Classes | Public Member Functions | Private Member Functions | Private Attributes
Smi540 Class Reference

A Class to interface to the SMI540 over SPI. More...

#include <smi540.h>

List of all members.

Classes

struct  OneSmi540Config
struct  OneSub20Config

Public Member Functions

void GetMeasurements (std::list< OneSmi540Meas > &)
 Polls one measurement from all SMI540 defined in std::list<OneMulSmiMeas>&.
 Smi540 (std::string)
 Constructor initializes Sub20 device and SMI540ies.
virtual ~Smi540 ()
 Destructor closing all open connections.

Private Member Functions

void confsens_on_sub20 (OneSub20Config *)
 Configures specified SMI540ies according to the default or user settings.
double mm5data_to_double (char, char, smi540_cmd::eSensorType)
 Converts SMI540 formatted data into int.

Private Attributes

bool bSubDeviceConfigured
bool bSubDeviceOpen
std::string strSerial
std::list< OneSub20ConfigSub20Device_list
sub_handle subhndl

Detailed Description

A Class to interface to the SMI540 over SPI.

This class interfaces with the BOSCH SMI 530/540 over SPI using an XDIMAX Sub20 interface device.

Definition at line 87 of file smi540.h.


Constructor & Destructor Documentation

Smi540::Smi540 ( std::string  sSub20Serial)

Constructor initializes Sub20 device and SMI540ies.

Detects connected Sub20 devices and SMI540ies. Initializes the Sub20 device and loads configures the SMI540 with the specified bandwidth and max acceleration range. On request it performs sensor calibration

Parameters:
sSub20SerialRequesting desired sub20 device to be opened

Definition at line 47 of file smi540.cpp.

Smi540::~Smi540 ( ) [virtual]

Destructor closing all open connections.

Closes open SPI connections and disables the Sub20 device. Disposes any dynamic structure in the heap.

Definition at line 156 of file smi540.cpp.


Member Function Documentation

void Smi540::confsens_on_sub20 ( OneSub20Config pOneSub20Conf) [private]

Configures specified SMI540ies according to the default or user settings.

Definition at line 283 of file smi540.cpp.

void Smi540::GetMeasurements ( std::list< OneSmi540Meas > &  list_meas)

Polls one measurement from all SMI540 defined in std::list<OneMulSmiMeas>&.

Iterates through all detected SMI540ies on all connected Sub20 devices and sends a measurement request to the respective sensor. In case of calibration request, any received measurement is used to calibrate the sensor. NOTE: As the EEPROM can only handle a limited amount of write cycles, the calibration routine only allows one Sub20 device to be connected for the calibration mode to be executed successfully.

Parameters:
&list_measpoints onto the std::list containing the connected devices

Definition at line 176 of file smi540.cpp.

double Smi540::mm5data_to_double ( char  chMSB,
char  chLSB,
smi540_cmd::eSensorType  eSensor 
) [private]

Converts SMI540 formatted data into int.

Definition at line 255 of file smi540.cpp.


Member Data Documentation

Definition at line 143 of file smi540.h.

bool Smi540::bSubDeviceOpen [private]

Definition at line 141 of file smi540.h.

std::string Smi540::strSerial [private]

Definition at line 145 of file smi540.h.

Definition at line 136 of file smi540.h.

sub_handle Smi540::subhndl [private]

Definition at line 139 of file smi540.h.


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


smi540
Author(s): Lukas Marti, Nikhil Deshpande (Maintained by Philip Roan)
autogenerated on Sat Dec 28 2013 16:49:36