Detailed Description
* $Id: stm32f1_adc.c 4268 2012-06-15 13:24:08Z haraldkipp $
*
Define Documentation
#define STM32_ADC_INITIAL_MODE SINGLE_CONVERSION |
#define STM32_ADC_INITIAL_PRESCALE 55 |
#define STM32_ADC_BUF_SIZE 16 |
#define _adc_buf_head STM32_ADC_BUF_SIZE |
#define _adc_buf_tail STM32_ADC_BUF_SIZE+1 |
#define STM32_ADC_INITIAL_MODE SINGLE_CONVERSION |
#define STM32_ADC_INITIAL_PRESCALE 55 |
#define STM32_ADC_BUF_SIZE 16 |
#define _adc_buf_head STM32_ADC_BUF_SIZE |
#define _adc_buf_tail STM32_ADC_BUF_SIZE+1 |
Function Documentation
Sets the data aquisition mode for the adc.
- Parameters:
-
References ADC_MR, ADC_OFF, ADC_SLEEP, ADC_TRGEN, ADC_TRGSEL, ADC_TRGSEL_EXT, ADC_TRGSEL_TIOA0, ADC_TRGSEL_TIOA1, ADC_TRGSEL_TIOA2, ADCStopConversion(), cbi, current_mode, FREE_RUNNING, FREE_RUNNING_EXT, FREE_RUNNING_T0, FREE_RUNNING_T1, FREE_RUNNING_T2, inr, outr, sbi, and SINGLE_CONVERSION.
Enable a channel used to sample when conversion started.
- Parameters:
-
channel | Specifies the channel to enable |
References _BV, ADC_CHER, ADC_IER, and outr.
Disable a channel.
- Parameters:
-
channel | Specifies the channel to disable |
References _BV, ADC_CHER, ADC_IDR, and outr.
void ADCSetPrescale |
( |
unsigned int |
prescale | ) |
|
void ADCStartConversion |
( |
void |
| ) |
|
Initialize the adc to the configured default values and enable interrupt.
References _adc_buf_head, _adc_buf_tail, ADC_BUF_SIZE, ADC_Buffer, ADC_buffer, ADC_CH0, ADC_CH1, ADC_CH2, ADC_CH3, ADC_CH4, ADC_CH5, ADC_CH6, ADC_CH7, ADC_CHDR, ADC_CR, ADC_INITIAL_CHANNEL, ADC_INITIAL_MODE, ADC_INITIAL_PRESCALE, ADC_INITIAL_REF, ADC_MAX_CHANNEL, ADC_SWRST, ADCBufInit(), ADCSetChannel(), ADCSetMode(), ADCSetPrescale(), ADCSetRef(), NULL, NutHeapAlloc, NutIrqEnable(), NutRegisterIrqHandler(), outr, RCC, RCC_APB2Periph_ADC1, RCC_APB2Periph_ADC2, RCC_APB2Periph_ADC3, sbi, sig_ADC, STM32_ADC_BUF_SIZE, STM32_ADC_INITIAL_MODE, and STM32_ADC_INITIAL_PRESCALE.
Variable Documentation