Mercurial > public > ostc4
comparison Small_CPU/Inc/uartProtocol_Co2.h @ 1072:8b97003dbb60 Icon_Integration
Improve CO2 calibration:
The most common calibration environment for diving is fresh air => ~400ppm co2. Some sensors do not have this setting as default => Calibration to 0ppm. To make sure that a proper calibration reference is set the common used value of 400ppm is not set before starting the calibration. For implementation new states were added to the co2 protocol state maschine. In addition the rx processor is now able to handle two responds parameters.
| author | Ideenmodellierer |
|---|---|
| date | Thu, 19 Feb 2026 21:37:34 +0100 |
| parents | a3f42192da0f |
| children |
comparison
equal
deleted
inserted
replaced
| 1071:b4a79464caf7 | 1072:8b97003dbb60 |
|---|---|
| 37 UART_CO2_IDLE, /* sensor detected and no communication pending */ | 37 UART_CO2_IDLE, /* sensor detected and no communication pending */ |
| 38 UART_CO2_ERROR, | 38 UART_CO2_ERROR, |
| 39 UART_CO2_SETUP = 10, /* collecting data needed to be read out of the sensor once at startup */ | 39 UART_CO2_SETUP = 10, /* collecting data needed to be read out of the sensor once at startup */ |
| 40 UART_CO2_MODE, /* set operation mode for sensor */ | 40 UART_CO2_MODE, /* set operation mode for sensor */ |
| 41 UART_CO2_OPERATING, /* normal operation */ | 41 UART_CO2_OPERATING, /* normal operation */ |
| 42 UART_CO2_CALIBRATE /* request calibration */ | 42 UART_CO2_CALIBRATE_H, /* request calibration */ |
| 43 UART_CO2_CALIBRATE_L, | |
| 44 UART_CO2_CALIBRATE | |
| 43 } uartCO2Status_t; | 45 } uartCO2Status_t; |
| 44 | 46 |
| 45 typedef enum | 47 typedef enum |
| 46 { | 48 { |
| 47 CO2RX_Ready= 0, /* Initial state */ | 49 CO2RX_Ready= 0, /* Initial state */ |
| 66 | 68 |
| 67 typedef enum | 69 typedef enum |
| 68 { | 70 { |
| 69 CO2CMD_MODE_POLL, /* Set operation mode of sensor to polling => only send data if requested */ | 71 CO2CMD_MODE_POLL, /* Set operation mode of sensor to polling => only send data if requested */ |
| 70 CO2CMD_MODE_STREAM, /* Set operation mode of sensor to streaming => send data every two seconds */ | 72 CO2CMD_MODE_STREAM, /* Set operation mode of sensor to streaming => send data every two seconds */ |
| 71 CO2CMD_CALIBRATE, /* Calibrate sensor */ | 73 CO2CMD_CALIBRATE_H, /* Calibrate sensor, send HIGH reference */ |
| 74 CO2CMD_CALIBRATE_L, /* Send low reference */ | |
| 75 CO2CMD_CALIBRATE, /* Execute calibration */ | |
| 72 CO2CMD_GETSCALE, /* Get scaling factor */ | 76 CO2CMD_GETSCALE, /* Get scaling factor */ |
| 73 CO2CMD_GETDATA /* Read sensor data */ | 77 CO2CMD_GETDATA /* Read sensor data */ |
| 74 } co2SensorCmd_t; | 78 } co2SensorCmd_t; |
| 75 | 79 |
| 76 | 80 |
