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