saml21-xpro/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
22 #ifndef BOARD_H
23 #define BOARD_H
24 
25 #include "cpu.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35 #define LED0_PIN GPIO_PIN(1, 10)
36 
37 #define LED_PORT PORT->Group[1]
38 #define LED0_MASK (1 << 10)
39 
40 #define LED0_ON (LED_PORT.OUTCLR.reg = LED0_MASK)
41 #define LED0_OFF (LED_PORT.OUTSET.reg = LED0_MASK)
42 #define LED0_TOGGLE (LED_PORT.OUTTGL.reg = LED0_MASK)
43 
49 #define BTN0_PORT PORT->Group[PA]
50 #define BTN0_PIN GPIO_PIN(PA, 2)
51 #define BTN0_MODE GPIO_IN_PU
52 
58 void board_init(void);
59 
60 #ifdef __cplusplus
61 }
62 #endif
63 
64 #endif /* BOARD_H */
65 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.