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 #pragma once
11 
29 #include <stdint.h>
30 
31 #include "cpu.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
40 #ifndef __MSP430F2617__
41 #define __MSP430F2617__
42 #endif
43 
48 #define XTIMER_WIDTH (16)
49 #define XTIMER_BACKOFF (40)
56 #define CONFIG_ZTIMER_USEC_ADJUST_SET (99)
57 #define CONFIG_ZTIMER_USEC_ADJUST_SLEEP (100)
64 #define LED0_PIN GPIO_PIN(5, 4)
65 #define LED1_PIN GPIO_PIN(5, 6)
66 #define LED2_PIN GPIO_PIN(5, 5)
67 
68 #define LED_OUT_REG P5OUT
69 #define LED0_MASK (0x10)
70 #define LED1_MASK (0x40)
71 #define LED2_MASK (0x20)
72 
73 #define LED0_ON (LED_OUT_REG &=~LED0_MASK)
74 #define LED0_OFF (LED_OUT_REG |= LED0_MASK)
75 #define LED0_TOGGLE (LED_OUT_REG ^= LED0_MASK)
76 
77 #define LED1_ON (LED_OUT_REG &=~LED1_MASK)
78 #define LED1_OFF (LED_OUT_REG |= LED1_MASK)
79 #define LED1_TOGGLE (LED_OUT_REG ^= LED1_MASK)
80 
81 #define LED2_ON (LED_OUT_REG &=~LED2_MASK)
82 #define LED2_OFF (LED_OUT_REG |= LED2_MASK)
83 #define LED2_TOGGLE (LED_OUT_REG ^= LED2_MASK)
90 #define BTN0_PIN GPIO_PIN(2, 5)
91 #define BTN0_MASK (0x20)
92 #define BTN0_MODE GPIO_IN
93 
94 #define BTN0_PRESSED ((BTN0_PIN & BTN0_MASK) == 0)
95 #define BTN0_RELEASED ((BTN0_PIN & BTN0_MASK) != 0)
102 #define CC2420_PARAM_CS GPIO_PIN(P3, 0)
103 #define CC2420_PARAM_FIFO GPIO_PIN(P1, 3)
104 #define CC2420_PARAM_FIFOP GPIO_PIN(P1, 2)
105 #define CC2420_PARAM_CCA GPIO_PIN(P1, 4)
106 #define CC2420_PARAM_SFD GPIO_PIN(P4, 1)
107 #define CC2420_PARAM_VREFEN GPIO_PIN(P4, 5)
108 #define CC2420_PARAM_RESET GPIO_PIN(P4, 6)
111 #ifdef __cplusplus
112 }
113 #endif
114