update to faceplate bodge

custom
jacqueline 2 years ago
parent d01f1bee10
commit 0fce4fcc06
  1. 10
      src/drivers/display.cpp
  2. 12
      src/drivers/include/gpio_expander.hpp

@ -60,7 +60,7 @@ auto Display::create(GpioExpander* expander,
const displays::InitialisationData& init_data) const displays::InitialisationData& init_data)
-> std::unique_ptr<Display> { -> std::unique_ptr<Display> {
// First, turn on the LED backlight. // First, turn on the LED backlight.
expander->set_pin(GpioExpander::DISPLAY_LED, 0); expander->set_pin(GpioExpander::DISPLAY_LED, 1);
expander->set_pin(GpioExpander::DISPLAY_POWER_ENABLE, 1); expander->set_pin(GpioExpander::DISPLAY_POWER_ENABLE, 1);
expander->Write(); expander->Write();
@ -118,6 +118,14 @@ Display::Display(GpioExpander* gpio, spi_device_handle_t handle)
Display::~Display() {} Display::~Display() {}
void Display::SendInitialisationSequence(const uint8_t* data) { void Display::SendInitialisationSequence(const uint8_t* data) {
// Reset the display manually to get it into a predictable state.
gpio_->set_pin(GpioExpander::DISPLAY_RESET, false);
gpio_->Write();
vTaskDelay(pdMS_TO_TICKS(10));
gpio_->set_pin(GpioExpander::DISPLAY_RESET, false);
gpio_->Write();
vTaskDelay(pdMS_TO_TICKS(10));
// Hold onto the bus for the entire sequence so that we're not interrupted // Hold onto the bus for the entire sequence so that we're not interrupted
// part way through. // part way through.
spi_device_acquire_bus(handle_, portMAX_DELAY); spi_device_acquire_bus(handle_, portMAX_DELAY);

@ -49,8 +49,8 @@ class GpioExpander {
// Port B: // Port B:
// 0 - 3.5mm jack detect (active low) // 0 - 3.5mm jack detect (active low)
// 1 - unused // 1 - unused
// 2 - volume up // 2 - trackpad int
// 3 - volume down // 3 - display reset (active low)
// 4 - lock switch // 4 - lock switch
// 5 - touchpad interupt // 5 - touchpad interupt
// 6 - display DR // 6 - display DR
@ -111,10 +111,10 @@ class GpioExpander {
// Port B // Port B
PHONE_DETECT = 8, // Active-high input PHONE_DETECT = 8, // Active-high input
// UNUSED = 9, // UNUSED = 9,
VOL_UP = 10, TOUCHPAD_INT = 10,
VOL_DOWN = 11, DISPLAY_RESET = 11,
LOCK = 12, // UNUSED = 12,
TOUCHPAD_INT = 13, // UNUSED = 13,
DISPLAY_DR = 14, DISPLAY_DR = 14,
DISPLAY_LED = 15, DISPLAY_LED = 15,
}; };

Loading…
Cancel
Save