📄 sys_dma.c
字号:
/* @(#) nom : sys_dma.c SID: 1.2 date : 05/23/03 *//* Filename: sys_dma.c *//* Version: 1.2 *//****************************************************************************** * WIRELESS COMMUNICATION SYSTEM DEVELOPMENT * * (C) 2002 Texas Instruments France. All rights reserved * * Author : Guillaume Leterrier * Francois Amand * * * Important Note * -------------- * * This S/W is a preliminary version. It contains information on a product * under development and is issued for evaluation purposes only. Features * characteristics, data and other information are subject to change. * * The S/W is furnished under Non Disclosure Agreement and may be used or * copied only in accordance with the terms of the agreement. It is an offence * to copy the software in any way except as specifically set out in the * agreement. No part of this document may be reproduced or transmitted in any * form or by any means, electronic or mechanical, including photocopying and * recording, for any purpose without the express written permission of Texas * Instruments Inc. * ****************************************************************************** * * FILE NAME: sys_dma.c * * * PURPOSE: DMA drivers for CALYPSO PLUS. * The drivers allows DMA module configuration and control. * * * FILE REFERENCES: * * Name IO Description * ------------- -- --------------------------------------------- * * * * EXTERNAL VARIABLES: * * Source: * * Name Type IO Description * ------------- --------------- -- ------------------------------ * * * * EXTERNAL REFERENCES: * * Name Description * ------------------ ------------------------------------------------------- * * * * ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES: * * * * ASSUMPTION, CONSTRAINTS, RESTRICTIONS: * * * * NOTES: * * * * REQUIREMENTS/FUNCTIONAL SPECIFICATION REFERENCES: * * * * * DEVELOPMENT HISTORY: * * Date Name(s) Version Description * ----------- -------------- ------- ------------------------------------- * 23-Oct-2002 G.Leterrier 0.0.1 First implementation * 6-Feb-2003 G.Leterrier 0.0.2 Reset HW request to 0, before new setup in function "f_dma_channel_parameter_set" * 20-Feb-2003 G.Leterrier 0.0.3 f_dma_global_parameter_set correction on API priority bit * disable and clear status register channel before re-configuration * ALGORITHM: * * *****************************************************************************/#include "chipset.cfg"#if (CHIPSET == 12) #include "dma/sys_dma.h" /***************************************************************************/ /* global variable *****************************************************************************/ extern T_DMA_CALL_BACK pf_dma_call_back_address[C_DMA_NUMBER_OF_CHANNEL]; /****************************************************************************** * * FUNCTION NAME: f_dma_get_version_driver * This functionis used to get to DMA driver software version. * * ARGUMENT LIST: * * Argument Type IO Description * ---------- ---------- -- ------------------------------------------- * none * * * RETURN VALUE: SYS_UWORD16 * *****************************************************************************/ SYS_UWORD16 f_dma_get_version_driver(void) { return(C_DMA_VERSION_DRIVER); } /*f_dma_get_version_driver()*/ /****************************************************************************** * * FUNCTION NAME:f_dma_global_parameter_set * The function is used to setup the DMA global configuration. * * * ARGUMENT LIST: * * Argument Type IO Description * ---------- ---------- -- ------------------------------------------- * p_dma_global_parameter T_DMA_TYPE_GLOBAL_PARAMETER* I Pointer on data structure containing all global parameter of DMA configuration * * * * RETURN VALUE: None * *****************************************************************************/ void f_dma_global_parameter_set(T_DMA_TYPE_GLOBAL_PARAMETER *p_dma_global_parameter) { if (p_dma_global_parameter->d_dma_global_auto_gate==C_DMA_AUTO_GATE_ON) { C_DMA_GCR_REG |= (C_DMA_AUTO_GATE_ON << C_DMA_GCR_AUTO_GATE_POS ); } else { C_DMA_GCR_REG &= ~( C_DMA_GCR_AUTO_GATE_MASK << C_DMA_GCR_AUTO_GATE_POS ); } C_DMA_AR_REG = ( (p_dma_global_parameter->d_dma_global_api_prio << C_DMA_AR_API_PRIO_POS) | (p_dma_global_parameter->d_dma_global_rhea_prio << C_DMA_AR_RHEA_PRIO_POS) | (p_dma_global_parameter->d_dma_global_imif_prio << C_DMA_AR_IMIF_PRIO_POS) ); } /*f_dma_global_parameter_set() */ /****************************************************************************** * * FUNCTION NAME: f_dma_channel_allocation_set * This function defines the allocation of a channel. * This function is used to set which channel can be configured through the ARM and which one can be configured through the DSP. * * * * ARGUMENT LIST: * * Argument Type IO Description * ---------- ---------- -- ------------------------------------------- * d_dma_channel_number T_DMA_TYPE_CHANNEL_NUMBER I Variable providing the channel number * d_dma_channel_allocation T_DMA_TYPE_CHANNEL_ALLOCATION I Variable defining if the channel allocated to the ARM or the DSP. * * * * RETURN VALUE: None * *****************************************************************************/ void f_dma_channel_allocation_set(T_DMA_TYPE_CHANNEL_NUMBER d_dma_channel_number, T_DMA_TYPE_CHANNEL_ALLOCATION d_dma_channel_allocation) { if (d_dma_channel_allocation==C_DMA_CHANNEL_DSP) { C_DMA_CAR_REG |= (C_DMA_CHANNEL_DSP << d_dma_channel_number); } else { C_DMA_CAR_REG &= ~( C_DMA_CHANNEL_DSP << d_dma_channel_number ); } } /*f_dma_channel_allocation_set */ /****************************************************************************** * * FUNCTION NAME: f_dma_channel_parameter_set * The function is used to setup a DMA channel configuration. * * * ARGUMENT LIST:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -