#ifndef __COH2_H
#define __COH2_H
#include "main.h"


// 声明CO传感器数据数组
extern float CO_data[];
// 声明H2传感器数据数组
extern float H2_data[];

uint16_t calculate_crc16(uint8_t *data, uint16_t length) ;
int find_sensor_index(uint8_t address, uint8_t *address_array, int num_sensors);
void send_modbus_command(uint8_t sensor_address);
void send_H2_0x0B_command(void);
void send_CO_0x0E_command(void) ;
void receive_and_store_data(uint8_t sensor_address)  ;
void receive_and_store_data_CO_0E(void) ;
void receive_and_store_data_H2_0B(void);
float modbus_to_float(uint8_t *data);
void read_gas_sensors_485data(void) ;
#endif /*__COH2_H*/

