EFM32 Gecko Software Documentation  efm32g-doc-5.1.2
imu.c File Reference

Detailed Description

Inertial Measurement Unit driver.

Version
5.1.1

License

Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com

This file is licensed under the Silicon Labs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file imu.c.

#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include "em_device.h"
#include "gpiointerrupt.h"
#include "thunderboard/board.h"
#include "thunderboard/icm20648.h"
#include "thunderboard/imu/imu.h"
#include "thunderboard/util.h"

Go to the source code of this file.

Functions

void IMU_accelerationGet (int16_t avec[3])
 Retrieves the processed acceleration data. More...
 
void IMU_clearDataReadyFlag (void)
 Clears the IMU data ready flag. In case of ver 0.3.0 and older of the PIC firmware the interrupt register also needs to be cleared. More...
 
void IMU_config (float sampleRate)
 Configures the IMU. More...
 
uint32_t IMU_deInit (void)
 De-initializes the IMU chip. More...
 
void IMU_getAccelerometerData (float avec[3])
 Retrieves the raw acceleration data from the IMU. More...
 
void IMU_getGyroCorrectionAngles (float acorr[3])
 Retrieves the processed gyroscope correction angles. More...
 
void IMU_getGyroData (float gvec[3])
 Retrieves the raw gyroscope data from the IMU. More...
 
uint8_t IMU_getState (void)
 Returns IMU state. More...
 
uint32_t IMU_gyroCalibrate (void)
 Performs gyroscope calibration to cancel gyro bias. More...
 
void IMU_gyroGet (int16_t gvec[3])
 Retrieves the processed gyroscope data. More...
 
uint32_t IMU_init (void)
 Initializes and calibrates the IMU. More...
 
bool IMU_isDataReady (void)
 Checks if there is new accel/gyro data available for read. More...
 
bool IMU_isDataReadyFlag (void)
 Checks if there is new accel/gyro data available for read. In case of ver 0.3.0 and older of the PIC firmware the state of the PIC_INT_WAKE needs to be read to determinte if the IMU interrupt is valid. More...
 
void IMU_orientationGet (int16_t ovec[3])
 Retrieves the processed orientation data. More...
 
void IMU_reset (void)
 Resets the fusion calculation. More...
 
void IMU_update (void)
 Gets a new set of data from the accel and gyro sensor and updates the fusion calculation. More...
 

Variables

uint8_t IMU_state = IMU_STATE_DISABLED
 

Variable Documentation

uint8_t IMU_state = IMU_STATE_DISABLED

DO_NOT_INCLUDE_WITH_DOXYGEN IMU state variable

Definition at line 41 of file imu.c.

Referenced by IMU_config(), IMU_deInit(), IMU_fuseUpdate(), IMU_getAccelerometerData(), IMU_getGyroData(), IMU_getState(), IMU_init(), IMU_isDataReady(), and IMU_isDataReadyFlag().