121 return (this->
buffer[index - 1] & 0xFFFF);
#define DMA_MemoryInc_Enable
#define ADC_SampleTime_480Cycles
void ADC_ContinuousModeCmd(ADC_TypeDef *ADCx, FunctionalState NewState)
Enables or disables the ADC continuous conversion mode.
static constexpr uint16_t NO_READING
static constexpr uint8_t SQR1_CHANNEL_COUNT_OFFSET
#define DMA_Priority_Medium
#define DMA_FIFOStatus_1QuarterFull
DMA Init structure definition.
bool is_initialized() const
Checks if the adc has been initialized, i.e. init has been called.
ADC Init structure definition.
#define ADC_TwoSamplingDelay_5Cycles
Analog to Digital Converter.
#define ADC_Mode_Independent
void ADC_Cmd(ADC_TypeDef *ADCx, FunctionalState NewState)
Enables or disables the specified ADC peripheral.
FunctionalState ADC_ContinuousConvMode
void DMA_DeInit(DMA_Stream_TypeDef *DMAy_Streamx)
Deinitialize the DMAy Streamx registers to their default reset values.
#define DMA_PeripheralInc_Disable
void ADC_DMARequestAfterLastTransferCmd(ADC_TypeDef *ADCx, FunctionalState NewState)
Enables or disables the ADC DMA request after last transfer (Single-ADC mode)
void ADC_StructInit(ADC_InitTypeDef *ADC_InitStruct)
Fills each ADC_InitStruct member with its default value.
uint32_t DMA_MemoryDataSize
void ADC_DMACmd(ADC_TypeDef *ADCx, FunctionalState NewState)
Enables or disables the specified ADC DMA request.
static constexpr uint8_t CHANNEL_COUNT
void DMA_Init(DMA_Stream_TypeDef *DMAy_Streamx, DMA_InitTypeDef *DMA_InitStruct)
Initializes the DMAy Streamx according to the specified parameters in the DMA_InitStruct structure...
uint32_t DMA_PeripheralInc
#define ADC_Prescaler_Div2
#define DMA_MemoryDataSize_Word
uint32_t DMA_PeripheralDataSize
ADC Common Init structure definition.
void DMA_StructInit(DMA_InitTypeDef *DMA_InitStruct)
Fills each DMA_InitStruct member with its default value.
uint32_t DMA_PeripheralBurst
void DMA_Cmd(DMA_Stream_TypeDef *DMAy_Streamx, FunctionalState NewState)
Enables or disables the specified DMAy Streamx.
uint32_t DMA_PeripheralBaseAddr
uint32_t DMA_Memory0BaseAddr
uint8_t ADC_NbrOfConversion
const ADCHardwareStruct * adc_def_
uint8_t get_current_channel_count() const
Checks the number of used channels. If this exceeds CHANNEL_COUNT, stuff will break.
#define DMA_MemoryBurst_Single
uint32_t ADC_TwoSamplingDelay
DMA_Stream_TypeDef * DMA_Stream
void init(const ADCHardwareStruct *adc_def)
Initializes the ADC according to the definition struct provided.
#define ADC_DMAAccessMode_1
#define DMA_FIFOMode_Disable
uint8_t add_channel(uint8_t channel)
Adds a channel to the list that is scanned.
#define ADC_Resolution_12b
uint16_t read(uint8_t index) const
Reads a single channel.
void ADC_SoftwareStartConv(ADC_TypeDef *ADCx)
Enables the selected ADC software start conversion of the regular channels.
FunctionalState ADC_ScanConvMode
uint32_t ADC_DMAAccessMode
void ADC_CommonInit(ADC_CommonInitTypeDef *ADC_CommonInitStruct)
Initializes the ADCs peripherals according to the specified parameters in the ADC_CommonInitStruct.
volatile uint32_t buffer[CHANNEL_COUNT]
#define DMA_DIR_PeripheralToMemory
void ADC_RegularChannelConfig(ADC_TypeDef *ADCx, uint8_t ADC_Channel, uint8_t Rank, uint8_t ADC_SampleTime)
Configures for the selected ADC regular channel its corresponding rank in the sequencer and its sampl...
#define DMA_Mode_Circular
#define ADC_DataAlign_Right
static constexpr uint32_t SQR1_CHANNEL_COUNT_MASK
#define DMA_PeripheralDataSize_Word
void ADC_Init(ADC_TypeDef *ADCx, ADC_InitTypeDef *ADC_InitStruct)
Initializes the ADCx peripheral according to the specified parameters in the ADC_InitStruct.
#define DMA_PeripheralBurst_Single