ISF15ACP4 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
isf15acp4_types.hpp
Go to the documentation of this file.
1
17#ifndef ISF15ACP4_TYPES_HPP
18#define ISF15ACP4_TYPES_HPP
19
20#include <cstdint>
21
22#include "isf15acp4_detail.hpp"
24#include "isf15acp4_version.h"
25
27namespace isf15acp4 {
28
41enum class [[nodiscard]] Error : uint8_t {
42 Ok = 0,
43 NotInitialized = 1,
44 InvalidArgument = 2,
45 Bus = 3,
46 Timeout = 4,
48 5,
49 Crc = 6,
50 Busy = 7,
51 DeviceFault = 8,
52 Unsupported = 9,
54 // Chip-specific values start at 16; each one is returned by some call (tests/test_errors.cpp).
55 ScrollActive = 16,
56 ScrollNotSet = 17,
57 SupplyOff = 18,
58 Locked = 19,
59};
60
66constexpr const char* ToString(Error error) noexcept {
67 switch (error) {
68 case Error::Ok:
69 return "Ok";
71 return "NotInitialized";
73 return "InvalidArgument";
74 case Error::Bus:
75 return "Bus";
76 case Error::Timeout:
77 return "Timeout";
79 return "DeviceIdMismatch";
80 case Error::Crc:
81 return "Crc";
82 case Error::Busy:
83 return "Busy";
85 return "DeviceFault";
87 return "Unsupported";
89 return "ScrollActive";
91 return "ScrollNotSet";
93 return "SupplyOff";
94 case Error::Locked:
95 return "Locked";
96 default:
97 break;
98 }
99 return "Unknown";
100}
101
109template <typename T>
110struct [[nodiscard]] Result {
111 T value{};
112 Error error{Error::Ok};
113
115 [[nodiscard]] constexpr bool ok() const noexcept {
116 return error == Error::Ok;
117 }
119 constexpr explicit operator bool() const noexcept {
120 return ok();
121 }
122
128 static constexpr Result Success(T v) noexcept {
129 return {v, Error::Ok};
130 }
136 static constexpr Result Failure(Error e) noexcept {
137 return {T{}, e};
138 }
139};
140
142template <>
143struct [[nodiscard]] Result<void> {
144 Error error{Error::Ok};
145
147 [[nodiscard]] constexpr bool ok() const noexcept {
148 return error == Error::Ok;
149 }
151 constexpr explicit operator bool() const noexcept {
152 return ok();
153 }
154
156 static constexpr Result Success() noexcept {
157 return {Error::Ok};
158 }
164 static constexpr Result Failure(Error e) noexcept {
165 return {e};
166 }
167};
168
170enum class LogLevel : uint8_t {
171 Error = 0,
172 Warning,
173 Info,
174 Debug,
175};
176
178enum class Variant : uint8_t {
179 Isf15acp4 = 0,
180 Isc15anp4 = 1,
181 Isc01p = 2,
182};
183
185enum class ColorDepth : uint8_t {
186 Colors256 = 0,
187 Colors65k = 1,
188 Colors65kFormat2 = 2,
189};
190
192enum class DisplayMode : uint8_t {
193 Normal = 0,
194 AllOn = 1,
195 AllOff = 2,
196 Inverse = 3,
197};
198
200enum class Output : uint8_t {
201 Off = 0,
202 Normal = 1,
203 Dim = 2,
204};
205
207enum class ScrollInterval : uint8_t {
208 Frames6 = 0,
209 Frames10 = 1,
210 Frames100 = 2,
211 Frames200 = 3,
212};
213
215enum class ButtonEvent : uint8_t {
216 None = 0,
217 Pressed = 1,
218 Released = 2,
219 LongPress = 3,
220 Repeat = 4,
221};
222
233
235struct Point {
236 uint8_t x{0};
237 uint8_t y{0};
238};
239
242 uint8_t contrast_a{0x0E};
243 uint8_t contrast_b{0x17};
244 uint8_t contrast_c{0x16};
245 uint8_t precharge{0x12};
246};
247
249struct Geometry {
250 uint8_t width{96};
251 uint8_t height{64};
252 uint8_t column_origin{0};
253 uint8_t multiplex{64};
254};
255
262constexpr Geometry GeometryOf(Variant variant) noexcept {
263 switch (variant) {
265 return Geometry{.width = 96, .height = 64, .column_origin = 0, .multiplex = 64};
267 return Geometry{.width = 64, .height = 48, .column_origin = 16, .multiplex = 48};
268 case Variant::Isc01p:
269 return Geometry{.width = 52, .height = 36, .column_origin = 22, .multiplex = 36};
270 default:
271 break;
272 }
273 return Geometry{.width = 96, .height = 64, .column_origin = 0, .multiplex = 64};
274}
275
281constexpr bool HasSwitch(Variant variant) noexcept {
282 return variant != Variant::Isc01p;
283}
284
287 bool active_low{true};
288 uint32_t debounce_ms{20};
289 uint32_t long_press_ms{800};
290 uint32_t repeat_interval_ms{0};
291 uint32_t repeat_delay_ms{500};
292};
293
300constexpr bool SameButtonConfig(const ButtonConfig& a, const ButtonConfig& b) noexcept {
301 return (a.active_low == b.active_low) && (a.debounce_ms == b.debounce_ms) &&
302 (a.long_press_ms == b.long_press_ms) && (a.repeat_interval_ms == b.repeat_interval_ms) &&
303 (a.repeat_delay_ms == b.repeat_delay_ms);
304}
305
307inline constexpr uint32_t kButtonTimeMaxMs = 60000;
309inline constexpr uint32_t kWaitMaxMs = 1000;
311inline constexpr uint32_t kEngineSettleMaxUs = 100000;
312
322struct Config {
325 uint8_t contrast_a{0x1C};
326 uint8_t contrast_b{0x2E};
327 uint8_t contrast_c{0x2C};
328 uint8_t precharge_speed_a{0x4F};
329 uint8_t precharge_speed_b{0x74};
330 uint8_t precharge_speed_c{0x88};
331 uint8_t master_current{0x0F};
332 uint8_t start_line{0};
333 uint8_t display_offset{0};
336 bool power_save{false};
337 uint8_t phase1{7};
338 uint8_t phase2{1};
339 uint8_t clock_divide{0};
340 uint8_t clock_frequency{15};
341 uint8_t precharge_level{14};
342 bool precharge_bit0{true};
344 uint8_t vcomh_level{16};
345 bool linear_gray_scale{true};
346 bool clear_ram{true};
347 bool red_on_segment_a{true};
349 uint32_t vcc_settle_ms{50};
351 uint32_t engine_settle_us{3000};
352 uint32_t idle_dim_ms{0};
353 uint32_t idle_sleep_ms{0};
355};
356
362constexpr Config PresetFor(Variant variant) noexcept {
363 Config c{};
364 c.variant = variant;
365 if (variant == Variant::Isf15acp4) {
366 return c;
367 }
368 c.remap.com_left_right_swap = false;
369 c.remap.com_scan_reverse = true;
370 c.start_line = 0;
371 c.phase1 = 4;
372 c.phase2 = 4;
373 c.precharge_level = 9;
374 c.precharge_bit0 = false;
375 c.send_precharge_speeds = false;
376 if (variant == Variant::Isc15anp4) {
377 c.contrast_a = 0x15;
378 c.contrast_b = 0x1A;
379 c.contrast_c = 0x17;
380 c.display_offset = 0x10;
381 c.clock_frequency = 10;
382 c.vcomh_level = 31;
383 c.dim =
384 DimSettings{.contrast_a = 0x12, .contrast_b = 0x0C, .contrast_c = 0x14, .precharge = 0x12};
385 } else {
386 c.contrast_a = 0x0E;
387 c.contrast_b = 0x13;
388 c.contrast_c = 0x12;
389 c.display_offset = 0x1C;
390 c.clock_frequency = 3;
391 c.vcomh_level = 30;
392 c.dim =
393 DimSettings{.contrast_a = 0x07, .contrast_b = 0x0A, .contrast_c = 0x09, .precharge = 0x12};
394 }
395 c.precharge_speed_a = c.contrast_a;
396 c.precharge_speed_b = c.contrast_b;
397 c.precharge_speed_c = c.contrast_c;
398 return c;
399}
400
401namespace detail {
403template <>
404struct EnumLast<Variant> {
405 static constexpr Variant kValue = Variant::Isc01p;
406};
408template <>
409struct EnumLast<ColorDepth> {
410 static constexpr ColorDepth kValue = ColorDepth::Colors65kFormat2;
411};
413template <>
414struct EnumLast<DisplayMode> {
415 static constexpr DisplayMode kValue = DisplayMode::Inverse;
416};
418template <>
419struct EnumLast<ScrollInterval> {
420 static constexpr ScrollInterval kValue = ScrollInterval::Frames200;
421};
422} // namespace detail
423
431constexpr Error Validate(const ButtonConfig& b) noexcept {
432 if ((b.debounce_ms == 0U) || (b.debounce_ms > 1000U)) {
434 }
435 if ((b.long_press_ms <= b.debounce_ms) || (b.long_press_ms > kButtonTimeMaxMs)) {
437 }
438 if (b.repeat_interval_ms != 0U) {
439 if ((b.repeat_interval_ms < 10U) || (b.repeat_interval_ms > 10000U)) {
441 }
442 }
443 if (b.repeat_delay_ms > kButtonTimeMaxMs) {
445 }
446 return Error::Ok;
447}
448
449namespace detail {
450
452constexpr bool DisplayFieldsValid(const Config& config) noexcept {
453 const bool enums =
454 IsEnumerator(config.variant) && IsEnumerator(config.remap.depth) && IsEnumerator(config.mode);
455 const bool rows = (config.start_line < reg::kRamRows) && (config.display_offset < reg::kRamRows);
456 const bool dim_ok = (config.dim.contrast_a <= config.contrast_a) &&
457 (config.dim.contrast_b <= config.contrast_b) &&
458 (config.dim.contrast_c <= config.contrast_c);
459 const bool levels = dim_ok && (config.master_current <= reg::kMasterCurrentMax) &&
460 (config.precharge_level <= reg::kPrechargeSteps) &&
461 (config.vcomh_level <= reg::kPrechargeSteps) &&
462 (config.dim.precharge <= reg::kPrechargeSteps);
463 return enums && rows && levels;
464}
465
467constexpr bool ClockFieldsValid(const Config& config) noexcept {
468 const bool phases = (config.phase1 != 0U) && (config.phase1 <= reg::kPhaseMax) &&
469 (config.phase2 != 0U) && (config.phase2 <= reg::kPhaseMax);
470 return phases && (config.clock_divide <= 15U) && (config.clock_frequency <= 15U);
471}
472
474constexpr bool TimeKnobsValid(const Config& config) noexcept {
475 const bool waits = (config.vcc_settle_ms != 0U) && (config.vcc_settle_ms <= kWaitMaxMs) &&
476 (config.vcc_off_ms <= kWaitMaxMs) &&
477 (config.engine_settle_us <= kEngineSettleMaxUs);
478 const bool idle = (config.idle_dim_ms <= (kButtonTimeMaxMs * 100U)) &&
479 (config.idle_sleep_ms <= (kButtonTimeMaxMs * 100U));
480 const bool ordered = (config.idle_dim_ms == 0U) || (config.idle_sleep_ms == 0U) ||
481 (config.idle_sleep_ms > config.idle_dim_ms);
482 return waits && idle && ordered;
483}
484
485} // namespace detail
486
497constexpr Error Validate(const Config& config) noexcept {
498 if (!detail::DisplayFieldsValid(config) || !detail::ClockFieldsValid(config) ||
499 !detail::TimeKnobsValid(config)) {
501 }
502 return Validate(config.button);
503}
504
505// Every preset is valid, proved at build time (KB-CPP20-012).
506static_assert(Validate(Config{}) == Error::Ok);
508static_assert(Validate(PresetFor(Variant::Isc01p)) == Error::Ok);
509static_assert(GeometryOf(Variant::Isf15acp4).width == 96U);
514
519void ConfigIsInvalid() noexcept;
520
529public:
534 consteval explicit CheckedConfig(const Config& config) noexcept : config_(config) {
535 if (Validate(config) != Error::Ok) {
537 }
538 }
540 [[nodiscard]] constexpr const Config& Get() const& noexcept {
541 return config_;
542 }
544 void Get() const&& = delete;
545
546private:
547 Config config_;
548};
549
554struct Color {
555 uint16_t rgb565{0};
556};
557
565constexpr Color MakeColor(uint8_t r, uint8_t g, uint8_t b) noexcept {
566 const uint32_t word = ((static_cast<uint32_t>(r) >> 3U) << 11U) |
567 ((static_cast<uint32_t>(g) >> 2U) << 5U) | (static_cast<uint32_t>(b) >> 3U);
568 return Color{static_cast<uint16_t>(word)};
569}
570
572inline constexpr Color kBlack{0x0000};
574inline constexpr Color kWhite{0xFFFF};
576inline constexpr Color kRed{0xF800};
578inline constexpr Color kGreen{0x07E0};
580inline constexpr Color kBlue{0x001F};
581
583struct Channels {
584 uint8_t red{0};
585 uint8_t green{0};
586 uint8_t blue{0};
587};
588
594constexpr Channels Split(Color c) noexcept {
595 const uint32_t w = c.rgb565;
596 return Channels{.red = static_cast<uint8_t>((w >> 11U) & 0x1FU),
597 .green = static_cast<uint8_t>((w >> 5U) & 0x3FU),
598 .blue = static_cast<uint8_t>(w & 0x1FU)};
599}
600
601static_assert(MakeColor(255, 255, 255).rgb565 == 0xFFFFU);
602static_assert((Split(kRed).red == 31U) && (Split(kGreen).green == 63U) &&
603 (Split(kBlue).blue == 31U));
604
606constexpr const char* GetDriverVersion() noexcept {
607 return ISF15ACP4_VERSION_STRING;
608}
610constexpr uint32_t GetDriverVersionMajor() noexcept {
611 return ISF15ACP4_VERSION_MAJOR;
612}
614constexpr uint32_t GetDriverVersionMinor() noexcept {
615 return ISF15ACP4_VERSION_MINOR;
616}
618constexpr uint32_t GetDriverVersionPatch() noexcept {
619 return ISF15ACP4_VERSION_PATCH;
620}
621
624} // namespace isf15acp4
625
626#endif // ISF15ACP4_TYPES_HPP
A configuration proven valid at build time.
Definition isf15acp4_types.hpp:528
void Get() const &&=delete
Not on a temporary: the reference would dangle (KB-CPP20-044).
consteval CheckedConfig(const Config &config) noexcept
Check config at build time.
Definition isf15acp4_types.hpp:534
constexpr const Config & Get() const &noexcept
Definition isf15acp4_types.hpp:540
constexpr uint32_t kVccOffTypicalMs
VCC off to VDD off, minimum 0 and typical 100 ms (section 7.9, tOFF).
Definition isf15acp4_registers.hpp:166
constexpr uint8_t kPhaseMax
B1h: 1 to 15 DCLK per phase.
Definition isf15acp4_registers.hpp:102
constexpr uint8_t kRamColumns
GDDRAM width: columns 0 to 95 (section 7.5.1).
Definition isf15acp4_registers.hpp:96
constexpr uint8_t kRamRows
GDDRAM height: rows 0 to 63.
Definition isf15acp4_registers.hpp:97
constexpr uint8_t kMasterCurrentMax
87h: 1/16 to 16/16 (steps 0 to 15).
Definition isf15acp4_registers.hpp:100
constexpr uint8_t kPrechargeSteps
BBh, BEh, ABh E: A[5:1] 0 to 31.
Definition isf15acp4_registers.hpp:101
constexpr Color MakeColor(uint8_t r, uint8_t g, uint8_t b) noexcept
An RGB565 colour from 8-bit channels (the low bits are dropped, not rounded).
Definition isf15acp4_types.hpp:565
constexpr Color kBlack
Black.
Definition isf15acp4_types.hpp:572
constexpr uint32_t kWaitMaxMs
Longest wait the driver accepts for the supply and engine times, in milliseconds.
Definition isf15acp4_types.hpp:309
constexpr Color kRed
Pure red.
Definition isf15acp4_types.hpp:576
constexpr Error Validate(const ButtonConfig &b) noexcept
Check the switch configuration without touching the chip.
Definition isf15acp4_types.hpp:431
constexpr uint32_t GetDriverVersionMinor() noexcept
Definition isf15acp4_types.hpp:614
ButtonEvent
What a switch poll can report.
Definition isf15acp4_types.hpp:215
DisplayMode
What the pixels show (A4h to A7h).
Definition isf15acp4_types.hpp:192
constexpr uint32_t GetDriverVersionMajor() noexcept
Definition isf15acp4_types.hpp:610
constexpr const char * ToString(Error error) noexcept
The name of an error, for logs.
Definition isf15acp4_types.hpp:66
LogLevel
Severity passed to the optional Log() hook.
Definition isf15acp4_types.hpp:170
constexpr Config PresetFor(Variant variant) noexcept
The working set of a module.
Definition isf15acp4_types.hpp:362
ColorDepth
The pixel format of GDDRAM (A0h A[7:6]).
Definition isf15acp4_types.hpp:185
constexpr bool SameButtonConfig(const ButtonConfig &a, const ButtonConfig &b) noexcept
Whether two switch configurations are the same, field by field.
Definition isf15acp4_types.hpp:300
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
constexpr uint32_t GetDriverVersionPatch() noexcept
Definition isf15acp4_types.hpp:618
constexpr const char * GetDriverVersion() noexcept
Definition isf15acp4_types.hpp:606
constexpr uint32_t kButtonTimeMaxMs
Longest button time the driver accepts, in milliseconds (keeps every difference below 2^31).
Definition isf15acp4_types.hpp:307
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
void ConfigIsInvalid() noexcept
Reached only when a CheckedConfig is built from an invalid configuration: it is never defined,...
constexpr uint32_t kEngineSettleMaxUs
Longest engine settle time, in microseconds.
Definition isf15acp4_types.hpp:311
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 kWhite
White.
Definition isf15acp4_types.hpp:574
constexpr Color kBlue
Pure blue.
Definition isf15acp4_types.hpp:580
constexpr bool HasSwitch(Variant variant) noexcept
Whether a module has the pushbutton (the ISC01P is a display only).
Definition isf15acp4_types.hpp:281
constexpr Color kGreen
Pure green.
Definition isf15acp4_types.hpp:578
Variant
The three modules of the family; they share the controller and differ in the panel.
Definition isf15acp4_types.hpp:178
@ LongPress
Held for long_press_ms; once per press.
@ None
Nothing happened.
@ Repeat
Held on: one per repeat_interval_ms after repeat_delay_ms.
@ Pressed
The switch closed and stayed closed for the debounce time.
@ Released
The switch opened and stayed open for the debounce time.
@ Normal
The RAM content (A4h).
@ Inverse
Gray levels swapped, GS0 <-> GS63 (A7h).
@ AllOff
Every pixel at GS0 (A6h).
@ AllOn
Every pixel at GS63 (A5h).
@ Warning
Something unexpected that the driver recovered from.
@ Info
Lifecycle events: initialised, supply on or off.
@ Debug
Detail for bring-up.
@ 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).
@ InvalidArgument
An argument or a Config field is out of range; nothing was sent.
@ SupplyOff
The call needs the OLED supply on (raw display-on).
@ DeviceIdMismatch
Not returned by this driver: the controller has no ID and cannot answer.
@ Crc
Not returned by this driver: the serial interface has no checksum.
@ ScrollActive
A RAM, drawing or setup call while scrolling is on (Deactivate first).
@ Bus
A port hook returned false (a transfer or a pin write).
@ DeviceFault
Not returned by this driver: the controller reports no fault.
@ NotInitialized
EnsureInitialized() has not succeeded, or Deinitialize() ran since.
@ Ok
The call succeeded.
@ Timeout
Not returned by this driver: nothing the driver waits for is observable.
@ Locked
The controller is command-locked by SetCommandLock(true).
@ Busy
Not returned by this driver: every wait blocks until it has elapsed.
@ ScrollNotSet
ActivateScroll() before SetupScroll() succeeded.
@ Dim
Display on in dim mode (ACh).
@ Off
Sleep (AEh): segments and commons are high impedance.
@ Isc15anp4
64 x 48 pixels, pushbutton (NKK sheet ISC15ANP4).
@ Isc01p
52 x 36 pixels, display only (NKK sheet ISC01P): no switch.
@ Isf15acp4
96 x 64 pixels, frameless pushbutton (NKK sheet E4 to E7).
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 ISF15ACP4 driver: everything it declares lives here; internals in detail.
Definition isf15acp4.hpp:31
Switch handling: polarity, debounce, long press and repeat.
Definition isf15acp4_types.hpp:286
uint32_t debounce_ms
Time a level must be stable to count, 1 to 1000.
Definition isf15acp4_types.hpp:288
uint32_t repeat_interval_ms
0 = no repeat; else 10 to 10000 between Repeat events.
Definition isf15acp4_types.hpp:290
uint32_t long_press_ms
Hold time of LongPress, above the debounce time, to 60000.
Definition isf15acp4_types.hpp:289
bool active_low
The closed switch pulls the pin low (pull-up wiring).
Definition isf15acp4_types.hpp:287
uint32_t repeat_delay_ms
Hold time of the first Repeat, to 60000.
Definition isf15acp4_types.hpp:291
The red, green and blue fields of a colour (5, 6 and 5 bits).
Definition isf15acp4_types.hpp:583
uint8_t red
0 to 31.
Definition isf15acp4_types.hpp:584
uint8_t green
0 to 63.
Definition isf15acp4_types.hpp:585
uint8_t blue
0 to 31.
Definition isf15acp4_types.hpp:586
A colour as the RGB565 word every call takes: red in bits 15..11, green 10..5, blue 4....
Definition isf15acp4_types.hpp:554
uint16_t rgb565
The word.
Definition isf15acp4_types.hpp:555
Everything the driver sends at start-up, and its own time knobs.
Definition isf15acp4_types.hpp:322
uint8_t precharge_speed_a
8Ah: second pre-charge speed, colour A.
Definition isf15acp4_types.hpp:328
uint32_t vcc_off_ms
VCC off to the end of power-down (tOFF typical).
Definition isf15acp4_types.hpp:350
bool precharge_bit0
BBh bit 0 (reserved): NKK Table 3 sends 1Dh, Tables 1/2 12h.
Definition isf15acp4_types.hpp:342
bool send_precharge_speeds
8Ah to 8Ch: only the ISF15ACP4 table (Table 3) has them.
Definition isf15acp4_types.hpp:343
bool linear_gray_scale
B9h at start-up (false: the reset table stays).
Definition isf15acp4_types.hpp:345
uint8_t contrast_b
82h.
Definition isf15acp4_types.hpp:326
uint8_t start_line
A1h, 0 to 63.
Definition isf15acp4_types.hpp:332
DisplayMode mode
A4h to A7h.
Definition isf15acp4_types.hpp:334
uint32_t vcc_settle_ms
VCC enable to AFh; the datasheet says only "stable".
Definition isf15acp4_types.hpp:349
uint8_t precharge_speed_b
8Bh.
Definition isf15acp4_types.hpp:329
ButtonConfig button
The switch.
Definition isf15acp4_types.hpp:354
uint32_t idle_sleep_ms
Poll(): sleep after this idle time; 0 = never.
Definition isf15acp4_types.hpp:353
Remap remap
A0h.
Definition isf15acp4_types.hpp:324
uint8_t vcomh_level
BEh A[5:1], 0 to 31.
Definition isf15acp4_types.hpp:344
uint8_t display_offset
A2h, 0 to 63.
Definition isf15acp4_types.hpp:333
uint32_t idle_dim_ms
Poll(): dim after this idle time; 0 = never.
Definition isf15acp4_types.hpp:352
uint8_t master_current
87h, 0 to 15 (1/16 to 16/16).
Definition isf15acp4_types.hpp:331
bool writes_while_scrolling
Allow RAM writes while scrolling (datasheet is silent).
Definition isf15acp4_types.hpp:348
uint8_t precharge_level
BBh A[5:1], 0 to 31.
Definition isf15acp4_types.hpp:341
uint32_t engine_settle_us
Wait after a drawing command; not in the datasheet.
Definition isf15acp4_types.hpp:351
uint8_t precharge_speed_c
8Ch.
Definition isf15acp4_types.hpp:330
uint8_t phase1
B1h phase 1, 1 to 15 DCLK.
Definition isf15acp4_types.hpp:337
uint8_t clock_divide
B3h A[3:0]: ratio is this + 1.
Definition isf15acp4_types.hpp:339
Variant variant
Which module; sets the geometry.
Definition isf15acp4_types.hpp:323
uint8_t phase2
B1h phase 2, 1 to 15 DCLK.
Definition isf15acp4_types.hpp:338
uint8_t clock_frequency
B3h A[7:4].
Definition isf15acp4_types.hpp:340
bool power_save
B0h: false = disabled (reset value: enabled).
Definition isf15acp4_types.hpp:336
DimSettings dim
ABh.
Definition isf15acp4_types.hpp:335
uint8_t contrast_a
81h. Reset value 0x80.
Definition isf15acp4_types.hpp:325
uint8_t contrast_c
83h.
Definition isf15acp4_types.hpp:327
bool clear_ram
Zero GDDRAM before the supply is enabled.
Definition isf15acp4_types.hpp:346
bool red_on_segment_a
Panel wiring: segment group A carries red.
Definition isf15acp4_types.hpp:347
Dim mode parameters (ABh): used when the display is on in dim mode (ACh).
Definition isf15acp4_types.hpp:241
uint8_t precharge
Pre-charge level in dim mode, 0 to 31 (0.10 to 0.50 x VCC).
Definition isf15acp4_types.hpp:245
uint8_t contrast_a
Contrast of colour A in dim mode.
Definition isf15acp4_types.hpp:242
uint8_t contrast_b
Contrast of colour B in dim mode.
Definition isf15acp4_types.hpp:243
uint8_t contrast_c
Contrast of colour C in dim mode.
Definition isf15acp4_types.hpp:244
Geometry of a module: its visible pixels inside the 96 x 64 RAM.
Definition isf15acp4_types.hpp:249
uint8_t multiplex
Rows scanned (A8h: N + 1).
Definition isf15acp4_types.hpp:253
uint8_t height
Visible rows.
Definition isf15acp4_types.hpp:251
uint8_t width
Visible columns.
Definition isf15acp4_types.hpp:250
uint8_t column_origin
RAM column of the first visible column.
Definition isf15acp4_types.hpp:252
A position in the visible area.
Definition isf15acp4_types.hpp:235
uint8_t y
Row.
Definition isf15acp4_types.hpp:237
uint8_t x
Column.
Definition isf15acp4_types.hpp:236
The controller settings that depend on the wiring of the panel (Remap, A0h).
Definition isf15acp4_types.hpp:224
bool column_reverse
A[1]: RAM column 0 drives SEG95 (mirror).
Definition isf15acp4_types.hpp:226
bool reverse_colour_order
A[2]: segment order SC, SB, SA.
Definition isf15acp4_types.hpp:227
bool com_scan_reverse
A[4]: scan COM[N-1] to COM0.
Definition isf15acp4_types.hpp:229
bool com_split_odd_even
A[5]: odd-even split of the COM pins.
Definition isf15acp4_types.hpp:230
ColorDepth depth
A[7:6].
Definition isf15acp4_types.hpp:231
bool com_left_right_swap
A[3]: left-right swap on COM.
Definition isf15acp4_types.hpp:228
bool vertical_increment
A[0]: the RAM address runs down a column first.
Definition isf15acp4_types.hpp:225
constexpr bool ok() const noexcept
Definition isf15acp4_types.hpp:147
static constexpr Result Failure(Error e) noexcept
A failed result.
Definition isf15acp4_types.hpp:164
static constexpr Result Success() noexcept
Definition isf15acp4_types.hpp:156
The value of a call, or why there is none.
Definition isf15acp4_types.hpp:110
static constexpr Result Success(T v) noexcept
A successful result.
Definition isf15acp4_types.hpp:128
static constexpr Result Failure(Error e) noexcept
A failed result.
Definition isf15acp4_types.hpp:136
constexpr bool ok() const noexcept
Definition isf15acp4_types.hpp:115