evbconfig.h

来自「zigbee 协议堆栈 stack(简化协议)」· C头文件 代码 · 共 46 行

H
46
字号
/*
  V0.1 Initial Release   10/July/2006  RBR
  Port over Tmote        21/December/2006 RS
*/

#ifndef EVBCONFIG_H
#define EVBCONFIG_H

//todo: figure it out...dynamic memory allocation
//change these locations for different PIC18 Processors
//these segments are for the 4620
//#define HEAPSEGMENT 0x100
//#define NEIGHBORSEGMENT 0xB00

//other macros
#define NOP()               _NOP()#define RESET()             _RESET()
#define DISABLE_WDT()       (WDTCTL = (WDTPW | WDTHOLD))
#define FOSC 4000000    //internal clock frequency...MCLK for CPU...see DCO setting

/*
 * Leds configuration for the TMote Sky.
 */
#define led_red_on()        P5OUT &= ~(1<<(4))
#define led_green_on()      P5OUT &= ~(1<<(5))
#define led_blue_on()     P5OUT &= ~(1<<(6))
#define led_red_off()       P5OUT |= (1<<(4))
#define led_green_off()     P5OUT |= (1<<(5))
#define led_blue_off()    P5OUT |= (1<<(6))
#define led_red_toggle()    P5OUT ^= (1 << 4)
#define led_green_toggle()  P5OUT ^= (1 << 5)
#define led_blue_toggle() P5OUT ^= (1 << 6)
#define led_red_state()     ((P5OUT & (1<<(4))) ? FALSE : TRUE )
#define led_green_state()   ((P5OUT & (1<<(5))) ? FALSE : TRUE )
#define led_blue_state()  ((P5OUT & (1<<(6))) ? FALSE : TRUE )
#define led_init()     {  P5SEL &= 0xFF8F; P5DIR |= 0x0070; led_green_off(); led_red_off(); led_blue_off(); }

#define LED_CONFIG()\
{					\
  led_init(); 		\
}                    

#endif

⌨️ 快捷键说明

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