A Class to interface to the SMI540 over SPI. More...
#include <smi540.h>
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< OneSub20Config > | Sub20Device_list |
sub_handle | subhndl |
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.
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
sSub20Serial | Requesting 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.
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.
&list_meas | points 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.
bool Smi540::bSubDeviceConfigured [private] |
bool Smi540::bSubDeviceOpen [private] |
std::string Smi540::strSerial [private] |
std::list<OneSub20Config> Smi540::Sub20Device_list [private] |
sub_handle Smi540::subhndl [private] |