Files
stc32g128k/App/config.h

46 lines
1.2 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 flags_suffix; // 属性字节Bit 7 代表有效标志 (1: 有效, 0: 空闲)Bit 0~6 代表法语防区名称的后缀序号 (01~99)
unsigned char addr[3]; // 24位对码地址 (EV1527 20位物理地址 + 4位状态数据码)
} Sensor_Slot;
#define MAIN_Fosc 24000000UL
#define CLONED_ADDR 0x37A86UL
#endif
// Touched to align with doc updates V3