|
ISF15ACP4 Driver 0.1.0
API reference
|
The ISF15ACP4 driver: everything it declares lives here; internals in detail.
More...
Namespaces | |
| namespace | reg |
| The SSD1331 command set. | |
Classes | |
| struct | ButtonConfig |
| Switch handling: polarity, debounce, long press and repeat. More... | |
| class | ButtonDebouncer |
| Debounces a switch sampled at any rate and classifies the press. More... | |
| struct | ButtonUpdate |
One result of ButtonDebouncer::Update(). More... | |
| struct | Channels |
| The red, green and blue fields of a colour (5, 6 and 5 bits). More... | |
| class | CheckedConfig |
| A configuration proven valid at build time. More... | |
| struct | Color |
| A colour as the RGB565 word every call takes: red in bits 15..11, green 10..5, blue 4..0. A strong type, so a panel word or a byte count cannot be passed by mistake (KB-CPP20-030). More... | |
| struct | Config |
| Everything the driver sends at start-up, and its own time knobs. More... | |
| struct | DimSettings |
| Dim mode parameters (ABh): used when the display is on in dim mode (ACh). More... | |
| struct | Geometry |
| Geometry of a module: its visible pixels inside the 96 x 64 RAM. More... | |
| class | ISF15ACP4 |
| Driver for one ISF15ACP4 on a platform port. More... | |
| struct | Point |
| A position in the visible area. More... | |
| struct | Remap |
| The controller settings that depend on the wiring of the panel (Remap, A0h). More... | |
| struct | Result |
| The value of a call, or why there is none. More... | |
| struct | Result< void > |
| The result of a call that returns no value. More... | |
| struct | ScrollSetup |
| The scroll parameters of command 27h. More... | |
| class | SpiInterface |
| CRTP base of the platform SPI port. More... | |
Concepts | |
| concept | SpiPort |
Satisfied by a class that derives from SpiInterface<Port> and implements the required hooks with exactly the types above, noexcept and returning bool: EnsureInitialized(), Write() and GpioSet() (RES# and the VCC enable). | |
Enumerations | |
| enum class | CtrlPin : uint8_t { Reset = 0 , VccEnable } |
The pins the port drives through GpioSet(). More... | |
| enum class | GpioSignal : uint8_t { INACTIVE = 0 , ACTIVE = 1 } |
| Logical level of a control pin; the port maps it to the physical polarity. More... | |
| enum class | DataKind : uint8_t { Command = 0 , Data = 1 } |
| What a transfer carries: it sets the D/C# pin (section 7.2). More... | |
| enum class | Error : uint8_t { Error::Ok = 0 , Error::NotInitialized = 1 , Error::InvalidArgument = 2 , Error::Bus = 3 , Error::Timeout = 4 , Error::DeviceIdMismatch , Error::Crc = 6 , Error::Busy = 7 , Error::DeviceFault = 8 , Error::Unsupported = 9 , Error::ScrollActive = 16 , Error::ScrollNotSet = 17 , Error::SupplyOff = 18 , Error::Locked = 19 } |
Why a call failed. Every call of the driver returns one of these in its Result. More... | |
| enum class | LogLevel : uint8_t { LogLevel::Error = 0 , LogLevel::Warning , LogLevel::Info , LogLevel::Debug } |
Severity passed to the optional Log() hook. More... | |
| enum class | Variant : uint8_t { Variant::Isf15acp4 = 0 , Variant::Isc15anp4 = 1 , Variant::Isc01p = 2 } |
| The three modules of the family; they share the controller and differ in the panel. More... | |
| enum class | ColorDepth : uint8_t { ColorDepth::Colors256 = 0 , ColorDepth::Colors65k = 1 , ColorDepth::Colors65kFormat2 = 2 } |
| The pixel format of GDDRAM (A0h A[7:6]). More... | |
| enum class | DisplayMode : uint8_t { DisplayMode::Normal = 0 , DisplayMode::AllOn = 1 , DisplayMode::AllOff = 2 , DisplayMode::Inverse = 3 } |
| What the pixels show (A4h to A7h). More... | |
| enum class | Output : uint8_t { Output::Off = 0 , Output::Normal = 1 , Output::Dim = 2 } |
| What the panel is doing, as far as the driver knows. More... | |
| enum class | ScrollInterval : uint8_t { ScrollInterval::Frames6 = 0 , ScrollInterval::Frames10 = 1 , ScrollInterval::Frames100 = 2 , ScrollInterval::Frames200 = 3 } |
| The time between two scroll steps (27h E). More... | |
| enum class | ButtonEvent : uint8_t { ButtonEvent::None = 0 , ButtonEvent::Pressed = 1 , ButtonEvent::Released = 2 , ButtonEvent::LongPress = 3 , ButtonEvent::Repeat = 4 } |
| What a switch poll can report. More... | |
Functions | |
| constexpr Config | KconfigDefaults () noexcept |
| The configuration menuconfig selected, on top of the module's preset. | |
| constexpr const char * | ToString (Error error) noexcept |
| The name of an error, for logs. | |
| constexpr Geometry | GeometryOf (Variant variant) noexcept |
| The geometry of a module (NKK sheets: pixel format; the column origin of the smaller panels is the centred one and not given by any NKK document: not verified on hardware). | |
| constexpr bool | HasSwitch (Variant variant) noexcept |
| Whether a module has the pushbutton (the ISC01P is a display only). | |
| constexpr bool | SameButtonConfig (const ButtonConfig &a, const ButtonConfig &b) noexcept |
| Whether two switch configurations are the same, field by field. | |
| constexpr Config | PresetFor (Variant variant) noexcept |
| The working set of a module. | |
| constexpr Error | Validate (const ButtonConfig &b) noexcept |
| Check the switch configuration without touching the chip. | |
| constexpr Error | Validate (const Config &config) noexcept |
| Check a configuration without touching the chip. | |
| void | ConfigIsInvalid () noexcept |
Reached only when a CheckedConfig is built from an invalid configuration: it is never defined, so the build fails and names it (KB-CPP20-013). | |
| 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). | |
| constexpr Channels | Split (Color c) noexcept |
| Split an RGB565 colour. | |
| constexpr const char * | GetDriverVersion () noexcept |
| constexpr uint32_t | GetDriverVersionMajor () noexcept |
| constexpr uint32_t | GetDriverVersionMinor () noexcept |
| constexpr uint32_t | GetDriverVersionPatch () noexcept |
Variables | |
| constexpr uint32_t | kButtonTimeMaxMs = 60000 |
| Longest button time the driver accepts, in milliseconds (keeps every difference below 2^31). | |
| constexpr uint32_t | kWaitMaxMs = 1000 |
| Longest wait the driver accepts for the supply and engine times, in milliseconds. | |
| constexpr uint32_t | kEngineSettleMaxUs = 100000 |
| Longest engine settle time, in microseconds. | |
| constexpr Color | kBlack {0x0000} |
| Black. | |
| constexpr Color | kWhite {0xFFFF} |
| White. | |
| constexpr Color | kRed {0xF800} |
| Pure red. | |
| constexpr Color | kGreen {0x07E0} |
| Pure green. | |
| constexpr Color | kBlue {0x001F} |
| Pure blue. | |
Bus requirements | |
What the controller needs from the SPI bus (SSD1331 section 7.1.3, Table 21; NKK sheet E7). A port and a board configuration check their settings against these with | |
| constexpr uint8_t | kSpiMode = 0 |
| constexpr bool | kMsbFirst = true |
| Each byte is clocked most significant bit first, D7 first (section 7.1.3). | |
| constexpr uint32_t | kMaxClockHz = 6'600'000 |
| Highest SCK frequency: tcycle 150 ns minimum (Table 21), 6.66 MHz. | |
| constexpr uint32_t | kMinCsHighNs = 150 |
| constexpr uint32_t | kCsSetupNs = 75 |
| CS# low to the first SCK edge, tCSS (Table 21). | |
| constexpr uint32_t | kCsHoldNs = 60 |
| Last SCK edge to CS# high, tCSH (Table 21). | |
| constexpr bool | kContinuousWord = false |
| constexpr uint32_t | kDcSetupNs = 40 |
| D/C# valid before the clock edge that starts a byte, tAS (Table 21). | |
| constexpr uint32_t | kDcHoldNs = 40 |
| D/C# held after the byte, tAH (Table 21). | |
| constexpr bool | kWriteOnly = true |
| There is no MISO: nothing can be read back. | |
The ISF15ACP4 driver: everything it declares lives here; internals in detail.
|
strong |
|
strong |
|
strong |
|
constexprnoexcept |
The configuration menuconfig selected, on top of the module's preset.
PresetFor(variant) with the master current, colour wiring, switch and idle times taken from Kconfig.
|
inlineconstexpr |
false: the datasheet sets no limit on idle SCK time between the bytes of one transfer; D/C# is sampled on every eighth clock.
|
inlineconstexpr |
Shortest time CS# stays high between two transfers: the datasheet gives none, so one SCLK period (tcycle) is used; not verified on hardware.
|
inlineconstexpr |
SPI mode the driver is tested with: CPOL 0, CPHA 0. Data is taken on the SCLK rising edge, so mode 3 also works (Figure 39).