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

src/g23m-*: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:40:46 +0000
parents
children
comparison
equal deleted inserted replaced
0:b6a5e36de839 1:d393cd9bb723
1 /*
2 +------------------------------------------------------------------------------
3 | File: gdd_dio.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 gdd_dio.
17 +-----------------------------------------------------------------------------
18 */
19
20 #ifndef GDD_DIO_H
21 #define GDD_DIO_H
22
23 /*==== INCLUDES =============================================================*/
24
25 #include "gdd_dio_data.h"
26
27 /*==== CONSTS ===============================================================*/
28
29 #define VSI_CALLER GDD_DIO_handle,
30 #define ENTITY_DATA gdd_dio_data
31
32 #define ENCODE_OFFSET 0 /* Bitoffset for encoding/decoding */
33 #define hCommGDD_DIO gdd_dio_hCommGDD_DIO /* Communication handle */
34
35 /* Timer definitions */
36 #define T001 0
37 #define T002 1
38
39 /* Timer durations */
40 #define T001_VALUE 1000 /* 1 second */
41 #define T002_VALUE 3000 /* 3 seconds */
42
43 /* -------------- Trace classes specific to GDD_DIO entity -----------------*/
44
45 /* Trace class user 1 is used for tracing GDD and DIO signals */
46 #define TC_SIGNALS TC_USER1
47 /* Trace class user 2 is used for function traces of the function which are
48 involved in the actual data flow. Since we expect these to be hit
49 frequently, this special trace class has been created. */
50 #define TC_FUNC_DATA_FLOW TC_USER2
51
52 /* Trace class user 3 is for all functions in the "gdd_sys.h" header */
53 #define TC_SYS_INTERFACE TC_USER3
54
55
56 /* Set the following #define if a context switch in DTX is to be made.
57 (i.e. a context switch to avoid calling a client into PSI */
58 /*#define GDD_MAKE_DTX_CONTEXT_SWITCH*/
59
60 #ifdef GDD_MAKE_DTX_CONTEXT_SWITCH
61 /** Signals (internal to this entity)
62 * The signal must also carry the connection handle, which is stored
63 * in bit 7. This means that we currently limit our device range to 0..127
64 */
65 #define GDD_DIO_SIGNAL_SEND_DATA 0x00000000
66 #define GDD_DIO_SIGNAL_RECEIVE_DATA 0x00000080
67
68 #define GDD_DIO_SIGNAL_MASK 0x00000080
69 #define GDD_DIO_SIGNAL_CON_HANDLE_MASK 0xFFFFFF7F
70 #endif /* GDD_MAKE_DTX_CONTEXT_SWITCH */
71
72 typedef struct
73 {
74 T_GDD_BUF * buf;
75 T_GDD_CON_HANDLE con_handle;
76 } T_GDD_DIO_SIGNAL_DATA;
77
78
79 /*==== TYPES =================================================================*/
80
81 /* GDD_DIO global typedefs */
82
83 typedef struct /* T_GDD_DIO_DATA */
84 {
85 /* Kernel service data */
86 T_GDD_DIO_KER_DATA ker;
87
88 /** Connection service data array (one structure for each connection) */
89 T_GDD_DIO_CON_DATA * con_arr;
90
91 /** Flag set when the con_arr memory was allocated in this entity */
92 BOOL con_arr_mem_allocated;
93
94 /** Max number of connections that client wishes to open */
95 U16 max_con;
96
97 /** External instnace id - passed in when calling gdd_init. */
98 T_GDD_INST_ID inst_id;
99
100 /** DIO driver number */
101 T_GDD_DIO_DRV_NUM drv_num;
102
103 /** DIO device range start (0 if not yet initialized by DIO IL) */
104 U32 device_range_start;
105
106 /** DIO device range end (0 if not yet initialized by DIO IL) */
107 U32 device_range_end;
108
109 /** DIO driver handle */
110 U16 drv_handle;
111
112 /** DIO callback */
113 T_DRV_CB_FUNC signal_callback;
114
115
116 } T_GDD_DIO_DATA;
117
118 /*==== EXPORTS ===============================================================*/
119
120 short pei_create (T_PEI_INFO **info);
121
122 #ifdef GDD_DIO_PEI_C
123
124 /* Entity data base */
125 T_GDD_DIO_DATA gdd_dio_data_base [GDD_NUM_INSTS];
126 BOOL gdd_dio_init_flag [GDD_NUM_INSTS];
127
128 /* Communication handles */
129 T_HANDLE hCommGDD_DIO = VSI_ERROR;
130 T_HANDLE GDD_DIO_handle;
131
132 #else /* GDD_DIO_PEI_C */
133
134 extern T_GDD_DIO_DATA gdd_dio_data_base [];
135 extern BOOL gdd_dio_init_flag [];
136 extern T_HANDLE hCommGDD_DIO;
137 extern T_HANDLE GDD_DIO_handle;
138
139 #endif /* GDD_DIO_PEI_C */
140
141 #endif /* !GDD_DIO_H */