upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Data Structures | Functions | Typedefs
Include dependency graph for bno055.h:

API Description

/*
* Author: Jon Trulson <jtrulson@ics.com>
* Copyright (c) 2017 Intel Corporation.
*
* The MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <stdbool.h>
#include <stdio.h>
#include <upm_utilities.h>
#include <signal.h>
#include "bno055.h"
bool shouldRun = true;
void sig_handler(int signo)
{
if (signo == SIGINT)
shouldRun = false;
}
int main(int argc, char **argv)
{
signal(SIGINT, sig_handler);
// Initialize a BNO055 using default parameters (bus 0, addr
// 0x28). The default running mode is NDOF absolute orientation
// mode.
bno055_context sensor = bno055_init(0, BNO055_DEFAULT_ADDR);
if (!sensor)
{
printf("bno055_init() failed.\n");
return 1;
}
// First we need to calibrate....
printf("First we need to calibrate. 4 numbers will be output every \n"
"second for each sensor. 0 means uncalibrated, and 3 means \n"
"fully calibrated.\n"
"See the UPM documentation on this sensor for instructions on \n"
"what actions are required to calibrate.\n");
// do the calibration...
while (shouldRun && !bno055_is_fully_calibrated(sensor))
{
int mag, acc, gyr, sys;
bno055_get_calibration_status(sensor, &mag, &acc, &gyr, &sys);
printf("Magnetometer: %d Accelerometer: %d Gyroscope: %d System: %d\n",
mag, acc, gyr, sys);
upm_delay(1);
}
printf("\nCalibration complete.\n\n");
// now output various fusion data every 250 milliseconds
while (shouldRun)
{
float w, x, y, z;
if (bno055_update(sensor))
{
printf("bno055_update() failed.\n");
return 1;
}
bno055_get_euler_angles(sensor, &x, &y, &z);
printf("Euler: Heading: %f Roll: %f Pitch: %f degrees\n",
x, y, z);
bno055_get_quaternions(sensor, &w, &x, &y, &z);
printf("Quaternion: W: %f X: %f Y: %f Z: %f\n",
w, x, y, z);
bno055_get_linear_acceleration(sensor, &x, &y, &z);
printf("Linear Acceleration: X: %f Y: %f Z: %f m/s^2\n",
x, y, z);
bno055_get_gravity_vectors(sensor, &x, &y, &z);
printf("Gravity Vector: X: %f Y: %f Z: %f m/s^2\n",
x, y, z);
printf("\n");
upm_delay_ms(250);
}
printf("Exiting...\n");
bno055_close(sensor);
return 0;
}

Go to the source code of this file.

Data Structures

struct  _bno055_context
 

Functions

bno055_context bno055_init (int bus, uint8_t addr)
 
void bno055_close (bno055_context dev)
 
upm_result_t bno055_update (const bno055_context dev)
 
upm_result_t bno055_get_chip_id (const bno055_context dev, uint8_t *chip_id)
 
upm_result_t bno055_get_acc_id (const bno055_context dev, uint8_t *chip_id)
 
upm_result_t bno055_get_mag_id (const bno055_context dev, uint8_t *chip_id)
 
upm_result_t bno055_get_gyr_id (const bno055_context dev, uint8_t *chip_id)
 
upm_result_t bno055_get_sw_revision (const bno055_context dev, uint16_t *sw_rev)
 
upm_result_t bno055_get_bootloader_id (const bno055_context dev, uint8_t *bl_id)
 
upm_result_t bno055_set_clock_external (const bno055_context dev, bool extClock)
 
upm_result_t bno055_set_temperature_source (const bno055_context dev, BNO055_TEMP_SOURCES_T src)
 
upm_result_t bno055_set_temperature_units_celsius (const bno055_context dev)
 
upm_result_t bno055_set_operation_mode (const bno055_context dev, BNO055_OPERATION_MODES_T mode)
 
upm_result_t bno055_reset_system (const bno055_context dev)
 
upm_result_t bno055_get_calibration_status (const bno055_context dev, int *mag, int *acc, int *gyr, int *sys)
 
bool bno055_is_fully_calibrated (const bno055_context dev)
 
upm_result_t bno055_read_calibration_data (const bno055_context dev, uint8_t *data, size_t len)
 
upm_result_t bno055_write_calibration_data (const bno055_context dev, uint8_t *data, size_t len)
 
float bno055_get_temperature (const bno055_context dev)
 
void bno055_get_euler_angles (const bno055_context dev, float *heading, float *roll, float *pitch)
 
void bno055_get_quaternions (const bno055_context dev, float *w, float *x, float *y, float *z)
 
void bno055_get_linear_acceleration (const bno055_context dev, float *x, float *y, float *z)
 
void bno055_get_gravity_vectors (const bno055_context dev, float *x, float *y, float *z)
 
void bno055_get_accelerometer (const bno055_context dev, float *x, float *y, float *z)
 
void bno055_get_magnetometer (const bno055_context dev, float *x, float *y, float *z)
 
void bno055_get_gyroscope (const bno055_context dev, float *x, float *y, float *z)
 
upm_result_t bno055_set_acceleration_config (const bno055_context dev, BNO055_ACC_RANGE_T range, BNO055_ACC_BW_T bw, BNO055_ACC_PWR_MODE_T pwr)
 
upm_result_t bno055_set_magnetometer_config (const bno055_context dev, BNO055_MAG_ODR_T odr, BNO055_MAG_OPR_T opr, BNO055_MAG_POWER_T pwr)
 
upm_result_t bno055_set_gyroscope_config (const bno055_context dev, BNO055_GYR_RANGE_T range, BNO055_GYR_BW_T bw, BNO055_GYR_POWER_MODE_T pwr)
 
upm_result_t bno055_set_accelerometer_units (const bno055_context dev, bool mg)
 
upm_result_t bno055_set_gyroscope_units (const bno055_context dev, bool radians)
 
upm_result_t bno055_set_euler_units (const bno055_context dev, bool radians)
 
upm_result_t bno055_reset_interrupt_status (const bno055_context dev)
 
upm_result_t bno055_get_interrupt_status (const bno055_context dev, uint8_t *istat)
 
upm_result_t bno055_get_interrupt_enable (const bno055_context dev, uint8_t *ienable)
 
upm_result_t bno055_set_interrupt_enable (const bno055_context dev, uint8_t enables)
 
upm_result_t bno055_get_interrupt_mask (const bno055_context dev, uint8_t *imask)
 
upm_result_t bno055_set_interrupt_mask (const bno055_context dev, uint8_t mask)
 
upm_result_t bno055_get_system_status (const bno055_context dev, BNO055_SYS_STATUS_T *sys_stat)
 
upm_result_t bno055_get_system_error (const bno055_context dev, BNO055_SYS_ERR_T *sys_err)
 
upm_result_t bno055_install_isr (const bno055_context dev, int gpio, mraa_gpio_edge_t level, void(*isr)(void *), void *arg)
 
void bno055_uninstall_isr (const bno055_context dev)
 
upm_result_t bno055_set_page (const bno055_context dev, uint8_t page, bool force)
 
upm_result_t bno055_read_reg (const bno055_context dev, uint8_t reg, uint8_t *retval)
 
upm_result_t bno055_read_regs (const bno055_context dev, uint8_t reg, uint8_t *buffer, size_t len)
 
upm_result_t bno055_write_reg (const bno055_context dev, uint8_t reg, uint8_t val)
 
upm_result_t bno055_write_regs (const bno055_context dev, uint8_t reg, uint8_t *buffer, size_t len)
 

Typedefs

typedef struct _bno055_contextbno055_context
 

Function Documentation

bno055_context bno055_init ( int  bus,
uint8_t  addr 
)

BNO055 initialization.

By default, this function sets the acceleration units to m/s^2, gyro and Euler units to degrees, and temperature to celsius. It then enters the NDOF fusion mode.

In addition, the internal clock is used so that compatibility with other implementations is assured. If you are using a device with an external clock, call setClockExternal(true) to enable it.

Parameters
busI2C bus to use.
addressThe I2C address for this device.
Returns
The device context, or NULL if an error occurred.

Here is the call graph for this function:

void bno055_close ( bno055_context  dev)

BNO055 close function.

Parameters
devThe device context.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_update ( const bno055_context  dev)

Update the internal stored values from sensor data.

Parameters
devThe device context.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_chip_id ( const bno055_context  dev,
uint8_t *  chip_id 
)

Return the chip ID.

Parameters
devThe device context.
chip_idThe chip ID (BNO055_CHIPID).
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_acc_id ( const bno055_context  dev,
uint8_t *  chip_id 
)

Return the accelerometer chip ID.

Parameters
devThe device context.
chip_idThe chip ID
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_mag_id ( const bno055_context  dev,
uint8_t *  chip_id 
)

Return the magnetometer chip ID.

Parameters
devThe device context.
chip_idThe chip ID
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_gyr_id ( const bno055_context  dev,
uint8_t *  chip_id 
)

Return the gyroscope chip ID.

Parameters
devThe device context.
chip_idThe chip ID
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_sw_revision ( const bno055_context  dev,
uint16_t *  sw_rev 
)

Return the fusion firmware revison.

Parameters
devThe device context.
sw_revThe firmware revison.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_bootloader_id ( const bno055_context  dev,
uint8_t *  bl_id 
)

Return the bootloader ID.

Parameters
devThe device context.
bl_idThe bootloader ID.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_clock_external ( const bno055_context  dev,
bool  extClock 
)

Enable or disables the use of the external clock. The Adafriut device does contain an external clock which might be more stable. By default, the internal clock is used.

Parameters
devThe device context.
extClocktrue to use external clock, false otherwise.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_temperature_source ( const bno055_context  dev,
BNO055_TEMP_SOURCES_T  src 
)

Select the temperature source. This can be the accelerometer or the gyroscope. By default, the accelerometer temperature is used as the source.

Parameters
devThe device context.
srcOne of the TEMP_SOURCES_T values.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_temperature_units_celsius ( const bno055_context  dev)

Set the temperature units of the device to Celsius (always).

Parameters
devThe device context.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_operation_mode ( const bno055_context  dev,
BNO055_OPERATION_MODES_T  mode 
)

Set the operating mode for the device. This places the device into a config mode, one of 7 non-fusion modes, or one of 5 fusion modes. All stored sensor data is cleared when switching modes. The device must be in config mode for most configuration operations. See the datasheet for details.

Parameters
devThe device context.
modeOne of the OPERATION_MODES_T values.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_reset_system ( const bno055_context  dev)

Reboot the sensor. This is equivalent to a power on reset. All calibration data will be lost, and the device must be re-calibrated.

Parameters
devThe device context.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_calibration_status ( const bno055_context  dev,
int *  mag,
int *  acc,
int *  gyr,
int *  sys 
)

Read the calibration status registers and return them. The values range from 0 (uncalibrated) to 3 (fully calibrated).

Parameters
devThe device context.
magThe calibration status of the magnetometer.
accThe calibration status of the accelerometer.
magThe calibration status of the gyroscope.
magThe calibration status of the overall system.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

bool bno055_is_fully_calibrated ( const bno055_context  dev)

Read the calibration status registers and return true or false, indicating whether all of the calibration parameters are fully calibrated.

Parameters
devThe device context.
Returns
true if all 4 calibration parameters are fully calibrated, else false.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_read_calibration_data ( const bno055_context  dev,
uint8_t *  data,
size_t  len 
)

Read the calibration data and place it into a buffer. The buffer must be BNO055_CALIBRATION_DATA_SIZE bytes in size. This data can then be saved for later reuse by bno055_write_calibration_data() to restore calibration data after a reset. Note: bno055_is_fully_calibrated() (calibration is complete) must be true or an error will result.

Parameters
devThe device context.
dataA pointer to a buffer to hold the calibration data. This buffer must be BNO055_CALIBRATION_DATA_SIZE bytes in length.
lenThe length of the buffer. An error will be returned if the length is not equal to BNO055_CALIBRATION_DATA_SIZE.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_write_calibration_data ( const bno055_context  dev,
uint8_t *  data,
size_t  len 
)

Write previously saved calibration data to the calibration registers. The array containing the data must be BNO055_CALIBRATION_DATA_SIZE bytes in size.

Parameters
devThe device context.
datauint8_t array representing calibration data, as obtained by bno055_read_calibration_data().
lenThe length of the supplied buffer. An error will be returned if the length is not equal to BNO055_CALIBRATION_DATA_SIZE.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

float bno055_get_temperature ( const bno055_context  dev)

Return the current measured temperature. Note, this is not ambient temperature - this is the temperature of the selected source on the chip. update() must have been called prior to calling this method.

Parameters
devThe device context.
Returns
The temperature in degrees Celsius.

Here is the caller graph for this function:

void bno055_get_euler_angles ( const bno055_context  dev,
float *  heading,
float *  roll,
float *  pitch 
)

Return current orientation fusion data in the form of Euler Angles. By default, the returned values are in degrees. update() must have been called prior to calling this method.

Parameters
devThe device context.
headingPointer to a floating point value that will have the current heading angle placed into it.
rollPointer to a floating point value that will have the current roll angle placed into it.
pitchPointer to a floating point value that will have the current pitch angle placed into it.

Here is the caller graph for this function:

void bno055_get_quaternions ( const bno055_context  dev,
float *  w,
float *  x,
float *  y,
float *  z 
)

Return current orientation fusion data in the form of Quaternions. update() must have been called prior to calling this method.

Parameters
devThe device context.
wPointer to a floating point value that will have the current w component placed into it.
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.

Here is the caller graph for this function:

void bno055_get_linear_acceleration ( const bno055_context  dev,
float *  x,
float *  y,
float *  z 
)

Return current orientation fusion data in the form of Linear Acceleration. By default the returned values are in meters per-second squared (m/s^2). update() must have been called prior to calling this method.

Parameters
devThe device context.
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.

Here is the caller graph for this function:

void bno055_get_gravity_vectors ( const bno055_context  dev,
float *  x,
float *  y,
float *  z 
)

Return current orientation fusion data in the form of a Gravity Vector per-axis. By default the returned values are in meters per-second squared (m/s^2). update() must have been called prior to calling this method.

Parameters
devThe device context.
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.

Here is the caller graph for this function:

void bno055_get_accelerometer ( const bno055_context  dev,
float *  x,
float *  y,
float *  z 
)

Return accelerometer data (non-fusion). In fusion modes, this data will be of little value. By default the returned values are in meters per-second squared (m/s^2). update() must have been called prior to calling this method.

Parameters
devThe device context.
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.

Here is the caller graph for this function:

void bno055_get_magnetometer ( const bno055_context  dev,
float *  x,
float *  y,
float *  z 
)

Return magnetometer data (non-fusion). In fusion modes, this data will be of little value. The returned values are in micro-teslas (uT). update() must have been called prior to calling this method.

Parameters
devThe device context.
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.

Here is the caller graph for this function:

void bno055_get_gyroscope ( const bno055_context  dev,
float *  x,
float *  y,
float *  z 
)

Return gyroscope data (non-fusion). In fusion modes, this data will be of little value. By default the returned values are in meters per-second squared (m/s^2). update() must have been called prior to calling this method.

Parameters
devThe device context.
xPointer to a floating point value that will have the current x component placed into it.
yPointer to a floating point value that will have the current y component placed into it.
zPointer to a floating point value that will have the current z component placed into it.

Here is the caller graph for this function:

upm_result_t bno055_set_acceleration_config ( const bno055_context  dev,
BNO055_ACC_RANGE_T  range,
BNO055_ACC_BW_T  bw,
BNO055_ACC_PWR_MODE_T  pwr 
)

Set the bandwidth, range, and power modes of the accelerometer. In fusion modes, these values will be ignored.

Parameters
devThe device context.
rangeOne of the BNO055_ACC_RANGE_T values.
bwOne of the BNO055_ACC_BW_T values.
pwrOne of the BNO055_ACC_PWR_MODE_T values.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_magnetometer_config ( const bno055_context  dev,
BNO055_MAG_ODR_T  odr,
BNO055_MAG_OPR_T  opr,
BNO055_MAG_POWER_T  pwr 
)

Set the output data rate, operating mode and power mode of the magnetometer. In fusion modes, these values will be ignored.

Parameters
devThe device context.
odrOne of the BNO055_MAG_ODR_T values.
oprOne of the BNO055_MAG_OPR_T values.
pwrOne of the BNO055_MAG_POWER_T values.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_gyroscope_config ( const bno055_context  dev,
BNO055_GYR_RANGE_T  range,
BNO055_GYR_BW_T  bw,
BNO055_GYR_POWER_MODE_T  pwr 
)

Set the range, bandwidth and power modes of the gyroscope. In fusion modes, these values will be ignored.

Parameters
devThe device context.
rangeOne of the BNO055_GYR_RANGE_T values.
bwOne of the BNO055_GYR_BW_T values.
pwrOne of the BNO055_GYR_POWER_MODE_T values.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_accelerometer_units ( const bno055_context  dev,
bool  mg 
)

Set the unit of measurement for the accelerometer related sensor values. The choices are mg (milli-gravities) or meters per-second squared (m/s^2). The default is m/s^2.

Parameters
devThe device context.
mgtrue for mg, false for m/s^2.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_gyroscope_units ( const bno055_context  dev,
bool  radians 
)

Set the unit of measurement for the gyroscope related sensor values. The choices are degrees and radians. The default is degrees.

Parameters
devThe device context.
radianstrue for radians, false for degrees.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_euler_units ( const bno055_context  dev,
bool  radians 
)

Set the unit of measurement for the Euler Angle related sensor values. The choices are degrees and radians. The default is degrees.

Parameters
devThe device context.
radianstrue for radians, false for degrees.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_reset_interrupt_status ( const bno055_context  dev)

Reset all interrupt status bits and interrupt output.

Parameters
devThe device context.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_interrupt_status ( const bno055_context  dev,
uint8_t *  istat 
)

Get the interrupt status register. This is a bitmask of the INT_STA_BITS_T bits.

Parameters
devThe device context.
istatA bitmask of INT_STA_BITS_T bits.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_interrupt_enable ( const bno055_context  dev,
uint8_t *  ienable 
)

Get the interrupt enables register. This is a bitmask of the INT_STA_BITS_T bits.

Parameters
devThe device context.
ienableA bitmask of INT_STA_BITS_T bits currently set in the enable register.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_interrupt_enable ( const bno055_context  dev,
uint8_t  enables 
)

Set the interrupt enable register. This is composed of a bitmask of the INT_STA_BITS_T bits.

Parameters
devThe device context.
enablesa bitmask of INT_STA_BITS_T bits to enable
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_interrupt_mask ( const bno055_context  dev,
uint8_t *  imask 
)

Get the interrupt mask register. This is a bitmask of the INT_STA_BITS_T bits. The interrupt mask is used to mask off enabled interrupts from generating a hardware interrupt. The interrupt status register can still be used to detect masked interrupts if they are enabled.

Parameters
devThe device context.
imaska bitmask of INT_STA_BITS_T bits currently set in the interrupt mask register.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_set_interrupt_mask ( const bno055_context  dev,
uint8_t  mask 
)

Set the interrupt mask register. This is a bitmask of the INT_STA_BITS_T bits. The interrupt mask is used to mask off enabled interrupts from generating a hardware interrupt. The interrupt status register can still be used to detect masked interrupts if they are enabled.

Parameters
devThe device context.
maskA bitmask of INT_STA_BITS_T bits to set in the interrupt mask register.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_system_status ( const bno055_context  dev,
BNO055_SYS_STATUS_T *  sys_stat 
)

Get the value of the system status register. This method can be used to determine the overall status of the device.

Parameters
devThe device context.
sys_statOne of the SYS_STATUS_T values.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_get_system_error ( const bno055_context  dev,
BNO055_SYS_ERR_T *  sys_err 
)

Return the value of the system error register. This mathod can be used to determine a variety of system related error conditions.

Parameters
devThe device context.
sys_statOne of the SYS_ERR_T values.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_install_isr ( const bno055_context  dev,
int  gpio,
mraa_gpio_edge_t  level,
void(*)(void *)  isr,
void *  arg 
)

install an interrupt handler.

Parameters
devThe device context.
gpioThe GPIO pin to use as interrupt pin.
levelThe interrupt trigger level (one of mraa_gpio_edge_t values). Make sure that you have configured the interrupt pin properly (on the device) for whatever level method you choose.
isrThe interrupt handler, accepting a void * argument.
argThe argument to pass the the interrupt handler.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

void bno055_uninstall_isr ( const bno055_context  dev)

uninstall a previously installed interrupt handler

Parameters
devThe device context.

Here is the caller graph for this function:

upm_result_t bno055_set_page ( const bno055_context  dev,
uint8_t  page,
bool  force 
)

Set the current internal device register page. This is a low level function and should not be used unless you know what you are doing.

Parameters
devThe device context.
pageThe page number to set. This can only be 0 or 1.
forceIf true, force the device page state to match indicated internal page state regardless of current state.
Returns
UPM result.

Here is the call graph for this function:

Here is the caller graph for this function:

upm_result_t bno055_read_reg ( const bno055_context  dev,
uint8_t  reg,
uint8_t *  retval 
)

Read a register. This is a low level function and should not be used unless you know what you are doing.

Parameters
devThe device context.
regThe register to read
retvalThe returned value of the register
Returns
UPM result.

Here is the caller graph for this function:

upm_result_t bno055_read_regs ( const bno055_context  dev,
uint8_t  reg,
uint8_t *  buffer,
size_t  len 
)

Read contiguous registers into a buffer. This is a low level function and should not be used unless you know what you are doing.

Parameters
devThe device context.
bufferThe buffer to store the results
lenThe number of registers to read
Returns
UPM result.

Here is the caller graph for this function:

upm_result_t bno055_write_reg ( const bno055_context  dev,
uint8_t  reg,
uint8_t  val 
)

Write to a register. This is a low level function and should not be used unless you know what you are doing.

Parameters
devThe device context.
regThe register to write to
valThe value to write
Returns
UPM result.

Here is the caller graph for this function:

upm_result_t bno055_write_regs ( const bno055_context  dev,
uint8_t  reg,
uint8_t *  buffer,
size_t  len 
)

Write data to contiguous registers. This is a low level function and should not be used unless you know what you are doing.

Parameters
devThe device context.
regThe starting register to write to
bufferThe buffer containing the data to write
lenThe number of bytes to write
Returns
UPM result.

Here is the caller graph for this function:

Typedef Documentation

typedef struct _bno055_context * bno055_context

Device context