board.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2023 Mesotic SAS
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #include "cpu.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
27 #define CLOCK_CORECLOCK MHZ(128)
28 
36  /* CLOCK_HFCLKSRC_SRC_HFXO to use external 32MHz crystal
37  * CLOCK_HFCLKSRC_SRC_HFINT to use internal crystal */
38 #define CLOCK_HFCLK (CLOCK_HFCLKSRC_SRC_HFXO)
40 /* LFCLK Source clock selection:*/
41 /* - CLOCK_LFCLKSRC_SRC_LFRC: 32.768 kHz RC oscillator
42  * - CLOCK_LFCLKSRC_SRC_LFXO: 32.768 kHz crystal oscillator
43  * - CLOCK_LFCLKSRC_SRC_LFSYNT: 32.768 kHz synthesized from HFCLK*/
44 #define CLOCK_LFCLK (CLOCK_LFCLKSRC_SRC_LFXO)
51 #define LED0_PIN GPIO_PIN(0, 28)
52 #define LED1_PIN GPIO_PIN(0, 29)
53 #define LED2_PIN GPIO_PIN(0, 30)
54 #define LED3_PIN GPIO_PIN(0, 31)
56 #define LED0_MASK (1 << 28)
57 #define LED1_MASK (1 << 29)
58 #define LED2_MASK (1 << 30)
59 #define LED3_MASK (1 << 31)
61 #define LED_PORT (NRF_P0_S)
63 #define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
64 #define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
65 #define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK)
67 #define LED1_ON (LED_PORT->OUTCLR = LED1_MASK)
68 #define LED1_OFF (LED_PORT->OUTSET = LED1_MASK)
69 #define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK)
71 #define LED2_ON (LED_PORT->OUTCLR = LED2_MASK)
72 #define LED2_OFF (LED_PORT->OUTSET = LED2_MASK)
73 #define LED2_TOGGLE (LED_PORT->OUT ^= LED2_MASK)
75 #define LED3_ON (LED_PORT->OUTCLR = LED3_MASK)
76 #define LED3_OFF (LED_PORT->OUTSET = LED3_MASK)
77 #define LED3_TOGGLE (LED_PORT->OUT ^= LED3_MASK)
84 #define BTN0_PIN GPIO_PIN(0, 23)
85 #define BTN0_MODE GPIO_IN_PU
86 #define BTN1_PIN GPIO_PIN(0, 24)
87 #define BTN1_MODE GPIO_IN_PU
88 #define BTN2_PIN GPIO_PIN(0, 8)
89 #define BTN2_MODE GPIO_IN_PU
90 #define BTN3_PIN GPIO_PIN(0, 9)
91 #define BTN3_MODE GPIO_IN_PU
98 #define MTD_0 mtd_dev_get(0)
99 
100 #define BOARD_QSPI_PIN_CS GPIO_PIN(0, 18)
101 #define BOARD_QSPI_PIN_WP GPIO_PIN(0, 15)
102 #define BOARD_QSPI_PIN_HOLD GPIO_PIN(0, 16)
105 #ifdef __cplusplus
106 }
107 #endif
108