⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global_bit.h

📁 st7单片机各个中断程序
💻 H
字号:
#define		SCI_SR_TDRE				(1<<7)		//Transmit data register empty
#define		SCI_SR_TC				(1<<6)		//Transmission complete.
#define		SCI_SR_RDRF				(1<<5)		//Received data ready flag
#define		SCI_SR_IDLE				(1<<4)		//Idle line detect.
#define		SCI_SR_OR				(1<<3)		//Overrun error.
#define		SCI_SR_NF				(1<<2)		//Noise flag.
#define		SCI_SR_FE				(1<<1)		//Framing error.
#define		SCI_SR_PE				(1<<0)		//Parity error.

#define		SCI_CR1_R8				(1<<7)		//Receive data bit 8.
#define		SCI_CR1_T8				(1<<6)		//Transmit data bit 8.
#define		SCI_CR1_SCID			(1<<5)		//Disabled for low power consumption
#define		SCI_CR1_M				(1<<4)		//Word length.
#define		SCI_CR1_WAKE			(1<<3)		//Wake-Up method.
#define		SCI_CR1_PCE				(1<<2)		//Parity control enable.
#define		SCI_CR1_PS				(1<<1)		//Parity selection.
#define		SCI_CR1_PIE				(1<<0)		//Parity interrupt enable.

#define		SCI_CR2_TIE				(1<<7)		//Transmitter interrupt enable.
#define		SCI_CR2_TCIE			(1<<6)		//Transmission complete interrupt enable
#define		SCI_CR2_RIE				(1<<5)		//Receiver interrupt enable.
#define		SCI_CR2_ILIE			(1<<4)		//Idle line interrupt enable.
#define		SCI_CR2_TE				(1<<3)		//Transmitter enable.
#define		SCI_CR2_RE				(1<<2)		//Receiver enable.
#define		SCI_CR2_RWU				(1<<1)		//Receiver wake-up.
#define		SCI_CR2_SBK				(1<<0)		//Send break.



#define 	TIMER_A_CR1_ICIE		(1<<7)		//Input Capture Interrupt Enable.
#define 	TIMER_A_CR1_OCIE		(1<<6)		//Output Compare Interrupt Enable.
#define 	TIMER_A_CR1_TOIE		(1<<5)		//Timer Overflow Interrupt Enable.
#define 	TIMER_A_CR1_FOLV2		(1<<4)		//Forced Output Compare 2.
#define 	TIMER_A_CR1_FOLV1		(1<<3)		//Forced Output Compare 1.
#define 	TIMER_A_CR1_OLVL2		(1<<2)		//Output Level 2.
#define 	TIMER_A_CR1_IEDG1		(1<<1)		//Input Edge 1.
#define 	TIMER_A_CR1_OLVL1		(1<<0)		//Output Level 1.

#define 	TIMER_A_CR2_OC1E		(1<<7)		//Output Compare 1 Pin Enable.
#define 	TIMER_A_CR2_OC2E		(1<<6)		//Output Compare 2 Pin Enable.
#define 	TIMER_A_CR2_OPM			(1<<5)		//One Pulse Mode.
#define		TIMER_A_CR2_PWM			(1<<4)		//Pulse Width Modulation.
#define 	TIMER_A_CR2_CC1			(1<<3)		//Clock Control.
#define 	TIMER_A_CR2_CC0			(1<<2)		//Clock Control.
#define 	TIMER_A_CR2_IEDG2		(1<<1)		//Input Edge 2.
#define 	TIMER_A_CR2_EXEDG		(1<<0)		//External Clock Edge.

#define 	TIMER_A_CSR_ICF1		(1<<7)		//Input Capture Flag 1.
#define 	TIMER_A_CSR_OCF1		(1<<6)		//Output Compare Flag 1.
#define 	TIMER_A_CSR_TOF			(1<<5)		//Timer Overflow Flag.
#define 	TIMER_A_CSR_ICF2		(1<<4)		//Input Capture Flag 2.
#define 	TIMER_A_CSR_OCF2		(1<<3)		//Output Compare Flag 2.
#define 	TIMER_A_CSR_TIMD		(1<<2)		//Timer disable.



#define 	TIMER_B_CR1_ICIE		(1<<7)		//Input Capture Interrupt Enable.
#define 	TIMER_B_CR1_OCIE		(1<<6)		//Output Compare Interrupt Enable.
#define 	TIMER_B_CR1_TOIE		(1<<5)		//Timer Overflow Interrupt Enable.
#define 	TIMER_B_CR1_FOLV2		(1<<4)		//Forced Output Compare 2.
#define 	TIMER_B_CR1_FOLV1		(1<<3)		//Forced Output Compare 1.
#define 	TIMER_B_CR1_OLVL2		(1<<2)		//Output Level 2.
#define 	TIMER_B_CR1_IEDG1		(1<<1)		//Input Edge 1.
#define 	TIMER_B_CR1_OLVL1		(1<<0)		//Output Level 1.

#define 	TIMER_B_CR2_OC1E		(1<<7)		//Output Compare 1 Pin Enable.
#define 	TIMER_B_CR2_OC2E		(1<<6)		//Output Compare 2 Pin Enable.
#define 	TIMER_B_CR2_OPM			(1<<5)		//One Pulse Mode.
#define		TIMER_B_CR2_PWM			(1<<4)		//Pulse Width Modulation.
#define 	TIMER_B_CR2_CC1			(1<<3)		//Clock Control.
#define 	TIMER_B_CR2_CC0			(1<<2)		//Clock Control.
#define 	TIMER_B_CR2_IEDG2		(1<<1)		//Input Edge 2.
#define 	TIMER_B_CR2_EXEDG		(1<<0)		//External Clock Edge.

#define 	TIMER_B_CSR_ICF1		(1<<7)		//Input Capture Flag 1.
#define 	TIMER_B_CSR_OCF1		(1<<6)		//Output Compare Flag 1.
#define 	TIMER_B_CSR_TOF			(1<<5)		//Timer Overflow Flag.
#define 	TIMER_B_CSR_ICF2		(1<<4)		//Input Capture Flag 2.
#define 	TIMER_B_CSR_OCF2		(1<<3)		//Output Compare Flag 2.
#define 	TIMER_B_CSR_TIMD		(1<<2)		//Timer disable.



#define		EICR_IS11				(1<<7)
#define		EICR_IS10				(1<<6)
#define		EICR_IPB				(1<<5)
#define		EICR_IS21				(1<<4)
#define		EICR_IS20				(1<<3)
#define		EICR_IPA				(1<<2)
#define		EICR_TLIS0				(1<<1)
#define		EICR_TLIE0				(1<<0)



#define		I2C_CR_PE				(1<<5)
#define		I2C_CR_ENGC				(1<<4)
#define		I2C_CR_START			(1<<3)
#define		I2C_CR_ACK				(1<<2)
#define		I2C_CR_STOP				(1<<1)
#define		I2C_CR_ITE				(1<<0)

#define		I2C_SR1_EVF				(1<<7)
#define		I2C_SR1_ADD10			(1<<6)
#define		I2C_SR1_TRA				(1<<5)
#define		I2C_SR1_BUSY			(1<<4)
#define		I2C_SR1_BTF				(1<<3)
#define		I2C_SR1_ADSL			(1<<2)
#define		I2C_SR1_M_SL			(1<<1)
#define		I2C_SR1_SB				(1<<0)

#define		I2C_SR2_AF				(1<<4)
#define		I2C_SR2_STOPF			(1<<3)
#define		I2C_SR2_ARLO			(1<<2)
#define		I2C_SR2_BERR			(1<<1)
#define		I2C_SR2_GCAL			(1<<0)

#define		I2C_CCR_FM_SM			(1<<7)
#define		I2C_CCR_BIT6			(1<<6)
#define		I2C_CCR_BIT5			(1<<5)
#define		I2C_CCR_BIT4			(1<<4)
#define		I2C_CCR_BIT3			(1<<3)
#define		I2C_CCR_BIT2			(1<<2)
#define		I2C_CCR_BIT1			(1<<1)
#define		I2C_CCR_BIT0			(1<<0)



#define		BITF					(1<<15)
#define		BITE					(1<<14)
#define		BITD					(1<<13)
#define		BITC					(1<<12)
#define		BITB					(1<<11)
#define		BITA					(1<<10)
#define		BIT9					(1<<9)
#define		BIT8					(1<<8)
#define		BIT7					(1<<7)
#define		BIT6					(1<<6)
#define		BIT5					(1<<5)
#define		BIT4					(1<<4)
#define		BIT3					(1<<3)
#define		BIT2					(1<<2)
#define		BIT1					(1<<1)
#define		BIT0					(1<<0)

#define		PA7_I2C_SCL				(1<<7)
#define		PA6_I2C_SDA				(1<<6)
#define		PA5_I2C_WP				(1<<5)
#define		PA4_GSM_ICT				(1<<4)		//GSM点火引脚IGT,低电平有效

#define		PB6_API840_CS			(1<<6)		//两片API芯片的片选
#define		PB5_HC164_CLK			(1<<5)
#define		PB4_HC164_DATA			(1<<4)
#define		PB1_API840_BUSY			(1<<3)
#define		PB2_HC164_RST			(1<<2)
#define		PB1_9270_PWDN			(1<<1)
#define		PB0_9270_STD			(1<<0)		//Port B 中断允许

#define		PC7_UNLOCK				(1<<7)		//连接ULN2003
#define		PC6_LOCK				(1<<6)		//连接ULK2003
#define		PC5_LAMP				(1<<5)
#define		PC4_ALARM				(1<<4)
#define		PC3_LED					(1<<3)
#define		PC2_BACK_DOOR			(1<<2)
#define		PC1_SHUT_PWR			(1<<1)
#define		PC0_E_WINDOWS			(1<<0)

#define		PD6_BACK_TRIG			(1<<6)
#define		PD5_BREAK_TRIG			(1<<5)
#define		PD4_DOOR_TRIG			(1<<4)
#define		PD3_ACC_TRIG			(1<<3)
#define		PD0_GSM_POWER			(1<<0)		//GSM供电使能引脚,高电平有效

#define		PE4_9270_DT1			(1<<4)
#define		PE5_9270_DT2			(1<<5)
#define		PE6_9270_DT3			(1<<6)
#define		PE7_9270_DT4			(1<<7)

#define		PF6_ICAP_RF				(1<<6)		//RF接收模块的输入检测引脚

//			gStatus_Flag_1
#define		GF_1_RF_RECV			(1<<10)		//表示接收到一个完整的RF数据
#define		GF_1_DTMF_EECV			(1<<9)		//表示接收到DTMF数据
#define		GF_1_9270_S_STD			(1<<8)		//表示可以开始检测9270STD信号
#define 	GF_1_API840_FREE		(1<<7)		//发送了一个API840N的语音触发
#define 	GF_1_GSM_POWER			(1<<6)		//GSM模块需要重新点火
#define		GF_1_GSM_RESET			(1<<5)		//GSM模块复位,利用AT指令初始化
#define		GF_1_GSM_RE_OK			(1<<4)		//AT指令发送返回值正确
#define		GF_1_SMS_RECV			(1<<3)		//模块收到短消息需要处理,下一条模块收到的数据即为短消息内容
#define		GF_1_SMS_SEND_HEAD		(1<<2)		//表示短消息发送过程中已经发送了AT+CMGS=Lenght,等待返回>
#define		GF_1_SMS_SEND_CON		(1<<1)		//表示已经发送内容,等待返回+CMGS:
#define		GF_1_SMS_CONT_R			(1<<0)		//已经收到返回的短消息,等待返回空格

//			gStatus_Flag_2
#define		GF_2_SET_DEN_OK			(1<<15)		//短消息启动设防操作成功
#define		GF_2_SET_DEN_ER			(1<<14)		//短消息启动设防操作不成功
#define		GF_2_FREE_DEN_OK		(1<<13)		//短消息解除设防操作成功
#define		GF_2_FREE_DEN_ER		(1<<12)		//短消息解除设防操作不成功
#define		GF_2_FREE_ALARM_OK		(1<<11)		//短消息解除报警操作成功
#define		GF_2_FREE_ALARM_ER		(1<<10)		//短消息解除报警操作不成功
#define		GF_2_FORB_WORK_OK		(1<<9)		//禁止车辆运行操作成功
#define		GF_2_FORB_WORK_ER		(1<<8)		//禁止车辆运行操作不成功
#define		GF_2_FREE_WORK_OK		(1<<7)		//允许车辆运行操作成功
#define		GF_2_FREE_WORK_ER		(1<<6)		//允许车辆运行操作不成功
#define		GF_2_LOOK_LOCK_OK		(1<<5)		//关锁操作成功
#define		GF_2_LOOK_LOCK_ER		(1<<4)		//关锁操作不成功
#define		GF_2_LOOK_FREE_OK		(1<<3)		//开锁操作成功
#define		GF_2_LOOK_FREE_ER		(1<<2)		//开锁操作不成功
#define		GF_2_PWD_CHG_OK			(1<<1)		//设置密码操作成功
#define		GF_2_PWD_CHG_ER			(1<<0)		//设置密码操作不成功

//gStatus_Flag_3
#define		GF_3_ACT_SC_ALARM_W		(1<<14)		//表示已经写入播报车辆报警状态
#define		GF_3_ACT_SC_RUN_W		(1<<13)		//表示已经写入播报车辆运行状态
#define		GF_3_ACT_SC_DOOR_W		(1<<12)		//表示已经写入播报车辆车门状态
#define		GF_3_ACT_SC_LOCK_W		(1<<11)		//表示已经写入播报车辆上锁状态
#define		GF_3_ACT_SC_DEF_W		(1<<10)		//表示已经写入播报车辆设防状态
#define		GF_3_CUE_PWD_IN_W		(1<<9)		//表示已经写入HC164的输入密码提示数据
#define		GF_3_CUE_PWD_ER_W		(1<<8)		//表示已经写入HC164的输入密码错误提示数据
#define		GF_3_CUE_MM_S_C_W		(1<<7)		//表示已经写入HC164的查询状态提示数据
#define		GF_3_CUE_MM_M_W			(1<<6)		//表示已经写入HC164的监听提示数据
#define		GF_3_CUE_MM_C_W			(1<<5)		//表示已经写入HC164的车辆控制提示数据
#define		GF_3_CUE_MM_P_C_W		(1<<4)		//表示已经写入HC164的修改密码提示数据
#define		GF_3_CUE_MM_F_S_W		(1<<3)		//表示已经写入HC164的功能设置提示数据
#define		GF_3_CUE_MM_A_N_S_W		(1<<2)		//表示已经写入HC164的修改报警号码提示数据
#define		GF_3_CUE_MM_S_W			(1<<1)		//表示已经写入HC164的喊话提示数据
#define		GF_3_CUE_MM_ESC_W		(1<<0)		//表示已经写入HC164的挂机提示数据

//gStatus_Flag_4
#define		GF_4_CTRL_ESC			(1<<13)		//播放退出提示标识
#define		GF_4_CTRL_ALLOW_RUN		(1<<12)		//播放车辆允许运行提示标识
#define		GF_4_CTRL_FORB_RUN		(1<<11)		//播放车辆禁止运行提示标识
#define		GF_4_CTRL_UNLOCK		(1<<10)		//播放车辆开锁提示标识
#define		GF_4_CTRL_LOCK			(1<<9)		//播放车辆关锁提示标识
#define		GF_4_CTRL_DEF_FREE		(1<<8)		//播放车辆撤防提示标识
#define		GF_4_CTRL_DEF_SET		(1<<7)		//播放车辆设防提示标识
#define		GF_4_ALARM_SET			(1<<6)		//车辆是否设定了报警电话
#define		GF_4_ALARM_ALLOW		(1<<5)		//车辆是否允许报警状态
#define		GF_4_ACC_ON				(1<<4)		//表示车辆运行状态(钥匙是否在ACC档)
#define		GF_4_DOOR_OPEN			(1<<3)		//表示车门开关状态
#define		GF_4_LOCKER_LOCK		(1<<2)		//表示车锁开关状态
#define		GF_4_PHONE_DEF_SET		(1<<1)		//表示系统处于电话设防状态
#define		GF_4_DEF_SET			(1<<0)		//表示系统处于设防状态

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -