|
DevLab_ICM20948 1.0.0
Driver para sensor ICM-20948
|
#include <DevLab_ICM20948.h>
Public Member Functions | |
| DevLab_ICM20948 () | |
| bool | beginI2C (uint8_t address=0x69, TwoWire &i2cPort=Wire, uint32_t i2cSpeed=400000) |
| bool | beginSPI (uint8_t csPin, SPIClass &spiPort=SPI, uint32_t spiSpeed=1000000) |
| bool | readWhoAmI (uint8_t &whoAmI) |
| bool | selectBank (uint8_t bank) |
| bool | softReset () |
| bool | sleep (bool en) |
| bool | applyBasicDefaults () |
| bool | readAccel (float &x, float &y, float &z) |
| bool | readGyro (float &x, float &y, float &z) |
| bool | readTemperature (float &temperature) |
| bool | readMag (float &x, float &y, float &z) |
| bool | initMag () |
| bool | setMagOpMode (ICM20948_Op_Mode opMode) |
| bool | setLowPower (bool enable) |
| bool | getLowPower (bool &enable) |
| bool | setClock (ICM20948_Clock_Source clock) |
| bool | getClock (uint8_t &clock) |
| bool | setGyroSampleRate (float sampleRate) |
| bool | getGyroSampleRate (float &sampleRate) |
| bool | setGyroDivRate (uint8_t divisor) |
| bool | setDLPF (ICM20948_Gyro_DLPF dlpf, bool bypass) |
| bool | getDLPF (uint8_t &dlpf, bool &bypass) |
| bool | setGyroScale (ICM20948_Gyro_FullScale fullScale) |
| bool | setGyroAveraging (ICM20948_Gyro_Average avg) |
| bool | getGyroScale (uint8_t &fullScale) |
| bool | selfTestGyro (bool x, bool y, bool z) |
| bool | setAccelDivRate (uint16_t divisor) |
| bool | setAccelSampleRate (uint16_t sampleRate) |
| bool | getAccelSampleRate (float &sampleRate) |
| bool | selfTestAccel (bool x, bool y, bool z) |
| bool | setAccelScale (ICM20948_Accel_FullScale fullScale) |
| bool | getAccelScale (uint8_t &fullScale) |
| bool | setAccelDLPF (uint8_t dlpf, bool bypass) |
| bool | getAccelDLPF (uint8_t &dlpf, bool &bypass) |
| bool | setAccelAveraging (ICM20948_Accel_Average avg) |
| bool | getAccelAveraging (uint8_t &avg) |
| bool | setSensors (bool accel_on, bool gyro_on, bool temp_on) |
| bool | getSensors (bool &accel_on, bool &gyro_on, bool &temp_on) |
| bool | setGyroOffset (uint16_t offsetX, uint16_t offsetY, uint16_t offsetZ) |
| bool | getGyroOffset (int16_t &offsetX, int16_t &offsetY, int16_t &offsetZ) |
| bool | setAccelOffset (int16_t offsetX, int16_t offsetY, int16_t offsetZ) |
| bool | getAccelOffset (int16_t &offsetX, int16_t &offsetY, int16_t &offsetZ) |
| bool | intInit (const ICM20948_IntPinConfig &cfg) |
| bool | intEnableConfig (const ICM20948_IntEnableConfig &cfg) |
| bool | checkIntStatus (ICM20948_IntStatus &status) |
| bool | auxMasterEnable (uint8_t clkFreq) |
| bool | auxWriteByte (uint8_t slaveAddr, uint8_t reg, uint8_t data) |
| bool | auxReadByte (uint8_t slaveAddr, uint8_t reg, uint8_t &data) |
| bool | auxWriteCommand (uint8_t slaveAddr, uint8_t cmd) |
| bool | auxConfigSlave (uint8_t slaveAddr, uint8_t reg, uint8_t numBytes) |
| bool | auxReadSensorData (uint8_t *buf, uint8_t len) |
| bool | auxReadResponse (uint8_t slaveAddr, uint8_t &data) |
| bool | auxRead12bit (uint16_t &raw) |
Class
Definition at line 172 of file DevLab_ICM20948.h.
| DevLab_ICM20948::DevLab_ICM20948 | ( | ) |
Definition at line 4 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::applyBasicDefaults | ( | ) |
applyBasicDefaults
Returns:
Definition at line 181 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::auxConfigSlave | ( | uint8_t | slaveAddr, |
| uint8_t | reg, | ||
| uint8_t | numBytes ) |
auxConfigSlave
Parameters:
Returns:
Definition at line 1374 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::auxMasterEnable | ( | uint8_t | clkFreq | ) |
auxMasterEnable
Parameters:
Returns:
Definition at line 1260 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::auxRead12bit | ( | uint16_t & | raw | ) |
auxRead12bit
Returns:
Definition at line 1424 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::auxReadByte | ( | uint8_t | slaveAddr, |
| uint8_t | reg, | ||
| uint8_t & | data ) |
auxReadByte
Note: slaves that need separate write/read transactions (e.g. command-response firmware) should use auxWriteCommand + auxReadResponse instead.
Parameters:
Returns:
Definition at line 1312 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::auxReadResponse | ( | uint8_t | slaveAddr, |
| uint8_t & | data ) |
auxReadResponse
Parameters:
Returns:
Definition at line 1397 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::auxReadSensorData | ( | uint8_t * | buf, |
| uint8_t | len ) |
auxReadSensorData
Parameters:
Returns:
Definition at line 1391 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::auxWriteByte | ( | uint8_t | slaveAddr, |
| uint8_t | reg, | ||
| uint8_t | data ) |
auxWriteByte
Parameters:
Returns:
Definition at line 1281 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::auxWriteCommand | ( | uint8_t | slaveAddr, |
| uint8_t | cmd ) |
auxWriteCommand
Parameters:
Returns:
Definition at line 1346 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::beginI2C | ( | uint8_t | address = 0x69, |
| TwoWire & | i2cPort = Wire, | ||
| uint32_t | i2cSpeed = 400000 ) |
beginI2C
Returns:
Definition at line 6 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::beginSPI | ( | uint8_t | csPin, |
| SPIClass & | spiPort = SPI, | ||
| uint32_t | spiSpeed = 1000000 ) |
| bool DevLab_ICM20948::checkIntStatus | ( | ICM20948_IntStatus & | status | ) |
checkIntStatus
Parameters:
Returns:
Definition at line 1231 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getAccelAveraging | ( | uint8_t & | avg | ) |
getAccelAveraging
Flow:
Returns:
Definition at line 988 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getAccelDLPF | ( | uint8_t & | dlpf, |
| bool & | bypass ) |
getAccelDLPF
Flow:
Returns:
Definition at line 926 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getAccelOffset | ( | int16_t & | offsetX, |
| int16_t & | offsetY, | ||
| int16_t & | offsetZ ) |
getAccelOffset
Flow:
Returns:
Definition at line 1151 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getAccelSampleRate | ( | float & | sampleRate | ) |
getAccelSampleRate
Returns:
Definition at line 796 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getAccelScale | ( | uint8_t & | fullScale | ) |
getAccelScale
Returns:
Definition at line 878 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getClock | ( | uint8_t & | clock | ) |
getClock
Returns:
Definition at line 534 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getDLPF | ( | uint8_t & | dlpf, |
| bool & | bypass ) |
getDLPF
Returns:
Definition at line 619 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getGyroOffset | ( | int16_t & | offsetX, |
| int16_t & | offsetY, | ||
| int16_t & | offsetZ ) |
getGyroOffset
Flow:
Returns:
Definition at line 1099 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getGyroSampleRate | ( | float & | sampleRate | ) |
getGyroSampleRate
Returns:
Definition at line 571 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getGyroScale | ( | uint8_t & | fullScale | ) |
getGyroScale
Returns:
Definition at line 665 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getLowPower | ( | bool & | enable | ) |
getLowPower
Returns:
Definition at line 502 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::getSensors | ( | bool & | accel_on, |
| bool & | gyro_on, | ||
| bool & | temp_on ) |
getSensors
Flow:
Returns:
Definition at line 1039 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::initMag | ( | ) |
initMag
Returns:
Definition at line 334 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::intEnableConfig | ( | const ICM20948_IntEnableConfig & | cfg | ) |
intEnableConfig
Parameters:
Returns:
Definition at line 1200 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::intInit | ( | const ICM20948_IntPinConfig & | cfg | ) |
intInit
Parameters:
Returns:
Definition at line 1176 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::readAccel | ( | float & | x, |
| float & | y, | ||
| float & | z ) |
readAccel
Returns:
Definition at line 238 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::readGyro | ( | float & | x, |
| float & | y, | ||
| float & | z ) |
readGyro
Returns:
Definition at line 258 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::readMag | ( | float & | x, |
| float & | y, | ||
| float & | z ) |
readMag
Returns:
Definition at line 310 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::readTemperature | ( | float & | temperature | ) |
readTemperature
Returns:
Definition at line 278 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::readWhoAmI | ( | uint8_t & | whoAmI | ) |
readWhoAmI
Returns:
Definition at line 118 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::selectBank | ( | uint8_t | bank | ) |
selectBank
Returns:
Definition at line 132 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::selfTestAccel | ( | bool | x, |
| bool | y, | ||
| bool | z ) |
selfTestAccel
Returns:
Definition at line 826 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::selfTestGyro | ( | bool | x, |
| bool | y, | ||
| bool | z ) |
selfTestGyro
Returns:
Definition at line 683 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setAccelAveraging | ( | ICM20948_Accel_Average | avg | ) |
setAccelAveraging
Flow:
Returns:
Definition at line 952 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setAccelDivRate | ( | uint16_t | divisor | ) |
| bool DevLab_ICM20948::setAccelDLPF | ( | uint8_t | dlpf, |
| bool | bypass ) |
setAccelDLPF
Flow:
Returns:
Definition at line 897 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setAccelOffset | ( | int16_t | offsetX, |
| int16_t | offsetY, | ||
| int16_t | offsetZ ) |
setAccelOffset
Flow:
Returns:
Definition at line 1124 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setAccelSampleRate | ( | uint16_t | sampleRate | ) |
setAccelSampleRate
Returns:
Definition at line 709 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setAccelScale | ( | ICM20948_Accel_FullScale | fullScale | ) |
setAccelScale
Returns:
Definition at line 857 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setClock | ( | ICM20948_Clock_Source | clock | ) |
setClock
Returns:
Definition at line 520 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setDLPF | ( | ICM20948_Gyro_DLPF | dlpf, |
| bool | bypass ) |
setDLPF
Returns:
Definition at line 593 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setGyroAveraging | ( | ICM20948_Gyro_Average | avg | ) |
| bool DevLab_ICM20948::setGyroDivRate | ( | uint8_t | divisor | ) |
| bool DevLab_ICM20948::setGyroOffset | ( | uint16_t | offsetX, |
| uint16_t | offsetY, | ||
| uint16_t | offsetZ ) |
setGyroOffset
Flow:
Returns:
Definition at line 1072 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setGyroSampleRate | ( | float | sampleRate | ) |
setGyroSampleRate
Returns:
Definition at line 550 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setGyroScale | ( | ICM20948_Gyro_FullScale | fullScale | ) |
setGyroScale
Flow:
Returns:
Definition at line 644 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setLowPower | ( | bool | enable | ) |
setLowPower
Returns:
Definition at line 488 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setMagOpMode | ( | ICM20948_Op_Mode | opMode | ) |
setMagOpMode
Returns:
Definition at line 410 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::setSensors | ( | bool | accel_on, |
| bool | gyro_on, | ||
| bool | temp_on ) |
setSensors
Flow:
Returns:
Definition at line 1006 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::sleep | ( | bool | en | ) |
sleep
Flow:
Returns:
Definition at line 164 of file DevLab_ICM20948.cpp.
| bool DevLab_ICM20948::softReset | ( | ) |
softReset
Flow:
Returns:
Definition at line 144 of file DevLab_ICM20948.cpp.