wpi-32u4-library
|
#include <LSM6.h>
Data Structures | |
struct | vector |
Public Member Functions | |
LSM6 (void) | |
bool | init (deviceType device=device_auto, sa0State sa0=sa0_auto) |
deviceType | getDeviceType (void) |
void | enableDefault (void) |
void | writeReg (uint8_t reg, uint8_t value) |
uint8_t | readReg (uint8_t reg) |
void | readAcc (void) |
void | readGyro (void) |
void | read (void) |
void | setFullScaleGyro (GYRO_FS gfs) |
void | setFullScaleAcc (ACC_FS afs) |
void | setGyroDataOutputRate (ODR) |
void | setAccDataOutputRate (ODR) |
void | setTimeout (uint16_t timeout) |
uint16_t | getTimeout (void) |
bool | timeoutOccurred (void) |
uint8_t | getStatus (void) |
Data Fields | |
vector< int16_t > | a |
vector< int16_t > | g |
vector< float > | dps |
float | mdps = 0 |
float | mg = 0 |
uint8_t | last_status |
Private Member Functions | |
int16_t | testReg (uint8_t address, regAddr reg) |
Private Attributes | |
deviceType | _device |
uint8_t | address |
uint16_t | io_timeout |
bool | did_timeout |
enum LSM6::ACC_FS |
enum LSM6::deviceType |
enum LSM6::GYRO_FS |
enum LSM6::ODR |
enum LSM6::regAddr |
enum LSM6::sa0State |
LSM6::LSM6 | ( | void | ) |
Definition at line 18 of file LSM6.cpp.
References _device, device_auto, did_timeout, and io_timeout.
void LSM6::enableDefault | ( | void | ) |
Definition at line 184 of file LSM6.cpp.
References _device, ACC_FS2, CTRL3_C, device_DS33, GYRO_FS245, setFullScaleAcc(), setFullScaleGyro(), and writeReg().
|
inline |
|
inline |
Definition at line 143 of file LSM6.h.
References readReg(), and STATUS_REG.
uint16_t LSM6::getTimeout | ( | void | ) |
Definition at line 41 of file LSM6.cpp.
References io_timeout.
bool LSM6::init | ( | deviceType | device = device_auto , |
sa0State | sa0 = sa0_auto |
||
) |
Definition at line 125 of file LSM6.cpp.
References _device, address, device_auto, device_DS33, DS33_SA0_HIGH_ADDRESS, DS33_SA0_LOW_ADDRESS, DS33_WHO_ID, sa0_auto, sa0_high, sa0_low, testReg(), and WHO_AM_I.
void LSM6::read | ( | void | ) |
Definition at line 300 of file LSM6.cpp.
References readAcc(), and readGyro().
void LSM6::readAcc | ( | void | ) |
Definition at line 232 of file LSM6.cpp.
References a, address, did_timeout, io_timeout, OUTX_L_XL, LSM6::vector< T >::x, LSM6::vector< T >::y, and LSM6::vector< T >::z.
Referenced by read().
void LSM6::readGyro | ( | void | ) |
Definition at line 264 of file LSM6.cpp.
References address, did_timeout, dps, g, io_timeout, mdps, OUTX_L_G, LSM6::vector< T >::x, LSM6::vector< T >::y, and LSM6::vector< T >::z.
Referenced by read().
uint8_t LSM6::readReg | ( | uint8_t | reg | ) |
Definition at line 217 of file LSM6.cpp.
References address, and last_status.
Referenced by getStatus(), setAccDataOutputRate(), setFullScaleAcc(), setFullScaleGyro(), and setGyroDataOutputRate().
void LSM6::setAccDataOutputRate | ( | ODR | rate | ) |
void LSM6::setFullScaleAcc | ( | ACC_FS | afs | ) |
void LSM6::setFullScaleGyro | ( | GYRO_FS | gfs | ) |
Definition at line 46 of file LSM6.cpp.
References CTRL2_G, GYRO_FS1000, GYRO_FS2000, GYRO_FS245, GYRO_FS500, mdps, readReg(), and writeReg().
Referenced by enableDefault().
void LSM6::setGyroDataOutputRate | ( | ODR | rate | ) |
void LSM6::setTimeout | ( | uint16_t | timeout | ) |
Definition at line 36 of file LSM6.cpp.
References io_timeout.
|
private |
Definition at line 316 of file LSM6.cpp.
References address, and TEST_REG_ERROR.
Referenced by init().
bool LSM6::timeoutOccurred | ( | void | ) |
Definition at line 29 of file LSM6.cpp.
References did_timeout.
void LSM6::writeReg | ( | uint8_t | reg, |
uint8_t | value | ||
) |
Definition at line 209 of file LSM6.cpp.
References address, and last_status.
Referenced by enableDefault(), setAccDataOutputRate(), setFullScaleAcc(), setFullScaleGyro(), and setGyroDataOutputRate().
|
private |
Definition at line 146 of file LSM6.h.
Referenced by enableDefault(), getDeviceType(), init(), and LSM6().
|
private |
Definition at line 147 of file LSM6.h.
Referenced by init(), readAcc(), readGyro(), readReg(), testReg(), and writeReg().
|
private |
Definition at line 150 of file LSM6.h.
Referenced by LSM6(), readAcc(), readGyro(), and timeoutOccurred().
vector<float> LSM6::dps |
Definition at line 109 of file LSM6.h.
Referenced by readGyro().
vector<int16_t> LSM6::g |
Definition at line 108 of file LSM6.h.
Referenced by readGyro().
|
private |
Definition at line 149 of file LSM6.h.
Referenced by getTimeout(), LSM6(), readAcc(), readGyro(), and setTimeout().
uint8_t LSM6::last_status |
Definition at line 116 of file LSM6.h.
Referenced by readReg(), and writeReg().
float LSM6::mdps = 0 |
Definition at line 112 of file LSM6.h.
Referenced by readGyro(), and setFullScaleGyro().
float LSM6::mg = 0 |
Definition at line 113 of file LSM6.h.
Referenced by setFullScaleAcc().