![]() |
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the Invensense 456XY IMUs: More...
#include "peripherals/invensense3_456.h"
#include "peripherals/invensense3_456_regs.h"
#include "math/pprz_isa.h"
#include "math/pprz_algebra_int.h"
#include "math/pprz_algebra_float.h"
#include "modules/imu/imu.h"
#include "modules/core/abi.h"
#include "mcu_periph/gpio_arch.h"
#include "std.h"
#include <string.h>
#include "modules/datalink/telemetry.h"
Go to the source code of this file.
|
static |
Configure the Invensense 3 device register by register.
inv | The invensense v3 instance |
Definition at line 415 of file invensense3_456.c.
References ACCEL_FS_SEL_SHIFT, ACCEL_ODR_SHIFT, foo, get_sys_time_usec(), GYRO_FS_SEL_SHIFT, GYRO_ODR_SHIFT, INV3BANK_456_IPREG_SYS1_ADDR, INV3BANK_456_IPREG_SYS2_ADDR, INV3BANK_456_IPREG_TOP1_ADDR, INV3REG_456_ACCEL_CONFIG0, INV3REG_456_FIFO_CONFIG0, INV3REG_456_FIFO_CONFIG3, INV3REG_456_GYRO_CONFIG0, INV3REG_456_PWR_MGMT0, INV3REG_456_REG_MISC2, INV_456_BASE_FIFO3_CONFIG_VALUE, INV_456_FIFO_IF_EN, invensense3_456_register_write(), and invensense3_register_write_bank().
Referenced by invensense3_456_event(), and invensense3_456_periodic().
void invensense3_456_event | ( | struct invensense3_456_t * | inv | ) |
Should be called in the event thread.
inv | The invensense v3 instance |
Definition at line 137 of file invensense3_456.c.
References foo, INV3_456_WHOAMI_ICM45686, INV3REG_456_FIFO_COUNTH, invensense3_456_config(), INVENSENSE3_456_CONFIG, INVENSENSE3_456_ICM45686, INVENSENSE3_456_IDLE, invensense3_456_parse_fifo_data(), invensense3_456_register_read(), INVENSENSE3_456_RUNNING, invensense3_456_set_scalings(), Min, n_samples, SPITransDone, SPITransFailed, and SPITransSuccess.
Referenced by imu_cube_event().
void invensense3_456_init | ( | struct invensense3_456_t * | inv | ) |
Initialize the invensense v3 sensor instance.
inv | The structure containing the configuration of the invensense v3 instance |
Definition at line 57 of file invensense3_456.c.
References foo, INVENSENSE3_456_IDLE, INVENSENSE3_456_UNKOWN, samples_from_odr(), SPICphaEdge2, SPICpolIdleHigh, SPIDiv16, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, and SPITransDone.
Referenced by imu_cube_init().
|
static |
Parse the FIFO buffer data.
inv | The invensense v3 instance |
data | The FIFO buffer data to parse |
len | The length of the FIFO buffer |
Definition at line 247 of file invensense3_456.c.
References FIFODataHighRes::accel, FIFODataHighRes::ax, FIFODataHighRes::ay, FIFODataHighRes::az, foo, get_sys_time_usec(), FIFODataHighRes::gx, FIFODataHighRes::gy, FIFODataHighRes::gyro, FIFODataHighRes::gz, FIFODataHighRes::header, INVENSENSE3_456_FIFO_BUFFER_LEN, Min, reassemble_uint20(), and FIFODataHighRes::temperature.
Referenced by invensense3_456_event().
void invensense3_456_periodic | ( | struct invensense3_456_t * | inv | ) |
Should be called periodically to request sensor readings.
inv | The invensense v3 instance |
Definition at line 95 of file invensense3_456.c.
References foo, INV3REG_456_FIFO_COUNTH, INV3REG_456_WHOAMI, invensense3_456_config(), INVENSENSE3_456_CONFIG, INVENSENSE3_456_IDLE, invensense3_456_register_read(), INVENSENSE3_456_RUNNING, Min, and SPITransDone.
Referenced by imu_cube_periodic().
|
static |
Read a register based on a combined bank/regsiter value.
inv | The invensense v3 instance |
reg | The address of the register to read |
size | The size to read (already 1 is added for the transmission of the register to read) |
Definition at line 396 of file invensense3_456.c.
References foo, INV3_456_READ_FLAG, and spi_submit().
Referenced by invensense3_456_event(), and invensense3_456_periodic().
|
static |
Write a register.
inv | The invensense v3 instance |
reg | The address of the register to write to |
value | The value to write to the register |
Definition at line 349 of file invensense3_456.c.
References foo, and spi_submit().
Referenced by invensense3_456_config().
|
static |
This sets the correct scalings.
inv | The invensense v3 instance |
Definition at line 297 of file invensense3_456.c.
References ACCEL_BFP_OF_REAL, foo, imu_set_defaults_accel(), imu_set_defaults_gyro(), INVENSENSE3_456_ODR_100HZ, INVENSENSE3_456_ODR_1_6KHZ, INVENSENSE3_456_ODR_200HZ, INVENSENSE3_456_ODR_25HZ, INVENSENSE3_456_ODR_3_2KHZ, INVENSENSE3_456_ODR_400HZ, INVENSENSE3_456_ODR_50HZ, INVENSENSE3_456_ODR_6_4KHZ, INVENSENSE3_456_ODR_800HZ, and RATE_BFP_OF_REAL.
Referenced by invensense3_456_event().
|
static |
Write to a register in a specific bank.
inv | The invensense v3 instance |
bank_addr | The address of the bank to write to |
reg | The address of the register to write to |
value | The value to write to the register |
Definition at line 371 of file invensense3_456.c.
References foo, INV3REG_456_IREG_ADDRH, spi_submit(), and val.
Referenced by invensense3_456_config().
Definition at line 225 of file invensense3_456.c.
References foo.
Referenced by invensense3_456_parse_fifo_data().
Definition at line 495 of file invensense3_456.c.
References foo, INVENSENSE3_456_ODR_100HZ, INVENSENSE3_456_ODR_1_6KHZ, INVENSENSE3_456_ODR_200HZ, INVENSENSE3_456_ODR_25HZ, INVENSENSE3_456_ODR_3_2KHZ, INVENSENSE3_456_ODR_400HZ, INVENSENSE3_456_ODR_50HZ, INVENSENSE3_456_ODR_6_4KHZ, and INVENSENSE3_456_ODR_800HZ.
Referenced by invensense3_456_init().