123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #ifndef USER_APP
- #define USER_APP
- /* ----------------------- Modbus includes ----------------------------------*/
- #include "mb.h"
- #include "mbconfig.h"
- #include "mbframe.h"
- #include "mbutils.h"
- typedef enum {
- REG_MIN = 0x00,
- Air_condition_switch = 0x01,
- Air_condition_mode = 0x02,
- Air_wind_speed = 0x03,
- Air_set_temp = 0x04,
- Relay_Sta_Read = 0x05,
- Floor_heating_switch = 0x06,
- Floor_heating_temp = 0x07,
- Relay_Switch = 0x08,
- Fresh_air_switch = 0x09,
- Fresh_air_Param = 0x0a,
- Fresh_air_wind_speed = 0x0b,
- Compensates_temp = 0x0c,
- Real_time_temp = 0x0d,
- Real_time_Humidity = 0x0e,
- Real_time_Fa_param = 0x0f,
- Air_condition_Relay = 0x10,
- Floor_heating_Relay = 0x11,
- Fresh_air_reg = 0x12,
- Ltemp_Protection_valve = 0x13,
- Lock_screen = 0x14,
- Full_Half_Lock = 0x15,
- Data_send = 0x16,
- Led_Brightness = 0x17,
- Env_Light = 0x18,
- Sleep_time_addr = 0x19,
- Code_Version = 0x1a,
- Reserve_1 = 0x1b,
- Temperature_Unit = 0x1c,
- Temperature_Down_limit = 0x1D,
- Temperature_Up_limit = 0x1E,
- REG_MAX,
- }reg_def;
- /* -----------------------Slave Defines -------------------------------------*/
- #define S_DISCRETE_INPUT_START 0
- #define S_DISCRETE_INPUT_NDISCRETES 8
- #define S_COIL_START 0
- #define S_COIL_NCOILS 8
- #define S_REG_INPUT_START 0
- #define S_REG_INPUT_NREGS 4
- #define S_REG_HOLDING_START 0
- #define S_REG_HOLDING_NREGS 128
- /* -----------------------Slave Defines -------------------------------------*/
- extern UCHAR ucMBAddress;
- extern USHORT usSRegHoldBuf[S_REG_HOLDING_NREGS];
- #define local_addr_broadcast MB_ADDRESS_BROADCAST
- #define local_addr ucMBAddress
- #define Reg_sta usSRegHoldBuf
- extern uint8_t * MakeMessage(uint16_t addr, uint16_t value);
- extern uint8_t * MakeMultiMessage_KT(void);
- extern uint8_t * MakeMultiMessage_DN(void);
- extern uint8_t * MakeMultiMessage_XF(void);
- extern BOOL ReportActively (const UCHAR * request, USHORT reqlen);
- extern BOOL ReportEnabled (void);
- #endif
|