| ICM42605 eMD Driver 2.0.9 Documentation of the eMD Driver API

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

- File List
- File Members

Icm426xxTransport.h
Go to the documentation of this file.
1 /*
2 * ________________________________________________________________________________________________________
3 * Copyright (c) 2015-2015 InvenSense Inc. All rights reserved.
4 *
5 * This software, related documentation and any modifications thereto (collectively “Software”) is subject
6 * to InvenSense and its licensors' intellectual property rights under U.S. and international copyright
7 * and other intellectual property rights laws.
8 *
9 * InvenSense and its licensors retain all intellectual property and proprietary rights in and to the Software
10 * and any use, reproduction, disclosure or distribution of the Software without an express license agreement
11 * from InvenSense is strictly prohibited.
12 *
13 * EXCEPT AS OTHERWISE PROVIDED IN A LICENSE AGREEMENT BETWEEN THE PARTIES, THE SOFTWARE IS
14 * PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
15 * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
16 * EXCEPT AS OTHERWISE PROVIDED IN A LICENSE AGREEMENT BETWEEN THE PARTIES, IN NO EVENT SHALL
17 * INVENSENSE BE LIABLE FOR ANY DIRECT, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY
18 * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
19 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THE SOFTWARE.
21 * ________________________________________________________________________________________________________
22 */
23
31 #ifndef _INV_ICM426XX_TRANSPORT_H_
32 #define _INV_ICM426XX_TRANSPORT_H_
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #include <stdint.h>
39
40 /* forward declaration */
41 struct inv_icm426xx;
42
43 /* Available serial interface type. */
44 #define ICM426XX_UI_I2C 0
45 #define ICM426XX_UI_SPI4 1
46 #define ICM426XX_UI_I3C 2
47 #define ICM426XX_AUX1_SPI3 3
48 #define ICM426XX_AUX2_SPI3 4
49 #define ICM426XX_AUX1_SPI4 5
55 typedef uint32_t ICM426XX_SERIAL_IF_TYPE_t;
56
59 struct inv_icm426xx_serif {
60 void *context;
61 int (*read_reg)(struct inv_icm426xx_serif *serif, uint8_t reg, uint8_t *buf, uint32_t len);
62 int (*write_reg)(struct inv_icm426xx_serif *serif, uint8_t reg, const uint8_t *buf,
63 uint32_t len);
64 int (*configure)(struct inv_icm426xx_serif *serif);
65 uint32_t max_read;
66 uint32_t max_write;
67 uint32_t serif_type;
68 };
69
72 struct inv_icm426xx_transport {
73 struct inv_icm426xx_serif
74 serif;
77 struct register_cache {
78 uint8_t intf_cfg_1_reg;
79 uint8_t pwr_mngt_0_reg;
80 uint8_t gyro_cfg_0_reg;
81 uint8_t accel_cfg_0_reg;
82 uint8_t tmst_cfg_reg;
83 uint8_t bank_sel_reg;
84 } register_cache;
90 };
91
95 int inv_icm426xx_init_transport(struct inv_icm426xx *s);
96
104 int inv_icm426xx_read_reg(struct inv_icm426xx *s, uint8_t reg, uint32_t len, uint8_t *buf);
105
113 int inv_icm426xx_write_reg(struct inv_icm426xx *s, uint8_t reg, uint32_t len, const uint8_t *buf);
114
115 #ifdef __cplusplus
116 }
117 #endif
118
119 #endif /* _INV_ICM426XX_TRANSPORT_H_ */
120
inv_icm426xx_read_reg
int inv_icm426xx_read_reg(struct inv_icm426xx *s, uint8_t reg, uint32_t len, uint8_t *buf)
Reads data from a register on Icm426xx.
inv_icm426xx_init_transport
int inv_icm426xx_init_transport(struct inv_icm426xx *s)
Init cache variable.
ICM426XX_SERIAL_IF_TYPE_t
uint32_t ICM426XX_SERIAL_IF_TYPE_t
Serif type definition.
Definition: Icm426xxTransport.h:55
inv_icm426xx_write_reg
int inv_icm426xx_write_reg(struct inv_icm426xx *s, uint8_t reg, uint32_t len, const uint8_t *buf)
Writes data to a register on Icm426xx.
inv_icm426xx
Icm426xx driver states definition.
Definition: Icm426xxDriver_HL.h:171
inv_icm426xx_serif
base sensor serial interface
Definition: Icm426xxTransport.h:59
inv_icm426xx_serif::max_read
uint32_t max_read
Definition: Icm426xxTransport.h:65
inv_icm426xx_serif::configure
int(* configure)(struct inv_icm426xx_serif *serif)
Definition: Icm426xxTransport.h:64
inv_icm426xx_serif::read_reg
int(* read_reg)(struct inv_icm426xx_serif *serif, uint8_t reg, uint8_t *buf, uint32_t len)
Definition: Icm426xxTransport.h:61
inv_icm426xx_serif::max_write
uint32_t max_write
Definition: Icm426xxTransport.h:66
inv_icm426xx_serif::write_reg
int(* write_reg)(struct inv_icm426xx_serif *serif, uint8_t reg, const uint8_t *buf, uint32_t len)
Definition: Icm426xxTransport.h:62
inv_icm426xx_serif::context
void * context
Definition: Icm426xxTransport.h:60
inv_icm426xx_serif::serif_type
uint32_t serif_type
Definition: Icm426xxTransport.h:67
inv_icm426xx_transport
transport interface
Definition: Icm426xxTransport.h:72
inv_icm426xx_transport::register_cache
struct inv_icm426xx_transport::register_cache register_cache
Store mostly used register values on SRAM.
inv_icm426xx_transport::serif
struct inv_icm426xx_serif serif
Warning : this field MUST be the first one of struct inv_icm426xx_transport.
Definition: Icm426xxTransport.h:73
inv_icm426xx_transport::register_cache
Contains mirrored values of some IP registers.
Definition: Icm426xxTransport.h:77
inv_icm426xx_transport::register_cache::bank_sel_reg
uint8_t bank_sel_reg
MPUREG_REG_BANK_SEL, All banks, Address 0x76.
Definition: Icm426xxTransport.h:83
inv_icm426xx_transport::register_cache::intf_cfg_1_reg
uint8_t intf_cfg_1_reg
INTF_CONFIG1, Bank: 0, Address: 0x4D.
Definition: Icm426xxTransport.h:78
inv_icm426xx_transport::register_cache::accel_cfg_0_reg
uint8_t accel_cfg_0_reg
ACCEL_CONFIG0, Bank: 0, Address: 0x50.
Definition: Icm426xxTransport.h:81
inv_icm426xx_transport::register_cache::pwr_mngt_0_reg
uint8_t pwr_mngt_0_reg
PWR_MGMT_0, Bank: 0, Address: 0x4E.
Definition: Icm426xxTransport.h:79
inv_icm426xx_transport::register_cache::gyro_cfg_0_reg
uint8_t gyro_cfg_0_reg
GYRO_CONFIG0, Bank: 0, Address: 0x4F.
Definition: Icm426xxTransport.h:80
inv_icm426xx_transport::register_cache::tmst_cfg_reg
uint8_t tmst_cfg_reg
TMST_CONFIG, Bank: 0, Address: 0x54.
Definition: Icm426xxTransport.h:82