comparison Small_CPU/Inc/externalInterface.h @ 554:3328189786e7

Added external ADC interface functionality (MCP3424): Added communication protocoll to read data from external ADC. At the moment 16bit and 18bit resolutions are supported. External data will be read and forwarded depending on the conversion time of the ADC.
author Ideenmodellierer
date Thu, 12 Nov 2020 19:46:03 +0100
parents
children 1b995079c045
comparison
equal deleted inserted replaced
553:43a2dd4ba30f 554:3328189786e7
1 /**
2 ******************************************************************************
3 * @file externalInterface.h
4 * @author heinrichs weikamp gmbh
5 * @version V0.0.1
6 * @date 07-Nov-2020
7 * @brief Interface functionality to proceed external analog signal via i2c connection
8 *
9 @verbatim
10 ==============================================================================
11 ##### How to use #####
12 ==============================================================================
13 @endverbatim
14 ******************************************************************************
15 * @attention
16 *
17 * <h2><center>&copy; COPYRIGHT(c) 2014 heinrichs weikamp</center></h2>
18 *
19 ******************************************************************************
20 */
21
22 /* Define to prevent recursive inclusion -------------------------------------*/
23 #ifndef EXTERNAL_INTERFACE_H
24 #define EXTERNAL_INTERFACE_H
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 /* Includes ------------------------------------------------------------------*/
31
32 #define MAX_ADC_CHANNEL (3u) /* number of channels to be read */
33 #define EXTERNAL_ADC_NO_DATA 0xFF
34
35 void externalInterface_Init(void);
36 uint8_t externalInterface_StartConversion(uint8_t channel);
37 uint8_t externalInterface_ReadAndSwitch();
38 float externalInterface_CalculateADCValue(uint8_t channel);
39 float getExternalInterfaceChannel(uint8_t channel);
40
41 #endif /* EXTERNAL_INTERFACE_H */