PER Firmware
Loading...
Searching...
No Matches
adc.c File Reference

Functions

bool PHAL_initADC (ADC_TypeDef *adc, ADCInitConfig_t *config, ADCChannelConfig_t channels[], uint8_t num_channels)
 Initializes the ADC, requires GPIO config prior.
 
bool PHAL_startADC (ADC_TypeDef *adc)
 Starts the ADC conversions, requires PHAL_initADC to be called prior.
 
bool PHAL_stopADC (ADC_TypeDef *adc)
 Stops the ADC conversions, requires PHAL_initADC to be called prior.
 
uint16_t PHAL_readADC (ADC_TypeDef *adc)
 Reads the ADC data register.
 

Detailed Description

Author
Aditya Anand, Chris McGalliard - port of L4 HAL by Luke Oxley (lcoxl.nosp@m.ey@p.nosp@m.urdue.nosp@m..edu)
Version
0.1
Date
2023-09-17

Function Documentation

◆ PHAL_initADC()

bool PHAL_initADC ( ADC_TypeDef * adc,
ADCInitConfig_t * config,
ADCChannelConfig_t channels[],
uint8_t num_channels )

Initializes the ADC, requires GPIO config prior.

Parameters
adcADC handle
configADC initial config settings
channelsList of channel configurations
num_channelsNumber of channels in the channel configuration list

◆ PHAL_readADC()

uint16_t PHAL_readADC ( ADC_TypeDef * adc)

Reads the ADC data register.

Parameters
adcADC handle
Returns
contents of the data register

◆ PHAL_startADC()

bool PHAL_startADC ( ADC_TypeDef * adc)

Starts the ADC conversions, requires PHAL_initADC to be called prior.

Parameters
adcADC handle

◆ PHAL_stopADC()

bool PHAL_stopADC ( ADC_TypeDef * adc)

Stops the ADC conversions, requires PHAL_initADC to be called prior.

Parameters
adcADC handle