📄 bsp_iodef.h
字号:
#ifndef _SYS_IOINI_H_
#define _SYS_IOINI_H_
//#include "sc16is752.h"
//#include "Zlg7290.h"
//#include "PCA9554.h"
//以下为控制所有外围器件的IO脚定义,包括SC16IS752驱动的引脚定义
//SPI、UART、EMI、I2C等的第二功能引脚在各自模块中定义
//以下宏在使用时注意后面加分号
#define IO_BIT_POT00 0x0001
#define IO_BIT_POT01 0x0002
#define IO_BIT_POT02 0x0004
#define IO_BIT_POT03 0x0008
#define IO_BIT_POT04 0x0010
#define IO_BIT_POT05 0x0020
#define IO_BIT_POT06 0x0040
#define IO_BIT_POT07 0x0080
#define IO_BIT_POT08 0x0100
#define IO_BIT_POT09 0x0200
#define IO_BIT_POT10 0x0400
#define IO_BIT_POT11 0x0800
#define IO_BIT_POT12 0x1000
#define IO_BIT_POT13 0x2000
#define IO_BIT_POT14 0x4000
#define IO_BIT_POT15 0x8000
#define IN_POWER_LOSS() (GPIO_BitRead(GPIO1, 7) | GPIO_BitRead(GPIO1, 7) | GPIO_BitRead(GPIO1, 7))
#define IN_DOOR() GPIO_BitRead(GPIO2, 9) //返回值类型u8,下同
#define IN_YX1() GPIO_BitRead(GPIO1, 2)
#define IN_YX2() GPIO_BitRead(GPIO1, 9)
#define IN_YX3() GPIO_BitRead(GPIO1, 10)
#define IN_YX4() GPIO_BitRead(GPIO1, 15)
#define IN_AD_SIG() GPIO_BitRead(GPIO1, 4)
#define OUT_WDI706(value) GPIO_BitWrite(GPIO1, 12, value)
#define OUT_BAT_RL(value) Out_SC752_GPIO(4, value) //????
#define OUT_BAT_CHARGE(value) GPIO_BitWrite(GPIO1, 6, value)
#define IN_COVER1() In_SC752_GPIO(7)
#define IN_COVER2() In_SC752_GPIO(6)
#define IN_COVER3() In_SC752_GPIO(5)
// LED指示灯操作定义
#define LED_RUN_ON() Initial_PCA9554();OUT_PCA9554_IO(7,0);//Write_ZLG7290_cmd(0x01,0x80 | 4);//OnOff_ZLG7290_Seg(ZLG7290_SegD, 0)
#define LED_RUN_OFF() OUT_PCA9554_IO(7,1);//Write_ZLG7290_cmd(0x01,0x00 | 4);//OnOff_ZLG7290_Seg(ZLG7290_SegD, 1)
#define LED_BAT_ON() GPIO_BitWrite(GPIO0, 3, 0);//Write_ZLG7290_cmd(0x01,0x80 | 2);//OnOff_ZLG7290_Seg(ZLG7290_SegC, 0)
#define LED_BAT_OFF() GPIO_BitWrite(GPIO0, 3, 1);//Write_ZLG7290_cmd(0x01,0x00 | 2);//OnOff_ZLG7290_Seg(ZLG7290_SegC, 1)
#define LED_ALARM_ON() OUT_PCA9554_IO(5,0);//Write_ZLG7290_cmd(0x01,0x80 | 3);//OnOff_ZLG7290_Seg(ZLG7290_SegE, 0)
#define LED_ALARM_OFF() OUT_PCA9554_IO(5,1);//Write_ZLG7290_cmd(0x01,0x00 | 3);//OnOff_ZLG7290_Seg(ZLG7290_SegE, 1)
#define LED_COM_ON() OUT_PCA9554_IO(6,0);//Write_ZLG7290_cmd(0x01,0x80 | 1);//OnOff_ZLG7290_Seg(ZLG7290_SegB, 0)
#define LED_COM_OFF() OUT_PCA9554_IO(6,1);//Write_ZLG7290_cmd(0x01,0x00 | 1);//OnOff_ZLG7290_Seg(ZLG7290_SegB, 1)
extern void SYS_IOint( void );
extern void Clear_WDT(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -