GlobLib
HAL and API libraries for MCUs and hardware.
stm32f103cb_adc.h File Reference

Header file for stm32f103cb ADC API. More...

#include "stm32f103cb_gpio.h"
#include "stm32f103cb_debug.h"
#include <libopencm3/stm32/adc.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define ADC_VOLT_REF   3.3f
 Typical voltage reference value used by ADC_volts()
 

Functions

mcu_error ADC_setup (gpio_port port, gpio_pin pin)
 Initialize ADC for a given port and pin. More...
 
uint16_t ADC_addChannel (gpio_port port, gpio_pin pin)
 Add an aditional channel to the ADC. More...
 
uint16_t ADC_sample (gpio_port port, gpio_pin pin)
 Get a sample from the ADC. More...
 
float ADC_volts (gpio_port port, gpio_pin pin)
 Get a sample from the ADC and convert it to volts. More...
 

Detailed Description

Header file for stm32f103cb ADC API.

Definition in file stm32f103cb_adc.h.