The friendly Operating System for the Internet of Things
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 Z1_BOARD_H
11 #define Z1_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 
63 #define MSP430_INITIAL_CPU_SPEED 8000000uL
64 #ifndef F_CPU
65 #define F_CPU MSP430_INITIAL_CPU_SPEED
66 #endif
67 #define F_RC_OSCILLATOR 32768
68 #define MSP430_HAS_DCOR 0
69 #define MSP430_HAS_EXTERNAL_CRYSTAL 1
70 
76 #define LED0_PIN GPIO_PIN(4, 0)
77 #define LED1_PIN GPIO_PIN(4, 1)
78 #define LED2_PIN GPIO_PIN(4, 2)
79 
80 #define LED_OUT_REG P5OUT
81 #define LED0_MASK (0x10)
82 #define LED1_MASK (0x20)
83 #define LED2_MASK (0x40)
84 
85 #define LED0_ON (LED_OUT_REG &=~LED0_MASK)
86 #define LED0_OFF (LED_OUT_REG |= LED0_MASK)
87 #define LED0_TOGGLE (LED_OUT_REG ^= LED0_MASK)
88 
89 #define LED1_ON (LED_OUT_REG &=~LED1_MASK)
90 #define LED1_OFF (LED_OUT_REG |= LED1_MASK)
91 #define LED1_TOGGLE (LED_OUT_REG ^= LED1_MASK)
92 
93 #define LED2_ON (LED_OUT_REG &=~LED2_MASK)
94 #define LED2_OFF (LED_OUT_REG |= LED2_MASK)
95 #define LED2_TOGGLE (LED_OUT_REG ^= LED2_MASK)
96 
103 #define USER_BTN_PxIN P2IN
104 #define USER_BTN_MASK 0x20
105 
106 #define USER_BTN_PRESSED ((USER_BTN_PxIN & USER_BTN_MASK) == 0)
107 #define USER_BTN_RELEASED ((USER_BTN_PxIN & USER_BTN_MASK) != 0)
108 
113 #define CC2420_PARAMS_BOARD {.spi = SPI_DEV(0), \
114  .spi_clk = SPI_CLK_5MHZ, \
115  .pin_cs = GPIO_PIN(P3, 0), \
116  .pin_fifo = GPIO_PIN(P1, 3), \
117  .pin_fifop = GPIO_PIN(P1, 2), \
118  .pin_cca = GPIO_PIN(P1, 4), \
119  .pin_sfd = GPIO_PIN(P4, 1), \
120  .pin_vrefen = GPIO_PIN(P4, 5), \
121  .pin_reset = GPIO_PIN(P4, 6)}
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
128 #endif /* Z1_BOARD_H */