Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
arch independent ADC (Analog to Digital Converter) API More...
Go to the source code of this file.
Data Structures | |
struct | adc_buf |
Generic interface for all ADC hardware drivers, independent from microcontroller architecture. More... | |
Macros | |
#define | MAX_AV_NB_SAMPLE 0x20 |
#define | DEFAULT_AV_NB_SAMPLE 0x20 |
Functions | |
void | adc_buf_channel (uint8_t adc_channel, struct adc_buf *s, uint8_t av_nb_sample) |
Link between ChibiOS ADC drivers and Paparazzi adc_buffers. More... | |
void | adc_init (void) |
Starts conversions. More... | |
arch independent ADC (Analog to Digital Converter) API
Facility to store last values in a circular buffer for a specific channel:
Definition in file adc.h.
struct adc_buf |
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
Struct to collect samples from ADC and building an average over MAX_AV_NB_SAMPLE values. See adc_buf_channel.
Data Fields | ||
---|---|---|
uint8_t | av_nb_sample | |
uint8_t | head | |
uint32_t | sum | |
uint16_t | values[MAX_AV_NB_SAMPLE] |
Link between ChibiOS ADC drivers and Paparazzi adc_buffers.
Registers a buffer to be used to store the specified converted channel Usage:
Registers channel_buf as buffer for ADC channel 1, with max index 12 (12 samples).
Definition at line 289 of file adc_arch.c.
References adc1_buffers, ADC_NUM_CHANNELS, adc_buf::av_nb_sample, buffers, MAX_AV_NB_SAMPLE, NB_ADC, nb_adc1_channels, nb_adc2_channels, nb_adc3_channels, and s.
Referenced by adc_generic_init(), airspeed_adc_init(), aoa_adc_init(), baro_init(), electrical_init(), glide_wing_lock_init(), humid_hih_init(), imu_analog_init(), infrared_adc_init(), light_solar_init(), light_temt_init(), mf_ptu_init(), sonar_adc_init(), temp_adc_init(), and temp_tcouple_adc_init().
void adc_init | ( | void | ) |
Starts conversions.
Starts conversions.
Initialize ADC drivers, buffers and start conversion in the background
Starts conversions.
Definition at line 312 of file adc_arch.c.
References _VIC_ADDR, _VIC_CNTL, AD0CR, AD1_1_CHANNEL, AD1_2_CHANNEL, AD1_3_CHANNEL, AD1_4_CHANNEL, AD1CR, ADC1, adc1_buffers, adc1callback(), ADC_1_GPIO_PIN, ADC_1_GPIO_PORT, ADC_2_GPIO_PIN, ADC_2_GPIO_PORT, ADC_3_GPIO_PIN, ADC_3_GPIO_PORT, ADC_4_GPIO_PIN, ADC_4_GPIO_PORT, ADC_5_GPIO_PIN, ADC_5_GPIO_PORT, ADC_7_GPIO_PIN, ADC_7_GPIO_PORT, ADC_9_GPIO_PIN, ADC_9_GPIO_PORT, ADC_BUF_DEPTH, adc_channel_map, adc_dev_init(), adc_init_irq(), adc_init_rcc(), adc_init_single(), ADC_NUM_CHANNELS, ADC_PINSEL0_ONES, ADC_PINSEL1_ONES, adc_regular_sequence(), adc_sample_time_on_all_channels(), adcerrorcallback(), adcgrpcfg, adcISR0(), adcISR1(), gpio_setup_pin_analog(), nb_adc1_channels, nb_adc2_channels, nb_adc3_channels, PINSEL0, PINSEL1, PRINT_CONFIG_MSG(), TRUE, VIC_AD0, VIC_AD1, VIC_BIT, VIC_ENABLE, VICIntEnable, and VICIntSelect.
Referenced by mcu_init().