Apply reset signal on pin P0.26 for LCD during init.

This commit is contained in:
JF 2020-01-02 14:47:59 +01:00
parent 6abe5d8db8
commit e08cfe07c7
2 changed files with 15 additions and 2 deletions

View file

@ -12,6 +12,9 @@ St7789::St7789(SpiMaster &spiMaster, uint8_t pinDataCommand) : spi{spiMaster}, p
void St7789::Init() { void St7789::Init() {
nrf_gpio_cfg_output(pinDataCommand); nrf_gpio_cfg_output(pinDataCommand);
nrf_gpio_cfg_output(26);
nrf_gpio_pin_set(26);
HardwareReset();
SoftwareReset(); SoftwareReset();
SleepOut(); SleepOut();
ColMod(); ColMod();
@ -158,4 +161,11 @@ void St7789::NextDrawBuffer(const uint8_t *data, size_t size) {
spi.Write(data, size); spi.Write(data, size);
} }
void St7789::HardwareReset() {
nrf_gpio_pin_clear(26);
nrf_delay_ms(200);
nrf_gpio_pin_set(26);
}

View file

@ -16,11 +16,15 @@ namespace Pinetime {
void NextDrawBuffer(const uint8_t* data, size_t size); void NextDrawBuffer(const uint8_t* data, size_t size);
void EndDrawBuffer(); void EndDrawBuffer();
void DisplayOn();
void DisplayOff();
private: private:
SpiMaster& spi; SpiMaster& spi;
uint8_t pinDataCommand; uint8_t pinDataCommand;
void HardwareReset();
void SoftwareReset(); void SoftwareReset();
void SleepOut(); void SleepOut();
void ColMod(); void ColMod();
@ -28,8 +32,7 @@ namespace Pinetime {
void DisplayInversionOn(); void DisplayInversionOn();
void NormalModeOn(); void NormalModeOn();
void WriteToRam(); void WriteToRam();
void DisplayOn();
void DisplayOff();
void SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); void SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1);