|
| 1 | + |
| 2 | +#ifndef Pins_Arduino_h |
| 3 | +#define Pins_Arduino_h |
| 4 | + |
| 5 | +#include <stdint.h> |
| 6 | +#include "soc/soc_caps.h" |
| 7 | + |
| 8 | +// BN: ESP32 Family Device |
| 9 | +#define USB_VID 0x303a |
| 10 | +#define USB_PID 0x8231 |
| 11 | + |
| 12 | +#define USB_MANUFACTURER "Waveshare" |
| 13 | +#define USB_PRODUCT "ESP32-S3-Touch-LCD-4.3B" |
| 14 | +#define USB_SERIAL "" |
| 15 | + |
| 16 | +// display for ST7262 |
| 17 | +#define WS_LCD_B3 14 |
| 18 | +#define WS_LCD_B4 38 |
| 19 | +#define WS_LCD_B5 18 |
| 20 | +#define WS_LCD_B6 17 |
| 21 | +#define WS_LCD_B7 10 |
| 22 | + |
| 23 | +#define WS_LCD_G2 39 |
| 24 | +#define WS_LCD_G3 0 |
| 25 | +#define WS_LCD_G4 45 |
| 26 | +#define WS_LCD_G5 48 |
| 27 | +#define WS_LCD_G6 47 |
| 28 | +#define WS_LCD_G7 21 |
| 29 | + |
| 30 | +#define WS_LCD_R3 1 |
| 31 | +#define WS_LCD_R4 2 |
| 32 | +#define WS_LCD_R5 42 |
| 33 | +#define WS_LCD_R6 41 |
| 34 | +#define WS_LCD_R7 40 |
| 35 | + |
| 36 | +#define WS_LCD_VSYNC 3 |
| 37 | +#define WS_LCD_HSYNC 46 |
| 38 | +#define WS_LCD_PCLK 7 |
| 39 | +#define WS_LCD_DE 5 |
| 40 | + |
| 41 | +// Touch for gt911 |
| 42 | +#define WS_TP_SDA 8 |
| 43 | +#define WS_TP_SCL 9 |
| 44 | +#define WS_TP_RST -1 |
| 45 | +#define WS_TP_INT 4 |
| 46 | + |
| 47 | +//RS485 |
| 48 | +#define WS_RS485_RXD 43 |
| 49 | +#define WS_RS485_TXD 44 |
| 50 | + |
| 51 | +//CAN |
| 52 | +#define WS_CAN_RXD 15 |
| 53 | +#define WS_CAN_TXD 16 |
| 54 | + |
| 55 | +//Onboard CH422G IO expander |
| 56 | +#define WS_CH422G_SDA 8 |
| 57 | +#define WS_CH422G_SCL 9 |
| 58 | + |
| 59 | +// UART0 pins |
| 60 | +static const uint8_t TX = 43; |
| 61 | +static const uint8_t RX = 44; |
| 62 | + |
| 63 | +// Def for I2C that shares the IMU I2C pins |
| 64 | +static const uint8_t SDA = 11; |
| 65 | +static const uint8_t SCL = 10; |
| 66 | + |
| 67 | +// Mapping based on the ESP32S3 data sheet - alternate for SPI2 |
| 68 | +static const uint8_t SS = 34; // FSPICS0 |
| 69 | +static const uint8_t MOSI = 35; // FSPID |
| 70 | +static const uint8_t MISO = 37; // FSPIQ |
| 71 | +static const uint8_t SCK = 36; // FSPICLK |
| 72 | + |
| 73 | +// Mapping based on the ESP32S3 data sheet - alternate for OUTPUT |
| 74 | +static const uint8_t OUTPUT_IO2 = 2; |
| 75 | +static const uint8_t OUTPUT_IO3 = 3; |
| 76 | +static const uint8_t OUTPUT_IO17 = 17; |
| 77 | +static const uint8_t OUTPUT_IO18 = 18; |
| 78 | + |
| 79 | +// Analog capable pins on the header |
| 80 | +static const uint8_t A0 = 1; |
| 81 | +static const uint8_t A1 = 2; |
| 82 | +static const uint8_t A2 = 3; |
| 83 | +static const uint8_t A3 = 4; |
| 84 | +static const uint8_t A4 = 5; |
| 85 | +static const uint8_t A5 = 6; |
| 86 | +static const uint8_t A6 = 7; |
| 87 | + |
| 88 | +// GPIO capable pins on the header |
| 89 | +static const uint8_t D0 = 7; |
| 90 | +static const uint8_t D1 = 6; |
| 91 | +static const uint8_t D2 = 5; |
| 92 | +static const uint8_t D3 = 4; |
| 93 | +static const uint8_t D4 = 3; |
| 94 | +static const uint8_t D5 = 2; |
| 95 | +static const uint8_t D6 = 1; |
| 96 | +static const uint8_t D7 = 44; |
| 97 | +static const uint8_t D8 = 43; |
| 98 | +static const uint8_t D9 = 40; |
| 99 | +static const uint8_t D10 = 39; |
| 100 | +static const uint8_t D11 = 38; |
| 101 | +static const uint8_t D12 = 37; |
| 102 | +static const uint8_t D13 = 36; |
| 103 | +static const uint8_t D14 = 35; |
| 104 | +static const uint8_t D15 = 34; |
| 105 | +static const uint8_t D16 = 33; |
| 106 | + |
| 107 | +// Touch input capable pins on the header |
| 108 | +static const uint8_t T1 = 1; |
| 109 | +static const uint8_t T2 = 2; |
| 110 | +static const uint8_t T3 = 3; |
| 111 | +static const uint8_t T4 = 4; |
| 112 | +static const uint8_t T5 = 5; |
| 113 | +static const uint8_t T6 = 6; |
| 114 | +static const uint8_t T7 = 7; |
| 115 | + |
| 116 | +#endif /* Pins_Arduino_h */ |
0 commit comments