board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Oppila Microsystems - http://www.oppila.in
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 
17 #ifndef BOARD_H
18 #define BOARD_H
19 
20 #include "cpu.h"
21 #include "periph/gpio.h"
22 #include "periph/spi.h"
23 #include "cc2538_eui_primary.h"
24 
25 #ifdef __cplusplus
26  extern "C" {
27 #endif
28 
33 #define LED0_PIN GPIO_PIN(3, 0)
34 #define LED1_PIN GPIO_PIN(3, 4)
35 
36 #define LED0_MASK (1 << 0)
37 #define LED1_MASK (1 << 4)
38 
39 #define LED0_ON (GPIO_D->DATA |= LED0_MASK)
40 #define LED0_OFF (GPIO_D->DATA &= ~LED0_MASK)
41 #define LED0_TOGGLE (GPIO_D->DATA ^= LED0_MASK)
42 
43 #define LED1_ON (GPIO_B->DATA |= LED1_MASK)
44 #define LED1_OFF (GPIO_B->DATA &= ~LED1_MASK)
45 #define LED1_TOGGLE (GPIO_B->DATA ^= LED1_MASK)
46 
47 #define LED_ALL_OFF LED0_OFF; \
48  LED1_OFF;
49 #define LED_ALL_ON LED0_ON; \
50  LED1_ON;
51 
57 #define BTN0_PIN GPIO_PIN(1, 0)
58 #define BTN0_MODE GPIO_IN_PU
59 
65 #ifndef UPDATE_CCA
66 #define UPDATE_CCA (1)
67 #endif
68 #define CCA_BACKDOOR_ENABLE (1)
69 #define CCA_BACKDOOR_PORT_A_PIN (3)
70 #define CCA_BACKDOOR_ACTIVE_LEVEL (0)
72 #define BOOT_PIN GPIO_PIN(0, CCA_BACKDOOR_PORT_A_PIN)
79 #define XTIMER_WIDTH (16)
80 #define XTIMER_BACKOFF (50)
81 #define XTIMER_ISR_BACKOFF (40)
82 
88 #define INTERNAL_PERIPHERAL_VID (0x0451)
89 #define INTERNAL_PERIPHERAL_PID (0x16C8)
90 
95 void board_init(void);
96 
97 #ifdef __cplusplus
98 } /* end extern "C" */
99 #endif
100 
101 #endif /* BOARD_H */
102 
spi.h
Low-level SPI peripheral driver interface definition.
gpio.h
Low-level GPIO peripheral driver interface definitions.
cc2538_eui_primary.h
CC2538 EUI-64 provider.
board_init
void board_init(void)
Board level initialization.