欢迎来到天天文库
浏览记录
ID:57894322
大小:69.50 KB
页数:14页
时间:2020-09-02
《STM32别名区端口从定义头文件.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、/************************************************@filename:gpioremap.h*@by:artisanCO.,LTD*:artisan*@version:V1.0.0*@date:08/06/2010**************************************************//*************************************************别名区重映射实现端口位操作GPIOABASEADDR
2、ESS0x40010800ENDADDRESS0x40010BFFGPIOBBASEADDRESS0x40010C00ENDADDRESS0x40010FFFGPIOCBASEADDRESS0x40011000ENDADDRESS0x400113FFGPIODBASEADDRESS0x40011400ENDADDRESS0x400117FFGPIOEBASEADDRESS0x40011800ENDADDRESS0x40011BFFGPIOFBASEADDRESS0x40012000ENDADDRESS0x400
3、123FFGPIOGBASEADDRESS0x40012000ENDADDRESS0x400123FFGPIO_CLROFFSETADDRESSOX00//GPIOConfiglowregGPIO_CHROFFSETADDRESSOX04//GPIOConfighighregGPIO_IDROFFSETADDRESSOX08//GPIODataInPutregGPIO_ODROFFSETADDRESSOX0C//GPIODataOutPutregGPIO_BSRROFFSETADDRESSOX10//GPIOB
4、itSET/CLRregGPIO_BRROFFSETADDRESSOX14//GPIOBitCLRregGPIO_LCKROFFSETADDRESSOX18//GPIOLOCKConfigreg计算公式别名区=ADDRESS=0x42000000+((GPIOXBASEADDRESS-0X40000000+reg OFFSETADDRESS)*0x20)+(GPIO_Pin_x*4)//X为端口号x为引脚号*************************************************/#if
5、ndef__GPIO_REMAP_H#define__GPIO_REMAP_H#defineSUBADD0x42000000#defineuSUBADD0x40000000#defineGPIOA_BASE_ADDRESS0x40010800#defineGPIOB_BASE_ADDRESS0x40010C00#defineGPIOC_BASE_ADDRESS0x40011000#defineGPIOD_BASE_ADDRESS0x40011400#defineGPIOE_BASE_ADDRESS0x40011
6、800#defineGPIOF_BASE_ADDRESS0x40012000#defineGPIOG_BASE_ADDRESS0x40012000#defineGPIO_IDR_OFFSET_ADDRESS0x08#defineGPIO_ODR_OFFSET_ADDRESS0x0c#defineGPIO_BIT_00#defineGPIO_BIT_11#defineGPIO_BIT_22#defineGPIO_BIT_33#defineGPIO_BIT_44#defineGPIO_BIT_55#defineGP
7、IO_BIT_66#defineGPIO_BIT_77#defineGPIO_BIT_88#defineGPIO_BIT_99#defineGPIO_BIT_1010#defineGPIO_BIT_1111#defineGPIO_BIT_1212#defineGPIO_BIT_1313#defineGPIO_BIT_1414#defineGPIO_BIT_1515//GPIOAInPutMode#defineGPIOA_Pin0_InPut((volatileunsignedlong*)(SUBADD+(GPI
8、OA_BASE_ADDRESS- uSUBADD+GPIO_IDR_OFFSET_ADDRESS)*0x20+(GPIO_BIT_0*4)))#defineGPIOA_Pin1_InPut((volatileunsignedlong*)(SUBADD+(GPIOA_BASE_ADDRESS- uSUBADD+GPIO_IDR_OFFSET_ADDRESS)*0x20+(GPIO_BIT
此文档下载收益归作者所有