⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csl_pwmaux.h

📁 TI达芬奇dm644x各硬件模块测试代码
💻 H
📖 第 1 页 / 共 2 页
字号:
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Pulse width modulation mode will be disabled 
 *       
 *       
 *   @b Modifies
 *   @n Pulse width modulation configuration registers mode will be disabled
 *
 *   @b Example
 *   @verbatim
        CSL_PwmHandle     hPwm;
        ...
        CSL_pwmDisableMode ( hPwm );
        ...
     @endverbatim
 * ===========================================================================
 */
CSL_IDEF_INLINE
void CSL_pwmDisableMode (
    CSL_PwmHandle   hPwm
)   
{   
    CSL_FINS (hPwm->regs->CFG, PWM_CFG_MODE, CSL_PWM_CFG_MODE_DISABLE);
}


/** ============================================================================
 *   @n@b CSL_pwmOneShotMode
 *
 *   @b Description
 *      Sets the mode to one-shot mode in pulse width modulation 
 *       
 *   @b Arguments
 *   @verbatim
        hPwm            Handle to the pulse width modulation instance
                
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Pulse width modulation mode will be set to one-shot mode 
 *       
 *       
 *   @b Modifies
 *   @n Pulse width modulation configuration registers mode will be set to 
 *      one-shot mode
 *
 *   @b Example
 *   @verbatim
        CSL_PwmHandle     hPwm;
        ...
        CSL_pwmOneShotMode ( hPwm );
        ...
     @endverbatim
 * =============================================================================
 */
CSL_IDEF_INLINE
void CSL_pwmOneShotMode (
    CSL_PwmHandle  hPwm
)   
{   
    CSL_FINS (hPwm->regs->CFG, PWM_CFG_MODE, CSL_PWM_CFG_MODE_OSHOT);
} 


/** ============================================================================
 *   @n@b CSL_pwmContinuousMode
 *
 *   @b Description
 *      Sets the mode to continuous mode in pulse width modulation 
 *       
 *   @b Arguments
 *   @verbatim
        hPwm            Handle to the pulse width modulation instance
                
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Pulse width modulation mode will be set to continuous mode
 *       
 *       
 *   @b Modifies
 *   @n Pulse width modulation configuration registers mode will be set to 
 *      one-shot mode
 *
 *   @b Example
 *   @verbatim
        CSL_PwmHandle     hPwm;
        ...
        CSL_pwmContinuousMode ( hPwm );
        ...
     @endverbatim
 * =============================================================================
 */
CSL_IDEF_INLINE
void CSL_pwmContinuousMode (
    CSL_PwmHandle    hPwm
)   
{   
    CSL_FINS (hPwm->regs->CFG, PWM_CFG_MODE, CSL_PWM_CFG_MODE_CONT);
} 
    

/** ============================================================================
 *   @n@b CSL_pwmConfigOneShot
 *
 *   @b Description
 *      configures the pulse width config register to in one-shot mode with the 
 *      parameter passed
 *       
 *   @b Arguments
 *   @verbatim
        hPwm                  Handle to the pulse width modulation instance
        CSL_PwmConfigOneShot  configOneShot
                
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Pulse width modulation config regiter will be configured to one-shot 
 *       mode
 *       
 *       
 *   @b Modifies
 *   @n Pulse width modulation configuration register
 
 *
 *   @b Example
 *   @verbatim
        CSL_PwmHandle        hPwm;
        CSL_PwmConfigOneShot configOneShot;
        ...
        CSL_pwmConfigOneShot ( hPwm , configoneShot );
        ...
     @endverbatim
 * =============================================================================
 */
CSL_IDEF_INLINE
void CSL_pwmConfigOneShot (
    CSL_PwmHandle        hPwm,
    CSL_PwmConfigOneShot configOneShot
)   
{   
    CSL_FINS (hPwm->regs->RPT, PWM_RPT_RPT, configOneShot.rpt); 
    hPwm->regs->CFG = ( CSL_FMK ( PWM_CFG_EVTRIG, configOneShot.evtTrig)
                   | CSL_FMK (PWM_CFG_INTEN, configOneShot.intEn) 
                   | CSL_FMK (PWM_CFG_INACTOUT, configOneShot.inactOut)
                   | CSL_FMK (PWM_CFG_P1OUT, configOneShot.p1Out) );
}


/** ============================================================================
 *   @n@b CSL_pwmConfigContinuous
 *
 *   @b Description
 *      configures the pulse width config register to in continuous mode with 
 *      the parameter passed
 *       
 *   @b Arguments
 *   @verbatim
        hPwm                     Handle to the pulse width modulation instance
        CSL_PwmConfigContinuous  configContinuous
                
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Pulse width modulation config regiter will be configured to Continuous 
 *       mode
 *       
 *       
 *   @b Modifies
 *   @n Pulse width modulation configuration register
 
 *
 *   @b Example
 *   @verbatim
        CSL_PwmHandle           hPwm;
        CSL_PwmConfigContinuous configContinuous;
        ...
        CSL_pwmConfigContinuous ( hPwm , configContinuous );
        ...
     @endverbatim
 * ===========================================================================
 */
CSL_IDEF_INLINE
void CSL_pwmConfigContinuous (
    CSL_PwmHandle            hPwm,
    CSL_PwmConfigContinuous  configContinuous
)   
{   
    hPwm->regs->CFG = ( CSL_FMK (PWM_CFG_INTEN, configContinuous.intEn)
                   | CSL_FMK (PWM_CFG_INACTOUT, configContinuous.inactOut)
                   | CSL_FMK (PWM_CFG_P1OUT, configContinuous.p1Out) );
}                  


/** ============================================================================
 *   @n@b CSL_pwmStop
 *
 *   @b Description
 *      stops the pulse width modulation
 *       
 *   @b Arguments
 *   @verbatim
        hPwm                  Handle to the pulse width modulation instance
                        
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Pulse width modulation will be stopped
 *       mode
 *       
 *       
 *   @b Modifies
 *   @n Pulse width modulation start register
 
 *
 *   @b Example
 *   @verbatim
        CSL_PwmHandle     hPwm;
        ...
        CSL_pwmStop ( hPwm );
        ...
     @endverbatim
 * ===========================================================================
 */
CSL_IDEF_INLINE
void CSL_pwmStop (
    CSL_PwmHandle    hPwm
)   
{   
    CSL_FINS (hPwm->regs->PCR, PWM_PCR_FREE, CSL_PWM_EMU_STOP);
}


/** ============================================================================
 *   @n@b CSL_pwmRunFree
 *
 *   @b Description
 *      pulse width modulation runs free regrdless of emu_suspend signal
 *       
 *   @b Arguments
 *   @verbatim
        hPwm                  Handle to the pulse width modulation instance
                        
     @endverbatim
 *
 *   <b> Return Value </b> 
 *       None 
 *
 *   <b> Pre Condition </b>
 *   @n  None
 *
 *   <b> Post Condition </b>
 *   @n  Pulse width modulation runs regrdless of emu_suspend signal
 *       mode
 *       
 *       
 *   @b Modifies
 *   @n Pulse width modulation config register
 
 *
 *   @b Example
 *   @verbatim
        CSL_PwmHandle     hPwm;
        ...
        CSL_pwmRunFree ( hPwm );
        ...
     @endverbatim
 * ===========================================================================
 */
CSL_IDEF_INLINE
void CSL_pwmRunFree (
    CSL_PwmHandle    hPwm
)   
{   
    CSL_FINS (hPwm->regs->PCR, PWM_PCR_FREE, CSL_PWM_EMU_RUN);
}


#ifdef __cplusplus
}
#endif

#endif /* _CSL_PWMAUX_H_ */


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -