PCA9685 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
pca9685_kconfig.hpp
Go to the documentation of this file.
1
19#ifndef PCA9685_KCONFIG_HPP
20#define PCA9685_KCONFIG_HPP
21
22#ifdef __has_include
23#if __has_include("sdkconfig.h")
24#include "sdkconfig.h"
25#endif
26#endif
27
28#include "pca9685_types.hpp"
29
30#ifndef CONFIG_PCA9685_PWM_FREQUENCY_HZ
32#define CONFIG_PCA9685_PWM_FREQUENCY_HZ 200
33#endif
34#ifndef CONFIG_PCA9685_OSCILLATOR_HZ
36#define CONFIG_PCA9685_OSCILLATOR_HZ 25000000
37#endif
38
39namespace pca9685 {
40
45constexpr Config KconfigDefaults() noexcept {
46 Config c{};
47 c.pwm_frequency_hz = static_cast<uint32_t>(CONFIG_PCA9685_PWM_FREQUENCY_HZ);
48 c.oscillator_hz = static_cast<uint32_t>(CONFIG_PCA9685_OSCILLATOR_HZ);
49#if defined(CONFIG_PCA9685_EXTERNAL_CLOCK) && CONFIG_PCA9685_EXTERNAL_CLOCK
50 c.clock = ClockSource::External;
51#endif
52#if defined(CONFIG_PCA9685_OPEN_DRAIN) && CONFIG_PCA9685_OPEN_DRAIN
53 c.output_drive = OutputDrive::OpenDrain;
54#endif
55#if defined(CONFIG_PCA9685_INVERT_OUTPUTS) && CONFIG_PCA9685_INVERT_OUTPUTS
56 c.invert_outputs = true;
57#endif
58 return c;
59}
60
61} // namespace pca9685
62
63#endif // PCA9685_KCONFIG_HPP
@ External
The EXTCLK pin, DC to 50 MHz; sticky until a power cycle or software reset.
@ OpenDrain
Sink only. Needed for LEDs with integrated Zener diodes (section 10, Q5).
The PCA9685 driver: everything it declares lives here; internals in detail.
Definition pca9685.hpp:30
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the reset values.
Definition pca9685_kconfig.hpp:45
#define CONFIG_PCA9685_OSCILLATOR_HZ
Definition pca9685_kconfig.hpp:36
#define CONFIG_PCA9685_PWM_FREQUENCY_HZ
Definition pca9685_kconfig.hpp:32
Public types of the PCA9685 driver: errors, Result<T>, channel values, configuration,...
Everything EnsureInitialized() writes to the chip.
Definition pca9685_types.hpp:377
uint32_t pwm_frequency_hz
Definition pca9685_types.hpp:378