| ICM45686 eMD driver Documentation of the eMD Driver API

- Main Page
- Related Pages
- Modules
- Classes
- Files

Files | Classes | Macros | Typedefs | Functions
Transport

Abstraction layer to communicate with device. More...

## Files
file | inv_imu_transport.h

## Classes
struct | inv_imu_transport_t
| Structure dedicated to transport layer transport interface. More...

## Macros
#define | UI_I2C 0
| identifies I2C interface. More...
#define | UI_SPI4 1
| identifies 4-wire SPI interface. More...
#define | UI_SPI3 2
| identifies 3-wire SPI interface. More...

## Typedefs
typedef int(* | inv_imu_read_reg_t) (uint8_t reg, uint8_t *buf, uint32_t len)
| Function pointer to read register(s). More...
typedef int(* | inv_imu_write_reg_t) (uint8_t reg, const uint8_t *buf, uint32_t len)
| Function pointer to write register(s). More...
typedef uint32_t | inv_imu_serif_type_t
| Serif type definition. More...

## Functions
int | inv_imu_read_reg (void *t, uint32_t reg, uint32_t len, uint8_t *buf)
| Reads data from a register on IMU. More...
int | inv_imu_write_reg (void *t, uint32_t reg, uint32_t len, const uint8_t *buf)
| Writes data to a register on IMU. More...
int | inv_imu_read_sram (void *t, uint32_t addr, uint32_t len, uint8_t *buf)
| Reads data from SRAM on IMU. More...
int | inv_imu_write_sram (void *t, uint32_t addr, uint32_t len, const uint8_t *buf)
| Writes data to SRAM on IMU. More...

## Detailed Description

Abstraction layer to communicate with device.

## Macro Definition Documentation

## ◆ UI_I2C

#define UI_I2C 0

identifies I2C interface.

## ◆ UI_SPI3

#define UI_SPI3 2

identifies 3-wire SPI interface.

## ◆ UI_SPI4

#define UI_SPI4 1

identifies 4-wire SPI interface.

## Typedef Documentation

## ◆ inv_imu_read_reg_t

typedef int(* inv_imu_read_reg_t) (uint8_t reg, uint8_t *buf, uint32_t len)

Function pointer to read register(s).

Parameters

  [in] | reg | Register address to be read.
  [out] | buf | Output data from the register.
  [in] | len | Number of byte to be read.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_serif_type_t

typedef uint32_t inv_imu_serif_type_t

Serif type definition.

Deprecated:
  Kept for retrocompatibility. Replaced with `uint32_t` type in `inv_imu_transport_t` struct.

## ◆ inv_imu_write_reg_t

typedef int(* inv_imu_write_reg_t) (uint8_t reg, const uint8_t *buf, uint32_t len)

Function pointer to write register(s).

Parameters

  [in] | reg | Register address to be written.
  [in] | buf | Input data to write.
  [in] | len | Number of byte to be written.

Returns
  0 on success, negative value on error.

## Function Documentation

## ◆ inv_imu_read_reg()

int inv_imu_read_reg | ( | void * | t,
|  | uint32_t | reg,
|  | uint32_t | len,
|  | uint8_t * | buf
| ) |  |

Reads data from a register on IMU.

Parameters

  [in] | t | Pointer to transport (as void * so it can be called from any module).
  [in] | reg | Register address to be read.
  [in] | len | Number of byte to be read.
  [out] | buf | Output data from the register.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_read_sram()

int inv_imu_read_sram | ( | void * | t,
|  | uint32_t | addr,
|  | uint32_t | len,
|  | uint8_t * | buf
| ) |  |

Reads data from SRAM on IMU.

Parameters

  [in] | t | Pointer to transport (as void * so it can be called from any module).
  [in] | addr | Address to be read.
  [in] | len | Number of byte to be read.
  [out] | buf | Output data from the register.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_write_reg()

int inv_imu_write_reg | ( | void * | t,
|  | uint32_t | reg,
|  | uint32_t | len,
|  | const uint8_t * | buf
| ) |  |

Writes data to a register on IMU.

Parameters

  [in] | t | Pointer to transport (as void * so it can be called from any module).
  [in] | reg | Register address to be written.
  [in] | len | Number of byte to be written.
  [in] | buf | Input data to write.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_write_sram()

int inv_imu_write_sram | ( | void * | t,
|  | uint32_t | addr,
|  | uint32_t | len,
|  | const uint8_t * | buf
| ) |  |

Writes data to SRAM on IMU.

Parameters

  [in] | t | Pointer to transport (as void * so it can be called from any module).
  [in] | addr | Address to be written.
  [in] | len | Number of byte to be written.
  [in] | buf | Input data to write.

Returns
  0 on success, negative value on error.