board.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2019 Inria
3  * SPDX-FileCopyrightText: 2019 Freie Universität Berlin
4  * SPDX-FileCopyrightText: 2019 Kaspar Schleiser <kaspar@schleiser.de>
5  * SPDX-License-Identifier: LGPL-2.1-only
6  */
7 
8 #pragma once
9 
20 #include "cpu.h"
21 #include "board_common.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
31 #define LCD_RS GPIO_PIN(0, 18)
32 #define LCD_DET GPIO_PIN(0, 9)
33 #define LCD_CS GPIO_PIN(0, 25)
34 #define LCD_RESET GPIO_PIN(0, 26)
35 
36 #define LCD_BACKLIGHT_LOW GPIO_PIN(0, 14)
37 #define LCD_BACKLIGHT_MID GPIO_PIN(0, 22)
38 #define LCD_BACKLIGHT_HIGH GPIO_PIN(0, 23)
39 
40 #define BUTTON0_ENABLE GPIO_PIN(0, 13)
41 #define BUTTON0 GPIO_PIN(0, 15)
42 #define VIBRATOR GPIO_PIN(0, 16)
43 
44 #define VCC33 GPIO_PIN(0, 24)
45 #define POWER_PRESENCE GPIO_PIN(0, 19)
46 #define CHARGING_ACTIVE GPIO_PIN(0, 12)
47 #define BATTERY_ADC NRF52_AIN7
54 #ifndef BACKLIGHT_MASK
55 #define BACKLIGHT_MASK (1 << 14)
56 #endif
57 #define BACKLIGHT_ON (NRF_P0->OUTCLR = BACKLIGHT_MASK)
58 #define BACKLIGHT_OFF (NRF_P0->OUTSET = BACKLIGHT_MASK)
65 #define ILI9341_PARAM_SPI SPI_DEV(0)
66 #define ILI9341_PARAM_SPI_CLK SPI_CLK_10MHZ
67 #define ILI9341_PARAM_SPI_MODE SPI_MODE_3
68 #define ILI9341_PARAM_CS LCD_CS
69 #define ILI9341_PARAM_DCX LCD_RS
70 #define ILI9341_PARAM_RST LCD_RESET
71 #define ILI9341_PARAM_RGB 1
72 #define ILI9341_PARAM_INVERTED 1
73 #define ILI9341_PARAM_NUM_LINES 240U
74 #define ILI9341_PARAM_ROTATION ILI9341_ROTATION_HORZ_FLIP
81 #define PINETIME_NOR_PAGE_SIZE (256)
82 #define PINETIME_NOR_PAGES_PER_SECTOR (16)
83 #define PINETIME_NOR_SECTOR_COUNT (2048)
84 #define PINETIME_NOR_FLAGS (SPI_NOR_F_SECT_4K | SPI_NOR_F_SECT_32K)
85 #define PINETIME_NOR_SPI_DEV SPI_DEV(0)
86 #define PINETIME_NOR_SPI_CLK SPI_CLK_10MHZ
87 #define PINETIME_NOR_SPI_CS GPIO_PIN(0, 5)
88 #define PINETIME_NOR_SPI_MODE SPI_MODE_3
95 #define MTD_0 mtd_dev_get(0)
102 #define CST816S_PARAM_I2C_DEV I2C_DEV(0)
103 #define CST816S_PARAM_I2C_ADDR (0x15)
104 #define CST816S_PARAM_IRQ GPIO_PIN(0, 28)
105 #define CST816S_PARAM_IRQ_FLANK GPIO_FALLING
106 #define CST816S_PARAM_RESET GPIO_PIN(0, 10)
109 #ifdef __cplusplus
110 }
111 #endif
112