Files
t-embed-insecam-widget/main/board.h
T
Juli 65a391940b insecam desk widget for the LilyGO T-Embed
ESP-IDF 5.5 + LVGL 9 firmware that plays random public cameras from
insecam.org on the T-Embed's 320x170 screen, live MJPEG where available,
a new camera every 20 seconds. Knob steps through cameras, LED ring shows
the countdown. Auto-detects the original vs CC1101 board, reuses Wi-Fi
credentials from NVS and falls back to a captive-portal setup hotspot.
2026-09-17 00:38:09 +02:00

31 lines
1.2 KiB
C

#pragma once
#include <stdbool.h>
#include <stdint.h>
// Pin map for the two LilyGO T-Embed variants, taken from LilyGO's own
// examples/factory/pin_config.h (2022 board) and examples/utilities.h (CC1101).
typedef enum { BOARD_TEMBED = 0, BOARD_TEMBED_CC1101 = 1 } board_variant_t;
typedef struct {
board_variant_t variant;
const char *name;
int pwr_en; // must be driven high or the board powers down on battery
// 1.9" ST7789 170x320, SPI
int lcd_mosi, lcd_miso, lcd_sclk, lcd_cs, lcd_dc, lcd_rst, lcd_bl;
bool lcd_bgr; // colour order the panel wants (TFT_eSPI setups differ per variant)
// rotary encoder + its push button (GPIO0), optional extra key
int enc_a, enc_b, enc_btn, user_key;
// LED ring: APA102 (SPI, clk+data) on the original, WS2812 (one wire) on the CC1101
bool led_ws2812;
int led_clk, led_data, led_count;
// I2C, used only to tell the two boards apart
int i2c_sda, i2c_scl;
// chip selects sharing the LCD SPI bus on the CC1101 board; parked high
int spi_other_cs[3];
} board_t;
extern const board_t *board;
// Latches power, picks the variant (probe or Kconfig) and parks unused chip selects.
void board_init(void);