fdma.c
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:2k
- /*****************************************************************************
- File name : fdma.c
- Description : FDMA functions
- COPYRIGHT (C) 2004 STMicroelectronics
- *****************************************************************************/
- /* Includes --------------------------------------------------------------- */
- #include <string.h>
- #include "stcommon.h"
- #include "stdevice.h"
- #include "sttbx.h"
- #include "section.h" /* memory partitions */
- #include "errors.h"
- #include "fdma.h"
- /* Global ----------------------------------------------------------------- */
- ST_DeviceName_t g_KB_FDMADeviceName[KB_FDMA_INST] = {"FDMA0"};
- /* Functions -------------------------------------------------------------- */
- /*-------------------------------------------------------------------------
- * Function : KB_FDMASetup
- * Input : None
- * Output :
- * Return : Error Code
- * ----------------------------------------------------------------------*/
- ST_ErrorCode_t KB_FDMASetup(void)
- {
- ST_ErrorCode_t ST_ErrorCode;
- STFDMA_InitParams_t STFDMA_InitParams;
- int Instance;
- for ( Instance = 0; Instance < KB_FDMA_INST; Instance++ )
- {
- STTBX_Print(("KB_FDMASetup(%s)=", g_KB_FDMADeviceName[Instance] ));
- STFDMA_InitParams.DeviceType = KB_FDMA_DEVICE_TYPE;
- STFDMA_InitParams.DriverPartition_p = SystemPartition;
- STFDMA_InitParams.NCachePartition_p = NcachePartition;
- STFDMA_InitParams.BaseAddress_p = (void *)KB_FDMA_BASE_ADDRESS;
- STFDMA_InitParams.InterruptNumber = KB_FDMA_INTERRUPT;
- STFDMA_InitParams.InterruptLevel = KB_FDMA_INTERRUPT_LEVEL;
- STFDMA_InitParams.NumberCallbackTasks = 1;
- STFDMA_InitParams.ClockTicksPerSecond = ST_GetClocksPerSecond();
- ST_ErrorCode = STFDMA_Init(g_KB_FDMADeviceName[Instance], &STFDMA_InitParams);
- if (ST_ErrorCode != ST_NO_ERROR)
- {
- STTBX_Print(("%sn", KB_ErrorGetText(ST_ErrorCode) ));
- return( ST_ErrorCode );
- }
- STTBX_Print(("%sn", STFDMA_GetRevision() ));
- } /* for(Instance) */
- return( ST_ErrorCode );
- }
- /* EOF --------------------------------------------------------------------- */