McBSP初始化函数

#include <csl_mcbsp.h>        //header included

 

 

MCBSP_Handle hMcbsp;        //定义一个MCBSP的句柄

 

/***********************************************************************/
/*    函数声明:    MCBSP初始化                                                                                              */
/***********************************************************************/
void McBSP_int()
{

    
  /* Let's open up serial port 0 */
    hMcbsp = MCBSP_open(MCBSP_DEV1, MCBSP_OPEN_RESET);
                                               /*Before a McBSP port can be used, it must first be opened by this function.
                                                The return value is a unique device handle that you use in subsequent McBSP API calls
                                               MCBSP_Handle MCBSP_open(
                                                int devNum,//McBSP device (port) number:
                                                                   MCBSP_DEV0
                                                                   MCBSP_DEV1
                                                 Uint32 flags//MCBSP_OPEN_RESET
                                               );*/
 
    MCBSP_config(hMcbsp,&ConfigLoopback);

/*Sets up the McBSP port using the configuration structure.


void MCBSP_config(
MCBSP_Handle hMcbsp,
MCBSP_Config *Config
);

*/


  /* Now that the port is setup, let's enable it in steps. */
    MCBSP_start(hMcbsp,MCBSP_RCV_START | MCBSP_XMIT_START |
                        MCBSP_SRGR_START| MCBSP_SRGR_FRAMESYNC,
                 MCBSP_SRGR_DEFAULT_DELAY);

/*Use this function to start a transmit and/or receive operation for a McBSP port
by passing the handle and mask.

void MCBSP_start(
MCBSP_Handle hMcbsp,    // handle
Uint32 startMask,             //using macros instead ,pull some part out of rst ,enable these part

                                         // MCBSP_XMIT_START: start transmit (XRST)
                                          //  MCBSP_RCV_START: start receive (RRST)
                                           // MCBSP_SRGR_START: start Sample rate
                                            //generator (GRST)
                                            // MCBSP_SRGR_FRAMESYNC: Start frame   //spi doesn't need
sync. Generation (FRST)

Uint32 SampleRateGenDelay//sys requirments
);*/
}

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值