comparison src/g23m-aci/gdd_dio/gdd_dio_con_mgr.h @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
1 /*
2 +-----------------------------------------------------------------------------
3 | File : gdd_dio_con_mgr.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 : Connecion handling functions of the DIO BAT adapter
17 | These functions form the interface of the connection manager,
18 | whose responsability is to create DIO connections, assign
19 | device numbers, etc.
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef GDD_DIO_CON_MGR_H
24 #define GDD_DIO_CON_MGR_H
25
26 /*
27 +------------------------------------------------------------------------------
28 | Function : gdd_dio_con_mgr_init
29 +------------------------------------------------------------------------------
30 | Description : Initializes the connection manager
31 |
32 | Parameters : -
33 |
34 +------------------------------------------------------------------------------
35 */
36 EXTERN void gdd_dio_con_mgr_init
37 (
38 T_GDD_DIO_DATA * gdd_dio_data
39 );
40
41 /*
42 +------------------------------------------------------------------------------
43 | Function : gdd_dio_con_mgr_new
44 +------------------------------------------------------------------------------
45 | Description : Create a new DIO connection
46 |
47 | Assumptions : gdd_dio_data->ker.state EQ GDD_DIO_KER_READY
48 | && gdd_dio_init_flag[inst] EQ TRUE
49 |
50 | Parameters : gdd_dio_data - pointer to instance data
51 | con_handle - output value: new conn. handle
52 | cap - capabilities required
53 | rcv_cb - receive callback
54 | sig_cb - signal callback
55 |
56 | Returns : GDD_OK - Connection succesfully created
57 | GDD_NO_CONNECTION_SLOT - Connection failed because we
58 | have already the max. number of
59 | connections.
60 +------------------------------------------------------------------------------
61 */
62 EXTERN GDD_RESULT gdd_dio_con_mgr_new
63 (
64 T_GDD_DIO_DATA * gdd_dio_data,
65 T_GDD_CON_HANDLE * con_handle,
66 const T_GDD_CAP * cap,
67 T_GDD_RECEIVE_DATA_CB rcv_cb,
68 T_GDD_SIGNAL_CB sig_cb
69 );
70
71
72 /*
73 +------------------------------------------------------------------------------
74 | Function : gdd_dio_con_mgr_close
75 +------------------------------------------------------------------------------
76 | Description : Close a connection
77 |
78 | Parameters : con_handle - connection handle
79 |
80 | Returns : GDD_OK - Connection succesfully created
81 | >GDD_OK - Error
82 +------------------------------------------------------------------------------
83 */
84 EXTERN GDD_RESULT gdd_dio_con_mgr_close( T_GDD_CON_HANDLE con_handle );
85
86
87 /*
88 +------------------------------------------------------------------------------
89 | Function : gdd_dio_con_mgr_close
90 +------------------------------------------------------------------------------
91 | Description : Mark a connection as dead
92 |
93 | Parameters : con_handle - connection handle
94 |
95 | Returns : GDD_OK - OK
96 | >GDD_OK - Error
97 +------------------------------------------------------------------------------
98 */
99 EXTERN GDD_RESULT gdd_dio_con_mgr_mark_dead( T_GDD_CON_HANDLE con_handle );
100
101
102
103 /*
104 +------------------------------------------------------------------------------
105 | Function : gdd_dio_con_mgr_has_open_connection
106 +------------------------------------------------------------------------------
107 | Description : Check if any of the connections is (still) open or in
108 | connecting state.
109 |
110 | Returns : TRUE - At least one connection is open
111 | FALSE - None of the connections is open
112 +------------------------------------------------------------------------------
113 */
114 BOOL gdd_dio_con_mgr_has_open_connection( const T_GDD_DIO_DATA * gdd_dio_data );
115
116
117 /*
118 +------------------------------------------------------------------------------
119 | Function : get_con_data
120 +------------------------------------------------------------------------------
121 | Description : Get the connection data for a given instance & handle
122 |
123 | Parameters : gdd_dio_data - pointer to instance data
124 | con_handle - output value: new conn. handle
125 |
126 | Returns : NULL - Connection not found / invalid handle
127 | NOT NULL - pointer to connection
128 +------------------------------------------------------------------------------
129 */
130 EXTERN T_GDD_DIO_CON_DATA * get_con_data
131 (
132 const T_GDD_DIO_DATA * gdd_dio_data,
133 T_GDD_CON_HANDLE con_handle
134 );
135
136
137 /*
138 +------------------------------------------------------------------------------
139 | Function : get_con_data_from_handle
140 +------------------------------------------------------------------------------
141 | Description : Get the connection data for a given andle
142 |
143 | Parameters : con_handle - output value: new conn. handle
144 |
145 | Returns : NULL - Connection not found / invalid handle
146 | NOT NULL - pointer to connection
147 +------------------------------------------------------------------------------
148 */
149 EXTERN T_GDD_DIO_CON_DATA * get_con_data_from_handle(T_GDD_CON_HANDLE con_handle);
150
151
152 /*
153 +------------------------------------------------------------------------------
154 | Function : gdd_dio_send_signal_to_dio
155 +------------------------------------------------------------------------------
156 | Description : Send a DIO signal via the specificed connection
157 |
158 | Parameters : con_data - pointer to the connection data
159 | sig_type - Signal type
160 +------------------------------------------------------------------------------
161 */
162 EXTERN void gdd_dio_send_signal_to_dio(T_GDD_DIO_CON_DATA * con_data, U16 sig_type);
163
164
165 #endif /* !GDD_DIO_CON_MGR_H */
166