board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 INRIA
3  * 2015 Freie Universität Berlin
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
10 #ifndef BOARD_H
11 #define BOARD_H
12 
30 #include <stdint.h>
31 
32 #include "cpu.h"
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
41 #ifndef __MSP430F2617__
42 #define __MSP430F2617__
43 #endif
44 
49 #define XTIMER_WIDTH (16)
50 #define XTIMER_BACKOFF (40)
51 
58 #define MSP430_INITIAL_CPU_SPEED 8000000uL
59 #ifndef F_CPU
60 #define F_CPU MSP430_INITIAL_CPU_SPEED
61 #endif
62 #define F_RC_OSCILLATOR 32768
63 #define MSP430_HAS_DCOR 0
64 #define MSP430_HAS_EXTERNAL_CRYSTAL 1
65 
71 #define LED0_PIN GPIO_PIN(5, 4)
72 #define LED1_PIN GPIO_PIN(5, 6)
73 #define LED2_PIN GPIO_PIN(5, 5)
74 
75 #define LED_OUT_REG P5OUT
76 #define LED0_MASK (0x10)
77 #define LED1_MASK (0x40)
78 #define LED2_MASK (0x20)
79 
80 #define LED0_ON (LED_OUT_REG &=~LED0_MASK)
81 #define LED0_OFF (LED_OUT_REG |= LED0_MASK)
82 #define LED0_TOGGLE (LED_OUT_REG ^= LED0_MASK)
83 
84 #define LED1_ON (LED_OUT_REG &=~LED1_MASK)
85 #define LED1_OFF (LED_OUT_REG |= LED1_MASK)
86 #define LED1_TOGGLE (LED_OUT_REG ^= LED1_MASK)
87 
88 #define LED2_ON (LED_OUT_REG &=~LED2_MASK)
89 #define LED2_OFF (LED_OUT_REG |= LED2_MASK)
90 #define LED2_TOGGLE (LED_OUT_REG ^= LED2_MASK)
91 
97 #define BTN0_PIN GPIO_PIN(2, 5)
98 #define BTN0_MASK (0x20)
99 #define BTN0_MODE GPIO_IN
100 
101 #define BTN0_PRESSED ((BTN0_PIN & BTN0_MASK) == 0)
102 #define BTN0_RELEASED ((BTN0_PIN & BTN0_MASK) != 0)
103 
109 #define CC2420_PARAM_CS GPIO_PIN(P3, 0)
110 #define CC2420_PARAM_FIFO GPIO_PIN(P1, 3)
111 #define CC2420_PARAM_FIFOP GPIO_PIN(P1, 2)
112 #define CC2420_PARAM_CCA GPIO_PIN(P1, 4)
113 #define CC2420_PARAM_SFD GPIO_PIN(P4, 1)
114 #define CC2420_PARAM_VREFEN GPIO_PIN(P4, 5)
115 #define CC2420_PARAM_RESET GPIO_PIN(P4, 6)
116 
118 #ifdef __cplusplus
119 }
120 #endif
121 
123 #endif /* BOARD_H */