📄 csl_tmraux.h
字号:
/* ============================================================================ * 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_tmrAux.h * * @brief Header file for functional layer of TMR CSL * * Path: \\(CSLPATH)\\ipmodules\\timer\\src *//* ============================================================================= * Revision History * =============== * 1-Sept-2004 HMM File Created. * ============================================================================= */#ifndef _CSL_TMRAUX_H_#define _CSL_TMRAUX_H_#include <csl_tmr.h>#ifdef __cplusplusextern "C" {#endif/* * Status Query Functions of General purpose timer *//** ============================================================================ * @n@b CSL_tmrGetPid * * @b Description * @n This function gets the Peripheral revision ID for the module * * @b Arguments * @verbatim hTmr Handle to the general purpose timer instance @endverbatim * * <b> Return Value </b> Bool * * @li PID - Peripheral identification Number * * <b> Pre Condition </b> * @n None * * <b> Post Condition </b> * @n None * * @b Modifies * @n None * * @b Example * @verbatim CSL_TmrHandle hTmr; CSL_TmrPidNumber *pid; CSL_tmrGetPid(hTmr, pid); @endverbatim * =========================================================================== */CSL_IDEF_INLINEvoid CSL_tmrGetPid ( CSL_TmrHandle hTmr, CSL_TmrPidNumber *pidNumber){ /* Identifies the type of peripheral */ pidNumber->tmrType = CSL_FEXT(hTmr->regs->PID12, TMR_PID12_TYPE); /* Identifies the class of peripheral */ pidNumber->tmrClass = CSL_FEXT(hTmr->regs->PID12, TMR_PID12_CLASS); /* Identifies the revision level of the timer */ pidNumber->tmrRevision = CSL_FEXT(hTmr->regs->PID12, TMR_PID12_REVISION);}/** ============================================================================ * @n@b CSL_tmrGetTinp34Data * * @b Description * @n This function gets the value of the TINP34 pin status * * @b Arguments * @verbatim hTmr Handle to the general purpose timer instance @endverbatim * * <b> Return Value </b> CSL_TmrGpDatDati34 * * @li CSL_TMR_GPDAT_DATI34_LOW - Data low * @li CSL_TMR_GPDAT_DATI34_HIGH - Data High * * <b> Pre Condition </b> * @n General purpose Timer should be set it to GPIO mode * * <b> Post Condition </b> * @n return the status of TINP34 pin input and output * * @b Modifies * @n None * * @b Example * @verbatim CSL_TmrHandle hTmr; CSL_TmrGpDatDati34 statusTinp34; statusTinp34 = CSL_tmrGetTinp34Data(hTmr); @endverbatim * =========================================================================== */CSL_IDEF_INLINEBool CSL_tmrGetTinp34Data ( CSL_TmrHandle hTmr){ return (Bool)CSL_FEXT(hTmr->regs->GPTDAT_GPDIR, TMR_GPTDAT_GPDIR_GPIO_DATI34);}/** ============================================================================ * @n@b CSL_tmrGetToutp34Data * * @b Description * @n This function gets the value of the TOUTP34 pin status * * @b Arguments * @verbatim hTmr Handle to the general purpose timer instance @endverbatim * * <b> Return Value </b> CSL_TmrGpDatDato34 * * @li CSL_TMR_GPDAT_DATO34_LOW - Data low * @li CSL_TMR_GPDAT_DATO34_HIGH - Data High * * <b> Pre Condition </b> * @n General purpose Timer should be set it to GPIO mode * * <b> Post Condition </b> * @n return the status of TOUTP34 pin input and output * * @b Modifies * @n None * * @b Example * @verbatim CSL_TmrHandle hTmr; CSL_TmrGpDatDato34 statusToutp34; statusToutp34 = CSL_tmrGetToutp34Data(hTmr); @endverbatim * =========================================================================== */CSL_IDEF_INLINEBool CSL_tmrGetToutp34Data ( CSL_TmrHandle hTmr){ return (Bool)CSL_FEXT(hTmr->regs->GPTDAT_GPDIR, \ TMR_GPTDAT_GPDIR_GPIO_DATO34);}/** ============================================================================ * @n@b CSL_tmrGetTinp12Data * * @b Description * @n This function gets the value of the TINP12 pin status * * @b Arguments * @verbatim hTmr Handle to the general purpose timer instance @endverbatim * * <b> Return Value </b> CSL_TmrGpDatDati12 * * @li CSL_TMR_GPDAT_DATI12_LOW - Data low * @li CSL_TMR_GPDAT_DATI12_HIGH - Data High * * <b> Pre Condition </b> * @n General purpose Timer should be set it to GPIO mode * * <b> Post Condition </b> * @n return the status of TINP12 pin input and output * * @b Modifies * @n None * * @b Example * @verbatim CSL_TmrHandle hTmr; CSL_TmrGpDatDati12 statusTinp12; statusTinp12 = CSL_tmrGetTinp12Data(hTmr); @endverbatim * =========================================================================== */CSL_IDEF_INLINEBool CSL_tmrGetTinp12Data ( CSL_TmrHandle hTmr){ return (Bool)CSL_FEXT(hTmr->regs->GPTDAT_GPDIR, \ TMR_GPTDAT_GPDIR_GPIO_DATI12);}/** ============================================================================ * @n@b CSL_tmrGetToutp12Data * * @b Description * @n This function gets the value of the TOUTP12 pin status * * @b Arguments * @verbatim hTmr Handle to the general purpose timer instance @endverbatim * * <b> Return Value </b> CSL_TmrGpDatDato12 * * @li CSL_TMR_GPDAT_DATO12_LOW - Data low * @li CSL_TMR_GPDAT_DATO12_HIGH - Data High * * <b> Pre Condition </b> * @n General purpose Timer should be set it to GPIO mode * * <b> Post Condition </b> * @n return the status of TOUTP12 pin input and output * * @b Modifies * @n None * * @b Example * @verbatim CSL_TmrHandle hTmr; CSL_TmrGpDatDato12 statusToutp12; statusToutp12 = CSL_tmrGetToutp12Data(hTmr); @endverbatim * =========================================================================== */CSL_IDEF_INLINEBool CSL_tmrGetToutp12Data ( CSL_TmrHandle hTmr){ return (Bool)CSL_FEXT(hTmr->regs->GPTDAT_GPDIR, \ TMR_GPTDAT_GPDIR_GPIO_DATO12);}/** ============================================================================ * @n@b CSL_tmrGetTim34Count * * @b Description * @n This function gets the value of the TIM34 counter * * @b Arguments * @verbatim hTmr Handle to the general purpose timer instance Unit32 * counter pointer @endverbatim * * <b> Return Value </b> TIM34 counter snapshot value * * <b> Pre Condition </b> * @n Timer should be set to GPTimer OR Unchained mode OR Chained mode * * <b> Post Condition </b> * @n TIM34 counter snapshot value * * @b Modifies * @n None * * @b Example * @verbatim CSL_TmrHandle hTmr; Unit32 *count34; CSL_tmrGetTim34Count(hTmr, count34); @endverbatim * =========================================================================== */CSL_IDEF_INLINEvoid CSL_tmrGetTim34Count ( CSL_TmrHandle hTmr, Uint32 *count34){ *count34 = hTmr->regs->TIM34;}/** ============================================================================ * @n@b CSL_tmrGetTim12Count * * @b Description * @n This function gets the value of the TIM12 counter * * @b Arguments * @verbatim hTmr Handle to the general purpose timer instance Unit32 * counter pointer @endverbatim * * <b> Return Value </b> TIM12 counter snapshot value * * <b> Pre Condition </b> * @n Timer should be set to GPTimer OR Unchained mode OR Chained mode * * <b> Post Condition </b> * @n TIM12 counter snapshot value * * @b Modifies * @n None * * @b Example * @verbatim CSL_TmrHandle hTmr; Unit32 *count12; CSL_tmrGetTim12Count(hTmr, count12); @endverbatim * =========================================================================== */CSL_IDEF_INLINEvoid CSL_tmrGetTim12Count ( CSL_TmrHandle hTmr, Uint32 *count12){ *count12 = hTmr->regs->TIM12;}/** ============================================================================ * @n@b CSL_tmrGetTstat12Status * * @b Description * @n This function gets the status of the TINT12 * * @b Arguments * @verbatim hTmr Handle to the general purpose timer instance @endverbatim * * <b> Return Value </b> CSL_TmrTstat12 - TINT12 status value * * @li CSL_TMR_TSTAT12_LOW - Data low * @li CSL_TMR_TSTAT12_HIGH - Data High * * <b> Pre Condition </b> * @n Timer should be set to GPTimer OR Unchained mode OR Chained mode * * <b> Post Condition </b> * @n TINT12 status value * * @b Modifies * @n None * * @b Example * @verbatim CSL_TmrHandle hTmr; CSL_TmrTstat12 status12; status12 = CSL_tmrGetTstat12Status(hTmr); @endverbatim * =========================================================================== */CSL_IDEF_INLINECSL_TmrTstat CSL_tmrGetTstat12Status ( CSL_TmrHandle hTmr){ return (CSL_TmrTstat)CSL_FEXT(hTmr->regs->TCR, TMR_TCR_TSTAT12);}/** =========================================================================== * @n@b CSL_tmrGetTstat34Status * * @b Description * @n This function gets the status of the TINT34 * * @b Arguments * @verbatim hTmr Handle to the general purpose timer instance @endverbatim * * <b> Return Value </b> CSL_TmrTstat34 - TINT34 status value * * @li CSL_TMR_TSTAT34_LOW - Data low * @li CSL_TMR_TSTAT34_HIGH - Data High * * <b> Pre Condition </b> * @n Timer should be set to GPTimer OR Unchained mode OR Chained mode * * <b> Post Condition </b> * @n TINT34 status value * * @b Modifies * @n None * * @b Example * @verbatim CSL_TmrHandle hTmr; CSL_TmrTstat34 status34; status34 = CSL_tmrGetTstat34Status(hTmr); @endverbatim * =========================================================================== */CSL_IDEF_INLINECSL_TmrTstat CSL_tmrGetTstat34Status ( CSL_TmrHandle hTmr){ return (CSL_TmrTstat)CSL_FEXT(hTmr->regs->TCR, TMR_TCR_TSTAT34);}/* * Control command functions of ATA
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -