TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
TM_ADC_Functions

Library Functions. More...

Functions

void TM_ADC_InitADC (ADC_TypeDef *ADCx)
 Initializes ADCx peripheral. More...
 
void TM_ADC_Init (ADC_TypeDef *ADCx, uint8_t channel)
 Initializes ADCx with ADCx channel. More...
 
uint16_t TM_ADC_Read (ADC_TypeDef *ADCx, uint8_t channel)
 Reads from ADCx channel. More...
 
void TM_ADC_EnableVbat (void)
 Enables Vbat channel for ADC. More...
 
void TM_ADC_DisableVbat (void)
 Disables Vbat channel for ADC. More...
 
uint16_t TM_ADC_ReadVbat (ADC_TypeDef *ADCx)
 Reads vbat pin voltage. More...
 

Detailed Description

Library Functions.

Function Documentation

void TM_ADC_DisableVbat ( void  )

Disables Vbat channel for ADC.

Parameters
None
Return values
None
void TM_ADC_EnableVbat ( void  )

Enables Vbat channel for ADC.

Parameters
None
Return values
None
void TM_ADC_Init ( ADC_TypeDef *  ADCx,
uint8_t  channel 
)

Initializes ADCx with ADCx channel.

Parameters
*ADCxADCx peripheral to operate with
channelchannel for ADCx
Return values
None
void TM_ADC_InitADC ( ADC_TypeDef *  ADCx)

Initializes ADCx peripheral.

Parameters
*ADCxADCx peripheral to initialize
Return values
None
uint16_t TM_ADC_Read ( ADC_TypeDef *  ADCx,
uint8_t  channel 
)

Reads from ADCx channel.

Parameters
*ADCxADCx peripheral to operate with
channelchannel for ADCx to read from
Return values
ADCvalue
uint16_t TM_ADC_ReadVbat ( ADC_TypeDef *  ADCx)

Reads vbat pin voltage.

Parameters
*ADCxADCx peripheral to use for Vbat measurement
Return values
voltagein mV