comparison Small_CPU/Inc/externalInterface.h @ 781:01b3eb9d55c3

Update real multiplexer implementation: The final multiplexer provides 4 sensor connections instead of three supported by the prototype => A mupping functionality has been introduced to map the 4 possible mux addresses to the three visible O2 sensor slots. In addition the request cycle time is not depending on the number of sensors connected to make sure that all sensors are read within a defined time frame. The error reaction had to be updated to reset mux channels if one of the sensors fails to respond.
author Ideenmodellierer
date Mon, 29 May 2023 18:26:55 +0200
parents 0b5f45448eb6
children 19ab6f3ed52a
comparison
equal deleted inserted replaced
780:e40790a67165 781:01b3eb9d55c3
30 /* Includes ------------------------------------------------------------------*/ 30 /* Includes ------------------------------------------------------------------*/
31 #include "configuration.h" 31 #include "configuration.h"
32 32
33 33
34 #define MAX_ADC_CHANNEL (3u) /* number of channels to be read */ 34 #define MAX_ADC_CHANNEL (3u) /* number of channels to be read */
35 #define MAX_MUX_CHANNEL (4u) /* number of channels provided by the UART multiplexer */
35 #define EXTERNAL_ADC_NO_DATA 0xFF 36 #define EXTERNAL_ADC_NO_DATA 0xFF
36 37
37 #define EXT33V_CONTROL_PIN GPIO_PIN_7 /* PortC */ 38 #define EXT33V_CONTROL_PIN GPIO_PIN_7 /* PortC */
38 39
39 #define MIN_ADC_VOLTAGE_MV (5.0f) /* miminal voltage to rate an ADC channel as active */ 40 #define MIN_ADC_VOLTAGE_MV (5.0f) /* miminal voltage to rate an ADC channel as active */
48 DETECTION_ANALOG2, 49 DETECTION_ANALOG2,
49 DETECTION_UARTMUX, /* check if a uart multiplexer is present */ 50 DETECTION_UARTMUX, /* check if a uart multiplexer is present */
50 DETECTION_DIGO2_0, /* check UART channel for connected DigO2 sensor */ 51 DETECTION_DIGO2_0, /* check UART channel for connected DigO2 sensor */
51 DETECTION_DIGO2_1, 52 DETECTION_DIGO2_1,
52 DETECTION_DIGO2_2, 53 DETECTION_DIGO2_2,
54 DETECTION_DIGO2_3,
53 #ifdef ENABLE_CO2_SUPPORT 55 #ifdef ENABLE_CO2_SUPPORT
54 DETECTION_CO2, /* check UART channel for connected CO2 sensor */ 56 DETECTION_CO2, /* check UART channel for connected CO2 sensor */
55 #endif 57 #endif
56 #ifdef ENABLE_SENTINEL_MODE 58 #ifdef ENABLE_SENTINEL_MODE
57 DETECTION_SENTINEL, /* check UART channel for connected Sentinel */ 59 DETECTION_SENTINEL, /* check UART channel for connected Sentinel */