Nut/OS  5.0.5
API Reference
XgStm32Adc

Defines

#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

Functions

int ADCBufRead (uint16_t channel, uint16_t *read)
 Reads data from the adc buffer.
void ADCSetMode (TADCMode mode)
 Sets the data aquisition mode for the adc.
void ADCEnableChannel (TADCChannel channel)
 Enable a channel used to sample when conversion started.
void ADCDisableChannel (TADCChannel channel)
 Disable a channel.
void ADCSetPrescale (unsigned int prescale)
 Set the prescaler for the adc.
void ADCStartConversion (void)
 Start conversion.
void ADCInit (void)
 Initialize the adc to the configured default values and enable interrupt.

Variables

uint16_t ** ADC_Buffer = NULL
uint16_t ** ADC_Buffer = NULL

Detailed Description

 * $Id: stm32f1_adc.c 4268 2012-06-15 13:24:08Z haraldkipp $
 *

Define Documentation

#define STM32_ADC_INITIAL_MODE   SINGLE_CONVERSION

Referenced by ADCInit().

#define STM32_ADC_INITIAL_PRESCALE   55

Referenced by ADCInit().

#define STM32_ADC_BUF_SIZE   16

Referenced by ADCBufRead(), and ADCInit().

#define _adc_buf_head   STM32_ADC_BUF_SIZE

Referenced by ADCBufRead(), and ADCInit().

#define _adc_buf_tail   STM32_ADC_BUF_SIZE+1

Referenced by ADCBufRead(), and ADCInit().

#define STM32_ADC_INITIAL_MODE   SINGLE_CONVERSION
#define STM32_ADC_INITIAL_PRESCALE   55
#define STM32_ADC_BUF_SIZE   16

Referenced by ADCBufRead().

#define _adc_buf_head   STM32_ADC_BUF_SIZE

Referenced by ADCBufRead().

#define _adc_buf_tail   STM32_ADC_BUF_SIZE+1

Referenced by ADCBufRead().


Function Documentation

int ADCBufRead ( uint16_t  channel,
uint16_t read 
)

Reads data from the adc buffer.

Parameters:
channelSpecifies the channel to read data from
readVariable to store the data in
Returns:
0: data read succesfully, 1: no data available

References _adc_buf_head, _adc_buf_tail, ADC_Buffer, and STM32_ADC_BUF_SIZE.

Referenced by ADCRead().

void ADCSetMode ( TADCMode  mode)

Sets the data aquisition mode for the adc.

Parameters:
modeMode to set

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.

Here is the call graph for this function:

void ADCEnableChannel ( TADCChannel  channel)

Enable a channel used to sample when conversion started.

Parameters:
channelSpecifies the channel to enable

References _BV, ADC_CHER, ADC_IER, and outr.

void ADCDisableChannel ( TADCChannel  channel)

Disable a channel.

Parameters:
channelSpecifies the channel to disable

References _BV, ADC_CHER, ADC_IDR, and outr.

void ADCSetPrescale ( unsigned int  prescale)

Set the prescaler for the adc.

Parameters:
prescalePrescaler value 0-128

References ADC_MR, ADC_PRESCAL, ADC_PRESCAL_LSB, ADC_SHTIM, ADC_STARTUP, inr, and outr.

void ADCStartConversion ( void  )

Start conversion.

References ADC_CR, ADC_START, outr, and sbi.

void ADCInit ( void  )

Variable Documentation

uint16_t** ADC_Buffer = NULL
uint16_t** ADC_Buffer = NULL