PCAL9555 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Public Attributes | Friends | List of all members
pcal9555::Config Struct Reference

Everything EnsureInitialized() and ApplyConfig() write to the chip. More...

#include <pcal9555_types.hpp>

Public Attributes

Variant variant {Variant::Pca9555}
 Driver side: which part is fitted. The Agile I/O calls need Variant::Pcal9555a.
 
uint16_t output_high_mask {0xFFFF}
 Output ports: 1 = drive high. Power-up: all high.
 
uint16_t polarity_invert_mask {0}
 Polarity inversion: 1 = input reads inverted.
 
uint16_t input_mask {0xFFFF}
 Configuration: 1 = input, 0 = output. Power-up: inputs.
 
uint32_t drive_strength_codes {0xFFFF'FFFFU}
 PCAL9555A: drive strength codes (DriveStrength), two bits per pin, pin n at bits 2n+1..2n.
 
uint16_t input_latch_mask {0}
 PCAL9555A: 1 = input change latched until read.
 
uint16_t pull_enable_mask {0xFFFF}
 PCAL9555A: 1 = pull resistor connected.
 
uint16_t pull_up_mask {0xFFFF}
 PCAL9555A: 1 = pull-up, 0 = pull-down.
 
uint16_t interrupt_mask {0xFFFF}
 PCAL9555A: 1 = the pin raises no interrupt.
 
OutputMode port0_mode {OutputMode::PushPull}
 PCAL9555A: output stage of port 0 (ODEN0).
 
OutputMode port1_mode {OutputMode::PushPull}
 PCAL9555A: output stage of port 1 (ODEN1).
 

Friends

constexpr bool operator== (const Config &lhs, const Config &rhs) noexcept=default
 Field by field; every field is an integer or an enumeration, so equality is exact.
 

Detailed Description

Everything EnsureInitialized() and ApplyConfig() write to the chip.

Bit n of each mask is pin n. The defaults are the power-up values of the registers, so Config{} changes nothing on a freshly powered chip. The fields below variant marked "PCAL9555A" must keep their default when variant is Variant::Pca9555 (Validate() returns Unsupported otherwise).

Friends And Related Symbol Documentation

◆ operator==

constexpr bool operator== ( const Config &  lhs,
const Config &  rhs 
)
friend

Field by field; every field is an integer or an enumeration, so equality is exact.

Parameters
lhsThe first configuration.
rhsThe configuration to compare with.
Returns
true when every field is equal.

The documentation for this struct was generated from the following file: