z1/include/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 
32 #include <stdint.h>
33 
34 #include "cpu.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
43 #ifndef __MSP430F2617__
44 #define __MSP430F2617__
45 #endif
46 
51 #define XTIMER_WIDTH (16)
52 #define XTIMER_BACKOFF (40)
53 
60 #define MSP430_INITIAL_CPU_SPEED 8000000uL
61 #ifndef F_CPU
62 #define F_CPU MSP430_INITIAL_CPU_SPEED
63 #endif
64 #define F_RC_OSCILLATOR 32768
65 #define MSP430_HAS_DCOR 0
66 #define MSP430_HAS_EXTERNAL_CRYSTAL 1
67 
73 #define LED0_PIN GPIO_PIN(4, 0)
74 #define LED1_PIN GPIO_PIN(4, 1)
75 #define LED2_PIN GPIO_PIN(4, 2)
76 
77 #define LED_OUT_REG P5OUT
78 #define LED0_MASK (0x10)
79 #define LED1_MASK (0x20)
80 #define LED2_MASK (0x40)
81 
82 #define LED0_ON (LED_OUT_REG &=~LED0_MASK)
83 #define LED0_OFF (LED_OUT_REG |= LED0_MASK)
84 #define LED0_TOGGLE (LED_OUT_REG ^= LED0_MASK)
85 
86 #define LED1_ON (LED_OUT_REG &=~LED1_MASK)
87 #define LED1_OFF (LED_OUT_REG |= LED1_MASK)
88 #define LED1_TOGGLE (LED_OUT_REG ^= LED1_MASK)
89 
90 #define LED2_ON (LED_OUT_REG &=~LED2_MASK)
91 #define LED2_OFF (LED_OUT_REG |= LED2_MASK)
92 #define LED2_TOGGLE (LED_OUT_REG ^= LED2_MASK)
93 
99 #define BTN0_PIN P2IN
100 #define BTN0_MASK (0x20)
101 #define BTN0_MODE GPIO_IN
102 
103 #define BTN0_PRESSED ((BTN0_PIN & BTN0_MASK) == 0)
104 #define BTN0_RELEASED ((BTN0_PIN & BTN0_MASK) != 0)
105 
110 #define CC2420_PARAMS_BOARD {.spi = SPI_DEV(0), \
111  .spi_clk = SPI_CLK_5MHZ, \
112  .pin_cs = GPIO_PIN(P3, 0), \
113  .pin_fifo = GPIO_PIN(P1, 3), \
114  .pin_fifop = GPIO_PIN(P1, 2), \
115  .pin_cca = GPIO_PIN(P1, 4), \
116  .pin_sfd = GPIO_PIN(P4, 1), \
117  .pin_vrefen = GPIO_PIN(P4, 5), \
118  .pin_reset = GPIO_PIN(P4, 6)}
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
125 #endif /* BOARD_H */