⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ledswitch.c

📁 ti-Chipcon CC1010 1G以下Soc应用开发源码实例。包括rf,powermodes,clockmodes,flashRW,interrupts,timer,pwm,uart...所有底
💻 C
字号:
/*****************************************************************************
 *                                                                           *
 *        **********                                                         *
 *       ************                                                        *
 *      ***        ***                                                       *
 *      ***   +++   ***                                                      *
 *      ***   + +   ***                                                      *
 *      ***   +                    CHIPCON CC1010 EXAMPLE PROGRAM            *
 *      ***   + +   ***               GENERAL PURPOSE I/0 PINS               *
 *      ***   +++   ***                                                      *
 *      ***       ***                                                        *
 *       ***********                                                         *
 *        *********                                                          *
 *                                                                           *
 *****************************************************************************
 * This program demonstrates the use of general purpose I/O pins (Port 0-3)  *
 *                                                                           *
 * A closed EB switch will set the connected port bit to logical 0. When     *
 * open, pull-up resistors set it to logical one. The SWx_PRESSED macros     *
 * invert this value.                                                        *
 *****************************************************************************
 * Author:              TEL, JOL                                             *
 *****************************************************************************
 * Revision history:                                                         *
 * 1.0  2002/08/29      First Public Release                                 *
 *                                                                           *
 * $Log: ledSwitch.c,v $
 * Revision 1.2  2002/11/18 10:58:49  kht
 * Added startup macros, added disabling of watchdog
 *
 * Revision 1.1  2002/10/14 09:26:46  tos
 * Initial version in CVS.
 *
 *                                                                           *
 ****************************************************************************/
#include <chipcon/hal.h>
#include <chipcon/cc1010eb.h>


//----------------------------------------------------------------------------
//  MAIN PROGRAM
//----------------------------------------------------------------------------
void main(void) {
    
    // Disable watchdog timer
    WDT_ENABLE(FALSE);

    // Startup macros for speed and low power consumption
    MEM_NO_WAIT_STATES();
    FLASH_SET_POWER_MODE(FLASH_STANDBY_BETWEEN_READS);
   
    // Enable the LEDs
    RLED_OE(TRUE);
    YLED_OE(TRUE);
    GLED_OE(TRUE);
    BLED_OE(TRUE);
    
    // Loop forever
    while (TRUE) {
        RLED = SW1_PRESSED;
        YLED = SW2_PRESSED;
        GLED = SW3_PRESSED;
        BLED = SW4_PRESSED;
   }
} // main

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -