Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
imu_icm42688.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 Freek van tieen <freek.v.tienen@gmail.com>
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, write to
18 * the Free Software Foundation, 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
28#include "modules/imu/imu.h"
29#include "modules/core/abi.h"
30#include "mcu_periph/spi.h"
32
33
34#ifndef INVENSENSE3_GYRO_AAF
35#define INVENSENSE3_GYRO_AAF 977
36#endif
37
38#ifndef INVENSENSE3_ACCEL_AAF
39#define INVENSENSE3_ACCEL_AAF 213
40#endif
41
43
45{
47 //imu_icm42688.parser = INVENSENSE3_PARSER_REGISTERS;
49
52 imu_icm42688.spi.slave_idx = IMU_SPI_SLAVE_IDX;
53
58
59 // The AAF freq needs to be high enough to avoid group delay and low enough to minimise noise and clipping
62
64}
65
70
75
76
77
Main include for ABI (AirBorneInterface).
#define IMU_ICM42688_ID
Inertial Measurement Unit interface.
void imu_icm42688_event(void)
static struct invensense3_t imu_icm42688
void imu_icm42688_periodic(void)
void imu_icm42688_init(void)
#define INVENSENSE3_GYRO_AAF
#define INVENSENSE3_ACCEL_AAF
Driver for the IMU ICM42688.
void invensense3_periodic(struct invensense3_t *inv)
Should be called periodically to request sensor readings.
void invensense3_event(struct invensense3_t *inv)
Should be called in the event thread.
void invensense3_init(struct invensense3_t *inv)
Initialize the invensense v3 sensor instance.
Driver for the Invensense V3 IMUs ICM40605, ICM40609, ICM42605, IIM42652 and ICM42688.
enum invensense3_gyro_range_t gyro_range
Gyro range configuration.
enum invensense3_parser_t parser
Parser of the device.
uint16_t accel_aaf
Accelerometer Anti-alias filter 3dB Bandwidth configuration [Hz].
@ INVENSENSE3_PARSER_FIFO
Definition invensense3.h:74
enum invensense3_accel_odr_t accel_odr
Accelerometer Output Data Rate configuration.
enum invensense3_bus_t bus
The communication bus used to connect the device SPI/I2C.
@ INVENSENSE3_SPI
Definition invensense3.h:60
enum invensense3_accel_range_t accel_range
Accelerometer range configuration.
uint8_t abi_id
The ABI id used to broadcast the device measurements.
uint16_t gyro_aaf
Gyro Anti-alias filter 3dB Bandwidth configuration [Hz].
enum invensense3_gyro_odr_t gyro_odr
Gyro Output Data Rate configuration.
uint16_t foo
Definition main_demo5.c:58
Architecture independent SPI (Serial Peripheral Interface) API.