打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
学习笔记--TMS320F2833X/2823X头文件函数(一)

TI提供的SPR530(C2833x/C2823x C/C++ 头文件和外设示例)使我们非常方便的使用2833X和2823X的外设。下面就它定义的函数加一个说明。

// $TI Release: DSP2833x Header Files V1.10 $
// $Release Date: February 15, 2008 $

//**************在DSP2833x_Adc.c中定义的,共1个函数**************************//
void InitAdc(void);//在DSP2833x_Adc.c中定义,初始化ADC,使能ADCCLK,调入ADC的出厂刻度数据,上电。

//**************在DSP2833x_DMA.c中定义的,共37个函数**************************//
void DMAInitialize(void);//执行DMA硬件复位,设置DMA不受仿真器的影响。。

// DMA Channel 1
void DMACH1AddrConfig(volatile Uint16 *DMA_Dest,volatile Uint16 *DMA_Source);
//设置DMA的源和目标
void DMACH1BurstConfig(Uint16 bsize, int16 srcbstep, int16 desbstep);
//设置每次Burst的字节数、源地址增量、目标地址增量。注意对于28335,BYTE和WORD是一样的,都是16BIT。
void DMACH1TransferConfig(Uint16 tsize, int16 srctstep, int16 deststep);
//设置每次传送包含多少个Burst、传送完毕发中断,源地址增量、目标地址增量
void DMACH1WrapConfig(Uint16 srcwsize, int16 srcwstep, Uint16 deswsize, int16 deswstep);
//设置传送完毕的源地址和目标地址
void DMACH1ModeConfig(Uint16 persel, Uint16 perinte, Uint16 oneshot, Uint16 cont, Uint16 synce, Uint16 syncsel, Uint16 ovrinte, Uint16 datasize, Uint16 chintmode, Uint16 chinte);
//设置DMA工作模式,包括触发源、是否使能触发源、是否使能oneshot模式、是否使能Continuous模式、是否使能外围设备同步、选择同步模式、溢出中断等。)
参数说明:
persel--选择触发源,值为下列选项
    DMA_SEQ1INT--------ADC
    DMA_SEQ2INT--------ADC
    DMA_XINT1  --------外部中断
    DMA_XINT2  --------外部中断
    DMA_XINT3  --------外部中断
    DMA_XINT4  --------外部中断
    DMA_XINT5  --------外部中断
    DMA_XINT6  --------外部中断
    DMA_XINT7  --------外部中断
    DMA_XINT13 --------外部中断
    DMA_TINT0  --------CPU时钟
    DMA_TINT1  --------CPU时钟
    DMA_TINT2  --------CPU时钟
    DMA_MXEVTA  --------McBSP-A
    DMA_MREVTA  --------McBSP-A
    DMA_MXREVTB --------McBSP-B
    DMA_MREVTB  --------McBSP-B
perinte--使能触发源,值为PERINT_DISABLE或PERINT_ENABLE
oneshot--使能oneshot模式,值为ONESHOT_DISABLE或ONESHOT_ENABLE。此模式下,一次触发完成全部burst。
cont--使能Continuous模式,值为CONT_DISABLE或CONT_ENABLE。此模式下,传送完毕后DMA重新被初始化,并等待触发源。
synce--使能外围设备同步,值为SYNC_DISABLE或SYNC_ENABLE。
syncsel--同步选择。值为SYNC_SRC或SYNC_DST。
ovrinte--使能溢出中断。值为OVRFLOW_DISABLE或OVEFLOW_ENABLE。
datasize--每次传送位数。值为SIXTEEN_BIT或THIRTYTWO_BIT。
chintmode--通道中断产生模式。CHINT_BEGIN:传送开始发中断。CHINT_END:传送结束发中断。
chinte--使能通道中断。值为CHINT_DISABLE或CHINT_ENABLE。
void StartDMACH1(void);
//启动DMACH1

//其它5个通道的DMA的函数功能含义是一样的
// DMA Channel 2
void DMACH2AddrConfig(volatile Uint16 *DMA_Dest,volatile Uint16 *DMA_Source);
void DMACH2BurstConfig(Uint16 bsize, int16 srcbstep, int16 desbstep);
void DMACH2TransferConfig(Uint16 tsize, int16 srctstep, int16 deststep);
void DMACH2WrapConfig(Uint16 srcwsize, int16 srcwstep, Uint16 deswsize, int16 deswstep);
void DMACH2ModeConfig(Uint16 persel, Uint16 perinte, Uint16 oneshot, Uint16 cont, Uint16 synce, Uint16 syncsel, Uint16 ovrinte, Uint16 datasize, Uint16 chintmode, Uint16 chinte);
void StartDMACH2(void);
// DMA Channel 3
void DMACH3AddrConfig(volatile Uint16 *DMA_Dest,volatile Uint16 *DMA_Source);
void DMACH3BurstConfig(Uint16 bsize, int16 srcbstep, int16 desbstep);
void DMACH3TransferConfig(Uint16 tsize, int16 srctstep, int16 deststep);
void DMACH3WrapConfig(Uint16 srcwsize, int16 srcwstep, Uint16 deswsize, int16 deswstep);
void DMACH3ModeConfig(Uint16 persel, Uint16 perinte, Uint16 oneshot, Uint16 cont, Uint16 synce, Uint16 syncsel, Uint16 ovrinte, Uint16 datasize, Uint16 chintmode, Uint16 chinte);
void StartDMACH3(void);
// DMA Channel 4
void DMACH4AddrConfig(volatile Uint16 *DMA_Dest,volatile Uint16 *DMA_Source);
void DMACH4BurstConfig(Uint16 bsize, int16 srcbstep, int16 desbstep);
void DMACH4TransferConfig(Uint16 tsize, int16 srctstep, int16 deststep);
void DMACH4WrapConfig(Uint16 srcwsize, int16 srcwstep, Uint16 deswsize, int16 deswstep);
void DMACH4ModeConfig(Uint16 persel, Uint16 perinte, Uint16 oneshot, Uint16 cont, Uint16 synce, Uint16 syncsel, Uint16 ovrinte, Uint16 datasize, Uint16 chintmode, Uint16 chinte);
void StartDMACH4(void);
// DMA Channel 5
void DMACH5AddrConfig(volatile Uint16 *DMA_Dest,volatile Uint16 *DMA_Source);
void DMACH5BurstConfig(Uint16 bsize, int16 srcbstep, int16 desbstep);
void DMACH5TransferConfig(Uint16 tsize, int16 srctstep, int16 deststep);
void DMACH5WrapConfig(Uint16 srcwsize, int16 srcwstep, Uint16 deswsize, int16 deswstep);
void DMACH5ModeConfig(Uint16 persel, Uint16 perinte, Uint16 oneshot, Uint16 cont, Uint16 synce, Uint16 syncsel, Uint16 ovrinte, Uint16 datasize, Uint16 chintmode, Uint16 chinte);
void StartDMACH5(void);
// DMA Channel 6
void DMACH6AddrConfig(volatile Uint16 *DMA_Dest,volatile Uint16 *DMA_Source);
void DMACH6BurstConfig(Uint16 bsize,Uint16 srcbstep, int16 desbstep);
void DMACH6TransferConfig(Uint16 tsize, int16 srctstep, int16 deststep);
void DMACH6WrapConfig(Uint16 srcwsize, int16 srcwstep, Uint16 deswsize, int16 deswstep);
void DMACH6ModeConfig(Uint16 persel, Uint16 perinte, Uint16 oneshot, Uint16 cont, Uint16 synce, Uint16 syncsel, Uint16 ovrinte, Uint16 datasize, Uint16 chintmode, Uint16 chinte);
void StartDMACH6(void);

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
avr 定时器0 16m晶振 驱动程序
STL C++编译中的 延迟编译
stm32f103 uart+DMA发送接收
【原创】STM32F103的USART2配置代码, DMA方式发送!
STM8L的DMA详解 含例程
STM32通过DMA采集多通道AD
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服