📄 csl_mshwcontrol.c
字号:
/* ============================================================================ * Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005 * * Use of this software is controlled by the terms and conditions found in the * license agreement under which this software has been supplied. * =========================================================================== *//** @file csl_msHwControl.c * * @brief File for functional layer of CSL API \a CSL_msHwControl() * * Path: \\(CSLPATH)\\ipmodules\\memstick\\src * * Description * - The \a CSL_msHwControl() function definition & it's associated * functions * * Date 7th June, 2004 * Author Santosh Narayanan * *//* ============================================================================= * Revision History * ================ * 14-Dec-2004 kpn Updated the file according to CSL Upgradation guidelines. * Added control commands for setting Byte Swap & Clock divider * Values according to csl_ms.h * ============================================================================= */#include <csl_ms.h>#include <csl_msAux.h>/** ============================================================================ * @n@b CSL_msHwControl * * @b Description * @n Takes a command of MS with an optional argument & implements it. * * @b Arguments * @verbatim hMs Handle to the MS instance cmd The command to this API indicates the action to be taken on MS. arg An optional argument. @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_SOK - Status info return successful. * @li CSL_ESYS_BADHANDLE - Invalid handle * @li CSL_ESYS_INVCMD - Invalid command * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n The MS is controlled according to input command and argument. * * @b Modifies * @n The hardware registers of MS. * * @b Example * @verbatim CSL_MsHandle hMs; CSL_MsHwControlCmd cmd; void arg; ... status = CSL_msHwControl (hMs, cmd, &arg); @endverbatim * ============================================================================= */#pragma CODE_SECTION (CSL_msHwControl, ".text:csl_section:ms");CSL_Status CSL_msHwControl ( CSL_MsHandle hMs, CSL_MsHwControlCmd cmd, void *arg){ CSL_Status status = CSL_SOK; if (hMs == NULL) { return CSL_ESYS_BADHANDLE; } switch (cmd) { case CSL_MS_CMD_TPC_SET: CSL_msTpcSet (hMs, *(Uint16*)arg); break; case CSL_MS_CMD_DSL_FIFO: CSL_msDslFifo (hMs); break; case CSL_MS_CMD_DSL_EXTMEM: CSL_msDslExtmem (hMs); break; case CSL_MS_CMD_RESET: CSL_msReset (hMs); break; case CSL_MS_CMD_SET_DATA_SIZE: CSL_msSetDataSize (hMs, *(Uint16*)arg); break; case CSL_MS_CMD_WRITE_FIFO: CSL_msWriteFifo (hMs, *(Uint32*)arg); break; case CSL_MS_CMD_READ_FIFO: CSL_msReadFifo(hMs, arg); break; case CSL_MS_CMD_INT_ENABLE: CSL_msIntEnable (hMs); break; case CSL_MS_CMD_INT_DISABLE: CSL_msIntDisable (hMs); break; case CSL_MS_CMD_DMA_ENABLE: CSL_msDmaEnable (hMs); break; case CSL_MS_CMD_DMA_DISABLE: CSL_msDmaDisable (hMs); break; case CSL_MS_CMD_SET_BYTESWAP: CSL_msSetByteSwap (hMs, *(CSL_MsByteSwapSel*)arg); break; case CSL_MS_CMD_SET_CLKDIV: CSL_msSetClkDiv (hMs, *(CSL_MsClkDivRatio*)arg); break; default: status = CSL_ESYS_INVCMD ; break; } return status;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -