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 
9 #pragma once
10 
21 #include "cpu.h"
22 #include "periph_conf.h"
23 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
33 #define LED0_PIN GPIO_PIN(PORT_A, 1)
34 #define LED1_PIN GPIO_PIN(PORT_A, 2)
35 #define LED2_PIN GPIO_PIN(PORT_D, 5)
36 
37 #define LED0_MASK (1 << 1)
38 #define LED1_MASK (1 << 2)
39 #define LED2_MASK (1 << 5)
40 
41 #define LED0_ON (GPIOA->PCOR = LED0_MASK)
42 #define LED0_OFF (GPIOA->PSOR = LED0_MASK)
43 #define LED0_TOGGLE (GPIOA->PTOR = LED0_MASK)
44 
45 #define LED1_ON (GPIOA->PCOR = LED1_MASK)
46 #define LED1_OFF (GPIOA->PSOR = LED1_MASK)
47 #define LED1_TOGGLE (GPIOA->PTOR = LED1_MASK)
48 
49 #define LED2_ON (GPIOD->PCOR = LED2_MASK)
50 #define LED2_OFF (GPIOD->PSOR = LED2_MASK)
51 #define LED2_TOGGLE (GPIOD->PTOR = LED2_MASK)
58 /* SW2, SW3 will short these pins to ground when pushed. Both pins have external
59  * pull-up resistors to VDD */
60 /* BTN0 is mapped to SW2 */
61 #define BTN0_PIN GPIO_PIN(PORT_C, 1)
62 #define BTN0_MODE GPIO_IN
63 /* BTN1 is mapped to SW3 */
64 #define BTN1_PIN GPIO_PIN(PORT_B, 17)
65 #define BTN1_MODE GPIO_IN
72 #define FXOS8700_PARAM_I2C I2C_DEV(0)
73 #define FXOS8700_PARAM_ADDR 0x1C
76 #ifdef __cplusplus
77 }
78 #endif
79 
Peripheral MCU configuration for the Zigduino board.