Compare commits
No commits in common. "master" and "MAX_WAVE" have entirely different histories.
|
@ -20,10 +20,8 @@
|
|||
|
||||
|
||||
|
||||
#define ADC_GAIN_ENABLE 190
|
||||
#define ADC_GAIN_DISABLE 1900
|
||||
|
||||
#define K_128 0xA12EE1FE
|
||||
|
||||
// 延时REV_MUTE_DELAY us启动ADC采集数据
|
||||
// 最大风速30m/s 2.5M 采样率 延时260uS
|
||||
#define REV_MUTE_DELAY_US 174
|
||||
|
@ -37,12 +35,8 @@
|
|||
#define DRIVE_FREQ_MHz ((float32_t)0.2)
|
||||
|
||||
// 驱动方波个数 实际个数 DRIVE_NUM+1
|
||||
#define DRIVE_NUM 2
|
||||
|
||||
// 温度探头版本,SHT30=1,TMP117=2
|
||||
#define SHT30_SENSOR 1
|
||||
#define TMP117_SENSOR 2
|
||||
#define TEMP_SENSOR TMP117_SENSOR
|
||||
#define DRIVE_NUM 2
|
||||
|
||||
|
||||
///已将DISTANCE写入配置文件,在结构体g_stConfigInfo.transducer_distace中
|
||||
|
@ -140,13 +134,12 @@ typedef struct _mcs_para{
|
|||
}mcs_para;
|
||||
extern mcs_para g_stMcs_Para;
|
||||
|
||||
//错误日志
|
||||
typedef struct _error_log{
|
||||
uint16_t tof_error_NS:1; /* 接受南北信号(tofy,tofx<0)很小 */
|
||||
uint16_t tof_error_WE:1; /* 接受东西信号(tofy,tofx<0)很小 */
|
||||
uint16_t temp_error_SHT30:1; /* SHT30错误日志(温湿度) */
|
||||
uint16_t temp_error_HP203B:1; /* HP203B错误日志(大气压) */
|
||||
uint16_t temp_error_TMP117:1; /* TMP117错误日志(温度) */
|
||||
uint16_t error_4:1; /* 保留 */
|
||||
uint16_t error_5:1; /* 保留 */
|
||||
uint16_t error_6:1; /* 保留 */
|
||||
uint16_t error_7:1; /* 保留 */
|
||||
|
@ -160,19 +153,6 @@ typedef struct _error_log{
|
|||
uint16_t error_15:1; /* 保留 */
|
||||
}error_log;
|
||||
extern error_log g_error_log;
|
||||
|
||||
//增益控制位
|
||||
typedef struct _adc_gain_status{
|
||||
uint16_t gain_status_s:1;
|
||||
uint16_t gain_status_n:1;
|
||||
uint16_t gain_status_e:1;
|
||||
uint16_t gain_status_w:1;
|
||||
uint16_t bit4:1;
|
||||
uint16_t bit5:1;
|
||||
uint16_t bit6:1;
|
||||
uint16_t bit7:1;
|
||||
}adc_gain_status;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#define MAX_VALUES 50
|
||||
|
@ -182,10 +162,10 @@ typedef struct {
|
|||
uint16_t currentIndex;
|
||||
uint16_t ave;
|
||||
} AverageCalculator;
|
||||
extern AverageCalculator wave_max_val_1;
|
||||
extern AverageCalculator wave_max_val_2;
|
||||
extern AverageCalculator wave_max_val_3;
|
||||
extern AverageCalculator wave_max_val_4;
|
||||
extern AverageCalculator Test1;
|
||||
extern AverageCalculator Test2;
|
||||
extern AverageCalculator Test3;
|
||||
extern AverageCalculator Test4;
|
||||
|
||||
// 切换通道
|
||||
void change_channel(uint32_t channel);
|
||||
|
@ -196,9 +176,6 @@ void play_one_measure(int16_t* result_data,uint32_t len);
|
|||
// 通过采集的数据计算 风速 风向
|
||||
void calculate_param(Weather_param *parm ,uint32_t direction , int16_t *adc_buf1,int16_t *adc_buf2,uint32_t len);
|
||||
|
||||
// ADC增益控制
|
||||
extern void enable_adc_gain(void);
|
||||
extern void disable_adc_gain(void);
|
||||
|
||||
void wind_task(void const * argument);
|
||||
void tem_hum_update_task(void const * argument);
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#ifndef _ENCRYPT_H_
|
||||
#define _ENCRYPT_H_
|
||||
#include "comm_types.h"
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include "inflash.h"
|
||||
#include "anemometer_dev.h"
|
||||
#include "frt_protocol.h"
|
||||
|
||||
#define K_64 0x9B45824A
|
||||
|
||||
uint8_t JudgeEncrypt();
|
||||
|
||||
#endif //_ENCRYPT_H_
|
|
@ -23,23 +23,22 @@ typedef enum
|
|||
typedef enum
|
||||
{
|
||||
FRT_REGISTER_MIN_WIND_DIRECTION = 0, /* 最小风向 */
|
||||
FRT_REGISTER_AVERAGE_WIND_DIRECTION = 1, /* 平均风向 */
|
||||
FRT_REGISTER_MAX_WIND_DIRECTION = 2, /* 最大风向 */
|
||||
FRT_REGISTER_MIN_WIND_SPEED = 3, /* 最小风速 */
|
||||
FRT_REGISTER_AVERAGE_WIND_SPEED = 4, /* 平均风速 */
|
||||
FRT_REGISTER_MAX_WIND_SPEED = 5, /* 最大风速 */
|
||||
FRT_REGISTER_TEMPERATURE = 6, /* 大气温度 */
|
||||
FRT_REGISTER_HUMIDITY = 7, /* 大气湿度 */
|
||||
FRT_REGISTER_PRESSURE = 8, /* 大气压 */
|
||||
FRT_REGISTER_RAIN = 9, /* 雨量 */
|
||||
FRT_REGISTER_PRECIPITATION_INTENSITY = 10, /* 总辐射 */
|
||||
FRT_REGISTER_UV_INTENSITY = 11, /* 紫外强度 */
|
||||
FRT_REGISTER_THROUGH_WIND_DIRECTION = 12, /* 极小风向 */
|
||||
FRT_REGISTER_INSTANTANEOUS_WIND_DIRECTION = 13, /* 瞬时风向 */
|
||||
FRT_REGISTER_PEAK_WIND_DIRECTION = 14, /* 极大风向 */
|
||||
FRT_REGISTER_THROUGH_WIND_SPEED = 15, /* 极小风速 */
|
||||
FRT_REGISTER_INSTANTANEOUS_WIND_SPEED = 16, /* 瞬时风速 */
|
||||
FRT_REGISTER_PEAK_WIND_SPEED = 17, /* 极大风速 */
|
||||
FRT_REGISTER_THROUGH_WIND_DIRECTION = 1, /* 极小风向 */
|
||||
FRT_REGISTER_AVERAGE_WIND_DIRECTION = 2, /* 平均风向 */
|
||||
FRT_REGISTER_INSTANTANEOUS_WIND_DIRECTION = 3, /* 瞬时风向 */
|
||||
FRT_REGISTER_PEAK_WIND_DIRECTION = 4, /* 极大风向 */
|
||||
FRT_REGISTER_MAX_WIND_DIRECTION = 5, /* 最大风向 */
|
||||
FRT_REGISTER_MIN_WIND_SPEED = 6, /* 最小风速 */
|
||||
FRT_REGISTER_THROUGH_WIND_SPEED = 7, /* 极小风速 */
|
||||
FRT_REGISTER_AVERAGE_WIND_SPEED = 8, /* 平均风速 */
|
||||
FRT_REGISTER_INSTANTANEOUS_WIND_SPEED = 9, /* 瞬时风速 */
|
||||
FRT_REGISTER_PEAK_WIND_SPEED = 10, /* 极大风速 */
|
||||
FRT_REGISTER_MAX_WIND_SPEED = 11, /* 最大风速 */
|
||||
FRT_REGISTER_TEMPERATURE = 12, /* 大气温度 */
|
||||
FRT_REGISTER_HUMIDITY = 13, /* 大气湿度 */
|
||||
FRT_REGISTER_PRESSURE = 14, /* 大气压 */
|
||||
FRT_REGISTER_RAIN = 15, /* 雨量 */
|
||||
FRT_REGISTER_PRECIPITATION_INTENSITY = 16, /* 总辐射 */
|
||||
|
||||
FRT_REGISTER_DEVICE_ADDR = 20, /* 设备地址 */
|
||||
FRT_REGISTER_COMMU_BAUDRATE = 21, /* 波特率 */
|
||||
|
@ -58,33 +57,24 @@ typedef enum
|
|||
FRT_REGISTER_COEFFICIENT = 34, /* 粘度修正系数 */
|
||||
FRT_REGISTER_DISTANCE_NS = 35, /* 南北换能器表面距离 */
|
||||
FRT_REGISTER_DISTANCE_WE = 36, /* 东西换能器表面距离 */
|
||||
FRT_REGISTER_ANEMOMETER_DELAY = 37, /* 换能器匹配层延时 */
|
||||
FRT_REGISTER_ERROR_LOG = 38, /* 错误日志 */
|
||||
FRT_REGISTER_WIND_C_NS = 39, /* 计算得到的南北风速 */
|
||||
FRT_REGISTER_WIND_C_WE = 40, /* 计算得到的东西风速 */
|
||||
FRT_REGISTER_LINEAR_POINT_X_1 = 41, /* 线性插值原始点1 */
|
||||
FRT_REGISTER_LINEAR_POINT_X_2 = 42, /* 线性插值原始点2 */
|
||||
FRT_REGISTER_LINEAR_POINT_X_3 = 43, /* 线性插值原始点3 */
|
||||
FRT_REGISTER_LINEAR_POINT_X_4 = 44, /* 线性插值原始点4 */
|
||||
FRT_REGISTER_LINEAR_POINT_X_5 = 45, /* 线性插值原始点5 */
|
||||
FRT_REGISTER_LINEAR_POINT_Y_1 = 46, /* 线性插值校准点1 */
|
||||
FRT_REGISTER_LINEAR_POINT_Y_2 = 47, /* 线性插值校准点2 */
|
||||
FRT_REGISTER_LINEAR_POINT_Y_3 = 48, /* 线性插值校准点3 */
|
||||
FRT_REGISTER_LINEAR_POINT_Y_4 = 49, /* 线性插值校准点4 */
|
||||
FRT_REGISTER_LINEAR_POINT_Y_5 = 50, /* 线性插值校准点5 */
|
||||
FRT_REGISTER_LINEAR_ENABLE = 51, /* 线性插值使能 */
|
||||
FRT_REGISTER_MAX_WAVE_1 = 52, /* 换能器最大波形 */
|
||||
FRT_REGISTER_MAX_WAVE_2 = 53, /* 换能器最大波形 */
|
||||
FRT_REGISTER_MAX_WAVE_3 = 54, /* 换能器最大波形 */
|
||||
FRT_REGISTER_MAX_WAVE_4 = 55, /* 换能器最大波形 */
|
||||
FRT_REGISTER_ID_1 = 56, /* ID16 */
|
||||
FRT_REGISTER_ID_2 = 57, /* ID32 */
|
||||
FRT_REGISTER_ID_3 = 58, /* ID48 */
|
||||
FRT_REGISTER_ID_4 = 59, /* ID64 */
|
||||
FRT_REGISTER_ENCRYPT_1 = 60, /* 密文16 */
|
||||
FRT_REGISTER_ENCRYPT_2 = 61, /* 密文32 */
|
||||
FRT_REGISTER_ENCRYPT_3 = 62, /* 密文48 */
|
||||
FRT_REGISTER_ENCRYPT_4 = 63, /* 密文64 */
|
||||
FRT_REGISTER_ERROR_LOG = 37, /* 错误日志 */
|
||||
FRT_REGISTER_WIND_C_NS = 38, /* 计算得到的南北风速 */
|
||||
FRT_REGISTER_WIND_C_WE = 39, /* 计算得到的东西风速 */
|
||||
FRT_REGISTER_LINEAR_POINT_X_1 = 40, /* 线性插值原始点1 */
|
||||
FRT_REGISTER_LINEAR_POINT_X_2 = 41, /* 线性插值原始点2 */
|
||||
FRT_REGISTER_LINEAR_POINT_X_3 = 42, /* 线性插值原始点3 */
|
||||
FRT_REGISTER_LINEAR_POINT_X_4 = 43, /* 线性插值原始点4 */
|
||||
FRT_REGISTER_LINEAR_POINT_X_5 = 44, /* 线性插值原始点5 */
|
||||
FRT_REGISTER_LINEAR_POINT_Y_1 = 45, /* 线性插值校准点1 */
|
||||
FRT_REGISTER_LINEAR_POINT_Y_2 = 46, /* 线性插值校准点2 */
|
||||
FRT_REGISTER_LINEAR_POINT_Y_3 = 47, /* 线性插值校准点3 */
|
||||
FRT_REGISTER_LINEAR_POINT_Y_4 = 48, /* 线性插值校准点4 */
|
||||
FRT_REGISTER_LINEAR_POINT_Y_5 = 49, /* 线性插值校准点5 */
|
||||
FRT_REGISTER_LINEAR_ENABLE = 50, /* 线性插值使能 */
|
||||
FRT_REGISTER_TEST1 = 51, /* 测试寄存器 */
|
||||
FRT_REGISTER_TEST2 = 52, /* 测试寄存器 */
|
||||
FRT_REGISTER_TEST3 = 53, /* 测试寄存器 */
|
||||
FRT_REGISTER_TEST4 = 54, /* 测试寄存器 */
|
||||
}FRT_MsgRegister;
|
||||
|
||||
#pragma pack(push,1)
|
||||
|
@ -142,8 +132,6 @@ typedef struct _FRT_RegProcTable_s{
|
|||
void read_and_process_uart_data(device_handle uart_handle);
|
||||
#pragma pack(pop)
|
||||
|
||||
extern uint32_t K_96;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -31,23 +31,12 @@ typedef struct _usr_config_info{
|
|||
u_int16_t uart_baud; /* 串口波特率 */
|
||||
u_int16_t speed_average_time; /* 风速平均时间 */
|
||||
u_int16_t temp_hum_update_time; /* 温湿度平均时间 */
|
||||
u_int16_t temp0; /* 占位留待升级 */
|
||||
u_int16_t temp1; /* 占位留待升级 */
|
||||
u_int16_t temp2; /* 占位留待升级 */
|
||||
u_int16_t temp3; /* 占位留待升级 */
|
||||
u_int16_t temp4; /* 占位留待升级 */
|
||||
u_int16_t temp5; /* 占位留待升级 */
|
||||
u_int16_t temp6; /* 占位留待升级 */
|
||||
u_int16_t temp7; /* 占位留待升级 */
|
||||
u_int16_t temp8; /* 占位留待升级 */
|
||||
u_int16_t temp9; /* 占位留待升级 */
|
||||
u_int8_t flag_end;
|
||||
}usr_config_info;
|
||||
|
||||
//出厂配置参数
|
||||
typedef struct _factory_config_info{
|
||||
u_int8_t flag_head;
|
||||
u_int32_t encrypt_0; /* 前32位密文 */
|
||||
u_int16_t transducer_cfg_1R5; /* 换能器参数 */
|
||||
u_int16_t transducer_cfg_4R5; /* 换能器参数 */
|
||||
u_int16_t transducer_cfg_8R0; /* 换能器参数 */
|
||||
|
@ -66,18 +55,6 @@ typedef struct _factory_config_info{
|
|||
u_int16_t linear_point_5_x; /* 线性插值点5X */
|
||||
u_int16_t linear_point_5_y; /* 线性插值点5Y */
|
||||
u_int16_t linear_enable; /* 线性插值使能 */
|
||||
u_int32_t encrypt_1; /* 后32位密文 */
|
||||
u_int16_t anemometerDelayTime; /* 换能器匹配层延时us */
|
||||
u_int16_t temp0; /* 占位留待升级 */
|
||||
u_int16_t temp1; /* 占位留待升级 */
|
||||
u_int16_t temp2; /* 占位留待升级 */
|
||||
u_int16_t temp3; /* 占位留待升级 */
|
||||
u_int16_t temp4; /* 占位留待升级 */
|
||||
u_int16_t temp5; /* 占位留待升级 */
|
||||
u_int16_t temp6; /* 占位留待升级 */
|
||||
u_int16_t temp7; /* 占位留待升级 */
|
||||
u_int16_t temp8; /* 占位留待升级 */
|
||||
u_int16_t temp9; /* 占位留待升级 */
|
||||
u_int8_t flag_end;
|
||||
}factory_config_info;
|
||||
#pragma pack(pop)
|
||||
|
|
|
@ -6,11 +6,8 @@
|
|||
#include "fdacoefs.h"
|
||||
#include "sht30.h"
|
||||
#include "hp203b.h"
|
||||
#include "tmp117.h"
|
||||
#include "FIR.h"
|
||||
#include "LowPassFilter.h"
|
||||
#include "encrypt.h"
|
||||
#include "ms5607.h"
|
||||
|
||||
#define AVE_TIME 600 //滑动平均时间,秒,最大600
|
||||
#define COVER_TINE 10 //探头遮挡后导致的接收次数过小的报错临界次数
|
||||
|
@ -39,10 +36,14 @@ void addValue(AverageCalculator *calc, uint16_t value) {
|
|||
}
|
||||
calc->ave = sum / calc->count;
|
||||
}
|
||||
AverageCalculator wave_max_val_1;
|
||||
AverageCalculator wave_max_val_2;
|
||||
AverageCalculator wave_max_val_3;
|
||||
AverageCalculator wave_max_val_4;
|
||||
AverageCalculator Test1;
|
||||
AverageCalculator Test2;
|
||||
AverageCalculator Test3;
|
||||
AverageCalculator Test4;
|
||||
uint16_t wave_max_val1;
|
||||
uint16_t wave_max_val2;
|
||||
uint16_t wave_max_val3;
|
||||
uint16_t wave_max_val4;
|
||||
|
||||
int16_t adc_val[ADC_VAL_LEN];
|
||||
int16_t adc_val1[ADC_VAL_LEN];
|
||||
|
@ -76,81 +77,6 @@ float32_t max_val_f32;
|
|||
|
||||
int32_t max_val_index_f32;
|
||||
|
||||
// adc增益使能
|
||||
void enable_adc_gain(void)
|
||||
{
|
||||
HAL_GPIO_ReadPin(GPIO_GAIN_SET_GPIO_Port, GPIO_GAIN_SET_Pin) ? (void)0 : HAL_GPIO_WritePin(GPIO_GAIN_SET_GPIO_Port, GPIO_GAIN_SET_Pin, GPIO_PIN_SET);
|
||||
}
|
||||
// adc增益取消使能
|
||||
void disable_adc_gain(void)
|
||||
{
|
||||
HAL_GPIO_ReadPin(GPIO_GAIN_SET_GPIO_Port, GPIO_GAIN_SET_Pin) ? HAL_GPIO_WritePin(GPIO_GAIN_SET_GPIO_Port, GPIO_GAIN_SET_Pin, GPIO_PIN_RESET) : (void)0;
|
||||
}
|
||||
|
||||
adc_gain_status gain_status = {0};
|
||||
// adc增益控制,0x01:S,0x02:N,0x03:E,0x04:W,当次使能下次生效,暂定为180开,1900关
|
||||
void config_adc_gain(uint8_t channel, uint16_t max_val)
|
||||
{
|
||||
switch(channel)
|
||||
{
|
||||
case 0x01:
|
||||
if(max_val <= ADC_GAIN_ENABLE)
|
||||
gain_status.gain_status_s = 1;
|
||||
else if(max_val >= ADC_GAIN_DISABLE)
|
||||
gain_status.gain_status_s = 0;
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
if(max_val <= ADC_GAIN_ENABLE)
|
||||
gain_status.gain_status_n = 1;
|
||||
else if(max_val >= ADC_GAIN_DISABLE)
|
||||
gain_status.gain_status_n = 0;
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
if(max_val <= ADC_GAIN_ENABLE)
|
||||
gain_status.gain_status_e = 1;
|
||||
else if(max_val >= ADC_GAIN_DISABLE)
|
||||
gain_status.gain_status_e = 0;
|
||||
break;
|
||||
|
||||
case 0x04:
|
||||
if(max_val <= ADC_GAIN_ENABLE)
|
||||
gain_status.gain_status_w = 1;
|
||||
else if(max_val >= ADC_GAIN_DISABLE)
|
||||
gain_status.gain_status_w = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void use_adc_gain(uint8_t channel)
|
||||
{
|
||||
switch(channel)
|
||||
{
|
||||
case 0x01:
|
||||
gain_status.gain_status_s ? enable_adc_gain() : disable_adc_gain();
|
||||
break;
|
||||
|
||||
case 0x02:
|
||||
gain_status.gain_status_n ? enable_adc_gain() : disable_adc_gain();
|
||||
break;
|
||||
|
||||
case 0x03:
|
||||
gain_status.gain_status_e ? enable_adc_gain() : disable_adc_gain();
|
||||
break;
|
||||
|
||||
case 0x04:
|
||||
gain_status.gain_status_w ? enable_adc_gain() : disable_adc_gain();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 多项式插值
|
||||
// 返回值是最大值
|
||||
float32_t find_maxVal_by_interpolation(float32_t a,float32_t b,float32_t c)
|
||||
|
@ -195,7 +121,7 @@ float32_t RSSI;
|
|||
float32_t buf[ADC_VAL_LEN];
|
||||
float32_t buf2[ADC_VAL_LEN];
|
||||
/*****************滤波器BUFF**********/
|
||||
float32_t cal_tof(q15_t* x,uint32_t len, uint16_t *maxVal)
|
||||
float32_t cal_tof(q15_t* x,uint32_t len, int16_t *maxVal)
|
||||
// float32_t cal_tof(q15_t* x,uint32_t len)
|
||||
{
|
||||
q15_t max_val,dc_offset;
|
||||
|
@ -462,16 +388,8 @@ char str[100];
|
|||
//}
|
||||
|
||||
|
||||
SlidingWindow_10min win_10min = {0};
|
||||
void wind_task(void const * argument)
|
||||
{
|
||||
//软件加密校验
|
||||
uint8_t wind_check_flag = JudgeEncrypt();
|
||||
// 最大幅值
|
||||
uint16_t wave_max_val1;
|
||||
uint16_t wave_max_val2;
|
||||
uint16_t wave_max_val3;
|
||||
uint16_t wave_max_val4;
|
||||
//错误次数统计,南北,东西分开(接受信号很小)
|
||||
uint8_t tof_error_log_NS = 0;
|
||||
uint8_t tof_error_log_WE = 0;
|
||||
|
@ -484,11 +402,6 @@ void wind_task(void const * argument)
|
|||
initLowPassFilter(&low_pass_filter_y, LOW_PASS_ALPHA);
|
||||
for(;;)
|
||||
{
|
||||
if(!wind_check_flag)
|
||||
{
|
||||
osDelay(1000);
|
||||
continue;
|
||||
}
|
||||
__HAL_TIM_DISABLE(&htim16);
|
||||
// 采集X轴风速耗时 22ms,两轴采集完44ms
|
||||
__HAL_TIM_SET_COUNTER(&htim16,0);
|
||||
|
@ -499,7 +412,6 @@ void wind_task(void const * argument)
|
|||
// 通道1 通道2 测试南北风速
|
||||
// 通道1发送 通道2接收
|
||||
change_channel(0x01);
|
||||
use_adc_gain(0x01);
|
||||
// 等待通道切换稳定
|
||||
// adc开启采集数据有个固定的延时,这里取消等待
|
||||
//HAL_Delay(0);
|
||||
|
@ -509,27 +421,20 @@ void wind_task(void const * argument)
|
|||
osDelay(1);
|
||||
// 通道2发送 通道1接收
|
||||
change_channel(0x02);
|
||||
use_adc_gain(0x02);
|
||||
// 等待通道切换稳定
|
||||
//HAL_Delay(0);
|
||||
// 发送pwm 并启动adc采集数据
|
||||
play_one_measure(adc_val1,ADC_VAL_LEN);
|
||||
|
||||
|
||||
tofx = cal_tof(adc_val,ADC_VAL_LEN, &wave_max_val1);
|
||||
//最大值平均+增益控制
|
||||
addValue(&wave_max_val_1, wave_max_val1);
|
||||
config_adc_gain(0x01, wave_max_val_1.ave);
|
||||
|
||||
tofy = cal_tof(adc_val1,ADC_VAL_LEN, &wave_max_val2);
|
||||
//最大值平均+增益控制
|
||||
addValue(&wave_max_val_2, wave_max_val2);
|
||||
config_adc_gain(0x02, wave_max_val_2.ave);
|
||||
tofx = cal_tof(adc_val,ADC_VAL_LEN, &wave_max_val1);addValue(&Test1, wave_max_val1);
|
||||
tofy = cal_tof(adc_val1,ADC_VAL_LEN, &wave_max_val2);addValue(&Test2, wave_max_val2);
|
||||
|
||||
|
||||
// 接受信号很小
|
||||
if(tofx<0||tofy<0)
|
||||
{
|
||||
tof_error_log_NS ++;
|
||||
// 放弃本次采样,可以有效筛选雨滴等导致的异常大的风速数据
|
||||
// 但是持续的遮挡会导致风速数据保持不变。
|
||||
// 连续10次采样有问题判定为有遮挡,置错误标志位,将声速与风速分量置0
|
||||
|
@ -542,7 +447,6 @@ void wind_task(void const * argument)
|
|||
}
|
||||
else
|
||||
{
|
||||
tof_error_log_NS ++;
|
||||
continue;
|
||||
}
|
||||
// 手动设置渡越时间差为0,会在探头受遮挡的时候输出0,持续遮挡的时候也输出0,但是计算出声速将变得很大
|
||||
|
@ -554,8 +458,8 @@ void wind_task(void const * argument)
|
|||
tof_error_log_NS = 0;
|
||||
g_error_log.tof_error_NS = 0;
|
||||
// 计算成us
|
||||
tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.0001f - g_stConfigInfo.anemometerDelayTime*1.0f;
|
||||
tofy = ((tofy-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.0001f - g_stConfigInfo.anemometerDelayTime*1.0f;
|
||||
tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.0001f - 2.0f;
|
||||
tofy = ((tofy-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.0001f - 2.0f;
|
||||
// 通过各通道渡越时间求时间差
|
||||
dtof = tofx-tofy;
|
||||
|
||||
|
@ -568,7 +472,6 @@ void wind_task(void const * argument)
|
|||
// 通道3 通道4 测试东西风速
|
||||
// 通道3发送 通道4接收
|
||||
change_channel(0x03);
|
||||
use_adc_gain(0x03);
|
||||
// 等待通道切换稳定
|
||||
//HAL_Delay(0);
|
||||
// 发送pwm 并启动adc采集数据
|
||||
|
@ -577,26 +480,19 @@ void wind_task(void const * argument)
|
|||
osDelay(1);
|
||||
// 通道4发送 通道3接收
|
||||
change_channel(0x04);
|
||||
use_adc_gain(0x04);
|
||||
// 等待通道切换稳定
|
||||
//HAL_Delay(0);
|
||||
// 发送pwm 并启动adc采集数据
|
||||
play_one_measure(adc_val1,ADC_VAL_LEN);
|
||||
|
||||
|
||||
tofx = cal_tof(adc_val,ADC_VAL_LEN, &wave_max_val3);
|
||||
//最大值平均+增益控制
|
||||
addValue(&wave_max_val_3, wave_max_val3);
|
||||
config_adc_gain(0x03, wave_max_val_3.ave);
|
||||
|
||||
tofy = cal_tof(adc_val1,ADC_VAL_LEN, &wave_max_val4);
|
||||
//最大值平均+增益控制
|
||||
addValue(&wave_max_val_4, wave_max_val4);
|
||||
config_adc_gain(0x04, wave_max_val_4.ave);
|
||||
tofx = cal_tof(adc_val,ADC_VAL_LEN, &wave_max_val3);addValue(&Test3, wave_max_val3);
|
||||
tofy = cal_tof(adc_val1,ADC_VAL_LEN, &wave_max_val4);addValue(&Test4, wave_max_val4);
|
||||
|
||||
// 如果测量的信号幅值过小。
|
||||
if(tofx<0||tofy<0)
|
||||
{
|
||||
tof_error_log_WE ++;
|
||||
// 放弃本次采样,可以有效筛选雨滴等导致的异常大的风速数据
|
||||
// 但是持续的遮挡会导致风速数据保持不变。
|
||||
// 连续10次采样有问题判定为有遮挡,置错误标志位,将声速与风速分量置0
|
||||
|
@ -609,7 +505,6 @@ void wind_task(void const * argument)
|
|||
}
|
||||
else
|
||||
{
|
||||
tof_error_log_WE ++;
|
||||
continue;
|
||||
}
|
||||
// 手动设置渡越时间差为0,会在探头受遮挡的时候输出0,持续遮挡的时候也输出0,但是计算出声速将变得很大
|
||||
|
@ -623,8 +518,8 @@ void wind_task(void const * argument)
|
|||
tof_error_log_WE = 0;
|
||||
g_error_log.tof_error_WE = 0;
|
||||
// 计算成us
|
||||
tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.000001f - g_stConfigInfo.anemometerDelayTime*1.0f;
|
||||
tofy = ((tofy-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.000001f - g_stConfigInfo.anemometerDelayTime*1.0f;
|
||||
tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.000001f - 2.0f;
|
||||
tofy = ((tofy-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.000001f - 2.0f;
|
||||
// 通过各通道渡越时间求时间差
|
||||
dtof = tofx-tofy;
|
||||
|
||||
|
@ -666,9 +561,6 @@ void wind_task(void const * argument)
|
|||
{
|
||||
av_speed = 0;
|
||||
av_angle = 0;
|
||||
//滑动平均值索引归零
|
||||
win_10min.count = 0;
|
||||
win_10min.index = 0;
|
||||
}
|
||||
// 360一圈
|
||||
if(av_speedy<0)
|
||||
|
@ -850,6 +742,7 @@ void update_mcs_param(float new_wind_speed, float new_wind_dirction)
|
|||
}
|
||||
}
|
||||
|
||||
SlidingWindow_10min win_10min = {0};
|
||||
SlidingWindow_3s win_3s = {0};
|
||||
//求和函数
|
||||
float sum(float arr[], int n)
|
||||
|
@ -979,12 +872,12 @@ void my_update_mcs_param(float new_wind_speed, float new_wind_dirction)
|
|||
win_10min.speed_data[win_10min.index] = g_stMcs_Para.instantaneous_wind_speed; //添加新数据
|
||||
win_10min.direction_data[win_10min.index] = g_stMcs_Para.instantaneous_wind_direction;
|
||||
|
||||
if(win_10min.count < g_usrConfigInfo.speed_average_time)
|
||||
if(win_10min.count < g_usrConfigInfo.speed_average_time /*AVE_TIME*/)
|
||||
{
|
||||
win_10min.count++;
|
||||
}
|
||||
|
||||
if(win_10min.count > g_usrConfigInfo.speed_average_time){win_10min.count = g_usrConfigInfo.speed_average_time;}
|
||||
if(win_10min.count > g_usrConfigInfo.speed_average_time/*AVE_TIME*/){win_10min.count = /*AVE_TIME*/g_usrConfigInfo.speed_average_time;}
|
||||
//计算10min风速滑动平均值
|
||||
win_10min.ave_speed_data[win_10min.index] = sum(win_10min.speed_data, win_10min.count) / win_10min.count;
|
||||
//计算10min风向滑动平均值,风向滑动平均值需要过零算法
|
||||
|
@ -1062,99 +955,73 @@ void my_update_mcs_param(float new_wind_speed, float new_wind_dirction)
|
|||
g_stMcs_Para.trough_wind_direction = temp_trough_min_direction;
|
||||
g_stMcs_Para.peak_wind_direction = temp_peak_max_direction;
|
||||
|
||||
win_10min.index = (win_10min.index + 1) % g_usrConfigInfo.speed_average_time;//更新索引
|
||||
}
|
||||
|
||||
|
||||
uint8_t SHT45_ERR_NUM = 0;
|
||||
//采集温度,湿度,大气压
|
||||
static void getTempHumiPress(void)
|
||||
{
|
||||
float backupTemperature1;
|
||||
//采集MS5607并判错
|
||||
if(MS56XX_GetPressure(&g_stMcs_Para.pressure) != HAL_OK)
|
||||
{
|
||||
//置错误标志位
|
||||
g_error_log.temp_error_HP203B = 1;
|
||||
//错误处理
|
||||
g_stMcs_Para.pressure = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//恢复错误标志位
|
||||
g_error_log.temp_error_HP203B = 0;
|
||||
}
|
||||
//采集SHT45并判错
|
||||
if(get_temp_humi_data(&backupTemperature1, &g_stMcs_Para.humidity) != HAL_OK)
|
||||
{
|
||||
//错误处理
|
||||
//断电重启,本次关电,下次上电,下下次返回正常数据
|
||||
if(g_error_log.temp_error_SHT30 == 0)
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOB, GPIO_SHT_PWR_EN_Pin, GPIO_PIN_RESET);
|
||||
HAL_I2C_DeInit(&hi2c1);
|
||||
SHT45_ERR_NUM = 1;
|
||||
}else
|
||||
{
|
||||
//确保只执行一次重新初始化程序
|
||||
if(SHT45_ERR_NUM == 1)
|
||||
{
|
||||
HAL_GPIO_WritePin(GPIOB, GPIO_SHT_PWR_EN_Pin, GPIO_PIN_SET);
|
||||
osDelay(1);
|
||||
MX_I2C1_Init();
|
||||
TMP117_Init();//TMP117是同一个电源,重新上电需要初始化
|
||||
SHT45_ERR_NUM = 0;
|
||||
}
|
||||
}
|
||||
//置错误标志位
|
||||
g_error_log.temp_error_SHT30 = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//恢复错误标志位
|
||||
g_error_log.temp_error_SHT30 = 0;
|
||||
}
|
||||
//采集TMP117并判错
|
||||
if(TMP117_Get_Temp(&g_stMcs_Para.temperature) != HAL_OK)
|
||||
{
|
||||
//置错误标志位
|
||||
g_error_log.temp_error_TMP117 = 1;
|
||||
//使用备用温度
|
||||
g_stMcs_Para.temperature = backupTemperature1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//恢复错误标志位
|
||||
g_error_log.temp_error_TMP117 = 0;
|
||||
}
|
||||
win_10min.index = (win_10min.index + 1) % /*AVE_TIME*/g_usrConfigInfo.speed_average_time;//更新索引
|
||||
}
|
||||
|
||||
void tem_hum_update_task(void const * argument)
|
||||
{
|
||||
uint8_t tem_hun_check_flag = JudgeEncrypt();
|
||||
int time_s_temp_humi = 0;
|
||||
uint32_t time_s_1Day = 0;
|
||||
|
||||
float backupTemperature;
|
||||
|
||||
uint16_t time_s_temp_humi = 0;//1秒计时,温湿度更新
|
||||
// 开机先采集一次大气压温湿度
|
||||
MS56XX_Init();
|
||||
if(tem_hun_check_flag)
|
||||
{
|
||||
//采集温湿度与大气压
|
||||
// osDelay(10);//等待传感器初始化
|
||||
getTempHumiPress();
|
||||
// 采集HP203B传感器数据(大气压)
|
||||
if(get_HP203_data(&backupTemperature, &g_stMcs_Para.pressure) == FALSE)
|
||||
{
|
||||
g_error_log.temp_error_HP203B = 1;
|
||||
/// 错误处理
|
||||
}
|
||||
// 采集SHT30传感器数据(温湿度)
|
||||
if(get_temp_humi_data(&g_stMcs_Para.temperature, &g_stMcs_Para.humidity) == FALSE)
|
||||
{
|
||||
g_error_log.temp_error_SHT30 = 1;
|
||||
/// 错误处理
|
||||
g_stMcs_Para.temperature = backupTemperature;
|
||||
}
|
||||
}
|
||||
|
||||
while(1)
|
||||
{
|
||||
osDelay(1000);
|
||||
if(!tem_hun_check_flag)continue;
|
||||
time_s_temp_humi ++;
|
||||
time_s_1Day ++;
|
||||
// 温湿度大气压更新
|
||||
if (time_s_temp_humi >= g_usrConfigInfo.temp_hum_update_time)
|
||||
{
|
||||
getTempHumiPress();
|
||||
// 采集HP203B传感器数据(大气压)
|
||||
if(get_HP203_data(&backupTemperature, &g_stMcs_Para.pressure) == FALSE)
|
||||
{
|
||||
g_error_log.temp_error_HP203B = 1;
|
||||
/// 错误处理
|
||||
}
|
||||
else
|
||||
{
|
||||
// 没出问题清除错误日志
|
||||
g_error_log.temp_error_HP203B = 0;
|
||||
}
|
||||
// 采集SHT30传感器数据(温湿度)
|
||||
if(get_temp_humi_data(&g_stMcs_Para.temperature, &g_stMcs_Para.humidity) == FALSE)
|
||||
{
|
||||
g_error_log.temp_error_SHT30 = 1;
|
||||
/// 错误处理
|
||||
g_stMcs_Para.temperature = backupTemperature;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 没出问题清除错误日志
|
||||
g_error_log.temp_error_SHT30 = 0;
|
||||
}
|
||||
// 计时重置
|
||||
time_s_temp_humi = 0;
|
||||
}
|
||||
// 一天重启
|
||||
if (time_s_1Day >= 86400)
|
||||
{
|
||||
__iar_builtin_set_FAULTMASK(1);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
// 风速风向更新
|
||||
my_update_mcs_param(weather_info.instantaneous_wind_speed, weather_info.instantaneous_wind_direction);
|
||||
}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
#include "encrypt.h"
|
||||
|
||||
/* TEA加密算法的解密过程 */
|
||||
static void tea_decrypt(uint32_t *v, uint32_t *k)
|
||||
{
|
||||
uint32_t delta = 0x9e3779b9; // 初始化delta
|
||||
uint32_t v0 = g_stConfigInfo.encrypt_0, v1 = g_stConfigInfo.encrypt_1, sum = delta << 5, i; // 初始化v0, v1, sum
|
||||
uint32_t k3 = k[3] ^ k[0], k2 = (k[2] ^ (*(uint32_t*)(0x1FFF7590))), k1 = k[1] ^ k[0], k0 = k[0] ^ (*(uint32_t*)(0x1FFF7590 + 4)); // 反算密钥
|
||||
for(i = 0; i < 32; i++) { // 执行32轮解密
|
||||
v1 -= ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
|
||||
v0 -= ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
|
||||
sum -= delta;
|
||||
}
|
||||
v[0] = v0; // 返回解密结果
|
||||
v[1] = v1;
|
||||
|
||||
// term_printf("%x %x", v[0], v[1]);
|
||||
}
|
||||
|
||||
/*
|
||||
* 判断密文是否正确
|
||||
*
|
||||
*/
|
||||
uint8_t JudgeEncrypt()
|
||||
{
|
||||
uint32_t encryptCode[2] = {0};
|
||||
// uint32_t key[] = {0x509770ff, 0x29c6b369, 0x4da2c125, ID中间32位}; //
|
||||
uint32_t key[] = {(K_128 >> 1) ^ (*(uint32_t*)(0x1FFF7590 + 4)), (K_96 >> 2) ^ key[0], (K_64 >>1) ^ (*(uint32_t*)(0x1FFF7590)), (*(uint32_t*)(0x1FFF7590 + 4)) ^ key[0]};
|
||||
tea_decrypt(encryptCode, key);
|
||||
return ((*(uint32_t*)(0x1FFF7590 + 4)) == encryptCode[0] && (*(uint32_t*)(0x1FFF7590 + 8)) == encryptCode[1]);
|
||||
}
|
|
@ -31,9 +31,8 @@ static u_int16_t FRT_ReadRegTemperature(void *pMsg);
|
|||
static u_int16_t FRT_ReadRegHumidity(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegPressure(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegRain(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegPrecipitationIntensity(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegUVIntensity(void *pMsg);
|
||||
/* 读 */
|
||||
static u_int16_t FRT_ReadRegPrecipitationIntensity(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegDeviceAddr(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegCommuBaudRate(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegSpeedAverageTime(void *pMsg);
|
||||
|
@ -54,7 +53,6 @@ static u_int16_t FRT_ReadRegRSSIRange(void *pMsg);
|
|||
static u_int16_t FRT_ReadRegCoefficient(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegDISTANCE_NS(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegDISTANCE_WE(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegANEMOMETER_Delay(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegErrorData(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegWindC_NS(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegWindC_WE(void *pMsg);
|
||||
|
@ -69,15 +67,6 @@ static u_int16_t FRT_ReadRegPoint_3Y(void *pMsg);
|
|||
static u_int16_t FRT_ReadRegPoint_4Y(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegPoint_5Y(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegLinearEnable(void *pMsg);
|
||||
static u_int16_t FRT_ReadReg_MaxWave_1(void *pMsg);
|
||||
static u_int16_t FRT_ReadReg_MaxWave_2(void *pMsg);
|
||||
static u_int16_t FRT_ReadReg_MaxWave_3(void *pMsg);
|
||||
static u_int16_t FRT_ReadReg_MaxWave_4(void *pMsg);
|
||||
/* 读ID */
|
||||
static u_int16_t FRT_ReadReg_ID_1(void *pMsg);
|
||||
static u_int16_t FRT_ReadReg_ID_2(void *pMsg);
|
||||
static u_int16_t FRT_ReadReg_ID_3(void *pMsg);
|
||||
static u_int16_t FRT_ReadReg_ID_4(void *pMsg);
|
||||
/* 写配置 */
|
||||
static u_int16_t FRT_WriteRegTransducerCFG1R5(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegTransducerCFG4R5(void *pMsg);
|
||||
|
@ -86,19 +75,17 @@ static u_int16_t FRT_WriteRegRSSIRange(void *pMsg);
|
|||
static u_int16_t FRT_WriteRegCoefficient(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegDISTANCE_NS(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegDISTANCE_WE(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegANEMOMETER_Delay(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegPoint_1Y(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegPoint_2Y(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegPoint_3Y(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegPoint_4Y(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegPoint_5Y(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegLinearEnable(void *pMsg);
|
||||
|
||||
/* 写密文 */
|
||||
static u_int16_t FRT_WriteRegEncrypt1(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegEncrypt2(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegEncrypt3(void *pMsg);
|
||||
static u_int16_t FRT_WriteRegEncrypt4(void *pMsg);
|
||||
/* 测试 */
|
||||
static u_int16_t FRT_ReadRegTest1(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegTest2(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegTest3(void *pMsg);
|
||||
static u_int16_t FRT_ReadRegTest4(void *pMsg);
|
||||
|
||||
static void pdebug_mcs_info();
|
||||
|
||||
|
@ -129,8 +116,6 @@ FRT_RegProcTable_s g_RegTbl[] =
|
|||
{ FRT_REGISTER_PRESSURE, FRT_ReadRegPressure }, /* 大气压 */
|
||||
{ FRT_REGISTER_RAIN, FRT_ReadRegRain }, /* 雨量 */
|
||||
{ FRT_REGISTER_PRECIPITATION_INTENSITY, FRT_ReadRegPrecipitationIntensity }, /* 总辐射 */
|
||||
{ FRT_REGISTER_UV_INTENSITY, FRT_ReadRegUVIntensity }, /* 紫外强度 */
|
||||
|
||||
{ FRT_REGISTER_DEVICE_ADDR, FRT_ReadRegDeviceAddr }, /* 设备地址 */
|
||||
{ FRT_REGISTER_COMMU_BAUDRATE, FRT_ReadRegCommuBaudRate }, /* 波特率 */
|
||||
{ FRT_REGISTER_SPEED_AVERAGE_TIME, FRT_ReadRegSpeedAverageTime }, /* 风速平均时间 */
|
||||
|
@ -143,7 +128,6 @@ FRT_RegProcTable_s g_RegTbl[] =
|
|||
{ FRT_REGISTER_COEFFICIENT, FRT_ReadRegCoefficient }, /* 读粘度修正系数 */
|
||||
{ FRT_REGISTER_DISTANCE_NS, FRT_ReadRegDISTANCE_NS }, /* 读南北探头表面有效距离 */
|
||||
{ FRT_REGISTER_DISTANCE_WE, FRT_ReadRegDISTANCE_WE }, /* 读东西探头表面有效距离 */
|
||||
{ FRT_REGISTER_ANEMOMETER_DELAY, FRT_ReadRegANEMOMETER_Delay }, /* 读换能器匹配层延时 */
|
||||
{ FRT_REGISTER_ERROR_LOG, FRT_ReadRegErrorData }, /* 读错误日志 */
|
||||
{ FRT_REGISTER_WIND_C_NS, FRT_ReadRegWindC_NS }, /* 读计算得到的南北风速 */
|
||||
{ FRT_REGISTER_WIND_C_WE, FRT_ReadRegWindC_WE }, /* 读计算得到的东西风速 */
|
||||
|
@ -158,14 +142,10 @@ FRT_RegProcTable_s g_RegTbl[] =
|
|||
{ FRT_REGISTER_LINEAR_POINT_Y_4, FRT_ReadRegPoint_4Y }, /* 线性插值校准点4 */
|
||||
{ FRT_REGISTER_LINEAR_POINT_Y_5, FRT_ReadRegPoint_5Y }, /* 线性插值校准点5 */
|
||||
{ FRT_REGISTER_LINEAR_ENABLE, FRT_ReadRegLinearEnable }, /* 线性插值使能 */
|
||||
{ FRT_REGISTER_MAX_WAVE_1, FRT_ReadReg_MaxWave_1 }, /* 波形最大幅值 */
|
||||
{ FRT_REGISTER_MAX_WAVE_2, FRT_ReadReg_MaxWave_2 }, /* 波形最大幅值 */
|
||||
{ FRT_REGISTER_MAX_WAVE_3, FRT_ReadReg_MaxWave_3 }, /* 波形最大幅值 */
|
||||
{ FRT_REGISTER_MAX_WAVE_4, FRT_ReadReg_MaxWave_4 }, /* 波形最大幅值 */
|
||||
{ FRT_REGISTER_ID_1, FRT_ReadReg_ID_1 }, /* ID */
|
||||
{ FRT_REGISTER_ID_2, FRT_ReadReg_ID_2 }, /* ID */
|
||||
{ FRT_REGISTER_ID_3, FRT_ReadReg_ID_3 }, /* ID */
|
||||
{ FRT_REGISTER_ID_4, FRT_ReadReg_ID_4 }, /* ID */
|
||||
{ FRT_REGISTER_TEST1, FRT_ReadRegTest1 }, /* 测试寄存器 */
|
||||
{ FRT_REGISTER_TEST2, FRT_ReadRegTest2 }, /* 测试寄存器 */
|
||||
{ FRT_REGISTER_TEST3, FRT_ReadRegTest3 }, /* 测试寄存器 */
|
||||
{ FRT_REGISTER_TEST4, FRT_ReadRegTest4 }, /* 测试寄存器 */
|
||||
};
|
||||
|
||||
/* 写寄存器处理表 */
|
||||
|
@ -184,17 +164,12 @@ FRT_RegProcTable_s g_Write_RegTbl[] =
|
|||
{ FRT_REGISTER_COEFFICIENT, FRT_WriteRegCoefficient }, /* 写粘度修正系数 */
|
||||
{ FRT_REGISTER_DISTANCE_NS, FRT_WriteRegDISTANCE_NS }, /* 写南北探头表面有效距离 */
|
||||
{ FRT_REGISTER_DISTANCE_WE, FRT_WriteRegDISTANCE_WE }, /* 写东西探头表面有效距离 */
|
||||
{ FRT_REGISTER_ANEMOMETER_DELAY, FRT_WriteRegANEMOMETER_Delay }, /* 写换能器匹配层延时 */
|
||||
{ FRT_REGISTER_LINEAR_POINT_Y_1, FRT_WriteRegPoint_1Y }, /* 线性插值校准点1 */
|
||||
{ FRT_REGISTER_LINEAR_POINT_Y_2, FRT_WriteRegPoint_2Y }, /* 线性插值校准点2 */
|
||||
{ FRT_REGISTER_LINEAR_POINT_Y_3, FRT_WriteRegPoint_3Y }, /* 线性插值校准点3 */
|
||||
{ FRT_REGISTER_LINEAR_POINT_Y_4, FRT_WriteRegPoint_4Y }, /* 线性插值校准点4 */
|
||||
{ FRT_REGISTER_LINEAR_POINT_Y_5, FRT_WriteRegPoint_5Y }, /* 线性插值校准点5 */
|
||||
{ FRT_REGISTER_LINEAR_ENABLE, FRT_WriteRegLinearEnable }, /* 线性插值使能 */
|
||||
{ FRT_REGISTER_ENCRYPT_1, FRT_WriteRegEncrypt1 }, /* 密文1 */
|
||||
{ FRT_REGISTER_ENCRYPT_2, FRT_WriteRegEncrypt2 }, /* 密文2 */
|
||||
{ FRT_REGISTER_ENCRYPT_3, FRT_WriteRegEncrypt3 }, /* 密文3 */
|
||||
{ FRT_REGISTER_ENCRYPT_4, FRT_WriteRegEncrypt4 }, /* 密文4 */
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -238,7 +213,7 @@ static u_int16_t FRT_swap_endian_16(u_int16_t value)
|
|||
*/
|
||||
static u_int16_t FRT_ReadRegMinWindDiretion(void *pMsg)
|
||||
{
|
||||
u_int16_t value = (u_int16_t)(g_stMcs_Para.min_wind_direction);
|
||||
u_int16_t value = (u_int16_t)(g_stMcs_Para.min_wind_direction *10);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
|
@ -249,7 +224,7 @@ static u_int16_t FRT_ReadRegMinWindDiretion(void *pMsg)
|
|||
*/
|
||||
static u_int16_t FRT_ReadRegThroughWindDiretion(void *pMsg)
|
||||
{
|
||||
u_int16_t value = (u_int16_t)(g_stMcs_Para.trough_wind_direction);
|
||||
u_int16_t value = (u_int16_t)(g_stMcs_Para.trough_wind_direction *10);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
|
@ -260,7 +235,7 @@ static u_int16_t FRT_ReadRegThroughWindDiretion(void *pMsg)
|
|||
*/
|
||||
static u_int16_t FRT_ReadRegAverageWindDirection(void *pMsg)
|
||||
{
|
||||
u_int16_t value = (u_int16_t)(g_stMcs_Para.average_wind_direction);
|
||||
u_int16_t value = (u_int16_t)(g_stMcs_Para.average_wind_direction *10);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
|
@ -271,7 +246,7 @@ static u_int16_t FRT_ReadRegAverageWindDirection(void *pMsg)
|
|||
*/
|
||||
static u_int16_t FRT_ReadRegInstantaneousWindDirection(void *pMsg)
|
||||
{
|
||||
u_int16_t value = (u_int16_t)(g_stMcs_Para.instantaneous_wind_direction);
|
||||
u_int16_t value = (u_int16_t)(g_stMcs_Para.instantaneous_wind_direction *10);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
|
@ -282,7 +257,7 @@ static u_int16_t FRT_ReadRegInstantaneousWindDirection(void *pMsg)
|
|||
*/
|
||||
static u_int16_t FRT_ReadRegPeakWindDiretion(void *pMsg)
|
||||
{
|
||||
u_int16_t value = (u_int16_t)(g_stMcs_Para.peak_wind_direction);
|
||||
u_int16_t value = (u_int16_t)(g_stMcs_Para.peak_wind_direction *10);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
|
@ -293,7 +268,7 @@ static u_int16_t FRT_ReadRegPeakWindDiretion(void *pMsg)
|
|||
*/
|
||||
static u_int16_t FRT_ReadRegMaxWindDirection(void *pMsg)
|
||||
{
|
||||
u_int16_t value=(u_int16_t)(g_stMcs_Para.max_wind_direction);
|
||||
u_int16_t value=(u_int16_t)(g_stMcs_Para.max_wind_direction *10);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
|
@ -403,7 +378,7 @@ static u_int16_t FRT_ReadRegPressure(void *pMsg)
|
|||
*/
|
||||
static u_int16_t FRT_ReadRegRain(void *pMsg)
|
||||
{
|
||||
u_int16_t value=0;
|
||||
u_int16_t value=9;
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
|
@ -414,18 +389,7 @@ static u_int16_t FRT_ReadRegRain(void *pMsg)
|
|||
*/
|
||||
static u_int16_t FRT_ReadRegPrecipitationIntensity(void *pMsg)
|
||||
{
|
||||
u_int16_t value=0;
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 读紫外强度寄存器值
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_ReadRegUVIntensity(void *pMsg)
|
||||
{
|
||||
u_int16_t value=0;
|
||||
u_int16_t value=10;
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
|
@ -497,10 +461,6 @@ static u_int16_t FRT_WriteRegDeviceAddr(void *pMsg)
|
|||
{
|
||||
uint16_t *pMsgAddr = (uint16_t *)pMsg;
|
||||
uint16_t data = *pMsgAddr;
|
||||
if(data > 0xFF || data < 0x00)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
g_usrConfigInfo.addr = data;
|
||||
save_usr_config_info(g_usrConfigInfo);
|
||||
|
||||
|
@ -516,15 +476,9 @@ static u_int16_t FRT_WriteRegCommuBaudRate(void *pMsg)
|
|||
{
|
||||
uint16_t *pMsgAddr = (uint16_t *)pMsg;
|
||||
uint16_t data = *pMsgAddr;
|
||||
if(data != 2400 && data != 4800 && data != 9600 && data != 19200 && data != 38400)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//存
|
||||
g_usrConfigInfo.uart_baud = data;
|
||||
save_usr_config_info(g_usrConfigInfo);
|
||||
//改
|
||||
|
||||
MX_USART3_UART_Init(g_usrConfigInfo.uart_baud);
|
||||
MX_USART1_UART_Init(g_usrConfigInfo.uart_baud);
|
||||
|
||||
|
@ -540,10 +494,6 @@ static u_int16_t FRT_WriteRegSpeedAverageTime(void *pMsg)
|
|||
{
|
||||
uint16_t *pMsgAddr = (uint16_t *)pMsg;
|
||||
uint16_t data = *pMsgAddr;
|
||||
if(data > 600 || data < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
g_usrConfigInfo.speed_average_time = data;
|
||||
save_usr_config_info(g_usrConfigInfo);
|
||||
|
@ -560,10 +510,6 @@ static u_int16_t FRT_WriteRegTempHumUpdateTime(void *pMsg)
|
|||
{
|
||||
uint16_t *pMsgAddr = (uint16_t *)pMsg;
|
||||
uint16_t data = *pMsgAddr;
|
||||
if(data > 600 || data < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
g_usrConfigInfo.temp_hum_update_time = data;
|
||||
save_usr_config_info(g_usrConfigInfo);
|
||||
|
@ -695,18 +641,6 @@ static u_int16_t FRT_ReadRegDISTANCE_WE(void *pMsg)
|
|||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 读换能器匹配延时
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_ReadRegANEMOMETER_Delay(void *pMsg)
|
||||
{
|
||||
read_config_info();
|
||||
u_int16_t value=g_stConfigInfo.anemometerDelayTime;
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 读错误日志
|
||||
* @param
|
||||
|
@ -873,87 +807,43 @@ static u_int16_t FRT_ReadRegLinearEnable(void *pMsg)
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 波形最大幅值S
|
||||
* @brief 111111111111111
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_ReadReg_MaxWave_1(void *pMsg)
|
||||
static u_int16_t FRT_ReadRegTest1(void *pMsg)
|
||||
{
|
||||
u_int16_t value=(u_int16_t)(wave_max_val_1.ave);
|
||||
u_int16_t value=(u_int16_t)(Test1.ave);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
/**
|
||||
* @brief 波形最大幅值N
|
||||
* @brief 111111111111111
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_ReadReg_MaxWave_2(void *pMsg)
|
||||
static u_int16_t FRT_ReadRegTest2(void *pMsg)
|
||||
{
|
||||
u_int16_t value=(u_int16_t)(wave_max_val_2.ave);
|
||||
u_int16_t value=(u_int16_t)(Test2.ave);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
/**
|
||||
* @brief 波形最大幅值E
|
||||
* @brief 111111111111111
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_ReadReg_MaxWave_3(void *pMsg)
|
||||
static u_int16_t FRT_ReadRegTest3(void *pMsg)
|
||||
{
|
||||
u_int16_t value=(u_int16_t)(wave_max_val_3.ave);
|
||||
u_int16_t value=(u_int16_t)(Test3.ave);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
/**
|
||||
* @brief 波形最大幅值W
|
||||
* @brief 111111111111111
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_ReadReg_MaxWave_4(void *pMsg)
|
||||
static u_int16_t FRT_ReadRegTest4(void *pMsg)
|
||||
{
|
||||
u_int16_t value=(u_int16_t)(wave_max_val_4.ave);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ID16
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_ReadReg_ID_1(void *pMsg)
|
||||
{
|
||||
u_int16_t value = ((*(uint32_t*)(0x1FFF7590 + 4)) >> 16) & 0x0000FFFF;
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ID32
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_ReadReg_ID_2(void *pMsg)
|
||||
{
|
||||
u_int16_t value = (*(uint32_t*)(0x1FFF7590 + 4)) & 0x0000FFFF;
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ID48
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_ReadReg_ID_3(void *pMsg)
|
||||
{
|
||||
u_int16_t value = ((*(uint32_t*)(0x1FFF7590 + 8)) >> 16) & 0x0000FFFF;
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ID64
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_ReadReg_ID_4(void *pMsg)
|
||||
{
|
||||
u_int16_t value = (*(uint32_t*)(0x1FFF7590 + 8)) & 0x0000FFFF;
|
||||
u_int16_t value=(u_int16_t)(Test4.ave);
|
||||
return FRT_swap_endian_16(value);
|
||||
}
|
||||
|
||||
|
@ -1069,22 +959,6 @@ static u_int16_t FRT_WriteRegDISTANCE_WE(void *pMsg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 写换能器匹配延时
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_WriteRegANEMOMETER_Delay(void *pMsg)
|
||||
{
|
||||
uint16_t *pMsgAddr = (uint16_t *)pMsg;
|
||||
uint16_t data = *pMsgAddr;
|
||||
|
||||
g_stConfigInfo.anemometerDelayTime = data;
|
||||
save_factory_config_info(g_stConfigInfo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 写线性插值矫正点1
|
||||
* @param
|
||||
|
@ -1201,70 +1075,6 @@ static u_int16_t FRT_WriteRegLinearEnable(void *pMsg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 写左1-16位
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_WriteRegEncrypt1(void *pMsg)
|
||||
{
|
||||
uint16_t *pMsgData = (uint16_t *)pMsg;
|
||||
uint16_t data = *pMsgData;
|
||||
|
||||
g_stConfigInfo.encrypt_0 = (g_stConfigInfo.encrypt_0 & 0x0000FFFF) | ((data << 16) & 0xFFFF0000);
|
||||
save_factory_config_info(g_stConfigInfo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 写左17-32位
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_WriteRegEncrypt2(void *pMsg)
|
||||
{
|
||||
uint16_t *pMsgData = (uint16_t *)pMsg;
|
||||
uint16_t data = *pMsgData;
|
||||
|
||||
g_stConfigInfo.encrypt_0 = (g_stConfigInfo.encrypt_0 & 0xFFFF0000) | (data & 0x0000FFFF);
|
||||
save_factory_config_info(g_stConfigInfo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 写左33-47位
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_WriteRegEncrypt3(void *pMsg)
|
||||
{
|
||||
uint16_t *pMsgData = (uint16_t *)pMsg;
|
||||
uint16_t data = *pMsgData;
|
||||
|
||||
g_stConfigInfo.encrypt_1 = (g_stConfigInfo.encrypt_1 & 0x0000FFFF) | ((data << 16) & 0xFFFF0000);
|
||||
save_factory_config_info(g_stConfigInfo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 写左48-64位
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
static u_int16_t FRT_WriteRegEncrypt4(void *pMsg)
|
||||
{
|
||||
uint16_t *pMsgData = (uint16_t *)pMsg;
|
||||
uint16_t data = *pMsgData;
|
||||
|
||||
g_stConfigInfo.encrypt_1 = (g_stConfigInfo.encrypt_1 & 0xFFFF0000) | (data & 0x0000FFFF);
|
||||
save_factory_config_info(g_stConfigInfo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 封装协议发送
|
||||
|
||||
|
@ -1344,10 +1154,9 @@ void FRT_MsgProc_ReadRegister(device_handle device, void *pMsg)
|
|||
u_int16_t reg_num= (data[4] << 8)| data[5];
|
||||
if ( \
|
||||
start_reg_addr < 0x00 ||\
|
||||
/* (start_reg_addr > FRT_REGISTER_PRESSURE && start_reg_addr < FRT_REGISTER_THROUGH_WIND_DIRECTION) ||\ */
|
||||
(start_reg_addr > FRT_REGISTER_PEAK_WIND_SPEED && start_reg_addr < FRT_REGISTER_DEVICE_ADDR) ||\
|
||||
(start_reg_addr > FRT_REGISTER_PRESSURE && start_reg_addr < FRT_REGISTER_DEVICE_ADDR) ||\
|
||||
(start_reg_addr > FRT_REGISTER_TEMPHUM_UPDATE_TIME && start_reg_addr < FRT_REGISTER_TRANSDUCER_CFG_1R5) ||\
|
||||
start_reg_addr > FRT_REGISTER_ID_4 \
|
||||
start_reg_addr > FRT_REGISTER_TEST4 \
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -1357,10 +1166,9 @@ void FRT_MsgProc_ReadRegister(device_handle device, void *pMsg)
|
|||
|
||||
if ( \
|
||||
reg_num < 0x01 ||\
|
||||
/* (((reg_num + start_reg_addr - 1) > FRT_REGISTER_PRESSURE) && ((reg_num + start_reg_addr - 1) < FRT_REGISTER_THROUGH_WIND_DIRECTION)) ||\ */
|
||||
(((reg_num + start_reg_addr - 1) > FRT_REGISTER_PEAK_WIND_SPEED) && ((reg_num + start_reg_addr - 1) < FRT_REGISTER_DEVICE_ADDR)) ||\
|
||||
(((reg_num + start_reg_addr - 1) > FRT_REGISTER_PRESSURE) && ((reg_num + start_reg_addr - 1) < FRT_REGISTER_DEVICE_ADDR)) ||\
|
||||
(((reg_num + start_reg_addr -1) > FRT_REGISTER_TEMPHUM_UPDATE_TIME) && ((reg_num + start_reg_addr -1) < FRT_REGISTER_TRANSDUCER_CFG_1R5)) ||\
|
||||
((reg_num + start_reg_addr -1) > FRT_REGISTER_ID_4) \
|
||||
((reg_num + start_reg_addr -1) > FRT_REGISTER_TEST4) \
|
||||
)
|
||||
|
||||
{
|
||||
|
@ -1411,9 +1219,8 @@ void FRT_MsgProc_WriteRegister(device_handle device, void *pMsg)
|
|||
// 校验
|
||||
if (start_reg_addr < FRT_REGISTER_DEVICE_ADDR ||\
|
||||
(start_reg_addr > FRT_REGISTER_REST_DEFAULT_SETTING && start_reg_addr < FRT_REGISTER_TRANSDUCER_CFG_1R5) ||\
|
||||
(start_reg_addr > FRT_REGISTER_ANEMOMETER_DELAY && start_reg_addr < FRT_REGISTER_LINEAR_POINT_Y_1) ||\
|
||||
(start_reg_addr > FRT_REGISTER_LINEAR_ENABLE) && (start_reg_addr < FRT_REGISTER_ENCRYPT_1) ||\
|
||||
(start_reg_addr > FRT_REGISTER_ENCRYPT_4)
|
||||
(start_reg_addr > FRT_REGISTER_DISTANCE_WE && start_reg_addr < FRT_REGISTER_LINEAR_POINT_Y_1) ||\
|
||||
(start_reg_addr > FRT_REGISTER_LINEAR_ENABLE) \
|
||||
)
|
||||
{
|
||||
term_printf("start_reg_addr error:%d", start_reg_addr);
|
||||
|
@ -1422,9 +1229,8 @@ void FRT_MsgProc_WriteRegister(device_handle device, void *pMsg)
|
|||
if (reg_num < 0x01 ||\
|
||||
((reg_num + start_reg_addr - 1) < FRT_REGISTER_DEVICE_ADDR) ||\
|
||||
(((reg_num + start_reg_addr -1) > FRT_REGISTER_REST_DEFAULT_SETTING) && ((reg_num + start_reg_addr -1) < FRT_REGISTER_TRANSDUCER_CFG_1R5)) ||\
|
||||
(((reg_num + start_reg_addr -1) > FRT_REGISTER_ANEMOMETER_DELAY) && ((reg_num + start_reg_addr -1) < FRT_REGISTER_LINEAR_POINT_Y_1)) ||\
|
||||
(((reg_num + start_reg_addr -1) > FRT_REGISTER_LINEAR_ENABLE) && ((reg_num + start_reg_addr -1) < FRT_REGISTER_ENCRYPT_1)) ||\
|
||||
((reg_num + start_reg_addr -1) > FRT_REGISTER_ENCRYPT_4)
|
||||
(((reg_num + start_reg_addr -1) > FRT_REGISTER_DISTANCE_WE) && ((reg_num + start_reg_addr -1) < FRT_REGISTER_LINEAR_POINT_Y_1)) ||\
|
||||
((reg_num + start_reg_addr -1) > FRT_REGISTER_LINEAR_ENABLE) \
|
||||
)
|
||||
{
|
||||
term_printf("reg_num error:%d", reg_num);
|
||||
|
@ -1444,18 +1250,16 @@ void FRT_MsgProc_WriteRegister(device_handle device, void *pMsg)
|
|||
// }
|
||||
|
||||
// 发回数据
|
||||
uint8_t Trans_data[8];
|
||||
uint8_t Trans_data[6];
|
||||
Trans_data[0] = g_usrConfigInfo.addr;
|
||||
Trans_data[1] = data[1];
|
||||
Trans_data[2] = start_reg_addr >> 8;
|
||||
Trans_data[3] = start_reg_addr;
|
||||
Trans_data[4] = reg_num >> 8;
|
||||
Trans_data[5] = reg_num;
|
||||
Trans_data[2] = start_reg_addr;
|
||||
Trans_data[3] = reg_num;
|
||||
|
||||
return_crc_value = CRC16(Trans_data, 6);
|
||||
Trans_data[6] = return_crc_value;
|
||||
Trans_data[7] = return_crc_value >> 8;
|
||||
uart_dev_write(device, Trans_data, 8);
|
||||
return_crc_value = CRC16(Trans_data, 4);
|
||||
Trans_data[4] = return_crc_value;
|
||||
Trans_data[5] = return_crc_value >> 8;
|
||||
uart_dev_write(device, Trans_data, 6);
|
||||
|
||||
for(u_int16_t pos=0; pos <reg_num; pos++)
|
||||
{
|
||||
|
@ -1584,7 +1388,6 @@ void FRT_MsgHandler(device_handle device, u_int8_t *pMsg, u_int32_t MsgLen)
|
|||
* @param
|
||||
* @retval
|
||||
*/
|
||||
uint32_t K_96 = 0xA71ACDA4;
|
||||
static u_int8_t rs485_buff[50]={0x00};
|
||||
void read_and_process_uart_data(device_handle device)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -41,9 +41,6 @@ factory_config_info g_stConfigInfo={
|
|||
.linear_point_5_x = 0, /* 线性插值点5 */
|
||||
.linear_point_5_y = 0, /* 线性插值点5 */
|
||||
.linear_enable = 0, /* 线性插值使能 */
|
||||
.encrypt_0 = 0, /* 密文 */
|
||||
.encrypt_1 = 0, /* 密文 */
|
||||
.anemometerDelayTime = 2, /* 换能器匹配层延时us *//*大宇3,无锡电声2*/
|
||||
.flag_end = FLAG_SAVE_INFLASH_END,
|
||||
};
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
#define configTICK_RATE_HZ ((TickType_t)40)
|
||||
#define configMAX_PRIORITIES ( 7 )
|
||||
#define configMINIMAL_STACK_SIZE ((uint16_t)128)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)30*1024)
|
||||
#define configTOTAL_HEAP_SIZE ((size_t)8000)
|
||||
#define configMAX_TASK_NAME_LEN ( 16 )
|
||||
#define configUSE_16_BIT_TICKS 0
|
||||
#define configUSE_MUTEXES 1
|
||||
|
|
|
@ -32,8 +32,6 @@ void task_shell_term_main_loop(void const * argument);
|
|||
#include "frt_protocol.h"
|
||||
#include "inflash.h"
|
||||
#include "hp203b.h"
|
||||
#include "tmp117.h"
|
||||
#include "encrypt.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
|
@ -117,17 +115,17 @@ void MX_FREERTOS_Init(void) {
|
|||
|
||||
/* Create the thread(s) */
|
||||
/* definition and creation of defaultTask */
|
||||
osThreadDef(defaultTask, StartDefaultTask, osPriorityRealtime, 0, 2*1024);//通讯
|
||||
osThreadDef(defaultTask, StartDefaultTask, osPriorityRealtime, 0, 512);//通讯
|
||||
defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
|
||||
|
||||
osThreadDef(ledTask, LEDTask, osPriorityIdle, 0, 128);//LED
|
||||
osThreadDef(ledTask, LEDTask, osPriorityIdle, 0, 32);//LED
|
||||
ledTaskHandle = osThreadCreate(osThread(ledTask), NULL);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
osThreadDef(anemometer, wind_task, osPriorityHigh, 0, 2*1024);// 风速风向
|
||||
osThreadDef(anemometer, wind_task, osPriorityHigh, 0, 256);// 风速风向
|
||||
anemometerHandle = osThreadCreate(osThread(anemometer), NULL);
|
||||
|
||||
osThreadDef(temhum_update_task, tem_hum_update_task, osPriorityAboveNormal, 0, 1024);//温湿度,大气压更新
|
||||
osThreadDef(temhum_update_task, tem_hum_update_task, osPriorityAboveNormal, 0, 256);//温湿度,大气压更新
|
||||
temhum_update_taskHandle = osThreadCreate(osThread(temhum_update_task), NULL);
|
||||
|
||||
// osThreadDef(sensorTask, SensorTask, osPriorityRealtime, 0, 128);
|
||||
|
@ -150,7 +148,7 @@ void MX_FREERTOS_Init(void) {
|
|||
void StartDefaultTask(void const * argument)
|
||||
{
|
||||
/* USER CODE BEGIN StartDefaultTask */
|
||||
osDelay(5000);
|
||||
|
||||
/* Infinite loop */
|
||||
for(;;)
|
||||
{
|
||||
|
@ -189,33 +187,15 @@ void SensorTask(void const * argument)
|
|||
}
|
||||
/* USER CODE END Application */
|
||||
|
||||
uint16_t time_s_1Hour = 0;//1小时的秒数
|
||||
uint8_t time_h_1Day = 0;//1天的小时
|
||||
void LEDTask(void const * argument)
|
||||
{
|
||||
/* USER CODE BEGIN StartDefaultTask */
|
||||
/* Infinite loop */
|
||||
uint8_t LED_Check_flag = JudgeEncrypt();
|
||||
for(;;)
|
||||
{
|
||||
osDelay(1000);
|
||||
time_s_1Hour ++;
|
||||
if(LED_Check_flag)
|
||||
{
|
||||
HAL_GPIO_TogglePin(GPIOC,GPIO_LED_CTRL_Pin);
|
||||
// 一天重启
|
||||
if (time_s_1Hour >= 3600)
|
||||
{
|
||||
time_s_1Hour = 0;
|
||||
time_h_1Day++;
|
||||
}
|
||||
if (time_h_1Day >= 24)
|
||||
{
|
||||
time_h_1Day = 0;
|
||||
__iar_builtin_set_FAULTMASK(1);
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/* USER CODE END StartDefaultTask */
|
||||
}
|
||||
|
|
|
@ -43,8 +43,6 @@
|
|||
#include "uart_dev.h"
|
||||
#include "sht30.h"
|
||||
#include "hp203b.h"
|
||||
#include "tmp117.h"
|
||||
#include "ms5607.h"
|
||||
|
||||
#include "inflash.h"
|
||||
/* USER CODE END Includes */
|
||||
|
@ -127,7 +125,6 @@ void Flash_EnableReadProtection(void)
|
|||
{
|
||||
|
||||
/* USER CODE BEGIN 1 */
|
||||
///远程升级时读保护
|
||||
// Flash_EnableReadProtection();//¶Á±£»¤
|
||||
/* USER CODE END 1 */
|
||||
|
||||
|
@ -174,7 +171,8 @@ void Flash_EnableReadProtection(void)
|
|||
term_printf("Version 1.0.0 Build: %s %s\r\n",__DATE__,__TIME__);
|
||||
HAL_ADCEx_Calibration_Start(&hadc1,ADC_SINGLE_ENDED);
|
||||
sht30_init();
|
||||
TMP117_Init();
|
||||
hp203_set_mode();
|
||||
|
||||
/* USER CODE END 2 */
|
||||
|
||||
/* Call init function for freertos objects (in cmsis_os2.c) */
|
||||
|
|
|
@ -10,44 +10,14 @@ void initLowPassFilter(SL_LowPassFilter* filter, float alpha)
|
|||
filter->alpha = alpha;
|
||||
// 初始化上一次的输出值为0
|
||||
filter->previous = 0.0f;
|
||||
|
||||
filter->x = 0;
|
||||
filter->times = 0;
|
||||
}
|
||||
|
||||
// 更新滤波器输出值
|
||||
float updateFilter(SL_LowPassFilter* filter, float new_input)
|
||||
{
|
||||
// 滤波新值
|
||||
float filtedData = (1.0f - filter->alpha) * filter->previous + filter->alpha * new_input;
|
||||
|
||||
// //差值大于一定值认为有问题,暂定4
|
||||
// if((filter->x) - filtedData > 4 || (filtedData) - filter->x > 4 )
|
||||
// {
|
||||
//// 将有问题的值存起来
|
||||
// (filter->x) = filtedData;
|
||||
//// 使用上一次的正确值当结果
|
||||
// filtedData = filter->previous;
|
||||
//// 清空计数
|
||||
// filter->times = 0;
|
||||
// }else
|
||||
// {
|
||||
//// 差值在允许范围内
|
||||
//// 差值合理一定时间后认为数据没问题
|
||||
// if(filter->times < 3)
|
||||
// {
|
||||
// filter->times++;
|
||||
//// 没满足次数,使用旧值
|
||||
// filtedData = filter->previous;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
//// 将值存起来,直接使用滤波后的值
|
||||
// (filter->x) = filtedData;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 更新滤波后的值
|
||||
float output = (1.0f - filter->alpha) * filter->previous + filter->alpha * new_input;
|
||||
// 更新上一次的输出值
|
||||
filter->previous = filtedData;
|
||||
return filtedData;
|
||||
filter->previous = output;
|
||||
return output;
|
||||
}
|
|
@ -9,8 +9,6 @@
|
|||
typedef struct {
|
||||
float alpha; // 滤波器系数
|
||||
float previous; // 上一次的输出值
|
||||
float x; // 上一次的输入值
|
||||
uint8_t times; // 次数
|
||||
} SL_LowPassFilter;
|
||||
|
||||
extern SL_LowPassFilter low_pass_filter_x;
|
||||
|
|
|
@ -26,8 +26,9 @@ void hp203_set_mode()
|
|||
*
|
||||
*返回:气压
|
||||
*****************************/
|
||||
BOOL Hp203bReadPressure(float *press)
|
||||
float Hp203bReadPressure(void)
|
||||
{
|
||||
float ret = 0.0;
|
||||
long Hp203b_Pressure = 0;
|
||||
uint8_t Hp203bPressure_Temp[3] = {0};
|
||||
uint8_t read_command[1] = {HP20X_READ_P};
|
||||
|
@ -41,13 +42,9 @@ BOOL Hp203bReadPressure(float *press)
|
|||
Hp203b_Pressure <<= 8;
|
||||
Hp203b_Pressure |= Hp203bPressure_Temp[2];
|
||||
|
||||
*press = (float)Hp203b_Pressure / 100.0f;
|
||||
if(*press < 300 || *press > 1200)
|
||||
{
|
||||
*press = 0;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
Hp203b_Pressure = Hp203b_Pressure / 100;
|
||||
ret = Hp203b_Pressure;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************
|
||||
|
@ -58,44 +55,27 @@ BOOL Hp203bReadPressure(float *press)
|
|||
*
|
||||
*返回:温度
|
||||
*****************************/
|
||||
BOOL Hp203bReadTempture(float *press)
|
||||
float Hp203bReadTempture(void)
|
||||
{
|
||||
uint32_t Hp203b_tempture = 0;
|
||||
float ret = 0.0;
|
||||
long Hp203b_tempture = 0;
|
||||
uint8_t Hp203bPressure_Temp[3] = {0};
|
||||
uint8_t read_command[1] = {0x32};
|
||||
|
||||
HAL_I2C_Master_Transmit(&hi2c3, HP20X_ADDRESSCMD, read_command, 1, 0xff);
|
||||
HAL_I2C_Master_Receive(&hi2c3, HP20X_ADDRESSCMD, Hp203bPressure_Temp, 3, 0xff);
|
||||
Hp203b_tempture = (Hp203bPressure_Temp[0] & 0x0F)<<16;
|
||||
Hp203b_tempture |= Hp203bPressure_Temp[1]<<8;
|
||||
|
||||
Hp203b_tempture = Hp203bPressure_Temp[0];
|
||||
Hp203b_tempture <<= 8;
|
||||
Hp203b_tempture |= Hp203bPressure_Temp[1];
|
||||
Hp203b_tempture <<= 8;
|
||||
Hp203b_tempture |= Hp203bPressure_Temp[2];
|
||||
|
||||
if((Hp203b_tempture>>19) & 1){
|
||||
Hp203b_tempture = (((~Hp203b_tempture) + 1) & 0xFFFFF);
|
||||
*press = -(float)Hp203b_tempture / 100.0f;
|
||||
}
|
||||
else{
|
||||
*press = (float)Hp203b_tempture / 100.0f;
|
||||
}
|
||||
if(*press<-50||*press>95){
|
||||
*press = 0;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
Hp203b_tempture = Hp203b_tempture / 100;
|
||||
ret = Hp203b_tempture;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static float calculateAverage(float arr[], int avgLength) {
|
||||
float sum = 0;
|
||||
|
||||
// 遍历数组(最多10个元素),收集非零值直到达到指定数量
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
sum += arr[i];
|
||||
}
|
||||
|
||||
// 计算平均值并限制最大值
|
||||
float average = sum / avgLength;
|
||||
return average;
|
||||
}
|
||||
/****************************
|
||||
*名称:get_press_data
|
||||
*功能:获取气压与备用温度数据
|
||||
|
@ -107,74 +87,51 @@ static float calculateAverage(float arr[], int avgLength) {
|
|||
#define COLLECT_HB203_DATA_NUM 10
|
||||
BOOL get_HP203_data(float* tempdata, float* press)
|
||||
{
|
||||
uint8_t ret;
|
||||
uint8_t temp_falt = 0;
|
||||
uint8_t press_falt = 0;
|
||||
// 压强
|
||||
float collect_pressure[COLLECT_HB203_DATA_NUM]={0x00};
|
||||
U_DataType collect_pressure[COLLECT_HB203_DATA_NUM]={0x00};
|
||||
|
||||
for(int i=0; i<COLLECT_HB203_DATA_NUM; i++){
|
||||
hp203_set_mode();
|
||||
osDelay(5);
|
||||
ret = Hp203bReadPressure(&collect_pressure[i]);
|
||||
if(ret == FALSE)
|
||||
{
|
||||
press_falt++;
|
||||
continue;
|
||||
//goto error_return;
|
||||
collect_pressure[i].fValue = Hp203bReadPressure();
|
||||
osDelay(1);
|
||||
}
|
||||
osDelay(5);
|
||||
}
|
||||
if(press_falt >= COLLECT_HB203_DATA_NUM)
|
||||
{
|
||||
goto error_return;
|
||||
}
|
||||
//求平均
|
||||
float tmp_press = calculateAverage(collect_pressure, COLLECT_HB203_DATA_NUM - press_falt);
|
||||
if(tmp_press < 300)
|
||||
|
||||
U_DataType tmp_press = filter_middle(collect_pressure, COLLECT_HB203_DATA_NUM, FILTER_DATA_TYPE_FLOAT);
|
||||
if(tmp_press.fValue < 300)
|
||||
{
|
||||
tmp_press.fValue = 300;
|
||||
// return FALSE;
|
||||
goto error_return;
|
||||
}
|
||||
if(tmp_press > 1200)
|
||||
if(tmp_press.fValue > 1200)
|
||||
{
|
||||
tmp_press.fValue = 1200;
|
||||
// return FALSE;
|
||||
goto error_return;
|
||||
}
|
||||
// 温度
|
||||
float collect_tempture[COLLECT_HB203_DATA_NUM]={0x00};
|
||||
U_DataType collect_tempture[COLLECT_HB203_DATA_NUM]={0x00};
|
||||
|
||||
for(int i=0; i<COLLECT_HB203_DATA_NUM; i++){
|
||||
hp203_set_mode();
|
||||
osDelay(5);
|
||||
ret = Hp203bReadTempture(&collect_tempture[i]);
|
||||
if(ret == FALSE)
|
||||
{
|
||||
temp_falt++;
|
||||
continue;
|
||||
//goto error_return;
|
||||
collect_tempture[i].fValue = Hp203bReadTempture();
|
||||
osDelay(1);
|
||||
}
|
||||
osDelay(5);
|
||||
}
|
||||
if(temp_falt >= COLLECT_HB203_DATA_NUM)
|
||||
{
|
||||
goto error_return;
|
||||
}
|
||||
//求平均
|
||||
float tmp_tempture = calculateAverage(collect_tempture, COLLECT_HB203_DATA_NUM - temp_falt);
|
||||
if(tmp_tempture < -50)
|
||||
|
||||
U_DataType tmp_tempture = filter_middle(collect_tempture, COLLECT_HB203_DATA_NUM, FILTER_DATA_TYPE_FLOAT);
|
||||
if(tmp_tempture.fValue < -40)
|
||||
{
|
||||
tmp_tempture.fValue = -40;
|
||||
// return FALSE;
|
||||
goto error_return;
|
||||
}
|
||||
if(tmp_tempture > 95)
|
||||
if(tmp_tempture.fValue > 85)
|
||||
{
|
||||
tmp_tempture.fValue = 85;
|
||||
// return FALSE;
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
*tempdata = tmp_tempture;
|
||||
*press = tmp_press;
|
||||
*tempdata = tmp_tempture.fValue;
|
||||
*press = tmp_press.fValue;
|
||||
return TRUE;
|
||||
|
||||
error_return:
|
||||
|
|
|
@ -1,241 +0,0 @@
|
|||
#include "ms5607.h"
|
||||
#include "i2c.h"
|
||||
#include "filter.h"
|
||||
#include "anemometer_dev.h"
|
||||
#include "uart_dev.h"
|
||||
|
||||
static void MS56XX_Reset(void)
|
||||
{
|
||||
uint8_t _cmd[] = {0x1e};
|
||||
HAL_I2C_Master_Transmit(&hi2c3, MS5607_ADDRESS, _cmd, 1, 0xff);
|
||||
osDelay(5);
|
||||
}
|
||||
|
||||
static void MS56XX_Read_PromData(uint16_t *VAL_C)
|
||||
{
|
||||
uint8_t _cmd[] = {0xa0};
|
||||
uint8_t temp_buff[2] = {0};
|
||||
for(uint8_t i = 0; i < 8; i++)
|
||||
{
|
||||
HAL_I2C_Master_Transmit(&hi2c3, MS5607_ADDRESS, _cmd, 1, 0xff);
|
||||
HAL_I2C_Master_Receive(&hi2c3, MS5607_ADDRESS, temp_buff, 2, 0xff);
|
||||
*(VAL_C + i) = temp_buff[0];
|
||||
*(VAL_C + i) <<= 8;
|
||||
*(VAL_C + i) += temp_buff[1];
|
||||
_cmd[0] += 0x02;
|
||||
}
|
||||
}
|
||||
|
||||
static uint16_t MS56XX_C_Value[8] = {0};
|
||||
void MS56XX_Init(void)
|
||||
{
|
||||
MS56XX_Reset();
|
||||
MS56XX_Read_PromData(MS56XX_C_Value);
|
||||
}
|
||||
|
||||
static HAL_StatusTypeDef MS56XX_ReadD1_Press(uint32_t *D1_Value)
|
||||
{
|
||||
uint8_t D1_Value_Buff[3] = {0xFF, 0xFF, 0xFF};
|
||||
uint8_t _cmd[] = {0x48};
|
||||
uint8_t _addr[] = {0x00};
|
||||
if(HAL_I2C_Master_Transmit(&hi2c3, MS5607_ADDRESS, _cmd, 1, 0xff) != HAL_OK)
|
||||
{
|
||||
return HAL_ERROR;
|
||||
}
|
||||
osDelay(10);
|
||||
if(HAL_I2C_Master_Transmit(&hi2c3, MS5607_ADDRESS, _addr, 1, 0xff) != HAL_OK)
|
||||
{
|
||||
return HAL_ERROR;
|
||||
}
|
||||
if(HAL_I2C_Master_Receive(&hi2c3, MS5607_ADDRESS, D1_Value_Buff, 3, 0xff) != HAL_OK)
|
||||
{
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
uint32_t press;
|
||||
press = D1_Value_Buff[0];
|
||||
press <<= 8;
|
||||
press += D1_Value_Buff[1];
|
||||
press <<= 8;
|
||||
press += D1_Value_Buff[2];
|
||||
*D1_Value = press;
|
||||
return HAL_OK;
|
||||
}
|
||||
|
||||
static HAL_StatusTypeDef MS56XX_ReadD2_Temp(uint32_t *D2_Value_)
|
||||
{
|
||||
uint8_t D2_Value_Buff[3] = {0x00, 0x00, 0x00};
|
||||
uint8_t _cmd[] = {0x58};
|
||||
uint8_t _addr[] = {0x00};
|
||||
if(HAL_I2C_Master_Transmit(&hi2c3, MS5607_ADDRESS, _cmd, 1, 0xff) != HAL_OK)
|
||||
{
|
||||
return HAL_ERROR;
|
||||
}
|
||||
osDelay(10);
|
||||
if(HAL_I2C_Master_Transmit(&hi2c3, MS5607_ADDRESS, _addr, 1, 0xff) != HAL_OK)
|
||||
{
|
||||
return HAL_ERROR;
|
||||
}
|
||||
if(HAL_I2C_Master_Receive(&hi2c3, MS5607_ADDRESS, D2_Value_Buff, 3, 0xff) != HAL_OK)
|
||||
{
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
uint32_t Temp;
|
||||
Temp = D2_Value_Buff[0];
|
||||
Temp <<= 8;
|
||||
Temp += D2_Value_Buff[1];
|
||||
Temp <<= 8;
|
||||
Temp += D2_Value_Buff[2];
|
||||
*D2_Value_ = Temp;
|
||||
return HAL_OK;
|
||||
}
|
||||
|
||||
static HAL_StatusTypeDef MS56XX_GetTemperature (int32_t *dT, int32_t *MS56XX_Temp) //计算温度
|
||||
{
|
||||
uint32_t D2_Value;
|
||||
if(MS56XX_ReadD2_Temp(&D2_Value) != HAL_OK) //循环读取 D2
|
||||
{
|
||||
return HAL_ERROR;
|
||||
}
|
||||
// term_printf("D2:%d\r\n", D2_Value);
|
||||
|
||||
if(D2_Value > (MS56XX_C_Value[5] * 256))
|
||||
{
|
||||
*dT = D2_Value - MS56XX_C_Value[5] * 256; //公式 dT = D2 - TREF = D2 - C5 * 2^8
|
||||
}else
|
||||
{
|
||||
*dT = MS56XX_C_Value[5] * 256 - D2_Value; //公式 dT = D2 - TREF = D2 - C5 * 2^8
|
||||
*dT *= -1;
|
||||
}
|
||||
|
||||
// term_printf("dT:%d\r\n", *dT);
|
||||
*MS56XX_Temp = 2000 + *dT * ((int32_t)MS56XX_C_Value[6]/8388608.0); //算出温度值的100倍,2001表示20.01° 公式TEMP =20°C + dT * TEMPSENS =2000 + dT * C6 / 2^23
|
||||
return HAL_OK;
|
||||
}
|
||||
|
||||
static HAL_StatusTypeDef MS56XX_GetPressureTemp(float *Temp, float *Press) //计算温度补偿压力
|
||||
{
|
||||
int32_t dT;
|
||||
int32_t MS56XX_Temperature;
|
||||
uint32_t D1_Value;
|
||||
if(MS56XX_ReadD1_Press(&D1_Value) != HAL_OK) //循环读取 D1
|
||||
{
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
if(MS56XX_GetTemperature(&dT, &MS56XX_Temperature) != HAL_OK)//读取dT,Temp
|
||||
{
|
||||
return HAL_ERROR;
|
||||
}
|
||||
// term_printf("TEMP:%d\r\n", MS56XX_Temperature);
|
||||
|
||||
// term_printf("dT:%d\r\n", dT);
|
||||
// term_printf("TEMP:%d\r\n", MS56XX_Temperature);
|
||||
|
||||
int64_t OFF = ((int64_t)MS56XX_C_Value[2] * 131072) + ((int64_t)MS56XX_C_Value[4] * dT )/ 64.0; //公式 OFF = OFFT1 + TCO *dT = C2 *2^17 +(C4 *dT )/ 2^6
|
||||
int64_t SENS = ((int64_t)MS56XX_C_Value[1] * 65536) + ((int64_t)MS56XX_C_Value[3] * dT )/ 128.0; //公式SENS = SENST1 + TCS* dT= C1 * 2^16 + (C3 * dT )/ 2^7
|
||||
|
||||
// term_printf("OFF:%d\r\n", OFF);
|
||||
// term_printf("SENS:%d\r\n", SENS);
|
||||
|
||||
//温度补偿部分 逻辑看芯片手册
|
||||
int64_t T2 = 0;
|
||||
int64_t OFF2 = 0;
|
||||
int64_t SENS2 = 0;
|
||||
if (MS56XX_Temperature < 2000 ) // second order temperature compensation when under 20 degrees C
|
||||
{
|
||||
T2 = (dT * dT) / 2147483648.0;
|
||||
OFF2 = 61 * ((MS56XX_Temperature - 2000) * (MS56XX_Temperature - 2000)) / 16;
|
||||
SENS2 = 2 * ((MS56XX_Temperature - 2000) * (MS56XX_Temperature - 2000)) ;
|
||||
if (MS56XX_Temperature < -1500)
|
||||
{
|
||||
OFF2 = OFF2 + 15 * ((MS56XX_Temperature + 1500) * (MS56XX_Temperature + 1500));
|
||||
SENS2 = SENS2 + 8 * ((MS56XX_Temperature + 1500) * (MS56XX_Temperature + 1500));
|
||||
}
|
||||
}
|
||||
|
||||
// term_printf("T2:%d\r\n", T2);
|
||||
MS56XX_Temperature = MS56XX_Temperature - T2;
|
||||
OFF = OFF - OFF2;
|
||||
SENS = SENS - SENS2;
|
||||
|
||||
|
||||
int32_t Tmp_Pressure = ((int32_t)D1_Value * SENS/2097152 - OFF) / 32768; //公式 P = D1 * SENS - OFF = (D1 * SENS / 2^21 - OFF) / 2^15
|
||||
|
||||
// term_printf("\r\nC1-C6:%d %d %d %d %d %d\r\n", MS56XX_C_Value[1], MS56XX_C_Value[2], MS56XX_C_Value[3], MS56XX_C_Value[4], MS56XX_C_Value[5], MS56XX_C_Value[6]);
|
||||
// term_printf("D1:%d\r\n", D1_Value);
|
||||
//
|
||||
// term_printf("dT:%d\r\n", dT);
|
||||
//
|
||||
// term_printf("OFF:%d\r\n", OFF);
|
||||
// term_printf("SENS:%d\r\n", SENS);
|
||||
// term_printf("P:%d\r\n", Tmp_Pressure);
|
||||
// term_printf("TEMP:%d\r\n", MS56XX_Temperature);
|
||||
// term_printf("PRESS:%d\r\n", Tmp_Pressure);
|
||||
if(MS56XX_Temperature<-6000)
|
||||
{
|
||||
MS56XX_Temperature=-6000;
|
||||
return HAL_ERROR;
|
||||
}
|
||||
if(MS56XX_Temperature>9000)
|
||||
{
|
||||
MS56XX_Temperature=9000;
|
||||
return HAL_ERROR;
|
||||
}
|
||||
if(Tmp_Pressure<1000)
|
||||
{
|
||||
// Tmp_Pressure=1000;
|
||||
*Press = 0;
|
||||
return HAL_ERROR;
|
||||
}
|
||||
if(Tmp_Pressure>120000)
|
||||
{
|
||||
// Tmp_Pressure=120000;
|
||||
*Press = 0;
|
||||
return HAL_ERROR;
|
||||
}
|
||||
*Temp = ((float)MS56XX_Temperature)/100;
|
||||
*Press = ((float)Tmp_Pressure)/100;
|
||||
return HAL_OK;
|
||||
}
|
||||
|
||||
static float calculateAverage(float arr[], int avgLength) {
|
||||
float sum = 0;
|
||||
|
||||
// 遍历数组(最多10个元素),收集非零值直到达到指定数量
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
sum += arr[i];
|
||||
}
|
||||
|
||||
// 计算平均值并限制最大值
|
||||
float average = sum / avgLength;
|
||||
return average;
|
||||
}
|
||||
|
||||
#define COLLECT_DATA_NUM 10
|
||||
HAL_StatusTypeDef MS56XX_GetPressure(float *Press)
|
||||
{
|
||||
float temp_buff;
|
||||
float pressure_buff[COLLECT_DATA_NUM] = {0};
|
||||
uint8_t ret_falt = 0;
|
||||
for(uint8_t i = 0;i<COLLECT_DATA_NUM;i++)
|
||||
{
|
||||
if(MS56XX_GetPressureTemp(&temp_buff, &pressure_buff[i]) != HAL_OK)
|
||||
{
|
||||
ret_falt++;
|
||||
pressure_buff[i] = 0;
|
||||
}
|
||||
osDelay(15);//转换时间
|
||||
}
|
||||
if(ret_falt >= COLLECT_DATA_NUM)
|
||||
{
|
||||
return HAL_ERROR;
|
||||
}
|
||||
*Press = calculateAverage( pressure_buff,COLLECT_DATA_NUM - ret_falt);
|
||||
// if(MS56XX_GetPressureTemp(&temp_buff, Press) != HAL_OK)
|
||||
// {
|
||||
// return HAL_ERROR;
|
||||
// }
|
||||
return HAL_OK;
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
#ifndef __MS5607_H__
|
||||
#define __MS5607_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "main.h"
|
||||
#include "comm_types.h"
|
||||
#include "cmsis_os.h"
|
||||
|
||||
#define MS5607_ADDRESS 0x77<<1
|
||||
|
||||
void MS56XX_Init(void);
|
||||
HAL_StatusTypeDef MS56XX_GetPressure(float *Press);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /*__ __MS5607_H__ */
|
||||
|
|
@ -33,7 +33,7 @@ static u_int8_t i2c_write_cmd(u_int8_t addr,u_int16_t cmd)
|
|||
cmd_buff[0] = cmd>>8;
|
||||
cmd_buff[1] = cmd;
|
||||
|
||||
u_int8_t ret = HAL_I2C_Master_Transmit(&hi2c1,addr,cmd_buff,2,0xff);
|
||||
u_int8_t ret = HAL_I2C_Master_Transmit(&hi2c1,addr,cmd_buff,2,0xffff);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ u_int8_t sht30_init()
|
|||
if(ret == TRUE)
|
||||
term_printf("Sensor Sht30 Check OK.\r\n Temp:%.2f,Humi:%.2f\r\n", temp,humi);
|
||||
else
|
||||
// term_printf("Sensor Sht30 Check Err.\r\n");
|
||||
term_printf("Sensor Sht30 Check Err.\r\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ u_int8_t sht30_collect_data(stTempHumiSensor stSensorDev, float *temp, float *hu
|
|||
|
||||
i2c_write_cmd(stSensorDev.i2c_reg_addr,stSensorDev.cmd_read_data);
|
||||
|
||||
if(HAL_I2C_Master_Receive(&hi2c1,stSensorDev.i2c_reg_addr,read_buff,6,0xff) != HAL_OK){
|
||||
if(HAL_I2C_Master_Receive(&hi2c1,stSensorDev.i2c_reg_addr,read_buff,6,0xffff) != HAL_OK){
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
|
@ -119,107 +119,73 @@ u_int8_t sht30_collect_data(stTempHumiSensor stSensorDev, float *temp, float *hu
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 温湿度数据采集
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
u_int8_t sht45_collect_data(stTempHumiSensor stSensorDev, float *temp, float *humi)
|
||||
{
|
||||
u_int8_t read_buff[6] = {0};
|
||||
uint8_t _cmd[] = {0xFD};
|
||||
|
||||
u_int16_t temp_value;
|
||||
u_int16_t humi_value;
|
||||
|
||||
HAL_I2C_Master_Transmit(&hi2c1,stSensorDev.i2c_reg_addr,_cmd,1,0xff);
|
||||
osDelay(15);
|
||||
|
||||
if(HAL_I2C_Master_Receive(&hi2c1,stSensorDev.i2c_reg_addr,read_buff,6,0xff) != HAL_OK){
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
if(CheckCrc8(read_buff, 0xFF) != read_buff[2] && CheckCrc8(&read_buff[3], 0xFF) != read_buff[5]){
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
temp_value = ((u_int16_t)read_buff[0]<<8)|read_buff[1];
|
||||
*temp = -45 + 175*((float)temp_value/65535);
|
||||
|
||||
humi_value = ((u_int16_t)read_buff[3]<<8)|read_buff[4];
|
||||
*humi = -6 + 125*((float)humi_value / 65535);
|
||||
|
||||
return HAL_OK;
|
||||
}
|
||||
|
||||
static float calculateAverage(float arr[], int avgLength) {
|
||||
float sum = 0;
|
||||
|
||||
// 遍历数组(最多10个元素),收集非零值直到达到指定数量
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
sum += arr[i];
|
||||
}
|
||||
|
||||
// 计算平均值并限制最大值
|
||||
float average = sum / avgLength;
|
||||
return average;
|
||||
}
|
||||
/**
|
||||
* @brief »ñÈ¡ÎÂʪ¶ÈÊý¾Ý
|
||||
* @param
|
||||
* @retval
|
||||
*/
|
||||
#define COLLECT_DATA_NUM 10
|
||||
HAL_StatusTypeDef get_temp_humi_data(float* temdata, float* humidata)
|
||||
BOOL get_temp_humi_data(float* temdata, float* humidata)
|
||||
{
|
||||
float collect_temdata[COLLECT_DATA_NUM] = {0};
|
||||
float collect_humidata[COLLECT_DATA_NUM] = {0};
|
||||
float tmp_temdata,tmp_humidata;
|
||||
uint8_t ret_falt = 0;
|
||||
U_DataType collect_temdata[COLLECT_DATA_NUM]={0x00};
|
||||
U_DataType collect_humidata[COLLECT_DATA_NUM]={0x00};
|
||||
U_DataType tmp_temdata,tmp_humidata;
|
||||
|
||||
for(int i=0; i<COLLECT_DATA_NUM; i++){
|
||||
if(sht45_collect_data(g_stTempHumiSensor,&collect_temdata[i], &collect_humidata[i]) == HAL_ERROR)
|
||||
{
|
||||
ret_falt++;
|
||||
collect_temdata[i] = 0;
|
||||
collect_humidata[i] = 0;
|
||||
}
|
||||
int ret = sht30_collect_data(g_stTempHumiSensor,&collect_temdata[i].fValue, &collect_humidata[i].fValue);
|
||||
// AssertError(ret == HAL_OK, return FALSE, "sht30采样失败");
|
||||
if(ret == HAL_ERROR)
|
||||
// return FALSE;
|
||||
goto error_return;
|
||||
osDelay(1);
|
||||
}
|
||||
if(ret_falt >= COLLECT_DATA_NUM)
|
||||
|
||||
tmp_temdata = filter_middle(collect_temdata,COLLECT_DATA_NUM, FILTER_DATA_TYPE_FLOAT);
|
||||
tmp_humidata = filter_middle(collect_humidata,COLLECT_DATA_NUM, FILTER_DATA_TYPE_FLOAT);
|
||||
|
||||
// 断言有问题
|
||||
// AssertError((tmp_temdata.fValue >= -40) && (tmp_temdata.fValue <= 85), return FALSE, "sht30温度值校验失败");
|
||||
// AssertError((tmp_humidata.fValue >= 0) && (tmp_humidata.fValue <= 100), return FALSE, "sht30湿度值校验失败");
|
||||
if(tmp_temdata.fValue < -40)
|
||||
{
|
||||
tmp_temdata.fValue = -40;
|
||||
// term_printf("sht30温度值校验失败");
|
||||
// return FALSE;
|
||||
goto error_return;
|
||||
}
|
||||
if(tmp_temdata.fValue > 125)
|
||||
{
|
||||
tmp_temdata.fValue = 125;
|
||||
// term_printf("sht30温度值校验失败");
|
||||
// return FALSE;
|
||||
goto error_return;
|
||||
}
|
||||
if(tmp_humidata.fValue < 0)
|
||||
{
|
||||
tmp_humidata.fValue = 0;
|
||||
// term_printf("sht30湿度值校验失败");
|
||||
// return FALSE;
|
||||
goto error_return;
|
||||
}
|
||||
if(tmp_humidata.fValue > 100)
|
||||
{
|
||||
tmp_humidata.fValue = 100;
|
||||
// term_printf("sht3湿度值校验失败");
|
||||
// return FALSE;
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
tmp_temdata = calculateAverage(collect_temdata,COLLECT_DATA_NUM - ret_falt);
|
||||
tmp_humidata = calculateAverage(collect_humidata,COLLECT_DATA_NUM - ret_falt);
|
||||
*temdata = tmp_temdata.fValue;
|
||||
*humidata = tmp_humidata.fValue;
|
||||
|
||||
if(tmp_temdata < -50.0)
|
||||
{
|
||||
tmp_temdata = -50.0;
|
||||
}
|
||||
if(tmp_temdata > 125.0)
|
||||
{
|
||||
tmp_temdata = 125.0;
|
||||
}
|
||||
if(tmp_humidata < 0.0)
|
||||
{
|
||||
tmp_humidata = 0.0;
|
||||
}
|
||||
if(tmp_humidata > 100.0)
|
||||
{
|
||||
tmp_humidata = 100.0;
|
||||
}
|
||||
|
||||
*temdata = tmp_temdata;
|
||||
*humidata = tmp_humidata;
|
||||
|
||||
return HAL_OK;
|
||||
//g_stTempHumiData.temp = tmp_temdata.fValue;
|
||||
//g_stTempHumiData.humi = tmp_humidata.fValue;
|
||||
return TRUE;
|
||||
|
||||
error_return:
|
||||
*temdata = 0;
|
||||
*humidata = 0;
|
||||
return HAL_ERROR;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#define __SHT30_H_
|
||||
|
||||
#include "comm_types.h"
|
||||
#include "main.h"
|
||||
|
||||
#define SHT30 "SHT30"
|
||||
|
||||
|
@ -22,6 +21,6 @@ typedef struct _stTempHumiData{
|
|||
extern stTempHumiData g_stTempHumiData;
|
||||
|
||||
u_int8_t sht30_init();
|
||||
HAL_StatusTypeDef get_temp_humi_data(float* temdata, float* humidata);
|
||||
BOOL get_temp_humi_data(float* temdata, float* humidata);
|
||||
//void TEST_read_sht30_value();
|
||||
#endif
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
#include "tmp117.h"
|
||||
#include "i2c.h"
|
||||
#include "cmsis_os.h"
|
||||
|
||||
|
||||
// 初始化温度传感器
|
||||
HAL_StatusTypeDef TMP117_Init(void)
|
||||
{
|
||||
// 配置值:
|
||||
uint8_t config_data[2] = {0x0C, 0x00}; // 高字节在前,单次转换,1100 0000 0000,12.5ms
|
||||
return HAL_I2C_Mem_Write(&hi2c1, TMP117_ADDR << 1, TMP117_CONFIG_REG,
|
||||
I2C_MEMADD_SIZE_8BIT, config_data, 2, 100);
|
||||
}
|
||||
|
||||
// 从寄存器读取双字节数据
|
||||
HAL_StatusTypeDef TMP117_Read(uint8_t reg, uint8_t *buffer) {
|
||||
return HAL_I2C_Mem_Read(&hi2c1, TMP117_ADDR << 1, reg,
|
||||
I2C_MEMADD_SIZE_8BIT, buffer, 2, 100);
|
||||
}
|
||||
|
||||
static float calculateAverage(float arr[], int avgLength) {
|
||||
float sum = 0;
|
||||
|
||||
// 遍历数组(最多10个元素),收集非零值直到达到指定数量
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
sum += arr[i];
|
||||
}
|
||||
|
||||
// 计算平均值并限制最大值
|
||||
float average = sum / avgLength;
|
||||
return average;
|
||||
}
|
||||
// 获取温度值(单位:℃)
|
||||
#define COLLECT_DATA_NUM 10
|
||||
HAL_StatusTypeDef TMP117_Get_Temp(float *temp)
|
||||
{
|
||||
uint8_t raw_data[2] = {0};
|
||||
int16_t temp_raw;
|
||||
uint8_t ret_falt = 0;
|
||||
float ret_temp;
|
||||
float temp_temp[COLLECT_DATA_NUM] = {0};
|
||||
|
||||
for(int i = 0; i<COLLECT_DATA_NUM; i++)
|
||||
{
|
||||
TMP117_Init();
|
||||
osDelay(20);
|
||||
if(TMP117_Read(TMP117_TEMP_REG, raw_data) != HAL_OK)
|
||||
{
|
||||
ret_falt++;
|
||||
temp_temp[i] = 0;
|
||||
}else
|
||||
{
|
||||
temp_raw = (raw_data[0] << 8) | raw_data[1];
|
||||
temp_temp[i] = temp_raw * 0.0078125f;
|
||||
}
|
||||
|
||||
}
|
||||
if(ret_falt >= COLLECT_DATA_NUM)
|
||||
{
|
||||
*temp = 0;
|
||||
return HAL_ERROR;
|
||||
}
|
||||
|
||||
ret_temp = calculateAverage(temp_temp, COLLECT_DATA_NUM - ret_falt);
|
||||
|
||||
if(ret_temp <= -60)
|
||||
{
|
||||
*temp = -60;
|
||||
}else if(ret_temp >= 150)
|
||||
{
|
||||
*temp = 150;
|
||||
}else
|
||||
{
|
||||
*temp = ret_temp;
|
||||
}
|
||||
return HAL_OK;
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
#ifndef __TMP117_H_
|
||||
#define __TMP117_H_
|
||||
|
||||
#include "comm_types.h"
|
||||
#include "main.h"
|
||||
|
||||
#define TMP117_ADDR 0x48 //A0接GND
|
||||
//#define TMP117_ADDR 0x49 //A0接V+
|
||||
//#define TMP117_ADDR 0x4A //A0接SDA
|
||||
//#define TMP117_ADDR 0x4B //A0接SCL
|
||||
|
||||
#define TMP117_TEMP_REG 0x00 //温度寄存器
|
||||
#define TMP117_CONFIG_REG 0x01 //配置寄存器
|
||||
#define TMP117_TLOW_REG 0x02 //温度高报警寄存器
|
||||
#define TMP117_THIGH_REG 0x03 //温度低报警寄存器
|
||||
|
||||
|
||||
|
||||
HAL_StatusTypeDef TMP117_Init(void);
|
||||
HAL_StatusTypeDef TMP117_Read(uint8_t reg, uint8_t *buffer);
|
||||
HAL_StatusTypeDef TMP117_Get_Temp(float *temp);
|
||||
|
||||
#endif //__TMP117_H_
|
||||
|
||||
|
||||
|
||||
|
|
@ -374,8 +374,6 @@
|
|||
<state>$PROJ_DIR$\..\tools</state>
|
||||
<state>$PROJ_DIR$\..\App\Inc</state>
|
||||
<state>$PROJ_DIR$\..\Drivers\HP203B</state>
|
||||
<state>$PROJ_DIR$\..\Drivers\Tmp117</state>
|
||||
<state>$PROJ_DIR$\..\Drivers\MS5607</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCStdIncCheck</name>
|
||||
|
@ -1487,8 +1485,6 @@
|
|||
<state>$PROJ_DIR$\..\tools</state>
|
||||
<state>$PROJ_DIR$\..\App\Inc</state>
|
||||
<state>$PROJ_DIR$\..\Drivers\HP203B</state>
|
||||
<state>$PROJ_DIR$\..\Drivers\Tmp117</state>
|
||||
<state>$PROJ_DIR$\..\Drivers\MS5607</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>CCStdIncCheck</name>
|
||||
|
@ -1816,7 +1812,7 @@
|
|||
<data>
|
||||
<extensions></extensions>
|
||||
<cmdline></cmdline>
|
||||
<hasPrio>184</hasPrio>
|
||||
<hasPrio>1</hasPrio>
|
||||
<buildSequence>inputOutputBased</buildSequence>
|
||||
</data>
|
||||
</settings>
|
||||
|
@ -2249,9 +2245,6 @@
|
|||
<file>
|
||||
<name>$PROJ_DIR$\..\App\Inc\comm_types.h</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\App\Inc\encrypt.h</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\App\Inc\frt_protocol.h</name>
|
||||
</file>
|
||||
|
@ -2273,9 +2266,6 @@
|
|||
<file>
|
||||
<name>$PROJ_DIR$\..\App\Src\anemometer_dev.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\App\Src\encrypt.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\App\Src\frt_protocol.c</name>
|
||||
</file>
|
||||
|
@ -2369,15 +2359,6 @@
|
|||
<name>$PROJ_DIR$\..\Drivers\HP203B\hp203b.h</name>
|
||||
</file>
|
||||
</group>
|
||||
<group>
|
||||
<name>MS5607</name>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Drivers\MS5607\ms5607.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Drivers\MS5607\ms5607.h</name>
|
||||
</file>
|
||||
</group>
|
||||
<group>
|
||||
<name>RingQueue</name>
|
||||
<file>
|
||||
|
@ -2495,15 +2476,6 @@
|
|||
<name>$PROJ_DIR$\..\Drivers\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c</name>
|
||||
</file>
|
||||
</group>
|
||||
<group>
|
||||
<name>tmp117</name>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Drivers\Tmp117\tmp117.c</name>
|
||||
</file>
|
||||
<file>
|
||||
<name>$PROJ_DIR$\..\Drivers\Tmp117\tmp117.h</name>
|
||||
</file>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<name>Middlewares</name>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue