| ICM42370P eMD Driver 2.2.7 Documentation of the eMD Driver API

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

Files | Classes | Macros | Typedefs | Functions
Transport

Abstraction layer to access device's registers. More...

## Files
file | inv_imu_transport.h

## Classes
struct | inv_imu_serif
| Serial interface definition. More...
struct | inv_imu_transport
| Transport interface definition. 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 uint32_t | SERIAL_IF_TYPE_t
| Serif type definition. More...

## Functions
int | inv_imu_init_transport (struct inv_imu_device *s)
| Init cache variable. More...
int | inv_imu_read_reg (struct inv_imu_device *s, uint32_t reg, uint32_t len, uint8_t *buf)
| Reads data from a register on IMU. More...
int | inv_imu_write_reg (struct inv_imu_device *s, uint32_t reg, uint32_t len, const uint8_t *buf)
| Writes data to a register on IMU. More...
int | inv_imu_switch_on_mclk (struct inv_imu_device *s)
| Enable MCLK. More...
int | inv_imu_switch_off_mclk (struct inv_imu_device *s)
| Disable MCLK. More...

## Detailed Description

Abstraction layer to access device's registers.

## 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

## ◆ SERIAL_IF_TYPE_t

typedef uint32_t SERIAL_IF_TYPE_t

Serif type definition.

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

## Function Documentation

## ◆ inv_imu_init_transport()

int inv_imu_init_transport | ( | struct inv_imu_device * | s | ) |

Init cache variable.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_read_reg()

int inv_imu_read_reg | ( | struct inv_imu_device * | s,
|  | uint32_t | reg,
|  | uint32_t | len,
|  | uint8_t * | buf
| ) |  |

Reads data from a register on IMU.

Parameters

  [in] | s | Pointer to device.
  [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_switch_off_mclk()

int inv_imu_switch_off_mclk | ( | struct inv_imu_device * | s | ) |

Disable MCLK.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_switch_on_mclk()

int inv_imu_switch_on_mclk | ( | struct inv_imu_device * | s | ) |

Enable MCLK.

Parameters

  [in] | s | Pointer to device.

Returns
  0 on success, negative value on error.

## ◆ inv_imu_write_reg()

int inv_imu_write_reg | ( | struct inv_imu_device * | s,
|  | uint32_t | reg,
|  | uint32_t | len,
|  | const uint8_t * | buf
| ) |  |

Writes data to a register on IMU.

Parameters

  [in] | s | Pointer to device.
  [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.