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

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

?? f93x_sleepmode_smartclockwake.c

?? 芯科原廠所有c8051fxx程序的例子。
?? C
?? 第 1 頁 / 共 2 頁
字號:
//-----------------------------------------------------------------------------
// F93x_SleepMode_smaRTClockWake.c
//-----------------------------------------------------------------------------
// Copyright (C) 2007 Silicon Laboratories, Inc.
// http://www.silabs.com
//
// Program Description:
//
// This program flashes the red LED on the C8051F930 target board about
// five times a second using the interrupt handler for Timer2 when the
// MCU is awake.
//
// The smaRTClock is configured to generate a wake-up event every 2 seconds. 
// The device will toggle between Sleep/Suspend mode and Normal mode. In 
// the low power state, the Yellow LED will be turned on. 
//
// If a smaRTClock oscillator failure occurs, both LEDs will remain on
// and the device will be in a high power state.
//
// How To Test:
//
// 1) Download code to the 'F93x target board 
// 2) Ensure that pins 1-2, 3-4, 5-6, 7-8 are shorted together on the
//    J8 header
// 3) Run the program. The Red LED will blink when the device is awake.
//
//
// Target:         C8051F93x-C8051F92x
// Tool chain:     Generic
// Command Line:   None
//
// Release 1.0
//    -Initial Revision (FB)
//    -15 JAN 2007
//

//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include <compiler_defs.h>             // compiler declarations
#include <C8051F930_defs.h>            // SFR declarations

//-----------------------------------------------------------------------------
// Pin Declarations
//-----------------------------------------------------------------------------

SBIT (RED_LED,    SFR_P1, 5);          // '0' means ON, '1' means OFF
SBIT (YELLOW_LED, SFR_P1, 6);          // '0' means ON, '1' means OFF
SBIT (SW2,        SFR_P0, 2);          // SW2 == 0 means switch pressed
SBIT (SW3,        SFR_P0, 3);          // SW3 == 0 means switch pressed

//-----------------------------------------------------------------------------
// Global CONSTANTS
//-----------------------------------------------------------------------------

#define SYSCLK        20000000         // SYSCLK frequency in Hz
#define RTCCLK         32768           // smaRTClock frequency in Hz

#define WAKE_INTERVAL   2000           // Wakeup-interval in milliseconds

#define SUSPEND          0x40          // Value to write to PMU0CF to place
                                       // the device in Suspend mode

#define SLEEP            0x80          // Value to write to PMU0CF to place
                                       // the device in Sleep Mode

#define POWER_MODE      SUSPEND        // Select between Suspend and Sleep
                                       // mode. When debugging, if the 
                                       // MCU is stopped/halted while 
                                       // in Sleep Mode, the connection
                                       // to the IDE will be lost. The 
                                       // IDE connection will not be lost
                                       // if the MCU is stopped/halted 
                                       // while in suspend mode.
                                               
#define LED_ON           0
#define LED_OFF          1

#define CAPTURE0  0x00                 // RTC address of CAPTURE0 register
#define CAPTURE1  0x01                 // RTC address of CAPTURE1 register
#define CAPTURE2  0x02                 // RTC address of CAPTURE2 register
#define CAPTURE3  0x03                 // RTC address of CAPTURE3 register
#define RTC0CN    0x04                 // RTC address of RTC0CN register                
#define RTC0XCN   0x05                 // RTC address of RTC0XCN register 
#define RTC0XCF   0x06                 // RTC address of RTC0XCF register
#define RTC0PIN   0x07                 // RTC address of RTC0PIN register
#define ALARM0    0x08                 // RTC address of ALARM0 register
#define ALARM1    0x09                 // RTC address of ALARM1 register
#define ALARM2    0x0A                 // RTC address of ALARM2 register
#define ALARM3    0x0B                 // RTC address of ALARM3 register

//-----------------------------------------------------------------------------
// Function PROTOTYPES
//-----------------------------------------------------------------------------
void OSCILLATOR_Init (void);
void PORT_Init (void);
void Timer2_Init (int counts);

void RTC_Init (void);
unsigned char RTC_Read (unsigned char);
void RTC_Write (unsigned char, unsigned char);

//-----------------------------------------------------------------------------
// MAIN Routine
//-----------------------------------------------------------------------------
void main (void)
{
   U8 wakeup_source;
   
   PCA0MD &= ~0x40;                    // WDTE = 0 (clear watchdog timer
                                       // enable)

   PORT_Init ();                       // Initialize Port I/O
   OSCILLATOR_Init ();                 // Initialize Oscillator

   RTC_Init ();                        // Initialize RTC
   
   Timer2_Init (SYSCLK / 12 / 10);     // Init Timer2 to generate interrupts
                                       // at a 10 Hz rate.

   EA = 1;                             // Enable global interrupts
   
   //----------------------------------
   // Main Application Loop
   //----------------------------------
   while (1)
   {

      if(PMU0CF & 0x0C)                // Check if a smaRTClock Alarm or
      {                                // clock fail event has occured

         // Check for clock failure while the device is awake         
         if(PMU0CF & 0x08)
         {
            EA = 0;
            YELLOW_LED = LED_ON;
            RED_LED = LED_ON;  
            while(1);
         }

         // Configure the Port I/O for Sleep Mode 
         RED_LED = LED_OFF;            // Turn off the LED or other
                                       // high-current devices         
         
         
         // Place the device in Sleep Mode
         PMU0CF = 0x20;                // Clear all wake-up flags

         // Typically, a check on each non-persistent wake-up event source 
         // should be performed to ensure no transient event has occurred 
         // while the wake-up flags were being cleared. In this example,
         // we have 2 wake-up sources:
         //    A. smaRTClock Alarm - no need to check since they are spaced
         //                          several seconds apart.
         //    B. smaRTClock Oscillator Fail - no need to check since this
         //                          condition is persistent
                  
         // Turn on Yellow LED to indicate that we are in 
         // the low power mode
         YELLOW_LED = LED_ON;
            
         // Enable smaRTClock alarm and clock fail as wake-up sources 
         // and place the device in a low power mode
         PMU0CF = (POWER_MODE | 0x0C); 
                                
         
         //--------------------------------------------------------------------
         // Device Sleeping until the next smaRTClock alarm
         //--------------------------------------------------------------------
         
         // Turn off the Yellow LED to indicate that we are in the 
         // high power mode
         YELLOW_LED = LED_OFF;   

         // Read the wake-up source flags
         wakeup_source = PMU0CF & 0x1F;
 
         // Clear the wake-up source flags
         PMU0CF = 0x20;             
         
         //---------------------------
         // Decode the wakeup source
         //---------------------------   

         if(wakeup_source & 0x10)
         {
            // We have been awaken by the reset pin (most likely C2 traffic)
            EA = 0;
            YELLOW_LED = LED_ON;
            RED_LED = LED_ON;  
            while(1);
         }         

         if(wakeup_source & 0x08)
         {
            // We have been awaken by a smaRTClock oscillator failure
            EA = 0;
            YELLOW_LED = LED_ON;
            RED_LED = LED_ON;  
            while(1);
         }    

         if(wakeup_source & 0x04)
         {
            // We have been awaken by a smaRTClock alarm
         }

       

      }


   }                        
}

//-----------------------------------------------------------------------------
// Support Subroutines
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// RTC_Read ()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人在线电影| 久久精品亚洲一区二区三区浴池 | 色婷婷综合久久久中文字幕| 国产亚洲人成网站| 国产精品一区二区三区四区| 久久久久国产精品厨房| 国内精品嫩模私拍在线| 国产精品沙发午睡系列990531| 成人夜色视频网站在线观看| 综合av第一页| 欧美日韩国产精品自在自线| 麻豆精品一区二区av白丝在线| 日韩欧美国产午夜精品| 国产91露脸合集magnet| 国产精品国产三级国产三级人妇| 97精品久久久久中文字幕| 亚洲欧美激情插| 欧洲av在线精品| 久久99久久久欧美国产| 国产精品免费免费| 在线观看av一区二区| 日韩电影在线看| 国产午夜精品一区二区三区嫩草| 色综合久久66| 蜜臀av一区二区| 国产精品久久久久久久岛一牛影视 | 日韩一区二区精品| 国产一区二区精品在线观看| 欧美一区二区视频网站| 激情综合色播五月| 久久精品一二三| 欧美日本一区二区在线观看| 精品一区二区日韩| 亚洲天堂久久久久久久| 欧美日韩视频在线第一区| 国产一区二区三区在线观看免费 | 99精品欧美一区二区蜜桃免费 | 午夜av一区二区| 日韩精品一区二区三区蜜臀| av一区二区三区在线| 亚洲aaa精品| 中文字幕综合网| 欧美精品乱码久久久久久| 高潮精品一区videoshd| 午夜欧美在线一二页| 日韩一区二区三区精品视频| 色94色欧美sute亚洲线路一久| 日韩高清不卡在线| 亚洲欧洲中文日韩久久av乱码| 欧美偷拍一区二区| 成人高清伦理免费影院在线观看| 亚洲成人中文在线| 亚洲色图.com| 久久在线观看免费| 7777精品久久久大香线蕉| 国产成人亚洲综合色影视| 人人精品人人爱| 国产精品欧美综合在线| 欧美精品一区二区三区蜜臀| 99久久婷婷国产综合精品电影| 一区二区三区小说| 国产欧美一区二区精品忘忧草| 欧美巨大另类极品videosbest| 99re热视频这里只精品| 国内精品免费**视频| 蜜臀av一级做a爰片久久| 亚洲人成影院在线观看| 国产精品视频一二三区| 日韩一区二区三区视频在线| 欧美日韩国产在线观看| 91女人视频在线观看| 成人久久视频在线观看| 精品综合久久久久久8888| 免费的国产精品| 午夜视频在线观看一区二区| 国产精品盗摄一区二区三区| 久久综合999| 欧美丰满嫩嫩电影| 日韩欧美综合一区| 色综合天天综合| 91精品福利视频| 成人18视频日本| 91原创在线视频| 91丝袜呻吟高潮美腿白嫩在线观看| 懂色av一区二区在线播放| 国产精品一级二级三级| 国产成人三级在线观看| 国产精品538一区二区在线| 国产一区二区三区电影在线观看| 久久精品国产一区二区三区免费看| 另类小说一区二区三区| 久久精品国产99| 国产资源在线一区| 激情综合五月婷婷| 亚洲男人天堂av| 亚洲国产欧美在线| 亚洲天堂免费在线观看视频| 亚洲一区二区高清| 亚洲地区一二三色| 国产综合色精品一区二区三区| 国内久久婷婷综合| 成人黄色av网站在线| 不卡一卡二卡三乱码免费网站| 91亚洲精品一区二区乱码| 在线国产亚洲欧美| 日韩欧美亚洲国产另类| 精品99一区二区| 国产精品毛片大码女人 | 国产精品白丝在线| 亚洲视频免费观看| 日韩精品色哟哟| 久草这里只有精品视频| 成人av在线看| 91蜜桃传媒精品久久久一区二区| 欧美亚洲高清一区| 欧美一级二级在线观看| 中文字幕电影一区| 亚洲精品日韩综合观看成人91| 亚洲欧美区自拍先锋| 亚洲欧美偷拍三级| 日韩在线观看一区二区| 麻豆91精品91久久久的内涵| 成人一区二区视频| 在线视频欧美区| 亚洲精品一区二区三区香蕉| 亚洲国产精品精华液2区45| 亚洲bt欧美bt精品| 懂色av噜噜一区二区三区av| 91.麻豆视频| 国产色综合一区| 香蕉av福利精品导航| 国产麻豆精品久久一二三| 欧美色精品在线视频| 久久精品人人做| 午夜精品福利一区二区蜜股av| 国内精品写真在线观看| 在线不卡欧美精品一区二区三区| 久久久亚洲精品一区二区三区 | 亚洲精品国产无套在线观| 国内外精品视频| 欧美艳星brazzers| 中文字幕五月欧美| 日本在线不卡视频一二三区| 欧洲国内综合视频| 国产欧美在线观看一区| 激情综合网天天干| 欧美日韩国产经典色站一区二区三区 | 美女精品自拍一二三四| yourporn久久国产精品| 日韩欧美国产成人一区二区| 自拍偷拍亚洲综合| 免费观看成人鲁鲁鲁鲁鲁视频| 色妹子一区二区| 欧美国产1区2区| 韩国视频一区二区| 欧美一区二区成人| 亚洲一区二区四区蜜桃| 91福利在线播放| 中文字幕 久热精品 视频在线| 日韩成人免费电影| 91国偷自产一区二区开放时间 | 在线不卡a资源高清| 亚洲日本在线天堂| 91老师片黄在线观看| 欧美国产日韩亚洲一区| 国产美女视频91| 日韩精品一区二区三区三区免费| 日韩 欧美一区二区三区| 欧美性大战久久久久久久| 一区二区三区欧美| 91视频在线看| 亚洲一级二级在线| 色综合久久久久网| 一区二区欧美国产| 91色.com| 天天综合日日夜夜精品| 色久综合一二码| 亚洲国产日韩一级| 欧美日韩在线一区二区| 日日噜噜夜夜狠狠视频欧美人| 在线日韩国产精品| 午夜在线成人av| 在线观看一区日韩| 日韩电影一二三区| 欧美美女一区二区三区| 亚洲成a人片在线观看中文| 7777精品伊人久久久大香线蕉 | 国产剧情av麻豆香蕉精品| 日韩欧美综合一区| 国产一区二区久久| 国产亚洲污的网站| 99国产精品久久久久久久久久 | 国产美女在线精品| 亚洲欧洲精品天堂一级| 国产伦精一区二区三区| 国产精品另类一区| 不卡视频一二三四| 亚洲精品视频在线观看网站| 制服.丝袜.亚洲.中文.综合| 日本伊人色综合网|