📄 csl_atareadcontrolreg.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_ataReadControlReg.c * * @brief File for functional layer of CSL API CSL_ataReadControlReg() * * Path: \\(CSLPATH)\\ipmodules\\ata\\src * *//* ============================================================================= * Revision History * =============== * 08-Oct-2004 kpn Added variable RegData to simplify return statement * 24-Sep-2004 kpn Updated according to CSL Upgradation guidelines. * ============================================================================ */#include <csl_ata.h>/** ============================================================================ * @n@b CSL_ataReadControlReg * * @b Description * @n It reads into the command register. * * @b Arguments * @verbatim hAta Handle to the ATA reg CSL_AtaCtlRegRd @endverbatim * * <b> Return Value </b> * @n Uint16 regVal * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n The control register is read. * * @b Modifies * @n None * * @b Example * @verbatim CSL_AtaHandle hAta; CSL_AtaCtlRegRd reg; ... regVal = CSL_ataReadControlReg (hAta, reg); ... @endverbatim * ============================================================================ */Uint16 CSL_ataReadControlReg ( CSL_AtaHandle hAta, CSL_AtaCtlRegRd reg){ register volatile Uint8 *addr = 0; volatile Uint16 regData; addr = (hAta->ataNum == CSL_ATA_PRIMARY) ? CSL_ATA_CTLREGS_PRIMARY : CSL_ATA_CTLREGS_SECONDARY; regData = (Uint16) addr[(int)reg]; return regData;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -