APM:Libraries
Functions | Variables
adc.c File Reference
#include <hal.h>
#include "adc.h"
#include <stdbool.h>
Include dependency graph for adc.c:

Go to the source code of this file.

Functions

void adc_foreach (void(*fn)(const adc_dev *))
 Call a function on all ADC devices. More...
 
void adc_init (const adc_dev *dev)
 Initialize an ADC peripheral. More...
 

Variables

const adc_dev _adc1
 
const adc_dev *const _ADC1 = &_adc1
 
const adc_dev _adc2
 
const adc_dev *const _ADC2 = &_adc2
 
const adc_dev const _adc3
 
const adc_dev *const _ADC3 = &_adc3
 
__IO uint16_t ADC_ConvertedValue
 
__IO bool adc_data_ready
 

Function Documentation

◆ adc_foreach()

void adc_foreach ( void(*)(const adc_dev *)  fn)

Call a function on all ADC devices.

Parameters
fnFunction to call on each ADC device.

Definition at line 41 of file adc.c.

Referenced by adc_disable_all().

Here is the caller graph for this function:

◆ adc_init()

void adc_init ( const adc_dev dev)

Initialize an ADC peripheral.

Initializes the RCC clock line for the given peripheral. Resets ADC device registers.

Parameters
devADC peripheral to initialize

Definition at line 56 of file adc.c.

Referenced by F4Light::AnalogSource::set_pin().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ _adc1

const adc_dev _adc1
Initial value:
= {
.adcx = ADC1,
}

Definition at line 16 of file adc.c.

◆ _ADC1

const adc_dev* const _ADC1 = &_adc1

ADC1 device.

Definition at line 20 of file adc.c.

Referenced by F4Light::AnalogSource::_find_device().

◆ _adc2

const adc_dev _adc2
Initial value:
= {
.adcx = ADC2,
}

Definition at line 22 of file adc.c.

◆ _ADC2

const adc_dev* const _ADC2 = &_adc2

ADC2 device.

Definition at line 26 of file adc.c.

◆ _adc3

const adc_dev const _adc3
Initial value:
= {
.adcx = ADC3,
}

Definition at line 28 of file adc.c.

◆ _ADC3

const adc_dev* const _ADC3 = &_adc3

ADC3 device.

Definition at line 32 of file adc.c.

◆ ADC_ConvertedValue

__IO uint16_t ADC_ConvertedValue

Definition at line 34 of file adc.c.

◆ adc_data_ready

__IO bool adc_data_ready

Definition at line 35 of file adc.c.

Referenced by adc_init().