BNO08X Driver 0.1.0
API reference
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
bno08x_types.hpp File Reference

Public types of the BNO08x driver: errors, Result<T>, configuration, events and the integer unit helpers. More...

#include <array>
#include <cstddef>
#include <cstdint>
#include "bno08x_detail.hpp"
#include "bno08x_registers.hpp"
#include "bno08x_version.h"

Go to the source code of this file.

Classes

struct  bno08x::Result< T >
 The value of a call, or why there is none. More...
 
struct  bno08x::Result< void >
 The result of a call that returns no value. More...
 
struct  bno08x::Event
 One thing the driver reports, taken with Bno08x::PopEvent(). More...
 
struct  bno08x::Stats
 Counters of everything the driver dropped, repaired or noticed. Never reset by the driver. More...
 
struct  bno08x::FeatureConfig
 The common feature report of one sensor (RM S6.5.2). More...
 
struct  bno08x::ProductId
 Product ID response (RM S6.3.2). More...
 
struct  bno08x::Metadata
 Sensor metadata record (RM Figures 28 and 29, record IDs 0xE301 to 0xE325). More...
 
struct  bno08x::FrsBuffer
 A caller-owned buffer for ReadFrs(); it must outlive the operation. More...
 
struct  bno08x::MeCal
 The motion engine's calibration enables (RM S6.4.6). More...
 
struct  bno08x::Quat14
 A quaternion in Q14 (RM S6.4.3.3): the set-reorientation argument. More...
 
struct  bno08x::WheelSample
 One wheel measurement for dead reckoning (RM S6.4.13). More...
 
struct  bno08x::RvcFrame
 A decoded UART-RVC frame (DS p21). More...
 
struct  bno08x::Config
 The configuration of a session. Config{} is the recommended setup for a BNO085. More...
 
struct  bno08x::EulerCentiDeg
 Yaw, pitch and roll in centidegrees. More...
 

Namespaces

namespace  bno08x
 The BNO08x driver: everything it declares lives here; internals in detail.
 

Typedefs

using bno08x::OpId = uint16_t
 An operation number returned by every call that completes later with an OpDone event.
 

Enumerations

enum class  bno08x::Error : uint8_t {
  bno08x::Error::Ok = 0 , bno08x::Error::NotInitialized = 1 , bno08x::Error::InvalidArgument = 2 , bno08x::Error::Bus = 3 ,
  bno08x::Error::Timeout = 4 , bno08x::Error::DeviceIdMismatch = 5 , bno08x::Error::Crc = 6 , bno08x::Error::Busy = 7 ,
  bno08x::Error::DeviceFault = 8 , bno08x::Error::Unsupported = 9 , bno08x::Error::Framing = 16 , bno08x::Error::HubReset = 17 ,
  bno08x::Error::Overflow = 18 , bno08x::Error::Refused = 19 , bno08x::Error::Oversize = 20 , bno08x::Error::NotAdvertised = 21 ,
  bno08x::Error::Variant = 22
}
 Why a call failed. Every call of the driver returns one of these in its Result. More...
 
enum class  bno08x::LogLevel : uint8_t { bno08x::LogLevel::Error = 0 , bno08x::LogLevel::Warning , bno08x::LogLevel::Info , bno08x::LogLevel::Debug }
 Severity passed to the optional Log() hook. More...
 
enum class  bno08x::Transport : uint8_t { bno08x::Transport::I2c = 0 , bno08x::Transport::Spi = 1 , bno08x::Transport::UartShtp = 2 , bno08x::Transport::UartRvc = 3 }
 How the host reaches the hub (strapped by PS1 and PS0 at reset, DS p9 Figure 1-5). More...
 
enum class  bno08x::Variant : uint8_t { bno08x::Variant::Bno080 = 0 , bno08x::Variant::Bno085 = 1 , bno08x::Variant::Bno086 = 2 }
 The chip of the family the driver talks to. It selects behaviour; it is never detected. More...
 
enum class  bno08x::ReadPolicy : uint8_t { bno08x::ReadPolicy::HeaderThenRest , bno08x::ReadPolicy::Fixed = 1 }
 How an I2C or SPI read sizes its transfers. More...
 
enum class  bno08x::State : uint8_t {
  bno08x::State::Idle = 0 , bno08x::State::Resetting = 1 , bno08x::State::WaitAdvert = 2 , bno08x::State::WaitReady = 3 ,
  bno08x::State::Ready = 4 , bno08x::State::Faulted = 5
}
 State of the session. More...
 
enum class  bno08x::Accuracy : uint8_t { bno08x::Accuracy::Unreliable = 0 , bno08x::Accuracy::Low = 1 , bno08x::Accuracy::Medium = 2 , bno08x::Accuracy::High = 3 }
 Accuracy of a sensor sample (status bits 1:0 of every input report, RM S6.5.1). More...
 
enum class  bno08x::SensorId : uint8_t {
  bno08x::SensorId::Accelerometer = 0x01 , bno08x::SensorId::GyroscopeCalibrated = 0x02 , bno08x::SensorId::MagneticFieldCalibrated = 0x03 , bno08x::SensorId::LinearAcceleration = 0x04 ,
  bno08x::SensorId::RotationVector = 0x05 , bno08x::SensorId::Gravity = 0x06 , bno08x::SensorId::GyroscopeUncalibrated = 0x07 , bno08x::SensorId::GameRotationVector = 0x08 ,
  bno08x::SensorId::GeomagneticRotationVector = 0x09 , bno08x::SensorId::Pressure = 0x0A , bno08x::SensorId::AmbientLight = 0x0B , bno08x::SensorId::Humidity = 0x0C ,
  bno08x::SensorId::Proximity = 0x0D , bno08x::SensorId::Temperature = 0x0E , bno08x::SensorId::MagneticFieldUncalibrated = 0x0F , bno08x::SensorId::TapDetector = 0x10 ,
  bno08x::SensorId::StepCounter = 0x11 , bno08x::SensorId::SignificantMotion = 0x12 , bno08x::SensorId::StabilityClassifier = 0x13 , bno08x::SensorId::RawAccelerometer = 0x14 ,
  bno08x::SensorId::RawGyroscope = 0x15 , bno08x::SensorId::RawMagnetometer = 0x16 , bno08x::SensorId::StepDetector = 0x18 , bno08x::SensorId::ShakeDetector = 0x19 ,
  bno08x::SensorId::FlipDetector = 0x1A , bno08x::SensorId::PickupDetector = 0x1B , bno08x::SensorId::StabilityDetector = 0x1C , bno08x::SensorId::PersonalActivityClassifier = 0x1E ,
  bno08x::SensorId::SleepDetector = 0x1F , bno08x::SensorId::TiltDetector = 0x20 , bno08x::SensorId::PocketDetector = 0x21 , bno08x::SensorId::CircleDetector = 0x22 ,
  bno08x::SensorId::HeartRateMonitor = 0x23 , bno08x::SensorId::ArvrRotationVector = 0x28 , bno08x::SensorId::ArvrGameRotationVector = 0x29 , bno08x::SensorId::GyroIntegratedRotationVector ,
  bno08x::SensorId::MotionRequest = 0x2B , bno08x::SensorId::OpticalFlow = 0x2C , bno08x::SensorId::DeadReckoningPose = 0x2D , bno08x::SensorId::WheelEncoder = 0x2E
}
 Every sensor report ID any CEVA document defines (RM S6.5; matrix section 1.8 of the design). More...
 
enum class  bno08x::EventKind : uint8_t {
  bno08x::EventKind::Sensor = 0 , bno08x::EventKind::OpDone = 1 , bno08x::EventKind::FeatureChanged = 2 , bno08x::EventKind::Reset = 3 ,
  bno08x::EventKind::FlushDone = 4 , bno08x::EventKind::HubError = 5 , bno08x::EventKind::Dropped = 6 , bno08x::EventKind::Rvc = 7 ,
  bno08x::EventKind::Sh2Error = 8
}
 What an Event reports. More...
 
enum class  bno08x::TareBasis : uint8_t {
  bno08x::TareBasis::RotationVector = 0 , bno08x::TareBasis::GameRotationVector = 1 , bno08x::TareBasis::GeomagneticRotationVector = 2 , bno08x::TareBasis::GyroIntegrated = 3 ,
  bno08x::TareBasis::ArvrRotationVector = 4 , bno08x::TareBasis::ArvrGameRotationVector
}
 The rotation vector a tare is based on (RM S6.4.3.1, P2). More...
 
enum class  bno08x::AxisMask : uint8_t {
  bno08x::AxisMask::All = 0x07 , bno08x::AxisMask::ZOnly = 0x04 , bno08x::AxisMask::X = 0x01 , bno08x::AxisMask::Y = 0x02 ,
  bno08x::AxisMask::XY = 0x03 , bno08x::AxisMask::XZ = 0x05 , bno08x::AxisMask::YZ = 0x06
}
 Axes of a tare (RM S6.4.3.1): 0x07 all axes, 0x04 Z only. More...
 
enum class  bno08x::MotionIntent : uint8_t {
  bno08x::MotionIntent::Unknown = 0 , bno08x::MotionIntent::StationaryNoVibration = 1 , bno08x::MotionIntent::StationaryWithVibration = 2 , bno08x::MotionIntent::InMotion = 3 ,
  bno08x::MotionIntent::InMotionAccelerating = 4
}
 The motion intent of the interactive calibration (RM S6.4.12.1; BNO086). More...
 
enum class  bno08x::SimpleCalStatus : uint8_t {
  bno08x::SimpleCalStatus::Ok = 0 , bno08x::SimpleCalStatus::NoGyroOffset = 1 , bno08x::SimpleCalStatus::NoStationary = 2 , bno08x::SimpleCalStatus::RotationOutOfSpec = 3 ,
  bno08x::SimpleCalStatus::GyroOffsetOutOfSpec = 4 , bno08x::SimpleCalStatus::AccelOffset = 5 , bno08x::SimpleCalStatus::GyroGain = 6 , bno08x::SimpleCalStatus::GyroPeriod = 7 ,
  bno08x::SimpleCalStatus::GyroSampleDrops = 8
}
 Result of the simple calibration finish (RM S6.4.10.2, R1). More...
 

Functions

constexpr const char * bno08x::ToString (Error error) noexcept
 The name of an error, for logs.
 
constexpr bool bno08x::ToSensorId (uint8_t raw, SensorId &out) noexcept
 Whether raw is one of the sensor IDs of SensorId, and if so which.
 
constexpr int32_t bno08x::ToMmPerS2 (int32_t q8) noexcept
 A Q8 acceleration (m/s2) in millimetres per second squared.
 
constexpr int32_t bno08x::ToMilliRadPerS (int32_t q9) noexcept
 A Q9 angular rate (rad/s) in milliradians per second.
 
constexpr int32_t bno08x::ToNanoTesla (int32_t q4) noexcept
 A Q4 magnetic field (uT) in nanotesla.
 
constexpr int32_t bno08x::ToMicroRad (int32_t q12) noexcept
 A Q12 angle (rad), such as a rotation vector's accuracy, in microradians.
 
constexpr int32_t bno08x::ToPpm (int32_t q14) noexcept
 A Q14 quaternion component in parts per million of unity.
 
constexpr const char * bno08x::GetDriverVersion () noexcept
 
constexpr uint32_t bno08x::GetDriverVersionMajor () noexcept
 
constexpr uint32_t bno08x::GetDriverVersionMinor () noexcept
 
constexpr uint32_t bno08x::GetDriverVersionPatch () noexcept
 

Variables

constexpr std::size_t bno08x::kSensorSlots = 0x2F
 Number of slots of the per-sensor tables: sensor IDs 0x01 to 0x2E.
 
constexpr std::size_t bno08x::kEventValues = 16
 Number of values an Event carries.
 
constexpr std::size_t bno08x::kFrsMaxWords = 128
 Largest FRS record the driver reads or writes, in 32-bit words (Kconfig-free constant).
 

Detailed Description

Public types of the BNO08x driver: errors, Result<T>, configuration, events and the integer unit helpers.

Everything here is plain data with no platform dependency. The driver is integer-only: sensor values keep the Q point the SH-2 reference manual gives them (RM S6.5), and the helpers at the end of this file convert them to whole units (millimetres per second squared, milliradians per second, nanotesla, microradians, centidegrees).