BNO08X Driver 0.1.0
API reference
Loading...
Searching...
No Matches
bno08x.hpp
Go to the documentation of this file.
1
14#ifndef BNO08X_HPP
15#define BNO08X_HPP
16
17#include <algorithm>
18#include <array>
19#include <bit>
20#include <concepts>
21#include <cstddef>
22#include <cstdint>
23#include <span>
24
25#include "bno08x_detail.hpp"
26#include "bno08x_euler.hpp"
27#include "bno08x_interface.hpp"
28#include "bno08x_records.hpp"
29#include "bno08x_registers.hpp"
30#include "bno08x_reports.hpp"
31#include "bno08x_rvc.hpp"
32#include "bno08x_shtp.hpp"
33#include "bno08x_types.hpp"
34#include "bno08x_version.h"
35
36namespace bno08x {
37
41 static constexpr std::size_t kRxCargo =
42 1024;
43 static constexpr std::size_t kTxCargo = 128;
44 static constexpr std::size_t kOpQueue = 8;
45 static constexpr std::size_t kEventQueue = 32;
46};
47
49template <typename Port>
50inline constexpr Transport kTransportOf = Port::kTransport;
51
53template <typename L>
54concept LimitsLike = requires {
55 { L::kRxCargo } -> std::convertible_to<std::size_t>;
56 { L::kTxCargo } -> std::convertible_to<std::size_t>;
57 { L::kOpQueue } -> std::convertible_to<std::size_t>;
58 { L::kEventQueue } -> std::convertible_to<std::size_t>;
59} && (L::kRxCargo >= 256U) && (L::kTxCargo >= 24U) && (L::kOpQueue >= 2U) && (L::kEventQueue >= 4U);
60
61namespace detail {
62
64template <typename Port>
65concept DeclaresSetReset = requires(Port& port) { port.SetReset(true); };
67template <typename Port>
68concept HasSetReset = requires { ExactHook<Port, bool(bool) noexcept>::Take(&Port::SetReset); };
70template <typename Port>
71concept DeclaresSetBootn = requires(Port& port) { port.SetBootn(true); };
73template <typename Port>
74concept HasSetBootn = requires { ExactHook<Port, bool(bool) noexcept>::Take(&Port::SetBootn); };
76template <typename Port>
77concept DeclaresTakeIntTimestamp =
78 requires(Port& port, uint32_t& us) { port.TakeIntTimestamp(us); };
80template <typename Port>
81concept HasTakeIntTimestamp =
82 requires { ExactHook<Port, bool(uint32_t&) noexcept>::Take(&Port::TakeIntTimestamp); };
84template <typename Port>
85concept DeclaresIntAsserted = requires(Port& port) { port.IntAsserted(); };
87template <typename Port>
88concept HasIntAsserted = requires { ExactHook<Port, bool() noexcept>::Take(&Port::IntAsserted); };
90template <typename Port>
91concept DeclaresLog = requires(Port& port) { port.Log(LogLevel::Info, ""); };
93template <typename Port>
94concept HasLog =
95 requires { ExactHook<Port, void(LogLevel, const char*) noexcept>::Take(&Port::Log); };
97template <typename Port>
98concept PacesUartTx = requires { requires Port::kPortPacesUartTx; };
99
101template <typename Port>
102void Log(Port& port, LogLevel level, const char* message) noexcept {
103 if constexpr (HasLog<Port>) {
104 port.Log(level, message);
105 } else {
106 static_cast<void>(port);
107 static_cast<void>(level);
108 static_cast<void>(message);
109 }
110}
111
113enum class OpKind : uint8_t {
114 Advertise,
115 Executable,
116 SetFeature,
117 GetFeature,
118 Flush,
119 ProductId,
120 Command,
121 FrsRead,
122 FrsWrite,
123};
124
126struct Op {
127 OpKind kind{OpKind::Executable};
128 bool silent{false};
129 bool no_response{false};
130 bool sent{false};
131 bool started{false};
132 bool stop{
133 false};
134 uint8_t channel{reg::kChanControl};
135 uint8_t req_len{0};
136 uint8_t sensor{0};
137 uint8_t cmd{0};
138 uint8_t cmd_seq{0};
139 uint8_t phase{0};
140 uint8_t responses{0};
141 OpId id{0};
142 uint16_t frs_type{0};
143 uint32_t start_us{0};
144 uint32_t limit_us{0};
145 std::array<uint8_t, reg::kLenGetFeature> req{};
146};
147
150[[nodiscard]] constexpr bool SameTarget(const Op& a, const Op& b) noexcept {
151 const bool features =
152 (a.kind == OpKind::SetFeature) && (b.kind == OpKind::SetFeature) && (a.sensor == b.sensor);
153 const bool power = (a.kind == OpKind::Executable) && (b.kind == OpKind::Executable);
154 return features || power;
155}
156
157} // namespace detail
158
159// clang-format off: the table below must keep one row per line.
183// clang-format on
184template <HubPort Port, LimitsLike Limits = DefaultLimits>
185class Bno08x {
186 static_assert(!detail::DeclaresSetReset<Port> || detail::HasSetReset<Port>,
187 "bno08x: the optional SetReset hook must be `bool SetReset(bool level) noexcept`");
188 static_assert(!detail::DeclaresSetBootn<Port> || detail::HasSetBootn<Port>,
189 "bno08x: the optional SetBootn hook must be `bool SetBootn(bool level) noexcept`");
190 static_assert(!detail::DeclaresTakeIntTimestamp<Port> || detail::HasTakeIntTimestamp<Port>,
191 "bno08x: the optional TakeIntTimestamp hook must be `bool "
192 "TakeIntTimestamp(uint32_t&) noexcept`");
193 static_assert(!detail::DeclaresIntAsserted<Port> || detail::HasIntAsserted<Port>,
194 "bno08x: the IntAsserted hook must be `bool IntAsserted() noexcept`");
195 static_assert(!detail::DeclaresLog<Port> || detail::HasLog<Port>,
196 "bno08x: the optional Log hook must be `void Log(LogLevel, const char*) noexcept`");
197 static_assert(!detail::DeclaresUartWriteByte<Port> || detail::HasUartWriteByte<Port>,
198 "bno08x: the UartWriteByte hook must be `bool UartWriteByte(uint8_t) noexcept`");
199 static_assert((kTransportOf<Port> != Transport::UartShtp) || detail::HasUartWriteByte<Port> ||
200 detail::PacesUartTx<Port>,
201 "bno08x: a UART-SHTP port without UartWriteByte must set `static constexpr bool "
202 "kPortPacesUartTx = true`");
203 static_assert(
204 !detail::DeclaresUartWrite<Port> || detail::HasUartWrite<Port>,
205 "bno08x: the UartWrite hook must be `bool UartWrite(const uint8_t*, std::size_t) noexcept`");
206
207public:
209 static constexpr Transport kTransport = Port::kTransport;
210
215 explicit Bno08x(Port& port) noexcept
216 : port_(port), rx_(stats_, cfg_), uart_(stats_), rvc_(stats_, cfg_),
217 adv_(detail::DefaultAdvert()) {}
218
226 Result<void> Begin(const Config& cfg) noexcept;
227
233 void Poll(uint32_t now_us) noexcept;
234
236 [[nodiscard]] State GetState() const noexcept {
237 return state_;
238 }
240 [[nodiscard]] bool Ready() const noexcept {
241 return state_ == State::Ready;
242 }
243
251
253 Result<OpId> Reset() noexcept;
256 Result<OpId> HubOn() noexcept;
259 Result<OpId> HubSleep() noexcept;
260
269 Result<OpId> SetFeature(SensorId id, const FeatureConfig& fc) noexcept;
275 Result<OpId> GetFeature(SensorId id) noexcept;
281 [[nodiscard]] Result<FeatureConfig> Feature(SensorId id) const noexcept;
287 Result<OpId> Flush(SensorId id) noexcept;
288
290 Result<OpId> ReadProductId() noexcept;
295 [[nodiscard]] const ProductId& Product() const noexcept {
296 return product_;
297 }
303 [[nodiscard]] std::span<const ProductId> ProductEntries() const noexcept {
304 return std::span<const ProductId>{product_entries_}.first(product_count_);
305 }
316 [[nodiscard]] const Metadata* GetMetadata(SensorId id) const noexcept;
317
324 Result<OpId> ReadFrs(uint16_t record, FrsBuffer& out) noexcept;
333 Result<OpId> WriteFrs(uint16_t record, std::span<const uint32_t> words) noexcept;
339 Result<OpId> EraseFrs(uint16_t record) noexcept;
340
348 Result<OpId> Tare(AxisMask axes, TareBasis basis) noexcept;
356 Result<OpId> SetReorientation(const Quat14& q) noexcept;
358 Result<OpId> ClearReorientation() noexcept;
359
365 Result<OpId> ConfigureMeCal(const MeCal& cal) noexcept;
370 Result<OpId> GetMeCal() noexcept;
372 Result<OpId> SaveDcd() noexcept;
378 Result<OpId> SetPeriodicDcd(bool enable) noexcept;
380 Result<OpId> ClearDcdAndReset() noexcept;
385 Result<OpId> GetOscillator() noexcept;
387 Result<OpId> Initialize() noexcept;
393 Result<OpId> GetCounts(SensorId id) noexcept;
399 Result<OpId> ClearCounts(SensorId id) noexcept;
405 Result<OpId> ReportErrors(uint8_t severity) noexcept;
411 Result<OpId> StartSimpleCal(uint32_t interval_us) noexcept;
414 Result<OpId> FinishSimpleCal() noexcept;
420 Result<OpId> SetMotionIntent(MotionIntent intent) noexcept;
426 Result<OpId> SendWheel(const WheelSample& s) noexcept;
427
434 Result<void> RvcSend(std::span<const uint8_t> text) noexcept;
435
441 bool PopEvent(Event& out) noexcept;
443 [[nodiscard]] const Stats& GetStats() const noexcept {
444 return stats_;
445 }
451 [[nodiscard]] Result<Event> Latest(SensorId id) const noexcept;
458 [[nodiscard]] uint32_t AgeUs(const Event& ev) const noexcept {
459 return now_us_ - ev.t_us;
460 }
462 static constexpr std::size_t kTraceBytes = 32;
470 [[nodiscard]] std::size_t TraceLastTransfer(std::span<uint8_t> out) const noexcept {
471 const std::size_t n = std::min({out.size(), trace_len_, kTraceBytes});
472 static_cast<void>(std::copy_n(trace_.begin(), n, out.begin()));
473 return n;
474 }
477 [[nodiscard]] std::size_t GetLastTransferLength() const noexcept {
478 return trace_total_;
479 }
481 [[nodiscard]] const detail::Advert& Advertised() const noexcept {
482 return adv_;
483 }
484
485private:
486 static constexpr std::size_t kFrameBuf =
487 (kTransport == Transport::UartShtp) ? ((2U * Limits::kRxCargo) + 8U) : 8U;
488 static constexpr std::size_t kUartTxBuf =
489 (kTransport == Transport::UartShtp) ? ((2U * Limits::kTxCargo) + 8U) : 8U;
490 static constexpr std::size_t kReadBuf = Limits::kRxCargo + reg::kShtpHeaderLen;
491 static constexpr std::size_t kZeroBuf = (kTransport == Transport::Spi) ? kReadBuf : 1U;
492 static constexpr std::size_t kMaxReadsPerPoll = 8;
493 static constexpr uint32_t kHubUnknownCause = 0xFF;
494 static constexpr uint32_t kRestoreTries = 3;
495
496 // session
497 Result<void> startReset() noexcept;
498 void stepReset() noexcept;
499 void beginWaitAdvert() noexcept;
500 void checkStartup() noexcept;
501 void checkOpTimeout() noexcept;
502 void becomeReady() noexcept;
503 [[nodiscard]] bool inStartupWindow() const noexcept;
504 void hubRestarted(uint8_t trigger) noexcept;
505 void noteViolation() noexcept;
506 void expireWindows() noexcept;
507 void recover() noexcept;
508 void serviceRestore() noexcept;
509 void restoreFailed(uint8_t sensor) noexcept;
510 void maybeReady() noexcept;
511 void serviceFaulted() noexcept;
512 void releaseWake() noexcept;
513 void resetTxPath() noexcept;
514 void abortUartTx() noexcept;
515 // receive
516 void pumpRx() noexcept;
517 void pumpRxBus() noexcept;
518 void pumpRxUart() noexcept;
519 void pumpRxRvc() noexcept;
520 bool intActive() noexcept;
521 uint32_t takeIntTime() noexcept;
522 bool readTransfer() noexcept;
523 void onTransfer(std::span<const uint8_t> transfer) noexcept;
524 void onUartFrame(std::span<const uint8_t> frame) noexcept;
525 void dispatch(uint8_t channel, std::span<const uint8_t> cargo) noexcept;
526 void onCommandChannel(std::span<const uint8_t> cargo) noexcept;
527 void onExecutable(std::span<const uint8_t> cargo) noexcept;
528 void onControl(std::span<const uint8_t> cargo) noexcept;
529 void onControlReport(std::span<const uint8_t> rep) noexcept;
530 void onInput(std::span<const uint8_t> cargo, bool wake) noexcept;
531 void onGyroRv(std::span<const uint8_t> cargo) noexcept;
532 void emitSensor(std::span<const uint8_t> rep, bool wake, int64_t ref_ticks) noexcept;
533 void onFeatureResponse(std::span<const uint8_t> rep) noexcept;
534 void onProductId(std::span<const uint8_t> rep) noexcept;
535 void onFrsWriteResponse(std::span<const uint8_t> rep) noexcept;
536 void onFrsReadResponse(std::span<const uint8_t> rep) noexcept;
537 void onCommandResponse(std::span<const uint8_t> rep) noexcept;
538 void onFlushDone(std::span<const uint8_t> rep) noexcept;
539 void onSh2Initialize(std::span<const uint8_t> rep) noexcept;
540 void fillCommandResult(const detail::Op& op, std::span<const uint8_t> rep) noexcept;
541 [[nodiscard]] static bool commandIsFinal(const detail::Op& op,
542 std::span<const uint8_t> rep) noexcept;
543 [[nodiscard]] static Error commandError(const detail::Op& op, std::span<const uint8_t> rep,
544 uint32_t& detail_word) noexcept;
545 void parseMetadata(uint16_t record, uint8_t sensor) noexcept;
546 void clearSession() noexcept;
547 [[nodiscard]] bool frsBusy() const noexcept;
548 // events
549 void pushEvent(const Event& ev) noexcept;
550 void emitOpDone(const detail::Op& op, Error err, uint32_t detail_word,
551 const std::array<int32_t, kEventValues>* vals) noexcept;
552 // operations
553 Result<OpId> enqueue(const detail::Op& op) noexcept;
554 [[nodiscard]] OpId queuedStop(const detail::Op& op) const noexcept;
555 bool evictForStop() noexcept;
556 void removeAt(std::size_t index, Error err) noexcept;
557 [[nodiscard]] Result<void> checkStop() const noexcept;
558 Result<OpId> enqueueStopExec(uint8_t code) noexcept;
559 Result<OpId> enqueueCommand(uint8_t cmd, const std::array<uint8_t, 9>& p,
560 bool no_response) noexcept;
561 Result<OpId> enqueueExec(uint8_t code, bool silent = false) noexcept;
562 Result<void> checkReady(bool needs_shtp) const noexcept;
565 [[nodiscard]] uint32_t wantedInterval(std::size_t sensor) const noexcept;
566 [[nodiscard]] bool userFeatureQueued(std::size_t sensor) const noexcept;
568 [[nodiscard]] Error checkFeature(SensorId id, const FeatureConfig& fc, bool off) const noexcept;
569 [[nodiscard]] Error checkFeatureOptions(SensorId id, const FeatureConfig& fc,
570 bool off) const noexcept;
571 [[nodiscard]] bool headWaits(detail::OpKind kind) const noexcept;
572 void startHead() noexcept;
573 void completeHead(Error err, uint32_t detail_word) noexcept;
574 void completeHeadWith(Error err, uint32_t detail_word,
575 const std::array<int32_t, kEventValues>* vals) noexcept;
576 void failAll(Error err, bool keep_stops = false) noexcept;
577 void afterComplete(const detail::Op& op, Error err) noexcept;
578 void enterFaulted(Error err) noexcept;
579 void toFront() noexcept;
580 void restartFailed() noexcept;
581 void afterSent() noexcept;
582 void frsReadFinished(Error err, uint32_t detail_word) noexcept;
583 void frsWriteStep() noexcept;
584 void frsStartVerify() noexcept;
585 // transmit
586 Result<void> queueTx(uint8_t channel, std::span<const uint8_t> payload) noexcept;
587 void pumpTx() noexcept;
588 Error txBus() noexcept;
589 Error txSpi() noexcept;
590 Error txUart() noexcept;
591 void uartPump() noexcept;
592 bool uartTokenOk(std::size_t total_len) noexcept;
593 void uartSendBsq() noexcept;
594 void txFailed(Error err) noexcept;
595 void log(LogLevel level, const char* msg) noexcept {
596 detail::Log(port_, level, msg);
597 }
598 [[nodiscard]] std::size_t maxWrite() const noexcept;
599 [[nodiscard]] std::size_t maxRead() const noexcept;
600
601 Port& port_;
602 Config cfg_{};
603 std::array<uint8_t, kTraceBytes> trace_{};
604 std::size_t trace_len_{0};
605 std::size_t trace_total_{0};
606 Stats stats_{};
607 detail::RxEngine<Limits::kRxCargo> rx_;
608 detail::UartFramer<kFrameBuf> uart_;
609 detail::RvcParser rvc_;
610 detail::Advert adv_;
611 State state_{State::Idle};
612 uint32_t now_us_{0};
613 uint32_t since_us_{0};
614 uint32_t t_int_us_{0};
615 uint32_t last_poll_us_{0};
616 bool reset_low_{false};
617 bool pin_reset_{false};
618 bool advert_seen_{false};
619 bool reset_seen_{false};
620 bool init_seen_{false};
621 bool restarting_{false};
622 bool advert_asked_{false};
623 uint32_t advert_at_us_{0};
624 bool reset_heard_{false};
625 bool init_heard_{false};
626 uint32_t ready_us_{0};
627 bool restart_event_pending_{false};
628 std::array<uint8_t, reg::kChannelCount> tx_seq_{};
629 // transmit
630 std::array<uint8_t, Limits::kTxCargo> tx_buf_{};
631 std::size_t tx_len_{0};
632 std::size_t duplex_len_{0};
633 bool tx_pending_{false};
634 bool wake_active_{false};
635 uint32_t wake_start_us_{0};
636 std::array<uint8_t, kUartTxBuf> uart_tx_{};
637 std::size_t uart_tx_len_{0};
638 bool uart_frame_open_{false};
639 std::size_t uart_tx_pos_{0};
640 bool uart_tx_cargo_{false};
641 uint32_t uart_last_byte_us_{0};
642 bool token_valid_{false};
643 bool bsq_out_{false};
644 uint32_t bsq_us_{0};
645 uint16_t token_bytes_{0};
646 uint32_t token_us_{0};
647 // receive scratch
648 std::array<uint8_t, kReadBuf> rd_buf_{};
649 std::array<uint8_t, kZeroBuf> zeros_{};
650 static constexpr std::size_t kRvcChunk = 32;
653 std::array<uint8_t, 64> uart_rx_chunk_{};
654 // violations
655 uint32_t viol_start_us_{0};
656 uint32_t viol_count_{0};
657 // operations
658 std::array<detail::Op, Limits::kOpQueue> ops_{};
659 std::size_t op_head_{0};
660 std::size_t op_count_{0};
661 OpId next_op_{1};
662 uint8_t cmd_seq_{0};
663 // FRS
664 std::array<uint32_t, kFrsMaxWords> frs_wr_{};
665 std::size_t frs_wr_len_{0};
666 std::size_t frs_wr_pos_{0};
667 FrsBuffer scratch_{};
668 FrsBuffer* frs_dst_{nullptr};
669 // features, samples, metadata
670 std::array<FeatureConfig, kSensorSlots> features_{};
671 std::array<FeatureConfig, kSensorSlots> desired_{};
672 std::array<int32_t, kEventValues> op_v_{};
673 std::size_t restore_next_{kSensorSlots};
674 uint32_t restore_tries_{0};
675 std::array<Event, kSensorSlots> latest_{};
676 std::array<bool, kSensorSlots> have_latest_{};
677 std::array<uint8_t, kSensorSlots> last_report_seq_{};
678 std::array<Metadata, kSensorSlots> metadata_{};
679 ProductId product_{};
680 std::array<ProductId, 5> product_entries_{};
681 std::size_t product_count_{0};
682 // events
683 std::array<Event, Limits::kEventQueue> events_{};
684 std::size_t ev_head_{0};
685 std::size_t ev_count_{0};
686 uint32_t pending_dropped_{0};
687 // RVC
688 Event rvc_event_{};
689};
690
691} // namespace bno08x
692
693// codeql::misra_deviation_next_line(MD-CPP-009)
694#include "../src/bno08x.ipp" // IWYU pragma: export
695
696#endif // BNO08X_HPP
Compile-time helpers of the BNO08X driver: typed integer literals, exact hook matching,...
Integer quaternion to Euler angle conversion (no floating point, no table).
The port of the BNO08x driver: the CRTP base, the four transports and the HubPort concept.
Typed codecs of the FRS records whose layout the documents give (RM S4), the 24 mounting quaternions ...
BNO08x protocol constants: SHTP channels, SH-2 report, command and record identifiers,...
The sensor input report layouts as data: one table drives every decode.
The UART-RVC frame parser (DS p20 to p21): a byte scanner that finds 19-byte frames,...
The SHTP frame engine: header codec, strict receive validation (rules V1 to V12), the UART framer and...
Public types of the BNO08x driver: errors, Result<T>, configuration, events and the integer unit help...
Driver for one BNO080, BNO085 or BNO086.
Definition bno08x.hpp:185
Bno08x(Port &port) noexcept
Bind the driver to a port. No I/O, cannot fail.
Definition bno08x.hpp:215
Result< Event > Latest(SensorId id) const noexcept
The most recent sample of a sensor.
std::span< const ProductId > ProductEntries() const noexcept
Definition bno08x.hpp:303
Result< OpId > PersistTare() noexcept
Persist the last tare to flash (RM S6.4.3.2).
bool Ready() const noexcept
Definition bno08x.hpp:240
State GetState() const noexcept
Definition bno08x.hpp:236
const Metadata * GetMetadata(SensorId id) const noexcept
void Poll(uint32_t now_us) noexcept
Advance the session: read what the hub offers, send the next request, check the time limits....
Result< void > Begin(const Config &cfg) noexcept
Start a session: validate cfg, bring the bus up, reset the hub and begin waiting for its advertisemen...
Result< void > HardReset() noexcept
Pulse NRST (needs the SetReset hook) and restart the session; pending operations complete with HubRes...
const detail::Advert & Advertised() const noexcept
Definition bno08x.hpp:481
Result< OpId > ReadMetadata(SensorId id) noexcept
Read a sensor's metadata record (RM S5.1); the result is available from GetMetadata().
Result< OpId > WriteFrs(uint16_t record, std::span< const uint32_t > words) noexcept
Write an FRS record (RM S6.3.3 to S6.3.5), then read it back and compare unless Config::frs_verify is...
Result< OpId > EraseFrs(uint16_t record) noexcept
Erase an FRS record (a write of length 0).
Result< OpId > Tare(AxisMask axes, TareBasis basis) noexcept
Tare now (RM S6.4.3.1).
uint32_t AgeUs(const Event &ev) const noexcept
The age of a sample.
Definition bno08x.hpp:458
std::size_t GetLastTransferLength() const noexcept
Definition bno08x.hpp:477
std::size_t TraceLastTransfer(std::span< uint8_t > out) const noexcept
Copy the first bytes of the most recent SHTP transfer the hub sent (the 4-byte header first),...
Definition bno08x.hpp:470
Result< OpId > ReadFrs(uint16_t record, FrsBuffer &out) noexcept
Read an FRS record into out (RM S6.3.6).
What a limits type must provide.
Definition bno08x.hpp:54
constexpr uint8_t kChanControl
Sensor hub control: features, product ID, FRS, commands.
Definition bno08x_registers.hpp:35
SensorId
Every sensor report ID any CEVA document defines (RM S6.5; matrix section 1.8 of the design).
Definition bno08x_types.hpp:205
LogLevel
Severity passed to the optional Log() hook.
Definition bno08x_types.hpp:155
TareBasis
The rotation vector a tare is based on (RM S6.4.3.1, P2).
Definition bno08x_types.hpp:436
Transport
How the host reaches the hub (strapped by PS1 and PS0 at reset, DS p9 Figure 1-5).
Definition bno08x_types.hpp:163
constexpr std::size_t kSensorSlots
Number of slots of the per-sensor tables: sensor IDs 0x01 to 0x2E.
Definition bno08x_types.hpp:250
State
State of the session.
Definition bno08x_types.hpp:186
Error
Why a call failed. Every call of the driver returns one of these in its Result.
Definition bno08x_types.hpp:40
MotionIntent
The motion intent of the interactive calibration (RM S6.4.12.1; BNO086).
Definition bno08x_types.hpp:458
uint16_t OpId
An operation number returned by every call that completes later with an OpDone event.
Definition bno08x_types.hpp:285
AxisMask
Axes of a tare (RM S6.4.3.1): 0x07 all axes, 0x04 Z only.
Definition bno08x_types.hpp:447
@ Info
Lifecycle events: session ready, hub reset.
The BNO08x driver: everything it declares lives here; internals in detail.
Definition bno08x.hpp:36
constexpr Transport kTransportOf
The transport a port names (used in constraints before the class is complete).
Definition bno08x.hpp:50
The configuration of a session. Config{} is the recommended setup for a BNO085.
Definition bno08x_types.hpp:502
The sizes of the driver's fixed buffers; pass your own as the second template argument.
Definition bno08x.hpp:40
static constexpr std::size_t kRxCargo
Largest cargo received, in bytes (at least 256).
Definition bno08x.hpp:41
static constexpr std::size_t kTxCargo
Largest cargo sent, header included.
Definition bno08x.hpp:43
static constexpr std::size_t kOpQueue
Pending operations.
Definition bno08x.hpp:44
static constexpr std::size_t kEventQueue
Events waiting to be popped.
Definition bno08x.hpp:45
One thing the driver reports, taken with Bno08x::PopEvent().
Definition bno08x_types.hpp:298
The common feature report of one sensor (RM S6.5.2).
Definition bno08x_types.hpp:358
A caller-owned buffer for ReadFrs(); it must outlive the operation.
Definition bno08x_types.hpp:412
The motion engine's calibration enables (RM S6.4.6).
Definition bno08x_types.hpp:419
Sensor metadata record (RM Figures 28 and 29, record IDs 0xE301 to 0xE325).
Definition bno08x_types.hpp:384
Product ID response (RM S6.3.2).
Definition bno08x_types.hpp:373
A quaternion in Q14 (RM S6.4.3.3): the set-reorientation argument.
Definition bno08x_types.hpp:428
The value of a call, or why there is none.
Definition bno08x_types.hpp:95
Counters of everything the driver dropped, repaired or noticed. Never reset by the driver.
Definition bno08x_types.hpp:314
One wheel measurement for dead reckoning (RM S6.4.13).
Definition bno08x_types.hpp:480