//
// Created by DELL on 2024/10/16.
//

#ifndef GMV_GATEWAY_BOARD_FFX_MASTER_H
#define GMV_GATEWAY_BOARD_FFX_MASTER_H

#include "main.h"

#define SLAVE_ADDRESS_START 1       // 从机地址起始
#define SLAVE_ADDRESS_END 8         // 从机地址结束

#define POWER_FFX_ADDRESS 0             //开关机状态
#define SET_TEMP_FFX_ADDRESS 0x0E       //设定温度
#define FAN_SPEED_FFX_ADDRESS 0x4       //风扇转速
#define INNER_NUM_FFX_ADDRESS 0x59      //线控器设定内机号地址
#define FLESH_AIR_ERROR_FFX_ADDRESS 0x6A      //新风机故障码地址

#define INNER_REG_ADDRESS 5

typedef struct
{
    uint8_t power;          // 开关机状态
    uint8_t mode;           // 模式
    uint8_t fresh_air_system;   // 新风机工作模式
    uint8_t fan_speed;      // 风机转速
    uint8_t set_temp;       // 设定温度
    uint8_t inner_num;      // 内机号
    uint8_t humidity_on;    // 加湿开始值
    uint8_t humidity_off;   // 加湿结束值
    uint8_t errors;         // 故障码
} ffx_status_t;

/**
 * init ffx master
 */
void ffx_master_init();

#endif //GMV_GATEWAY_BOARD_FFX_MASTER_H
