libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
oled_color_display.h
Go to the documentation of this file.
1#pragma once
2#include "color_display.h"
3
4namespace daisy
5{
10template <typename DisplayDriver>
12: public ColorGraphicsDisplayImpl<OledColorDisplay<DisplayDriver>>
13{
14 public:
16 virtual ~OledColorDisplay() {}
17
18 struct Config
19 {
20 typename DisplayDriver::Config driver_config;
21 };
22
23 void Init(Config config) { driver_.Init(config.driver_config); }
24
25 uint16_t Height() const override { return driver_.Height(); }
26 uint16_t Width() const override { return driver_.Width(); }
27
32 void Fill(bool on) override { driver_.Fill(on); }
33
40 void DrawPixel(uint_fast8_t x, uint_fast8_t y, bool on) override
41 {
42 driver_.DrawPixel(x, y, on);
43 }
44
52 {
53 driver_.SetColorFG(red, green, blue);
54 }
55
63 {
64 driver_.SetColorBG(red, green, blue);
65 }
66
71 void Update() override { driver_.Update(); }
72
73 private:
74 DisplayDriver driver_;
75
76 void Reset() { driver_.Reset(); };
77 void SendCommand(uint8_t cmd) { driver_.SendCommand(cmd); };
78 void SendData(uint8_t* buff, size_t size) { driver_.SendData(buff, size); };
79};
80
81} // namespace daisy
Definition color_display.h:230
Definition leddriver.h:33
void Init(I2CHandle i2c, const uint8_t(&addresses)[numDrivers], DmaBuffer dma_buffer_a, DmaBuffer dma_buffer_b, Pin oe_pin=Pin(PORTX, 0))
Definition leddriver.h:65
Definition oled_color_display.h:13
void Update() override
Definition oled_color_display.h:71
virtual ~OledColorDisplay()
Definition oled_color_display.h:16
OledColorDisplay()
Definition oled_color_display.h:15
uint16_t Height() const override
Definition oled_color_display.h:25
void Fill(bool on) override
Definition oled_color_display.h:32
void SetColorFG(uint8_t red, uint8_t green, uint8_t blue)
Definition oled_color_display.h:51
void DrawPixel(uint_fast8_t x, uint_fast8_t y, bool on) override
Definition oled_color_display.h:40
void SetColorBG(uint8_t red, uint8_t green, uint8_t blue)
Definition oled_color_display.h:62
void Init(Config config)
Definition oled_color_display.h:23
uint16_t Width() const override
Definition oled_color_display.h:26
Hardware defines and helpers for daisy field platform.
Definition index.h:2
Definition oled_color_display.h:19
DisplayDriver::Config driver_config
Definition oled_color_display.h:20