65 lines
1.6 KiB
C
65 lines
1.6 KiB
C
#pragma once
|
|
|
|
/* KY-040 #1 (проверено по HB: CLK=GP2) */
|
|
#define PIN_ENC1_SW 0
|
|
#define PIN_ENC1_DT 1
|
|
#define PIN_ENC1_CLK 2
|
|
|
|
/* KY-040 #2 */
|
|
#define PIN_ENC2_CLK 3
|
|
#define PIN_ENC2_DT 4
|
|
#define PIN_ENC2_SW 5
|
|
|
|
/* Potentiometer wiper → ADC */
|
|
#define PIN_POT 26 /* ADC0 */
|
|
|
|
/* Тумблер: GP9, второй контакт замыкать на землю (internal pull-up) */
|
|
#define PIN_TOGGLE 9
|
|
|
|
/*
|
|
* TPM408-2.8 (ILI9341 240x320):
|
|
* SCK → GP18
|
|
* SDI → GP19 (MOSI)
|
|
* SDO → GP16 (MISO) — LCD SDO, optional
|
|
* CS → GP17
|
|
* DC → GP20
|
|
* RES → GP21
|
|
* LED → GP22
|
|
* SD_CS→ GP7 (hold HIGH if unused)
|
|
*
|
|
* Touch XPT2046 — on THIS panel T_* does NOT share tracks with LCD
|
|
* (continuity check failed). Wire all 5 touch pins to Pico:
|
|
*
|
|
* T_CLK → GP18 (jumper to same net as LCD SCK)
|
|
* T_DIN → GP19 (jumper to same net as LCD MOSI)
|
|
* T_DO → GP16 (touch DO — NOT LCD SDO if they are separate pads)
|
|
* T_CS → GP6
|
|
* T_IRQ → GP8
|
|
*
|
|
* During a touch sample we bit-bang CLK/DIN/DO; LCD SPI is restored after.
|
|
*/
|
|
#define PIN_LCD_MISO 16
|
|
#define PIN_LCD_CS 17
|
|
#define PIN_LCD_SCK 18
|
|
#define PIN_LCD_MOSI 19
|
|
#define PIN_LCD_DC 20
|
|
#define PIN_LCD_RES 21
|
|
#define PIN_LCD_BL 22
|
|
|
|
#define PIN_T_CLK 18
|
|
#define PIN_T_DIN 19
|
|
#define PIN_T_DO 16
|
|
#define PIN_T_CS 6
|
|
#define PIN_T_IRQ 8
|
|
|
|
#define PIN_TOUCH_CS PIN_T_CS
|
|
#define PIN_TOUCH_IRQ PIN_T_IRQ
|
|
#define PIN_TOUCH_SCK PIN_T_CLK
|
|
#define PIN_TOUCH_MOSI PIN_T_DIN
|
|
#define PIN_TOUCH_MISO PIN_T_DO
|
|
|
|
#define PIN_SD_CS 7
|
|
|
|
#define LCD_SPI_INST spi0
|
|
#define TOUCH_SPI_INST LCD_SPI_INST
|