Mercurial > public > ostc4
diff Small_CPU/Inc/uartProtocol_O2.h @ 798:e9eba334b942
Migrated CO2 protocol implementation to new format:
The previous implementation was a monolithic protocol implementation which was not usable together with the multiplexer. The new implementation moves the CO2 implementation into a separate C file and decoubles the upper layer external interface, which is not able to handle DiveO2 and CO2 sensors in parallel without restriction to port assignments.
author | Ideenmodellierer |
---|---|
date | Mon, 07 Aug 2023 20:29:44 +0200 |
parents | d4083ac09b5d |
children |
line wrap: on
line diff
--- a/Small_CPU/Inc/uartProtocol_O2.h Mon Jul 31 20:10:27 2023 +0200 +++ b/Small_CPU/Inc/uartProtocol_O2.h Mon Aug 07 20:29:44 2023 +0200 @@ -31,17 +31,23 @@ #include "configuration.h" #include "stm32f4xx_hal.h" + typedef enum + { + UART_COMMON_INIT = 0, /* Default Status for every sensor type */ + UART_COMMON_IDLE, /* sensor detected and no communication pending */ + UART_COMMON_ERROR, /* Error message received from sensor */ + } uartCommonStatus_t; typedef enum { - UART_O2_INIT = 0, - UART_O2_CHECK, /* send blink command and check if sensor answers */ - UART_O2_REQ_INFO, /* request information about available internal sensors of sensor */ - UART_O2_REQ_ID, /* request ID of sensor */ - UART_O2_IDLE, /* sensor detected and no communication pending */ - UART_O2_REQ_O2, /* O2 value has been requested and is in receiption progress */ - UART_O2_REQ_RAW, /* Request O2 and extended raw data */ - UART_O2_ERROR /* Error message received from sensor */ + UART_O2_INIT = UART_COMMON_INIT, /* Default Status for every sensor type */ + UART_O2_IDLE = UART_COMMON_IDLE, /* sensor detected and no communication pending */ + UART_O2_ERROR = UART_COMMON_ERROR, /* Error message received from sensor */ + UART_O2_CHECK, /* send blink command and check if sensor answers */ + UART_O2_REQ_INFO, /* request information about available internal sensors of sensor */ + UART_O2_REQ_ID, /* request ID of sensor */ + UART_O2_REQ_O2, /* O2 value has been requested and is in receiption progress */ + UART_O2_REQ_RAW, /* Request O2 and extended raw data */ } uartO2Status_t;