Files
stc32g128k/App/config.h

47 lines
1.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __CONFIG_H__
#define __CONFIG_H__
typedef unsigned char u8;
typedef unsigned int u16;
typedef unsigned long u32;
// 系统状态机状态定义
typedef enum {
STATE_NORMAL,
STATE_ARMED,
STATE_DISARMED,
STATE_PAIR_MENU,
STATE_PAIR_WAIT,
STATE_PAIR_CONFIRM,
STATE_PAIR_SUCCESS,
STATE_PAIR_FAIL,
STATE_ALARM,
STATE_SOS_EMITTED
} SystemState;
// 按键事件定义
typedef enum {
KEY_EVENT_NONE,
KEY_EVENT_UP_CLICK, // SW1 单击
KEY_EVENT_DOWN_CLICK, // SW2 单击
KEY_EVENT_SOS_CLICK, // SW3 单击
KEY_EVENT_UP_LONG, // SW1 长按3秒
KEY_EVENT_DOWN_LONG, // SW2 长按3秒
KEY_EVENT_SOS_LONG, // SW3 长按
KEY_EVENT_UP_DOWN_COMB // SW1 + SW2 组合按键
} KeyEvent;
// 传感器存储结构
typedef struct {
unsigned char is_used; // 是否配对 (0x01: 已配对, 其它: 空闲)
unsigned char addr[3]; // 24位对码地址 (EV1527)
unsigned char type; // 传感器类型: 0~4
unsigned char zone; // 防区类型: 0: 24h防区, 1: 普通防区
unsigned char name_gbk[16]; // 中文防区名称 (预留)
} Sensor_Slot;
#define MAIN_Fosc 24000000UL
#define CLONED_ADDR 0x37A86UL
#endif