Loading...
Searching...
No Matches
board.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 Mesotic SAS
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
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31#define CLOCK_CORECLOCK MHZ(128)
32
40 /* CLOCK_HFCLKSRC_SRC_HFXO to use external 32MHz crystal
41 * CLOCK_HFCLKSRC_SRC_HFINT to use internal crystal */
42#define CLOCK_HFCLK (CLOCK_HFCLKSRC_SRC_HFXO)
44/* LFCLK Source clock selection:*/
45/* - CLOCK_LFCLKSRC_SRC_LFRC: 32.768 kHz RC oscillator
46 * - CLOCK_LFCLKSRC_SRC_LFXO: 32.768 kHz crystal oscillator
47 * - CLOCK_LFCLKSRC_SRC_LFSYNT: 32.768 kHz synthesized from HFCLK*/
48#define CLOCK_LFCLK (CLOCK_LFCLKSRC_SRC_LFXO)
55#define LED0_PIN GPIO_PIN(0, 28)
56#define LED1_PIN GPIO_PIN(0, 29)
57#define LED2_PIN GPIO_PIN(0, 30)
58#define LED3_PIN GPIO_PIN(0, 31)
60#define LED0_MASK (1 << 28)
61#define LED1_MASK (1 << 29)
62#define LED2_MASK (1 << 30)
63#define LED3_MASK (1 << 31)
65#define LED_PORT (NRF_P0_S)
67#define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
68#define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
69#define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK)
71#define LED1_ON (LED_PORT->OUTCLR = LED1_MASK)
72#define LED1_OFF (LED_PORT->OUTSET = LED1_MASK)
73#define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK)
75#define LED2_ON (LED_PORT->OUTCLR = LED2_MASK)
76#define LED2_OFF (LED_PORT->OUTSET = LED2_MASK)
77#define LED2_TOGGLE (LED_PORT->OUT ^= LED2_MASK)
79#define LED3_ON (LED_PORT->OUTCLR = LED3_MASK)
80#define LED3_OFF (LED_PORT->OUTSET = LED3_MASK)
81#define LED3_TOGGLE (LED_PORT->OUT ^= LED3_MASK)
88#define BTN0_PIN GPIO_PIN(0, 23)
89#define BTN0_MODE GPIO_IN_PU
90#define BTN1_PIN GPIO_PIN(0, 24)
91#define BTN1_MODE GPIO_IN_PU
92#define BTN2_PIN GPIO_PIN(0, 8)
93#define BTN2_MODE GPIO_IN_PU
94#define BTN3_PIN GPIO_PIN(0, 9)
95#define BTN3_MODE GPIO_IN_PU
102#define MTD_0 mtd_dev_get(0)
103
104#define BOARD_QSPI_PIN_CS GPIO_PIN(0, 18)
105#define BOARD_QSPI_PIN_WP GPIO_PIN(0, 15)
106#define BOARD_QSPI_PIN_HOLD GPIO_PIN(0, 16)
109#ifdef __cplusplus
110}
111#endif
112
113#endif /* BOARD_H */