All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
board.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 TU Dresden
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
19#ifndef BOARD_H
20#define BOARD_H
21
22#include "cpu.h"
23#include "board_common.h"
24#include "periph/gpio.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
34#define LED0_PIN GPIO_PIN(0, 26)
35#define LED1_PIN GPIO_PIN(0, 30)
36#define LED2_PIN GPIO_PIN(0, 6)
37
38#define LED_PORT (NRF_P0)
39#define LED0_MASK (1 << 26)
40#define LED1_MASK (1 << 30)
41#define LED2_MASK (1 << 6)
42#define LED_MASK (LED0_MASK | LED1_MASK | LED2_MASK)
43
44#define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
45#define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
46#define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK)
47
48#define LED1_ON (LED_PORT->OUTCLR = LED1_MASK)
49#define LED1_OFF (LED_PORT->OUTSET = LED1_MASK)
50#define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK)
51
52#define LED2_ON (LED_PORT->OUTCLR = LED2_MASK)
53#define LED2_OFF (LED_PORT->OUTSET = LED2_MASK)
54#define LED2_TOGGLE (LED_PORT->OUT ^= LED2_MASK)
66#define XIAO_NRF52840_NOR_PAGE_SIZE (256)
67#define XIAO_NRF52840_NOR_PAGES_PER_SECTOR (16)
68#define XIAO_NRF52840_NOR_SECTOR_COUNT (512)
69#define XIAO_NRF52840_NOR_FLAGS \
70 (SPI_NOR_F_SECT_4K | SPI_NOR_F_SECT_32K | SPI_NOR_F_SECT_64K)
71#define XIAO_NRF52840_NOR_SPI_DEV SPI_DEV(1)
72#define XIAO_NRF52840_NOR_SPI_CLK SPI_CLK_10MHZ
73#define XIAO_NRF52840_NOR_SPI_CS GPIO_PIN(0, 25)
74#define XIAO_NRF52840_NOR_SPI_WP GPIO_PIN(0, 22)
75#define XIAO_NRF52840_NOR_SPI_HOLD GPIO_PIN(0, 23)
76#define XIAO_NRF52840_NOR_SPI_MODE SPI_MODE_0
80#define MTD_0 mtd_dev_get(0)
81
86#define CONFIG_ZTIMER_USEC_ADJUST_SET 7
87#define CONFIG_ZTIMER_USEC_ADJUST_SLEEP 22
90#ifdef __cplusplus
91}
92#endif
93
94#endif /* BOARD_H */
Low-level GPIO peripheral driver interface definitions.