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