AS5047U Driver 0.1.0
API reference
Loading...
Searching...
No Matches
as5047u_kconfig.hpp
Go to the documentation of this file.
1
21#ifndef AS5047U_KCONFIG_HPP
22#define AS5047U_KCONFIG_HPP
23
24#ifdef __has_include
25#if __has_include("sdkconfig.h")
26#include "sdkconfig.h"
27#endif
28#endif
29
30#include "as5047u_types.hpp"
31
32namespace as5047u {
33
38constexpr Config KconfigDefaults() noexcept {
39 Config c{};
40#ifdef CONFIG_AS5047U_FRAME_16
42#elif defined(CONFIG_AS5047U_FRAME_32)
43 c.frame = FrameFormat::Bits32;
44#else
45 c.frame = FrameFormat::Bits24;
46#endif
47#if defined(CONFIG_AS5047U_DIRECTION_CCW) && CONFIG_AS5047U_DIRECTION_CCW
48 c.direction = Direction::CounterClockwise;
49#endif
50#if defined(CONFIG_AS5047U_DAEC_DISABLE) && CONFIG_AS5047U_DAEC_DISABLE
51 c.dynamic_compensation = false;
52#endif
53 return c;
54}
55
56} // namespace as5047u
57
58#endif // AS5047U_KCONFIG_HPP
Public types of the AS5047U driver: errors, Result<T>, configuration, decoded registers.
@ CounterClockwise
Inverted (DIR = 1).
@ Bits16
16-bit frames, no CRC: the fastest reads, but a corrupted reply goes unnoticed.
@ Bits32
32-bit frames: a pad byte, then a 24-bit frame (daisy chains).
@ Bits24
24-bit frames with CRC-8 in both directions. Default.
The AS5047U driver: everything it declares lives here; internals in detail.
Definition as5047u.hpp:24
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the defaults.
Definition as5047u_kconfig.hpp:38
Everything EnsureInitialized() and ApplyConfig() write to the chip.
Definition as5047u_types.hpp:287
FrameFormat frame
Definition as5047u_types.hpp:292