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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? landzo

?? 【開源】線性CCD自適應(yīng)性算法攻略
??
字號:
/*
 * File:        pmc.c
 * Purpose:     Provides routines for entering low power modes.
 *
 * Notes:	Since the wakeup mechanism for low power modes
 *              will be application specific, these routines
 *              do not include code to setup interrupts to exit
 *              from the low power modes. The desired means of
 *              low power mode exit should be configured before
 *              calling any of these functions.
 *
 *              These routines do not include protection to
 *              prevent illegal state transitions in the mode
 *              controller, and all routines that write to the
 *              PMPROT register write a value to allow all
 *              possible low power modes (it is write once, so
 *              if only the currently requested mode is enabled
 *              a different mode couldn't be enabled later on).
 *
 */

#include "common.h"
#include "pmc.h"
#include "mcg.h"


/********************************************************************/
/* WAIT mode entry routine. Puts the processor into wait mode.
 * In this mode the core clock is disabled (no code executing), but
 * bus clocks are enabled (peripheral modules are operational).
 *
 * Mode transitions:
 * RUN -> WAIT
 * VLPR -> VLPW
 *
 * This function can be used to enter normal wait mode or VLPW
 * mode. If you are executing in normal run mode when calling this
 * function, then you will enter normal wait mode. If you are in VLPR
 * mode when calling this function, then you will enter VLPW mode instead.
 *
 * NOTE: Some modules include a programmable option to disable them in
 * wait mode. If those modules are programmed to disable in wait mode,
 * they will not be able to generate interrupts to wake up the core.
 *
 * WAIT mode is exited using any enabled interrupt or RESET, so no
 * exit_wait routine is needed.
 *
 * If in VLPW mode, the statue of the MC_PMCTRL[LPWUI] bit determines if
 * the processor exits to VLPR (LPWUI cleared) or normal run mode (LPWUI
 * set). The enable_lpwui() and disable_lpwui()functions can be used to set
 * this bit to the desired option prior to calling enter_wait().
 *
 *
 * Parameters:
 * none
 */
void enter_wait(void)
{
    wait();
}
/********************************************************************/
/* STOP mode entry routine. Puts the processor into normal stop mode.
 * In this mode core, bus and peripheral clocks are disabled.
 *
 * Mode transitions:
 * RUN -> STOP
 * VLPR -> VLPS
 *
 * This function can be used to enter normal stop mode or VLPS
 * mode. If you are executing in normal run mode when calling this
 * function, then you will enter normal stop mode. If you are in VLPR
 * mode when calling this function, then you will enter VLPS mode instead.
 *
 * STOP mode is exited using any enabled interrupt or RESET, so no
 * exit_stop routine is needed.
 *
 * Parameters:
 * none
 */
void enter_stop(void)
{
    /* Set the LPLLSM field to 0b000 for normal STOP mode - Need to retain state of LPWUI bit 8 */
    MC_PMCTRL =  MC_PMCTRL_LPLLSM(0);           // set LPLLSM = 0b000
    stop();
}
/********************************************************************/
/* VLPR mode entry routine. Puts the processor into very low power
 * run mode. In this mode all clocks are enabled, but the core, bus,
 * and peripheral clocks are limited to 2MHz or less. The flash
 * clock is limited to 1MHz or less.
 *
 * Mode transitions:
 * RUN -> VLPR
 *
 * exit_vlpr() function or an interrupt with LPWUI set can be used
 * to switch from VLPR back to RUN. The enable_lpwui() and disable_lpwui()
 * functions can be used to set LPWUI to the desired option prior to
 * calling enter_vlpr().
 *
 * Parameters:
 * none
 */
void enter_vlpr(char lpwui_value)
{

    /* Reduce system clock to < 2MHz */
    printf("\n\n\n To communicate in VLPR - Auto-Trim must have been done, then Change Baud Rate to 19200 baud NOW !!!! \n\r");
    mcg_pee_2_blpi();
    SIM_CLKDIV1  =  0x13330000;    //(SIM_CLKDIV1_OUTDIV1(1) | SIM_CLKDIV1_OUTDIV2(3) \
    // SIM_CLKDIV1_OUTDIV3(3) | SIM_CLKDIV1_OUTDIV4(3));
    //core = /2 bus = /4 =flex bus /4 flash clk /4

    /* Set the RUNM field to 0b10 for VLPR mode - Need to retain state of LPWUI bit 8 */
    /* Set the LPLLSM field to 0b010 for VLPS mode - Need to set state of LPWUI bit 8 */
    if(lpwui_value)
    {
        MC_PMCTRL = (MC_PMCTRL_LPWUI_MASK       // set LPWUI
                     | MC_PMCTRL_RUNM(2));       // set RUNM = 0b10

    }
    else
    {
        MC_PMCTRL = (!MC_PMCTRL_LPWUI_MASK            // clear LPWUI
                     | MC_PMCTRL_RUNM(2));             // set RUNM = 0b10
    }

    /* Wait for VLPS regulator mode to be confirmed */
    while(!(PMC_REGSC & PMC_REGSC_VLPRS_MASK));    // 0 MCU is not in VLPR mode
    // 1 MCU is in VLPR mode
}
/********************************************************************/
/* VLPR mode exit routine. Puts the processor into normal run mode
 * from VLPR mode. You can transition from VLPR to normal run using
 * this function or an interrupt with LPWUI set. The enable_lpwui()
 * and disable_lpwui() functions can be used to set LPWUI to the
 * desired option prior to calling enter_vlpr().
 *
 * Mode transitions:
 * VLPR -> RUN
 *
 * Parameters:
 * none
 */
void exit_vlpr(void)
{
    /* Clear RUNM */
    MC_PMCTRL &= ~(MC_PMCTRL_RUNM(0x3));

    /* Wait for normal RUN regulation mode to be confirmed */
    while (PMC_REGSC & PMC_REGSC_VLPRS_MASK); // 0 MCU is not in VLPR mode
    // 1 MCU is in VLPR mode
    while(!(PMC_REGSC & PMC_REGSC_REGONS_MASK));

    /* Transition MCG back to the PLL enabled state */
    mcg_blpi_2_pee();
    //sim_clkdivided back to default
    SIM_CLKDIV1 = 0x00110000;   //(SIM_CLKDIV1_OUTDIV1(1) | SIM_CLKDIV1_OUTDIV2(3) \
    // SIM_CLKDIV1_OUTDIV3(3) | SIM_CLKDIV1_OUTDIV4(3));
    //core = /1 bus = /1 =flex bus /2 flash clk /2
}
/********************************************************************/
/* VLPS mode entry routine. Puts the processor into VLPS mode directly
 * from normal run mode.
 *
 * Mode transitions:
 * RUN -> VLPS
 *
 * If VLPS mode is entered directly from normal RUN mode, then the
 * LPWUI bit is forced to 1 by hardware. This means that when an
 * interrupt occurs you will exit to normal run mode instead of VLPR.
 *
 * If however VLPS mode is entered from VLPR the state of the LPWUI bit
 * determines the state the MCU will return to upon exit from VLPS.If LPWUI is set
 * and an interrupt occurs you will exit to normal run mode instead of VLPR.
 * If LPWUI is clear and an interrupt occurs you will exit to VLPR.
 *
 * Parameters:  value of LPWUI
 * none
 */
void enter_vlps(char lpwui_value)
{
    /* Write to PMPROT to allow VLPS power modes */
    MC_PMPROT = MC_PMPROT_AVLP_MASK;   // write oneif not all set make sure all enabled
    //this write-once bit allows the MCU to enter the
    //very low power modes: VLPR, VLPW, and VLPS.

    /* Reduce system clock to < 2MHz */
    //   mcg_pee_2_blpi();    // you don't need to chage to lower frequency for VLPS

    /* Set the LPLLSM field to 0b010 for VLPS mode - Need to set state of LPWUI bit 8 */
    if(lpwui_value)
    {
        MC_PMCTRL = (MC_PMCTRL_LPWUI_MASK            // set LPWUI
                     | MC_PMCTRL_LPLLSM(2));           // set LPLLSM = 0b10
    }
    else
    {
        MC_PMCTRL = (!MC_PMCTRL_LPWUI_MASK           // set LPWUI
                     | MC_PMCTRL_LPLLSM(2));           // set LPLLSM = 0b10
    }
    /* Now execute the stop instruction to go into VLPS */
    stop();
}
/********************************************************************/
/* LLS mode entry routine. Puts the processor into LLS mode from
 * normal run mode or VLPR.
 *
 * Mode transitions:
 * RUN -> LLS
 * VLPR -> LLS
 *
 * NOTE: LLS mode will always exit to RUN mode even if you were
 * in VLPR mode before entering LLS.
 *
 * Wakeup from LLS mode is controlled by the LLWU module. Most
 * modules cannot issue a wakeup interrupt in LLS mode, so make
 * sure to setup the desired wakeup sources in the LLWU before
 * calling this function.
 *
 * Parameters:
 * none
 */
void enter_lls(void)
{
    /* Write to PMPROT to allow LLS power modes */
    MC_PMPROT = MC_PMPROT_ALLS_MASK;   //this write-once bit allows the MCU to enter the
    //LLS low power mode


    /* Set the LPLLSM field to 0b011 for LLS mode  */
    MC_PMCTRL  =  MC_PMCTRL_LPLLSM(3);           // set LPLLSM = 0b11

    /* Now execute the stop instruction to go into LLS */
    stop();
}
/********************************************************************/
/* VLLS3 mode entry routine. Puts the processor into VLLS3 mode from
 * normal run mode or VLPR.
 *
 * Mode transitions:
 * RUN -> VLLS3
 * VLPR -> VLLS3
 *
 * NOTE: VLLSx modes will always exit to RUN mode even if you were
 * in VLPR mode before entering VLLSx.
 *
 * Wakeup from VLLSx mode is controlled by the LLWU module. Most
 * modules cannot issue a wakeup interrupt in VLLSx mode, so make
 * sure to setup the desired wakeup sources in the LLWU before
 * calling this function.
 *
 * Parameters:
 * none
 */
void enter_vlls3(void)
{
    /* Write to PMPROT to allow VLLS3 power modes */
    MC_PMPROT = MC_PMPROT_AVLLS3_MASK;

    /* Set the LPLLSM field to 0b101 for VLLS3 mode  */
    MC_PMCTRL =  MC_PMCTRL_LPLLSM(5);           // set LPLLSM = 0b101

    /* Now execute the stop instruction to go into VLLS3 */
    stop();
}
/********************************************************************/
/* VLLS2 mode entry routine. Puts the processor into VLLS2 mode from
 * normal run mode or VLPR.
 *
 * Mode transitions:
 * RUN -> VLLS2
 * VLPR -> VLLS2
 *
 * NOTE: VLLSx modes will always exit to RUN mode even if you were
 * in VLPR mode before entering VLLSx.
 *
 * Wakeup from VLLSx mode is controlled by the LLWU module. Most
 * modules cannot issue a wakeup interrupt in VLLSx mode, so make
 * sure to setup the desired wakeup sources in the LLWU before
 * calling this function.
 *
 * Parameters:
 * none
 */
void enter_vlls2(void)
{
    /* Write to PMPROT to allow VLLS2 power modes */
    MC_PMPROT = MC_PMPROT_AVLLS2_MASK;

    /* Set the LPLLSM field to 0b110 for VLLS2 mode */
    MC_PMCTRL =  MC_PMCTRL_LPLLSM(6);           // set LPLLSM = 0b110

    /* Now execute the stop instruction to go into VLLS2 */
    stop();
}
/********************************************************************/
/* VLLS1 mode entry routine. Puts the processor into VLLS1 mode from
 * normal run mode or VLPR.
 *
 * Mode transitions:
 * RUN -> VLLS1
 * VLPR -> VLLS1
 *
 * NOTE: VLLSx modes will always exit to RUN mode even if you were
 * in VLPR mode before entering VLLSx.
 *
 * Wakeup from VLLSx mode is controlled by the LLWU module. Most
 * modules cannot issue a wakeup interrupt in VLLSx mode, so make
 * sure to setup the desired wakeup sources in the LLWU before
 * calling this function.
 *
 * Parameters:
 * none
 */
void enter_vlls1(void)
{
    /* Write to PMPROT to allow all possible power modes */
    MC_PMPROT = MC_PMPROT_AVLLS1_MASK;

    /* Set the LPLLSM field to 0b111 for VLLS1 mode  */
    MC_PMCTRL =  MC_PMCTRL_LPLLSM(7);           // set LPLLSM = 0b111

    /* Now execute the stop instruction to go into VLLS1 */
    stop();
}
/********************************************************************/
/* Enable low power wake up on interrupt. This function can be used
 * to set the LPWUI bit. When this bit is set VLPx modes will exit
 * to normal run mode. When this bit is cleared VLPx modes will exit
 * to VLPR mode.
 *
 * The disable_lpwui() function can be used to clear the LPWUI bit.
 *
 * Parameters:
 * none
 */



void enable_lpwui(void)
{
    MC_PMCTRL |= MC_PMCTRL_LPWUI_MASK;
}
/********************************************************************/
/* Disable low power wake up on interrupt. This function can be used
 * to clear the LPWUI bit. When this bit is set VLPx modes will exit
 * to normal run mode. When this bit is cleared VLPx modes will exit
 * to VLPR mode.
 *
 * The enable_lpwui() function can be used to set the LPWUI bit.
 *
 * Parameters:
 * none
 */
void disable_lpwui(void)
{
    MC_PMCTRL &= ~MC_PMCTRL_LPWUI_MASK;
}
/********************************************************************/
/* entry mode variable is set to one of the valid settings following
 000 Normal stop
 001 Reserved
 010 Very low power stop (VLPS)
 011 Low leakage stop (LLS)
 100 Reserved
 101 Very low leakage stop 3 (VLLS3)
 110 Very low leakage stop 2 (VLLS2)
 111 Very low leakage stop 1 (VLLS1)
*/
/********************************************************************/
void enter_stop_mode(char mode)
{
    printf("\n-------------------------------------\n");
    printf("  MC_Enter Low Power Modes Utility    \n");
    printf("--------------------------------------\n");

    MC_PMPROT = 0x37;               //This value enables all possible power modes.

    MC_PMCTRL = MC_PMCTRL_LPWUI_MASK | MC_PMCTRL_LPLLSM(mode) ;
    stop();
}



?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品综合久久久久久8888| 精品亚洲国产成人av制服丝袜| 91精品国产全国免费观看| jizzjizzjizz欧美| 日本不卡视频一二三区| 亚洲视频在线一区观看| 日韩免费电影一区| 欧美在线视频日韩| 成人国产一区二区三区精品| 免费在线一区观看| 一区二区三区中文字幕精品精品 | 久久精品99久久久| 亚洲色图在线播放| 久久精品欧美日韩精品 | 亚洲色图欧洲色图婷婷| 久久久久久毛片| 91精品国产91久久综合桃花 | 国产一区二区视频在线| 成人深夜福利app| 国产精品一品二品| 久久精品国产免费| 日本人妖一区二区| 亚洲成精国产精品女| 亚洲免费观看高清完整版在线| 国产欧美日韩综合| 国产亚洲人成网站| 精品久久久久久久久久久久久久久 | 日韩一区精品字幕| 亚洲一线二线三线久久久| 亚洲欧洲精品一区二区三区不卡| 久久美女艺术照精彩视频福利播放| 欧美一区二区福利视频| 欧美日韩国产高清一区| 欧美日韩一区二区不卡| 欧美亚洲丝袜传媒另类| 在线区一区二视频| 欧美日韩一二三| 欧美另类高清zo欧美| 欧美日韩国产一级| 欧美日韩日日摸| 欧美一区2区视频在线观看| 91精品国产丝袜白色高跟鞋| 欧美日韩国产小视频在线观看| 精品视频一区二区不卡| 欧美精品乱码久久久久久| 欧美日韩在线观看一区二区| 7777精品伊人久久久大香线蕉经典版下载 | 国产美女视频91| 国产麻豆一精品一av一免费| 国内精品在线播放| 国产成a人亚洲精品| 波多野结衣中文字幕一区二区三区 | 麻豆国产精品视频| 国产精品白丝av| 成人免费高清在线| 色综合欧美在线视频区| 欧美伊人久久大香线蕉综合69| 欧美色图12p| 日韩欧美国产小视频| 国产亚洲精品中文字幕| 国产精品夫妻自拍| 亚洲永久免费视频| 美国三级日本三级久久99 | 国产精品亚洲一区二区三区在线| 国产美女娇喘av呻吟久久| 成人a级免费电影| 欧美性感一类影片在线播放| 日韩一区二区影院| 欧美国产成人精品| 亚洲国产aⅴ天堂久久| 久久99久久久久久久久久久| 国产不卡视频在线播放| 一本一道久久a久久精品| 日韩无一区二区| 国产精品国产三级国产三级人妇| 亚洲高清一区二区三区| 国产在线播放一区| 色八戒一区二区三区| 日韩亚洲欧美中文三级| 中文字幕在线播放不卡一区| 日韩不卡一区二区| 国产成人无遮挡在线视频| 欧美综合色免费| 精品福利在线导航| 亚洲国产精品久久不卡毛片| 国产一区二区三区黄视频| 欧美三级视频在线| 国产日韩欧美精品一区| 亚洲黄一区二区三区| 国内精品自线一区二区三区视频| 一本色道a无线码一区v| 精品88久久久久88久久久 | 高清视频一区二区| 91麻豆精品国产91久久久使用方法| 久久久久国产精品麻豆ai换脸| 亚洲成av人片一区二区| 成人自拍视频在线| 日韩欧美国产午夜精品| 一区二区三区国产精品| 处破女av一区二区| 亚洲精品一线二线三线| 亚洲成人资源在线| 91原创在线视频| 久久久久久久久久久久电影 | 成人av网站在线观看免费| 91精品国产免费| 亚洲品质自拍视频| 国产精品一卡二卡| 日韩欧美视频在线| 亚洲国产另类精品专区| 成人激情黄色小说| 国产日产欧美一区二区视频| 美腿丝袜在线亚洲一区 | 亚洲欧洲日韩一区二区三区| 美脚の诱脚舐め脚责91| 欧美美女网站色| 亚洲精品国产精品乱码不99| 国产91丝袜在线18| 精品国产123| 极品少妇xxxx精品少妇| 69堂国产成人免费视频| 亚洲成人综合视频| 在线观看91视频| 亚洲精品高清视频在线观看| 丁香激情综合五月| 中文字幕av资源一区| 国产成人综合精品三级| 久久综合九色综合97婷婷 | 久久国产精品无码网站| 69成人精品免费视频| 天天影视涩香欲综合网| 欧美日韩一区不卡| 亚洲成人av一区二区三区| 欧美性猛交xxxx乱大交退制版| 亚洲自拍偷拍欧美| 欧美丰满嫩嫩电影| 日韩av网站免费在线| 欧美伦理影视网| 男女性色大片免费观看一区二区| 欧美一级日韩一级| 久久精品国产精品亚洲综合| 欧美一区二区日韩一区二区| 麻豆精品一区二区三区| 久久综合九色综合97婷婷| 国内精品久久久久影院一蜜桃| 欧美成人一区二区三区| 美女精品自拍一二三四| 久久久噜噜噜久噜久久综合| 国产精品一二三区在线| 国产精品国产三级国产普通话99| 一本色道久久加勒比精品| 亚洲综合免费观看高清完整版| 在线看一区二区| 青娱乐精品在线视频| 久久欧美一区二区| 成人av网址在线观看| 亚洲一区二区三区四区在线观看 | 欧美一级日韩一级| 国产福利精品导航| 亚洲精品亚洲人成人网| 在线观看91精品国产入口| 蜜臀va亚洲va欧美va天堂| 国产偷国产偷亚洲高清人白洁| 成人av在线资源网| 亚洲国产精品影院| 久久―日本道色综合久久| 99久久免费视频.com| 午夜视频在线观看一区二区三区| 欧美成人女星排名| 波多野结衣中文字幕一区二区三区 | 国产精品夫妻自拍| 欧美人xxxx| 国产盗摄精品一区二区三区在线| 亚洲欧洲一区二区在线播放| 欧美一区二区三区男人的天堂| 国产精品1区二区.| 亚洲一区在线看| 久久久影视传媒| 在线观看网站黄不卡| 国产麻豆视频精品| 一区二区三区日韩精品| 精品剧情v国产在线观看在线| eeuss影院一区二区三区| 午夜av一区二区三区| 欧美韩日一区二区三区四区| 欧美日韩色一区| 成人午夜电影网站| 日本不卡123| 亚洲婷婷在线视频| 精品国产免费人成在线观看| 色婷婷久久久综合中文字幕| 精品一区二区综合| 亚洲一区二区在线免费看| 国产日韩欧美综合一区| 欧美一区二区三区影视| 91麻豆精品视频| 国产成人精品亚洲日本在线桃色| 天天做天天摸天天爽国产一区| 国产精品天干天干在线综合| 日韩天堂在线观看|