#include "devices/Display.h" #include #include #include #include #include #include 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 };