|
PCA9555 / PCAL9555A Driver
API reference
|
Fixed-capacity result container for multi-pin read operations. More...
#include <pcal95555.hpp>
Public Types | |
| using | iterator = typename std::array< std::pair< uint8_t, bool >, kMaxPins >::const_iterator |
Public Member Functions | |
| uint8_t | size () const noexcept |
| Number of populated entries. | |
| bool | empty () const noexcept |
| True when no entries have been added. | |
| const std::pair< uint8_t, bool > & | operator[] (uint8_t i) const noexcept |
| Access entry by index (no bounds check). | |
| void | push_back (uint8_t pin, bool value) noexcept |
| Append a pin/value pair. Silently drops entries beyond kMaxPins. | |
| bool | contains (uint8_t pin) const noexcept |
| Check whether a pin number is already stored in the result set. | |
| const std::pair< uint8_t, bool > * | find (uint8_t pin) const noexcept |
| iterator | begin () const noexcept |
| iterator | end () const noexcept |
Public Attributes | |
| std::array< std::pair< uint8_t, bool >, kMaxPins > | data {} |
| Pin number / value pairs. | |
| uint8_t | count = 0 |
| Number of valid entries in data[]. | |
Static Public Attributes | |
| static constexpr uint8_t | kMaxPins = 16 |
| Maximum number of entries (constrained by hardware: 16 GPIO pins). | |
Fixed-capacity result container for multi-pin read operations.
Stores up to 16 pin/value pairs on the stack, avoiding heap allocation. The PCAL95555 has exactly 16 GPIO pins, so 16 is the hard upper bound.
Supports range-based for loops and structured bindings:
| using pcal95555::PinReadResult::iterator = typename std::array<std::pair<uint8_t, bool>, kMaxPins>::const_iterator |
|
inlinenoexcept |
|
inlinenoexcept |
Check whether a pin number is already stored in the result set.
|
inlinenoexcept |
True when no entries have been added.
|
inlinenoexcept |
|
inlinenoexcept |
Look up a pin's read result by pin number.
|
inlinenoexcept |
Access entry by index (no bounds check).
|
inlinenoexcept |
Append a pin/value pair. Silently drops entries beyond kMaxPins.
|
inlinenoexcept |
Number of populated entries.
| uint8_t pcal95555::PinReadResult::count = 0 |
Number of valid entries in data[].
| std::array<std::pair<uint8_t, bool>, kMaxPins> pcal95555::PinReadResult::data {} |
Pin number / value pairs.
|
staticconstexpr |
Maximum number of entries (constrained by hardware: 16 GPIO pins).