remote-pa/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  * Copyright (C) 2015 Zolertia SL
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser General
6  * Public License v2.1. See the file LICENSE in the top level directory for more
7  * details.
8  */
9 
24 #ifndef BOARD_H
25 #define BOARD_H
26 
27 #include "cpu.h"
28 #include "board_common.h"
29 
30 #ifdef __cplusplus
31  extern "C" {
32 #endif
33 
38 #define LED0_PIN GPIO_PIN(3, 2)
39 #define LED1_PIN GPIO_PIN(3, 5)
40 #define LED2_PIN GPIO_PIN(2, 3)
41 
42 #define LED0_MASK (1 << 2)
43 #define LED1_MASK (1 << 5)
44 #define LED2_MASK (1 << 3)
45 
46 #define LED0_ON (GPIO_D->DATA &= ~LED0_MASK)
47 #define LED0_OFF (GPIO_D->DATA |= LED0_MASK)
48 #define LED0_TOGGLE (GPIO_D->DATA ^= LED0_MASK)
49 
50 #define LED1_ON (GPIO_D->DATA &= ~LED1_MASK)
51 #define LED1_OFF (GPIO_D->DATA |= LED1_MASK)
52 #define LED1_TOGGLE (GPIO_D->DATA ^= LED1_MASK)
53 
54 #define LED2_ON (GPIO_C->DATA &= ~LED2_MASK)
55 #define LED2_OFF (GPIO_C->DATA |= LED2_MASK)
56 #define LED2_TOGGLE (GPIO_C->DATA ^= LED2_MASK)
57 
63 #define BTN0_PIN GPIO_PIN(0, 3)
64 #define BTN0_MODE GPIO_IN_PU
65 
73 #define RF_SWITCH_PORT GPIO_D
74 #define RF_SWITCH_PIN (4)
75 #define RF_SWITCH_EXTERNAL (RF_SWITCH_PORT->DATA |= (1 << RF_SWITCH_PIN))
76 #define RF_SWITCH_INTERNAL (RF_SWITCH_PORT->DATA &= ~(1 << RF_SWITCH_PIN))
77 #define RF_SWITCH_TOGGLE (RF_SWITCH_PORT->DATA ^= (1 << RF_SWITCH_PIN))
78 
83 void board_init(void);
84 
85 #ifdef __cplusplus
86 } /* end extern "C" */
87 #endif
88 #endif /* BOARD_H */
89 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.