硬汉嵌入式论坛

 找回密码
 立即注册
查看: 2451|回复: 1
收起左侧

[HAL] HAL库BDMA多组通道统一命名

[复制链接]

36

主题

2040

回帖

2148

积分

至尊会员

积分
2148
发表于 2019-1-26 10:25:31 | 显示全部楼层 |阅读模式
定义方式
typedef struct
{
  __IO uint32_t CCR; /*!< DMA channel x configuration register  Addr offset: 0x08 + 0x14 * x,x = 0 to 7 */
  __IO uint32_t CNDTR;/*!< DMA channel x number of data register Addr offset: 0x0C + 0x14 * x,x = 0 to 7 */
  __IO uint32_t CPAR; /*!< DMA channel x peripheral address register Addr offset: 0x10 + 0x14 * x, x = 0 to 7*/
  __IO uint32_t CMAR; /*!< DMA channel x memory address register, Addr offset: 0x14 + 0x14 * x, x = 0 to 7 */
} BDMA_Channel_TypeDef;

地址
#define BDMA_Channel0  ((BDMA_Channel_TypeDef *) BDMA_Channel0_BASE)
#define BDMA_Channel1  ((BDMA_Channel_TypeDef *) BDMA_Channel1_BASE)
#define BDMA_Channel2  ((BDMA_Channel_TypeDef *) BDMA_Channel2_BASE)
#define BDMA_Channel3  ((BDMA_Channel_TypeDef *) BDMA_Channel3_BASE)
#define BDMA_Channel4  ((BDMA_Channel_TypeDef *) BDMA_Channel4_BASE)
#define BDMA_Channel5  ((BDMA_Channel_TypeDef *) BDMA_Channel5_BASE)
#define BDMA_Channel6  ((BDMA_Channel_TypeDef *) BDMA_Channel6_BASE)
#define BDMA_Channel7  ((BDMA_Channel_TypeDef *) BDMA_Channel7_BASE)

Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
107101
QQ
发表于 2019-1-26 11:14:26 | 显示全部楼层
谢谢分享
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-17 12:42 , Processed in 0.147087 second(s), 25 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表