目录
- EDMA3主要包括EDMA3CC(通道控制器)和EDMA3TC(传输控制器),函数
EDMA3Init();
主要对EDMA3CC进行配置。
C6748的EDMA3 初始化:EDMA3Init(0x01C00000, 0);
EDMA3Init(0x01C00000, 0)
:配置EDMA3控制器的基本参数,如控制寄存器、通道使能等。- 如下如
0x01C00000
为EDMA3控制器的基地址,用于访问其内部寄存器
EDMA3Init函数
// https://e2echina.ti.com/support/processors/f/processors-forum/185720/c6654-edma-ipr
/**
* \file edma.c
*
* \brief This file contains device abstraction layer APIs for the EDMA device.
* There are APIs here to enable the EDMA instance, set the required
* configurations for communication, transmit or receive data.
*/
/* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
* ALL RIGHTS RESERVED. */
/* Driver APIs */
#include "edma.h"
#include "hw_types.h"
#include "hw_edma3cc.h"
#include <c6x.h>
/****************************************************************************/
/* GLOBAL VARIABLES */
/****************************************************************************/
unsigned int regionId;
/****************************************************************************/
/* API FUNCTION DEFINITIONS */
/****************************************************************************/
/**
* \brief EDMA3 Initialization
*
* This function initializes the EDMA3 Driver
* Clears the error specific registers (EMCR/EMCRh, QEMCR, CCERRCLR) &
* initialize the Queue Number Registers
*
* \param baseAdd Memory address of the EDMA instance used.\n
* EDMA3控制器的基地址,用于访问其内部寄存器
*
* \param queNum Event Queue Number to which the channel
* will be mapped (valid only for the
* Master Channel (DMA/QDMA) request).\n
* 事件队列编号,指定哪个队列将用于映射通道(仅对主通道有效)。
*
* \return None
*
* \note The regionId is the shadow region(0 or 1) used and the,
* Event Queue used is either (0 or 1). There are only four shadow
* regions and only two event Queues
*/
void EDMA3Init(unsigned int baseAdd,
unsigned int queNum)
{
unsigned int count = 0;
unsigned int i = 0;
#ifdef _TMS320C6X
/* For DSP, regionId is assigned here and used globally in the driver */
regionId = (unsigned int)1u;
#