Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: BNO080-Examples BNO080-Examples
BNO080Async Class Reference
Asynchronous version of the SPI BNO080 driver. More...
#include <BNO080Async.h>
Inherits BNO080SPI.
Public Types | |
| enum | Report { TOTAL_ACCELERATION = SENSOR_REPORTID_ACCELEROMETER, LINEAR_ACCELERATION = SENSOR_REPORTID_LINEAR_ACCELERATION, GRAVITY_ACCELERATION = SENSOR_REPORTID_GRAVITY, GYROSCOPE = SENSOR_REPORTID_GYROSCOPE_CALIBRATED, MAG_FIELD = SENSOR_REPORTID_MAGNETIC_FIELD_CALIBRATED, MAG_FIELD_UNCALIBRATED = SENSOR_REPORTID_MAGNETIC_FIELD_UNCALIBRATED, ROTATION = SENSOR_REPORTID_ROTATION_VECTOR, GEOMAGNETIC_ROTATION = SENSOR_REPORTID_GEOMAGNETIC_ROTATION_VECTOR, GAME_ROTATION = SENSOR_REPORTID_GAME_ROTATION_VECTOR, TAP_DETECTOR = SENSOR_REPORTID_TAP_DETECTOR, STABILITY_CLASSIFIER = SENSOR_REPORTID_STABILITY_CLASSIFIER, STEP_DETECTOR = SENSOR_REPORTID_STEP_DETECTOR, STEP_COUNTER = SENSOR_REPORTID_STEP_COUNTER, SIGNIFICANT_MOTION = SENSOR_REPORTID_SIGNIFICANT_MOTION, SHAKE_DETECTOR = SENSOR_REPORTID_SHAKE_DETECTOR } |
List of all sensor reports that the IMU supports. More... | |
| enum | Stability { UNKNOWN = 0, ON_TABLE = 1, STATIONARY = 2, STABLE = 3, MOTION = 4 } |
Enum to represent the different stability types. More... | |
Public Member Functions | |
| BNO080Async (Stream *debugPort, PinName rstPin, PinName intPin, PinName wakePin, PinName misoPin, PinName mosiPin, PinName sclkPin, PinName csPin, int spiSpeed=3000000, osPriority threadPriority=osPriorityAboveNormal) | |
| Construct a BNO080Async. | |
| bool | begin () override |
| Resets and connects to the IMU. | |
| bool | updateData () override |
| In BNO080Async, there is no need to call updateData() in order to get new results, but this call is provided for compatibility. | |
| void | lockMutex () override |
| Locks the data mutex. | |
| void | unlockMutex () override |
| Unlocks the data mutex. | |
| void | tare (bool zOnly=false) |
| Tells the IMU to use its current rotation vector as the "zero" rotation vector and to reorient all outputs accordingly. | |
| bool | enableCalibration (bool calibrateAccel, bool calibrateGyro, bool calibrateMag) |
| Tells the IMU to begin a dynamic sensor calibration. | |
| bool | saveCalibration () |
| Saves the calibration started with startCalibration() and ends the calibration. | |
| void | setSensorOrientation (Quaternion orientation) |
| Sets the orientation quaternion, telling the sensor how it's mounted in relation to world space. | |
| bool | setPermanentOrientation (Quaternion orientation) |
| Sets the orientation quaternion, telling the sensor how it's mounted in relation to world space. | |
| uint8_t | getReportStatus (Report report) |
| Gets the status of a report as a 2 bit number. | |
| const char * | getReportStatusString (Report report) |
| Get a string for printout describing the status of a sensor. | |
| bool | hasNewData (Report report) |
| Checks if a specific report has gotten new data since the last call to this function. | |
| void | enableReport (Report report, uint16_t timeBetweenReports) |
| Enable a data report from the IMU. | |
| void | disableReport (Report report) |
| Disable a data report from the IMU. | |
| uint32_t | getSerialNumber () |
| Gets the serial number (used to uniquely identify each individual device). | |
| float | getRange (Report report) |
| Gets the range of a report as reported by the IMU. | |
| float | getResolution (Report report) |
| Gets the resolution of a report as reported by the IMU. | |
| float | getPower (Report report) |
| Get the power used by a report when it's operating, according to the IMU. | |
| float | getMinPeriod (Report report) |
| Gets the smallest polling period that a report supports. | |
| float | getMaxPeriod (Report report) |
| Gets the larges polling period that a report supports. | |
| void | printMetadataSummary (Report report) |
| Prints a summary of a report's metadata to the debug stream. | |
Data Fields | |
| TVector3 | totalAcceleration |
| Readout from Accleration report. | |
| TVector3 | linearAcceleration |
| Readout from Linear Acceleration report. | |
| TVector3 | gravityAcceleration |
| Readout from Gravity report. | |
| TVector3 | gyroRotation |
| Readout from Calibrated Gyroscope report Represents the angular velocities of the chip in rad/s in the X, Y, and Z axes. | |
| TVector3 | magField |
| Readout from the Magnetic Field Calibrated report. | |
| TVector3 | magFieldUncalibrated |
| Readout from the Magnetic Field Uncalibrated report. | |
| TVector3 | hardIronOffset |
| Auxiliary readout from the Magnetic Field Uncalibrated report. | |
| Quaternion | rotationVector |
| Readout from the Rotation Vector report. | |
| float | rotationAccuracy |
| Auxiliary accuracy readout from the Rotation Vector report. | |
| Quaternion | gameRotationVector |
| Readout from the Game Rotation Vector report. | |
| Quaternion | geomagneticRotationVector |
| Readout from the Geomagnetic Rotation Vector report. | |
| float | geomagneticRotationAccuracy |
| Auxiliary accuracy readout from the Geomagnetic Rotation Vector report. | |
| bool | tapDetected |
| Tap readout from the Tap Detector report. | |
| bool | doubleTap |
| Whether the last tap detected was a single or double tap. | |
| Stability | stability |
| Readout from the stability classifier. | |
| bool | stepDetected |
| Readout from the Step Detector report. | |
| uint16_t | stepCount |
| Readout from the Step Counter report. | |
| bool | significantMotionDetected |
| Readout from the Significant Motion Detector report. | |
| bool | shakeDetected |
| Readout from the Shake Detector report. | |
| uint8_t | majorSoftwareVersion |
| Version info read from the IMU when it starts up. | |
| bool | xAxisShake |
| The axis/axes that shaking was detected in in the latest shaking report. | |
Protected Member Functions | |
| bool | receivePacket (std::chrono::milliseconds timeout=200ms) override |
| Reads a packet from the IMU and stores it in the class variables. | |
| bool | receiveCompletePacket (size_t bytesRead, std::chrono::milliseconds timeout=200ms) |
| Assuming that at least a packet header has been read into the RX buffer, receive the remainder of the packet. | |
| void | spiTransferAndWait (const uint8_t *tx_buffer, int tx_length, uint8_t *rx_buffer, int rx_length) |
| Start an SPI transfer and suspend the current thread until it is complete. | |
| void | spiTransferAndWait (const uint8_t *tx_buffer, int tx_length, uint8_t *rx_buffer, int rx_length) |
| Start an SPI transfer and wait for it to complete. | |
| uint16_t | getMetaVersion () |
| Gets the version of the metadata stored in the buffer. | |
| void | processPacket () |
| Processes the packet currently stored in the buffer, and updates class variables to reflect the data it contains. | |
| void | parseSensorDataPacket () |
| Processes the sensor data packet currently stored in the buffer. | |
| float | qToFloat (int16_t fixedPointValue, uint8_t qPoint) |
| Given a Q value, converts fixed point floating to regular floating point number. | |
| float | qToFloat_dword (uint32_t fixedPointValue, int16_t qPoint) |
| Given a Q value, converts fixed point floating to regular floating point number. | |
| int16_t | floatToQ (float qFloat, uint8_t qPoint) |
| Given a floating point value and a Q point, convert to Q See https://en.wikipedia.org/wiki/Q_(number_format) | |
| int32_t | floatToQ_dword (float qFloat, uint16_t qPoint) |
| Given a floating point value and a Q point, convert to Q See https://en.wikipedia.org/wiki/Q_(number_format) | |
| void | sendCommand (uint8_t command) |
| Tell the sensor to do a command. | |
| void | setFeatureCommand (uint8_t reportID, uint16_t timeBetweenReports, uint32_t specificConfig=0) |
| Given a sensor's report ID, this tells the BNO080 to begin reporting the values. | |
| bool | readFRSRecord (uint16_t recordID, uint32_t *readBuffer, uint16_t readLength) |
| Read a record from the FRS (Flash Record System) on the IMU. | |
| bool | writeFRSRecord (uint16_t recordID, uint32_t *buffer, uint16_t length) |
| Write a record to the FRS (Flash Record System) on the IMU. | |
| void | printPacket (uint8_t *buffer) |
| Prints the current shtp packet stored in the buffer. | |
| bool | loadReportMetadata (Report report) |
| Loads the metadata for this report into the metadata buffer. | |
| int16_t | getQ1 (Report report) |
| Gets the Q point from a report's metadata, which essentially defines where the decimal point goes in the sensor's output. | |
Protected Attributes | |
| SPI | _spiPort |
| I2C port object. | |
| int | _spiSpeed |
| user defined port speed | |
| Stream * | _debugPort |
| Serial stream to print debug info to. | |
| InterruptIn | _int |
| Interrupt pin -- signals to the host that the IMU has data to send. | |
| uint8_t * | txShtpHeader = txPacketBuffer |
| Each SHTP packet starts with a header of 4 uint8_ts. | |
| uint8_t * | txShtpData = txPacketBuffer + SHTP_HEADER_SIZE |
| Stores data contained in each packet. | |
| uint16_t | rxPacketLength |
| Length of packet that was received into buffer. Does NOT include header bytes. | |
| uint8_t | sequenceNumber [6] |
| Current sequence number for each channel, incremented after transmission. | |
| uint8_t | commandSequenceNumber |
| Commands have a seqNum as well. These are inside command packet, the header uses its own seqNum per channel. | |
| uint16_t | bufferMetadataRecord |
| Record ID of the metadata record currently stored in the metadataRecord[] buffer. | |
| uint32_t | metadataRecord [METADATA_BUFFER_LEN] |
| Buffer for current metadata record. | |
| uint8_t | reportStatus [STATUS_ARRAY_LEN] |
| stores status of each sensor, indexed by report ID | |
| bool | reportHasBeenUpdated [STATUS_ARRAY_LEN] |
| stores whether a sensor has been updated since the last call to hasNewData() | |
Detailed Description
Asynchronous version of the SPI BNO080 driver.
Since the timing requirements of this driver are so different, wouldn't it be great to have a dedicated thread to handle them? This class provides exactly that, using an internal thread triggered by interrupts to connect to the BNO.
Note: the internal thread is started the first time begin() is called, and is shut down when the class is destroyed.
Definition at line 19 of file BNO080Async.h.
Member Enumeration Documentation
enum Report [inherited] |
List of all sensor reports that the IMU supports.
- Enumerator:
enum Stability [inherited] |
Enum to represent the different stability types.
See BNO datasheet section 2.4.1 and SH-2 section 6.5.31.2 for details.
- Enumerator:
Constructor & Destructor Documentation
| BNO080Async | ( | Stream * | debugPort, |
| PinName | rstPin, | ||
| PinName | intPin, | ||
| PinName | wakePin, | ||
| PinName | misoPin, | ||
| PinName | mosiPin, | ||
| PinName | sclkPin, | ||
| PinName | csPin, | ||
| int | spiSpeed = 3000000, |
||
| osPriority | threadPriority = osPriorityAboveNormal |
||
| ) |
Construct a BNO080Async.
This doesn't actually initialize the chip, you will need to call begin() for that.
NOTE: while some schematics tell you to connect the BOOTN pin to the processor, this driver does not use or require it. Just tie it to VCC per the datasheet.
- Parameters:
-
debugPort Serial port to write output to. Cannot be nullptr. rstPin Hardware reset pin, resets the IMU intPin Hardware interrupt pin, this is used for the IMU to signal the host that it has a message to send wakePin Hardware wake pin, this is used by the processor to signal the BNO to wake up and receive a message misoPin SPI MISO pin mosiPin SPI MOSI pin sclkPin SPI SCLK pin csPin SPI CS pin spiSpeed SPI frequency. The BNO's max is 3MHz. threadPriority Priority to give the internal thread. Defaults to AboveNormal so it will run whenever it can.
Member Function Documentation
| bool begin | ( | ) | [override, virtual] |
Resets and connects to the IMU.
Verifies that it's connected, and reads out its version info into the class variables above.
Async version also starts the internal communication thread, restarting it if it's already started.
If this function is failing, it would be a good idea to turn on BNO_DEBUG in the cpp file to get detailed output.
- Returns:
- whether or not initialization was successful
Reimplemented from BNO080Base.
Definition at line 228 of file BNO080Async.cpp.
| void disableReport | ( | Report | report ) | [inherited] |
Disable a data report from the IMU.
- Parameters:
-
report The report to disable.
Definition at line 428 of file BNO080.cpp.
| bool enableCalibration | ( | bool | calibrateAccel, |
| bool | calibrateGyro, | ||
| bool | calibrateMag | ||
| ) | [inherited] |
Tells the IMU to begin a dynamic sensor calibration.
To calibrate the IMU, call this function and move the IMU according to the instructions in the "BNO080 Sensor Calibration Procedure" app note (http://www.hillcrestlabs.com/download/59de9014566d0727bd002ae7).
To tell when the calibration is complete, look at the status bits for Game Rotation Vector (for accel and gyro) and Magnetic Field (for the magnetometer).
The gyro and accelerometer should only need to be calibrated once, but the magnetometer will need to be recalibrated every time the orientation of ferrous metals around the IMU changes (e.g. when it is put into a new enclosure).
The new calibration will not be saved in flash until you call saveCalibration().
NOTE: calling this with all false values will cancel any calibration in progress. However, the calibration data being created will remain in use until the next chip reset (I think!)
- Parameters:
-
calibrateAccel Whether to calibrate the accelerometer. calibrateGyro Whether to calibrate the gyro. calibrateMag Whether to calibrate the magnetometer.
- Returns:
- whether the operation succeeded
Definition at line 216 of file BNO080.cpp.
| void enableReport | ( | Report | report, |
| uint16_t | timeBetweenReports | ||
| ) | [inherited] |
Enable a data report from the IMU.
Look at the comments above to see what the reports do. This function checks your polling period against the report's max speed in the IMU's metadata, and reports an error if you're trying to poll too fast.
- Parameters:
-
timeBetweenReports time in milliseconds between data updates.
Definition at line 409 of file BNO080.cpp.
| int16_t floatToQ | ( | float | qFloat, |
| uint8_t | qPoint | ||
| ) | [protected, inherited] |
Given a floating point value and a Q point, convert to Q See https://en.wikipedia.org/wiki/Q_(number_format)
- Parameters:
-
qFloat qPoint
- Returns:
Definition at line 850 of file BNO080.cpp.
| int32_t floatToQ_dword | ( | float | qFloat, |
| uint16_t | qPoint | ||
| ) | [protected, inherited] |
Given a floating point value and a Q point, convert to Q See https://en.wikipedia.org/wiki/Q_(number_format)
This version is used for the signed 32-bit values in metadata records.
- Parameters:
-
qFloat qPoint
- Returns:
Definition at line 856 of file BNO080.cpp.
| float getMaxPeriod | ( | Report | report ) | [inherited] |
Gets the larges polling period that a report supports.
Some reports don't have a max period, in which case this function will return -1.0.
- Returns:
- Period in seconds, or -1.0 on error.
Definition at line 477 of file BNO080.cpp.
| uint16_t getMetaVersion | ( | ) | [protected, inherited] |
| float getMinPeriod | ( | Report | report ) | [inherited] |
Gets the smallest polling period that a report supports.
- Returns:
- Period in seconds.
Definition at line 470 of file BNO080.cpp.
| float getPower | ( | Report | report ) | [inherited] |
Get the power used by a report when it's operating, according to the IMU.
- Parameters:
-
report
- Returns:
- Power used in mA.
Definition at line 461 of file BNO080.cpp.
| int16_t getQ1 | ( | Report | report ) | [protected, inherited] |
Gets the Q point from a report's metadata, which essentially defines where the decimal point goes in the sensor's output.
The 1/2/3 Q values are used in different places in the metadata, see SH-2 section 5.1 for details.
- Parameters:
-
report
- Returns:
Definition at line 509 of file BNO080.cpp.
| float getRange | ( | Report | report ) | [inherited] |
Gets the range of a report as reported by the IMU.
Units are the same as the report's output data.
- Returns:
Definition at line 446 of file BNO080.cpp.
| uint8_t getReportStatus | ( | Report | report ) | [inherited] |
Gets the status of a report as a 2 bit number.
per SH-2 section 6.5.1, this is interpreted as:
0 - unreliable
1 - accuracy low
2 - accuracy medium
3 - accuracy high
of course, these are only updated if a given report is enabled.
- Parameters:
-
report
- Returns:
Definition at line 367 of file BNO080.cpp.
| const char * getReportStatusString | ( | Report | report ) | [inherited] |
Get a string for printout describing the status of a sensor.
- Returns:
Definition at line 378 of file BNO080.cpp.
| float getResolution | ( | Report | report ) | [inherited] |
Gets the resolution of a report as reported by the IMU.
Units are the same as the report's output data.
- Parameters:
-
report
- Returns:
Definition at line 454 of file BNO080.cpp.
| uint32_t getSerialNumber | ( | ) | [inherited] |
Gets the serial number (used to uniquely identify each individual device).
NOTE: this function should work according to the datasheet, but the device I was testing with appears to have an empty serial number record as shipped, and I could never get anything out of it. Your mileage may vary.
- Returns:
- The serial number, or 0 on error.
Definition at line 434 of file BNO080.cpp.
| bool hasNewData | ( | Report | report ) | [inherited] |
Checks if a specific report has gotten new data since the last call to this function.
- Parameters:
-
report The report to check.
- Returns:
- Whether the report has received new data.
Definition at line 395 of file BNO080.cpp.
| bool loadReportMetadata | ( | BNO080Base::Report | report ) | [protected, inherited] |
Loads the metadata for this report into the metadata buffer.
- Parameters:
-
report
- Returns:
- Whether the operation succeeded.
Definition at line 1222 of file BNO080.cpp.
| void lockMutex | ( | ) | [override, virtual] |
| void parseSensorDataPacket | ( | ) | [protected, inherited] |
Processes the sensor data packet currently stored in the buffer.
Only called from processPacket()
Definition at line 572 of file BNO080.cpp.
| void printMetadataSummary | ( | Report | report ) | [inherited] |
Prints a summary of a report's metadata to the debug stream.
Should be useful for debugging and setting up reports since lots of this data isn't given in the datasheets.
Note: to save string constant space, this function is only available when BNO_DEBUG is 1.
Definition at line 490 of file BNO080.cpp.
| void printPacket | ( | uint8_t * | buffer ) | [protected, inherited] |
Prints the current shtp packet stored in the buffer.
- Parameters:
-
length
Definition at line 1174 of file BNO080.cpp.
| void processPacket | ( | ) | [protected, inherited] |
Processes the packet currently stored in the buffer, and updates class variables to reflect the data it contains.
Definition at line 530 of file BNO080.cpp.
| float qToFloat | ( | int16_t | fixedPointValue, |
| uint8_t | qPoint | ||
| ) | [protected, inherited] |
Given a Q value, converts fixed point floating to regular floating point number.
- Parameters:
-
fixedPointValue qPoint
- Returns:
Definition at line 834 of file BNO080.cpp.
| float qToFloat_dword | ( | uint32_t | fixedPointValue, |
| int16_t | qPoint | ||
| ) | [protected, inherited] |
Given a Q value, converts fixed point floating to regular floating point number.
This version is used for the unsigned 32-bit values in metadata records.
- Parameters:
-
fixedPointValue qPoint
- Returns:
Definition at line 841 of file BNO080.cpp.
| bool readFRSRecord | ( | uint16_t | recordID, |
| uint32_t * | readBuffer, | ||
| uint16_t | readLength | ||
| ) | [protected, inherited] |
Read a record from the FRS (Flash Record System) on the IMU.
FRS records are composed of 32-bit words, with the size of each record determined by the record type.
Will block until the entire record has been read.
- Parameters:
-
recordID Record ID to read. See SH-2 figures 28 and 29 for a list of these. Sometimes also called the "FRS Type" by the datasheet (???). readBuffer Buffer to read data into. readLength Amount of words to read from the record. Must be <= the length of the record.
- Returns:
- whether the request succeeded
Definition at line 915 of file BNO080.cpp.
| bool receiveCompletePacket | ( | size_t | bytesRead, |
| std::chrono::milliseconds | timeout = 200ms |
||
| ) | [protected, inherited] |
Assuming that at least a packet header has been read into the RX buffer, receive the remainder of the packet.
- Parameters:
-
bytesRead The number of bytes (including the header) of the packet that have already been read.
- Returns:
Definition at line 1597 of file BNO080.cpp.
| bool receivePacket | ( | std::chrono::milliseconds | timeout = 200ms ) |
[override, protected, virtual, inherited] |
Reads a packet from the IMU and stores it in the class variables.
- Parameters:
-
timeout how long to wait for there to be a packet
- Returns:
- whether a packet was recieved.
Implements BNO080Base.
Definition at line 1575 of file BNO080.cpp.
| bool saveCalibration | ( | ) | [inherited] |
Saves the calibration started with startCalibration() and ends the calibration.
You will want to call this once the status bits read as "accuracy high".
WARNING: if you paid for a factory calibrated IMU, then this WILL OVERWRITE THE FACTORY CALIBRATION in whatever sensors are being calibrated. Use with caution!
- Returns:
- whether the operation succeeded
Definition at line 260 of file BNO080.cpp.
| void sendCommand | ( | uint8_t | command ) | [protected, inherited] |
Tell the sensor to do a command.
See SH-2 Reference Manual section 6.3.8 page 42, Command request The caller is expected to set shtpData 3 though 11 prior to calling
Definition at line 864 of file BNO080.cpp.
| void setFeatureCommand | ( | uint8_t | reportID, |
| uint16_t | timeBetweenReports, | ||
| uint32_t | specificConfig = 0 |
||
| ) | [protected, inherited] |
Given a sensor's report ID, this tells the BNO080 to begin reporting the values.
- Parameters:
-
reportID timeBetweenReports specificConfig the specific config word. Useful for personal activity classifier.
Definition at line 887 of file BNO080.cpp.
| bool setPermanentOrientation | ( | Quaternion | orientation ) | [inherited] |
Sets the orientation quaternion, telling the sensor how it's mounted in relation to world space.
See page 40 of the BNO080 datasheet.
Unlike setSensorOrientation(), this setting will persist across sensor restarts. However, it will also take a few hundred milliseconds to write.
- Parameters:
-
orientation quaternion mapping from IMU space to world space.
- Returns:
- true if the operation succeeded, false if it failed.
Definition at line 328 of file BNO080.cpp.
| void setSensorOrientation | ( | Quaternion | orientation ) | [inherited] |
Sets the orientation quaternion, telling the sensor how it's mounted in relation to world space.
See page 40 of the BNO080 datasheet.
NOTE: this driver provides the macro SQRT_2 to help with entering values from that table.
NOTE 2: this setting does not persist and will have to be re-applied every time the chip is reset. Use setPermanentOrientation() for that.
- Parameters:
-
orientation quaternion mapping from IMU space to world space.
Definition at line 296 of file BNO080.cpp.
| void spiTransferAndWait | ( | const uint8_t * | tx_buffer, |
| int | tx_length, | ||
| uint8_t * | rx_buffer, | ||
| int | rx_length | ||
| ) | [protected, inherited] |
Start an SPI transfer and wait for it to complete.
BNO080Async swaps in a threaded implementation here. API same as SPI::write().
| void spiTransferAndWait | ( | const uint8_t * | tx_buffer, |
| int | tx_length, | ||
| uint8_t * | rx_buffer, | ||
| int | rx_length | ||
| ) | [protected, inherited] |
Start an SPI transfer and suspend the current thread until it is complete.
Used by functions in BNO080SPI. Note: should only be called by one thread at a time.
- Parameters:
-
tx_buffer tx_length rx_buffer rx_length
Definition at line 1685 of file BNO080.cpp.
| void tare | ( | bool | zOnly = false ) |
[inherited] |
Tells the IMU to use its current rotation vector as the "zero" rotation vector and to reorient all outputs accordingly.
- Parameters:
-
zOnly If true, only the rotation about the Z axis (the heading) will be tared.
Definition at line 195 of file BNO080.cpp.
| void unlockMutex | ( | ) | [override, virtual] |
Unlocks the data mutex.
Reimplemented from BNO080Base.
Definition at line 134 of file BNO080Async.h.
| bool updateData | ( | ) | [override, virtual] |
In BNO080Async, there is no need to call updateData() in order to get new results, but this call is provided for compatibility.
It maintains its behavior of returning true iff packets have been received since the last call. You must lock bnoDataMutex to call this.
- Returns:
Reimplemented from BNO080Base.
Definition at line 294 of file BNO080Async.cpp.
| bool writeFRSRecord | ( | uint16_t | recordID, |
| uint32_t * | buffer, | ||
| uint16_t | length | ||
| ) | [protected, inherited] |
Write a record to the FRS (Flash Record System) on the IMU.
FRS records are composed of 32-bit words, with the size of each record determined by the record type.
Will block until the entire record has been written.
- Parameters:
-
recordID Record ID to write. See SH-2 figures 28 and 29 for a list of these. Sometimes also called the "FRS Type" by the datasheet (???). buffer Buffer to write data into. length Amount of words to write to the record. Must be <= the length of the record.
- Returns:
- whether the request succeeded
Definition at line 1024 of file BNO080.cpp.
Field Documentation
Stream* _debugPort [protected, inherited] |
InterruptIn _int [protected, inherited] |
SPI _spiPort [protected, inherited] |
int _spiSpeed [protected, inherited] |
uint16_t bufferMetadataRecord [protected, inherited] |
uint8_t commandSequenceNumber [protected, inherited] |
bool doubleTap [inherited] |
Quaternion gameRotationVector [inherited] |
float geomagneticRotationAccuracy [inherited] |
Quaternion geomagneticRotationVector [inherited] |
TVector3 gravityAcceleration [inherited] |
TVector3 gyroRotation [inherited] |
TVector3 hardIronOffset [inherited] |
TVector3 linearAcceleration [inherited] |
TVector3 magFieldUncalibrated [inherited] |
uint8_t majorSoftwareVersion [inherited] |
uint32_t metadataRecord[METADATA_BUFFER_LEN] [protected, inherited] |
bool reportHasBeenUpdated[STATUS_ARRAY_LEN] [protected, inherited] |
stores whether a sensor has been updated since the last call to hasNewData()
uint8_t reportStatus[STATUS_ARRAY_LEN] [protected, inherited] |
float rotationAccuracy [inherited] |
Quaternion rotationVector [inherited] |
uint16_t rxPacketLength [protected, inherited] |
uint8_t sequenceNumber[6] [protected, inherited] |
bool shakeDetected [inherited] |
bool significantMotionDetected [inherited] |
uint16_t stepCount [inherited] |
bool stepDetected [inherited] |
bool tapDetected [inherited] |
TVector3 totalAcceleration [inherited] |
uint8_t* txShtpData = txPacketBuffer + SHTP_HEADER_SIZE [protected, inherited] |
uint8_t* txShtpHeader = txPacketBuffer [protected, inherited] |
bool xAxisShake [inherited] |
Generated on Wed Jul 13 2022 10:30:01 by
1.7.2
Hilcrest BNO080