📄 csl_timer.h
字号:
/** @brief Peripheral specific initialization function. * * This is the peripheral specific intialization function. This function is * idempotent in that calling it many times is same as calling it once. * This function initializes the CSL data structures, and doesn't touches * the hardware. * * <b> Usage Constraints: </b> * This function should be called before using any of the CSL APIs in the TIMER * module. * * Note: As TIMER doesn't have any context based information, currently, the function * just returns CSL_SOK. User is expected to pass NULL in the function call. * * @b Example: * @verbatim ... if (CSL_SOK != CSL_timerInit(NULL)) { return; } @endverbatim * * @return returns the status of the operation * */CSL_Status CSL_timerInit( /** TIMER specific context information */ CSL_TimerContext * pContext );/** @brief Opens the instance of TIMER requested. * * The open call sets up the data structures for the particular instance of * TIMER device. The device can be re-opened anytime after it has been normally * closed if so required. The handle returned by this call is input as an * essential argument for rest of the APIs described for this module. * * <b> Usage Constraints: </b> * TIMER must be successfully initialized via @a CSL_timerInit() before calling * this function. Memory for the @a CSL_timerObj must be allocated outside * this call. This object must be retained while usage of this peripheral. * * @b Example: * @verbatim CSL_TimerObj timerObj; CSL_Status status; ... hTimer = CSL_timerOpen(&timerObj, CSL_TIMER_1, NULL, &status); @endverbatim * * @return returns a handle @a CSL_TimerHandle to the requested instance of * TIMER if the call is successful, otherwise, a @a NULL is returned. * */CSL_TimerHandle CSL_timerOpen ( /** Pointer to the object that holds reference to the * instance of TIMER requested after the call */ CSL_TimerObj* pTimerObj, /** Instance of TIMER to which a handle is requested */ CSL_InstNum timerNum, /** Module specific parameters; * Currently there are none; the user should pass 'NULL' */ CSL_TimerParam *pTimerParam, /** This returns the status (success/errors) of the call. * Could be 'NULL' if the user does not want status information. */ CSL_Status *pStatus );/** The Close call releases the resource and appropriate shared pins. * * <b> Usage Constraints: </b> * Both @a CSL_timerInit() and @a CSL_timerOpen() must be called successfully * in that order before @a CSL_timerClose() can be called. * * @b Example: * @verbatim CSL_TimerHandle hTimer; ... CSL_timerClose(hTimer); @endverbatim * * @return returns the status of the operation (see @a CSL_Status) * */ CSL_Status CSL_timerClose( CSL_TimerHandle hTimer);/** This function initializes the device registers with the appropriate values * provided through the HwSetup Data structure. This function needs to be called * only if the HwSetup Structure was not previously passed through the Open call. * After the Setup is completed, the serial device is ready for data transfer. * For information passed through the HwSetup Data structure refer * @a CSL_TimerHwSetup. * * <b> Usage Constraints: </b> * Both @a CSL_timerInit() and @a CSL_timerOpen() must be called * successfully in that order before this function can be called. The user * has to allocate space for & fill in the main setup structure appropriately * before calling this function * * @b Example: * @verbatim CSL_TimerHandle hTimer; CSL_TimerHwSetup hwSetup = CSL_TIMER_HWSETUP_DEFAULTS; CSL_timerHwSetup(hTimer, &hwSetup); @endverbatim * * @return Returns the status of the setup operation * */ CSL_Status CSL_timerHwSetup( CSL_TimerHandle hTimer, CSL_TimerHwSetup *setup);/** This function gets the h/w setup parameters values, can be used to check if * the setup parameters are proper or not * @a CSL_TimerGetHwSetup * * <b> Usage Constraints: </b> * Both @a CSL_timerInit() and @a CSL_timerOpen() must be called successfully * in that order before this function can be called. The user has to allocate * space for the setup structure before calling this function * * @b Example * @verbatim CSL_status status; CSL_TimerHwSetup hwSetup; status = CSL_timerGetHwSetup (hTimer, &hwSetup); @endverbatim * * @return Returns the status of the setup operation * */extern CSL_Status CSL_timerGetHwSetup ( CSL_TimerHandle hTimer, CSL_TimerHwSetup *hwSetup);/** This function initializes the device registers with the register-values * provided through the Config Data structure. For information passed through * the Config Data structure refer to @a CSL_TimerConfig. * * <b> Usage Constraints: </b> * The user has to allocate space for & fill in the main setup structure * appropriately before calling this function. * * @b Example: * @verbatim CSL_TimerHandle hTimer; CSL_TimerConfig config; config.CNTL = 0x1000; config.LOAD = 0xFFFF; CSL_timerHwSetupRaw(hTimer, &config); @endverbatim * * @return Returns the status of the setup operation * */CSL_Status CSL_timerHwSetupRaw( CSL_TimerHandle hTimer, CSL_TimerConfig * setup);/** Control operations for the TIMER. For a particular control operation, the * pointer to the corresponding data type needs to be passed as argument HwControl * function Call. All the arguments (Structure elements included) passed to the * HwControl function are inputs. For the list of commands supported and argument * type that can be @a void* casted & passed with a particular command refer to * @a CSL_TimerHwControlCmd. * * <b> Usage Constraints: </b> * Both @a CSL_timerInit() and @a CSL_timerOpen() must be called successfully * in that order before @a CSL_timerHwControl() can be called. For the * argument type that can be @a void* casted & passed with a particular command * refer to @a CSL_TimerHwControlCmd * * @b Example: * @verbatim CSL_TimerHandle hTimer; CSL_Status status; ... status = CSL_timerHwControl(hTimer, CSL_TIMER_CMD_START, NULL); @endverbatim * * @return returns the status of the operation (see @a CSL_Status) * */CSL_Status CSL_timerHwControl( CSL_TimerHandle hTimer, CSL_TimerHwControlCmd cmd, void *cmdArg);/** This function is used to read the current device configuration, status flags * and the value present associated registers. Following table details the various * status queries supported and the associated data structure to record the response. * User should allocate memory for the said data type and pass its pointer as an * unadorned void* argument to the status query call. For details about the various * status queries supported and the associated data structure to record the response, * refer to @a CSL_TimerHwStatusQuery * * <b> Usage Constraints: </b> * Both @a CSL_timerInit() and @a CSL_timerOpen() must be called successfully * in that order before @a CSL_timerGetHwStatus() can be called. For the * argument type that can be @a void* casted & passed with a particular command * refer to @a CSL_TimerHwStatusQuery * * @b Example: * @verbatim CSL_TimerHandle hTimer; CSL_Status status; Uint16 *response; ... status = CSL_timerGetHwStatus(hTimer, CSL_TIMER_QUERY_PRESCALE, &cmdArg); @endverbatim * * @return Returns the status of the operation (see @a CSL_Status) * */CSL_Status CSL_timerGetHwStatus( CSL_TimerHandle hTimer, CSL_TimerHwStatusQuery myQuery, void *response);/** @brief 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_timerOpen() * function call. * * 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 and there by allow CSL initiated write/reads into peripheral * MMR's go to an alternate location. Please refer the documentation for * more details. * * @b Example: * @verbatim CSL_Status status; CSL_TimerBaseAddress baseAddress; ... status = CSL_timerGetBaseAddress(CSL_TIMER_1, NULL, &baseAddress); @endverbatim * * @return Returns the status of the operation (see @a CSL_Status) * */CSL_Status CSL_timerGetBaseAddress( /** Instance number */ CSL_InstNum timerNum, /** Module specific parameters */ CSL_TimerParam * pTimerParam, /** Base address details */ CSL_TimerBaseAddress * pBaseAddress);#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -