![]() |
ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
|
ADC1 injected-group binding for the battery (see batt_adc.h). More...
#include "batt_adc.h"#include "app_config.h"#include "stm32wbxx_hal.h"#include "stm32wbxx_ll_adc.h"#include "stm32wbxx_ll_bus.h"#include "stm32wbxx_ll_gpio.h"#include "stm32wbxx_ll_rcc.h"Go to the source code of this file.
Functions | |
| static void | delay_us (uint32_t us) |
| static void | analog_pin (GPIO_TypeDef *port, uint32_t pin) |
| int | batt_adc_init (void) |
| 0 = ok | |
| int | batt_adc_read (float *vbat_pin, float *cur_pin) |
| 0 = a new sample: pin voltages in volts | |
Variables | |
| static uint8_t | s_started |
ADC1 injected-group binding for the battery (see batt_adc.h).
Reference: RM0434 ยง16 (ADC), STM32WB55 datasheet (VREFINT_CAL).
Definition in file batt_adc.c.
|
static |
Definition at line 16 of file batt_adc.c.
References n.
Referenced by batt_adc_init().
|
static |
Definition at line 22 of file batt_adc.c.
References port.
Referenced by batt_adc_init().
| int batt_adc_init | ( | void | ) |
0 = ok
Definition at line 30 of file batt_adc.c.
References analog_pin(), APP_BATT_CUR_CH, APP_BATT_CUR_PIN, APP_BATT_CUR_PORT, APP_BATT_VBAT_CH, APP_BATT_VBAT_PIN, APP_BATT_VBAT_PORT, delay_us(), and s_started.
Referenced by app_start().
| int batt_adc_read | ( | float * | vbat_pin, |
| float * | cur_pin | ||
| ) |
0 = a new sample: pin voltages in volts
Definition at line 79 of file batt_adc.c.
References s_started.
Referenced by app_start().
|
static |
Definition at line 14 of file batt_adc.c.
Referenced by batt_adc_init(), and batt_adc_read().