Sonochan II 0.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
HW.h
Go to the documentation of this file.
1
18 #ifndef _HW_H_
19 #define _HW_H_
20
21 //============================| Configure tables |=============================
22
43 #define DEVICE0 BRD_DRV_metadata
45 #include "brd_driver_hw_03.h"
46
48 #include "tlv320aic33.h"
49 #define DEVICE1 TLV320AIC33_metadata
50
52 #include "cs2200.h"
53 #define DEVICE2 CS2200_metadata
54
56
57 //================================| Includes |=================================
58 #include <inttypes.h>
59
60 // Include also lower layer - generic driver
61 #include "generic_driver.h"
62
63
64 //=================================| Macros |==================================
65 #ifndef DEVICE0
66 #error "At least one device MUST be defined! Please set constant DEVICE0 at\
67 .h file, where value is name of variable where are stored metadata.\
68 Example: #define DEVICE0 TLV320AIC23_metadata"
69 // And Add default values, so no other compiler errors should shown
70 #define HW_MAX_DEVICE_ID 0
71 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0
72
73 #endif
74 #ifdef DEVICE10
75 #error "Sorry. Driver support only 10 devices. If you need more, then edit .h\
76 file"
77 // And Add default values, so no other compiler errors should shown
78 #define HW_MAX_DEVICE_ID 0
79 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0
80 #endif
81
82
83 #ifdef DEVICE9
84 #define HW_MAX_DEVICE_ID 9
85 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0,\
86 (gd_metadata*)&DEVICE1,\
87 (gd_metadata*)&DEVICE2,\
88 (gd_metadata*)&DEVICE3,\
89 (gd_metadata*)&DEVICE4,\
90 (gd_metadata*)&DEVICE5,\
91 (gd_metadata*)&DEVICE6,\
92 (gd_metadata*)&DEVICE7,\
93 (gd_metadata*)&DEVICE8,\
94 (gd_metadata*)&DEVICE9
95 #else
96 #ifdef DEVICE8
97 #define HW_MAX_DEVICE_ID 8
98 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0,\
99 (gd_metadata*)&DEVICE1,\
100 (gd_metadata*)&DEVICE2,\
101 (gd_metadata*)&DEVICE3,\
102 (gd_metadata*)&DEVICE4,\
103 (gd_metadata*)&DEVICE5,\
104 (gd_metadata*)&DEVICE6,\
105 (gd_metadata*)&DEVICE7,\
106 (gd_metadata*)&DEVICE8
107 #else
108 #ifdef DEVICE7
109 #define HW_MAX_DEVICE_ID 7
110 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0,\
111 (gd_metadata*)&DEVICE1,\
112 (gd_metadata*)&DEVICE2,\
113 (gd_metadata*)&DEVICE3,\
114 (gd_metadata*)&DEVICE4,\
115 (gd_metadata*)&DEVICE5,\
116 (gd_metadata*)&DEVICE6,\
117 (gd_metadata*)&DEVICE7
118 #else
119 #ifdef DEVICE6
120 #define HW_MAX_DEVICE_ID 6
121 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0,\
122 (gd_metadata*)&DEVICE1,\
123 (gd_metadata*)&DEVICE2,\
124 (gd_metadata*)&DEVICE3,\
125 (gd_metadata*)&DEVICE4,\
126 (gd_metadata*)&DEVICE5,\
127 (gd_metadata*)&DEVICE6
128 #else
129 #ifdef DEVICE5
130 #define HW_MAX_DEVICE_ID 5
131 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0,\
132 (gd_metadata*)&DEVICE1,\
133 (gd_metadata*)&DEVICE2,\
134 (gd_metadata*)&DEVICE3,\
135 (gd_metadata*)&DEVICE4,\
136 (gd_metadata*)&DEVICE5
137 #else
138 #ifdef DEVICE4
139 #define HW_MAX_DEVICE_ID 4
140 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0,\
141 (gd_metadata*)&DEVICE1,\
142 (gd_metadata*)&DEVICE2,\
143 (gd_metadata*)&DEVICE3,\
144 (gd_metadata*)&DEVICE4
145 #else
146 #ifdef DEVICE3
147 #define HW_MAX_DEVICE_ID 3
148 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0,\
149 (gd_metadata*)&DEVICE1,\
150 (gd_metadata*)&DEVICE2,\
151 (gd_metadata*)&DEVICE3
152 #else
153 #ifdef DEVICE2
154 #define HW_MAX_DEVICE_ID 2
155 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0,\
156 (gd_metadata*)&DEVICE1,\
157 (gd_metadata*)&DEVICE2
158 #else
159 #ifdef DEVICE1
160 #define HW_MAX_DEVICE_ID 1
161 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0,\
162 (gd_metadata*)&DEVICE1
163 #else
164 #ifdef DEVICE0
165 #define HW_MAX_DEVICE_ID 0
166 #define HW_POINTER_ARRAY_TO_METADATA (gd_metadata*)&DEVICE0
167 #endif
168 #endif
169 #endif
170 #endif
171 #endif
172 #endif
173 #endif
174 #endif
175 #endif
176 #endif
177
178
179 //===========================| Function prototypes |===========================
180
181 // Basic functions
182 GD_RES_CODE hw_get_setting(
183 uint8_t i_device_ID,
184 uint16_t i_cmd_ID,
185 gd_config_struct *p_config_table);
186
187 GD_RES_CODE hw_set_setting(
188 uint8_t i_device_ID,
189 uint16_t i_cmd_ID,
190 GD_DATA_VALUE i_data);
191
192 GD_RES_CODE hw_get_device_metadata(
193 uint8_t i_device_ID,
194 gd_metadata **p_device_metadata);
195
196 uint8_t hw_get_max_device_index(void);
197 #endif