BNO08X Driver 0.1.0
API reference
Loading...
Searching...
No Matches
bno08x_kconfig.hpp
Go to the documentation of this file.
1
19#ifndef BNO08X_KCONFIG_HPP
20#define BNO08X_KCONFIG_HPP
21
22#ifdef __has_include
23#if __has_include("sdkconfig.h")
24#include "sdkconfig.h"
25#endif
26#endif
27
28#include "bno08x.hpp"
29
30#ifndef CONFIG_BNO08X_RX_CARGO
32#define CONFIG_BNO08X_RX_CARGO 1024
33#endif
34#ifndef CONFIG_BNO08X_TX_CARGO
36#define CONFIG_BNO08X_TX_CARGO 128
37#endif
38#ifndef CONFIG_BNO08X_OP_QUEUE
40#define CONFIG_BNO08X_OP_QUEUE 8
41#endif
42#ifndef CONFIG_BNO08X_EVENT_QUEUE
44#define CONFIG_BNO08X_EVENT_QUEUE 32
45#endif
46#ifndef CONFIG_BNO08X_STARTUP_TIMEOUT_MS
48#define CONFIG_BNO08X_STARTUP_TIMEOUT_MS 500
49#endif
50#ifndef CONFIG_BNO08X_OP_TIMEOUT_MS
52#define CONFIG_BNO08X_OP_TIMEOUT_MS 1000
53#endif
54
55namespace bno08x {
56
60 static constexpr std::size_t kRxCargo = CONFIG_BNO08X_RX_CARGO;
61 static constexpr std::size_t kTxCargo = CONFIG_BNO08X_TX_CARGO;
62 static constexpr std::size_t kOpQueue = CONFIG_BNO08X_OP_QUEUE;
63 static constexpr std::size_t kEventQueue = CONFIG_BNO08X_EVENT_QUEUE;
64};
65
71constexpr Config KconfigDefaults() noexcept {
72 Config c{};
73#if defined(CONFIG_BNO08X_VARIANT_BNO080)
75#elif defined(CONFIG_BNO08X_VARIANT_BNO086)
76 c.variant = Variant::Bno086;
77#else
78 c.variant = Variant::Bno085;
79#endif
80#ifdef CONFIG_BNO08X_I2C_ADDR_HIGH
81 c.i2c_address = reg::kI2cAddrHigh;
82#endif
83#ifdef CONFIG_BNO08X_NOT_STRICT_VARIANT
84 c.strict_variant = false;
85#endif
86#ifdef CONFIG_BNO08X_NO_AUTO_RESTORE
87 c.auto_restore = false;
88#endif
89#ifdef CONFIG_BNO08X_SET_FEATURE_CONFIRM
90 c.set_feature_confirm = true;
91#endif
92 c.startup_timeout_ms = CONFIG_BNO08X_STARTUP_TIMEOUT_MS;
93 c.op_timeout_ms = CONFIG_BNO08X_OP_TIMEOUT_MS;
94 return c;
95}
96
97} // namespace bno08x
98
99#endif // BNO08X_KCONFIG_HPP
BNO08x driver: the one header to include.
#define CONFIG_BNO08X_RX_CARGO
Definition bno08x_kconfig.hpp:32
#define CONFIG_BNO08X_OP_QUEUE
Definition bno08x_kconfig.hpp:40
#define CONFIG_BNO08X_OP_TIMEOUT_MS
Definition bno08x_kconfig.hpp:52
#define CONFIG_BNO08X_STARTUP_TIMEOUT_MS
Definition bno08x_kconfig.hpp:48
#define CONFIG_BNO08X_EVENT_QUEUE
Definition bno08x_kconfig.hpp:44
#define CONFIG_BNO08X_TX_CARGO
Definition bno08x_kconfig.hpp:36
constexpr uint8_t kI2cAddrHigh
7-bit I2C address with SA0 high.
Definition bno08x_registers.hpp:200
@ Bno080
BNO080 (end of life): the base MotionEngine.
@ Bno085
BNO085: enhanced fusion; I2C polling stretches the clock.
@ Bno086
BNO086: interactive calibration, RVC MI/MR bytes, zero-length I2C packets.
The BNO08x driver: everything it declares lives here; internals in detail.
Definition bno08x.hpp:36
constexpr Config KconfigDefaults() noexcept
The configuration menuconfig selected, on top of the driver defaults.
Definition bno08x_kconfig.hpp:71
The configuration of a session. Config{} is the recommended setup for a BNO085.
Definition bno08x_types.hpp:502
Variant variant
Chip of the family; selects behaviour.
Definition bno08x_types.hpp:503
The buffer sizes menuconfig selected; pass it as the second template argument of Bno08x.
Definition bno08x_kconfig.hpp:59
static constexpr std::size_t kTxCargo
Largest cargo sent.
Definition bno08x_kconfig.hpp:61
static constexpr std::size_t kRxCargo
Largest cargo received.
Definition bno08x_kconfig.hpp:60
static constexpr std::size_t kEventQueue
Queued events.
Definition bno08x_kconfig.hpp:63
static constexpr std::size_t kOpQueue
Pending operations.
Definition bno08x_kconfig.hpp:62