📄 csl_pschwsetup.c
字号:
/* ============================================================================
* Copyright (c) Texas Instruments Inc 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_pscHwSetup.c
*
* @path $(CSLPATH)\psc\v1\src
*
* @brief File for functional layer of CSL API @a CSL_pscHwSetup()
*
*/
/* =============================================================================
* Revision History
* ===============
* 5-June-2005 Lawrence Ronk File Created.
* =============================================================================
*/
#include <csl_psc.h>
#include <csl_pscAux.h>
/** ============================================================================
* @n@b CSL_pscHwSetup
*
* @b Description
* @n It configures the psc registers as per the values passed
* in the hardware setup structure.
*
* @b Arguments
* @verbatim
hPsc Handle to the psc
hwSetup Pointer to harware setup structure
@endverbatim
*
* <b> Return Value </b> CSL_Status
* @li CSL_SOK - Hardware setup successful
* @li CSL_ESYS_BADHANDLE - Invalid handle
* @li CSL_ESYS_INVPARAMS - Hardware structure is not
properly initialized
*
* <b> Pre Condition </b>
* @n None
*
* <b> Post Condition </b>
* @n PSC controller registers are configured according
* to the hardware setup parameters
*
* @b Modifies
* @n PSC controller registers
*
* @b Example
* @verbatim
CSL_PscHandle hPsc;
CSL_PscObj pscObj;
CSL_PscHwSetup hwSetup;
CSL_status status;
...
hPsc = CSL_pscOpen(&pscObj, CSL_PSCC, NULL, &status);
status = CSL_pscHwSetup(hPsc, &hwSetup);
@endverbatim
* ===========================================================================
*/
#pragma CODE_SECTION (CSL_pscHwSetup, ".text:csl_section:psc");
CSL_Status CSL_pscHwSetup(
CSL_PscHandle hPsc,
CSL_PscHwSetup *hwSetup
)
{
CSL_Status status = CSL_SOK;
if (hPsc == NULL)
return CSL_ESYS_BADHANDLE;
if (hwSetup == NULL)
return CSL_ESYS_INVPARAMS;
/* Setup PD States */
status = CSL_pscPdStateCfg( hPsc, hwSetup->pscPdCfg );
if( status != CSL_SOK )
return status;
/* Setup Module States */
status = CSL_pscMdStateCfg( hPsc, hwSetup->pscMdCfg );
if( status != CSL_SOK )
return status;
/* Setup PD Interrupts */
status = CSL_pscPdIntCfg( hPsc, hwSetup->pscPdCfg );
if( status != CSL_SOK )
return status;
/* Setup Module Interrupts */
status = CSL_pscMdIntCfg( hPsc, hwSetup->pscMdCfg );
if( status != CSL_SOK )
return status;
return status;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -