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

📄 rf040b.h

📁 SOS操作系统用于无线传感器网络节点的源代码
💻 H
字号:
#ifndef RF_040_B
#define RF_040_B
#include "hal.h"
/******************************************************************************
* LED
*
* LED1 = GLED (green)
* LED2 = RLED (red)
* LED3 = YLED (yellow)
* LED4 = BLED (blue)
*
* LED2 and LED4 are not connected to CC2430
******************************************************************************/
#define LED_OFF 1
#define LED_ON  0


#define LED1          P1_0
#define LED3          P1_3
//#define LED2          P1_2
//#define LED4          P1_4


#define GLED          LED1
#define YLED          LED3
//#define RLED          LED2
//#define BLED          LED4

#define INIT_LED1()      do { LED1 = LED_OFF; IO_DIR_PORT_PIN(1, 0, IO_OUT); P1SEL &= ~0x01;} while (0)
#define INIT_LED3()      do { LED3 = LED_OFF; IO_DIR_PORT_PIN(1, 3, IO_OUT); P1SEL &= ~0x08;} while (0)
//#define INIT_LED2()      do { LED2 = LED_OFF; IO_DIR_PORT_PIN(1, 2, IO_OUT); P1SEL &= ~0x01;} while (0)
//#define INIT_LED4()      do { LED4 = LED_OFF; IO_DIR_PORT_PIN(1, 4, IO_OUT); P1SEL &= ~0x08;} while (0)


#define INIT_GLED()      INIT_LED1()
#define INIT_YLED()      INIT_LED3()
//#define INIT_RLED()      INIT_LED2()
//#define INIT_BLED()      INIT_LED4()

#define SET_LED1()  (LED1 = LED_ON)
#define SET_LED3()  (LED3 = LED_ON)

#define SET_GLED()  (GLED = LED_ON)
#define SET_YLED()  (YLED = LED_ON)
//#define SET_RLED()  (RLED = LED_ON)
//#define SET_BLED()  (BLED = LED_ON)

#define CLR_LED1()  (LED1 = LED_OFF)
#define CLR_LED3()  (LED3 = LED_OFF)

#define CLR_GLED()  (GLED = LED_OFF)
#define CLR_YLED()  (YLED = LED_OFF)
//#define CLR_RLED()  (RLED = LED_OFF)
//#define CLR_BLED()  (BLED = LED_OFF)

#define SET_LED_MASK( n )                            \
    do {                                             \
        if ((n) & 0x01) SET_LED1(); else CLR_LED1(); \
        if ((n) & 0x04) SET_LED3(); else CLR_LED3(); \
    } while (0)

#endif

⌨️ 快捷键说明

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