此帖出自微控制器 MCU论坛
最新回复
//*****************************************************************************
//
//! Controls the output level.
//!
//! \param ui32Base is the base address of the timer module.
//! \param ui32Timer specifies the timer(s) to adjust; must be one of
//! \b TIMER_A, \b TIMER_B, or \b TIMER_BOTH.
//! \param bInvert specifies the output level.
//!
//! This function configures the PWM output level for the specified timer. If
//! the \e bInvert parameter is \b true, then the timer's output is made active
//! low; otherwise, it is made active high.
//!
//! \return None.
//
//*****************************************************************************
void
TimerControlLevel(uint32_t ui32Base, uint32_t ui32Timer, bool bInvert)
{
//
// Check the arguments.
//
ASSERT(_TimerBaseValid(ui32Base));
ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
(ui32Timer == TIMER_BOTH));
//
// Set the output levels as requested.
//
ui32Timer &= TIMER_CTL_TAPWML | TIMER_CTL_TBPWML;
HWREG(ui32Base + TIMER_O_CTL) = (bInvert ?
(HWREG(ui32Base + TIMER_O_CTL) |
ui32Timer) :
(HWREG(ui32Base + TIMER_O_CTL) &
~(ui32Timer)));
}
详情
回复
发表于 2013-9-3 16:11
点评 | ||
|
||
回复 楼主zgbkdlm 的帖子
此帖出自微控制器 MCU论坛
| ||
|
||
曾经的版主且威望大于2000,或对EEWORLD论坛有突出贡献的坛友
EEWorld Datasheet 技术支持