21 #pragma GCC optimize ("O2") 25 #if CONFIG_HAL_BOARD == HAL_BOARD_F4LIGHT 37 #include <stm32f4xx.h> 40 #pragma GCC optimize ("O2") 54 _read_start_time_ms(0),
83 return v * (3.3f / 4096.0f);
194 #define MAX_SUM_COUNT 64
static void _pinMode(uint8_t pin, uint8_t output)
static INLINE void noInterrupts()
const adc_dev * _find_device() const
static INLINE void interrupts()
#define LeaveCriticalSection
static void adc_channel_config(const adc_dev *dev, uint8_t channel, uint8_t rank, uint8_t sampleTime)
const AP_HAL::HAL & hal
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
const stm32_pin_info PIN_MAP[BOARD_NR_GPIO_PINS]
#define ANALOG_INPUT_NONE
static void adc_enable(const adc_dev *dev)
Enable an adc peripheral.
static void adc_disable(const adc_dev *dev)
Disable an ADC peripheral.
Analog-to-Digital Conversion (ADC) header.
-*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
void gpio_set_mode(const gpio_dev *const dev, uint8_t pin, gpio_pin_mode mode)
float voltage_average_ratiometric()
static void adc_vref_disable()
static AP_HAL::OwnPtr< AP_HAL::Device > dev
void adc_init(const adc_dev *dev)
Initialize an ADC peripheral.
AnalogSource(uint8_t pin)
volatile uint16_t _latest
#define BOARD_NR_GPIO_PINS
Board-specific pin information.
#define ADC_SampleTime_84Cycles
#define ANALOG_INPUT_F4Light_VCC
void new_sample(uint16_t)
uint32_t _read_start_time_ms
static void adc_vref_enable()
static void adc_set_reg_seqlen(const adc_dev *dev, uint8_t length)
Set the regular channel sequence length.
static void _delay_microseconds(uint16_t us)
#define EnterCriticalSection
Stores STM32-specific information related to a given Maple pin.
const gpio_dev *const gpio_device
volatile uint32_t _sum_count
static INLINE void gpio_write_bit(const gpio_dev *const dev, uint8_t pin, uint8_t val)