CubeMon-Vue-Demo-STM32F407VGT6U
ai.h
Go to the documentation of this file.
1
20#ifndef INC_LIB_AI_H_
21#define INC_LIB_AI_H_
22
24#include <lib/uti/utility.h>
25#include <lib/uti/lib_config.h>
26
27#ifdef LIB_AI
28#include <prog/init.h>
29#else
34typedef enum anaInputs {
35 AI_NONE
37#endif
38
39extern uint32_t ADC_data_buffer[(AI_NONE * 2) + 1];
40
52retStatus analog_input_init(anaInputs an_input_name, int32_t sample_from,
53 liner_fce linearization_function);
54
67retStatus analog_input_get(uint16_t analog_input, uint16_t data, int32_t *value);
68
73void analog_input_handle(void);
74
80__weak HAL_StatusTypeDef analog_input_start(ADC_HandleTypeDef adc);
81
85uint32_t lin_adc_no_scaling_no_corrections(uint32_t adc_value);
86
87#endif /* INC_LIB_AI_H_ */
retStatus analog_input_get(uint16_t analog_input, uint16_t data, int32_t *value)
Standardized getter function for digital input library.
Definition: ai.c:34
anaInputs
Definition: ai.h:34
retStatus analog_input_init(anaInputs an_input_name, int32_t sample_from, liner_fce linearization_function)
Analog input initialization function.
Definition: ai.c:66
__weak HAL_StatusTypeDef analog_input_start(ADC_HandleTypeDef adc)
Starts the ADC with DMA in interrupt mode using STM32 HAL.
Definition: ai.c:139
uint32_t lin_adc_no_scaling_no_corrections(uint32_t adc_value)
Convert ADC reading to voltage for a simple 0-3.3V input.
Definition: ai.c:144
void analog_input_handle(void)
Handler for analog inputs.
Definition: ai.c:94
provides HAL includes for different MCU cores
Initialization of digital/analog inputs and outputs.
Defines for turning on/off the library modules.
Defines and functions that are useful for all library files.
retStatus
possible return values
Definition: utility.h:13