libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
oled_display.h
Go to the documentation of this file.
1#pragma once
2#ifndef DSY_OLED_DISPLAY_H
3#define DSY_OLED_DISPLAY_H
5#include "display.h"
6
7namespace daisy
8{
13template <typename DisplayDriver>
14class OledDisplay : public OneBitGraphicsDisplayImpl<OledDisplay<DisplayDriver>>
15{
16 public:
18 virtual ~OledDisplay() {}
19
20 struct Config
21 {
22 typename DisplayDriver::Config driver_config;
23 };
24
25 void Init(Config config) { driver_.Init(config.driver_config); }
26
27 uint16_t Height() const override { return driver_.Height(); }
28 uint16_t Width() const override { return driver_.Width(); }
29
34 void Fill(bool on) override { driver_.Fill(on); }
35
42 void DrawPixel(uint_fast8_t x, uint_fast8_t y, bool on) override
43 {
44 driver_.DrawPixel(x, y, on);
45 }
46
51 void Update() override { driver_.Update(); }
52
53 private:
54 DisplayDriver driver_;
55
56 void Reset() { driver_.Reset(); };
57 void SendCommand(uint8_t cmd) { driver_.SendCommand(cmd); };
58 void SendData(uint8_t* buff, size_t size) { driver_.SendData(buff, size); };
59};
60
61} // namespace daisy
62
63#endif
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_display.h:15
void Fill(bool on) override
Definition oled_display.h:34
void Init(Config config)
Definition oled_display.h:25
uint16_t Width() const override
Definition oled_display.h:28
OledDisplay()
Definition oled_display.h:17
virtual ~OledDisplay()
Definition oled_display.h:18
uint16_t Height() const override
Definition oled_display.h:27
void DrawPixel(uint_fast8_t x, uint_fast8_t y, bool on) override
Definition oled_display.h:42
void Update() override
Definition oled_display.h:51
Definition display.h:216
Hardware defines and helpers for daisy field platform.
Definition index.h:2
Definition oled_display.h:21
DisplayDriver::Config driver_config
Definition oled_display.h:22