comparison src/cs/services/atp/atp_uart_api.h @ 0:92470e5d0b9e

src: partial import from FC Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 15 May 2020 01:28:16 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:92470e5d0b9e
1 /********************************************************************************/
2 /* */
3 /* File Name: atp_uart_api.h */
4 /* */
5 /* Purpose: This header file contains the external constants and */
6 /* prototypes related to the ATP-UART interface. */
7 /* */
8 /* Note: None. */
9 /* */
10 /* Revision History: */
11 /* 10/04/01 Pascal Pompei */
12 /* - Create. */
13 /* */
14 /* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved. */
15 /* */
16 /********************************************************************************/
17 #ifndef _ATP_UART_API_
18 #define _ATP_UART_API_
19
20 #include "rv/rv_general.h"
21
22 #ifdef __cplusplus
23 extern "C"
24 {
25 #endif
26
27
28 /**************************** ATP-UART INTERFACE NAME ***************************/
29 /* */
30 /* Define the name assigned to the ATP-UART interface. */
31 #define ATP_UART_NAME ("ATP-UART")
32
33
34 /***************************** INTERNAL ERROR CODES *****************************/
35 /* */
36 /* Define the internal error codes. */
37 typedef T_RV_RET T_ATP_UART_ERROR_CODES;
38
39
40 /********************************** EVENTS MASK *********************************/
41 /* */
42 /* Define a mask used to uniquely identify the events associated with the */
43 /* ATP-UART interface. */
44 #define ATP_UART_EVENTS_MASK (0x8000)
45
46
47 /******************************* COM PORT SETTINGS ******************************/
48 /* */
49 /* Define the COM port number. */
50 typedef enum
51 {
52 ATP_UART_COM_PORT_1 = 0x00000001,
53 ATP_UART_COM_PORT_2,
54 ATP_UART_COM_PORT_3,
55 ATP_UART_COM_PORT_4
56 } T_ATP_UART_COM_PORT;
57
58 /* Define the baud rate (in bits per second). */
59 typedef enum
60 {
61 ATP_UART_BAUD_RATE_9600 = 9600,
62 ATP_UART_BAUD_RATE_19200 = 19200,
63 ATP_UART_BAUD_RATE_38400 = 38400,
64 ATP_UART_BAUD_RATE_57600 = 57600,
65 ATP_UART_BAUD_RATE_115200 = 115200
66 } T_ATP_UART_BAUD_RATE;
67
68
69 /****************************** COM PORT ACTIVATION *****************************/
70 /* */
71 /* Define a structure used to instruct the ATP-UART interface to open the COM */
72 /* port. */
73 /* */
74 /* Opcode: ATP_UART_OPEN_COM_PORT. */
75 #define ATP_UART_OPEN_COM_PORT (0x001C | ATP_UART_EVENTS_MASK)
76
77 typedef struct
78 {
79 T_RV_HDR os_header;
80 T_ATP_UART_COM_PORT com_port;
81 T_ATP_UART_BAUD_RATE baud_rate;
82 } T_ATP_UART_OPEN_COM_PORT;
83
84
85 /******************************** GSM ACTIVATION ********************************/
86 /* */
87 /* Define a structure used to instruct the ATP-UART interface to initiate using */
88 /* the GSM protocol stack. */
89 /* */
90 /* Opcode: ATP_UART_START_GSM. */
91 #define ATP_UART_START_GSM (0x002C | ATP_UART_EVENTS_MASK)
92
93 typedef struct
94 {
95 T_RV_HDR os_header;
96 } T_ATP_UART_START_GSM;
97
98
99 /*************************** LOCAL FUNCTION PROTOTYPES **************************/
100 /* */
101 /* Define the local fonction prototypes. */
102 T_ATP_UART_ERROR_CODES atp_uart_open_com_port (T_ATP_UART_COM_PORT com_port,
103 T_ATP_UART_BAUD_RATE baud_rate);
104
105 T_ATP_UART_ERROR_CODES atp_uart_start_gsm (void);
106
107 #ifdef __cplusplus
108 }
109 #endif
110
111 #endif