| ICM45605 eMD driver Documentation of the eMD Driver API

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

- File List
- File Members

inv_imu_transport.h
Go to the documentation of this file.
1 /*
2 *
3 * Copyright (c) [2020] by InvenSense, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 *
16 */
17
25 #ifndef _INV_IMU_TRANSPORT_H_
26 #define _INV_IMU_TRANSPORT_H_
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #include <stdint.h>
33
40 typedef int (*inv_imu_read_reg_t)(uint8_t reg, uint8_t *buf, uint32_t len);
41
48 typedef int (*inv_imu_write_reg_t)(uint8_t reg, const uint8_t *buf, uint32_t len);
49
50 /* Available serial interface type. */
51 #define UI_I2C 0
52 #define UI_SPI4 1
53 #define UI_SPI3 2
59 typedef uint32_t inv_imu_serif_type_t;
60
62 typedef struct {
63 /* Serial interface variables (should be initialized by application) */
64 inv_imu_read_reg_t read_reg;
65 inv_imu_write_reg_t write_reg;
66 uint32_t serif_type;
71 void (*sleep_us)(uint32_t us);
72 } inv_imu_transport_t;
73
81 int inv_imu_read_reg(void *t, uint32_t reg, uint32_t len, uint8_t *buf);
82
90 int inv_imu_write_reg(void *t, uint32_t reg, uint32_t len, const uint8_t *buf);
91
99 int inv_imu_read_sram(void *t, uint32_t addr, uint32_t len, uint8_t *buf);
100
108 int inv_imu_write_sram(void *t, uint32_t addr, uint32_t len, const uint8_t *buf);
109
110 #ifdef __cplusplus
111 }
112 #endif
113
114 #endif /* _INV_IMU_TRANSPORT_H_ */
115
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.
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.
inv_imu_serif_type_t
uint32_t inv_imu_serif_type_t
Serif type definition.
Definition: inv_imu_transport.h:59
inv_imu_write_reg_t
int(* inv_imu_write_reg_t)(uint8_t reg, const uint8_t *buf, uint32_t len)
Function pointer to write register(s).
Definition: inv_imu_transport.h:48
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.
inv_imu_read_reg_t
int(* inv_imu_read_reg_t)(uint8_t reg, uint8_t *buf, uint32_t len)
Function pointer to read register(s).
Definition: inv_imu_transport.h:40
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.
inv_imu_transport_t
Structure dedicated to transport layer transport interface.
Definition: inv_imu_transport.h:62
inv_imu_transport_t::serif_type
uint32_t serif_type
Serial interface type.
Definition: inv_imu_transport.h:66
inv_imu_transport_t::read_reg
inv_imu_read_reg_t read_reg
Function pointer to read register(s).
Definition: inv_imu_transport.h:64
inv_imu_transport_t::write_reg
inv_imu_write_reg_t write_reg
Function pointer to write register(s).
Definition: inv_imu_transport.h:65