aboutsummaryrefslogtreecommitdiffstats
path: root/src/Components/Gfx/Gfx.h
diff options
context:
space:
mode:
authorAvamander <avamander@gmail.com>2020-10-02 21:44:27 +0300
committerAvamander <avamander@gmail.com>2020-10-02 21:44:27 +0300
commit40a643d203d2d21834dd2b35d83419a56a3939b6 (patch)
tree522947ffe2e7c10f6e8c45a6e7d1e58d3521829b /src/Components/Gfx/Gfx.h
parent455d8319e4af521de4e24cfa423a4c06c4378a8d (diff)
Renamed Components/ to components/
Diffstat (limited to 'src/Components/Gfx/Gfx.h')
-rw-r--r--src/Components/Gfx/Gfx.h60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/Components/Gfx/Gfx.h b/src/Components/Gfx/Gfx.h
deleted file mode 100644
index 091f06f5..00000000
--- a/src/Components/Gfx/Gfx.h
+++ /dev/null
@@ -1,60 +0,0 @@
-#pragma once
-#include <cstdint>
-#include <nrf_font.h>
-#include <drivers/BufferProvider.h>
-#include <FreeRTOS.h>
-#include <task.h>
-
-
-namespace Pinetime {
- namespace Drivers {
- class St7789;
- }
- namespace Components {
- class Gfx : public Pinetime::Drivers::BufferProvider {
- public:
- explicit Gfx(Drivers::St7789& lcd);
- void Init();
- 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 FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b);
- void SetScrollArea(uint16_t topFixedLines, uint16_t scrollLines, uint16_t bottomFixedLines);
- void SetScrollStartLine(uint16_t line);
-
-
- void Sleep();
- void Wakeup();
- bool GetNextBuffer(uint8_t **buffer, size_t &size) override;
- void pixel_draw(uint8_t x, uint8_t y, uint16_t color);
-
-
- private:
- static constexpr uint8_t width = 240;
- static constexpr uint8_t height = 240;
-
- enum class Action { None, FillRectangle, DrawChar};
- struct State {
- State() : busy{false}, action{Action::None}, remainingIterations{0}, currentIteration{0} {}
- volatile bool busy;
- volatile Action action;
- volatile uint16_t remainingIterations;
- volatile uint16_t currentIteration;
- volatile FONT_INFO *font;
- volatile uint16_t color;
- volatile uint8_t character;
- volatile TaskHandle_t taskToNotify = nullptr;
- };
-
- volatile State state;
-
- uint16_t buffer[width]; // 1 line buffer
- Drivers::St7789& lcd;
-
- void SetBackgroundColor(uint16_t color);
- void WaitTransfertFinished() const;
- void NotifyEndOfTransfert(TaskHandle_t task);
- };
- }
-}