Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
BMC050Parameters Class Reference

#include <bmc050_parameters.hpp>

Inheritance diagram for BMC050Parameters:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

Definition at line 71 of file bmc050_parameters.hpp.


Member Enumeration Documentation

Enumerator:
RANGE_2 
RANGE_4 
RANGE_8 
RANGE_16 

Definition at line 76 of file bmc050_parameters.hpp.

Enumerator:
BW_8HZ 
BW_16HZ 
BW_31HZ 
BW_63HZ 
BW_125HZ 
BW_250HZ 
BW_500HZ 
BW_1000HZ 

Definition at line 84 of file bmc050_parameters.hpp.

Enumerator:
ODR_10HZ 
ODR_2HZ 
ODR_6HZ 
ODR_8HZ 
ODR_15HZ 
ODR_20HZ 
ODR_25HZ 
ODR_30HZ 

Definition at line 99 of file bmc050_parameters.hpp.


Constructor & Destructor Documentation

constructor

Definition at line 52 of file bmc050_parameters.cpp.

destructor

Definition at line 81 of file bmc050_parameters.cpp.


Member Function Documentation

Definition at line 92 of file bmc050_parameters.cpp.

a wrapper function that returns the currently specified accelerometer range.

Returns:
accel_range_

Definition at line 277 of file bmc050_parameters.cpp.

a wrapper function that returns the currently specified accelerometer sensitivity.

Note:
this sensitivity is automatically adjusted when the accelerometer range is adjusted.
Returns:
accel_sensitivity_

Definition at line 86 of file bmc050_parameters.cpp.

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.

Implements bosch_drivers_common::Parameters.

Definition at line 173 of file bmc050_parameters.cpp.

select the bandwidth that the sensor will respond to. See the datasheet for more information.

Parameters:
bandwidthbw an enumerated datatype specifying one of the available accelerometer bandwidths.
Note:
this user preference is applied upon sensor initialization.

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.

Accelerometer-specific.

Parameters:
accel_rangenew_range an enumerated datatype specifying one of the sensor's selectable ranges. (Sensor initializes with default range if no range is specified.)
Note:
this user-choice is then applied to the sensor upon initialization.

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.

Note:
byte-order arguments are either MSBFIRST or LSBFIRST, both of which 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.

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.

select the rate at which the compass will output its data.

Parameters:
compass_raterate an enumerated dataype specifying one of the available compass data rates.
Note:
this user preference is applied upon sensor initialization.

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 ?)

Parameters:
boolval true indicates that CSB2 is connected to VDD. false indicates that CSB2 is connected to GND.
Note:
the value of both CSB2 and SDO will determine the i2c addresses of both two sensors: compass and accelerometer
thise settings are only important in i2c mode.

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.

Parameters:
boolinput true indicates filtered data; false indicates unfiltered data.
Note:
this user preference is applied upon sensor initialization.

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.

Parameters:
anunsigned integer from 0 through 511.
Note:
only odd values are valid

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.

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

Returns:
pin_, which has no effect on this class

Implements bosch_drivers_common::Parameters.

Definition at line 179 of file bmc050_parameters.cpp.

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 ?)

Parameters:
boolval true indicates that SDO is connected to VDD. false indicates that SDO is connected to GND.
Note:
the value of both CSB2 and SDO will determine the i2c addresses of both two sensors: compass and accelerometer
these settings are only important in i2c mode.

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.

Parameters:
modethe SPI mode of the sensor. Valid modes: SPI_MODE0, SPI_MODE1, SPI_MODE2, SPI_MODE3.
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.
Returns:
boolean indicating successful input.

Definition at line 225 of file bmc050_parameters.cpp.


Friends And Related Function Documentation

friend class BMC050 [friend]

Definition at line 74 of file bmc050_parameters.hpp.


Member Data Documentation

Definition at line 278 of file bmc050_parameters.hpp.

uint8_t BMC050Parameters::accel_pin_ [private]

Definition at line 287 of file bmc050_parameters.hpp.

Definition at line 277 of file bmc050_parameters.hpp.

Definition at line 279 of file bmc050_parameters.hpp.

Definition at line 280 of file bmc050_parameters.hpp.

uint8_t BMC050Parameters::compass_pin_ [private]

Definition at line 288 of file bmc050_parameters.hpp.

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.


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


bmc050_driver
Author(s): Joshua Vasquez, Philip Roan. Maintained by Philip Roan
autogenerated on Mon Oct 6 2014 10:09:40