frdm-k22f/include/board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Eistec AB
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
21 #ifndef BOARD_H
22 #define BOARD_H
23 
24 #include "cpu.h"
25 #include "periph_conf.h"
26 
27 #ifdef __cplusplus
28 extern "C"
29 {
30 #endif
31 
36 #define LED0_PIN GPIO_PIN(PORT_A, 1)
37 #define LED1_PIN GPIO_PIN(PORT_A, 2)
38 #define LED2_PIN GPIO_PIN(PORT_D, 5)
39 
40 #define LED0_MASK (1 << 1)
41 #define LED1_MASK (1 << 2)
42 #define LED2_MASK (1 << 5)
43 
44 #define LED0_ON (GPIOA->PCOR = LED0_MASK)
45 #define LED0_OFF (GPIOA->PSOR = LED0_MASK)
46 #define LED0_TOGGLE (GPIOA->PTOR = LED0_MASK)
47 
48 #define LED1_ON (GPIOA->PCOR = LED1_MASK)
49 #define LED1_OFF (GPIOA->PSOR = LED1_MASK)
50 #define LED1_TOGGLE (GPIOA->PTOR = LED1_MASK)
51 
52 #define LED2_ON (GPIOD->PCOR = LED2_MASK)
53 #define LED2_OFF (GPIOD->PSOR = LED2_MASK)
54 #define LED2_TOGGLE (GPIOD->PTOR = LED2_MASK)
55 
60 void board_init(void);
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif /* BOARD_H */
67 
void board_init(void)
Initialize board specific hardware, including clock, LEDs and std-IO.