2019-10-23 13:50:18 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Inria
|
|
|
|
* 2019 Freie Universität Berlin
|
|
|
|
* 2019 Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup boards_pinetime
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Board specific configuration for the PineTime
|
|
|
|
*
|
|
|
|
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BOARD_H
|
|
|
|
#define BOARD_H
|
|
|
|
|
|
|
|
#include "cpu.h"
|
|
|
|
#include "board_common.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name GPIO pin defines
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define LCD_RS GPIO_PIN(0, 18)
|
|
|
|
#define LCD_DET GPIO_PIN(0, 9)
|
|
|
|
#define LCD_CS GPIO_PIN(0, 25)
|
|
|
|
#define LCD_RESET GPIO_PIN(0, 26)
|
|
|
|
|
|
|
|
#define LCD_BACKLIGHT_LOW GPIO_PIN(0, 14)
|
|
|
|
#define LCD_BACKLIGHT_MID GPIO_PIN(0, 22)
|
|
|
|
#define LCD_BACKLIGHT_HIGH GPIO_PIN(0, 23)
|
|
|
|
|
|
|
|
#define BUTTON0_ENABLE GPIO_PIN(0, 13)
|
|
|
|
#define BUTTON0 GPIO_PIN(0, 15)
|
|
|
|
#define VIBRATOR GPIO_PIN(0, 16)
|
|
|
|
|
|
|
|
#define VCC33 GPIO_PIN(0, 24)
|
|
|
|
#define POWER_PRESENCE GPIO_PIN(0, 19)
|
|
|
|
#define CHARGING_ACTIVE GPIO_PIN(0, 12)
|
2020-01-18 11:15:04 +01:00
|
|
|
#define BATTERY_ADC NRF52_AIN7
|
2019-10-23 13:50:18 +02:00
|
|
|
/** @} */
|
|
|
|
|
2020-03-19 10:23:51 +01:00
|
|
|
/**
|
|
|
|
* @name Backlight control defines, default uses LCD_BACKLIGHT_LOW values
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#ifndef BACKLIGHT_MASK
|
|
|
|
#define BACKLIGHT_MASK (1 << 14)
|
|
|
|
#endif
|
|
|
|
#define BACKLIGHT_ON (NRF_P0->OUTCLR = BACKLIGHT_MASK)
|
|
|
|
#define BACKLIGHT_OFF (NRF_P0->OUTSET = BACKLIGHT_MASK)
|
2022-08-11 16:24:37 +02:00
|
|
|
/** @} */
|
2020-03-19 10:23:51 +01:00
|
|
|
|
2019-10-23 13:50:18 +02:00
|
|
|
/**
|
|
|
|
* @name LCD configuration
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define ILI9341_PARAM_SPI SPI_DEV(0)
|
|
|
|
#define ILI9341_PARAM_SPI_CLK SPI_CLK_10MHZ
|
|
|
|
#define ILI9341_PARAM_SPI_MODE SPI_MODE_3
|
|
|
|
#define ILI9341_PARAM_CS LCD_CS
|
|
|
|
#define ILI9341_PARAM_DCX LCD_RS
|
|
|
|
#define ILI9341_PARAM_RST LCD_RESET
|
|
|
|
#define ILI9341_PARAM_RGB 1
|
|
|
|
#define ILI9341_PARAM_INVERTED 1
|
2020-01-15 15:34:52 +01:00
|
|
|
#define ILI9341_PARAM_NUM_LINES 240U
|
2022-04-13 13:46:32 +02:00
|
|
|
#define ILI9341_PARAM_ROTATION ILI9341_ROTATION_HORZ_FLIP
|
2019-10-23 13:50:18 +02:00
|
|
|
/** @} */
|
|
|
|
|
2020-01-17 20:58:11 +01:00
|
|
|
/**
|
|
|
|
* @name PineTime NOR flash hardware configuration
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define PINETIME_NOR_PAGE_SIZE (256)
|
|
|
|
#define PINETIME_NOR_PAGES_PER_SECTOR (16)
|
|
|
|
#define PINETIME_NOR_SECTOR_COUNT (2048)
|
|
|
|
#define PINETIME_NOR_FLAGS (SPI_NOR_F_SECT_4K | SPI_NOR_F_SECT_32K)
|
|
|
|
#define PINETIME_NOR_SPI_DEV SPI_DEV(0)
|
|
|
|
#define PINETIME_NOR_SPI_CLK SPI_CLK_10MHZ
|
|
|
|
#define PINETIME_NOR_SPI_CS GPIO_PIN(0, 5)
|
|
|
|
#define PINETIME_NOR_SPI_MODE SPI_MODE_3
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name MTD configuration
|
|
|
|
* @{
|
|
|
|
*/
|
2023-11-23 17:46:10 +01:00
|
|
|
#define MTD_0 mtd_dev_get(0)
|
2020-01-17 20:58:11 +01:00
|
|
|
/** @} */
|
|
|
|
|
2020-06-23 10:39:51 +02:00
|
|
|
/**
|
|
|
|
* @name Touch screen configuration
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
#define CST816S_PARAM_I2C_DEV I2C_DEV(0)
|
|
|
|
#define CST816S_PARAM_I2C_ADDR (0x15)
|
|
|
|
#define CST816S_PARAM_IRQ GPIO_PIN(0, 28)
|
|
|
|
#define CST816S_PARAM_IRQ_FLANK GPIO_FALLING
|
|
|
|
#define CST816S_PARAM_RESET GPIO_PIN(0, 10)
|
|
|
|
/** @} */
|
|
|
|
|
2019-10-23 13:50:18 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* BOARD_H */
|
|
|
|
/** @} */
|