Revision 960338cc modules/RT-STM32L476RG-NUCLEO64/module.h
modules/RT-STM32L476RG-NUCLEO64/module.h | ||
---|---|---|
72 | 72 |
#include <hal.h> |
73 | 73 |
|
74 | 74 |
/** |
75 |
* @brief ADC driver for reading the system voltage. |
|
76 |
*/ |
|
77 |
#define MODULE_HAL_ADC_VSYS ADCD1 |
|
78 |
|
|
79 |
/** |
|
80 |
* @brief Configuration for the ADC. |
|
81 |
*/ |
|
82 |
//extern ADCConversionGroup moduleHalAdcVsysConversionGroup; |
|
83 |
|
|
84 |
/** |
|
85 | 75 |
* @brief CAN driver to use. |
86 | 76 |
*/ |
87 | 77 |
#define MODULE_HAL_CAN CAND1 |
... | ... | |
92 | 82 |
extern CANConfig moduleHalCanConfig; |
93 | 83 |
|
94 | 84 |
/** |
95 |
* @brief I2C driver to access multiplexer, proximity sensors 1 to 4, power monitors for VIO1.8 and VIO 3.3, and fuel gauge (rear battery). |
|
96 |
*/ |
|
97 |
//#define MODULE_HAL_I2C_PROX_PM18_PM33_GAUGEREAR I2CD1 |
|
98 |
|
|
99 |
/** |
|
100 |
* @brief Configuration for the multiplexer, proximity sensors 1 to 4, power monitors for VIO1.8 and VIO 3.3, and fuel gauge (rear battery) I2C driver. |
|
101 |
*/ |
|
102 |
//extern I2CConfig moduleHalI2cProxPm18Pm33GaugeRearConfig; |
|
103 |
|
|
104 |
/** |
|
105 |
* @brief I2C driver to access multiplexer, proximity sensors 5 to 8, power monitors for VSYS4.2, VIO 5.0 and VDD, EEPROM, touch sensor, and fuel gauge (front battery). |
|
106 |
*/ |
|
107 |
#define MODULE_HAL_I2C_PROX_PM42_PM50_PMVDD_EEPROM_TOUCH_GAUGEFRONT I2CD2 |
|
108 |
|
|
109 |
/** |
|
110 |
* @brief Configuration for the multiplexer, proximity sensors 1 to 4, power monitors for VIO1.8 and VIO 3.3, and fuel gauge (rear battery) I2C driver. |
|
111 |
*/ |
|
112 |
//extern I2CConfig moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig; |
|
113 |
|
|
114 |
/** |
|
115 |
* @brief PWM driver for the buzzer. |
|
116 |
*/ |
|
117 |
//#define MODULE_HAL_PWM_BUZZER PWMD3 |
|
118 |
|
|
119 |
/** |
|
120 |
* @brief Configuration of the PWM driver. |
|
121 |
*/ |
|
122 |
//extern PWMConfig moduleHalPwmBuzzerConfig; |
|
123 |
|
|
124 |
/** |
|
125 |
* @brief PWM channeƶ for the buzzer. |
|
126 |
*/ |
|
127 |
//#define MODULE_HAL_PWM_BUZZER_CHANNEL 1 |
|
128 |
|
|
129 |
/** |
|
130 | 85 |
* @brief Serial driver of the programmer interface. |
131 | 86 |
*/ |
132 | 87 |
#define MODULE_HAL_PROGIF SD2 |
... | ... | |
172 | 127 |
extern ROMCONST apalControlGpio_t moduleGpioSysUartDn; |
173 | 128 |
|
174 | 129 |
/** |
175 |
* @brief CHARGE_STAT2A input signal GPIO. |
|
176 |
*/ |
|
177 |
extern ROMCONST apalControlGpio_t moduleGpioChargeStat2A; |
|
178 |
|
|
179 |
/** |
|
180 |
* @brief GAUGE_BATLOW2 input signal GPIO. |
|
181 |
*/ |
|
182 |
extern ROMCONST apalControlGpio_t moduleGpioGaugeBatLow2; |
|
183 |
|
|
184 |
/** |
|
185 |
* @brief GAUGE_BATGD2 input signal GPIO. |
|
186 |
*/ |
|
187 |
extern ROMCONST apalControlGpio_t moduleGpioGaugeBatGd2; |
|
188 |
|
|
189 |
/** |
|
190 | 130 |
* @brief LED output signal GPIO. |
191 | 131 |
*/ |
192 | 132 |
extern ROMCONST apalControlGpio_t moduleGpioLed; |
... | ... | |
197 | 137 |
extern ROMCONST apalControlGpio_t moduleGpioSysUartUp; |
198 | 138 |
|
199 | 139 |
/** |
200 |
* @brief CHARGE_STAT1A input signal GPIO. |
|
201 |
*/ |
|
202 |
extern ROMCONST apalControlGpio_t moduleGpioChargeStat1A; |
|
203 |
|
|
204 |
/** |
|
205 |
* @brief GAUGE_BATLOW1 input signal GPIO. |
|
206 |
*/ |
|
207 |
extern ROMCONST apalControlGpio_t moduleGpioGaugeBatLow1; |
|
208 |
|
|
209 |
/** |
|
210 |
* @brief GAUGE_BATGD1 input signal GPIO. |
|
211 |
*/ |
|
212 |
extern ROMCONST apalControlGpio_t moduleGpioGaugeBatGd1; |
|
213 |
|
|
214 |
/** |
|
215 |
* @brief CHARG_EN1 output signal GPIO. |
|
216 |
*/ |
|
217 |
extern ROMCONST apalControlGpio_t moduleGpioChargeEn1; |
|
218 |
|
|
219 |
/** |
|
220 | 140 |
* @brief IR_INT2 input signal GPIO. |
221 | 141 |
*/ |
222 | 142 |
extern ROMCONST apalControlGpio_t moduleGpioIrInt2; |
... | ... | |
266 | 186 |
*/ |
267 | 187 |
extern ROMCONST apalControlGpio_t moduleGpioBtRst; |
268 | 188 |
|
269 |
/** |
|
270 |
* @brief CHARGE_EN2 output signal GPIO. |
|
271 |
*/ |
|
272 |
extern ROMCONST apalControlGpio_t moduleGpioChargeEn2; |
|
273 | 189 |
|
274 | 190 |
/** @} */ |
275 | 191 |
|
... | ... | |
285 | 201 |
*/ |
286 | 202 |
#define MODULE_OS_IOEVENTFLAGS_IRINT1 ((eventflags_t)1 << GPIOB_IR_INT1_N) |
287 | 203 |
|
288 |
/** |
|
289 |
* @brief Event flag to be set on a GAUGE_BATLOW1 interrupt. |
|
290 |
*/ |
|
291 |
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATLOW1 ((eventflags_t)1 << GPIOC_GAUGE_BATLOW1) |
|
292 |
|
|
293 |
/** |
|
294 |
* @brief Event flag to be set on a GAUGE_BATGD1 interrupt. |
|
295 |
*/ |
|
296 |
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATGD1 ((eventflags_t)1 << GPIOC_GAUGE_BATGD1_N) |
|
297 | 204 |
|
298 | 205 |
/** |
299 | 206 |
* @brief Event flag to be set on a SYS_UART_DN interrupt. |
300 | 207 |
*/ |
301 | 208 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN ((eventflags_t)1 << GPIOB_SYS_UART_DN) |
302 | 209 |
|
303 |
/** |
|
304 |
* @brief Event flag to be set on a IR_INT2 / CHARGE_STAT2A interrupt. |
|
305 |
*/ |
|
306 |
#define MODULE_OS_IOEVENTFLAGS_IRINT2 ((eventflags_t)1 << GPIOC_IR_INT2_N) |
|
307 | 210 |
|
308 | 211 |
/** |
309 | 212 |
* @brief Event flag to be set on a TOUCH_INT interrupt. |
310 | 213 |
*/ |
311 | 214 |
#define MODULE_OS_IOEVENTFLAGS_TOUCHINT ((eventflags_t)1 << GPIOC_TOUCH_INT_N) |
312 | 215 |
|
313 |
/** |
|
314 |
* @brief Event flag to be set on a GAUGE_BATLOW2 interrupt. |
|
315 |
*/ |
|
316 |
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATLOW2 ((eventflags_t)1 << GPIOB_GAUGE_BATLOW2) |
|
317 |
|
|
318 |
/** |
|
319 |
* @brief Event flag to be set on a GAUGE_BATGD2 interrupt. |
|
320 |
*/ |
|
321 |
#define MODULE_OS_IOEVENTFLAGS_GAUGEBATGD2 ((eventflags_t)1 << GPIOB_GAUGE_BATGD2_N) |
|
322 | 216 |
|
323 | 217 |
/** |
324 | 218 |
* @brief Event flag to be set on a PATH_DC interrupt. |
... | ... | |
357 | 251 |
extern ROMCONST char* moduleShellPrompt; |
358 | 252 |
#endif |
359 | 253 |
|
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 |
/* IR_INT1 */ \ |
|
366 |
palSetPadCallback(moduleGpioIrInt1.gpio->port, moduleGpioIrInt1.gpio->pad, _intCallback, &moduleGpioIrInt1.gpio->pad); \ |
|
367 |
palEnablePadEvent(moduleGpioIrInt1.gpio->port, moduleGpioIrInt1.gpio->pad, APAL2CH_EDGE(moduleGpioIrInt1.meta.edge)); \ |
|
368 |
/* GAUGE_BATLOW2 */ \ |
|
369 |
palSetPadCallback(moduleGpioGaugeBatLow2.gpio->port, moduleGpioGaugeBatLow2.gpio->pad, _intCallback, &moduleGpioGaugeBatLow2.gpio->pad); \ |
|
370 |
palEnablePadEvent(moduleGpioGaugeBatLow2.gpio->port, moduleGpioGaugeBatLow2.gpio->pad, APAL2CH_EDGE(moduleGpioGaugeBatLow2.meta.edge)); \ |
|
371 |
/* GAUGE_BATGD2 */ \ |
|
372 |
palSetPadCallback(moduleGpioGaugeBatGd2.gpio->port, moduleGpioGaugeBatGd2.gpio->pad, _intCallback, &moduleGpioGaugeBatGd2.gpio->pad); \ |
|
373 |
palEnablePadEvent(moduleGpioGaugeBatGd2.gpio->port, moduleGpioGaugeBatGd2.gpio->pad, APAL2CH_EDGE(moduleGpioGaugeBatGd2.meta.edge)); \ |
|
374 |
/* GAUGE_BATLOW1 */ \ |
|
375 |
palSetPadCallback(moduleGpioGaugeBatLow1.gpio->port, moduleGpioGaugeBatLow1.gpio->pad, _intCallback, &moduleGpioGaugeBatLow1.gpio->pad); \ |
|
376 |
palEnablePadEvent(moduleGpioGaugeBatLow1.gpio->port, moduleGpioGaugeBatLow1.gpio->pad, APAL2CH_EDGE(moduleGpioGaugeBatLow1.meta.edge)); \ |
|
377 |
/* GAUGE_BATGD1 */ \ |
|
378 |
palSetPadCallback(moduleGpioGaugeBatGd1.gpio->port, moduleGpioGaugeBatGd1.gpio->pad, _intCallback, &moduleGpioGaugeBatGd1.gpio->pad); \ |
|
379 |
palEnablePadEvent(moduleGpioGaugeBatGd1.gpio->port, moduleGpioGaugeBatGd1.gpio->pad, APAL2CH_EDGE(moduleGpioGaugeBatGd1.meta.edge)); \ |
|
380 |
/* IR_INT1 */ \ |
|
381 |
palSetPadCallback(moduleGpioIrInt2.gpio->port, moduleGpioIrInt2.gpio->pad, _intCallback, &moduleGpioIrInt1.gpio->pad); \ |
|
382 |
palEnablePadEvent(moduleGpioIrInt2.gpio->port, moduleGpioIrInt2.gpio->pad, APAL2CH_EDGE(moduleGpioIrInt1.meta.edge)); \ |
|
383 |
/* TOUCH_INT */ \ |
|
384 |
palSetPadCallback(moduleGpioTouchInt.gpio->port, moduleGpioTouchInt.gpio->pad, _intCallback, &moduleGpioTouchInt.gpio->pad); \ |
|
385 |
palEnablePadEvent(moduleGpioTouchInt.gpio->port, moduleGpioTouchInt.gpio->pad, APAL2CH_EDGE(moduleGpioTouchInt.meta.edge)); \ |
|
386 |
/* PATH_DC */ \ |
|
387 |
palSetPadCallback(moduleGpioPathDc.gpio->port, moduleGpioPathDc.gpio->pad, _intCallback, &moduleGpioPathDc.gpio->pad); \ |
|
388 |
palEnablePadEvent(moduleGpioPathDc.gpio->port, moduleGpioPathDc.gpio->pad, APAL2CH_EDGE(moduleGpioPathDc.meta.edge)); \ |
|
389 |
/* SYS_SPI_DIR */ \ |
|
390 |
palSetPadCallback(moduleGpioSysSpiDir.gpio->port, moduleGpioSysSpiDir.gpio->pad, _intCallback, &moduleGpioSysSpiDir.gpio->pad); \ |
|
391 |
palEnablePadEvent(moduleGpioSysSpiDir.gpio->port, moduleGpioSysSpiDir.gpio->pad, APAL2CH_EDGE(moduleGpioSysSpiDir.meta.edge)); \ |
|
392 |
/* SYS_WARMRST */ \ |
|
393 |
palSetPadCallback(moduleGpioSysWarmrst.gpio->port, moduleGpioSysWarmrst.gpio->pad, _intCallback, &moduleGpioSysWarmrst.gpio->pad); \ |
|
394 |
palEnablePadEvent(moduleGpioSysWarmrst.gpio->port, moduleGpioSysWarmrst.gpio->pad, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge)); \ |
|
395 |
} |
|
396 |
|
|
397 |
/** |
|
398 |
* @brief Unit test initialization hook. |
|
399 |
*/ |
|
400 |
#define MODULE_INIT_TESTS() { \ |
|
401 |
/* add unit-test shell commands */ \ |
|
402 |
aosShellAddCommand(&aos.shell, &moduleUtAdcVsys.shellcmd); \ |
|
403 |
aosShellAddCommand(&aos.shell, &moduleUtAlldAt24c01bn.shellcmd); \ |
|
404 |
aosShellAddCommand(&aos.shell, &moduleUtAlldBq24103a.shellcmd); \ |
|
405 |
aosShellAddCommand(&aos.shell, &moduleUtAlldBq27500.shellcmd); \ |
|
406 |
aosShellAddCommand(&aos.shell, &moduleUtAlldBq27500Bq24103a.shellcmd); \ |
|
407 |
aosShellAddCommand(&aos.shell, &moduleUtAlldIna219.shellcmd); \ |
|
408 |
aosShellAddCommand(&aos.shell, &moduleUtAlldMpr121.shellcmd); \ |
|
409 |
aosShellAddCommand(&aos.shell, &moduleUtAlldPca9544a.shellcmd); \ |
|
410 |
aosShellAddCommand(&aos.shell, &moduleUtAlldPklcs1212e4001.shellcmd); \ |
|
411 |
aosShellAddCommand(&aos.shell, &moduleUtAlldLed.shellcmd); \ |
|
412 |
aosShellAddCommand(&aos.shell, &moduleUtAlldTps62113.shellcmd); \ |
|
413 |
aosShellAddCommand(&aos.shell, &moduleUtAlldTps62113Ina219.shellcmd); \ |
|
414 |
aosShellAddCommand(&aos.shell, &moduleUtAlldVcnl4020.shellcmd); \ |
|
415 |
} |
|
416 |
|
|
417 |
/** |
|
418 |
* @brief Periphery communication interfaces initialization hook. |
|
419 |
*/ |
|
420 |
#define MODULE_INIT_PERIPHERY_COMM() { \ |
|
421 |
/* serial driver */ \ |
|
422 |
sdStart(&MODULE_HAL_PROGIF, &moduleHalProgIfConfig); \ |
|
423 |
/* I2C */ \ |
|
424 |
moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed = (PCA9544A_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed) ? PCA9544A_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed; \ |
|
425 |
moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed = (VCNL4020_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed) ? VCNL4020_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed; \ |
|
426 |
moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed = (INA219_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed) ? INA219_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed; \ |
|
427 |
moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed = (BQ27500_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed) ? BQ27500_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed; \ |
|
428 |
moduleHalI2cProxPm18Pm33GaugeRearConfig.duty_cycle = (moduleHalI2cProxPm18Pm33GaugeRearConfig.clock_speed <= 100000) ? STD_DUTY_CYCLE : FAST_DUTY_CYCLE_2; \ |
|
429 |
i2cStart(&MODULE_HAL_I2C_PROX_PM18_PM33_GAUGEREAR, &moduleHalI2cProxPm18Pm33GaugeRearConfig); \ |
|
430 |
moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed = (PCA9544A_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed) ? PCA9544A_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed; \ |
|
431 |
moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed = (VCNL4020_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed) ? VCNL4020_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed; \ |
|
432 |
moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed = (INA219_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed) ? INA219_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed; \ |
|
433 |
moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed = (AT24C01BN_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed) ? AT24C01BN_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed; \ |
|
434 |
moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed = (MPR121_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed) ? MPR121_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed; \ |
|
435 |
moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed = (BQ27500_LLD_I2C_MAXFREQUENCY < moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed) ? BQ27500_LLD_I2C_MAXFREQUENCY : moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed; \ |
|
436 |
moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.duty_cycle = (moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig.clock_speed <= 100000) ? STD_DUTY_CYCLE : FAST_DUTY_CYCLE_2; \ |
|
437 |
i2cStart(&MODULE_HAL_I2C_PROX_PM42_PM50_PMVDD_EEPROM_TOUCH_GAUGEFRONT, &moduleHalI2cProxPm42Pm50PmVddEepromTouchGaugeFrontConfig); \ |
|
438 |
/* ADC */ \ |
|
439 |
adcStart(&MODULE_HAL_ADC_VSYS, NULL); \ |
|
440 |
/* PWM */ \ |
|
441 |
pwmStart(&MODULE_HAL_PWM_BUZZER, &moduleHalPwmBuzzerConfig); \ |
|
442 |
moduleHalPwmBuzzerConfig.frequency = MODULE_HAL_PWM_BUZZER.clock; \ |
|
443 |
pwmStop(&MODULE_HAL_PWM_BUZZER); \ |
|
444 |
moduleHalPwmBuzzerConfig.period = moduleHalPwmBuzzerConfig.frequency / PKLCS1212E4001_LLD_FREQUENCY_SPEC; \ |
|
445 |
pwmStart(&MODULE_HAL_PWM_BUZZER, &moduleHalPwmBuzzerConfig); \ |
|
446 |
} |
|
447 |
|
|
448 |
/** |
|
449 |
* @brief Periphery communication interface deinitialization hook. |
|
450 |
*/ |
|
451 |
#define MODULE_SHUTDOWN_PERIPHERY_COMM() { \ |
|
452 |
/* PWM */ \ |
|
453 |
pwmStop(&MODULE_HAL_PWM_BUZZER); \ |
|
454 |
/* ADC */ \ |
|
455 |
adcStop(&MODULE_HAL_ADC_VSYS); \ |
|
456 |
/* I2C */ \ |
|
457 |
i2cStop(&MODULE_HAL_I2C_PROX_PM18_PM33_GAUGEREAR); \ |
|
458 |
i2cStop(&MODULE_HAL_I2C_PROX_PM42_PM50_PMVDD_EEPROM_TOUCH_GAUGEFRONT); \ |
|
459 |
/* don't stop the serial driver so messages can still be printed */ \ |
|
460 |
} |
|
461 |
|
|
462 |
/** @} */ |
|
463 |
|
|
464 |
#if (AMIROOS_CFG_SSSP_ENABLE == true) |
|
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 DN signal GPIO. |
|
484 |
*/ |
|
485 |
#define moduleSsspGpioDn moduleGpioSysUartDn |
|
486 |
|
|
487 |
/** |
|
488 |
* @brief UP signal GPIO. |
|
489 |
*/ |
|
490 |
#define moduleSsspGpioUp moduleGpioSysUartUp |
|
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 |
#endif |
|
515 |
|
|
516 |
/*===========================================================================*/ |
|
517 |
/** |
|
518 |
* @name Low-level drivers |
|
519 |
* @{ |
|
520 |
*/ |
|
521 |
/*===========================================================================*/ |
|
522 |
#include <alld_at24c01bn-sh-b.h> |
|
523 |
#include <alld_bq24103a.h> |
|
524 |
#include <alld_bq27500.h> |
|
525 |
#include <alld_ina219.h> |
|
526 |
#include <alld_led.h> |
|
527 |
#include <alld_mpr121.h> |
|
528 |
#include <alld_pca9544a.h> |
|
529 |
#include <alld_pklcs1212e4001.h> |
|
530 |
#include <alld_tps62113.h> |
|
531 |
#include <alld_vcnl4020.h> |
|
532 |
|
|
533 |
/** |
|
534 |
* @brief EEPROM driver. |
|
535 |
*/ |
|
536 |
//extern AT24C01BNDriver moduleLldEeprom; |
|
537 |
|
|
538 |
/** |
|
539 |
* @brief Battery charger (front battery) driver. |
|
540 |
*/ |
|
541 |
//extern BQ24103ADriver moduleLldBatteryChargerFront; |
|
542 |
|
|
543 |
/** |
|
544 |
* @brief Battery charger (rear battery) driver. |
|
545 |
*/ |
|
546 |
//extern BQ24103ADriver moduleLldBatteryChargerRear; |
|
547 |
|
|
548 |
/** |
|
549 |
* @brief Fuel gauge (front battery) driver. |
|
550 |
*/ |
|
551 |
//extern BQ27500Driver moduleLldFuelGaugeFront; |
|
552 |
|
|
553 |
/** |
|
554 |
* @brief Fuel gauge (rear battery) driver. |
|
555 |
*/ |
|
556 |
//extern BQ27500Driver moduleLldFuelGaugeRear; |
|
557 |
|
|
558 |
/** |
|
559 |
* @brief Power monitor (VDD) driver. |
|
560 |
*/ |
|
561 |
//extern INA219Driver moduleLldPowerMonitorVdd; |
|
562 |
|
|
563 |
/** |
|
564 |
* @brief Power monitor (VIO 1.8) driver. |
|
565 |
*/ |
|
566 |
//extern INA219Driver moduleLldPowerMonitorVio18; |
|
567 |
|
|
568 |
/** |
|
569 |
* @brief Power monitor (VIO 3.3) driver. |
|
570 |
*/ |
|
571 |
//extern INA219Driver moduleLldPowerMonitorVio33; |
|
572 |
|
|
573 |
/** |
|
574 |
* @brief Power monitor (VSYS 4.2) driver. |
|
575 |
*/ |
|
576 |
//extern INA219Driver moduleLldPowerMonitorVsys42; |
|
577 |
|
|
578 |
/** |
|
579 |
* @brief Power monitor (VIO 5.0) driver. |
|
580 |
*/ |
|
581 |
//extern INA219Driver moduleLldPowerMonitorVio50; |
|
582 |
|
|
583 |
/** |
|
584 |
* @brief Status LED driver. |
|
585 |
*/ |
|
586 |
//extern LEDDriver moduleLldStatusLed; |
|
587 |
|
|
588 |
/** |
|
589 |
* @brief Touch sensor driver. |
|
590 |
*/ |
|
591 |
//extern MPR121Driver moduleLldTouch; |
|
592 |
|
|
593 |
/** |
|
594 |
* @brief I2C multiplexer (I2C 1) driver. |
|
595 |
*/ |
|
596 |
//extern PCA9544ADriver moduleLldI2cMultiplexer1; |
|
597 |
|
|
598 |
/** |
|
599 |
* @brief I2C multiplexer (I2C 2) driver. |
|
600 |
*/ |
|
601 |
//extern PCA9544ADriver moduleLldI2cMultiplexer2; |
|
602 |
|
|
603 |
/** |
|
604 |
* @brief Step down converter driver. |
|
605 |
* @note Although there multiple TPS62113, those are completely identical from driver few (share the same signals). |
|
606 |
*/ |
|
607 |
//extern TPS62113Driver moduleLldStepDownConverter; |
|
608 |
|
|
609 |
/** |
|
610 |
* @brief Proximity sensor (I2C 1) driver. |
|
611 |
*/ |
|
612 |
//extern VCNL4020Driver moduleLldProximity1; |
|
613 |
|
|
614 |
/** |
|
615 |
* @brief Proximity sensor (I2C 2) driver. |
|
616 |
*/ |
|
617 |
//extern VCNL4020Driver moduleLldProximity2; |
|
618 |
|
|
619 |
/** @} */ |
|
620 |
|
|
621 |
/*===========================================================================*/ |
|
622 |
/** |
|
623 |
* @name Unit tests (UT) |
|
624 |
* @{ |
|
625 |
*/ |
|
626 |
/*===========================================================================*/ |
|
627 |
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
|
628 |
#include <ut_lld_adc.h> |
|
629 |
#include <ut_alld_at24c01bn-sh-b.h> |
|
630 |
#include <ut_alld_bq24103a.h> |
|
631 |
#include <ut_alld_bq27500.h> |
|
632 |
#include <ut_alld_bq27500_bq24103a.h> |
|
633 |
#include <ut_alld_ina219.h> |
|
634 |
#include <ut_alld_led.h> |
|
635 |
#include <ut_alld_mpr121.h> |
|
636 |
#include <ut_alld_pca9544a.h> |
|
637 |
#include <ut_alld_pklcs1212e4001.h> |
|
638 |
#include <ut_alld_tps62113.h> |
|
639 |
#include <ut_alld_tps62113_ina219.h> |
|
640 |
#include <ut_alld_vcnl4020.h> |
|
641 |
|
|
642 |
/** |
|
643 |
* @brief ADC unit test object. |
|
644 |
*/ |
|
645 |
extern aos_unittest_t moduleUtAdcVsys; |
|
646 |
|
|
647 |
/** |
|
648 |
* @brief AT24C01BN-SH-B (EEPROM) unit test object. |
|
649 |
*/ |
|
650 |
extern aos_unittest_t moduleUtAlldAt24c01bn; |
|
651 |
|
|
652 |
/** |
|
653 |
* @brief BQ24103A (battery charger) unit test object. |
|
654 |
*/ |
|
655 |
extern aos_unittest_t moduleUtAlldBq24103a; |
|
656 |
|
|
657 |
/** |
|
658 |
* @brief BQ27500 (fuel gauge) unit test object. |
|
659 |
*/ |
|
660 |
extern aos_unittest_t moduleUtAlldBq27500; |
|
661 |
|
|
662 |
/** |
|
663 |
* @brief BQ27500 (fuela gauge) in combination with BQ24103A (battery charger) unit test object. |
|
664 |
*/ |
|
665 |
extern aos_unittest_t moduleUtAlldBq27500Bq24103a; |
|
666 |
|
|
667 |
/** |
|
668 |
* @brief INA219 (power monitor) unit test object. |
|
669 |
*/ |
|
670 |
extern aos_unittest_t moduleUtAlldIna219; |
|
671 |
|
|
672 |
/** |
|
673 |
* @brief Status LED unit test object. |
|
674 |
*/ |
|
675 |
extern aos_unittest_t moduleUtAlldLed; |
|
676 |
|
|
677 |
/** |
|
678 |
* @brief MPR121 (touch sensor) unit test object. |
|
679 |
*/ |
|
680 |
extern aos_unittest_t moduleUtAlldMpr121; |
|
681 |
|
|
682 |
/** |
|
683 |
* @brief PCA9544A (I2C multiplexer) unit test object. |
|
684 |
*/ |
|
685 |
extern aos_unittest_t moduleUtAlldPca9544a; |
|
686 |
|
|
687 |
/** |
|
688 |
* @brief PKLCS1212E4001 (buzzer) unit test object. |
|
689 |
*/ |
|
690 |
extern aos_unittest_t moduleUtAlldPklcs1212e4001; |
|
691 |
|
|
692 |
/** |
|
693 |
* @brief TPS62113 (step-down converter) unit test object. |
|
694 |
*/ |
|
695 |
extern aos_unittest_t moduleUtAlldTps62113; |
|
696 |
|
|
697 |
/** |
|
698 |
* @brief TPS62113 (step-sown converter) in combination with INA219 (power monitor) unit test object. |
|
699 |
*/ |
|
700 |
extern aos_unittest_t moduleUtAlldTps62113Ina219; |
|
701 |
|
|
702 |
/** |
|
703 |
* @brief VCNL4020 (proximity sensor) unit test object. |
|
704 |
*/ |
|
705 |
extern aos_unittest_t moduleUtAlldVcnl4020; |
|
706 |
|
|
707 |
#endif /* AMIROOS_CFG_TESTS_ENABLE == true */ |
|
708 |
|
|
709 |
/** @} */ |
|
710 |
|
|
711 | 254 |
#endif /* _AMIROOS_MODULE_H_ */ |
712 | 255 |
|
713 | 256 |
/** @} */ |
Also available in: Unified diff