81 lines
2.4 KiB
C
81 lines
2.4 KiB
C
/**
|
||
* @file app.h
|
||
* @author: xxx
|
||
* @date: 2023-06-29 13:21:02
|
||
* @brief 应用层
|
||
* @copyright: Copyright (c) 2023 by xxx, All Rights Reserved.
|
||
*/
|
||
#ifndef __APP_H__
|
||
#define __APP_H__
|
||
#include "main.h"
|
||
#include "board.h"
|
||
#include "delay.h"
|
||
|
||
#include "entity.h"
|
||
|
||
#include "fal_execution.h"
|
||
#include "key.h" // 按键
|
||
#include "params.h" // 参数
|
||
#include "convert.h" // 转换
|
||
#include "mode.h" // 工作模式
|
||
|
||
typedef enum
|
||
{
|
||
APP_UART_1,
|
||
APP_UART_2,
|
||
APP_UART_MAX,
|
||
} app_uart_e;
|
||
|
||
// 这里的结构体不能使用1字节对齐,让其自动对齐
|
||
typedef struct
|
||
{
|
||
float32 input_current; // 输入电流
|
||
uint16_t valve_feedback; // 阀位反馈
|
||
uint16_t atmospheric_pressure_source; // 气压源压力
|
||
uint16_t pressure_at_port_a; // A口压力
|
||
uint16_t pressure_at_port_b; // B口压力
|
||
uint16_t amplifier_circuit; // 放大器回路
|
||
float32 built_in_temperature; // 内置温度
|
||
uint16_t ip_output_detection; // IP输出检测
|
||
float32 valve_percentage; // 阀位百分比
|
||
} app_analog_quantity_t; // 模拟量
|
||
|
||
typedef struct
|
||
{
|
||
float32 input_current; // 输入电流
|
||
uint16_t valve_feedback; // 阀位反馈
|
||
uint16_t atmospheric_pressure_source; // 气压源压力
|
||
uint16_t pressure_at_port_a; // A口压力
|
||
uint16_t pressure_at_port_b; // B口压力
|
||
uint16_t amplifier_circuit; // 放大器回路
|
||
float32 built_in_temperature; // 内置温度
|
||
uint16_t ip_output_detection; // IP输出检测
|
||
|
||
float32 target_row; // 目标行程
|
||
float32 current_row; // 当前行程
|
||
float32 friction; // 摩擦力
|
||
float32 spring_force; // 弹簧力
|
||
} app_digital_quantity_t; // 数字量
|
||
|
||
typedef struct
|
||
{
|
||
app_analog_quantity_t analog_quantity;
|
||
app_digital_quantity_t digital_quantity;
|
||
} app_dynamics_t;
|
||
|
||
extern void app_init(void);
|
||
extern void app_start(void);
|
||
|
||
extern void flow_init(void);
|
||
extern void flow_start(void);
|
||
|
||
extern BOOL app_hart_init(void);
|
||
extern BOOL app_hart_is_idle(void);
|
||
extern void hart_uart_init(void);
|
||
extern void hart_uart_dinit(void);
|
||
extern void hart_ble_init(void);
|
||
extern void hart_ble_dinit(void);
|
||
extern void h24_bluetooth_work(uint8_t index);
|
||
extern void menu_inspection(void);
|
||
#endif // __APP_H__
|