1a96307de2
- ST7305 driver with persistent 15KB DMA buffer (fix use-after-free +
WDT lockup that caused freeze after flash)
- Reset timing fix: 150ms after reset, 50ms after init
- DTS: i2s0 mclk 16, bclk 9, ws 45, out 8, in 10 - fixes GPIO5 conflict
- i2c0 uses esp32-i2c-master, SDMMC 1-bit
- device.properties: colorDepth 16, fontSize 20, DefaultDark
- Amp GPIO46 init in initBoot
- Buttons: two-button control GPIO18 (cycle) + GPIO0 (select)
Base: origin/main f9453d89
42 lines
1.2 KiB
C++
42 lines
1.2 KiB
C++
#include "devices/Display.h"
|
|
|
|
#include <Tactility/hal/Configuration.h>
|
|
#include <ButtonControl.h>
|
|
#include <driver/gpio.h>
|
|
#include <tactility/log.h>
|
|
#include <freertos/FreeRTOS.h>
|
|
#include <freertos/task.h>
|
|
|
|
static constexpr auto* TAG = "WaveshareRLCD";
|
|
|
|
using namespace tt::hal;
|
|
|
|
static DeviceVector createDevices() {
|
|
return {
|
|
createDisplay(),
|
|
ButtonControl::createTwoButtonControl(GPIO_NUM_18, GPIO_NUM_0) // KEY=18 cycles, BOOT=0 selects
|
|
};
|
|
}
|
|
|
|
static bool initBoot() {
|
|
// Amp enable GPIO46 active HIGH - keep LOW during boot to avoid pop,
|
|
// then HIGH after delay so speaker works for MCP / Mp3Player
|
|
gpio_config_t io_conf = {};
|
|
io_conf.intr_type = GPIO_INTR_DISABLE;
|
|
io_conf.mode = GPIO_MODE_OUTPUT;
|
|
io_conf.pin_bit_mask = (1ULL << GPIO_NUM_46);
|
|
io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE;
|
|
io_conf.pull_up_en = GPIO_PULLUP_DISABLE;
|
|
gpio_config(&io_conf);
|
|
gpio_set_level(GPIO_NUM_46, 0);
|
|
vTaskDelay(pdMS_TO_TICKS(100));
|
|
gpio_set_level(GPIO_NUM_46, 1);
|
|
LOG_I(TAG, "Speaker amp GPIO46 enabled");
|
|
return true;
|
|
}
|
|
|
|
extern const Configuration hardwareConfiguration = {
|
|
.initBoot = initBoot,
|
|
.createDevices = createDevices
|
|
};
|