68 lines
1.5 KiB
C
68 lines
1.5 KiB
C
/***
|
|
* @Author: mbw
|
|
* @Date: 2024-09-05 16:04:44
|
|
* @LastEditors: mbw && 1600520629@qq.com
|
|
* @LastEditTime: 2024-09-14 13:59:01
|
|
* @FilePath: \USART1_Interrupt - RT-Thread\bsp\inc\bsp_sensor.h
|
|
* @Description:
|
|
* @
|
|
* @Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
|
|
*/
|
|
#ifndef __BSP_UART_H__
|
|
#define __BSP_UART_H__
|
|
|
|
#include "rtthread.h"
|
|
|
|
typedef enum
|
|
{
|
|
kUsartRxStart,
|
|
kUsartRxComplate,
|
|
} Te_State_e;
|
|
|
|
typedef struct
|
|
{
|
|
Te_State_e usart_rx_state;
|
|
} Ts_StateStruct;
|
|
|
|
// QX
|
|
typedef struct
|
|
{
|
|
char concentration[16]; // 浓度
|
|
char temperature[16]; // 温度
|
|
char sensor_temperature[16]; // 激光器温度
|
|
char signal_strength[16]; // 信号强度
|
|
char mu_factor[16]; // 放大系数
|
|
char sensor_status[4]; // 传感器状态
|
|
char checksum[4]; // 校验
|
|
|
|
} TsSensoStrData;
|
|
|
|
typedef struct
|
|
{
|
|
|
|
double concentration; // 浓度
|
|
double temperature; // 温度
|
|
double sensor_temperature; // 激光器温度
|
|
double signal_strength; // 信号强度
|
|
double mu_factor; // 放大系数 GAIN
|
|
rt_uint8_t sensor_status; // 传感器状态
|
|
rt_uint8_t checksum; // 校验
|
|
|
|
} TsSensorData;
|
|
|
|
// typedef struct
|
|
//{
|
|
// float concentration;//浓度
|
|
// float temperature;//温度
|
|
// float sensor_temperature;//激光器温度
|
|
// float signal_strength;//信号强度
|
|
// float mu_factor;//放大系数
|
|
// int sensor_status;//传感器状态
|
|
// int checksum;//校验
|
|
//
|
|
// } TsSensorData;
|
|
|
|
extern TsSensorData SensorData;
|
|
extern struct rt_semaphore sensor_rx_sem;
|
|
#endif //!__BSP_UART_H__
|