Hierodule 1.6.2
Utility module set for STM32 MCUs
Loading...
Searching...
No Matches

Elements of the module that are confined to the scope of the compilation unit. Perfectly corresponds to the module's source file, except the IRQ handlers. More...

Functions

void Smoothen (HIERODULE_ADC_Wrapper *Wrapper)
 Applies a cumulative-smoothening filter before updating the wrapper data field.
 

Variables

static HIERODULE_ADC_WrapperADC1_Wrapper = NULL
 ADC wrapper pointer meant for ADC1.
 
static HIERODULE_ADC_WrapperADC2_Wrapper = NULL
 ADC wrapper pointer meant for ADC2.
Requires the device specific macro __STM32F103xB_H to be defined.
 

Detailed Description

Implements the routines defined in the header file and routines necessary for those in the background. Pointers of ADC wrappers are also defined here.
IRQ definitions with custom ISR implementations are also included at the end of the file.

Function Documentation

◆ Smoothen()

void Smoothen ( HIERODULE_ADC_Wrapper * Wrapper)
Parameters
WrapperPointer to the ADC wrapper.
Returns
None

Meant to be used in IRQ bodies and not for custom implementations, hence the reason it's static.

Requires HIERODULE_ADC_SMOOTHENING_FILTER to be defined.

Definition at line 47 of file hierodule_adc.c.

48{
49 Wrapper->Data = (Wrapper->Data*Wrapper->FilterWeight) +
50 (Wrapper->_ADC->DR*(1.0-Wrapper->FilterWeight));
51}
HIERODULE_USB_Wrapper Wrapper
Extern declaration for the wrapper instance in the source file.

References Wrapper.

Referenced by ADC1_2_IRQHandler(), ADC1_IRQHandler(), and ADC_IRQHandler().

Variable Documentation

◆ ADC1_Wrapper

HIERODULE_ADC_Wrapper* ADC1_Wrapper = NULL
static

◆ ADC2_Wrapper

HIERODULE_ADC_Wrapper* ADC2_Wrapper = NULL
static

Definition at line 34 of file hierodule_adc.c.

Referenced by ADC1_2_IRQHandler(), and HIERODULE_ADC_InitWrapper().