EFR32 Mighty Gecko 1 Software Documentation
efr32mg1-doc-5.1.2
|
ICM20648 driver and support functions.
Functions | |
uint32_t | ICM20648_accelBandwidthSet (uint8_t accelBw) |
Sets the bandwidth of the accelerometer. More... | |
uint32_t | ICM20648_accelDataRead (float *accel) |
Reads the raw acceleration value and converts to g value based on the actual resolution. More... | |
uint32_t | ICM20648_accelFullscaleSet (uint8_t accelFs) |
Sets the full scale value of the accelerometer. More... | |
uint32_t | ICM20648_accelGyroCalibrate (float *accelBiasScaled, float *gyroBiasScaled) |
Accelerometer and gyroscope calibration function. Reads the gyroscope and accelerometer values while the device is at rest and in level. The resulting values are loaded to the accel and gyro bias registers to cancel the static offset error. More... | |
uint32_t | ICM20648_accelResolutionGet (float *accelRes) |
Gets the actual resolution of the accelerometer. More... | |
float | ICM20648_accelSampleRateSet (float sampleRate) |
Sets the sample rate of the gyroscope. More... | |
void | ICM20648_bankSelect (uint8_t bank) |
Select the desired register bank. More... | |
uint32_t | ICM20648_cycleModeEnable (bool enable) |
Enables or disables the cycle mode operation of the accel and gyro. More... | |
uint32_t | ICM20648_deInit (void) |
De-initializes the ICM20648 sensor by disconnecting the supply and SPI lines. More... | |
uint32_t | ICM20648_getDeviceID (uint8_t *devID) |
Reads the device ID of the ICM20648. More... | |
uint32_t | ICM20648_gyroBandwidthSet (uint8_t gyroBw) |
Sets the bandwidth of the gyroscope. More... | |
uint32_t | ICM20648_gyroCalibrate (float *gyroBiasScaled) |
Gyroscope calibration function. Reads the gyroscope values while the device is at rest and in level. The resulting values are loaded to the gyro bias registers to cancel the static offset error. More... | |
uint32_t | ICM20648_gyroDataRead (float *gyro) |
Reads the raw gyroscope value and converts to deg/sec value based on the actual resolution. More... | |
uint32_t | ICM20648_gyroFullscaleSet (uint8_t gyroFs) |
Sets the full scale value of the gyroscope. More... | |
uint32_t | ICM20648_gyroResolutionGet (float *gyroRes) |
Gets the actual resolution of the gyroscope. More... | |
float | ICM20648_gyroSampleRateSet (float sampleRate) |
Sets the sample rate of the accelerometer. More... | |
uint32_t | ICM20648_init (void) |
Initializes the ICM20648 sensor. Enables the power supply and SPI lines, sets up the host SPI controller, configures the chip control interface, clock generator and interrupt line. More... | |
uint32_t | ICM20648_interruptEnable (bool dataReadyEnable, bool womEnable) |
Enables or disables the interrupts in the ICM20648 chip. More... | |
uint32_t | ICM20648_interruptStatusRead (uint32_t *intStatus) |
Reads the interrupt status registers of the ICM20648 chip. More... | |
bool | ICM20648_isDataReady (void) |
Checks if new data is available for read. More... | |
uint32_t | ICM20648_lowPowerModeEnter (bool enAccel, bool enGyro, bool enTemp) |
Enables or disables the sensors in low power mode in the ICM20648 chip. More... | |
void | ICM20648_registerRead (uint16_t addr, int numBytes, uint8_t *data) |
Reads register from the ICM20648 device. More... | |
void | ICM20648_registerWrite (uint16_t addr, uint8_t data) |
Writes a register in the ICM20648 device. More... | |
uint32_t | ICM20648_reset (void) |
Performs soft reset on the ICM20648 chip. More... | |
uint32_t | ICM20648_sampleRateSet (float sampleRate) |
Sets the sample rate both of the accelerometer and the gyroscope. More... | |
uint32_t | ICM20648_sensorEnable (bool accel, bool gyro, bool temp) |
Enables or disables the sensors in the ICM20648 chip. More... | |
uint32_t | ICM20648_sleepModeEnable (bool enable) |
Enables or disables the sleep mode of the device. More... | |
uint32_t | ICM20648_spiInit (void) |
Initializes the SPI bus in order to communicate with the ICM20648. More... | |
uint32_t | ICM20648_temperatureRead (float *temperature) |
Reads the temperature sensor raw value and converts to Celsius. More... | |
uint32_t | ICM20648_wakeOnMotionITEnable (bool enable, uint8_t womThreshold, float sampleRate) |
Sets up and enables the Wake-up On Motion feature. More... | |
uint32_t ICM20648_accelBandwidthSet | ( | uint8_t | accelBw | ) |
Sets the bandwidth of the accelerometer.
[in] | accelBw | The desired bandwidth value. Use the ICM20648_ACCEL_BW_yHZ macros, which are defined in the icm20648.h file. The value of y can be 6, 12, 24, 50, 111, 246, 470 or 1210. |
Definition at line 491 of file icm20648.c.
References ICM20648_MASK_ACCEL_BW, ICM20648_OK, ICM20648_REG_ACCEL_CONFIG, ICM20648_registerRead(), and ICM20648_registerWrite().
Referenced by ICM20648_accelGyroCalibrate(), ICM20648_wakeOnMotionITEnable(), and IMU_config().
uint32_t ICM20648_accelDataRead | ( | float * | accel | ) |
Reads the raw acceleration value and converts to g value based on the actual resolution.
[out] | accel | A 3-element array of float numbers containing the acceleration values for the x, y and z axes in g units. |
Definition at line 145 of file icm20648.c.
References ICM20648_accelResolutionGet(), ICM20648_OK, ICM20648_REG_ACCEL_XOUT_H_SH, and ICM20648_registerRead().
Referenced by IMU_getAccelerometerData().
uint32_t ICM20648_accelFullscaleSet | ( | uint8_t | accelFs | ) |
Sets the full scale value of the accelerometer.
[in] | accelFs | The desired full scale value. Use the ICM20648_ACCEL_FULLSCALE_xG macros, which are defined in the icm20648.h file. The value of x can be 2, 4, 8 or 16. |
Definition at line 305 of file icm20648.c.
References ICM20648_MASK_ACCEL_FULLSCALE, ICM20648_OK, ICM20648_REG_ACCEL_CONFIG, ICM20648_registerRead(), and ICM20648_registerWrite().
Referenced by ICM20648_accelGyroCalibrate(), ICM20648_wakeOnMotionITEnable(), and IMU_config().
uint32_t ICM20648_accelGyroCalibrate | ( | float * | accelBiasScaled, |
float * | gyroBiasScaled | ||
) |
Accelerometer and gyroscope calibration function. Reads the gyroscope and accelerometer values while the device is at rest and in level. The resulting values are loaded to the accel and gyro bias registers to cancel the static offset error.
[out] | accelBiasScaled | The mesured acceleration sensor bias in mg |
[out] | gyroBiasScaled | The mesured gyro sensor bias in deg/sec |
Definition at line 863 of file icm20648.c.
References ICM20648_ACCEL_BW_246HZ, ICM20648_ACCEL_FULLSCALE_2G, ICM20648_accelBandwidthSet(), ICM20648_accelFullscaleSet(), ICM20648_accelResolutionGet(), ICM20648_BIT_ACCEL_FIFO_EN, ICM20648_BIT_FIFO_EN, ICM20648_BITS_GYRO_FIFO_EN, ICM20648_GYRO_BW_12HZ, ICM20648_GYRO_FULLSCALE_250DPS, ICM20648_gyroBandwidthSet(), ICM20648_gyroFullscaleSet(), ICM20648_gyroResolutionGet(), ICM20648_OK, ICM20648_REG_FIFO_COUNT_H, ICM20648_REG_FIFO_EN_2, ICM20648_REG_FIFO_MODE, ICM20648_REG_FIFO_R_W, ICM20648_REG_FIFO_RST, ICM20648_REG_USER_CTRL, ICM20648_REG_XA_OFFSET_H, ICM20648_REG_XA_OFFSET_L, ICM20648_REG_XG_OFFS_USRH, ICM20648_REG_XG_OFFS_USRL, ICM20648_REG_YA_OFFSET_H, ICM20648_REG_YA_OFFSET_L, ICM20648_REG_YG_OFFS_USRH, ICM20648_REG_YG_OFFS_USRL, ICM20648_REG_ZA_OFFSET_H, ICM20648_REG_ZA_OFFSET_L, ICM20648_REG_ZG_OFFS_USRH, ICM20648_REG_ZG_OFFS_USRL, ICM20648_registerRead(), ICM20648_registerWrite(), ICM20648_sampleRateSet(), ICM20648_sensorEnable(), and UTIL_delay().
uint32_t ICM20648_accelResolutionGet | ( | float * | accelRes | ) |
Gets the actual resolution of the accelerometer.
[out] | accelRes | The resolution in g/bit units |
Definition at line 217 of file icm20648.c.
References ICM20648_ACCEL_FULLSCALE_16G, ICM20648_ACCEL_FULLSCALE_2G, ICM20648_ACCEL_FULLSCALE_4G, ICM20648_ACCEL_FULLSCALE_8G, ICM20648_MASK_ACCEL_FULLSCALE, ICM20648_OK, ICM20648_REG_ACCEL_CONFIG, and ICM20648_registerRead().
Referenced by ICM20648_accelDataRead(), and ICM20648_accelGyroCalibrate().
float ICM20648_accelSampleRateSet | ( | float | sampleRate | ) |
Sets the sample rate of the gyroscope.
[in] | sampleRate | The desired sample rate in Hz |
Definition at line 420 of file icm20648.c.
References ICM20648_REG_ACCEL_SMPLRT_DIV_1, ICM20648_REG_ACCEL_SMPLRT_DIV_2, and ICM20648_registerWrite().
Referenced by ICM20648_sampleRateSet(), and IMU_config().
void ICM20648_bankSelect | ( | uint8_t | bank | ) |
Select the desired register bank.
[in] | bank | The address of the register bank (0..3) |
Definition at line 1407 of file icm20648.c.
References ICM20648_REG_BANK_SEL, USART_Rx(), and USART_Tx().
Referenced by ICM20648_registerRead(), and ICM20648_registerWrite().
uint32_t ICM20648_cycleModeEnable | ( | bool | enable | ) |
Enables or disables the cycle mode operation of the accel and gyro.
[in] | enable | If true both the accel and gyro sensors will operate in cycle mode. If false the senors working in continuous mode. |
Definition at line 551 of file icm20648.c.
References ICM20648_BIT_ACCEL_CYCLE, ICM20648_BIT_GYRO_CYCLE, ICM20648_OK, ICM20648_REG_LP_CONFIG, and ICM20648_registerWrite().
Referenced by ICM20648_lowPowerModeEnter(), and ICM20648_wakeOnMotionITEnable().
uint32_t ICM20648_deInit | ( | void | ) |
De-initializes the ICM20648 sensor by disconnecting the supply and SPI lines.
Definition at line 103 of file icm20648.c.
References BOARD_imuEnable(), and ICM20648_OK.
Referenced by IMU_deInit(), and IMU_init().
uint32_t ICM20648_getDeviceID | ( | uint8_t * | devID | ) |
Reads the device ID of the ICM20648.
[out] | devID | The ID of the device read from teh WHO_AM_I register. Expected value? 0xE0 |
Definition at line 1256 of file icm20648.c.
References ICM20648_OK, ICM20648_REG_WHO_AM_I, and ICM20648_registerRead().
Referenced by IMU_init().
uint32_t ICM20648_gyroBandwidthSet | ( | uint8_t | gyroBw | ) |
Sets the bandwidth of the gyroscope.
[in] | gyroBw | The desired bandwidth value. Use the ICM20648_GYRO_BW_xHZ macros, which are defined in the icm20648.h file. The value of x can be 6, 12, 24, 51, 120, 150, 200, 360 or 12100. |
Definition at line 462 of file icm20648.c.
References ICM20648_MASK_GYRO_BW, ICM20648_OK, ICM20648_REG_GYRO_CONFIG_1, ICM20648_registerRead(), and ICM20648_registerWrite().
Referenced by ICM20648_accelGyroCalibrate(), ICM20648_gyroCalibrate(), and IMU_config().
uint32_t ICM20648_gyroCalibrate | ( | float * | gyroBiasScaled | ) |
Gyroscope calibration function. Reads the gyroscope values while the device is at rest and in level. The resulting values are loaded to the gyro bias registers to cancel the static offset error.
[out] | gyroBiasScaled | The mesured gyro sensor bias in deg/sec |
Definition at line 1077 of file icm20648.c.
References ICM20648_BIT_FIFO_EN, ICM20648_BITS_GYRO_FIFO_EN, ICM20648_GYRO_BW_12HZ, ICM20648_GYRO_FULLSCALE_250DPS, ICM20648_gyroBandwidthSet(), ICM20648_gyroFullscaleSet(), ICM20648_gyroResolutionGet(), ICM20648_OK, ICM20648_REG_FIFO_COUNT_H, ICM20648_REG_FIFO_EN_2, ICM20648_REG_FIFO_MODE, ICM20648_REG_FIFO_R_W, ICM20648_REG_FIFO_RST, ICM20648_REG_USER_CTRL, ICM20648_REG_XG_OFFS_USRH, ICM20648_REG_XG_OFFS_USRL, ICM20648_REG_YG_OFFS_USRH, ICM20648_REG_YG_OFFS_USRL, ICM20648_REG_ZG_OFFS_USRH, ICM20648_REG_ZG_OFFS_USRL, ICM20648_registerRead(), ICM20648_registerWrite(), ICM20648_sampleRateSet(), ICM20648_sensorEnable(), and UTIL_delay().
Referenced by IMU_init().
uint32_t ICM20648_gyroDataRead | ( | float * | gyro | ) |
Reads the raw gyroscope value and converts to deg/sec value based on the actual resolution.
[out] | gyro | A 3-element array of float numbers containing the gyroscope values for the x, y and z axes in deg/sec units. |
Definition at line 182 of file icm20648.c.
References ICM20648_gyroResolutionGet(), ICM20648_OK, ICM20648_REG_GYRO_XOUT_H_SH, and ICM20648_registerRead().
Referenced by IMU_getGyroData().
uint32_t ICM20648_gyroFullscaleSet | ( | uint8_t | gyroFs | ) |
Sets the full scale value of the gyroscope.
[in] | gyroFs | The desired full scale value. Use the ICM20648_GYRO_FULLSCALE_yDPS macros, which are defined in the icm20648.h file. The value of y can be 250, 500, 1000 or 2000. |
Definition at line 332 of file icm20648.c.
References ICM20648_MASK_GYRO_FULLSCALE, ICM20648_OK, ICM20648_REG_GYRO_CONFIG_1, ICM20648_registerRead(), and ICM20648_registerWrite().
Referenced by ICM20648_accelGyroCalibrate(), ICM20648_gyroCalibrate(), and IMU_config().
uint32_t ICM20648_gyroResolutionGet | ( | float * | gyroRes | ) |
Gets the actual resolution of the gyroscope.
[out] | gyroRes | The actual resolution in (deg/sec)/bit units |
Definition at line 260 of file icm20648.c.
References ICM20648_GYRO_FULLSCALE_1000DPS, ICM20648_GYRO_FULLSCALE_2000DPS, ICM20648_GYRO_FULLSCALE_250DPS, ICM20648_GYRO_FULLSCALE_500DPS, ICM20648_MASK_GYRO_FULLSCALE, ICM20648_OK, ICM20648_REG_GYRO_CONFIG_1, and ICM20648_registerRead().
Referenced by ICM20648_accelGyroCalibrate(), ICM20648_gyroCalibrate(), and ICM20648_gyroDataRead().
float ICM20648_gyroSampleRateSet | ( | float | sampleRate | ) |
Sets the sample rate of the accelerometer.
[in] | sampleRate | The desired sample rate in Hz |
Definition at line 380 of file icm20648.c.
References ICM20648_REG_GYRO_SMPLRT_DIV, and ICM20648_registerWrite().
Referenced by ICM20648_sampleRateSet(), and IMU_config().
uint32_t ICM20648_init | ( | void | ) |
Initializes the ICM20648 sensor. Enables the power supply and SPI lines, sets up the host SPI controller, configures the chip control interface, clock generator and interrupt line.
DO_NOT_INCLUDE_WITH_DOXYGEN
Definition at line 53 of file icm20648.c.
References BOARD_imuEnable(), ICM20648_BIT_CLK_PLL, ICM20648_BIT_I2C_IF_DIS, ICM20648_BIT_INT_ACTL, ICM20648_BIT_INT_OPEN, ICM20648_DEVICE_ID, ICM20648_ERROR_INVALID_DEVICE_ID, ICM20648_OK, ICM20648_REG_INT_PIN_CFG, ICM20648_REG_PWR_MGMT_1, ICM20648_REG_USER_CTRL, ICM20648_REG_WHO_AM_I, ICM20648_registerRead(), ICM20648_registerWrite(), ICM20648_reset(), ICM20648_spiInit(), and UTIL_delay().
Referenced by IMU_init().
uint32_t ICM20648_interruptEnable | ( | bool | dataReadyEnable, |
bool | womEnable | ||
) |
Enables or disables the interrupts in the ICM20648 chip.
[in] | dataReadyEnable | If true enables the Raw Data Ready interrupt, otherwise disables. |
[in] | womEnable | If true enables the Wake-up On Motion interrupt, otherwise disables. |
Definition at line 697 of file icm20648.c.
References ICM20648_BIT_RAW_DATA_0_RDY_EN, ICM20648_BIT_WOM_INT_EN, ICM20648_OK, ICM20648_REG_INT_ENABLE, ICM20648_REG_INT_ENABLE_1, and ICM20648_registerWrite().
Referenced by ICM20648_wakeOnMotionITEnable(), IMU_config(), and IMU_gyroCalibrate().
uint32_t ICM20648_interruptStatusRead | ( | uint32_t * | intStatus | ) |
Reads the interrupt status registers of the ICM20648 chip.
[out] | intStatus | The content the four interrupt registers. LSByte is INT_STATUS, MSByte is INT_STATUS_3 |
Definition at line 737 of file icm20648.c.
References ICM20648_OK, ICM20648_REG_INT_STATUS, and ICM20648_registerRead().
Referenced by IMU_config().
bool ICM20648_isDataReady | ( | void | ) |
Checks if new data is available for read.
Definition at line 759 of file icm20648.c.
References ICM20648_BIT_RAW_DATA_0_RDY_INT, ICM20648_REG_INT_STATUS_1, and ICM20648_registerRead().
Referenced by IMU_isDataReady().
uint32_t ICM20648_lowPowerModeEnter | ( | bool | enAccel, |
bool | enGyro, | ||
bool | enTemp | ||
) |
Enables or disables the sensors in low power mode in the ICM20648 chip.
[in] | enAccel | If true enables the acceleration sensor in low power mode |
[in] | enGyro | If true enables the gyroscope sensor in low power mode |
[in] | enTemp | If true enables the temperature sensor in low power mode |
Definition at line 641 of file icm20648.c.
References ICM20648_BIT_LP_EN, ICM20648_cycleModeEnable(), ICM20648_OK, ICM20648_REG_PWR_MGMT_1, ICM20648_registerRead(), ICM20648_registerWrite(), ICM20648_sensorEnable(), ICM20648_sleepModeEnable(), and UTIL_delay().
Referenced by ICM20648_wakeOnMotionITEnable(), and IMU_config().
void ICM20648_registerRead | ( | uint16_t | addr, |
int | numBytes, | ||
uint8_t * | data | ||
) |
Reads register from the ICM20648 device.
[in] | addr | The register address to read from in the sensor Bit[8:7] - bank address Bit[6:0] - register address |
[in] | numBytes | The number of bytes to read |
[out] | data | The data read from the register |
Definition at line 1323 of file icm20648.c.
References ICM20648_bankSelect(), USART_Rx(), and USART_Tx().
Referenced by ICM20648_accelBandwidthSet(), ICM20648_accelDataRead(), ICM20648_accelFullscaleSet(), ICM20648_accelGyroCalibrate(), ICM20648_accelResolutionGet(), ICM20648_getDeviceID(), ICM20648_gyroBandwidthSet(), ICM20648_gyroCalibrate(), ICM20648_gyroDataRead(), ICM20648_gyroFullscaleSet(), ICM20648_gyroResolutionGet(), ICM20648_init(), ICM20648_interruptStatusRead(), ICM20648_isDataReady(), ICM20648_lowPowerModeEnter(), ICM20648_sensorEnable(), ICM20648_sleepModeEnable(), and ICM20648_temperatureRead().
void ICM20648_registerWrite | ( | uint16_t | addr, |
uint8_t | data | ||
) |
Writes a register in the ICM20648 device.
[in] | addr | The register address to write Bit[8:7] - bank address Bit[6:0] - register address |
[in] | data | The data to write to the register |
Definition at line 1368 of file icm20648.c.
References ICM20648_bankSelect(), USART_Rx(), and USART_Tx().
Referenced by ICM20648_accelBandwidthSet(), ICM20648_accelFullscaleSet(), ICM20648_accelGyroCalibrate(), ICM20648_accelSampleRateSet(), ICM20648_cycleModeEnable(), ICM20648_gyroBandwidthSet(), ICM20648_gyroCalibrate(), ICM20648_gyroFullscaleSet(), ICM20648_gyroSampleRateSet(), ICM20648_init(), ICM20648_interruptEnable(), ICM20648_lowPowerModeEnter(), ICM20648_reset(), ICM20648_sensorEnable(), ICM20648_sleepModeEnable(), and ICM20648_wakeOnMotionITEnable().
uint32_t ICM20648_reset | ( | void | ) |
Performs soft reset on the ICM20648 chip.
Definition at line 120 of file icm20648.c.
References ICM20648_BIT_H_RESET, ICM20648_OK, ICM20648_REG_PWR_MGMT_1, ICM20648_registerWrite(), and UTIL_delay().
Referenced by ICM20648_init().
uint32_t ICM20648_sampleRateSet | ( | float | sampleRate | ) |
Sets the sample rate both of the accelerometer and the gyroscope.
[in] | sampleRate | The desired sample rate in Hz. Since the resolution of the sample rate divider is different in the accel and gyro stages it is possible that the two sensor will have different sample rate set. |
Definition at line 359 of file icm20648.c.
References ICM20648_accelSampleRateSet(), ICM20648_gyroSampleRateSet(), and ICM20648_OK.
Referenced by ICM20648_accelGyroCalibrate(), ICM20648_gyroCalibrate(), and ICM20648_wakeOnMotionITEnable().
uint32_t ICM20648_sensorEnable | ( | bool | accel, |
bool | gyro, | ||
bool | temp | ||
) |
Enables or disables the sensors in the ICM20648 chip.
[in] | accel | If true enables the acceleration sensor |
[in] | gyro | If true enables the gyroscope sensor |
[in] | temp | If true enables the temperature sensor |
Definition at line 584 of file icm20648.c.
References ICM20648_BIT_PWR_ACCEL_STBY, ICM20648_BIT_PWR_GYRO_STBY, ICM20648_BIT_TEMP_DIS, ICM20648_OK, ICM20648_REG_PWR_MGMT_1, ICM20648_REG_PWR_MGMT_2, ICM20648_registerRead(), and ICM20648_registerWrite().
Referenced by ICM20648_accelGyroCalibrate(), ICM20648_gyroCalibrate(), ICM20648_lowPowerModeEnter(), ICM20648_wakeOnMotionITEnable(), and IMU_config().
uint32_t ICM20648_sleepModeEnable | ( | bool | enable | ) |
Enables or disables the sleep mode of the device.
[in] | enable | If true, sleep mode is enabled. Set to false to disable sleep mode. |
Definition at line 518 of file icm20648.c.
References ICM20648_BIT_SLEEP, ICM20648_OK, ICM20648_REG_PWR_MGMT_1, ICM20648_registerRead(), and ICM20648_registerWrite().
Referenced by ICM20648_lowPowerModeEnter(), and ICM20648_wakeOnMotionITEnable().
uint32_t ICM20648_spiInit | ( | void | ) |
Initializes the SPI bus in order to communicate with the ICM20648.
Definition at line 1272 of file icm20648.c.
References _USART_ROUTELOC0_CLKLOC_MASK, _USART_ROUTELOC0_CLKLOC_SHIFT, _USART_ROUTELOC0_RXLOC_MASK, _USART_ROUTELOC0_RXLOC_SHIFT, _USART_ROUTELOC0_TXLOC_MASK, _USART_ROUTELOC0_TXLOC_SHIFT, CMU_ClockEnable(), cmuClock_GPIO, cmuClock_HFPER, GPIO_PinModeSet(), gpioModeInput, gpioModePushPull, ICM20648_OK, USART_TypeDef::ROUTELOC0, USART_TypeDef::ROUTEPEN, USART_InitSync(), USART_Reset(), USART_ROUTEPEN_CLKPEN, USART_ROUTEPEN_RXPEN, and USART_ROUTEPEN_TXPEN.
Referenced by ICM20648_init().
uint32_t ICM20648_temperatureRead | ( | float * | temperature | ) |
Reads the temperature sensor raw value and converts to Celsius.
[out] | temperature | The mesured temperature in Celsius |
Definition at line 1227 of file icm20648.c.
References ICM20648_OK, ICM20648_REG_TEMPERATURE_H, and ICM20648_registerRead().
uint32_t ICM20648_wakeOnMotionITEnable | ( | bool | enable, |
uint8_t | womThreshold, | ||
float | sampleRate | ||
) |
Sets up and enables the Wake-up On Motion feature.
[in] | enable | If true enables the WOM feature, disables otherwise |
[in] | womThreshold | Threshold value for the Wake on Motion Interrupt for ACCEL x/y/z axes. LSB = 4mg. Range is 0mg to 1020mg |
[in] | sampleRate | The desired sample rate of the accel sensor in Hz |
Definition at line 793 of file icm20648.c.
References ICM20648_ACCEL_BW_1210HZ, ICM20648_ACCEL_FULLSCALE_2G, ICM20648_accelBandwidthSet(), ICM20648_accelFullscaleSet(), ICM20648_BIT_ACCEL_INTEL_EN, ICM20648_BIT_ACCEL_INTEL_MODE, ICM20648_cycleModeEnable(), ICM20648_interruptEnable(), ICM20648_lowPowerModeEnter(), ICM20648_OK, ICM20648_REG_ACCEL_INTEL_CTRL, ICM20648_REG_ACCEL_WOM_THR, ICM20648_registerWrite(), ICM20648_sampleRateSet(), ICM20648_sensorEnable(), ICM20648_sleepModeEnable(), and UTIL_delay().