comparison src/gpf/tst/drv/mux.h @ 0:4e78acac3d88

src/{condat,cs,gpf,nucleus}: import from Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:23:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4e78acac3d88
1 /*
2 +------------------------------------------------------------------------------
3 | File: mux.h
4 +------------------------------------------------------------------------------
5 | Copyright 2002 Texas Instruments Berlin, AG
6 | All rights reserved.
7 |
8 | This file is confidential and a trade secret of Texas
9 | Instruments Berlin, AG
10 | The receipt of or possession of this file does not convey
11 | any rights to reproduce or disclose its contents or to
12 | manufacture, use, or sell anything it may describe, in
13 | whole, or in part, without the specific written consent of
14 | Texas Instruments Berlin, AG.
15 +-----------------------------------------------------------------------------
16 | Purpose : Definitions for the Protocol Stack Entity mux.
17 +-----------------------------------------------------------------------------
18 */
19
20 #ifndef MUX_H
21 #define MUX_H
22
23 #ifndef _ENTITY_PREFIXED
24 #define _ENTITY_PREFIXED(N) tst_##N
25 #endif
26
27 /*==== INCLUDES =============================================================*/
28
29 #ifndef SAP_DTI2
30 #define SAP_DTI2
31 #endif
32
33 /*==== CONSTS ===============================================================*/
34
35 #define ENCODE_OFFSET 0 /* Bitoffset for encoding/decoding */
36 #define hCommYYY mux_hCommYYY /* Communication handle */
37
38 /* Timer definitions */
39 #define T001 0
40 #define T002 1
41
42 /* Timer durations */
43 #define T001_VALUE 1000 /* 1 second */
44 #define T002_VALUE 3000 /* 3 seconds */
45
46 /*
47 * information for dti library
48 */
49 #define MTST_DTI_DN_INTERFACE 0
50 #define MTST_DTI_DN_CHANNEL 0
51 #define MTST_DTI_DN_INSTANCE 0
52
53 /* make the pei_create, .. functions unique */
54 #define pei_create mux_pei_create
55
56 #define pei_dti_dti_connect_req _ENTITY_PREFIXED(pei_dti_dti_connect_req)
57 #define pei_dti_dti_connect_cnf _ENTITY_PREFIXED(pei_dti_dti_connect_cnf)
58 #define pei_dti_dti_connect_ind _ENTITY_PREFIXED(pei_dti_dti_connect_ind)
59 #define pei_dti_dti_connect_res _ENTITY_PREFIXED(pei_dti_dti_connect_res)
60 #define pei_dti_dti_disconnect_req _ENTITY_PREFIXED(pei_dti_dti_disconnect_req)
61 #define pei_dti_dti_disconnect_ind _ENTITY_PREFIXED(pei_dti_dti_disconnect_ind)
62 #define pei_dti_dti_ready_ind _ENTITY_PREFIXED(pei_dti_dti_ready_ind)
63 #define pei_dti_dti_data_req _ENTITY_PREFIXED(pei_dti_dti_data_req)
64 #define pei_dti_dti_data_ind _ENTITY_PREFIXED(pei_dti_dti_data_ind)
65 #define pei_dti_dti_getdata_req _ENTITY_PREFIXED(pei_dti_dti_getdata_req)
66 #ifdef _SIMULATION_
67 #define pei_dti_dti_data_test_req _ENTITY_PREFIXED(pei_dti_dti_data_test_req)
68 #define pei_dti_dti_data_test_ind _ENTITY_PREFIXED(pei_dti_dti_data_test_ind)
69 #endif /* _SIMLUATION_ */
70
71 #define pei_sig_callback \
72 _ENTITY_PREFIXED(pei_sig_callback )
73 #define sig_dti_pei_connection_opened_ind \
74 _ENTITY_PREFIXED(sig_dti_pei_connection_opened_ind)
75 #define sig_dti_pei_connection_closed_ind \
76 _ENTITY_PREFIXED(sig_dti_pei_connection_closed_ind)
77 #define sig_dti_pei_tx_buffer_full_ind \
78 _ENTITY_PREFIXED(sig_dti_pei_tx_buffer_full_ind )
79 #define sig_dti_pei_tx_buffer_ready_ind \
80 _ENTITY_PREFIXED(sig_dti_pei_tx_buffer_ready_ind )
81 #define sig_dti_pei_data_received_ind \
82 _ENTITY_PREFIXED(sig_dti_pei_data_received_ind )
83
84
85 #ifdef MUX_PEI_C
86 static const T_STR_IND tmr_name_to_ind[] =
87 {
88 { "T001", T001 },
89 { "T002", T002 },
90 { NULL, 0 }
91 };
92 #endif
93
94 #define MAX_SEND_BUF_COUNT 40
95
96 /*==== TYPES =================================================================*/
97
98 /* MUX global typedefs */
99
100 typedef struct
101 {
102 USHORT Handle;
103 UBYTE dti_state; /* state variable for dti library */
104 USHORT EnabledSignalType;
105 T_DRV_CB_FUNC Callback;
106 T_HANDLE h_comm_mtst;
107 char Connected;
108 T_desc2 *recv_data;
109 USHORT send_data_buf_count;
110 } T_MUX_DATA;
111
112 /*==== EXPORTS ===============================================================*/
113
114 short pei_create (T_PEI_INFO const **info);
115
116 /*
117 * wrapping functions for dtilib primitives
118 */
119
120 EXTERN const void pei_dti_dti_connect_ind (
121 T_DTI2_CONNECT_IND *dti_connect_ind);
122 EXTERN const void pei_dti_dti_connect_cnf (
123 T_DTI2_CONNECT_CNF *dti_connect_cnf);
124 EXTERN const void pei_dti_dti_disconnect_ind (
125 T_DTI2_DISCONNECT_IND *dti_disconnect_ind);
126 EXTERN const void pei_dti_dti_data_ind (
127 T_DTI2_DATA_IND *dti_data_ind);
128 EXTERN const void pei_dti_dti_ready_ind (
129 T_DTI2_READY_IND *dti_ready_ind);
130 #ifdef _SIMULATION_
131 EXTERN const void pei_dti_dti_data_test_ind (
132 T_DTI2_DATA_TEST_IND *dti_data_test_ind);
133 #endif /* _SIMULATION_ */
134
135 /*
136 * this function is called by DTILIB
137 */
138 EXTERN void pei_sig_callback
139 (
140 U8 instance,
141 U8 interfac,
142 U8 channel,
143 U8 reason,
144 T_DTI2_DATA_IND *dti_data2_ind
145 );
146
147 /*
148 * these functions are called by pei_sig_callback
149 */
150
151 EXTERN const void sig_dti_pei_connection_opened_ind();
152 EXTERN const void sig_dti_pei_connection_closed_ind();
153
154 EXTERN const void sig_dti_pei_tx_buffer_full_ind();
155 EXTERN const void sig_dti_pei_tx_buffer_ready_ind();
156
157 EXTERN const void sig_dti_pei_data_received_ind
158 (
159 T_DTI2_DATA_IND *dti_data_req
160 );
161
162
163
164 #ifdef MUX_PEI_C
165
166 /* Entity data base */
167 T_MUX_DATA mux_data;
168 /* DTI connection handle for DTI library */
169 DTI_HANDLE mtst_hDTI;
170
171 /* Communication handles */
172
173 #else /* MUX_PEI_C */
174
175 /* Entity data base */
176 extern T_MUX_DATA mux_data;
177 /* DTI connection handle for DTI library */
178 EXTERN DTI_HANDLE mtst_hDTI;
179
180 #endif /* MUX_PEI_C */
181
182 #endif /* !MUX_H */