16#ifndef PCA9685_REGISTERS_HPP
17#define PCA9685_REGISTERS_HPP
32inline constexpr uint8_t
kMode1 = 0x00;
33inline constexpr uint8_t
kMode2 = 0x01;
54[[nodiscard]]
constexpr uint8_t
ChannelBase(uint32_t channel)
noexcept {
55 return static_cast<uint8_t
>(uint32_t{
kLed0OnL} +
105static_assert(Mode2Outne::kMask == 0x03U);
constexpr uint8_t kMode2Reserved
Bits 7..5: reserved, read only, read 0.
Definition pca9685_registers.hpp:78
constexpr uint8_t kMode1Restart
Definition pca9685_registers.hpp:65
constexpr uint8_t kPreScaleReset
30: about 200 Hz from the 25 MHz oscillator.
Definition pca9685_registers.hpp:101
constexpr uint32_t kOutneHiZ
OUTNE = 10: LEDn = high impedance.
Definition pca9685_registers.hpp:89
constexpr uint8_t kMode1Ai
AI: register auto-increment.
Definition pca9685_registers.hpp:68
constexpr uint8_t kSubAdr2
SUBADR2 (R/W): I2C subaddress 2.
Definition pca9685_registers.hpp:35
constexpr uint8_t kSubAdr1
SUBADR1 (R/W): I2C subaddress 1 (section 7.3.6).
Definition pca9685_registers.hpp:34
constexpr uint8_t kMode1AllCall
Definition pca9685_registers.hpp:73
constexpr uint8_t kLedOffHReset
LEDn_OFF_H after a reset: full OFF (table 7). The other three bytes reset to 0.
Definition pca9685_registers.hpp:98
constexpr uint8_t kChannels
Number of LED channels.
Definition pca9685_registers.hpp:47
constexpr uint8_t kMode1Reset
MODE1 after a power-on or software reset: SLEEP and ALLCALL set (table 5).
Definition pca9685_registers.hpp:75
constexpr uint8_t kMode1Sleep
SLEEP: oscillator off, low-power mode.
Definition pca9685_registers.hpp:69
constexpr uint8_t kMode2
MODE2 (R/W): output inversion, change, drive, OE.
Definition pca9685_registers.hpp:33
constexpr uint8_t kSubAdrReadOnly
SUBADR1 to 3 and ALLCALLADR bit 0: read only, reads 0 (tables 9, 10).
Definition pca9685_registers.hpp:60
constexpr uint8_t kSubAdr1Reset
SUBADR1 after a reset (table 9).
Definition pca9685_registers.hpp:62
constexpr uint8_t kAllLedOffH
ALL_LED_OFF_H (W): loads every LEDn_OFF_H.
Definition pca9685_registers.hpp:41
constexpr uint8_t kMode2OutDrv
Definition pca9685_registers.hpp:81
constexpr uint8_t kMode1Sub3
SUB3: answer I2C subaddress 3.
Definition pca9685_registers.hpp:72
constexpr uint8_t kLed15OffH
LED15_OFF_H (R/W): the last channel byte.
Definition pca9685_registers.hpp:39
constexpr uint8_t kMode1Sub2
SUB2: answer I2C subaddress 2.
Definition pca9685_registers.hpp:71
constexpr uint8_t kBytesPerChannel
Bytes per channel: ON_L, ON_H, OFF_L, OFF_H (table 7).
Definition pca9685_registers.hpp:45
constexpr uint32_t kOutneLow
OUTNE = 00: LEDn = 0.
Definition pca9685_registers.hpp:86
constexpr uint16_t kMaxCount
Highest LEDn_ON and LEDn_OFF count: the 12-bit counter runs 0 to 4095 (section 7.3....
Definition pca9685_registers.hpp:96
constexpr uint8_t kLedHReserved
Bits 7..5 of the _H bytes: read only, read 0.
Definition pca9685_registers.hpp:92
constexpr uint8_t ChannelBase(uint32_t channel) noexcept
The address of LEDn_ON_L of a channel (table 4).
Definition pca9685_registers.hpp:54
constexpr uint8_t kAllCallAdr
ALLCALLADR (R/W): LED All Call address (7.3.7).
Definition pca9685_registers.hpp:37
constexpr uint8_t kMode2Och
OCH: outputs change on ACK, not on STOP.
Definition pca9685_registers.hpp:80
constexpr uint8_t kLedFull
Bit 4: full ON (ON_H) or full OFF (OFF_H).
Definition pca9685_registers.hpp:93
constexpr uint8_t kMode1
MODE1 (R/W): restart, clock, AI, sleep, group calls.
Definition pca9685_registers.hpp:32
constexpr uint8_t kMode2Reset
MODE2 after a reset: change on STOP, totem pole, not inverted, LEDn = 0 when OE = 1.
Definition pca9685_registers.hpp:83
constexpr uint8_t kMode2Invrt
INVRT: output logic inverted (OE = 0 only).
Definition pca9685_registers.hpp:79
constexpr uint8_t kPreScaleMin
The hardware forces at least 3 (1526 Hz).
Definition pca9685_registers.hpp:102
constexpr uint8_t kMode1ExtClk
EXTCLK: use the EXTCLK pin; sticky.
Definition pca9685_registers.hpp:67
constexpr uint32_t kOutneHigh
OUTNE = 01: LEDn = 1 (totem pole), Hi-Z (open drain).
Definition pca9685_registers.hpp:87
constexpr uint8_t kSubAdr3
SUBADR3 (R/W): I2C subaddress 3.
Definition pca9685_registers.hpp:36
constexpr uint8_t kLedCountHigh
Definition pca9685_registers.hpp:94
detail::Field< uint8_t, 0U, 2U > Mode2Outne
MODE2.OUTNE[1:0], the level of every output while OE is high (table 11).
Definition pca9685_registers.hpp:85
constexpr uint8_t kLed0OnL
LED0_ON_L (R/W): first of 16 x 4 channel bytes.
Definition pca9685_registers.hpp:38
constexpr uint8_t kMode1Sub1
SUB1: answer I2C subaddress 1.
Definition pca9685_registers.hpp:70
constexpr uint8_t kPreScale
PRE_SCALE (R/W): PWM frequency; written in SLEEP.
Definition pca9685_registers.hpp:42
constexpr uint8_t kAllLedOnL
ALL_LED_ON_L (W): loads every LEDn_ON_L (7.3.4).
Definition pca9685_registers.hpp:40
The PCA9685 register map.
Definition pca9685_registers.hpp:24
Compile-time helpers of the PCA9685 driver: typed integer literals, exact hook matching,...