This repository has been archived on 2025-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
torsion/User/app.h

39 lines
903 B
C

#ifndef __APP_H__
#define __APP_H__
#include "main.h"
#include "board.h"
#include "motor.h"
typedef struct
{
bool is_open;
float32 calibration_value;
uint32_t original_value;
} calibration_sensor_data_t;
typedef struct
{
calibration_sensor_data_t torsion_in13; // 扭力
calibration_sensor_data_t ipressure_in7; // 压力
calibration_sensor_data_t iflow_in8; // 流量
calibration_sensor_data_t opressure_in9; // 压力
calibration_sensor_data_t oflow_in10; // 流量
} adcs_t;
typedef struct
{
adcs_t adc; // 采集的传感器数据
} app_t;
extern uint8_t cpu_percent; // CPU使用率
extern uint8_t mem_percent; // 内存使用率
extern void app_init(void); ///< 应用初始化
extern void app_start(void); ///< 应用启动
extern void flow_init(void); ///< 流程初始化
extern void flow_start(void); ///< 流程启动
#endif // __APP_H__