Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
adc_arch.c File Reference

Handling of ADC hardware for lpc21xx. More...

#include "mcu_periph/adc.h"
#include "LPC21xx.h"
#include "armVIC.h"
#include <BOARD_CONFIG>
+ Include dependency graph for adc_arch.c:

Go to the source code of this file.

Functions

void adcISR0 (void)
 
void adcISR1 (void)
 
void adc_buf_channel (uint8_t adc_channel, struct adc_buf *s, uint8_t av_nb_sample)
 Registers a buffer to be used to store the specified converted channel Usage: More...
 
void adc_init (void)
 Starts conversions. More...
 

Variables

static struct adc_bufbuffers [NB_ADC *2]
 First NB_ADC for bank 0, others for bank 2. More...
 
volatile uint16_t adc0_val [NB_ADC] = {1, 2, 3, 4, 5, 6, 7, 8}
 
volatile uint16_t adc1_val [NB_ADC] = {9, 10, 11, 12, 13, 14, 15, 16}
 
static const uint32_t ADC_PINSEL0_ONES = 0
 
static const uint32_t ADC_PINSEL1_ONES = 0
 
static const uint32_t ADC_AD0CR_SEL_HW_SCAN = 0
 
static const uint32_t ADC_AD1CR_SEL_HW_SCAN = 0
 

Detailed Description

Handling of ADC hardware for lpc21xx.

Definition in file adc_arch.c.

Function Documentation

void adc_buf_channel ( uint8_t  adc_channel,
struct adc_buf s,
uint8_t  av_nb_sample 
)

Registers a buffer to be used to store the specified converted channel Usage:

1 struct adc_buf channel_buf;
2 adc_buf_channel(1, &channel_buf, 12);

Registers channel_buf as buffer for ADC channel 1, with max index 12 (12 samples).

Definition at line 59 of file adc_arch.c.

Referenced by adc_generic_init(), agl_vf_init(), airspeed_adc_init(), AOA_adc_init(), baro_init(), electrical_init(), enose_init(), humid_hih_init(), imu_impl_init(), infrared_adc_init(), light_solar_init(), light_temt_init(), main_init(), sonar_adc_init(), and temp_tcouple_adc_init().

+ Here is the caller graph for this function:

void adc_init ( void  )

Starts conversions.

Definition at line 194 of file adc_arch.c.

Referenced by main_init(), and mcu_init().

+ Here is the caller graph for this function:

void adcISR0 ( void  )

Definition at line 233 of file adc_arch.c.

References AD0GDR, adc0_val, adc_buf::av_nb_sample, buf, channel, adc_buf::head, ISR_ENTRY, ISR_EXIT, adc_buf::sum, value, adc_buf::values, and VICVectAddr.

Referenced by adc_init().

+ Here is the caller graph for this function:

void adcISR1 ( void  )

Definition at line 254 of file adc_arch.c.

References AD1GDR, adc1_val, adc_buf::av_nb_sample, buf, channel, adc_buf::head, ISR_ENTRY, ISR_EXIT, NB_ADC, adc_buf::sum, value, adc_buf::values, and VICVectAddr.

Referenced by adc_init().

+ Here is the caller graph for this function:

Variable Documentation

volatile uint16_t adc0_val[NB_ADC] = {1, 2, 3, 4, 5, 6, 7, 8}

Definition at line 53 of file adc_arch.c.

Referenced by adcISR0().

volatile uint16_t adc1_val[NB_ADC] = {9, 10, 11, 12, 13, 14, 15, 16}

Definition at line 54 of file adc_arch.c.

Referenced by adcISR1().

const uint32_t ADC_AD0CR_SEL_HW_SCAN = 0
static

Definition at line 140 of file adc_arch.c.

Referenced by adc_init().

const uint32_t ADC_AD1CR_SEL_HW_SCAN = 0
static

Definition at line 167 of file adc_arch.c.

Referenced by adc_init().

const uint32_t ADC_PINSEL0_ONES = 0
static

Definition at line 86 of file adc_arch.c.

Referenced by adc_init().

const uint32_t ADC_PINSEL1_ONES = 0
static

Definition at line 113 of file adc_arch.c.

Referenced by adc_init().

struct adc_buf* buffers[NB_ADC *2]
static

First NB_ADC for bank 0, others for bank 2.

Definition at line 51 of file adc_arch.c.