微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > STM32 矩阵键盘扫描

STM32 矩阵键盘扫描

时间:09-10 来源:互联网 点击:

BIT_ADDR(GPIOB_IDR_Addr,n) //输入

#define PCout(n) BIT_ADDR(GPIOC_ODR_Addr,n) //输出

#define PCin(n) BIT_ADDR(GPIOC_IDR_Addr,n) //输入

#define PDout(n) BIT_ADDR(GPIOD_ODR_Addr,n) //输出

#define PDin(n) BIT_ADDR(GPIOD_IDR_Addr,n) //输入

#define PEout(n) BIT_ADDR(GPIOE_ODR_Addr,n) //输出

#define PEin(n) BIT_ADDR(GPIOE_IDR_Addr,n) //输入

#define PFout(n) BIT_ADDR(GPIOF_ODR_Addr,n) //输出

#define PFin(n) BIT_ADDR(GPIOF_IDR_Addr,n) //输入

#define PGout(n) BIT_ADDR(GPIOG_ODR_Addr,n) //输出

#define PGin(n) BIT_ADDR(GPIOG_IDR_Addr,n) //输入

/*------------------------------

*******************************

各GPIO输出口地址定义

********************************

--------------------------------*/

#define PAo_0 PAout(0)

#define PAo_1 PAout(1)

#define PAo_2 PAout(2)

#define PAo_3 PAout(3)

#define PAo_4 PAout(4)

#define PAo_5 PAout(5)

#define PAo_6 PAout(6)

#define PAo_7 PAout(7)

#define PAo_8 PAout(8)

#define PAo_9 PAout(9)

#define PAo_10 PAout(10)

#define PAo_11 PAout(11)

#define PAo_12 PAout(12)

#define PAo_13 PAout(13)

#define PAo_14 PAout(14)

#define PAo_15 PAout(15)

//----------------------------------//

#define PBo_0 PBout(0)

#define PBo_1 PBout(1)

#define PBo_2 PBout(2)

#define PBo_3 PBout(3)

#define PBo_4 PBout(4)

#define PBo_5 PBout(5)

#define PBo_6 PBout(6)

#define PBo_7 PBout(7)

#define PBo_8 PBout(8)

#define PBo_9 PBout(9)

#define PBo_10 PBout(10)

#define PBo_11 PBout(11)

#define PBo_12 PBout(12)

#define PBo_13 PBout(13)

#define PBo_14 PBout(14)

#define PBo_15 PBout(15)

//--------------------------------//

#define PCo_0 PCout(0)

#define PCo_1 PCout(1)

#define PCo_2 PCout(2)

#define PCo_3 PCout(3)

#define PCo_4 PCout(4)

#define PCo_5 PCout(5)

#define PCo_6 PCout(6)

#define PCo_7 PCout(7)

#define PCo_8 PCout(8)

#define PCo_9 PCout(9)

#define PCo_10 PCout(10)

#define PCo_11 PCout(11)

#define PCo_12 PCout(12)

#define PCo_13 PCout(13)

#define PCo_14 PCout(14)

#define PCo_15 PCout(15)

//---------------------------//

#define PDo_0 PDout(0)

#define PDo_1 PDout(1)

#define PDo_2 PDout(2)

#define PDo_3 PDout(3)

#define PDo_4 PDout(4)

#define PDo_5 PDout(5)

#define PDo_6 PDout(6)

#define PDo_7 PDout(7)

#define PDo_8 PDout(8)

#define PDo_9 PDout(9)

#define PDo_10 PDout(10)

#define PDo_11 PDout(11)

#define PDo_12 PDout(12)

#define PDo_13 PDout(13)

#define PDo_14 PDout(14)

#define PDo_15 PDout(15)

//------------------------------//

#define PEo_0 PEout(0)

#define PEo_1 PEout(1)

#define PEo_2 PEout(2)

#define PEo_3 PEout(3)

#define PEo_4 PEout(4)

#define PEo_5 PEout(5)

#define PEo_6 PEout(6)

#define PEo_7 PEout(7)

#define PEo_8 PEout(8)

#define PEo_9 PEout(9)

#define PEo_10 PEout(10)

#define PEo_11 PEout(11)

#define PEo_12 PEout(12)

#define PEo_13 PEout(13)

#define PEo_14 PEout(14)

#define PEo_15 PEout(15)

//---------------------------//

#define PFo_0 PFout(0)

#define PFo_1 PFout(1)

#define PFo_2 PFout(2)

#define PFo_3 PFout(3)

#define PFo_4 PFout(4)

#define PFo_5 PFout(5)

#define PFo_6 PFout(6)

#define PFo_7 PFout(7)

#define PFo_8 PFout(8)

#define PFo_9 PFout(9)

#define PFo_10 PFout(10)

#define PFo_11 PFout(11)

#define PFo_12 PFout(12)

#define PFo_13 PFout(13)

#define PFo_14 PFout(14)

#define PFo_15 PFout(15)

//---------------------------//

#define PGo_0 PGout(0)

#define PGo_1 PGout(1)

#define PGo_2 PGout(2)

#define PGo_3 PGout(3)

#define PGo_4 PGout(4)

#define PGo_5 PGout(5)

#define PGo_6 PGout(6)

#define PGo_7 PGout(7)

#define PGo_8 PGout(8)

#define PGo_9 PGout(9)

#define PGo_10 PGout(10)

#define PGo_11 PGout(11)

#define PGo_12 PGout(12)

#define PGo_13 PGout(13)

#define PGo_14 PGout(14)

#define PGo_15 PGout(15)

/*------------------------------

********************************

各GPIO输入口地址定义

********************************

--------------------------------*/

#define PAi_0 PAin(0)

#

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top