13#include <idfxx/epaper/panel>
16#include <idfxx/memory>
17#include <idfxx/panel_io>
22#include <frequency/frequency>
23#include <initializer_list>
119#ifdef CONFIG_COMPILER_CXX_EXCEPTIONS
189 , _mirror_x(config.mirror_x)
190 , _mirror_y(config.mirror_y)
191 , _shadow(std::move(shadow)) {}
195 do_write(
const mono_framebuffer& fb,
size_t row_start,
size_t row_end,
size_t x,
size_t y)
override;
197 do_write(
const gray4_framebuffer& fb,
size_t row_start,
size_t row_end,
size_t x,
size_t y)
override;
206 [[nodiscard]]
result<void> _cmd(uint8_t cmd, std::initializer_list<uint8_t> params);
207 [[nodiscard]]
result<void> _cmd(uint8_t cmd, std::span<const uint8_t> params);
208 [[nodiscard]]
result<void> _stream(uint8_t cmd, std::span<const uint8_t> data);
215 _write_planes(region window, std::span<const uint8_t> new_plane, std::span<const uint8_t> old_plane);
217 [[nodiscard]]
size_t _stride() const noexcept {
return (
width() + 7) / 8; }
220 bool _mirror_x =
false;
221 bool _mirror_y =
false;
225 std::vector<uint8_t, dram_allocator<uint8_t>> _shadow;
Abstract base class for ePaper display panels.
std::chrono::milliseconds busy_timeout() const noexcept
Returns the default BUSY timeout.
size_t height() const noexcept
Returns the panel height in pixels.
gpio reset_gpio() const noexcept
Returns the reset output pin (may be unconnected).
gpio busy_gpio() const noexcept
Returns the BUSY input pin (may be unconnected).
enum color_mode color_mode() const noexcept
Returns the panel's current pixel format.
size_t width() const noexcept
Returns the panel width in pixels.
SSD1680 ePaper display controller driver.
static result< ssd1680 > make(idfxx::panel_io &panel_io, config config)
Creates a new SSD1680 panel driver.
ssd1680(ssd1680 &&other) noexcept
ssd1680(const ssd1680 &)=delete
ssd1680(idfxx::panel_io &panel_io, config config)
Creates a new SSD1680 panel driver.
static panel_io::spi_config spi_io_config(gpio cs, gpio dc, freq::hertz pclk=freq::hertz{10 '000 '000}) noexcept
Returns a panel I/O configuration for communicating with an SSD1680 over SPI.
ssd1680 & operator=(ssd1680 &&other) noexcept
ssd1680 & operator=(const ssd1680 &)=delete
static constexpr gpio nc()
Returns a GPIO representing "not connected".
Panel I/O interface for SPI- and I2C-connected displays.
ePaper display driver classes.
refresh_mode
Refresh style for panel::refresh.
std::expected< T, std::error_code > result
result type wrapping a value or error code.
STL-compatible allocator for capability-based memory regions.
Configuration structure for SSD1680 panels.
size_t height
Panel height in pixels (gates). The controller drives up to 296.
bool mirror_x
Mirror the image horizontally (reverses the source scan via the controller's address decrement mode)....
bool mirror_y
Mirror the image vertically (reverses the gate scan via the controller's address decrement mode).
gpio reset_gpio
GPIO wired to the panel's reset line, or gpio::nc() if not wired.
std::chrono::milliseconds busy_timeout
Maximum time to wait for the BUSY line to release.
gpio busy_gpio
GPIO wired to the panel's BUSY output (required).
size_t width
Panel width in pixels (sources).
SPI-based panel I/O configuration.