diff options
| author | JF <jf@codingfield.com> | 2019-12-07 17:11:50 +0100 |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2019-12-07 17:11:50 +0100 |
| commit | 6fbb6c8f70b2103fd88d8d9da3ce884a283b1bfd (patch) | |
| tree | 000f0851f3517b9b8a40c16d4c6bf34fd834b24c /src/Components/Gfx/Gfx.h | |
| parent | 0db16bd8279826878e9d2d5ba63e21c4e15c35bf (diff) | |
Convert Spi and GFX to C++.
Diffstat (limited to 'src/Components/Gfx/Gfx.h')
| -rw-r--r-- | src/Components/Gfx/Gfx.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Components/Gfx/Gfx.h b/src/Components/Gfx/Gfx.h new file mode 100644 index 00000000..72293de9 --- /dev/null +++ b/src/Components/Gfx/Gfx.h @@ -0,0 +1,26 @@ +#pragma once +#include <cstdint> +#include <nrf_font.h> + + +namespace Pinetime { + namespace Drivers { + class St7789; + } + namespace Components { + class Gfx { + public: + explicit Gfx(Drivers::St7789& lcd); + void ClearScreen(); + void DrawString(uint8_t x, uint8_t y, uint16_t color, const char* text, const FONT_INFO *p_font, bool wrap); + void DrawChar(const FONT_INFO *font, uint8_t c, uint8_t *x, uint8_t y, uint16_t color); + + + private: + Drivers::St7789& lcd; + const uint8_t width = 240; + const uint8_t height = 240; + void pixel_draw(uint8_t x, uint8_t y, uint16_t color); + }; + } +} |
