You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
1.9 KiB
106 lines
1.9 KiB
////////////////////////////////////////////////////////////////////////////
|
|
///@copyright Copyright (c) 2018, 传控科技 All rights reserved.
|
|
///-------------------------------------------------------------------------
|
|
/// @file bsp_drv.h
|
|
/// @brief bsp @ driver config
|
|
///-------------------------------------------------------------------------
|
|
/// @version 1.0
|
|
/// @author CC
|
|
/// @date 20220109
|
|
/// @note cc_AS_stc02
|
|
|
|
|
|
/*******************
|
|
|
|
|
|
app:
|
|
weight zero
|
|
零点校准: 上电和手工
|
|
|
|
-----------------------------
|
|
|
|
xxx.x
|
|
Layer4: send/show
|
|
|
|
write to buffer -->send
|
|
|
|
-----------------------------
|
|
|
|
weight = cal(adc32)
|
|
|
|
Layer3: app weight
|
|
|
|
|
|
tst_weight.adc32 = ts_adc_samples[0].out5;
|
|
选择曲线 line
|
|
|
|
单路到多路
|
|
-----------------------------
|
|
out3 滤波啊
|
|
out2 滤波啊
|
|
|
|
Layer2: asp asp_adc
|
|
|
|
out1 读取adc
|
|
|
|
-------------------------
|
|
void L0_ADS1231_readCH2(vtype ch,vU16 *d)
|
|
|
|
Layer1: bsp: bsp_cs1232 最底层的adc的采样
|
|
|
|
*******************/
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _app_weightzero_H
|
|
#define _app_weightzero_H
|
|
|
|
#include "TTSS_task.h"
|
|
#include "c_lib.h"
|
|
#include "../bsp/bsp_config.h"
|
|
#include "msp_uart0.h"
|
|
#include "../bsp/bsp_cs1232.h"
|
|
/////水一般是18-19升,再加上桶,就是大约20公斤
|
|
|
|
|
|
/*******
|
|
^
|
|
|
|
|
| o
|
|
| |
|
|
| o |
|
|
- - | |
|
|
o | |
|
|
| | |
|
|
|____|_____|____________>
|
|
|
|
0 40 80
|
|
[0] [1] [2]
|
|
|
|
上电时候 ,如果adc在一定范围内 自动清零
|
|
出厂:0 40 80
|
|
上电 0+-% 40+-% 80+-%
|
|
|
|
**/
|
|
|
|
|
|
typedef struct
|
|
{
|
|
TS_task task;
|
|
vS32 rough_weight;
|
|
vU32 zero_weight;
|
|
vU32 adc32;
|
|
vU32 t32a,t32b;
|
|
vU32 weight_dval;
|
|
/// ts_weight_sheet_ ws[3];
|
|
|
|
}TS_TASK_weight_zero;
|
|
|
|
extern TS_TASK_weight_zero tst_weight_zero;
|
|
void L3_task_weight_zero_init(void);
|
|
|
|
void L3_task_weight_zero_handler(TS_TASK_weight_zero *s);
|
|
|
|
#endif // #ifndef _APP_TASK_ADC_H
|
|
|
|
|