ISF15ACP4 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
isf15acp4.hpp
Go to the documentation of this file.
1
15#ifndef ISF15ACP4_HPP
16#define ISF15ACP4_HPP
17
18#include <algorithm>
19#include <array>
20#include <cstddef>
21#include <cstdint>
22#include <span>
23
24#include "isf15acp4_button.hpp"
25#include "isf15acp4_detail.hpp"
28#include "isf15acp4_types.hpp"
29#include "isf15acp4_version.h"
30
31namespace isf15acp4 {
32
35 uint8_t columns{1};
36 uint8_t start_row{0};
37 uint8_t rows{64};
38 uint8_t vertical{0};
40};
41
42namespace detail {
43
45template <typename Port>
46concept DeclaresReadSwitch = requires(Port& port, bool& high) { port.ReadSwitch(high); };
47
50template <typename Port>
51concept HasReadSwitch =
52 requires { ExactHook<Port, bool(bool&) noexcept>::Take(&Port::ReadSwitch); };
53
55template <typename Port>
56concept DeclaresNowMs = requires(Port& port) { port.NowMs(); };
57
59template <typename Port>
60concept HasNowMs = requires { ExactHook<Port, uint32_t() noexcept>::Take(&Port::NowMs); };
61
63template <typename Port>
64concept DeclaresDelayUs = requires(Port& port) { port.DelayUs(1_u32); };
65
68template <typename Port>
69concept HasDelayUs = requires { ExactHook<Port, void(uint32_t) noexcept>::Take(&Port::DelayUs); };
70
72template <typename Port>
73concept DeclaresLog = requires(Port& port) { port.Log(LogLevel::Info, ""); };
74
76template <typename Port>
77concept HasLog =
78 requires { ExactHook<Port, void(LogLevel, const char*) noexcept>::Take(&Port::Log); };
79
82template <typename Port>
83void DelayUs(Port& port, uint32_t us) noexcept {
84 if constexpr (HasDelayUs<Port>) {
85 port.DelayUs(us);
86 } else {
87 static_assert(kAlwaysFalse<Port>,
88 "isf15acp4: the port must implement `void DelayUs(uint32_t us) noexcept`");
89 }
90}
91
93template <typename Port>
94void Log(Port& port, LogLevel level, const char* message) noexcept {
95 if constexpr (HasLog<Port>) {
96 port.Log(level, message);
97 } else {
98 // A port without Log(): every parameter is used in each instantiation (Rule 0.2.2).
99 static_cast<void>(port);
100 static_cast<void>(level);
101 static_cast<void>(message);
102 }
103}
104
106struct PixelBytes {
107 std::array<uint8_t, 3> bytes{};
108 std::size_t count{0};
109};
110
112constexpr std::size_t BytesPerPixel(ColorDepth depth) noexcept {
113 switch (depth) {
115 return 1U;
117 return 2U;
119 return 3U;
120 default:
121 break;
122 }
123 return 2U;
124}
125
128constexpr bool BlueFirst(const Config& config) noexcept {
129 return config.red_on_segment_a != config.remap.reverse_colour_order;
130}
131
133constexpr PixelBytes EncodePixel(ColorDepth depth, Color color, bool blue_first) noexcept {
134 const Channels ch = Split(color);
135 const uint32_t first = blue_first ? ch.blue : ch.red; // colour C, 5 bits
136 const uint32_t second = ch.green; // colour B, 6 bits
137 const uint32_t third = blue_first ? ch.red : ch.blue; // colour A, 5 bits
138 PixelBytes p{};
139 switch (depth) {
141 p.bytes[0] =
142 static_cast<uint8_t>(((first >> 2U) << 5U) | ((second >> 3U) << 2U) | (third >> 3U));
143 p.count = 1U;
144 break;
146 p.bytes[0] = static_cast<uint8_t>((first << 3U) | (second >> 3U));
147 p.bytes[1] = static_cast<uint8_t>(((second & 0x07U) << 5U) | third);
148 p.count = 2U;
149 break;
151 p.bytes[0] = static_cast<uint8_t>(first << 1U);
152 p.bytes[1] = static_cast<uint8_t>(second);
153 p.bytes[2] = static_cast<uint8_t>(third << 1U);
154 p.count = 3U;
155 break;
156 default:
157 break;
158 }
159 return p;
160}
161
163constexpr int32_t ParameterCount(uint8_t opcode) noexcept {
164 switch (opcode) {
167 return 2;
168 case reg::kDimWindow:
170 return 4;
178 case reg::kRemap:
179 case reg::kStartLine:
181 case reg::kMultiplex:
183 case reg::kPowerSave:
187 case reg::kVcomh:
189 case reg::kFillEnable:
190 return 1;
191 case reg::kModeNormal:
192 case reg::kModeAllOn:
193 case reg::kModeAllOff:
195 case reg::kDisplayDim:
196 case reg::kDisplayOff:
197 case reg::kDisplayOn:
199 case reg::kNopBC:
200 case reg::kNopBD:
201 case reg::kNopE3:
202 case reg::kScrollOff:
203 case reg::kScrollOn:
204 return 0;
205 case reg::kDimMode:
207 return 5;
209 return 32;
210 case reg::kDrawLine:
211 return 7;
213 return 10;
214 case reg::kCopy:
215 return 6;
216 default:
217 break;
218 }
219 return -1;
220}
221
222static_assert((ParameterCount(reg::kSetColumnAddress) == 2) &&
223 (ParameterCount(reg::kDrawRectangle) == 10) &&
224 (ParameterCount(reg::kGrayScaleTable) == 32) && (ParameterCount(0x00_u8) == -1),
225 "Table 10: the parameter counts");
226static_assert(EncodePixel(ColorDepth::Colors65k, kRed, true).bytes[1] == 0x1FU,
227 "C first: with blue as C, red is the low five bits");
228static_assert(EncodePixel(ColorDepth::Colors65k, kBlue, true).bytes[0] == 0xF8U,
229 "C = blue is first");
230
231} // namespace detail
232
233// clang-format off: the table below must keep one row per line.
257// clang-format on
258template <SpiPort Port>
260 static_assert(
261 !detail::DeclaresReadSwitch<Port> || detail::HasReadSwitch<Port>,
262 "isf15acp4: the optional ReadSwitch hook must be `bool ReadSwitch(bool& high) noexcept`");
263 static_assert(!detail::DeclaresNowMs<Port> || detail::HasNowMs<Port>,
264 "isf15acp4: the optional NowMs hook must be `uint32_t NowMs() noexcept`");
265 static_assert(
266 !detail::DeclaresDelayUs<Port> || detail::HasDelayUs<Port>,
267 "isf15acp4: the DelayUs hook must be `void DelayUs(uint32_t us) noexcept`, so that no "
268 "wait is truncated");
269 static_assert(!detail::DeclaresLog<Port> || detail::HasLog<Port>,
270 "isf15acp4: the optional Log hook must be `void Log(LogLevel, const char* message) "
271 "noexcept`");
272
273public:
279 explicit ISF15ACP4(Port& port, const Config& config = {}) noexcept
280 : bus_(port), config_(config), button_(config.button),
281 multiplex_(GeometryOf(config.variant).multiplex) {}
282
284 ISF15ACP4(const ISF15ACP4&) = delete;
286 ISF15ACP4& operator=(const ISF15ACP4&) = delete;
287
290
303
305 [[nodiscard]] bool IsInitialized() const noexcept {
306 return initialized_;
307 }
308
321
328 Result<void> Reinitialize() noexcept;
329
333
339 Result<void> DisplayOn() noexcept;
340
345 Result<void> DisplayDim() noexcept;
346
354 Result<void> DisplayOff() noexcept;
355
357 [[nodiscard]] Output GetOutput() const noexcept {
358 return output_;
359 }
361 [[nodiscard]] bool IsSupplyEnabled() const noexcept {
362 return vcc_on_;
363 }
364
368
381 Result<void> ApplyConfig(const Config& config) noexcept;
382
384 [[nodiscard]] const Config& GetConfig() const& noexcept {
385 return config_;
386 }
388 void GetConfig() const&& = delete;
389
391 [[nodiscard]] Geometry GetGeometry() const noexcept {
392 return GeometryOf(config_.variant);
393 }
394
406 Result<void> SetContrast(uint8_t a, uint8_t b, uint8_t c) noexcept;
412 Result<void> SetMasterCurrent(uint8_t step) noexcept;
422 Result<void> SetPrechargeSpeed(uint8_t a, uint8_t b, uint8_t c) noexcept;
429 Result<void> SetRemap(const Remap& remap) noexcept;
435 Result<void> SetStartLine(uint8_t line) noexcept;
441 Result<void> SetDisplayOffset(uint8_t offset) noexcept;
454 Result<void> SetMultiplexRatio(uint8_t rows) noexcept;
470 Result<void> SetPowerSave(bool enable) noexcept;
477 Result<void> SetPhasePeriods(uint8_t phase1, uint8_t phase2) noexcept;
484 Result<void> SetClock(uint8_t divide, uint8_t frequency) noexcept;
492 Result<void> SetGrayScaleTable(std::span<const uint8_t, reg::kGrayScaleEntries> widths) noexcept;
500 Result<void> SetPrechargeLevel(uint8_t level) noexcept;
506 Result<void> SetVcomh(uint8_t level) noexcept;
513 Result<void> SetCommandLock(bool lock) noexcept;
515 Result<void> Nop() noexcept;
516
520
526 Result<void> Present(std::span<const Color> frame) noexcept;
527
542 Result<void> WriteWindow(uint8_t x, uint8_t y, uint8_t width, uint8_t height,
543 std::span<const Color> pixels) noexcept;
544
555 Result<void> WriteWindowRaw(uint8_t x, uint8_t y, uint8_t width, uint8_t height,
556 std::span<const uint8_t> bytes) noexcept;
557
567 Result<void> FillWindow(uint8_t x, uint8_t y, uint8_t width, uint8_t height,
568 Color color) noexcept;
569
577 Result<void> SetPixel(uint8_t x, uint8_t y, Color color) noexcept;
578
584 Result<void> Clear(Color color = kBlack) noexcept;
585
588 [[nodiscard]] bool RamNeedsRewrite() const noexcept {
589 return ram_rewrite_;
590 }
591
595
605 Result<void> DrawLine(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, Color color) noexcept;
606
616 Result<void> DrawRectangle(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,
617 Color outline) noexcept;
618
629 Result<void> FillRectangle(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, Color outline,
630 Color fill) noexcept;
631
642 Result<void> CopyWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, Point dest,
643 bool reverse = false) noexcept;
644
653 Result<void> DimWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1) noexcept;
654
663 Result<void> ClearWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1) noexcept;
664
668
674 Result<void> SetupScroll(const ScrollSetup& setup) noexcept;
675
678 Result<void> ActivateScroll() noexcept;
679
682 Result<void> DeactivateScroll() noexcept;
683
685 [[nodiscard]] bool IsScrolling() const noexcept {
686 return scrolling_;
687 }
688
692
710
713 Result<bool> ReadSwitchRaw() noexcept;
714
720 Result<void> SetButtonConfig(const ButtonConfig& config) noexcept;
721
723 [[nodiscard]] bool IsButtonDown() const noexcept {
724 return button_.IsDown();
725 }
727 [[nodiscard]] uint32_t GetButtonPressCount() const noexcept {
728 return button_.PressCount();
729 }
730
733
737
754 Result<void> TraceCommand(uint8_t opcode, std::span<const uint8_t> parameters) noexcept;
755
757 [[nodiscard]] uint8_t GetLastCommandOpcode() const noexcept {
758 return last_opcode_;
759 }
762 [[nodiscard]] std::size_t GetLastTransferBytes() const noexcept {
763 return last_len_;
764 }
767 [[nodiscard]] bool IsShadowInDoubt() const noexcept {
768 return shadow_doubt_;
769 }
771 [[nodiscard]] bool IsLocked() const noexcept {
772 return locked_;
773 }
774
776
777private:
778 Result<void> powerUp(const Config& config) noexcept;
779 Result<void> sendConfig(const Config& config) noexcept;
780 Result<void> safeOff(bool wait_discharge) noexcept;
781 Result<void> turnOn(bool dim) noexcept;
782 Result<void> ready(bool ram) const noexcept;
783 Result<void> send(std::size_t length) noexcept;
784 Result<void> send1(uint8_t opcode) noexcept;
785 Result<void> send2(uint8_t opcode, uint8_t a) noexcept;
786 Result<void> sendWindow(uint8_t col0, uint8_t row0, uint8_t col1, uint8_t row1) noexcept;
787 Result<void> sendData(std::size_t length) noexcept;
788 Result<void> openWindow(uint8_t x, uint8_t y, uint8_t width, uint8_t height) noexcept;
789 void windowDone(uint8_t width, uint8_t height) noexcept;
790 Result<void> streamPixels(uint8_t width, uint8_t height, std::span<const Color> colors,
791 Color fill) noexcept;
792 Result<void> streamBytes(std::span<const uint8_t> bytes) noexcept;
793 Result<void> checkWindow(uint8_t x, uint8_t y, uint8_t width, uint8_t height) const noexcept;
794 Result<void> engineCheck(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1,
795 bool ordered) const noexcept;
796 Result<void> engineEnd() noexcept;
797 Result<void> setFillBit(bool filled) noexcept;
798 Result<void> sendRectangle(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, Color outline,
799 Color fill) noexcept;
800 Result<void> windowCommand(uint8_t opcode, uint8_t x0, uint8_t y0, uint8_t x1,
801 uint8_t y1) noexcept;
802 [[nodiscard]] std::array<uint8_t, 3> triple(Color color) const noexcept;
803 Result<void> applyIdle(uint32_t idle) noexcept;
805 void configureButton(const ButtonConfig& b) noexcept;
807 [[nodiscard]] static bool rawCommandValid(uint8_t opcode,
808 std::span<const uint8_t> parameters) noexcept;
810 void trackRawScroll(uint8_t opcode) noexcept;
812 [[nodiscard]] bool wakeWanted(const ButtonUpdate& u) const noexcept;
814 [[nodiscard]] static uint8_t prechargeByte(uint8_t level, const Config& config) noexcept;
815 Result<void> sendTiming(const Config& config) noexcept;
816 Result<void> pin(CtrlPin which, GpioSignal level) noexcept;
817 Result<void> fail(Error error, const char* message) noexcept;
818 void touch() noexcept;
819
820 detail::WriteBus<Port> bus_;
821 Config config_{};
822 ButtonDebouncer button_;
823 std::array<uint8_t, detail::kMaxCommandBytes> command_{};
824 std::array<uint8_t, detail::kDataChunkBytes> data_{};
825 std::size_t last_len_{0};
826 uint32_t last_activity_ms_{0};
827 uint8_t multiplex_{64};
828 std::array<uint8_t, 3> contrast_cap_{0x80, 0x80, 0x80};
829 uint8_t last_opcode_{0};
830 ScrollSetup scroll_{};
831 Output output_{Output::Off};
832 bool initialized_{false};
833 bool vcc_on_{false};
834 bool locked_{false};
835 bool scrolling_{false};
836 bool scroll_set_{false};
837 bool ram_rewrite_{false};
838 bool shadow_doubt_{false};
839 bool activity_valid_{false};
840 bool idle_lowered_{false};
841};
842
843} // namespace isf15acp4
844
845// codeql::misra_deviation_next_line(MD-CPP-009)
846#include "../src/isf15acp4.ipp" // IWYU pragma: export
847
848#endif // ISF15ACP4_HPP
Driver for one ISF15ACP4 on a platform port.
Definition isf15acp4.hpp:259
Result< void > ApplyConfig(const Config &config) noexcept
Change the whole configuration.
Result< ButtonUpdate > Poll() noexcept
Sample the switch, debounce it and apply the idle timers.
Result< void > SetDisplayOffset(uint8_t offset) noexcept
Set the display offset, 0 to 63 (A2h).
ISF15ACP4(Port &port, const Config &config={}) noexcept
Bind the driver to a port and store the configuration. No I/O, cannot fail.
Definition isf15acp4.hpp:279
Result< void > CopyWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, Point dest, bool reverse=false) noexcept
Copy a window to another place (26h, 23h); the destination must fit in the visible area.
Result< void > SetPhasePeriods(uint8_t phase1, uint8_t phase2) noexcept
Set phase 1 and phase 2 periods, 1 to 15 DCLK each (B1h).
ISF15ACP4(const ISF15ACP4 &)=delete
One driver object per module.
Result< void > SetPowerSave(bool enable) noexcept
Enable or disable the power save mode (B0h).
ISF15ACP4 & operator=(const ISF15ACP4 &)=delete
One driver object per module.
Result< void > SetMultiplexRatio(uint8_t rows) noexcept
Set the multiplex ratio, 16 to 64 rows (A8h). Vertical scrolling needs 64. Not stored in Config: a re...
Result< void > SetContrast(uint8_t a, uint8_t b, uint8_t c) noexcept
Set the contrast of the three colours (81h, 82h, 83h).
Result< void > NotifyActivity() noexcept
Restart the idle timers from now.
Result< void > DrawLine(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, Color color) noexcept
Draw a line with the controller's engine (21h), then wait engine_settle_us.
Result< void > SetDimSettings(const DimSettings &dim) noexcept
Set the dim mode parameters (ABh); they apply at the next DisplayDim().
Result< void > SetMasterCurrent(uint8_t step) noexcept
Set the master current attenuation, 0 to 15 (87h).
Result< void > SetDisplayMode(DisplayMode mode) noexcept
Set what the pixels show (A4h to A7h).
Result< void > Deinitialize() noexcept
The power-down: command unlock, display off, supply off, wait vcc_off_ms. Never refused.
Result< void > SetPrechargeSpeed(uint8_t a, uint8_t b, uint8_t c) noexcept
Set the second pre-charge speed of the three colours; all six bytes go out together (8Ah to 8Ch)....
Result< void > EnsureInitialized() noexcept
Power up to state 1: the controller is reset, configured and cleared, the supply is off.
const Config & GetConfig() const &noexcept
Definition isf15acp4.hpp:384
void GetConfig() const &&=delete
Not on a temporary driver: the reference would dangle (KB-CPP20-044).
Result< void > SetRemap(const Remap &remap) noexcept
Set the remap and colour depth (A0h). Changes how pixels are sent: ColorDepth, vertical_increment.
std::size_t GetLastTransferBytes() const noexcept
Definition isf15acp4.hpp:762
uint32_t GetButtonPressCount() const noexcept
Definition isf15acp4.hpp:727
Result< void > UseLinearGrayScale() noexcept
Reload the built-in linear gray scale table (B9h).
bool IsShadowInDoubt() const noexcept
Definition isf15acp4.hpp:767
Result< void > SetClock(uint8_t divide, uint8_t frequency) noexcept
Set the clock divide ratio (this + 1) and oscillator frequency, 0 to 15 each (B3h).
Result< void > SetGrayScaleTable(std::span< const uint8_t, reg::kGrayScaleEntries > widths) noexcept
Set the 32 gray scale pulse widths GS1, GS3 ... GS63, each 1 to 125 and rising (B8h)....
Result< void > FillRectangle(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, Color outline, Color fill) noexcept
Draw a filled rectangle (26h, 22h) with an outline colour and a fill colour.
Result< void > DrawRectangle(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, Color outline) noexcept
Draw a rectangle outline (26h, 22h), then wait engine_settle_us.
bool IsSupplyEnabled() const noexcept
Definition isf15acp4.hpp:361
Result< void > SetStartLine(uint8_t line) noexcept
Set the display start line, 0 to 63 (A1h).
bool IsLocked() const noexcept
Definition isf15acp4.hpp:771
constexpr uint8_t kScrollOff
2Eh: stop scrolling (9.2.8).
Definition isf15acp4_registers.hpp:80
constexpr uint8_t kDimWindow
24h + 4 bytes (9.2.4).
Definition isf15acp4_registers.hpp:76
constexpr uint8_t kModeInverse
A7h: GS0 <-> GS63.
Definition isf15acp4_registers.hpp:54
constexpr uint8_t kDisplayOffset
A2h + display offset (9.1.8).
Definition isf15acp4_registers.hpp:50
constexpr uint8_t kDrawRectangle
22h + 10 bytes (9.2.2).
Definition isf15acp4_registers.hpp:74
constexpr uint8_t kSetContrastA
81h + contrast of colour A (9.1.3).
Definition isf15acp4_registers.hpp:40
constexpr uint8_t kLinearGrayScale
B9h: built-in linear table (9.1.18).
Definition isf15acp4_registers.hpp:65
constexpr uint8_t kGrayScaleTable
B8h + 32 pulse widths (9.1.17).
Definition isf15acp4_registers.hpp:64
constexpr uint8_t kModeAllOn
A5h: every pixel at GS63.
Definition isf15acp4_registers.hpp:52
constexpr uint8_t kPrechargeSpeedC
8Ch + speed of colour C.
Definition isf15acp4_registers.hpp:47
constexpr uint8_t kModeNormal
A4h: normal display (9.1.9).
Definition isf15acp4_registers.hpp:51
constexpr uint8_t kDisplayOff
AEh: display off, sleep.
Definition isf15acp4_registers.hpp:59
constexpr uint8_t kSetRowAddress
75h + start, end (section 9.1.2).
Definition isf15acp4_registers.hpp:39
constexpr uint8_t kDisplayOn
AFh: display on, normal brightness.
Definition isf15acp4_registers.hpp:60
constexpr uint8_t kNopBD
BDh: no operation.
Definition isf15acp4_registers.hpp:68
constexpr uint8_t kCommandLock
FDh + 12h unlock or 16h lock (9.1.22).
Definition isf15acp4_registers.hpp:72
constexpr uint8_t kPhasePeriods
B1h + phase 1 and 2 periods (9.1.15).
Definition isf15acp4_registers.hpp:62
constexpr uint8_t kNopE3
E3h: no operation.
Definition isf15acp4_registers.hpp:71
constexpr uint8_t kSetColumnAddress
15h + start, end (section 9.1.1).
Definition isf15acp4_registers.hpp:38
constexpr uint8_t kClockDivider
B3h + divide ratio and frequency (9.1.16).
Definition isf15acp4_registers.hpp:63
constexpr uint8_t kScrollSetup
27h + 5 bytes (9.2.7).
Definition isf15acp4_registers.hpp:79
constexpr uint8_t kDisplayDim
ACh: display on in dim mode (9.1.13).
Definition isf15acp4_registers.hpp:58
constexpr uint8_t kSetContrastB
82h + contrast of colour B.
Definition isf15acp4_registers.hpp:41
constexpr uint8_t kDrawLine
21h + 7 bytes (9.2.1).
Definition isf15acp4_registers.hpp:73
constexpr uint8_t kSetContrastC
83h + contrast of colour C.
Definition isf15acp4_registers.hpp:42
constexpr uint8_t kPrechargeSpeedB
8Bh + speed of colour B.
Definition isf15acp4_registers.hpp:46
constexpr uint8_t kFillEnable
26h + fill and reverse-copy bits (9.2.6).
Definition isf15acp4_registers.hpp:78
constexpr uint8_t kMasterCurrent
87h + attenuation 0..15 (9.1.4).
Definition isf15acp4_registers.hpp:43
constexpr uint8_t kClearWindow
25h + 4 bytes (9.2.5).
Definition isf15acp4_registers.hpp:77
constexpr uint8_t kRemap
A0h + remap and colour depth (9.1.6).
Definition isf15acp4_registers.hpp:48
constexpr uint8_t kPowerSave
B0h + 1Ah enable or 0Bh disable (9.1.14).
Definition isf15acp4_registers.hpp:61
constexpr uint8_t kCopy
23h + 6 bytes (9.2.3).
Definition isf15acp4_registers.hpp:75
constexpr uint8_t kPrechargeSpeedA
8Ah + second pre-charge speed of colour A (9.1.5).
Definition isf15acp4_registers.hpp:44
constexpr uint8_t kVcomh
BEh + VCOMH level (9.1.20).
Definition isf15acp4_registers.hpp:70
constexpr uint8_t kStartLine
A1h + display start line (9.1.7).
Definition isf15acp4_registers.hpp:49
constexpr uint8_t kScrollOn
2Fh: start scrolling (9.2.9).
Definition isf15acp4_registers.hpp:81
constexpr uint8_t kNopBC
BCh: no operation (9.1.21).
Definition isf15acp4_registers.hpp:67
constexpr uint8_t kMultiplex
A8h + N = multiplex ratio - 1 (9.1.10).
Definition isf15acp4_registers.hpp:55
constexpr uint8_t kPrechargeLevel
BBh + pre-charge voltage (9.1.19).
Definition isf15acp4_registers.hpp:66
constexpr uint8_t kModeAllOff
A6h: every pixel at GS0.
Definition isf15acp4_registers.hpp:53
constexpr uint8_t kDimMode
ABh + five bytes (9.1.11).
Definition isf15acp4_registers.hpp:56
constexpr uint8_t kMasterConfig
ADh + 8Eh: external VCC (9.1.12).
Definition isf15acp4_registers.hpp:57
constexpr Color kRed
Pure red.
Definition isf15acp4_types.hpp:576
DisplayMode
What the pixels show (A4h to A7h).
Definition isf15acp4_types.hpp:192
LogLevel
Severity passed to the optional Log() hook.
Definition isf15acp4_types.hpp:170
ColorDepth
The pixel format of GDDRAM (A0h A[7:6]).
Definition isf15acp4_types.hpp:185
Error
Why a call failed. Every call of the driver returns one of these in its Result.
Definition isf15acp4_types.hpp:41
constexpr Channels Split(Color c) noexcept
Split an RGB565 colour.
Definition isf15acp4_types.hpp:594
ScrollInterval
The time between two scroll steps (27h E).
Definition isf15acp4_types.hpp:207
Output
What the panel is doing, as far as the driver knows.
Definition isf15acp4_types.hpp:200
constexpr Geometry GeometryOf(Variant variant) noexcept
The geometry of a module (NKK sheets: pixel format; the column origin of the smaller panels is the ce...
Definition isf15acp4_types.hpp:262
constexpr Color kBlue
Pure blue.
Definition isf15acp4_types.hpp:580
@ Info
Lifecycle events: initialised, supply on or off.
@ Colors65k
2 bytes per pixel, format 1: C[4:0] B[5:0] A[4:0]. Reset value.
@ Colors256
1 byte per pixel: C[4:2] B[5:3] A[4:3].
@ Colors65kFormat2
3 bytes per pixel, format 2: six bits per byte (Table 9).
The switch debouncer: a time-injected state machine with press, release, long-press and repeat events...
Compile-time helpers of the ISF15ACP4 driver: typed integer literals, exact hook matching,...
SSD1331 command set: opcodes, parameter fields, limits and timing (SSD1331 datasheet Rev 1....
The write-only SPI port of the ISF15ACP4 driver: the CRTP base, its pin enums, the SpiPort concept an...
Public types of the ISF15ACP4 driver: errors, Result<T>, the display and button configuration,...
The ISF15ACP4 driver: everything it declares lives here; internals in detail.
Definition isf15acp4.hpp:31
GpioSignal
Logical level of a control pin; the port maps it to the physical polarity.
Definition isf15acp4_spi_interface.hpp:93
CtrlPin
The pins the port drives through GpioSet().
Definition isf15acp4_spi_interface.hpp:86
Switch handling: polarity, debounce, long press and repeat.
Definition isf15acp4_types.hpp:286
One result of ButtonDebouncer::Update().
Definition isf15acp4_button.hpp:24
A colour as the RGB565 word every call takes: red in bits 15..11, green 10..5, blue 4....
Definition isf15acp4_types.hpp:554
Everything the driver sends at start-up, and its own time knobs.
Definition isf15acp4_types.hpp:322
Dim mode parameters (ABh): used when the display is on in dim mode (ACh).
Definition isf15acp4_types.hpp:241
Geometry of a module: its visible pixels inside the 96 x 64 RAM.
Definition isf15acp4_types.hpp:249
A position in the visible area.
Definition isf15acp4_types.hpp:235
The controller settings that depend on the wiring of the panel (Remap, A0h).
Definition isf15acp4_types.hpp:224
The value of a call, or why there is none.
Definition isf15acp4_types.hpp:110
The scroll parameters of command 27h.
Definition isf15acp4.hpp:34
ScrollInterval interval
Time between steps.
Definition isf15acp4.hpp:39
uint8_t columns
Columns per step, 0 to 95 (0 = no horizontal scroll).
Definition isf15acp4.hpp:35
uint8_t rows
Rows that scroll horizontally, 1 to 64; start_row + rows <= 64.
Definition isf15acp4.hpp:37
uint8_t vertical
Rows per step, 0 to 63 (0 = none); needs a multiplex ratio of 64.
Definition isf15acp4.hpp:38
uint8_t start_row
First row that scrolls horizontally, 0 to 63.
Definition isf15acp4.hpp:36