教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 基础教育 >

K60 - GPIO头文件分析

来源:网络收集 时间:2026-08-14
导读: [cpp] view plaincopyprint? 1. /* ---------------------------------------------------------------------------- 2. -- PORT 3. ---------------------------------------------------------------------------- */ 4. 5. /** 6. * @addtogroup PORT_Per

[cpp] view plaincopyprint?

1. /* ---------------------------------------------------------------------------- 2. -- PORT

3. ---------------------------------------------------------------------------- */ 4. 5. /**

6. * @addtogroup PORT_Peripheral PORT 7. * @{ 8. */ 9.

10. /** PORT - Peripheral register structure */ 11. typedef struct PORT_MemMap {

12. uint32_t PCR[32]; /**< Pin Control Register

n, array offset: 0x0, array step: 0x4 */

13. uint32_t GPCLR; /**< Global Pin Control L

ow Register, offset: 0x80 */

14. uint32_t GPCHR; /**< Global Pin Control H

igh Register, offset: 0x84 */ 15. uint8_t RESERVED_0[24];

16. uint32_t ISFR; /**< Interrupt Status Fla

g Register, offset: 0xA0 */ 17. uint8_t RESERVED_1[28];

18. uint32_t DFER; /**< Digital Filter Enabl

e Register, offset: 0xC0 */

19. uint32_t DFCR; /**< Digital Filter Clock

Register, offset: 0xC4 */

20. uint32_t DFWR; /**< Digital Filter Width

Register, offset: 0xC8 */ 21. } volatile *PORT_MemMapPtr; 22.

23. /* ----------------------------------------------------------------------------

24. -- PORT - Register accessor macros

25. ---------------------------------------------------------------------------- */ 26. 27. /**

28. * @addtogroup PORT_Register_Accessor_Macros PORT - Register accessor macros

29. * @{ 30. */ 31.

32.

33. /* PORT - Register accessors */

34. #define PORT_PCR_REG(base,index) ((base)->PCR[index]) 35. #define PORT_GPCLR_REG(base) ((base)->GPCLR) 36. #define PORT_GPCHR_REG(base) ((base)->GPCHR) 37. #define PORT_ISFR_REG(base) ((base)->ISFR) 38. #define PORT_DFER_REG(base) ((base)->DFER) 39. #define PORT_DFCR_REG(base) ((base)->DFCR) 40. #define PORT_DFWR_REG(base) ((base)->DFWR) 41. 42. /** 43. * @}

44. */ /* end of group PORT_Register_Accessor_Macros */ 45. 46.

47. /* ----------------------------------------------------------------------------

48. -- PORT Register Masks

49. ---------------------------------------------------------------------------- */ 50. 51. /**

52. * @addtogroup PORT_Register_Masks PORT Register Masks 53. * @{ 54. */ 55.

56. /* PCR Bit Fields */

57. #define PORT_PCR_PS_MASK 0x1u 58. #define PORT_PCR_PS_SHIFT 0 59. #define PORT_PCR_PE_MASK 0x2u 60. #define PORT_PCR_PE_SHIFT 1 61. #define PORT_PCR_SRE_MASK 0x4u 62. #define PORT_PCR_SRE_SHIFT 2 63. #define PORT_PCR_PFE_MASK 0x10u 64. #define PORT_PCR_PFE_SHIFT 4 65. #define PORT_PCR_ODE_MASK 0x20u 66. #define PORT_PCR_ODE_SHIFT 5 67. #define PORT_PCR_DSE_MASK 0x40u 68. #define PORT_PCR_DSE_SHIFT 6 69. #define PORT_PCR_MUX_MASK 0x700u 70. #define PORT_PCR_MUX_SHIFT 8

71. #define PORT_PCR_MUX(x) (((uint32_t)(((uint32_t)(x)

)<

72. #define PORT_PCR_LK_MASK 0x8000u

73. #define PORT_PCR_LK_SHIFT 15 74. #define PORT_PCR_IRQC_MASK 0xF0000u 75. #define PORT_PCR_IRQC_SHIFT 16

76. #define PORT_PCR_IRQC(x) (((uint32_t)(((uint32_t)(x)

)<

77. #define PORT_PCR_ISF_MASK 0x1000000u 78. #define PORT_PCR_ISF_SHIFT 24 79. /* GPCLR Bit Fields */

80. #define PORT_GPCLR_GPWD_MASK 0xFFFFu 81. #define PORT_GPCLR_GPWD_SHIFT 0

82. #define PORT_GPCLR_GPWD(x) (((uint32_t)(((uint32_t)(x)

)<

83. #define PORT_GPCLR_GPWE_MASK 0xFFFF0000u 84. #define PORT_GPCLR_GPWE_SHIFT 16

85. #define PORT_GPCLR_GPWE(x) (((uint32_t)(((uint32_t)(x)

)<

87. #define PORT_GPCHR_GPWD_MASK 0xFFFFu 88. #define PORT_GPCHR_GPWD_SHIFT 0

89. #define PORT_GPCHR_GPWD(x) (((uint32_t)(((uint32_t)(x)

)<

90. #define PORT_GPCHR_GPWE_MASK 0xFFFF0000u 91. #define PORT_GPCHR_GPWE_SHIFT 16

92. #define PORT_GPCHR_GPWE(x) (((uint32_t)(((uint32_t)(x)

)<

94. #define PORT_ISFR_ISF_MASK 0xFFFFFFFFu 95. #define PORT_ISFR_ISF_SHIFT 0

96. #define PORT_ISFR_ISF(x) (((uint32_t)(((uint32_t)(x)

)<

98. #define PORT_DFER_DFE_MASK 0xFFFFFFFFu 99. #define PORT_DFER_DFE_SHIFT 0

100. #define PORT_DFER_DFE(x) …… 此处隐藏:4169字,全部文档内容请下载后查看。喜欢就下载吧 ……

K60 - GPIO头文件分析.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/563868.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)