33 lines
786 B
C
33 lines
786 B
C
#pragma once
|
|
|
|
// Board pins — 2.8" default; 3.5" when CYD_BOARD_3248S035 is set (env:cyd_35r)
|
|
|
|
#if defined(CYD_BOARD_3248S035)
|
|
#define TFT_BL_PIN 27
|
|
#define SCREEN_WIDTH 320
|
|
#define SCREEN_HEIGHT 480
|
|
#define UI_HOR_RES 480
|
|
#define UI_VER_RES 320
|
|
#else
|
|
#define TFT_BL_PIN 21
|
|
#define SCREEN_WIDTH 240
|
|
#define SCREEN_HEIGHT 320
|
|
#define UI_HOR_RES 320
|
|
#define UI_VER_RES 240
|
|
#endif
|
|
|
|
#define CYD_TOUCH_IRQ 36
|
|
#define CYD_TOUCH_MOSI 32
|
|
#define CYD_TOUCH_MISO 39
|
|
#define CYD_TOUCH_CLK 25
|
|
#define CYD_TOUCH_CS 33
|
|
|
|
/* Map 320x240 design coordinates onto the active UI resolution (identity on 2.8"). */
|
|
#define UX(x) ((int)(((long)(x) * (UI_HOR_RES)) / 320))
|
|
#define UY(y) ((int)(((long)(y) * (UI_VER_RES)) / 240))
|
|
#define UW(w) UX(w)
|
|
#define UH(h) UY(h)
|
|
|
|
|
|
#define BTN_PIN 22
|