Public Types | Public Member Functions | Public Attributes
BMG160Parameters Class Reference

#include <bmg160_parameters.hpp>

Inheritance diagram for BMG160Parameters:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

Definition at line 61 of file bmg160_parameters.hpp.


Member Enumeration Documentation

Configurable bandwidths that the user can set on the sensor.

Enumerator:
BW_32HZ 
BW_64HZ 
BW_12HZ 
BW_23HZ 
BW_47HZ 
BW_116HZ 
BW_230HZ 
BW_UNFILTERED 

Definition at line 96 of file bmg160_parameters.hpp.

Configurable range values that the user can adjust on the sensor. See datasheet page 38.

Enumerator:
RANGE_2000 

max: ±2000 [°/s], sensitivity: 61.0 [milli°/(s * LSB)]

RANGE_1000 

max: ±1000 [°/s], sensitivity: 30.5 [milli°/(s * LSB)

RANGE_500 

max: ±500 [°/s], sensitivity: 15.3 [milli°/(s * LSB)]

RANGE_250 

max: ±250 [°/s], sensitivity: 7.6 [milli°/(s * LSB)]

RANGE_125 

max: ±125 [°/s], sensitivity: 3.8 [milli°/(s * LSB)]

Definition at line 69 of file bmg160_parameters.hpp.


Constructor & Destructor Documentation

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_.

Note:
The user should not have to change these next two settings:

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.


Member Function Documentation

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.

Returns:
class flags_ member.

Implements bosch_drivers_common::Parameters.

Definition at line 189 of file bmg160_parameters.cpp.

int BMG160Parameters::getFrequency ( ) [virtual]
Returns:
frequency that the hardware interface is set to commmunicate.

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.

Returns:
hardware interface pin.

Implements bosch_drivers_common::Parameters.

Definition at line 174 of file bmg160_parameters.cpp.

retreive the interface protocol for which the device is configured.

Returns:
class protocol_ value.

Implements bosch_drivers_common::Parameters.

Definition at line 141 of file bmg160_parameters.cpp.

Retreive the sensitivity value to the corresponding gyro range such that the raw data can be correctly calculated.

Returns:
class sensitivity_ value, who's current value should be the sensitivity that corresponds with the correct range setting.

Definition at line 105 of file bmg160_parameters.cpp.

Returns:
slave_address_bit_

Definition at line 181 of file bmg160_parameters.cpp.

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.

Note:
The user should NOT have to change this value from a value different from the value set upon instantiation. In detail, this method directly manipulates the class flags_ value, which is passed to the hardware interface class.

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.

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().

Note:
bmg160::changeRange() must be called after this method so that the sensor's range is adjusted as well!

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.

Parameters:
high_or_lowtrue 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.

Note:
see the wikipedia article on SPI for more information on the corresponding CPOL and CPHA settings. Valid modes are defined in the bosch_drivers_common. The user should NOT have to change this value from a value different from the value set upon instantiation. In detail, this method directly manipulates the class flags_ value, which is passed to the hardware interface class.
Parameters:
modethe SPI mode of the sensor. Valid modes: SPI_MODE_0, SPI_MODE_1, SPI_MODE_2, SPI_MODE_3.
Returns:
boolean indicating successful input.

Definition at line 196 of file bmg160_parameters.cpp.


Member Data Documentation

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.


The documentation for this class was generated from the following files:


bmg160_driver
Author(s): Joshua Vasquez, Philip Roan. Maintained by Philip Roan
autogenerated on Sat Dec 28 2013 16:49:28