PCAL9555 Driver 0.1.0
API reference
Loading...
Searching...
No Matches
pcal9555_kconfig.hpp
Go to the documentation of this file.
1
17#ifndef PCAL9555_KCONFIG_HPP
18#define PCAL9555_KCONFIG_HPP
19
20#ifdef __has_include
21#if __has_include("sdkconfig.h")
22#include "sdkconfig.h"
23#endif
24#endif
25
26#include "pcal9555_types.hpp"
27
28#ifndef CONFIG_PCAL9555_OUTPUT_HIGH_MASK
30#define CONFIG_PCAL9555_OUTPUT_HIGH_MASK 0xFFFF
31#endif
32#ifndef CONFIG_PCAL9555_INPUT_MASK
34#define CONFIG_PCAL9555_INPUT_MASK 0xFFFF
35#endif
36
37namespace pcal9555 {
38
43constexpr Config KconfigDefaults() noexcept {
44 Config c{};
45#ifdef CONFIG_PCAL9555_VARIANT_PCAL9555A
47#else
48 c.variant = Variant::Pca9555;
49#endif
50 c.output_high_mask = static_cast<uint16_t>(CONFIG_PCAL9555_OUTPUT_HIGH_MASK);
51 c.input_mask = static_cast<uint16_t>(CONFIG_PCAL9555_INPUT_MASK);
52 return c;
53}
54
55} // namespace pcal9555
56
57#endif // PCAL9555_KCONFIG_HPP
@ Pcal9555a
PCAL9555A: also the Agile I/O bank at 0x40 to 0x4F.
@ Pca9555
PCA9555 (or a PCAL9555A used as one): registers 0x00 to 0x07 only. Default.
The PCAL9555 driver: everything it declares lives here; internals in detail.
Definition pcal9555.hpp:26
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the power-up values.
Definition pcal9555_kconfig.hpp:43
#define CONFIG_PCAL9555_INPUT_MASK
Definition pcal9555_kconfig.hpp:34
#define CONFIG_PCAL9555_OUTPUT_HIGH_MASK
Definition pcal9555_kconfig.hpp:30
Public types of the PCAL9555 driver: errors, Result<T>, pins and configuration.
Everything EnsureInitialized() and ApplyConfig() write to the chip.
Definition pcal9555_types.hpp:302
Variant variant
Driver side: which part is fitted. The Agile I/O calls need Variant::Pcal9555a.
Definition pcal9555_types.hpp:304