diff options
| author | JF002 <JF002@users.noreply.github.com> | 2020-01-26 14:44:26 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-26 14:44:26 (GMT) |
| commit | 7c03810f46ff1f7accd2f5adb7404b4f2cb723d9 (patch) | |
| tree | f720612013c3518b54ecd22ccfc5aef6917d3023 /src/drivers/St7789.cpp | |
| parent | 9dc4e32e36eb1167ee241cdf8027089cad593cf1 (diff) | |
| parent | 6491a7c3a0738d6e6ef3bf57da460f61298d1cd9 (diff) | |
Merge pull request #19 from JF002/spi-dma
Spi dma
Diffstat (limited to 'src/drivers/St7789.cpp')
| -rw-r--r-- | src/drivers/St7789.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index ac81306..39595dc 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -38,7 +38,7 @@ void St7789::WriteData(uint8_t data) { void St7789::WriteSpi(const uint8_t* data, size_t size) { - spi.Write(data, size); + spi.Write(data, size); } void St7789::SoftwareReset() { @@ -95,20 +95,6 @@ void St7789::DisplayOn() { WriteCommand(static_cast<uint8_t>(Commands::DisplayOn)); } -void St7789::FillRectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color) { - BeginDrawBuffer(x, y, width, height); - - uint32_t c = color + (color << 16); - uint8_t w = width/2; - - for(y=height+ST7789_ROW_OFFSET; y>ST7789_ROW_OFFSET; y--) { - for(x=w; x>0; x--) { - NextDrawBuffer(reinterpret_cast<const uint8_t *>(&c), 4); - } - } - EndDrawBuffer(); -} - void St7789::SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) { WriteCommand(static_cast<uint8_t>(Commands::ColumnAddressSet)); WriteData(x0 >> 8); @@ -156,11 +142,8 @@ void St7789::BeginDrawBuffer(uint16_t x, uint16_t y, uint16_t width, uint16_t he nrf_gpio_pin_set(pinDataCommand); } -void St7789::EndDrawBuffer() { -} - void St7789::NextDrawBuffer(const uint8_t *data, size_t size) { - spi.Write(data, size); + WriteSpi(data, size); } void St7789::HardwareReset() { @@ -191,5 +174,3 @@ void St7789::Wakeup() { NormalModeOn(); DisplayOn(); } - - |
