本帖最后由 曾经in 于 2015-3-25 13:42 编辑
原地址寄存器和目标地址寄存器DMA0SA、DMA0DA都是SFR_20BIT类型的,不知道该怎么赋值
编译环境是CCS6
定义:
#define SFR_16BIT(address) extern volatile unsigned int address
typedef void (* __SFR_FARPTR)();//空返回值的函数指针
#define SFR_20BIT(address) extern __SFR_FARPTR address
SFR_20BIT(DMA0SA); /* DMA Channel 0 Source Address */
SFR_16BIT(DMA0SAL); /* DMA Channel 0 Source Address */
SFR_20BIT(DMA0DA); /* DMA Channel 0 Destination Address */
SFR_16BIT(DMA0DAL); /* DMA Channel 0 Destination Address */
有官方例程,不过是用FR5967的,改为5969一样会报错
__data16_write_addr((unsigned short) &DMA0SA,(unsigned long) 0x1C20);
// Source block address
__data16_write_addr((unsigned short) &DMA0DA,(unsigned long) 0x1C40);
// Destination single address
#770-D conversion from pointer to smaller integer
强制转换也报错
DMA0DA= (__SFR_FARPTR)&UCB0TXBUF;
#173-D invalid type conversion
好久了都没弄明白,求助大神。。。
此帖出自
小平头技术问答
一周热门 更多>