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

📄 com.h

📁 STM32_LCD5110资料
💻 H
字号:
#ifndef _COM_H_
#define _COM_H_

//位操作宏定义
#define bit_clr(sfr, bit) 	GPIO_ResetBits(sfr, bit)// sfr 端口的 bit 清零
#define bit_set(sfr, bit) 	GPIO_SetBits(sfr, bit)// sfr 端口的 bit 位置一
#define bit_xbi(sfr, bit)  	GPIO_WriteBit(sfr, bit, (BitAction)(1 - GPIO_ReadOutputDataBit(sfr,bit))) // sfr 端口的 bit 位取反
#define	bit_read(sfr, bit)	GPIO_ReadInputDataBit(sfr,bit)//读 sfr 端口的 bit 位状态

//定义 LED 相关管脚
#define	LED_GPIO		GPIOA
#define LED_RED_GPIO	GPIOB
	#define	LED_BLUE	GPIO_Pin_2
	#define LED_YELLOW	GPIO_Pin_3
	#define LED_RED		GPIO_Pin_2
										 	
//定义按键相关管脚
#define	KEY_GPIO	GPIOA
	#define	KEY_1	GPIO_Pin_0
	#define KEY_2	GPIO_Pin_1

//定义 LCD5110 相关管脚
#define LCD5110_GPIO	GPIOB
	#define	LCD5110_SCLK	GPIO_Pin_13
	#define LCD5110_SDIN	GPIO_Pin_15
	#define LCD5110_DC		GPIO_Pin_11
	#define LCD5110_SCE		GPIO_Pin_10
	#define LCD5110_RES		GPIO_Pin_9

	
#endif	

⌨️ 快捷键说明

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