📄 csl_atagetbaseaddress.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_ataGetBaseAddress.c * * @brief File for functional layer of CSL API @a CSL_ataGetBaseAddress() * * Path: \\(CSLPATH)\\soc\\davinci\\arm9\\src * *//* ============================================================================= * Revision History * =============== * 08-Oct-2004 kpn Added code to check for invalid arguments * Changed variable 'st' to 'status' * 24-Sep-2004 kpn File Created. * ============================================================================ */#include <soc.h>#include <csl_ata.h>/** ============================================================================ * @n@b CSL_ataGetBaseAddress * * @b Description * @n Function to get the base address of the peripheral instance. * This function is used for getting the base address of the peripheral * instance. This function will be called inside the CSL_ataOpen() * function call. This function is open for re-implementing if the user * wants to modify the base address of the peripheral object to point to * a different location and there by allow CSL initiated write/reads into * peripheral. MMR's go to an alternate location. * * @b Arguments * @verbatim ataNum Specifies the instance of the ata to be opened. pAtaParam Module specific parameters. pBaseAddress Pointer to base address structure containing base address details. @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_OK Open call is successful * @li CSL_ESYS_FAIL The instance number is invalid. * @li CSL_ESYS_INVPARAMS Invalid parameter * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n Base address structure is populated * * @b Modifies * @n 1. The status variable * * 2. Base address structure is modified. * * @b Example * @verbatim CSL_Status status; CSL_AtaBaseAddress baseAddress; ... status = CSL_ataGetBaseAddress(CSL_ATA_PER_CNT, NULL, &baseAddress); ... @endverbatim * ============================================================================ */#pragma CODE_SECTION (CSL_ataGetBaseAddress, ".text:csl_section:ata");CSL_Status CSL_ataGetBaseAddress ( CSL_InstNum ataNum, CSL_AtaParam *pAtaParam, CSL_AtaBaseAddress *pBaseAddress){ CSL_Status status = CSL_SOK; pAtaParam = pAtaParam; if (pBaseAddress == NULL) { return CSL_ESYS_INVPARAMS; } switch (ataNum) { case CSL_ATA_PRIMARY: case CSL_ATA_SECONDARY: pBaseAddress->regs = (CSL_AtaRegsOvly)CSL_ATA_1_REGS; break; default: pBaseAddress->regs = (CSL_AtaRegsOvly)NULL; status = CSL_ESYS_FAIL; break; } return status;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -