dummybot-firmware/include/User_Setup.h

48 lines
1.5 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ============================================================
// User_Setup.h TFT_eSPI config para M130T-240240-RGB-7-V1.1
// Driver: ST7789, 240x240, SPI, sin CS (CS=GN)
// ============================================================
#define USER_SETUP_LOADED
// --- Pines ESP32 (WROOM-32 / DevKitC) ---
// Los TTP223 (3 unidades) van en BTN_NEXT/BTN_DONE/BTN_SNOOZE
// y el vibrador en VIBRATOR_PIN (definidos en main.cpp).
#pragma once
#define TFT_MOSI 23
#define TFT_SCLK 18
#define TFT_CS -1 // CS no se usa (va a GND en el módulo)
#define TFT_DC 4 // Data/Command
#define TFT_RST 15 // Reset (movido desde GPIO 2 por conflicto con LED interno)
#define TFT_BL 32 // Backlight (LED) PWM opcional
#define TFT_SPI_FREQUENCY 40000000
#define TFT_SPI_READ_FREQUENCY 20000000
// --- Driver y resolución ---
#define ST7789_DRIVER
#define TFT_WIDTH 240
#define TFT_HEIGHT 240
// Offsets típicos para ST7789 240x240 (varían por lote, ajustar si sale desplazado)
#define TFT_ROTATION 0
#define CGRAM_OFFSET // necessário para ST7789
#define ST7789_GAMMA_CTRL1 0xD0
#define ST7789_GAMMA_CTRL2 0x04
#define ST7789_GAMMA_CTRL3 0x0D
#define ST7789_GAMMA_CTRL4 0x11
#define ST7789_GAMMA_CTRL5 0x0C
#define ST7789_GAMMA_CTRL6 0x27
#define ST7789_GAMMA_CTRL7 0x32
#define ST7789_GAMMA_CTRL8 0x4D
#define ST7789_GAMMA_CTRL9 0x42
#define ST7789_GAMMA_CTRL10 0x16
// --- Fuentes y sprites ---
#define SMOOTH_FONT
#define SPI_FREQUENCY 40000000
#define SPI_READ_FREQUENCY 20000000
#define SPI_TOUCH_FREQUENCY 2500000