Hierodule 1.6.2
Utility module set for STM32 MCUs
Loading...
Searching...
No Matches
hierodule_adc.h
Go to the documentation of this file.
1
12#ifndef __HIERODULE_ADC_H
13#define __HIERODULE_ADC_H
14
15#ifdef __cplusplus
16extern "C"
17{
18#endif
19
38#define HIERODULE_ADC_SMOOTHENING_FILTER
39
40#include <main.h>
41#include <stdlib.h>
42
46typedef struct
47{
51 ADC_TypeDef *_ADC;
55 uint16_t Data;
57 #ifdef HIERODULE_ADC_SMOOTHENING_FILTER
63 #endif
67 void (*Data_Handler)(uint16_t);
69
75 void (*ISR)(uint16_t));
76
82
88
94
102#ifdef __cplusplus
103}
104#endif
105
106#endif /* __HIERODULE_ADC_H */
HIERODULE_ADC_Wrapper ** HIERODULE_ADC_InitWrapper(ADC_TypeDef *_ADC, void(*ISR)(uint16_t))
Initializes a wrapper for the specified ADC peripheral.
void HIERODULE_ADC_Enable(HIERODULE_ADC_Wrapper *Wrapper)
Updates relevant control register bits to start ADC action.
void HIERODULE_ADC_ReleaseWrapper(HIERODULE_ADC_Wrapper *Wrapper)
Frees the memory allocated to an ADC wrapper.
void HIERODULE_ADC_Disable(HIERODULE_ADC_Wrapper *Wrapper)
Updates relevant control register bits to stop ADC action.
HIERODULE_USB_Wrapper Wrapper
Extern declaration for the wrapper instance in the source file.
Struct that keeps variables for the ADC data, a pointer to the ADC peripheral and a pointer to the IS...
ADC_TypeDef * _ADC
Pointer to the ADC peripheral.
double FilterWeight
Filter weight for the smoothening filter.
uint16_t Data
Variable to assign the received ADC data.