aniker/docs/TFT_SETUP.md

73 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

2025-04-16 21:00:32 +01:00
# 1.8" TFT Display Setup Guide
## Overview
The 1.8" TFT display (128x160) is used as the primary visual interface for the Aniker anchor alarm system. It displays GPS coordinates, anchor status, and alarm conditions.
## Display Specifications
### Technical Details
- Display Type: TFT LCD
- Resolution: 128x160 pixels
- Interface: SPI
- Controller: ST7735 (typical)
- Viewing Angle: ~160°
- Operating Voltage: 3.3V
- Backlight: LED
- Color Depth: 16-bit (65K colors)
### Physical Characteristics
- Screen Size: 1.8 inches diagonal
- Active Area: ~28mm x 35mm
- Module Size: ~34mm x 45mm (approximate)
- Interface: 8-pin connection
## Hardware Setup
### Power Requirements
- Logic Voltage: 3.3V
- Current Draw: ~100mA with backlight on
- Backlight Control: PWM capable
### Pin Connections
1. **Power Pins**
- VCC → ESP32 3.3V
- GND → ESP32 GND
- BLK → ESP32 GPIO4 (Backlight control)
2. **SPI Interface**
- SCL → ESP32 GPIO18 (SPI Clock)
- SDA → ESP32 GPIO23 (MOSI)
- RES → ESP32 GPIO21 (Reset)
- DC → ESP32 GPIO22 (Data/Command)
- CS → ESP32 GPIO5 (Chip Select)
### Display Orientation
- The display can be mounted in 4 orientations (0°, 90°, 180°, 270°)
- Software configuration available for orientation adjustment
- Default orientation: Portrait (0°)
## Software Integration
### Basic Configuration
```rust
// Example display configuration
let spi = SPIInterface::new(
spi,
gpio23, // MOSI
gpio18, // SCK
gpio5, // CS
gpio22, // DC
gpio21, // RST
);
let display = ST7735::new(
spi,
gpio4, // BLK
false, // is_inverted
160, // height
128, // width
);
```
### Display Layout
The screen is organized into several regions: