#include <bmg160_parameters.hpp>
Public Types | |
enum | bandwidth { BW_32HZ = 0x07, BW_64HZ = 0x06, BW_12HZ = 0x05, BW_23HZ = 0x04, BW_47HZ = 0x03, BW_116HZ = 0x02, BW_230HZ = 0x01, BW_UNFILTERED = 0x00 } |
Configurable bandwidths that the user can set on the sensor. More... | |
enum | range { RANGE_2000 = 0x00, RANGE_1000 = 0x01, RANGE_500 = 0x02, RANGE_250 = 0x03, RANGE_125 = 0x04 } |
Configurable range values that the user can adjust on the sensor. See datasheet page 38. More... | |
Public Member Functions | |
BMG160Parameters () | |
constructor | |
int * | getFlags () |
Retreive the SPI-relevant settings encoded in the flags_ member. | |
int | getFrequency () |
int | getPin () |
retreive the physical pin of the hardware interface that the sensor's chip-select is connected to. | |
interface_protocol | getProtocol () |
retreive the interface protocol for which the device is configured. | |
double | getSensitivity () |
Retreive the sensitivity value to the corresponding gyro range such that the raw data can be correctly calculated. | |
bool | getSlaveAddressBit () |
void | setBandwidth (bandwidth bw) |
Change bandwidth parameter to input bandwidth. | |
bool | setByteOrder (uint8_t value) |
Configure the hardware-interface's SPI byte-order by which it will communicate with the sensor. | |
void | setFilter (bool input) |
Change filter parameter to filtered or unfiltered, depending on input value. | |
bool | setFrequency (int frequency) |
Change interface protocol frequency to a different frequency. | |
bool | setPin (uint8_t pin) |
Alert software driver of the physical pin of the hardware interface that the sensor's chip-select is connected to. | |
bool | setProtocol (interface_protocol protocol) |
Change gyro protocol parameter to a different protocol. | |
void | setRange (range new_range) |
Change gyro range parameter to a different range. | |
void | setSlaveAddressBit (bool high_or_low) |
Alerts the software driver that the chip's SDO pin is connected to either VDD or GND, which allows it to deduce the I2C device address. | |
bool | setSpiMode (uint8_t mode) |
Configure the hardware-interface's SPI mode by which it communicates with the sensor. | |
~BMG160Parameters () | |
destructor | |
Public Attributes | |
bandwidth | bw_reg_ |
the user-specified bandwidth register of the gyroscope. | |
bool | gyro_is_filtered_ |
A boolean indicating whether or not the gyro is outputting filtered data. | |
range | range_ |
The user-specified range value of the gyroscope. | |
double | sensitivity_ |
the sensitivity of the current gyro range. | |
bool | slave_address_bit_ |
Indicates whether the SDO pin is connected to VDD or GND. |
Definition at line 61 of file bmg160_parameters.hpp.
Configurable bandwidths that the user can set on the sensor.
Definition at line 96 of file bmg160_parameters.hpp.
Configurable range values that the user can adjust on the sensor. See datasheet page 38.
Definition at line 69 of file bmg160_parameters.hpp.
constructor
I2C Settings: (the default configuration)
SPI Settings: (relevant only if the user selects SPI)
flags_ must be first cleared to zero, because the next two settings directly manipulate bits in flags_.
Default sensor settings:
These settings correspond to the sensor's settings after every power-on or softReset(). These settings have been deduced from the datasheet default register values.
units: [g/LSB] // corresponds to RANGE_2
These next settings will write values to the sensor's registers upon calling initialize() from the bmg160 driver:
Definition at line 55 of file bmg160_parameters.cpp.
destructor
Definition at line 99 of file bmg160_parameters.cpp.
int * BMG160Parameters::getFlags | ( | ) | [virtual] |
Retreive the SPI-relevant settings encoded in the flags_ member.
This is an SPI-relevant parameter only. The flags_ value is ignored when the device is read from a protocol other than SPI.
Implements bosch_drivers_common::Parameters.
Definition at line 189 of file bmg160_parameters.cpp.
int BMG160Parameters::getFrequency | ( | ) | [virtual] |
Implements bosch_drivers_common::Parameters.
Definition at line 148 of file bmg160_parameters.cpp.
int BMG160Parameters::getPin | ( | ) | [virtual] |
retreive the physical pin of the hardware interface that the sensor's chip-select is connected to.
This is an SPI-relevant parameter only.
Implements bosch_drivers_common::Parameters.
Definition at line 174 of file bmg160_parameters.cpp.
interface_protocol BMG160Parameters::getProtocol | ( | ) | [virtual] |
retreive the interface protocol for which the device is configured.
Implements bosch_drivers_common::Parameters.
Definition at line 141 of file bmg160_parameters.cpp.
double BMG160Parameters::getSensitivity | ( | ) |
Retreive the sensitivity value to the corresponding gyro range such that the raw data can be correctly calculated.
Definition at line 105 of file bmg160_parameters.cpp.
bool BMG160Parameters::getSlaveAddressBit | ( | ) |
Definition at line 181 of file bmg160_parameters.cpp.
void BMG160Parameters::setBandwidth | ( | bandwidth | bw | ) |
Change bandwidth parameter to input bandwidth.
To apply this parameter on the sensor, the user must subsequently call one of two methods in the bmg160 driver: initialize() or changeBandwidth().
Definition at line 274 of file bmg160_parameters.cpp.
bool BMG160Parameters::setByteOrder | ( | uint8_t | value | ) |
Configure the hardware-interface's SPI byte-order by which it will communicate with the sensor.
Byte-order arguments are either MSB_FIRST or LSB_FIRST, both of which are defined in the bosch_drivers_common.
Definition at line 218 of file bmg160_parameters.cpp.
void BMG160Parameters::setFilter | ( | bool | input | ) |
Change filter parameter to filtered or unfiltered, depending on input value.
To apply this filter parameter on the sensor, the user must subsequently call one of two methods in the bmg160 driver: initialize() or filterData(gyro_is_filtered_) , where gyro_is_filtered is a class member of this class.
Definition at line 267 of file bmg160_parameters.cpp.
bool BMG160Parameters::setFrequency | ( | int | frequency | ) | [virtual] |
Change interface protocol frequency to a different frequency.
User should not need to change this value. The frequency set upon instantiation is functional.
Implements bosch_drivers_common::Parameters.
Definition at line 132 of file bmg160_parameters.cpp.
bool BMG160Parameters::setPin | ( | uint8_t | pin | ) | [virtual] |
Alert software driver of the physical pin of the hardware interface that the sensor's chip-select is connected to.
This is an SPI-relevant parameter only.
Implements bosch_drivers_common::Parameters.
Definition at line 155 of file bmg160_parameters.cpp.
bool BMG160Parameters::setProtocol | ( | interface_protocol | protocol | ) |
Change gyro protocol parameter to a different protocol.
The protocol depends on the physical hardware configuration of the sensor.
Definition at line 113 of file bmg160_parameters.cpp.
void BMG160Parameters::setRange | ( | range | new_range | ) |
Change gyro range parameter to a different range.
To apply this range on the sensor, the user must subsequently call one of two methods in the bmg160 driver: initialize() or changeRange().
Definition at line 232 of file bmg160_parameters.cpp.
void BMG160Parameters::setSlaveAddressBit | ( | bool | high_or_low | ) |
Alerts the software driver that the chip's SDO pin is connected to either VDD or GND, which allows it to deduce the I2C device address.
high_or_low | true indicates SDO is connected to VDD. false indicates that SDO is connected to GND. |
Definition at line 167 of file bmg160_parameters.cpp.
bool BMG160Parameters::setSpiMode | ( | uint8_t | mode | ) |
Configure the hardware-interface's SPI mode by which it communicates with the sensor.
mode | the SPI mode of the sensor. Valid modes: SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3. |
Definition at line 196 of file bmg160_parameters.cpp.
the user-specified bandwidth register of the gyroscope.
Definition at line 273 of file bmg160_parameters.hpp.
A boolean indicating whether or not the gyro is outputting filtered data.
Definition at line 268 of file bmg160_parameters.hpp.
The user-specified range value of the gyroscope.
Definition at line 262 of file bmg160_parameters.hpp.
the sensitivity of the current gyro range.
Definition at line 278 of file bmg160_parameters.hpp.
Indicates whether the SDO pin is connected to VDD or GND.
Definition at line 283 of file bmg160_parameters.hpp.