[pca9685] Make mode constants inline constexpr (#14042)

This commit is contained in:
J. Nick Koston
2026-02-18 15:04:14 -06:00
committed by GitHub
parent bd38041d04
commit 4a038978d2
2 changed files with 6 additions and 10 deletions

View File

@@ -8,11 +8,7 @@ namespace pca9685 {
static const char *const TAG = "pca9685";
const uint8_t PCA9685_MODE_INVERTED = 0x10;
const uint8_t PCA9685_MODE_OUTPUT_ONACK = 0x08;
const uint8_t PCA9685_MODE_OUTPUT_TOTEM_POLE = 0x04;
const uint8_t PCA9685_MODE_OUTNE_HIGHZ = 0x02;
const uint8_t PCA9685_MODE_OUTNE_LOW = 0x01;
// PCA9685 mode constants are now inline constexpr in pca9685_output.h
static const uint8_t PCA9685_REGISTER_SOFTWARE_RESET = 0x06;
static const uint8_t PCA9685_REGISTER_MODE1 = 0x00;

View File

@@ -13,15 +13,15 @@ enum class PhaseBalancer {
};
/// Inverts polarity of channel output signal
extern const uint8_t PCA9685_MODE_INVERTED;
inline constexpr uint8_t PCA9685_MODE_INVERTED = 0x10;
/// Channel update happens upon ACK (post-set) rather than on STOP (endTransmission)
extern const uint8_t PCA9685_MODE_OUTPUT_ONACK;
inline constexpr uint8_t PCA9685_MODE_OUTPUT_ONACK = 0x08;
/// Use a totem-pole (push-pull) style output rather than an open-drain structure.
extern const uint8_t PCA9685_MODE_OUTPUT_TOTEM_POLE;
inline constexpr uint8_t PCA9685_MODE_OUTPUT_TOTEM_POLE = 0x04;
/// For active low output enable, sets channel output to high-impedance state
extern const uint8_t PCA9685_MODE_OUTNE_HIGHZ;
inline constexpr uint8_t PCA9685_MODE_OUTNE_HIGHZ = 0x02;
/// Similarly, sets channel output to high if in totem-pole mode, otherwise
extern const uint8_t PCA9685_MODE_OUTNE_LOW;
inline constexpr uint8_t PCA9685_MODE_OUTNE_LOW = 0x01;
class PCA9685Output;