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 
9 #pragma once
10 
21 #include "cpu.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
30 #define CLOCK_CORECLOCK MHZ(128)
31 
39  /* CLOCK_HFCLKSRC_SRC_HFXO to use external 32MHz crystal
40  * CLOCK_HFCLKSRC_SRC_HFINT to use internal crystal */
41 #define CLOCK_HFCLK (CLOCK_HFCLKSRC_SRC_HFXO)
43 /* LFCLK Source clock selection:*/
44 /* - CLOCK_LFCLKSRC_SRC_LFRC: 32.768 kHz RC oscillator
45  * - CLOCK_LFCLKSRC_SRC_LFXO: 32.768 kHz crystal oscillator
46  * - CLOCK_LFCLKSRC_SRC_LFSYNT: 32.768 kHz synthesized from HFCLK*/
47 #define CLOCK_LFCLK (CLOCK_LFCLKSRC_SRC_LFXO)
54 #define LED0_PIN GPIO_PIN(0, 28)
55 #define LED1_PIN GPIO_PIN(0, 29)
56 #define LED2_PIN GPIO_PIN(0, 30)
57 #define LED3_PIN GPIO_PIN(0, 31)
59 #define LED0_MASK (1 << 28)
60 #define LED1_MASK (1 << 29)
61 #define LED2_MASK (1 << 30)
62 #define LED3_MASK (1 << 31)
64 #define LED_PORT (NRF_P0_S)
66 #define LED0_ON (LED_PORT->OUTCLR = LED0_MASK)
67 #define LED0_OFF (LED_PORT->OUTSET = LED0_MASK)
68 #define LED0_TOGGLE (LED_PORT->OUT ^= LED0_MASK)
70 #define LED1_ON (LED_PORT->OUTCLR = LED1_MASK)
71 #define LED1_OFF (LED_PORT->OUTSET = LED1_MASK)
72 #define LED1_TOGGLE (LED_PORT->OUT ^= LED1_MASK)
74 #define LED2_ON (LED_PORT->OUTCLR = LED2_MASK)
75 #define LED2_OFF (LED_PORT->OUTSET = LED2_MASK)
76 #define LED2_TOGGLE (LED_PORT->OUT ^= LED2_MASK)
78 #define LED3_ON (LED_PORT->OUTCLR = LED3_MASK)
79 #define LED3_OFF (LED_PORT->OUTSET = LED3_MASK)
80 #define LED3_TOGGLE (LED_PORT->OUT ^= LED3_MASK)
87 #define BTN0_PIN GPIO_PIN(0, 23)
88 #define BTN0_MODE GPIO_IN_PU
89 #define BTN1_PIN GPIO_PIN(0, 24)
90 #define BTN1_MODE GPIO_IN_PU
91 #define BTN2_PIN GPIO_PIN(0, 8)
92 #define BTN2_MODE GPIO_IN_PU
93 #define BTN3_PIN GPIO_PIN(0, 9)
94 #define BTN3_MODE GPIO_IN_PU
101 #define MTD_0 mtd_dev_get(0)
102 
103 #define BOARD_QSPI_PIN_CS GPIO_PIN(0, 18)
104 #define BOARD_QSPI_PIN_WP GPIO_PIN(0, 15)
105 #define BOARD_QSPI_PIN_HOLD GPIO_PIN(0, 16)
108 #ifdef __cplusplus
109 }
110 #endif
111