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

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

?? pwm.c

?? 飛利浦LM3S系列ARM的庫文件,在進行arm開發(fā)時所必須的庫文件,直接加到工程中,一般不必修改.
?? C
?? 第 1 頁 / 共 3 頁
字號:
}

//*****************************************************************************
//
//! 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, or \b PWM_OUT_5.
//!
//! 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 \b PWM clock ticks.
//!
//! \return Returns the width of the pulse in \b 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((ulPWMOut == PWM_OUT_0) || (ulPWMOut == PWM_OUT_1) ||
           (ulPWMOut == PWM_OUT_2) || (ulPWMOut == PWM_OUT_3) ||
           (ulPWMOut == PWM_OUT_4) || (ulPWMOut == PWM_OUT_5));

    //
    // 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, or \b PWM_GEN_2.
//! \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((ulGen == PWM_GEN_0) || (ulGen == PWM_GEN_1) ||
           (ulGen == PWM_GEN_2));
    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_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, or \b PWM_GEN_2.
//!
//! 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((ulGen == PWM_GEN_0) || (ulGen == PWM_GEN_1) ||
           (ulGen == PWM_GEN_2));

    //
    // Disable the deadband functionality.
    //
    HWREG(PWM_GEN_BADDR(ulBase, ulGen) + PWM_O_X_DBCTL) &= ~(PWM_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, or
//! \b PWM_GEN_2_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)));

    //
    // Update the PWM timing registers.
    //
    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, or
//! \b PWM_GEN_2_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)));

    //
    // Synchronize the counters in the specified generators by writing to
    // the module's synchronization register.
    //
    HWREG(ulBase + PWM_O_SYNC) = ulGenBits;
}

//*****************************************************************************
//
//! Enables or disables PWM outputs.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulPWMOutBits are the PWM outputs to be modified.  Must be the
//! logical OR of any of \b PWM_OUT_0_BIT, \b PWM_OUT_1_BIT, \b PWM_OUT_2_BIT,
//! \b PWM_OUT_3_BIT, \b PWM_OUT_4_BIT, or \b PWM_OUT_5_BIT.
//! \param bEnable determines if the signal is enabled or disabled.
//!
//! This function is used to enable or disable the selected PWM outputs.  The
//! outputs are selected using the parameter \e ulPWMOutBits.  The parameter
//! \e bEnable determines the state of the selected outputs.  If \e bEnable is
//! \b true, then the selected PWM outputs are enabled, or placed in the active
//! state.  If \e bEnable is \b false, then the selected outputs are disabled,
//! or placed in the inactive state.
//!
//! \return None.
//
//*****************************************************************************
void
PWMOutputState(unsigned long ulBase, unsigned long ulPWMOutBits,
               tBoolean bEnable)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(!(ulPWMOutBits & ~(PWM_OUT_0_BIT | PWM_OUT_1_BIT | PWM_OUT_2_BIT |
                              PWM_OUT_3_BIT | PWM_OUT_4_BIT | PWM_OUT_5_BIT)));

    //
    // Read the module's ENABLE output control register, and set or clear
    // the requested bits.
    //
    if(bEnable == true)
    {
        HWREG(ulBase + PWM_O_ENABLE) |= ulPWMOutBits;
    }
    else
    {
        HWREG(ulBase + PWM_O_ENABLE) &= ~(ulPWMOutBits);
    }
}

//*****************************************************************************
//
//! Selects the inversion mode for PWM outputs.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulPWMOutBits are the PWM outputs to be modified.  Must be the
//! logical OR of any of \b PWM_OUT_0_BIT, \b PWM_OUT_1_BIT, \b PWM_OUT_2_BIT,
//! \b PWM_OUT_3_BIT, \b PWM_OUT_4_BIT, or \b PWM_OUT_5_BIT.
//! \param bInvert determines if the signal is inverted or passed through.
//!
//! This function is used to select the inversion mode for the selected PWM
//! outputs.  The outputs are selected using the parameter \e ulPWMOutBits.
//! The parameter \e bInvert determines the inversion mode for the selected
//! outputs.  If \e bInvert is \b true, this function will cause the specified
//! PWM output signals to be inverted, or made active low.  If \e bInvert is
//! \b false, the specified output will be passed through as is, or be made
//! active high.
//!
//! \return None.
//
//*****************************************************************************
void
PWMOutputInvert(unsigned long ulBase, unsigned long ulPWMOutBits,
                tBoolean bInvert)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(!(ulPWMOutBits & ~(PWM_OUT_0_BIT | PWM_OUT_1_BIT | PWM_OUT_2_BIT |
                              PWM_OUT_3_BIT | PWM_OUT_4_BIT | PWM_OUT_5_BIT)));

    //
    // Read the module's INVERT output control register, and set or clear
    // the requested bits.
    //
    if(bInvert == true)
    {
        HWREG(ulBase + PWM_O_INVERT) |= ulPWMOutBits;
    }
    else
    {
        HWREG(ulBase + PWM_O_INVERT) &= ~(ulPWMOutBits);
    }
}

//*****************************************************************************
//
//! Specifies the state of PWM outputs in response to a fault condition.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulPWMOutBits are the PWM outputs to be modified.  Must be the
//! logical OR of any of \b PWM_OUT_0_BIT, \b PWM_OUT_1_BIT, \b PWM_OUT_2_BIT,
//! \b PWM_OUT_3_BIT, \b PWM_OUT_4_BIT, or \b PWM_OUT_5_BIT.
//! \param bFaultKill determines if the signal is killed or passed through
//! during an active fault condition.
//!
//! This function sets the fault handling characteristics of the selected PWM
//! outputs.  The outputs are selected using the parameter \e ulPWMOutBits.
//! The parameter \e bFaultKill determines the fault handling characteristics
//! for the selected outputs.  If \e bFaultKill is \b true, then the selected
//! outputs will be made inactive.  If \e bFaultKill is \b false, then the
//! selected outputs are unaffected by the detected fault.
//!
//! \return None.
//
//*****************************************************************************
void
PWMOutputFault(unsigned long ulBase, unsigned long ulPWMOutBits,
               tBoolean bFaultKill)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT(!(ulPWMOutBits & ~(PWM_OUT_0_BIT | PWM_OUT_1_BIT | PWM_OUT_2_BIT |
                              PWM_OUT_3_BIT | PWM_OUT_4_BIT | PWM_OUT_5_BIT)));

    //
    // Read the module's FAULT output control register, and set or clear
    // the requested bits.
    //
    if(bFaultKill == true)
    {
        HWREG(ulBase + PWM_O_FAULT) |= ulPWMOutBits;
    }
    else
    {
        HWREG(ulBase + PWM_O_FAULT) &= ~(ulPWMOutBits);
    }
}

//*****************************************************************************
//
//! Registers an interrupt.handler for the specified PWM generator block.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulGen is the PWM generator in question.
//! \param pfIntHandler is a pointer to the function to be called when the PWM
//! generator interrupt occurs.
//!
//! This function will ensure that the interrupt.handler specified by
//! \e pfIntHandler is called when an interrupt is detected for the specified
//! PWM generator block.  This function will also enable the corresponding
//! PWM generator interrupt in the interrupt controller; individual generator
//! interrupts and interrupt sources must be enabled with PWMIntEnable() and
//! PWMGenIntTrigEnable().
//!
//! \sa IntRegister() for important information about registering interrupt
//! handlers.
//!
//! \return None.
//
//*****************************************************************************
void
PWMGenIntRegister(unsigned long ulBase, unsigned long ulGen,
                  void (*pfIntHandler)(void))
{
    unsigned long ulInt;

    //
    // Check the arguments.
    //
    ASSERT(ulBase == PWM_BASE);
    ASSERT((ulGen == PWM_GEN_0) || (ulGen == PWM_GEN_1) ||
           (ulGen == PWM_GEN_2));

    //
    // Get the interrupt number associated with the specified generator.
    //
    ulInt = INT_PWM0 + (ulGen >> 6) - 1;

    //
    // Register the interrupt.handler.
    //
    IntRegister(ulInt, pfIntHandler);

    //
    // Enable the PWMx interrupt.
    //
    IntEnable(ulInt);
}

//*****************************************************************************
//
//! Removes an interrupt.handler for the specified PWM generator block.
//!
//! \param ulBase is the base address of the PWM module.
//! \param ulGen is the PWM generator in question.
//!
//! This function will unregister the interrupt.handler for the specified
//! PWM generator block.  This function will also disable the corresponding
//! PWM generator interrupt in the interrupt controller; individual generator
//! interrupts and interrupt sources must be disabled with PWMIntDisable() and
//! PWMGenIntTrigDisable().
//!
//! \sa IntRegister() for important information about registering interrupt
//! handlers.
//!
//! \return None.
//
//*****************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品视频www在线观看| 欧美一区二区三区四区高清| 日韩在线一区二区三区| 国产欧美一区二区精品秋霞影院| 91美女视频网站| 国产酒店精品激情| 香蕉影视欧美成人| 1000精品久久久久久久久| 日韩限制级电影在线观看| www.欧美.com| 激情成人综合网| 午夜精品久久久久久久久久 | 99综合影院在线| 麻豆91精品91久久久的内涵| 亚洲免费电影在线| 国产精品丝袜黑色高跟| 精品播放一区二区| 91精品国产综合久久久久久久| 一本大道久久a久久综合婷婷| 国产原创一区二区| 久久精品国产一区二区三区免费看| 一区二区三区欧美| 国产精品国产三级国产| 欧美国产激情二区三区| 精品国产成人系列| 精品人伦一区二区色婷婷| 欧美日韩一区在线| 欧美性生活久久| 色婷婷综合久久久中文字幕| 99久久精品一区二区| 成人高清视频在线观看| 国产福利一区在线| 国产成人综合在线播放| 国产成人免费视频| 成人黄色软件下载| 成人深夜在线观看| av电影天堂一区二区在线观看| 高清免费成人av| 丁香激情综合国产| av电影在线观看不卡| va亚洲va日韩不卡在线观看| 成人91在线观看| 91在线观看视频| 色综合久久久网| 欧美影视一区二区三区| 欧美视频在线播放| 欧美肥妇free| 日韩美女视频一区二区在线观看| 91精品国产91热久久久做人人| 91精品国产一区二区三区| 欧美精品在线视频| 精品国产麻豆免费人成网站| 欧美刺激午夜性久久久久久久| 亚洲精品在线电影| 中文天堂在线一区| 亚洲精品成人悠悠色影视| 亚洲成人午夜电影| 久久精品72免费观看| 国产自产2019最新不卡| 99在线精品视频| 欧日韩精品视频| 欧美一级爆毛片| 国产视频一区二区三区在线观看| 亚洲国产精品传媒在线观看| 国产精品久久久久久久久免费樱桃 | 日韩和欧美一区二区三区| 日本午夜精品视频在线观看| 国产一区二区三区| 99久久国产免费看| 7777精品伊人久久久大香线蕉完整版| 精品国内二区三区| 亚洲精品国产a| 久久国产精品99精品国产| 高清不卡一区二区在线| 色成人在线视频| 538在线一区二区精品国产| 久久毛片高清国产| 亚洲精品成人精品456| 美脚の诱脚舐め脚责91| 成人91在线观看| 欧美一三区三区四区免费在线看| 久久精品亚洲国产奇米99| 亚洲一区在线观看免费观看电影高清| 久久97超碰色| 色香蕉成人二区免费| 337p日本欧洲亚洲大胆精品| 一级特黄大欧美久久久| 国产乱人伦偷精品视频不卡 | 国产精品亚洲人在线观看| 色婷婷狠狠综合| 久久综合久久鬼色中文字| 一区二区三区在线免费| 国产91丝袜在线播放九色| 欧美日韩午夜影院| 欧美激情一区二区三区蜜桃视频 | 欧美在线制服丝袜| 久久久久久黄色| 五月婷婷另类国产| 成人免费看黄yyy456| 欧美一区二区三区思思人| 亚洲婷婷综合久久一本伊一区| 九九视频精品免费| 欧美日韩精品一区二区三区四区| 日本一区二区三区在线不卡| 久久99精品国产麻豆婷婷| 欧美日韩日日骚| 一区二区三区中文字幕精品精品| 国产乱码精品一品二品| 精品三级在线观看| 丝瓜av网站精品一区二区| 色综合欧美在线视频区| 国产精品蜜臀av| 国产成人aaa| 精品成人在线观看| 玖玖九九国产精品| 欧美一级欧美三级| 欧美aaa在线| 欧美日韩国产一级| 亚洲国产精品天堂| 在线精品视频免费观看| 成人免费一区二区三区视频 | 另类成人小视频在线| 欧美人狂配大交3d怪物一区| 亚洲一区二区三区四区五区黄| 91污片在线观看| 日韩理论在线观看| 一道本成人在线| 亚洲精品菠萝久久久久久久| 一本色道a无线码一区v| 亚洲你懂的在线视频| 日本乱人伦aⅴ精品| 亚洲免费伊人电影| 在线视频一区二区免费| 亚洲综合视频网| 欧美亚洲综合在线| 亚洲国产精品久久久男人的天堂| 色婷婷综合视频在线观看| 亚洲在线观看免费视频| 欧美视频中文字幕| 日韩国产欧美视频| 日韩精品一区在线观看| 国产一区二区福利| 欧美国产激情二区三区| 99精品视频在线观看免费| 亚洲色图欧洲色图| 精品视频一区三区九区| 亚洲国产视频在线| 欧美一区二区三区在线视频| 久久精品国产999大香线蕉| 欧美成人激情免费网| 国产成人鲁色资源国产91色综| 国产精品你懂的| 91视视频在线观看入口直接观看www| 亚洲精品成人在线| 91精品国产综合久久福利软件| 精品午夜久久福利影院| 中文子幕无线码一区tr| 91福利社在线观看| 奇米888四色在线精品| 国产亚洲成aⅴ人片在线观看| 99久久久久免费精品国产| 午夜精品一区二区三区电影天堂| 日韩欧美亚洲国产另类| 国产高清精品在线| 一区二区三区在线不卡| 日韩免费视频一区二区| 成人高清免费观看| 午夜精品久久久久久久| 欧美精品一区二区三区久久久| 成人国产在线观看| 午夜精品福利在线| 国产亚洲欧美日韩日本| 色香蕉成人二区免费| 久久aⅴ国产欧美74aaa| 亚洲视频精选在线| 精品国产乱码久久久久久老虎 | 日韩一级黄色片| 99久久精品免费看国产| 日本不卡在线视频| 久久精工是国产品牌吗| 26uuu久久综合| 不卡av免费在线观看| 午夜亚洲福利老司机| 久久久亚洲精品一区二区三区| 91免费观看视频在线| 久久不见久久见中文字幕免费| 中文字幕亚洲一区二区va在线| 制服.丝袜.亚洲.中文.综合| 国产91丝袜在线18| 日韩av不卡一区二区| 国产精品国产自产拍高清av王其| 国产精品国产三级国产普通话三级 | 亚洲视频一区二区在线| 日韩丝袜美女视频| 在线免费观看一区| 国产精品2024| 麻豆精品在线视频| 亚洲第一av色| 一区二区三区中文字幕电影| 国产亚洲1区2区3区|