86#include <stm32g4xx_hal.h>
91#define CORE_ADC_ALLOWED_ADC1 0x0001
92#define CORE_ADC_ALLOWED_ADC2 0x0002
93#define CORE_ADC_ALLOWED_ADC3 0x0004
94#define CORE_ADC_ALLOWED_ADC4 0x0008
95#define CORE_ADC_ALLOWED_ADC5 0x0010
96#define CORE_ADC_ALLOWED_OPAMP1 0x0100
97#define CORE_ADC_ALLOWED_OPAMP2 0x0200
98#define CORE_ADC_ALLOWED_OPAMP3 0x0400
99#define CORE_ADC_ALLOWED_OPAMP4 0x0800
100#define CORE_ADC_ALLOWED_OPAMP5 0x1000
101#define CORE_ADC_ALLOWED_OPAMP6 0x2000
102#define CORE_ADC_ALLOWED_ADC_MASK 0x001f
103#define CORE_ADC_ALLOWED_OPAMP_MASK 0x3f00
109 uint16_t allowed_connections;
114 OPAMP_TypeDef *opamp;
115 uint8_t adc_chan_sel;
116 uint8_t opamp_chan_sel;
bool core_ADC_read_channel(GPIO_TypeDef *port, uint32_t pin, uint16_t *result)
Read the value of an analog input as a value between 0 and 4095.
Definition adc.c:231
uint16_t core_ADC_read_vrefint()
Read the value of the internal voltage reference with respect to the VREF pin.
Definition adc.c:124
bool core_ADC_init(ADC_TypeDef *adc)
Initialize an ADC module, including its clock. Also performs calibration. GPIO ports are not initiali...
Definition adc.c:75
bool core_ADC_setup_pin(GPIO_TypeDef *port, uint32_t pin, uint8_t opamp)
Set up a pin as an analog input.
Definition adc.c:153