microHAL
An abstraction layer for your future F4xx projects
|
Function defines for the ADC_ driver. More...
#include "adc.h"
Functions | |
void | adc_set_prescaler (const adc_prescaler_t value) |
Sets the ADC Prescaler divider to the specified value. | |
void | adc_set_resolution (const adc_peripheral_t adc, const adc_res_t value) |
Sets the ADC resolution to the specified value. | |
void | adc_set_samplerate (const adc_peripheral_t adc, const uint8_t channel, const adc_samplerate_t value) |
Sets the ADC sampling rate to the specified value. | |
void | adc_set_modes (const adc_peripheral_t adc, const struct ADCModes config) |
Sets the ADC modes according to the configuration. | |
void | adc_set_seq (const adc_peripheral_t adc, const uint8_t *seq, const uint8_t count) |
Sets the ADC conversion sequence to the specified order. | |
void | adc_on (const adc_peripheral_t adc) |
Starts the ADC conversion. | |
void | adc_off (const adc_peripheral_t adc) |
Stops the ADC conversion. | |
uint16_t | adc_read (const adc_peripheral_t adc) |
Reads the last ADC conversion result. | |
Function defines for the ADC_ driver.
This file contains all of the function definitions declared in adc.h.
void adc_off | ( | const adc_peripheral_t | adc | ) |
Stops the ADC conversion.
The ADC will be powered off upon calling this command and instantly stop the conversion procedure.
adc | The selected ADC |
void adc_on | ( | const adc_peripheral_t | adc | ) |
Starts the ADC conversion.
The ADC will be powered on upon calling this command and start the conversion procedure as configured. Dummy reads are included.
adc | The selected ADC |
uint16_t adc_read | ( | const adc_peripheral_t | adc | ) |
Reads the last ADC conversion result.
adc | The selected ADC |
void adc_set_modes | ( | const adc_peripheral_t | adc, |
const struct ADCModes | config ) |
Sets the ADC modes according to the configuration.
The configuration values are specified within the adc_config struct. Some modes may not work as expected yet.
adc | The selected ADC |
config | The ADC configuration |
void adc_set_prescaler | ( | const adc_prescaler_t | value | ) |
Sets the ADC Prescaler divider to the specified value.
The available dividers for the ADC Prescaler are specified in the adc_prescaler_t enum. Any other value will be ignored.
value | The prescaler divider value |
void adc_set_resolution | ( | const adc_peripheral_t | adc, |
const adc_res_t | value ) |
Sets the ADC resolution to the specified value.
The available resolutions for the ADC channel reads are specified in the adc_res_t enum. Any other value will be ignored.
adc | The selected ADC |
value | The resolution of the ADC conversions |
void adc_set_samplerate | ( | const adc_peripheral_t | adc, |
const uint8_t | channel, | ||
const adc_samplerate_t | value ) |
Sets the ADC sampling rate to the specified value.
The available sampling rates for the ADC channel reads are specified in the adc_res_t enum (in clock cycles). Any other value will be ignored.
adc | The selected ADC |
channel | The selected channel (0..19) |
value | The clock cycles of the ADC conversions |
void adc_set_seq | ( | const adc_peripheral_t | adc, |
const uint8_t * | seq, | ||
const uint8_t | count ) |
Sets the ADC conversion sequence to the specified order.
The sequence consists of 16 5-bit elements. Bits 6..8 will be ignored.
adc | The selected ADC |
seq | Pointer to channel conversion sequence array |
count | The total amount of conversions |