Synopsis
CTL_STATUS_t ctl_transport_rmw_8b_register(CTL_TRANSPORT_t *self,
                                           int reg,
                                           unsigned mask,
                                           unsigned value);
Description

ctl_transport_rmw_8b_register reads, updates, and writes the 8-bit register at address reg on the device associated with transport self. The register is modified by replacing existing bits with new bits from value where the the corresponding bits in mask are non-zero.

The value written back to the register is:

(not mask and value-of-register) or (value and mask).

Return Value

ctl_transport_rmw_8b_register returns a standard status code.

Thread Safety

ctl_transport_rmw_8b_register is thread-safe if the transport self has a mutex associated with it. ctl_transport_rmw_8b_register ensures an atomic update of the register by locking the transport before reading the register and unlocking it after writing the register.