亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pwm.c

?? KEIL驅動 各方面各 你的看法女士的煩惱 方看到你
?? C
?? 第 1 頁 / 共 5 頁
字號:
        // The period is twice the reload register value.
        //
        return(HWREG(ulGen + PWM_O_X_LOAD) * 2);
    }
    else
    {
        //
        // The period is the reload register value plus one.
        //
        return(HWREG(ulGen + PWM_O_X_LOAD) + 1);
    }
}

//*****************************************************************************
//
//! Enables the timer/counter for a PWM generator block.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulGen is the PWM generator to be enabled.  Must be one of
//! \b PWM_GEN_0, \b PWM_GEN_1, \b PWM_GEN_2, or \b PWM_GEN_3.
//!
//! This function allows the PWM clock to drive the timer/counter for the
//! specified generator block.
//!
//! \return None.
//
//*****************************************************************************
void
PWMGenEnable(unsigned long ulBase, unsigned long ulGen)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(PWMGenValid(ulGen));

    //
    // Enable the PWM generator.
    //
    HWREG(PWM_GEN_BADDR(ulBase, ulGen) + PWM_O_X_CTL) |= PWM_X_CTL_ENABLE;
}

//*****************************************************************************
//
//! Disables the timer/counter for a PWM generator block.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulGen is the PWM generator to be disabled.  Must be one of
//! \b PWM_GEN_0, \b PWM_GEN_1, \b PWM_GEN_2, or \b PWM_GEN_3.
//!
//! This function blocks the PWM clock from driving the timer/counter for the
//! specified generator block.
//!
//! \return None.
//
//*****************************************************************************
void
PWMGenDisable(unsigned long ulBase, unsigned long ulGen)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(PWMGenValid(ulGen));

    //
    // Disable the PWM generator.
    //
    HWREG(PWM_GEN_BADDR(ulBase, + ulGen) + PWM_O_X_CTL) &= ~(PWM_X_CTL_ENABLE);
}

//*****************************************************************************
//
//! Sets the pulse width for the specified PWM output.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulPWMOut is the PWM output to modify.  Must be one of \b PWM_OUT_0,
//! \b PWM_OUT_1, \b PWM_OUT_2, \b PWM_OUT_3, \b PWM_OUT_4, \b PWM_OUT_5,
//! \b PWM_OUT_6, or \b PWM_OUT_7.
//! \param ulWidth specifies the width of the positive portion of the pulse.
//!
//! This function sets the pulse width for the specified PWM output, where the
//! pulse width is defined as the number of PWM clock ticks.
//!
//! \note Any subsequent calls made to this function before an update occurs
//! will cause the previous values to be overwritten.
//!
//! \return None.
//
//*****************************************************************************
void
PWMPulseWidthSet(unsigned long ulBase, unsigned long ulPWMOut,
                 unsigned long ulWidth)
{
    unsigned long ulGenBase, ulReg;

    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(PWMOutValid(ulPWMOut));

    //
    // Compute the generator's base address.
    //
    ulGenBase = PWM_OUT_BADDR(ulBase, ulPWMOut);

    //
    // If the counter is in up/down count mode, divide the width by two.
    //
    if(HWREG(ulGenBase + PWM_O_X_CTL) & PWM_X_CTL_MODE)
    {
        ulWidth /= 2;
    }

    //
    // Get the period.
    //
    ulReg = HWREG(ulGenBase + PWM_O_X_LOAD);

    //
    // Make sure the width is not too large.
    //
    ASSERT(ulWidth < ulReg);

    //
    // Compute the compare value.
    //
    ulReg = ulReg - ulWidth;

    //
    // Write to the appropriate registers.
    //
    if(PWM_IS_OUTPUT_ODD(ulPWMOut))
    {
        HWREG(ulGenBase + PWM_O_X_CMPB) = ulReg;
    }
    else
    {
        HWREG(ulGenBase + PWM_O_X_CMPA) = ulReg;
    }
}

//*****************************************************************************
//
//! Gets the pulse width of a PWM output.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulPWMOut is the PWM output to query.  Must be one of \b PWM_OUT_0,
//! \b PWM_OUT_1, \b PWM_OUT_2, \b PWM_OUT_3, \b PWM_OUT_4, \b PWM_OUT_5,
//! \b PWM_OUT_6, or \b PWM_OUT_7.
//!
//! This function gets the currently programmed pulse width for the specified
//! PWM output.  If the update of the comparator for the specified output has
//! yet to be completed, the value returned may not be the active pulse width.
//! The value returned is the programmed pulse width, measured in PWM clock
//! ticks.
//!
//! \return Returns the width of the pulse in PWM clock ticks.
//
//*****************************************************************************
unsigned long
PWMPulseWidthGet(unsigned long ulBase, unsigned long ulPWMOut)
{
    unsigned long ulGenBase, ulReg, ulLoad;

    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(PWMOutValid(ulPWMOut));

    //
    // Compute the generator's base address.
    //
    ulGenBase = PWM_OUT_BADDR(ulBase, ulPWMOut);

    //
    // Then compute the pulse width.  If mode is UpDown, set
    // width = (load - compare) * 2.  Otherwise, set width = load - compare.
    //
    ulLoad = HWREG(ulGenBase + PWM_O_X_LOAD);
    if(PWM_IS_OUTPUT_ODD(ulPWMOut))
    {
        ulReg = HWREG(ulGenBase + PWM_O_X_CMPB);
    }
    else
    {
        ulReg = HWREG(ulGenBase + PWM_O_X_CMPA);
    }
    ulReg = ulLoad - ulReg;

    //
    // If in up/down count mode, double the pulse width.
    //
    if(HWREG(ulGenBase + PWM_O_X_CTL) & PWM_X_CTL_MODE)
    {
        ulReg = ulReg * 2;
    }

    //
    // Return the pulse width.
    //
    return(ulReg);
}

//*****************************************************************************
//
//! Enables the PWM dead band output, and sets the dead band delays.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulGen is the PWM generator to modify.  Must be one of
//! \b PWM_GEN_0, \b PWM_GEN_1, \b PWM_GEN_2, or \b PWM_GEN_3.
//! \param usRise specifies the width of delay from the rising edge.
//! \param usFall specifies the width of delay from the falling edge.
//!
//! This function sets the dead bands for the specified PWM generator,
//! where the dead bands are defined as the number of \b PWM clock ticks
//! from the rising or falling edge of the generator's \b OutA signal.
//! Note that this function causes the coupling of \b OutB to \b OutA.
//!
//! \return None.
//
//*****************************************************************************
void
PWMDeadBandEnable(unsigned long ulBase, unsigned long ulGen,
                  unsigned short usRise, unsigned short usFall)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(PWMGenValid(ulGen));
    ASSERT(usRise < 4096);
    ASSERT(usFall < 4096);

    //
    // Compute the generator's base address.
    //
    ulGen = PWM_GEN_BADDR(ulBase, ulGen);

    //
    // Write the dead band delay values.
    //
    HWREG(ulGen + PWM_O_X_DBRISE) = usRise;
    HWREG(ulGen + PWM_O_X_DBFALL) = usFall;

    //
    // Enable the deadband functionality.
    //
    HWREG(ulGen + PWM_O_X_DBCTL) |= PWM_X_DBCTL_ENABLE;
}

//*****************************************************************************
//
//! Disables the PWM dead band output.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulGen is the PWM generator to modify.  Must be one of
//! \b PWM_GEN_0, \b PWM_GEN_1, \b PWM_GEN_2, or \b PWM_GEN_3.
//!
//! This function disables the dead band mode for the specified PWM generator.
//! Doing so decouples the \b OutA and \b OutB signals.
//!
//! \return None.
//
//*****************************************************************************
void
PWMDeadBandDisable(unsigned long ulBase, unsigned long ulGen)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(PWMGenValid(ulGen));

    //
    // Disable the deadband functionality.
    //
    HWREG(PWM_GEN_BADDR(ulBase, ulGen) + PWM_O_X_DBCTL) &=
        ~(PWM_X_DBCTL_ENABLE);
}

//*****************************************************************************
//
//! Synchronizes all pending updates.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulGenBits are the PWM generator blocks to be updated.  Must be the
//! logical OR of any of \b PWM_GEN_0_BIT, \b PWM_GEN_1_BIT,
//! \b PWM_GEN_2_BIT, or \b PWM_GEN_3_BIT.
//!
//! For the selected PWM generators, this function causes all queued updates to
//! the period or pulse width to be applied the next time the corresponding
//! counter becomes zero.
//!
//! \return None.
//
//*****************************************************************************
void
PWMSyncUpdate(unsigned long ulBase, unsigned long ulGenBits)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(!(ulGenBits & ~(PWM_GEN_0_BIT | PWM_GEN_1_BIT | PWM_GEN_2_BIT |
                           PWM_GEN_3_BIT)));

    //
    // Synchronize pending PWM register changes.
    //
    HWREG(ulBase + PWM_O_CTL) = ulGenBits;
}

//*****************************************************************************
//
//! Synchronizes the counters in one or multiple PWM generator blocks.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulGenBits are the PWM generator blocks to be synchronized.  Must be
//! the logical OR of any of \b PWM_GEN_0_BIT, \b PWM_GEN_1_BIT,
//! \b PWM_GEN_2_BIT, or \b PWM_GEN_3_BIT.
//!
//! For the selected PWM module, this function synchronizes the time base
//! of the generator blocks by causing the specified generator counters to be
//! reset to zero.
//!
//! \return None.
//
//*****************************************************************************
void
PWMSyncTimeBase(unsigned long ulBase, unsigned long ulGenBits)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(!(ulGenBits & ~(PWM_GEN_0_BIT | PWM_GEN_1_BIT | PWM_GEN_2_BIT |
                           PWM_GEN_3_BIT)));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产成人高清精品| 欧美丰满一区二区免费视频 | 中文字幕在线不卡国产视频| 日韩视频一区二区在线观看| 欧美婷婷六月丁香综合色| 99国产精品国产精品久久| 高清国产一区二区三区| 欧洲精品视频在线观看| 99精品国产视频| 91免费观看国产| 日本高清视频一区二区| 色吊一区二区三区| 一本到不卡免费一区二区| 日本久久一区二区三区| 欧美在线啊v一区| 欧美另类videos死尸| 91精品福利在线一区二区三区| 欧美一级精品在线| 精品美女一区二区| 日本一区二区三区免费乱视频| 国产精品看片你懂得| 亚洲精品一二三四区| 天涯成人国产亚洲精品一区av| 捆绑调教一区二区三区| 国产在线一区二区综合免费视频| 国产精品99久久久久久久女警| av亚洲精华国产精华精华| 色综合 综合色| 欧美女孩性生活视频| 精品美女在线播放| 国产精品久久久久久久久搜平片| 亚洲男人的天堂在线观看| 亚洲成a人v欧美综合天堂 | 成人欧美一区二区三区| 亚洲国产欧美在线| 蜜臀精品一区二区三区在线观看 | 日本精品一区二区三区四区的功能| 欧美日韩精品一区二区天天拍小说| 精品日韩一区二区三区| 亚洲少妇30p| 国产精品综合一区二区| 欧美视频在线观看一区二区| 国产亚洲短视频| 午夜精品久久久久久久久久久 | 日本丰满少妇一区二区三区| 日韩网站在线看片你懂的| 国产精品久久久久久久久晋中| 日韩精品电影在线观看| jlzzjlzz亚洲女人18| 精品剧情v国产在线观看在线| 亚洲色图制服丝袜| 激情文学综合网| 欧美午夜精品久久久| 国产欧美日韩视频一区二区| 丝袜美腿亚洲一区| 成人app网站| 日韩你懂的在线观看| 亚洲精品大片www| 国产不卡高清在线观看视频| 在线播放一区二区三区| 中文字幕一区二区三区蜜月| 精品在线一区二区| 538prom精品视频线放| 亚洲精品视频免费观看| 不卡av免费在线观看| 久久久精品黄色| 经典三级在线一区| 欧美一区2区视频在线观看| 一区二区高清免费观看影视大全 | 一区二区三区四区不卡在线| 99久久精品一区| 国产精品美女一区二区三区| 国产91在线看| 欧美国产在线观看| 国产乱国产乱300精品| 精品欧美一区二区久久| 久久成人免费网站| 精品国产乱码久久久久久夜甘婷婷| 蜜桃91丨九色丨蝌蚪91桃色| 91精品婷婷国产综合久久性色| 亚洲伊人伊色伊影伊综合网| 91浏览器入口在线观看| 亚洲欧洲成人av每日更新| 成人黄色网址在线观看| 国产精品久久久久久亚洲伦 | 蜜桃视频在线观看一区| 欧美一区二区精品在线| 免费黄网站欧美| 久久综合久久鬼色中文字| 国产一区二区三区日韩| 日本一区二区不卡视频| 99久久伊人精品| 亚洲成人福利片| 日韩欧美一级二级| 国产精品自拍三区| 亚洲欧洲日本在线| 欧美视频在线一区二区三区| 天天色图综合网| 精品国内二区三区| 成人18精品视频| 亚洲成人先锋电影| 欧美精品一区二区久久婷婷| 国产91精品一区二区麻豆网站| 亚洲欧美日韩国产综合在线| 欧美精品久久久久久久多人混战 | 欧美在线观看一二区| 日韩精品亚洲一区二区三区免费| 欧美xxxx老人做受| 99视频一区二区三区| 丝袜美腿亚洲一区二区图片| 国产人久久人人人人爽| 欧美色图一区二区三区| 精品一区二区三区免费播放| 一色屋精品亚洲香蕉网站| 欧美日本高清视频在线观看| 国产a级毛片一区| 午夜精品久久久久久久久| 国产欧美日韩久久| 欧美午夜精品一区二区蜜桃| 国产不卡视频在线播放| 日本不卡在线视频| 亚洲女与黑人做爰| 2021中文字幕一区亚洲| 欧美日韩黄色影视| av一区二区三区在线| 国产一区啦啦啦在线观看| 亚洲一级二级在线| 亚洲国产精品高清| 欧美一二三区在线观看| 97se亚洲国产综合在线| 国产呦精品一区二区三区网站| 亚洲一区二区在线视频| 国产精品不卡一区二区三区| 日韩精品一区二区三区老鸭窝| 欧美在线短视频| 色悠悠亚洲一区二区| 国产成人精品三级| 麻豆91小视频| 日韩电影免费在线观看网站| 一区二区三区中文免费| 国产精品美女久久久久aⅴ| 精品欧美久久久| 欧美高清性hdvideosex| 欧美性受xxxx黑人xyx性爽| 成人精品鲁一区一区二区| 国内精品免费在线观看| 免播放器亚洲一区| 亚洲综合免费观看高清完整版在线 | 午夜欧美视频在线观看| 一区二区三区四区在线播放| 国产精品欧美一级免费| 国产精品免费视频观看| 国产精品美女久久久久久2018| 国产欧美综合在线| 精品国产一区二区三区av性色 | 成人激情免费网站| 国产精品亚洲一区二区三区在线 | 欧美大片一区二区| 欧美一区二区三区在线视频| 91精品国产麻豆国产自产在线 | 国产一二三精品| 国产精品资源在线观看| 国产69精品一区二区亚洲孕妇| 国产精品亚洲а∨天堂免在线| 国产sm精品调教视频网站| 成人激情文学综合网| 色久优优欧美色久优优| 欧美亚洲一区三区| 欧美一区二区三区影视| 精品理论电影在线| 国产精品伦一区| 亚洲一区二区三区国产| 日韩国产一二三区| 韩日av一区二区| 成年人国产精品| 欧美探花视频资源| 精品久久一区二区| 国产精品丝袜一区| 亚洲精品乱码久久久久久久久| 天天色天天操综合| 国产美女一区二区| 色网站国产精品| 欧美一区二区三区免费大片| 国产亚洲精品aa| 亚洲国产精品久久久男人的天堂| 麻豆国产精品一区二区三区| aaa国产一区| 欧美大肚乱孕交hd孕妇| 国产喷白浆一区二区三区| 亚洲一区二区视频在线| 国产曰批免费观看久久久| 色素色在线综合| 2022国产精品视频| 亚洲一区二区三区三| 国产一区二区三区四区五区美女| 欧美羞羞免费网站| 国产婷婷精品av在线| 亚洲一区二区欧美| 国产aⅴ精品一区二区三区色成熟| 欧美亚洲日本国产|