InfiniTime/src/Components/Gfx/Gfx.h
JF c1f3a31b51 Disable SPI, I²C, touch controller and display controller in sleep mode.
Re-enable them on wake up.

Remove delays that were not needed in st7889 driver.

Hopefully, it'll improve the battery life!
2020-01-17 22:16:45 +01:00

30 lines
797 B
C++

#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);
void FillRectangle(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint16_t color);
void Sleep();
void Wakeup();
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);
};
}
}