📄 csl_pwrdwngetbaseaddress.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_pwrdwnGetBaseAddress.c
*
* @brief Implementation of @a CSL_pwrdwnGetBaseAddress()
*
* PATH \\(CSLPATH)\\soc\\davinci\\c64plus\\src
*
* Description
* - The @a CSL_pwrdwnGetBaseAddress() function returns the base-address of the
* specified Memory Protection instance.
*
* Note: 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
* there by allow CSL initiated write/reads into peripheral MMR's go to an
* alternate location. Please refer documentation for more details.
*
* Modification 1
* - Modified on: 7/16/2004
* - Reason: created the sources
*
* @author Ruchika Kharwar.
* ===========================================================================
*/
#include <soc64plus.h>
#include <csl_pwrdwn.h>
/** ============================================================================
* @n@b CSL_pwrdwnGetBaseAddress
*
* @b Description
* @n This function gets the base address of the given pwrdwn
* instance.
*
* @b Arguments
* @verbatim
hPwrdwn Pointer to the peripheral data object for pwrdwn
pwrdwnNum Specifies the instance of the pwrdwn to be
opened.
pPwrdwnParam pwrdwn 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 pwrdwn instance is not
* available.
*
* <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_PwrdwnHandle hPwrdwn;
CSL_PwrdwnBaseAddress baseAddress;
CSL_PwrdwnParam params;
CSL_pwrdwnGetBaseAddress(CSL_PWRDWN_0, ¶ms, &baseAddress) ;
@endverbatim
* ===========================================================================
*/
#pragma CODE_SECTION (CSL_pwrdwnGetBaseAddress, ".text:csl_section:pwrdwn");
CSL_Status CSL_pwrdwnGetBaseAddress (
/** Peripheral instance number
*/
CSL_InstNum pwrdwnNum,
/** Module specific parameters.
*/
CSL_PwrdwnParam * pPwrdwnParam,
/** Base address details.
*/
CSL_PwrdwnBaseAddress * pBaseAddress
)
{
CSL_Status st = CSL_ESYS_INVPARAMS;
if (pwrdwnNum == CSL_PWRDWN_0) {
pBaseAddress->regs = (CSL_PdcRegsOvly)CSL_PWRDWN_PDC_REGS;
pBaseAddress->l2pwrdwnRegs = (CSL_L2pwrdwnRegsOvly)CSL_PWRDWN_L2;
st = CSL_SOK;
}
return st;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -