#include <bmc050_parameters.hpp>
Public Types | |
enum | accel_range { RANGE_2 = 0x03, RANGE_4 = 0x05, RANGE_8 = 0x08, RANGE_16 = 0x0C } |
enum | bandwidth { BW_8HZ = 0x08, BW_16HZ = 0x09, BW_31HZ = 0x0A, BW_63HZ = 0x0B, BW_125HZ = 0x0C, BW_250HZ = 0x0D, BW_500HZ = 0x0E, BW_1000HZ = 0x0F } |
enum | compass_rate { ODR_10HZ = 0x00, ODR_2HZ = 0x01, ODR_6HZ = 0x02, ODR_8HZ = 0x03, ODR_15HZ = 0x04, ODR_20HZ = 0x05, ODR_25HZ = 0x06, ODR_30HZ = 0x07 } |
Public Member Functions | |
BMC050Parameters () | |
constructor | |
uint8_t | getAccelAddress () |
accel_range | getAccelRange () |
a wrapper function that returns the currently specified accelerometer range. | |
double | getAccelSensitivity () |
a wrapper function that returns the currently specified accelerometer sensitivity. | |
uint8_t | getCompassAddress () |
int * | getFlags () |
int | getFrequency () |
int | getPin () |
interface_protocol | getProtocol () |
void | setAccelBandwidth (bandwidth bw) |
select the bandwidth that the sensor will respond to. See the datasheet for more information. | |
bool | setAccelPin (uint8_t pin) |
Alert software driver of the physical pin of the hardware interface that the accelerometer's chip-select is connected to. | |
void | setAccelRange (accel_range new_range) |
Accelerometer-specific. | |
bool | setCompassPin (uint8_t pin) |
alert software driver of the physical pin of the hardware interface that the compass's chip-select is connected to. This is an SPI-relevant parameter only. | |
void | setCompassRate (compass_rate rate) |
select the rate at which the compass will output its data. | |
void | setCSB2 (bool val) |
alert software driver of the harware pin configuration for the CSB2 pin. (aka, is CSB2 connected to VDD or GND ?) | |
void | setFilter (bool input) |
choose whether or not to use filtered(default) or unfiltered data from the accelerometer. | |
bool | setFrequency (int frequency) |
change interface protocol frequency to a different frequency. | |
void | setNumRepetitionsXY (uint16_t num_repetitions) |
select number of repetitions that the compass will sample before outputting its average for the X and Y axes. | |
void | setNumRepetitionsZ (uint16_t num_repetitions) |
select number of repetitions that the compass will sample before outputting its average for the Z axis. | |
bool | setPin (uint8_t pin) |
This method must be implemented since it is inheritted from a virtual method in the parameters class. | |
bool | setProtocol (interface_protocol protocol) |
Change BMC050 protocol parameter to a different protocol. | |
void | setSDO (bool val) |
alert software driver of the harware pin configuration for the SDO pin. (aka, is SDO connected to VDD or GND ?) | |
~BMC050Parameters () | |
destructor | |
Private Member Functions | |
bool | setByteOrder (uint8_t value) |
configure the hardware-interface's SPI byte-order by which it will communicate with the sensor. | |
bool | setSpiMode (uint8_t mode) |
configure the hardware-interface's SPI mode by which it communicates with the sensor. | |
Private Attributes | |
bool | accel_is_filtered_ |
uint8_t | accel_pin_ |
accel_range | accel_range_ |
double | accel_sensitivity_ |
bandwidth | bw_reg_ |
uint8_t | compass_pin_ |
compass_rate | compass_rate_ |
bool | CSB2 |
uint8_t | repsXY_ |
uint8_t | repsZ_ |
bool | SDO |
Friends | |
class | BMC050 |
Definition at line 71 of file bmc050_parameters.hpp.
Definition at line 76 of file bmc050_parameters.hpp.
Definition at line 84 of file bmc050_parameters.hpp.
Definition at line 99 of file bmc050_parameters.hpp.
constructor
Definition at line 52 of file bmc050_parameters.cpp.
destructor
Definition at line 81 of file bmc050_parameters.cpp.
uint8_t BMC050Parameters::getAccelAddress | ( | ) |
Definition at line 92 of file bmc050_parameters.cpp.
a wrapper function that returns the currently specified accelerometer range.
Definition at line 277 of file bmc050_parameters.cpp.
double BMC050Parameters::getAccelSensitivity | ( | ) |
a wrapper function that returns the currently specified accelerometer sensitivity.
Definition at line 86 of file bmc050_parameters.cpp.
uint8_t BMC050Parameters::getCompassAddress | ( | ) |
Definition at line 117 of file bmc050_parameters.cpp.
int * BMC050Parameters::getFlags | ( | ) | [virtual] |
Implements bosch_drivers_common::Parameters.
Definition at line 219 of file bmc050_parameters.cpp.
int BMC050Parameters::getFrequency | ( | ) | [virtual] |
Implements bosch_drivers_common::Parameters.
Definition at line 167 of file bmc050_parameters.cpp.
int BMC050Parameters::getPin | ( | ) | [virtual] |
Implements bosch_drivers_common::Parameters.
Definition at line 214 of file bmc050_parameters.cpp.
interface_protocol BMC050Parameters::getProtocol | ( | ) | [virtual] |
Implements bosch_drivers_common::Parameters.
Definition at line 173 of file bmc050_parameters.cpp.
void BMC050Parameters::setAccelBandwidth | ( | bandwidth | bw | ) |
select the bandwidth that the sensor will respond to. See the datasheet for more information.
bandwidth | bw an enumerated datatype specifying one of the available accelerometer bandwidths. |
Definition at line 289 of file bmc050_parameters.cpp.
bool BMC050Parameters::setAccelPin | ( | uint8_t | pin | ) |
Alert software driver of the physical pin of the hardware interface that the accelerometer's chip-select is connected to.
This is an SPI-relevant parameter only.
Definition at line 190 of file bmc050_parameters.cpp.
void BMC050Parameters::setAccelRange | ( | accel_range | new_range | ) |
Accelerometer-specific.
accel_range | new_range an enumerated datatype specifying one of the sensor's selectable ranges. (Sensor initializes with default range if no range is specified.) |
Definition at line 271 of file bmc050_parameters.cpp.
bool BMC050Parameters::setByteOrder | ( | uint8_t | value | ) | [private] |
configure the hardware-interface's SPI byte-order by which it will communicate with the sensor.
Definition at line 246 of file bmc050_parameters.cpp.
bool BMC050Parameters::setCompassPin | ( | uint8_t | pin | ) |
alert software driver of the physical pin of the hardware interface that the compass's chip-select is connected to. This is an SPI-relevant parameter only.
Definition at line 202 of file bmc050_parameters.cpp.
void BMC050Parameters::setCompassRate | ( | compass_rate | rate | ) |
select the rate at which the compass will output its data.
compass_rate | rate an enumerated dataype specifying one of the available compass data rates. |
Definition at line 295 of file bmc050_parameters.cpp.
void BMC050Parameters::setCSB2 | ( | bool | val | ) |
alert software driver of the harware pin configuration for the CSB2 pin. (aka, is CSB2 connected to VDD or GND ?)
bool | val true indicates that CSB2 is connected to VDD. false indicates that CSB2 is connected to GND. |
Definition at line 259 of file bmc050_parameters.cpp.
void BMC050Parameters::setFilter | ( | bool | input | ) |
choose whether or not to use filtered(default) or unfiltered data from the accelerometer.
bool | input true indicates filtered data; false indicates unfiltered data. |
Definition at line 283 of file bmc050_parameters.cpp.
bool BMC050Parameters::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 160 of file bmc050_parameters.cpp.
void BMC050Parameters::setNumRepetitionsXY | ( | uint16_t | num_repetitions | ) |
select number of repetitions that the compass will sample before outputting its average for the X and Y axes.
an | unsigned integer from 0 through 511. |
Definition at line 301 of file bmc050_parameters.cpp.
void BMC050Parameters::setNumRepetitionsZ | ( | uint16_t | num_repetitions | ) |
select number of repetitions that the compass will sample before outputting its average for the Z axis.
an | unsigned integer from 0 through 256. |
Definition at line 337 of file bmc050_parameters.cpp.
bool BMC050Parameters::setPin | ( | uint8_t | pin | ) | [virtual] |
This method must be implemented since it is inheritted from a virtual method in the parameters class.
Since the BMC050 is actually two sensors, it has two separate chip-select pins.
Implements bosch_drivers_common::Parameters.
Definition at line 179 of file bmc050_parameters.cpp.
bool BMC050Parameters::setProtocol | ( | interface_protocol | protocol | ) |
Change BMC050 protocol parameter to a different protocol.
The protocol depends on the physical hardware configuration of the sensor.
Definition at line 142 of file bmc050_parameters.cpp.
void BMC050Parameters::setSDO | ( | bool | val | ) |
alert software driver of the harware pin configuration for the SDO pin. (aka, is SDO connected to VDD or GND ?)
bool | val true indicates that SDO is connected to VDD. false indicates that SDO is connected to GND. |
Definition at line 265 of file bmc050_parameters.cpp.
bool BMC050Parameters::setSpiMode | ( | uint8_t | mode | ) | [private] |
configure the hardware-interface's SPI mode by which it communicates with the sensor.
mode | the SPI mode of the sensor. Valid modes: SPI_MODE0, SPI_MODE1, SPI_MODE2, SPI_MODE3. |
Definition at line 225 of file bmc050_parameters.cpp.
friend class BMC050 [friend] |
Definition at line 74 of file bmc050_parameters.hpp.
bool BMC050Parameters::accel_is_filtered_ [private] |
Definition at line 278 of file bmc050_parameters.hpp.
uint8_t BMC050Parameters::accel_pin_ [private] |
Definition at line 287 of file bmc050_parameters.hpp.
accel_range BMC050Parameters::accel_range_ [private] |
Definition at line 277 of file bmc050_parameters.hpp.
double BMC050Parameters::accel_sensitivity_ [private] |
Definition at line 279 of file bmc050_parameters.hpp.
bandwidth BMC050Parameters::bw_reg_ [private] |
Definition at line 280 of file bmc050_parameters.hpp.
uint8_t BMC050Parameters::compass_pin_ [private] |
Definition at line 288 of file bmc050_parameters.hpp.
compass_rate BMC050Parameters::compass_rate_ [private] |
Definition at line 281 of file bmc050_parameters.hpp.
bool BMC050Parameters::CSB2 [private] |
Definition at line 285 of file bmc050_parameters.hpp.
uint8_t BMC050Parameters::repsXY_ [private] |
Definition at line 282 of file bmc050_parameters.hpp.
uint8_t BMC050Parameters::repsZ_ [private] |
Definition at line 283 of file bmc050_parameters.hpp.
bool BMC050Parameters::SDO [private] |
Definition at line 286 of file bmc050_parameters.hpp.