JeVois  1.22
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Loading...
Searching...
No Matches
ICM_20948_C.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "ICM_20948_REGISTERS.h"
#include "ICM_20948_ENUMERATIONS.h"
#include "AK09916_ENUMERATIONS.h"
#include "ICM_20948_DMP.h"
Include dependency graph for ICM_20948_C.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  ICM_20948_axis3bit16_t
 
union  ICM_20948_axis1bit16_t
 
struct  ICM_20948_fss_t
 
struct  ICM_20948_dlpcfg_t
 
struct  ICM_20948_smplrt_t
 
struct  ICM_20948_INT_enable_t
 
union  ICM_20948_axis3named_t
 
struct  ICM_20948_AGMT_t
 
struct  ICM_20948_Serif_t
 
struct  ICM_20948_Device_t
 

Macros

#define DMP_CODE_SIZE   14301 /* eMD-SmartMotion-ICM20948-1.1.0-MP */
 
#define ICM_20948_I2C_ADDR_AD0   0x68
 
#define ICM_20948_I2C_ADDR_AD1   0x69
 
#define ICM_20948_WHOAMI   0xEA
 
#define MAG_AK09916_I2C_ADDR   0x0C
 
#define MAG_AK09916_WHO_AM_I   0x4809
 
#define MAG_REG_WHO_AM_I   0x00
 
#define INV_MAX_SERIAL_READ   16
 Max size that can be read across I2C or SPI data lines.
 
#define INV_MAX_SERIAL_WRITE   16
 Max size that can be written across I2C or SPI data lines.
 

Enumerations

enum  ICM_20948_Status_e {
  ICM_20948_Stat_Ok = 0x00 , ICM_20948_Stat_Err , ICM_20948_Stat_NotImpl , ICM_20948_Stat_ParamErr ,
  ICM_20948_Stat_WrongID , ICM_20948_Stat_InvalSensor , ICM_20948_Stat_NoData , ICM_20948_Stat_SensorNotSupported ,
  ICM_20948_Stat_DMPNotSupported , ICM_20948_Stat_DMPVerifyFail , ICM_20948_Stat_FIFONoDataAvail , ICM_20948_Stat_FIFOIncompleteData ,
  ICM_20948_Stat_FIFOMoreDataAvail , ICM_20948_Stat_UnrecognisedDMPHeader , ICM_20948_Stat_UnrecognisedDMPHeader2 , ICM_20948_Stat_InvalDMPRegister ,
  ICM_20948_Stat_NUM , ICM_20948_Stat_Unknown
}
 
enum  ICM_20948_InternalSensorID_bm {
  ICM_20948_Internal_Acc = (1 << 0) , ICM_20948_Internal_Gyr = (1 << 1) , ICM_20948_Internal_Mag = (1 << 2) , ICM_20948_Internal_Tmp = (1 << 3) ,
  ICM_20948_Internal_Mst = (1 << 4)
}
 

Functions

int memcmp (const void *, const void *, size_t)
 
ICM_20948_Status_e ICM_20948_init_struct (ICM_20948_Device_t *pdev)
 
ICM_20948_Status_e ICM_20948_link_serif (ICM_20948_Device_t *pdev, const ICM_20948_Serif_t *s)
 
ICM_20948_Status_e ICM_20948_execute_r (ICM_20948_Device_t *pdev, uint8_t regaddr, uint8_t *pdata, uint32_t len)
 
ICM_20948_Status_e ICM_20948_execute_w (ICM_20948_Device_t *pdev, uint8_t regaddr, uint8_t *pdata, uint32_t len)
 
ICM_20948_Status_e ICM_20948_i2c_controller_periph4_txn (ICM_20948_Device_t *pdev, uint8_t addr, uint8_t reg, uint8_t *data, uint8_t len, bool Rw, bool send_reg_addr)
 
ICM_20948_Status_e ICM_20948_i2c_master_single_w (ICM_20948_Device_t *pdev, uint8_t addr, uint8_t reg, uint8_t *data)
 
ICM_20948_Status_e ICM_20948_i2c_master_single_r (ICM_20948_Device_t *pdev, uint8_t addr, uint8_t reg, uint8_t *data)
 
ICM_20948_Status_e ICM_20948_set_bank (ICM_20948_Device_t *pdev, uint8_t bank)
 
ICM_20948_Status_e ICM_20948_sw_reset (ICM_20948_Device_t *pdev)
 
ICM_20948_Status_e ICM_20948_sleep (ICM_20948_Device_t *pdev, bool on)
 
ICM_20948_Status_e ICM_20948_low_power (ICM_20948_Device_t *pdev, bool on)
 
ICM_20948_Status_e ICM_20948_set_clock_source (ICM_20948_Device_t *pdev, ICM_20948_PWR_MGMT_1_CLKSEL_e source)
 
ICM_20948_Status_e ICM_20948_get_who_am_i (ICM_20948_Device_t *pdev, uint8_t *whoami)
 
ICM_20948_Status_e ICM_20948_check_id (ICM_20948_Device_t *pdev)
 
ICM_20948_Status_e ICM_20948_data_ready (ICM_20948_Device_t *pdev)
 
ICM_20948_Status_e ICM_20948_int_pin_cfg (ICM_20948_Device_t *pdev, ICM_20948_INT_PIN_CFG_t *write, ICM_20948_INT_PIN_CFG_t *read)
 
ICM_20948_Status_e ICM_20948_int_enable (ICM_20948_Device_t *pdev, ICM_20948_INT_enable_t *write, ICM_20948_INT_enable_t *read)
 
ICM_20948_Status_e ICM_20948_wom_logic (ICM_20948_Device_t *pdev, ICM_20948_ACCEL_INTEL_CTRL_t *write, ICM_20948_ACCEL_INTEL_CTRL_t *read)
 
ICM_20948_Status_e ICM_20948_wom_threshold (ICM_20948_Device_t *pdev, ICM_20948_ACCEL_WOM_THR_t *write, ICM_20948_ACCEL_WOM_THR_t *read)
 
ICM_20948_Status_e ICM_20948_set_sample_mode (ICM_20948_Device_t *pdev, ICM_20948_InternalSensorID_bm sensors, ICM_20948_LP_CONFIG_CYCLE_e mode)
 
ICM_20948_Status_e ICM_20948_set_full_scale (ICM_20948_Device_t *pdev, ICM_20948_InternalSensorID_bm sensors, ICM_20948_fss_t fss)
 
ICM_20948_Status_e ICM_20948_set_dlpf_cfg (ICM_20948_Device_t *pdev, ICM_20948_InternalSensorID_bm sensors, ICM_20948_dlpcfg_t cfg)
 
ICM_20948_Status_e ICM_20948_enable_dlpf (ICM_20948_Device_t *pdev, ICM_20948_InternalSensorID_bm sensors, bool enable)
 
ICM_20948_Status_e ICM_20948_set_sample_rate (ICM_20948_Device_t *pdev, ICM_20948_InternalSensorID_bm sensors, ICM_20948_smplrt_t smplrt)
 
ICM_20948_Status_e ICM_20948_i2c_master_passthrough (ICM_20948_Device_t *pdev, bool passthrough)
 
ICM_20948_Status_e ICM_20948_i2c_master_enable (ICM_20948_Device_t *pdev, bool enable)
 
ICM_20948_Status_e ICM_20948_i2c_master_reset (ICM_20948_Device_t *pdev)
 
ICM_20948_Status_e ICM_20948_i2c_controller_configure_peripheral (ICM_20948_Device_t *pdev, uint8_t peripheral, uint8_t addr, uint8_t reg, uint8_t len, bool Rw, bool enable, bool data_only, bool grp, bool swap, uint8_t dataOut)
 
ICM_20948_Status_e ICM_20948_get_agmt (ICM_20948_Device_t *pdev, ICM_20948_AGMT_t *p)
 
ICM_20948_Status_e ICM_20948_enable_FIFO (ICM_20948_Device_t *pdev, bool enable)
 
ICM_20948_Status_e ICM_20948_reset_FIFO (ICM_20948_Device_t *pdev)
 
ICM_20948_Status_e ICM_20948_set_FIFO_mode (ICM_20948_Device_t *pdev, bool snapshot)
 
ICM_20948_Status_e ICM_20948_get_FIFO_count (ICM_20948_Device_t *pdev, uint16_t *count)
 
ICM_20948_Status_e ICM_20948_read_FIFO (ICM_20948_Device_t *pdev, uint8_t *data, uint8_t len)
 
ICM_20948_Status_e ICM_20948_enable_DMP (ICM_20948_Device_t *pdev, bool enable)
 
ICM_20948_Status_e ICM_20948_reset_DMP (ICM_20948_Device_t *pdev)
 
ICM_20948_Status_e ICM_20948_firmware_load (ICM_20948_Device_t *pdev)
 
ICM_20948_Status_e ICM_20948_set_dmp_start_address (ICM_20948_Device_t *pdev, unsigned short address)
 
ICM_20948_Status_e inv_icm20948_firmware_load (ICM_20948_Device_t *pdev, const unsigned char *data, unsigned short size, unsigned short load_addr)
 Loads the DMP firmware from SRAM.
 
ICM_20948_Status_e inv_icm20948_write_mems (ICM_20948_Device_t *pdev, unsigned short reg, unsigned int length, const unsigned char *data)
 Write data to a register in DMP memory.
 
ICM_20948_Status_e inv_icm20948_read_mems (ICM_20948_Device_t *pdev, unsigned short reg, unsigned int length, unsigned char *data)
 Read data from a register in DMP memory.
 
ICM_20948_Status_e inv_icm20948_set_dmp_sensor_period (ICM_20948_Device_t *pdev, enum DMP_ODR_Registers odr_reg, uint16_t interval)
 
ICM_20948_Status_e inv_icm20948_enable_dmp_sensor (ICM_20948_Device_t *pdev, enum inv_icm20948_sensor sensor, int state)
 
ICM_20948_Status_e inv_icm20948_enable_dmp_sensor_int (ICM_20948_Device_t *pdev, enum inv_icm20948_sensor sensor, int state)
 
uint8_t sensor_type_2_android_sensor (enum inv_icm20948_sensor sensor)
 
enum inv_icm20948_sensor inv_icm20948_sensor_android_2_sensor_type (int sensor)
 
ICM_20948_Status_e inv_icm20948_read_dmp_data (ICM_20948_Device_t *pdev, icm_20948_DMP_data_t *data)
 
ICM_20948_Status_e inv_icm20948_set_gyro_sf (ICM_20948_Device_t *pdev, unsigned char div, int gyro_level)
 

Variables

const ICM_20948_Serif_t NullSerif
 

Macro Definition Documentation

◆ DMP_CODE_SIZE

#define DMP_CODE_SIZE   14301 /* eMD-SmartMotion-ICM20948-1.1.0-MP */

Definition at line 32 of file ICM_20948_C.h.

◆ ICM_20948_I2C_ADDR_AD0

#define ICM_20948_I2C_ADDR_AD0   0x68

Definition at line 36 of file ICM_20948_C.h.

◆ ICM_20948_I2C_ADDR_AD1

#define ICM_20948_I2C_ADDR_AD1   0x69

Definition at line 37 of file ICM_20948_C.h.

◆ ICM_20948_WHOAMI

#define ICM_20948_WHOAMI   0xEA

Definition at line 38 of file ICM_20948_C.h.

◆ INV_MAX_SERIAL_READ

#define INV_MAX_SERIAL_READ   16

Max size that can be read across I2C or SPI data lines.

Definition at line 45 of file ICM_20948_C.h.

◆ INV_MAX_SERIAL_WRITE

#define INV_MAX_SERIAL_WRITE   16

Max size that can be written across I2C or SPI data lines.

Definition at line 47 of file ICM_20948_C.h.

◆ MAG_AK09916_I2C_ADDR

#define MAG_AK09916_I2C_ADDR   0x0C

Definition at line 40 of file ICM_20948_C.h.

◆ MAG_AK09916_WHO_AM_I

#define MAG_AK09916_WHO_AM_I   0x4809

Definition at line 41 of file ICM_20948_C.h.

◆ MAG_REG_WHO_AM_I

#define MAG_REG_WHO_AM_I   0x00

Definition at line 42 of file ICM_20948_C.h.

Enumeration Type Documentation

◆ ICM_20948_InternalSensorID_bm

Enumerator
ICM_20948_Internal_Acc 
ICM_20948_Internal_Gyr 
ICM_20948_Internal_Mag 
ICM_20948_Internal_Tmp 
ICM_20948_Internal_Mst 

Definition at line 72 of file ICM_20948_C.h.

◆ ICM_20948_Status_e

Enumerator
ICM_20948_Stat_Ok 
ICM_20948_Stat_Err 
ICM_20948_Stat_NotImpl 
ICM_20948_Stat_ParamErr 
ICM_20948_Stat_WrongID 
ICM_20948_Stat_InvalSensor 
ICM_20948_Stat_NoData 
ICM_20948_Stat_SensorNotSupported 
ICM_20948_Stat_DMPNotSupported 
ICM_20948_Stat_DMPVerifyFail 
ICM_20948_Stat_FIFONoDataAvail 
ICM_20948_Stat_FIFOIncompleteData 
ICM_20948_Stat_FIFOMoreDataAvail 
ICM_20948_Stat_UnrecognisedDMPHeader 
ICM_20948_Stat_UnrecognisedDMPHeader2 
ICM_20948_Stat_InvalDMPRegister 
ICM_20948_Stat_NUM 
ICM_20948_Stat_Unknown 

Definition at line 49 of file ICM_20948_C.h.

Function Documentation

◆ ICM_20948_check_id()

◆ ICM_20948_data_ready()

◆ ICM_20948_enable_dlpf()

◆ ICM_20948_enable_DMP()

◆ ICM_20948_enable_FIFO()

◆ ICM_20948_execute_r()

◆ ICM_20948_execute_w()

◆ ICM_20948_firmware_load()

ICM_20948_Status_e ICM_20948_firmware_load ( ICM_20948_Device_t pdev)

◆ ICM_20948_get_agmt()

◆ ICM_20948_get_FIFO_count()

◆ ICM_20948_get_who_am_i()

ICM_20948_Status_e ICM_20948_get_who_am_i ( ICM_20948_Device_t pdev,
uint8_t *  whoami 
)

◆ ICM_20948_i2c_controller_configure_peripheral()

◆ ICM_20948_i2c_controller_periph4_txn()

◆ ICM_20948_i2c_master_enable()

◆ ICM_20948_i2c_master_passthrough()

◆ ICM_20948_i2c_master_reset()

◆ ICM_20948_i2c_master_single_r()

ICM_20948_Status_e ICM_20948_i2c_master_single_r ( ICM_20948_Device_t pdev,
uint8_t  addr,
uint8_t  reg,
uint8_t *  data 
)

Definition at line 261 of file ICM_20948_C.c.

References ICM_20948_i2c_controller_periph4_txn().

◆ ICM_20948_i2c_master_single_w()

ICM_20948_Status_e ICM_20948_i2c_master_single_w ( ICM_20948_Device_t pdev,
uint8_t  addr,
uint8_t  reg,
uint8_t *  data 
)

Definition at line 256 of file ICM_20948_C.c.

References ICM_20948_i2c_controller_periph4_txn().

◆ ICM_20948_init_struct()

ICM_20948_Status_e ICM_20948_init_struct ( ICM_20948_Device_t pdev)

Definition at line 125 of file ICM_20948_C.c.

References ICM_20948_Device_t::_last_bank, and ICM_20948_Stat_Ok.

◆ ICM_20948_int_enable()

ICM_20948_Status_e ICM_20948_int_enable ( ICM_20948_Device_t pdev,
ICM_20948_INT_enable_t write,
ICM_20948_INT_enable_t read 
)

Definition at line 458 of file ICM_20948_C.c.

References AGB0_REG_INT_ENABLE, AGB0_REG_INT_ENABLE_1, AGB0_REG_INT_ENABLE_2, AGB0_REG_INT_ENABLE_3, ICM_20948_INT_enable_t::DMP_INT1_EN, ICM_20948_INT_ENABLE_t::DMP_INT1_EN, ICM_20948_INT_enable_t::FIFO_OVERFLOW_EN_0, ICM_20948_INT_ENABLE_2_t::FIFO_OVERFLOW_EN_0, ICM_20948_INT_enable_t::FIFO_OVERFLOW_EN_1, ICM_20948_INT_ENABLE_2_t::FIFO_OVERFLOW_EN_1, ICM_20948_INT_enable_t::FIFO_OVERFLOW_EN_2, ICM_20948_INT_ENABLE_2_t::FIFO_OVERFLOW_EN_2, ICM_20948_INT_enable_t::FIFO_OVERFLOW_EN_3, ICM_20948_INT_ENABLE_2_t::FIFO_OVERFLOW_EN_3, ICM_20948_INT_enable_t::FIFO_OVERFLOW_EN_4, ICM_20948_INT_ENABLE_2_t::FIFO_OVERFLOW_EN_4, ICM_20948_INT_enable_t::FIFO_WM_EN_0, ICM_20948_INT_ENABLE_3_t::FIFO_WM_EN_0, ICM_20948_INT_enable_t::FIFO_WM_EN_1, ICM_20948_INT_ENABLE_3_t::FIFO_WM_EN_1, ICM_20948_INT_enable_t::FIFO_WM_EN_2, ICM_20948_INT_ENABLE_3_t::FIFO_WM_EN_2, ICM_20948_INT_enable_t::FIFO_WM_EN_3, ICM_20948_INT_ENABLE_3_t::FIFO_WM_EN_3, ICM_20948_INT_enable_t::FIFO_WM_EN_4, ICM_20948_INT_ENABLE_3_t::FIFO_WM_EN_4, ICM_20948_INT_enable_t::I2C_MST_INT_EN, ICM_20948_INT_ENABLE_t::I2C_MST_INT_EN, ICM_20948_execute_r(), ICM_20948_execute_w(), ICM_20948_set_bank(), ICM_20948_Stat_Ok, ICM_20948_INT_ENABLE_2_t::individual, ICM_20948_INT_ENABLE_3_t::individual, ICM_20948_INT_enable_t::PLL_RDY_EN, ICM_20948_INT_ENABLE_t::PLL_READY_EN, ICM_20948_INT_enable_t::RAW_DATA_0_RDY_EN, ICM_20948_INT_ENABLE_1_t::RAW_DATA_0_RDY_EN, ICM_20948_INT_enable_t::REG_WOF_EN, ICM_20948_INT_ENABLE_t::REG_WOF_EN, ICM_20948_INT_ENABLE_t::reserved_0, ICM_20948_INT_ENABLE_1_t::reserved_0, ICM_20948_INT_ENABLE_2_t::reserved_0, ICM_20948_INT_ENABLE_3_t::reserved_0, ICM_20948_INT_enable_t::WOM_INT_EN, and ICM_20948_INT_ENABLE_t::WOM_INT_EN.

◆ ICM_20948_int_pin_cfg()

◆ ICM_20948_link_serif()

ICM_20948_Status_e ICM_20948_link_serif ( ICM_20948_Device_t pdev,
const ICM_20948_Serif_t s 
)

◆ ICM_20948_low_power()

◆ ICM_20948_read_FIFO()

ICM_20948_Status_e ICM_20948_read_FIFO ( ICM_20948_Device_t pdev,
uint8_t *  data,
uint8_t  len 
)

◆ ICM_20948_reset_DMP()

◆ ICM_20948_reset_FIFO()

◆ ICM_20948_set_bank()

◆ ICM_20948_set_clock_source()

◆ ICM_20948_set_dlpf_cfg()

◆ ICM_20948_set_dmp_start_address()

◆ ICM_20948_set_FIFO_mode()

◆ ICM_20948_set_full_scale()

◆ ICM_20948_set_sample_mode()

◆ ICM_20948_set_sample_rate()

◆ ICM_20948_sleep()

◆ ICM_20948_sw_reset()

◆ ICM_20948_wom_logic()

◆ ICM_20948_wom_threshold()

◆ inv_icm20948_enable_dmp_sensor()

ICM_20948_Status_e inv_icm20948_enable_dmp_sensor ( ICM_20948_Device_t pdev,
enum inv_icm20948_sensor  sensor,
int  state 
)

Definition at line 1734 of file ICM_20948_C.c.

References ICM_20948_Device_t::_dataOutCtl1, ICM_20948_Device_t::_dataOutCtl2, ICM_20948_Device_t::_dataRdyStatus, ICM_20948_Device_t::_dmp_firmware_available, ICM_20948_Device_t::_enabled_Android_0, ICM_20948_Device_t::_enabled_Android_1, ICM_20948_Device_t::_motionEventCtl, ANDROID_SENSOR_NUM_MAX, DATA_OUT_CTL1, DATA_OUT_CTL2, DATA_RDY_STATUS, DMP_Data_Output_Control_1_Accel, DMP_Data_Output_Control_1_Compass, DMP_Data_Output_Control_1_Compass_Calibr, DMP_Data_Output_Control_1_Geomag, DMP_Data_Output_Control_1_Gyro, DMP_Data_Output_Control_1_Gyro_Calibr, DMP_Data_Output_Control_1_Quat9, DMP_Data_Output_Control_1_Step_Detector, DMP_Data_Output_Control_1_Step_Ind_0, DMP_Data_Output_Control_1_Step_Ind_1, DMP_Data_Output_Control_1_Step_Ind_2, DMP_Data_Output_Control_2_Accel_Accuracy, DMP_Data_Output_Control_2_Compass_Accuracy, DMP_Data_Output_Control_2_Gyro_Accuracy, DMP_Data_ready_Accel, DMP_Data_ready_Gyro, DMP_Data_ready_Secondary_Compass, DMP_Motion_Event_Control_9axis, DMP_Motion_Event_Control_Accel_Calibr, DMP_Motion_Event_Control_Compass_Calibr, DMP_Motion_Event_Control_Geomag, DMP_Motion_Event_Control_Gyro_Calibr, DMP_Motion_Event_Control_Pedometer_Interrupt, ICM_20948_low_power(), ICM_20948_sleep(), ICM_20948_Stat_DMPNotSupported, ICM_20948_Stat_Ok, ICM_20948_Stat_SensorNotSupported, inv_androidSensor_to_control_bits, inv_icm20948_write_mems(), INV_NEEDS_ACCEL_MASK, INV_NEEDS_ACCEL_MASK1, INV_NEEDS_COMPASS_MASK, INV_NEEDS_COMPASS_MASK1, INV_NEEDS_GYRO_MASK, INV_NEEDS_GYRO_MASK1, MOTION_EVENT_CTL, and sensor_type_2_android_sensor().

◆ inv_icm20948_enable_dmp_sensor_int()

◆ inv_icm20948_firmware_load()

ICM_20948_Status_e inv_icm20948_firmware_load ( ICM_20948_Device_t pdev,
const unsigned char *  data_start,
unsigned short  size_start,
unsigned short  load_addr 
)

Loads the DMP firmware from SRAM.

Parameters
[in]datapointer where the image
[in]sizesize if the image
[in]load_addraddress to loading the image
Returns
0 in case of success, -1 for any error

Definition at line 1326 of file ICM_20948_C.c.

References ICM_20948_Device_t::_dmp_firmware_available, ICM_20948_Device_t::_firmware_loaded, ICM_20948_low_power(), ICM_20948_sleep(), ICM_20948_Stat_DMPNotSupported, ICM_20948_Stat_DMPVerifyFail, ICM_20948_Stat_Ok, inv_icm20948_read_mems(), inv_icm20948_write_mems(), INV_MAX_SERIAL_READ, INV_MAX_SERIAL_WRITE, and memcmp().

Referenced by ICM_20948_firmware_load().

◆ inv_icm20948_read_dmp_data()

ICM_20948_Status_e inv_icm20948_read_dmp_data ( ICM_20948_Device_t pdev,
icm_20948_DMP_data_t data 
)

Definition at line 1990 of file ICM_20948_C.c.

References ICM_20948_Device_t::_dmp_firmware_available, icm_20948_DMP_data_t::Accel_Accuracy, icm_20948_DMP_data_t::Activity_Recognition, icm_20948_DMP_data_t::ALS, icm_20948_DMP_data_t::Bytes, icm_20948_DMP_data_t::Compass, icm_20948_DMP_data_t::Compass_Accuracy, icm_20948_DMP_data_t::Compass_Calibr, DMP_Activity_Recognition_Byte_Ordering, DMP_header2_bitmap_Accel_Accuracy, DMP_header2_bitmap_Activity_Recog, DMP_header2_bitmap_Compass_Accuracy, DMP_header2_bitmap_Fsync, DMP_header2_bitmap_Gyro_Accuracy, DMP_header2_bitmap_Pickup, DMP_header2_bitmap_Secondary_On_Off, DMP_header_bitmap_Accel, DMP_header_bitmap_ALS, DMP_header_bitmap_Compass, DMP_header_bitmap_Compass_Calibr, DMP_header_bitmap_Geomag, DMP_header_bitmap_Gyro, DMP_header_bitmap_Gyro_Calibr, DMP_header_bitmap_Header2, DMP_header_bitmap_PQuat6, DMP_header_bitmap_Pressure, DMP_header_bitmap_Quat6, DMP_header_bitmap_Quat9, DMP_header_bitmap_Step_Detector, DMP_PQuat6_Byte_Ordering, DMP_Quat6_Byte_Ordering, DMP_Quat9_Byte_Ordering, DMP_Raw_Gyro_Byte_Ordering, DMP_Secondary_On_Off_Byte_Ordering, icm_20948_DMP_data_t::Footer, icm_20948_DMP_data_t::Geomag, icm_20948_DMP_data_t::Gyro_Accuracy, icm_20948_DMP_data_t::header, icm_20948_DMP_data_t::header2, icm_20948_DMP_Accel_Accuracy_Bytes, icm_20948_DMP_Activity_Recognition_Bytes, icm_20948_DMP_ALS_Bytes, icm_20948_DMP_Compass_Accuracy_Bytes, icm_20948_DMP_Compass_Bytes, icm_20948_DMP_Compass_Calibr_Bytes, icm_20948_DMP_Footer_Bytes, icm_20948_DMP_Geomag_Bytes, icm_20948_DMP_Gyro_Accuracy_Bytes, icm_20948_DMP_Gyro_Bias_Bytes, icm_20948_DMP_Header2_Bytes, icm_20948_DMP_Header_Bytes, icm_20948_DMP_Maximum_Bytes, icm_20948_DMP_Pickup_Bytes, icm_20948_DMP_PQuat6_Bytes, icm_20948_DMP_Pressure_Bytes, icm_20948_DMP_Quat6_Bytes, icm_20948_DMP_Quat9_Bytes, icm_20948_DMP_Raw_Accel_Bytes, icm_20948_DMP_Raw_Gyro_Bytes, icm_20948_DMP_Secondary_On_Off_Bytes, icm_20948_DMP_Step_Detector_Bytes, ICM_20948_get_FIFO_count(), ICM_20948_read_FIFO(), ICM_20948_Stat_DMPNotSupported, ICM_20948_Stat_FIFOIncompleteData, ICM_20948_Stat_FIFOMoreDataAvail, ICM_20948_Stat_FIFONoDataAvail, ICM_20948_Stat_Ok, icm_20948_DMP_data_t::Pedometer_Timestamp, icm_20948_DMP_data_t::Pickup, icm_20948_DMP_data_t::PQuat6, icm_20948_DMP_data_t::Pressure, icm_20948_DMP_data_t::Quat6, icm_20948_DMP_data_t::Quat9, icm_20948_DMP_data_t::Raw_Accel, icm_20948_DMP_data_t::Raw_Gyro, and icm_20948_DMP_data_t::Secondary_On_Off.

◆ inv_icm20948_read_mems()

ICM_20948_Status_e inv_icm20948_read_mems ( ICM_20948_Device_t pdev,
unsigned short  reg,
unsigned int  length,
unsigned char *  data 
)

Read data from a register in DMP memory.

Parameters
[in]DMPmemory address
[in]numberof byte to be read
[in]inputdata from the register
Returns
0 if successful.

Definition at line 1549 of file ICM_20948_C.c.

References ICM_20948_Device_t::_last_mems_bank, AGB0_REG_MEM_BANK_SEL, AGB0_REG_MEM_R_W, AGB0_REG_MEM_START_ADDR, ICM_20948_execute_r(), ICM_20948_execute_w(), ICM_20948_set_bank(), ICM_20948_Stat_NoData, ICM_20948_Stat_Ok, and INV_MAX_SERIAL_READ.

Referenced by inv_icm20948_firmware_load().

◆ inv_icm20948_sensor_android_2_sensor_type()

enum inv_icm20948_sensor inv_icm20948_sensor_android_2_sensor_type ( int  sensor)

Definition at line 2523 of file ICM_20948_C.c.

References ANDROID_SENSOR_ACCELEROMETER, ANDROID_SENSOR_ACTIVITY_CLASSIFICATON, ANDROID_SENSOR_B2S, ANDROID_SENSOR_FLIP_PICKUP, ANDROID_SENSOR_GAME_ROTATION_VECTOR, ANDROID_SENSOR_GEOMAGNETIC_FIELD, ANDROID_SENSOR_GEOMAGNETIC_ROTATION_VECTOR, ANDROID_SENSOR_GRAVITY, ANDROID_SENSOR_GYROSCOPE, ANDROID_SENSOR_GYROSCOPE_UNCALIBRATED, ANDROID_SENSOR_LINEAR_ACCELERATION, ANDROID_SENSOR_MAGNETIC_FIELD_UNCALIBRATED, ANDROID_SENSOR_ORIENTATION, ANDROID_SENSOR_RAW_ACCELEROMETER, ANDROID_SENSOR_RAW_GYROSCOPE, ANDROID_SENSOR_ROTATION_VECTOR, ANDROID_SENSOR_STEP_COUNTER, ANDROID_SENSOR_STEP_DETECTOR, ANDROID_SENSOR_WAKEUP_SIGNIFICANT_MOTION, ANDROID_SENSOR_WAKEUP_TILT_DETECTOR, INV_ICM20948_SENSOR_ACCELEROMETER, INV_ICM20948_SENSOR_ACTIVITY_CLASSIFICATON, INV_ICM20948_SENSOR_B2S, INV_ICM20948_SENSOR_FLIP_PICKUP, INV_ICM20948_SENSOR_GAME_ROTATION_VECTOR, INV_ICM20948_SENSOR_GEOMAGNETIC_FIELD, INV_ICM20948_SENSOR_GEOMAGNETIC_ROTATION_VECTOR, INV_ICM20948_SENSOR_GRAVITY, INV_ICM20948_SENSOR_GYROSCOPE, INV_ICM20948_SENSOR_GYROSCOPE_UNCALIBRATED, INV_ICM20948_SENSOR_LINEAR_ACCELERATION, INV_ICM20948_SENSOR_MAGNETIC_FIELD_UNCALIBRATED, INV_ICM20948_SENSOR_MAX, INV_ICM20948_SENSOR_ORIENTATION, INV_ICM20948_SENSOR_RAW_ACCELEROMETER, INV_ICM20948_SENSOR_RAW_GYROSCOPE, INV_ICM20948_SENSOR_ROTATION_VECTOR, INV_ICM20948_SENSOR_STEP_COUNTER, INV_ICM20948_SENSOR_STEP_DETECTOR, INV_ICM20948_SENSOR_WAKEUP_SIGNIFICANT_MOTION, and INV_ICM20948_SENSOR_WAKEUP_TILT_DETECTOR.

◆ inv_icm20948_set_dmp_sensor_period()

◆ inv_icm20948_set_gyro_sf()

◆ inv_icm20948_write_mems()

ICM_20948_Status_e inv_icm20948_write_mems ( ICM_20948_Device_t pdev,
unsigned short  reg,
unsigned int  length,
const unsigned char *  data 
)

Write data to a register in DMP memory.

Parameters
[in]DMPmemory address
[in]numberof byte to be written
[out]outputdata from the register
Returns
0 if successful.

Definition at line 1476 of file ICM_20948_C.c.

References ICM_20948_Device_t::_last_mems_bank, AGB0_REG_MEM_BANK_SEL, AGB0_REG_MEM_R_W, AGB0_REG_MEM_START_ADDR, ICM_20948_execute_w(), ICM_20948_set_bank(), ICM_20948_Stat_NoData, ICM_20948_Stat_Ok, and INV_MAX_SERIAL_WRITE.

Referenced by inv_icm20948_enable_dmp_sensor(), inv_icm20948_enable_dmp_sensor_int(), inv_icm20948_firmware_load(), inv_icm20948_set_dmp_sensor_period(), and inv_icm20948_set_gyro_sf().

◆ memcmp()

int memcmp ( const void *  ,
const void *  ,
size_t   
)
extern

◆ sensor_type_2_android_sensor()

uint8_t sensor_type_2_android_sensor ( enum inv_icm20948_sensor  sensor)

Definition at line 2474 of file ICM_20948_C.c.

References ANDROID_SENSOR_ACCELEROMETER, ANDROID_SENSOR_ACTIVITY_CLASSIFICATON, ANDROID_SENSOR_B2S, ANDROID_SENSOR_FLIP_PICKUP, ANDROID_SENSOR_GAME_ROTATION_VECTOR, ANDROID_SENSOR_GEOMAGNETIC_FIELD, ANDROID_SENSOR_GEOMAGNETIC_ROTATION_VECTOR, ANDROID_SENSOR_GRAVITY, ANDROID_SENSOR_GYROSCOPE, ANDROID_SENSOR_GYROSCOPE_UNCALIBRATED, ANDROID_SENSOR_LINEAR_ACCELERATION, ANDROID_SENSOR_MAGNETIC_FIELD_UNCALIBRATED, ANDROID_SENSOR_NUM_MAX, ANDROID_SENSOR_ORIENTATION, ANDROID_SENSOR_RAW_ACCELEROMETER, ANDROID_SENSOR_RAW_GYROSCOPE, ANDROID_SENSOR_ROTATION_VECTOR, ANDROID_SENSOR_STEP_COUNTER, ANDROID_SENSOR_STEP_DETECTOR, ANDROID_SENSOR_WAKEUP_SIGNIFICANT_MOTION, ANDROID_SENSOR_WAKEUP_TILT_DETECTOR, INV_ICM20948_SENSOR_ACCELEROMETER, INV_ICM20948_SENSOR_ACTIVITY_CLASSIFICATON, INV_ICM20948_SENSOR_B2S, INV_ICM20948_SENSOR_FLIP_PICKUP, INV_ICM20948_SENSOR_GAME_ROTATION_VECTOR, INV_ICM20948_SENSOR_GEOMAGNETIC_FIELD, INV_ICM20948_SENSOR_GEOMAGNETIC_ROTATION_VECTOR, INV_ICM20948_SENSOR_GRAVITY, INV_ICM20948_SENSOR_GYROSCOPE, INV_ICM20948_SENSOR_GYROSCOPE_UNCALIBRATED, INV_ICM20948_SENSOR_LINEAR_ACCELERATION, INV_ICM20948_SENSOR_MAGNETIC_FIELD_UNCALIBRATED, INV_ICM20948_SENSOR_ORIENTATION, INV_ICM20948_SENSOR_RAW_ACCELEROMETER, INV_ICM20948_SENSOR_RAW_GYROSCOPE, INV_ICM20948_SENSOR_ROTATION_VECTOR, INV_ICM20948_SENSOR_STEP_COUNTER, INV_ICM20948_SENSOR_STEP_DETECTOR, INV_ICM20948_SENSOR_WAKEUP_SIGNIFICANT_MOTION, and INV_ICM20948_SENSOR_WAKEUP_TILT_DETECTOR.

Referenced by inv_icm20948_enable_dmp_sensor(), and inv_icm20948_enable_dmp_sensor_int().

Variable Documentation

◆ NullSerif

const ICM_20948_Serif_t NullSerif
extern

Definition at line 116 of file ICM_20948_C.c.