Skip to content

Commit 9f6b225

Browse files
committed
Added a fake adc line for the vbat feature
The stm32 cpu adds `periph_vbat` to `FEATURES_PROVIDED` but we don't actually want to provide that since the other MCU handles power management. Therefore we set up a fake ADC line and use it for the vbat feature. I also put the adc lines on different pins.
1 parent 38b4c6f commit 9f6b225

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

boards/bitcraze-crazyflie21-main/include/periph_conf.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,16 @@ static const uart_conf_t uart_config[] = {
125125
* @{
126126
*/
127127
static const adc_conf_t adc_config[] = {
128-
{ .pin = GPIO_PIN(PORT_A, 0), .dev = 0, .chan = 0 },
129-
{ .pin = GPIO_PIN(PORT_B, 0), .dev = 0, .chan = 8 },
130-
{ .pin = GPIO_PIN(PORT_B, 1), .dev = 0, .chan = 9 },
131-
{ .pin = GPIO_PIN(PORT_C, 4), .dev = 1, .chan = 14 },
132-
{ .pin = GPIO_PIN(PORT_C, 5), .dev = 1, .chan = 15 },
128+
{ .pin = GPIO_PIN(PORT_A, 2), .dev = 0, .chan = 2 },
129+
{ .pin = GPIO_PIN(PORT_A, 3), .dev = 0, .chan = 3 },
130+
{ .pin = GPIO_PIN(PORT_A, 5), .dev = 1, .chan = 5 },
131+
{ .pin = GPIO_PIN(PORT_A, 6), .dev = 1, .chan = 6 },
132+
{ .pin = GPIO_PIN(PORT_A, 7), .dev = 1, .chan = 7 },
133+
{ .pin = GPIO_UNDEF, .dev = 0, .chan = 0}, /* VBAT */
133134
};
134135

136+
/* The radio MCU takes care of power management -> adc line without proper pin. */
137+
#define VBAT_ADC ADC_LINE(5) /**< VBAT ADC line */
135138
#define ADC_NUMOF ARRAY_SIZE(adc_config)
136139
/** @} */
137140

0 commit comments

Comments
 (0)