DevLab_ICM20948 1.0.2 ICM-20948 9-Axis Motion Sensor Driver

Loading...
Searching...
No Matches
Public Attributes | List of all members
icm_plat_t Struct Reference

`#include <ICM20948_platform.h>`

## Public Attributes
int(* | read )(uint8_t reg, uint8_t *buf, size_t len, void *user)
int(* | write )(uint8_t reg, const uint8_t *buf, size_t len, void *user)
uint8_t(* | spi_reg_rw_bits )(uint8_t reg, int is_write)
void(* | delay_ms )(uint32_t ms)
void * | user
void(* | spi_cs )(int level, void *user)
uint8_t | i2c_addr

## Detailed Description

7Semi comment style

- Platform glue for bus IO, delays, and timing
- Implement these for your system (I2C or SPI)

Definition at line 13 of file ICM20948_platform.h.

## Member Data Documentation

## ◆ delay_ms

void(* icm_plat_t::delay_ms) (uint32_t ms)

- Millisecond delay

Definition at line 32 of file ICM20948_platform.h.

## ◆ i2c_addr

uint8_t icm_plat_t::i2c_addr

- Device address (I2C) or ignored for SPI if you wrap inside user

Definition at line 45 of file ICM20948_platform.h.

## ◆ read

int(* icm_plat_t::read) (uint8_t reg, uint8_t *buf, size_t len, void *user)

- Bus read: read `len` bytes from `reg` into `buf`
- Return 0 on success, nonzero on error

Definition at line 18 of file ICM20948_platform.h.

## ◆ spi_cs

void(* icm_plat_t::spi_cs) (int level, void *user)

- If using SPI: set chip select active (1) or inactive (0)
- For I2C: leave as NULL

Definition at line 41 of file ICM20948_platform.h.

## ◆ spi_reg_rw_bits

uint8_t(* icm_plat_t::spi_reg_rw_bits) (uint8_t reg, int is_write)

- Optional: SPI transfers may need register R/W bit mangling
- For I2C, leave as NULL

Definition at line 28 of file ICM20948_platform.h.

## ◆ user

void* icm_plat_t::user

- User context pointer passed to read/write

Definition at line 36 of file ICM20948_platform.h.

## ◆ write

int(* icm_plat_t::write) (uint8_t reg, const uint8_t *buf, size_t len, void *user)

- Bus write: write `len` bytes from `buf` to `reg`
- Return 0 on success, nonzero on error

Definition at line 23 of file ICM20948_platform.h.

The documentation for this struct was generated from the following file:

- src/ICM20948_platform.h