amiro-os / modules / LightRing_1-2 / module.h @ 70dd091e
History | View | Annotate | Download (18.413 KB)
1 |
/*
|
---|---|
2 |
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
|
3 |
Copyright (C) 2016..2019 Thomas Schöpping et al.
|
4 |
|
5 |
This program is free software: you can redistribute it and/or modify
|
6 |
it under the terms of the GNU General Public License as published by
|
7 |
the Free Software Foundation, either version 3 of the License, or
|
8 |
(at your option) any later version.
|
9 |
|
10 |
This program is distributed in the hope that it will be useful,
|
11 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
GNU General Public License for more details.
|
14 |
|
15 |
You should have received a copy of the GNU General Public License
|
16 |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
17 |
*/
|
18 |
|
19 |
/**
|
20 |
* @file
|
21 |
* @brief Structures and constant for the LightRing module.
|
22 |
*
|
23 |
* @addtogroup lightring_module
|
24 |
* @{
|
25 |
*/
|
26 |
|
27 |
#ifndef AMIROOS_MODULE_H
|
28 |
#define AMIROOS_MODULE_H
|
29 |
|
30 |
#include <amiroos.h> |
31 |
|
32 |
/*===========================================================================*/
|
33 |
/**
|
34 |
* @name Module specific functions
|
35 |
* @{
|
36 |
*/
|
37 |
/*===========================================================================*/
|
38 |
|
39 |
|
40 |
#if defined(__cplusplus)
|
41 |
extern "C" { |
42 |
#endif /* defined(__cplusplus) */ |
43 |
|
44 |
#if (BOARD_DW1000_CONNECTED == true) |
45 |
void process_deca_irq(void); |
46 |
apalGpioState_t port_CheckEXT_IRQ(void) ;
|
47 |
#endif /* (BOARD_DW1000_CONNECTED == true) */ |
48 |
|
49 |
void set_SPI_chip_select(void); |
50 |
void clear_SPI_chip_select(void); |
51 |
void reset_DW1000(void); |
52 |
|
53 |
#if defined(__cplusplus)
|
54 |
} |
55 |
#endif /* defined(__cplusplus) */ |
56 |
|
57 |
/** @} */
|
58 |
|
59 |
/*===========================================================================*/
|
60 |
/**
|
61 |
* @name ChibiOS/HAL configuration
|
62 |
* @{
|
63 |
*/
|
64 |
/*===========================================================================*/
|
65 |
|
66 |
/**
|
67 |
* @brief CAN driver to use.
|
68 |
*/
|
69 |
#define MODULE_HAL_CAN CAND1
|
70 |
|
71 |
/**
|
72 |
* @brief Configuration for the CAN driver.
|
73 |
*/
|
74 |
extern CANConfig moduleHalCanConfig;
|
75 |
|
76 |
/**
|
77 |
* @brief I2C driver to access the EEPROM, power monitor and the breakout header.
|
78 |
*/
|
79 |
#define MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT I2CD2
|
80 |
|
81 |
/**
|
82 |
* @brief Configuration for the EEPROM, power monitor and breakout I2C driver.
|
83 |
*/
|
84 |
extern I2CConfig moduleHalI2cEepromPwrmtrBreakoutConfig;
|
85 |
|
86 |
/**
|
87 |
* @brief Serial driver of the programmer interface.
|
88 |
*/
|
89 |
#define MODULE_HAL_PROGIF SD1
|
90 |
|
91 |
/**
|
92 |
* @brief Configuration for the programmer serial interface driver.
|
93 |
*/
|
94 |
extern SerialConfig moduleHalProgIfConfig;
|
95 |
|
96 |
/**
|
97 |
* @brief SPI interface driver for the motion sensors (gyroscope and accelerometer).
|
98 |
*/
|
99 |
#define MODULE_HAL_SPI_LIGHT SPID1
|
100 |
|
101 |
/**
|
102 |
* @brief Configuration for the SPI interface driver to communicate with the LED driver.
|
103 |
*/
|
104 |
extern SPIConfig moduleHalSpiLightConfig;
|
105 |
|
106 |
#if (BOARD_DW1000_CONNECTED == true) |
107 |
/**
|
108 |
* @brief SPI interface driver for UWB DW1000 module.
|
109 |
*/
|
110 |
#define MODULE_HAL_SPI_UWB SPID2
|
111 |
|
112 |
/**
|
113 |
* @brief Configuration for the high-speed SPI interface driver of DW1000 module.
|
114 |
*/
|
115 |
extern SPIConfig moduleHalSpiUwbHsConfig;
|
116 |
|
117 |
/**
|
118 |
* @brief Configuration for the low-speed SPI interface driver of DW1000 module.
|
119 |
*/
|
120 |
extern SPIConfig moduleHalSpiUwbLsConfig;
|
121 |
|
122 |
#else
|
123 |
|
124 |
/**
|
125 |
* @brief SPI interface driver for the breakout header.
|
126 |
*/
|
127 |
#define MODULE_HAL_SPI_BREAKOUT SPID2
|
128 |
|
129 |
#endif /* BOARD_DW1000_CONNECTED == true*/ |
130 |
|
131 |
|
132 |
/**
|
133 |
* @brief UART interface driver for the breakout header (alternative to serial).
|
134 |
*/
|
135 |
#define MODULE_HAL_UART_BREAKOUT UARTD2
|
136 |
|
137 |
/**
|
138 |
* @brief Real-Time Clock driver.
|
139 |
*/
|
140 |
#define MODULE_HAL_RTC RTCD1
|
141 |
|
142 |
/** @} */
|
143 |
|
144 |
/*===========================================================================*/
|
145 |
/**
|
146 |
* @name GPIO definitions
|
147 |
* @{
|
148 |
*/
|
149 |
/*===========================================================================*/
|
150 |
|
151 |
/**
|
152 |
* @brief LIGHT_BANK output signal GPIO.
|
153 |
*/
|
154 |
extern ROMCONST apalControlGpio_t moduleGpioLightBlank;
|
155 |
|
156 |
/**
|
157 |
* @brief RS232_R_EN_N output signal GPIO.
|
158 |
*/
|
159 |
extern ROMCONST apalControlGpio_t moduleGpioRs232En;
|
160 |
|
161 |
/**
|
162 |
* @brief SW_V33_EN output signal GPIO.
|
163 |
*/
|
164 |
extern ROMCONST apalControlGpio_t moduleGpioSwV33En;
|
165 |
|
166 |
// The 4.2V switch is disabled due to a hardware bug.
|
167 |
///**
|
168 |
// * @brief SW_V42_EN output signal GPIO.
|
169 |
// */
|
170 |
//extern ROMCONST apalControlGpio_t moduleGpioSwV42En;
|
171 |
|
172 |
/**
|
173 |
* @brief SW_V50_EN output signal GPIO.
|
174 |
*/
|
175 |
extern ROMCONST apalControlGpio_t moduleGpioSwV50En;
|
176 |
|
177 |
/**
|
178 |
* @brief IO_3 breakout signal GPIO.
|
179 |
*/
|
180 |
extern apalControlGpio_t moduleGpioBreakoutIo3;
|
181 |
|
182 |
/**
|
183 |
* @brief IO_5 breakout signal GPIO.
|
184 |
*/
|
185 |
extern apalControlGpio_t moduleGpioBreakoutIo5;
|
186 |
|
187 |
/**
|
188 |
* @brief IO_6 breakout signal GPIO.
|
189 |
*/
|
190 |
extern apalControlGpio_t moduleGpioBreakoutIo6;
|
191 |
|
192 |
/**
|
193 |
* @brief SYS_UART_DN bidirectional signal GPIO.
|
194 |
*/
|
195 |
extern ROMCONST apalControlGpio_t moduleGpioSysUartDn;
|
196 |
|
197 |
/**
|
198 |
* @brief IO_4 breakout signal GPIO.
|
199 |
*/
|
200 |
extern apalControlGpio_t moduleGpioBreakoutIo4;
|
201 |
|
202 |
/**
|
203 |
* @brief IO_1 breakout signal GPIO.
|
204 |
*/
|
205 |
extern apalControlGpio_t moduleGpioBreakoutIo1;
|
206 |
|
207 |
/**
|
208 |
* @brief LED output signal GPIO.
|
209 |
*/
|
210 |
extern ROMCONST apalControlGpio_t moduleGpioLed;
|
211 |
|
212 |
/**
|
213 |
* @brief LIGHT_XLAT output signal.
|
214 |
*/
|
215 |
extern ROMCONST apalControlGpio_t moduleGpioLightXlat;
|
216 |
|
217 |
/**
|
218 |
* @brief SW_V18_EN output signal GPIO.
|
219 |
*/
|
220 |
extern ROMCONST apalControlGpio_t moduleGpioSwV18En;
|
221 |
|
222 |
/**
|
223 |
* @brief SW_VSYS_EN output signal GPIO.
|
224 |
*/
|
225 |
extern ROMCONST apalControlGpio_t moduleGpioSwVsysEn;
|
226 |
|
227 |
/**
|
228 |
* @brief SYS_UART_UP bidirectional signal GPIO.
|
229 |
*/
|
230 |
extern ROMCONST apalControlGpio_t moduleGpioSysUartUp;
|
231 |
|
232 |
/**
|
233 |
* @brief SYS_PD bidirectional signal GPIO.
|
234 |
*/
|
235 |
extern ROMCONST apalControlGpio_t moduleGpioSysPd;
|
236 |
|
237 |
/**
|
238 |
* @brief SYS_SYNC bidirectional signal GPIO.
|
239 |
*/
|
240 |
extern ROMCONST apalControlGpio_t moduleGpioSysSync;
|
241 |
|
242 |
#if (BOARD_DW1000_CONNECTED == true) |
243 |
/**
|
244 |
* @brief DW1000 reset output signal
|
245 |
* @note the reset pin should be drived as low by MCU to activate.
|
246 |
* Then, put back the reset pin as input to MCU (tri-state float on the air
|
247 |
* is not supported in AMiRo)
|
248 |
*/
|
249 |
extern ROMCONST apalControlGpio_t moduleGpioDw1000Reset;
|
250 |
|
251 |
/**
|
252 |
* @brief DW1000 wakeup signal
|
253 |
*/
|
254 |
extern ROMCONST apalControlGpio_t moduleGpioDw1000WakeUp;
|
255 |
|
256 |
/**
|
257 |
* @brief DW1000 interrupt IRQn input signal.
|
258 |
*/
|
259 |
extern ROMCONST apalControlGpio_t moduleGpioDw1000Irqn;
|
260 |
|
261 |
/**
|
262 |
* @brief DW1000 SPI chip select output signal.
|
263 |
*/
|
264 |
extern ROMCONST apalControlGpio_t moduleGpioSpiChipSelect ;
|
265 |
|
266 |
#else
|
267 |
/**
|
268 |
* @brief IO_2 breakout signal GPIO.
|
269 |
*/
|
270 |
extern apalControlGpio_t moduleGpioBreakoutIo2;
|
271 |
|
272 |
/**
|
273 |
* @brief IO_7 breakout signal GPIO.
|
274 |
*/
|
275 |
extern apalControlGpio_t moduleGpioBreakoutIo7;
|
276 |
|
277 |
/**
|
278 |
* @brief IO_8 breakout signal GPIO.
|
279 |
*/
|
280 |
extern apalControlGpio_t moduleGpioBreakoutIo8;
|
281 |
|
282 |
#endif /* BOARD_DW1000_CONNECTED == true */ |
283 |
|
284 |
/** @} */
|
285 |
|
286 |
/*===========================================================================*/
|
287 |
/**
|
288 |
* @name AMiRo-OS core configurations
|
289 |
* @{
|
290 |
*/
|
291 |
/*===========================================================================*/
|
292 |
|
293 |
/**
|
294 |
* @brief Event flag to be set on a IO_4 (breakout) interrupt.
|
295 |
*/
|
296 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO4 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_4))
|
297 |
|
298 |
/**
|
299 |
* @brief Event flag to be set on a IO_1 (breakout) interrupt.
|
300 |
*/
|
301 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO1 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_1))
|
302 |
|
303 |
/**
|
304 |
* @brief Event flag to be set on a SYS_SYNC interrupt.
|
305 |
*/
|
306 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
|
307 |
|
308 |
/**
|
309 |
* @brief Event flag to be set on a IO_3 (breakout) interrupt.
|
310 |
*/
|
311 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO3 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_3))
|
312 |
|
313 |
/**
|
314 |
* @brief Event flag to be set on a IO_5 (breakout) interrupt.
|
315 |
*/
|
316 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO5 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_5))
|
317 |
|
318 |
/**
|
319 |
* @brief Event flag to be set on a IO_6 (breakout) interrupt.
|
320 |
*/
|
321 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO6 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_6))
|
322 |
|
323 |
/**
|
324 |
* @brief Event flag to be set on a SYS_UART_DN interrupt.
|
325 |
*/
|
326 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
|
327 |
|
328 |
/**
|
329 |
* @brief Event flag to be set on a SYS_UART_UP interrupt.
|
330 |
*/
|
331 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
|
332 |
|
333 |
/**
|
334 |
* @brief Event flag to be set on a IO_7 (breakout) interrupt.
|
335 |
*/
|
336 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO7 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_7))
|
337 |
|
338 |
/**
|
339 |
* @brief Event flag to be set on a IO_8 (breakout) interrupt.
|
340 |
*/
|
341 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO8 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_8))
|
342 |
|
343 |
/**
|
344 |
* @brief Event flag to be set on a DW1000 interrupt.
|
345 |
*/
|
346 |
#define MODULE_OS_IOEVENTFLAGS_DW1000 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_8))
|
347 |
|
348 |
/**
|
349 |
* @brief Event flag to be set on a SYS_PD interrupt.
|
350 |
*/
|
351 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
|
352 |
|
353 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
354 |
/**
|
355 |
* @brief Shell prompt text.
|
356 |
*/
|
357 |
extern ROMCONST char* moduleShellPrompt; |
358 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */ |
359 |
|
360 |
/**
|
361 |
* @brief Interrupt initialization macro.
|
362 |
* @note SSSP related interrupt signals are already initialized in 'aos_system.c'.
|
363 |
*/
|
364 |
#define MODULE_INIT_INTERRUPTS() { \
|
365 |
/* breakout interrupts must be enabled explicitely */ \
|
366 |
MODULE_INIT_INTERRUPTS_DW1000(); \ |
367 |
} |
368 |
#if (BOARD_DW1000_CONNECTED == true) |
369 |
#define MODULE_INIT_INTERRUPTS_DW1000() { \
|
370 |
palSetLineCallback(moduleGpioDw1000Irqn.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioDw1000Irqn.gpio->line); \ |
371 |
palEnableLineEvent(moduleGpioDw1000Irqn.gpio->line, APAL2CH_EDGE(moduleGpioDw1000Irqn.meta.edge)); \ |
372 |
} |
373 |
#else /* (BOARD_DW1000_CONNECTED == true) */ |
374 |
#define MODULE_INIT_INTERRUPTS_DW1000() { \
|
375 |
} |
376 |
#endif /* (BOARD_DW1000_CONNECTED == true) */ |
377 |
|
378 |
/**
|
379 |
* @brief Unit test initialization hook.
|
380 |
*/
|
381 |
#define MODULE_INIT_TESTS() { \
|
382 |
/* initialize tests and add to shell */ \
|
383 |
aosShellAddCommand(&aos.shell, &moduleTestAt24c01bShellCmd); \ |
384 |
aosShellAddCommand(&aos.shell, &moduleTestIna219ShellCmd); \ |
385 |
aosShellAddCommand(&aos.shell, &moduleTestLedShellCmd); \ |
386 |
aosShellAddCommand(&aos.shell, &moduleTestMic9404xShellCmd); \ |
387 |
aosShellAddCommand(&aos.shell, &moduleTestTlc5947ShellCmd); \ |
388 |
aosShellAddCommand(&aos.shell, &moduleTestAllShellCmd); \ |
389 |
MODULE_INIT_TESTS_DW1000(); \ |
390 |
} |
391 |
#if (BOARD_DW1000_CONNECTED == true) |
392 |
#define MODULE_INIT_TESTS_DW1000() { \
|
393 |
aosShellAddCommand(&aos.shell, &moduleTestDw1000ShellCmd); \ |
394 |
} |
395 |
#else /* defined(AMIROLLD_CFG_DW1000) */ |
396 |
#define MODULE_INIT_TESTS_DW1000() { \
|
397 |
} |
398 |
#endif /* BOARD_DW1000_CONNECTED == true */ |
399 |
|
400 |
/**
|
401 |
* @brief Periphery communication interfaces initialization hook.
|
402 |
*/
|
403 |
#define MODULE_INIT_PERIPHERY_IF() { \
|
404 |
/* serial driver */ \
|
405 |
sdStart(&MODULE_HAL_PROGIF, &moduleHalProgIfConfig); \ |
406 |
/* I2C */ \
|
407 |
moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed = (AT24C01B_LLD_I2C_MAXFREQUENCY < moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed) ? AT24C01B_LLD_I2C_MAXFREQUENCY : moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed; \ |
408 |
moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed = (INA219_LLD_I2C_MAXFREQUENCY < moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed) ? INA219_LLD_I2C_MAXFREQUENCY : moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed; \ |
409 |
moduleHalI2cEepromPwrmtrBreakoutConfig.duty_cycle = (moduleHalI2cEepromPwrmtrBreakoutConfig.clock_speed <= 100000) ? STD_DUTY_CYCLE : FAST_DUTY_CYCLE_2; \
|
410 |
i2cStart(&MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT, &moduleHalI2cEepromPwrmtrBreakoutConfig); \ |
411 |
/* SPI */ \
|
412 |
spiStart(&MODULE_HAL_SPI_LIGHT, &moduleHalSpiLightConfig); \ |
413 |
MODULE_INIT_PERIPHERY_COMM_DW1000(); \ |
414 |
} |
415 |
#if (BOARD_DW1000_CONNECTED == true) |
416 |
#define MODULE_INIT_PERIPHERY_COMM_DW1000() { \
|
417 |
spiStart(&MODULE_HAL_SPI_UWB, &moduleHalSpiUwbLsConfig); \ |
418 |
} |
419 |
#else /* defined(AMIROLLD_CFG_DW1000) */ |
420 |
#define MODULE_INIT_PERIPHERY_COMM_DW1000() { \
|
421 |
} |
422 |
#endif /* BOARD_DW1000_CONNECTED == true */ |
423 |
|
424 |
/**
|
425 |
* @brief Periphery communication interface deinitialization hook.
|
426 |
*/
|
427 |
#define MODULE_SHUTDOWN_PERIPHERY_IF() { \
|
428 |
/* SPI */ \
|
429 |
spiStop(&MODULE_HAL_SPI_LIGHT); \ |
430 |
/* I2C */ \
|
431 |
i2cStop(&MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT); \ |
432 |
MODULE_SHUTDOWN_PERIPHERY_COMM_DW1000(); \ |
433 |
/* don't stop the serial driver so messages can still be printed */ \
|
434 |
} |
435 |
#if (BOARD_DW1000_CONNECTED == true) |
436 |
#define MODULE_SHUTDOWN_PERIPHERY_COMM_DW1000() { \
|
437 |
/* SPI */ \
|
438 |
spiStop(&MODULE_HAL_SPI_UWB); \ |
439 |
} |
440 |
#else /* defined(AMIROLLD_CFG_DW1000) */ |
441 |
#define MODULE_SHUTDOWN_PERIPHERY_COMM_DW1000() { \
|
442 |
} |
443 |
#endif /* BOARD_DW1000_CONNECTED == true */ |
444 |
|
445 |
|
446 |
/**
|
447 |
* @brief HOOK to call process_deca_irq() func when the dw1000 interrupt pin is activated.
|
448 |
*/
|
449 |
#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) { \
|
450 |
MODULE_MAIN_LOOP_IO_EVENT_DW1000(); \ |
451 |
} |
452 |
#if (BOARD_DW1000_CONNECTED == true) |
453 |
#define MODULE_MAIN_LOOP_IO_EVENT_DW1000() { \
|
454 |
if(eventflags & MODULE_OS_IOEVENTFLAGS_DW1000) { \
|
455 |
process_deca_irq(); \ |
456 |
} \ |
457 |
} |
458 |
#else /* defined(AMIROLLD_CFG_DW1000) */ |
459 |
#define MODULE_MAIN_LOOP_IO_EVENT_DW1000() { \
|
460 |
} |
461 |
#endif /* BOARD_DW1000_CONNECTED == true */ |
462 |
|
463 |
/** @} */
|
464 |
|
465 |
/*===========================================================================*/
|
466 |
/**
|
467 |
* @name Startup Shutdown Synchronization Protocol (SSSP)
|
468 |
* @{
|
469 |
*/
|
470 |
/*===========================================================================*/
|
471 |
|
472 |
/**
|
473 |
* @brief PD signal GPIO.
|
474 |
*/
|
475 |
#define moduleSsspGpioPd moduleGpioSysPd
|
476 |
|
477 |
/**
|
478 |
* @brief SYNC signal GPIO.
|
479 |
*/
|
480 |
#define moduleSsspGpioSync moduleGpioSysSync
|
481 |
|
482 |
/**
|
483 |
* @brief UP signal GPIO.
|
484 |
*/
|
485 |
#define moduleSsspGpioUp moduleGpioSysUartUp
|
486 |
|
487 |
/**
|
488 |
* @brief DN signal GPIO.
|
489 |
*/
|
490 |
#define moduleSsspGpioDn moduleGpioSysUartDn
|
491 |
|
492 |
/**
|
493 |
* @brief Event flags for PD signal events.
|
494 |
*/
|
495 |
#define MODULE_SSSP_EVENTFLAGS_PD MODULE_OS_IOEVENTFLAGS_SYSPD
|
496 |
|
497 |
/**
|
498 |
* @brief Event flags for SYNC signal events.
|
499 |
*/
|
500 |
#define MODULE_SSSP_EVENTFLAGS_SYNC MODULE_OS_IOEVENTFLAGS_SYSSYNC
|
501 |
|
502 |
/**
|
503 |
* @brief Event flags for UP signal events.
|
504 |
*/
|
505 |
#define MODULE_SSSP_EVENTFLAGS_UP MODULE_OS_IOEVENTFLAGS_SYSUARTUP
|
506 |
|
507 |
/**
|
508 |
* @brief Event flags for DN signal events.
|
509 |
*/
|
510 |
#define MODULE_SSSP_EVENTFLAGS_DN MODULE_OS_IOEVENTFLAGS_SYSUARTDN
|
511 |
|
512 |
/** @} */
|
513 |
|
514 |
/*===========================================================================*/
|
515 |
/**
|
516 |
* @name Low-level drivers
|
517 |
* @{
|
518 |
*/
|
519 |
/*===========================================================================*/
|
520 |
#include <alld_AT24C01B.h> |
521 |
#include <alld_INA219.h> |
522 |
#include <alld_LED.h> |
523 |
#include <alld_MIC9404x.h> |
524 |
// TODO: add SNx5C3221E
|
525 |
#include <alld_TLC5947.h> |
526 |
#include <alld_DW1000.h> |
527 |
|
528 |
/**
|
529 |
* @brief EEPROM driver.
|
530 |
*/
|
531 |
extern AT24C01BDriver moduleLldEeprom;
|
532 |
|
533 |
/**
|
534 |
* @brief Power monitor (VLED 4.2) driver.
|
535 |
*/
|
536 |
extern INA219Driver moduleLldPowerMonitorVled;
|
537 |
|
538 |
/**
|
539 |
* @brief Status LED driver.
|
540 |
*/
|
541 |
extern LEDDriver moduleLldStatusLed;
|
542 |
|
543 |
/**
|
544 |
* @brief Power switch driver (1.8V).
|
545 |
*/
|
546 |
extern MIC9404xDriver moduleLldPowerSwitchV18;
|
547 |
|
548 |
/**
|
549 |
* @brief Power switch driver (3.3V).
|
550 |
*/
|
551 |
extern MIC9404xDriver moduleLldPowerSwitchV33;
|
552 |
|
553 |
/**
|
554 |
* @brief Power switch driver (4.2V).
|
555 |
*/
|
556 |
extern MIC9404xDriver moduleLldPowerSwitchV42;
|
557 |
|
558 |
/**
|
559 |
* @brief Power switch driver (5.0V).
|
560 |
*/
|
561 |
extern MIC9404xDriver moduleLldPowerSwitchV50;
|
562 |
|
563 |
/**
|
564 |
* @brief Pseudo power switch driver (VSYS).
|
565 |
* @details There is no actual MIC9040x device, but the swicthable circuit behaves analogous.
|
566 |
*/
|
567 |
extern MIC9404xDriver moduleLldPowerSwitchVsys;
|
568 |
|
569 |
// TODO: add SNx5C3221E
|
570 |
|
571 |
/**
|
572 |
* @brief 24 channel PWM LED driver.
|
573 |
*/
|
574 |
extern TLC5947Driver moduleLldLedPwm;
|
575 |
|
576 |
/**
|
577 |
* @brief DW1000 driver.
|
578 |
*/
|
579 |
void setHighSpeed_SPI(bool speedValue, DW1000Driver* drv); |
580 |
#if (BOARD_DW1000_CONNECTED == true) |
581 |
extern DW1000Driver moduleLldDw1000;
|
582 |
extern MIC9404xDriver moduleLldPowerSwitchDw1000;
|
583 |
#endif /* (BOARD_DW1000_CONNECTED == true) */ |
584 |
|
585 |
/** @} */
|
586 |
|
587 |
/*===========================================================================*/
|
588 |
/**
|
589 |
* @name Tests
|
590 |
* @{
|
591 |
*/
|
592 |
/*===========================================================================*/
|
593 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
594 |
|
595 |
/**
|
596 |
* @brief AT24C01BN-SH-B (EEPROM) test command.
|
597 |
*/
|
598 |
extern aos_shellcommand_t moduleTestAt24c01bShellCmd;
|
599 |
|
600 |
/**
|
601 |
* @brief INA219 (power monitor) test command.
|
602 |
*/
|
603 |
extern aos_shellcommand_t moduleTestIna219ShellCmd;
|
604 |
|
605 |
/**
|
606 |
* @brief Status LED test command.
|
607 |
*/
|
608 |
extern aos_shellcommand_t moduleTestLedShellCmd;
|
609 |
|
610 |
/**
|
611 |
* @brief MIC9404x (power switch) test command.
|
612 |
*/
|
613 |
extern aos_shellcommand_t moduleTestMic9404xShellCmd;
|
614 |
|
615 |
// TODO: add SNx5C3221E
|
616 |
|
617 |
/**
|
618 |
* @brief TLC5947 (24 channel PWM LED driver) test command.
|
619 |
*/
|
620 |
extern aos_shellcommand_t moduleTestTlc5947ShellCmd;
|
621 |
|
622 |
/**
|
623 |
* @brief Entire module test command.
|
624 |
*/
|
625 |
extern aos_shellcommand_t moduleTestAllShellCmd;
|
626 |
|
627 |
|
628 |
#if (BOARD_DW1000_CONNECTED == true) |
629 |
/**
|
630 |
* @brief DW1000 (UWB transmitter) test command.
|
631 |
*/
|
632 |
extern aos_shellcommand_t moduleTestDw1000ShellCmd;
|
633 |
#endif /* (BOARD_DW1000_CONNECTED == true) */ |
634 |
|
635 |
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */ |
636 |
|
637 |
/** @} */
|
638 |
|
639 |
#endif /* AMIROOS_MODULE_H */ |
640 |
|
641 |
/** @} */
|