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_DEV (0)
52 #define XTIMER_CHAN (0)
53 #define XTIMER_WIDTH (16)
54 #define XTIMER_BACKOFF (40)
55 
62 #define MSP430_INITIAL_CPU_SPEED 8000000uL
63 #ifndef F_CPU
64 #define F_CPU MSP430_INITIAL_CPU_SPEED
65 #endif
66 #define F_RC_OSCILLATOR 32768
67 #define MSP430_HAS_DCOR 0
68 #define MSP430_HAS_EXTERNAL_CRYSTAL 1
69 
75 #define LED0_PIN GPIO_PIN(4, 0)
76 #define LED1_PIN GPIO_PIN(4, 1)
77 #define LED2_PIN GPIO_PIN(4, 2)
78 
79 #define LED_OUT_REG P5OUT
80 #define LED0_MASK (0x10)
81 #define LED1_MASK (0x20)
82 #define LED2_MASK (0x40)
83 
84 #define LED0_ON (LED_OUT_REG &=~LED0_MASK)
85 #define LED0_OFF (LED_OUT_REG |= LED0_MASK)
86 #define LED0_TOGGLE (LED_OUT_REG ^= LED0_MASK)
87 
88 #define LED1_ON (LED_OUT_REG &=~LED1_MASK)
89 #define LED1_OFF (LED_OUT_REG |= LED1_MASK)
90 #define LED1_TOGGLE (LED_OUT_REG ^= LED1_MASK)
91 
92 #define LED2_ON (LED_OUT_REG &=~LED2_MASK)
93 #define LED2_OFF (LED_OUT_REG |= LED2_MASK)
94 #define LED2_TOGGLE (LED_OUT_REG ^= LED2_MASK)
95 
101 #define USER_BTN_PxIN P2IN
102 #define USER_BTN_MASK 0x20
103 
104 #define USER_BTN_PRESSED ((USER_BTN_PxIN & USER_BTN_MASK) == 0)
105 #define USER_BTN_RELEASED ((USER_BTN_PxIN & USER_BTN_MASK) != 0)
106 
111 #define CC2420_PARAMS_BOARD {.spi = SPI_DEV(0), \
112  .spi_clk = SPI_CLK_5MHZ, \
113  .pin_cs = GPIO_PIN(P3, 0), \
114  .pin_fifo = GPIO_PIN(P1, 3), \
115  .pin_fifop = GPIO_PIN(P1, 2), \
116  .pin_cca = GPIO_PIN(P1, 4), \
117  .pin_sfd = GPIO_PIN(P4, 1), \
118  .pin_vrefen = GPIO_PIN(P4, 5), \
119  .pin_reset = GPIO_PIN(P4, 6)}
120 
121 #ifdef __cplusplus
122 }
123 #endif
124 
126 #endif /* BOARD_H */