diff options
| author | JF <jf@codingfield.com> | 2019-12-07 16:11:50 (GMT) |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2019-12-07 16:11:50 (GMT) |
| commit | 6fbb6c8f70b2103fd88d8d9da3ce884a283b1bfd (patch) | |
| tree | 000f0851f3517b9b8a40c16d4c6bf34fd834b24c /src/drivers/st7789.h | |
| parent | 0db16bd8279826878e9d2d5ba63e21c4e15c35bf (diff) | |
Convert Spi and GFX to C++.
Diffstat (limited to 'src/drivers/st7789.h')
| -rw-r--r-- | src/drivers/st7789.h | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/drivers/st7789.h b/src/drivers/st7789.h deleted file mode 100644 index 6f744a1..0000000 --- a/src/drivers/st7789.h +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -namespace Pinetime { - namespace Drivers { - class st7789 { - public: - ret_code_t Init(); - void Uninit(); - void DrawPixel(uint16_t x, uint16_t y, uint32_t color); - void DrawRectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint32_t color); - void FillRectangle(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint16_t color); - - private: - ret_code_t InitHw() const; - void InitCommands(); - - void SoftwareReset(); - void SleepOut(); - void ColMod(); - void MemoryDataAccessControl(); - void DisplayInversionOn(); - void NormalModeOn(); - void WriteToRam(); - void DisplayOn(); - void DisplayOff(); - - void SetAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1); - - void WriteCommand(uint8_t cmd); - void WriteSpi(const uint8_t* data, size_t size); - - enum class Commands : uint8_t { - SoftwareReset = 0x01, - SleepOut = 0x11, - NormalModeOn = 0x13, - DisplayInversionOn = 0x21, - DisplayOff = 0x28, - DisplayOn = 0x29, - ColumnAddressSet = 0x2a, - RowAddressSet = 0x2b, - WriteToRam = 0x2c, - MemoryDataAccessControl = 036, - ColMod = 0x3a, - }; - void WriteData(uint8_t data); - void ColumnAddressSet(); - - static constexpr uint16_t Width = 240; - static constexpr uint16_t Height = 240; - void RowAddressSet(); - - }; - } -} - - |
