OpenShoe  1.0
Defines | Functions
imu_interface.c File Reference

High level IMU interface. More...

#include "imu_interface.h"
#include "conf_spi_master.h"
#include "nav_types.h"
#include <gpio.h>
#include <spi.h>
#include <spi_master.h>

Defines

#define MAX_LOG2_NR_FILTER_TAPS   4
IMU commands
#define BURST_READ   0x3E00
#define PRECISION_GYRO_BIAS_CALIBRATION   0xBE10
#define SET_NR_FILTER_TAPS   0xB8
Scaling of IMU raw data
#define SUPPLY_SCALE   0.002418f
#define GYRO_SCALE   0.00087266f
#define ACC_SCALE   0.0081643275f
#define TEMP_SCALE   0.0085f
#define SUPPLY_SCALE   0.000151125f

Functions

void imu_interface_init (void)
 Initialization routine for the IMU to MCU interface.
void convert_inert_readings (void)
 Converts raw (integer) inertial readings to float SI units.
void convert_auxiliary_data (void)
 Converts raw (integer) auxiliary data readings to float SI units.
void imu_burst_read (void)
 Request and reads all sensor output data from IMU.
void precision_gyro_bias_null_calibration (void)
 Initializes the internal IMU gyro calibration routine.
void low_pass_filter_setting (uint8_t nr_filter_taps)
 Sets the number of filter taps of the IMU internal low pass filter.

Variables

Global IMU output variables

Global variable used for making sensor readings available to other parts of the program. The variables will contain the latest read out sensor readings. The values are scaled to SI units apart from the temperature which is in $^circ C$. Angels are given in radians.

vec3 accelerations_in
 $[m/s^2]$
vec3 angular_rates_in
 $[rad/s]$
vec3 imu_temperaturs
 $[^circ C]$
precision imu_supply_voltage
 $[V]$

Detailed Description

High level IMU interface.

This file declares the high level interface functions used by the rest of the system to interact with the IMU. The functions work for all IMUs in the Analog Devices iSensor (R) serie. The communication is done via a SPI interface. Before the functions are called the initialization routine (imu_interface_init()) must be called to set up the SPI interface. The SPI interface settings are found in conf_spi_master.h.

Authors:
John-Olof Nilsson, Isaac Skog
 All Data Structures Files Functions Variables Typedefs Defines