DevLab_ICM20948 1.0.2 ICM-20948 9-Axis Motion Sensor Driver

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
I2C_Interface Class Reference

`#include <7Semi_I2C_Interface.h>`

Inheritance diagram for I2C_Interface:
[legend]
Collaboration diagram for I2C_Interface:
[legend]

## Public Member Functions
bool | beginI2C (uint8_t addr, TwoWire &wire, uint32_t speed, uint8_t sda=255, uint8_t scl=255)
int8_t | read (uint8_t reg, uint8_t *data, uint32_t len) override
bool | beginSPI (uint8_t, SPIClass &, uint32_t, uint8_t, uint8_t, uint8_t) override
int8_t | write (uint8_t reg, const uint8_t *data, uint32_t len) override
Public Member Functions inherited from Interface_7Semi
virtual | ~Interface_7Semi ()

## Public Attributes
TwoWire * | i2c = nullptr
uint8_t | address = 0

## Additional Inherited Members
Static Protected Member Functions inherited from Interface_7Semi
static void | delay_us (uint32_t us)

## Detailed Description

Definition at line 5 of file 7Semi_I2C_Interface.h.

## Member Function Documentation

## ◆ beginI2C()

bool I2C_Interface::beginI2C | ( | uint8_t | address,
|  | TwoWire & | wire,
|  | uint32_t | speed,
|  | uint8_t | sda = `255`,
|  | uint8_t | scl = `255`
| ) |  |
| inline virtual

beginI2C()

- Initializes I2C peripheral
- Configures SDA / SCL pins if supported
- Sets communication clock

Returns:

- true → Initialization successful
- false → Initialization failed

Implements Interface_7Semi.

Definition at line 11 of file 7Semi_I2C_Interface.h.

Here is the caller graph for this function:

## ◆ beginSPI()

bool I2C_Interface::beginSPI | ( | uint8_t | ,
|  | SPIClass & | ,
|  | uint32_t | ,
|  | uint8_t | ,
|  | uint8_t | ,
|  | uint8_t |
| ) |  |
| inline override virtual

Implements Interface_7Semi.

Definition at line 69 of file 7Semi_I2C_Interface.h.

## ◆ read()

int8_t I2C_Interface::read | ( | uint8_t | reg,
|  | uint8_t * | data,
|  | uint32_t | len
| ) |  |
| inline override virtual

read()

- Reads data from device register

Parameters:

- reg : Register address
- data : Output buffer
- len : Number of bytes

Returns:

- 0 → Success
- <0 → Error

Implements Interface_7Semi.

Definition at line 32 of file 7Semi_I2C_Interface.h.

## ◆ write()

int8_t I2C_Interface::write | ( | uint8_t | reg,
|  | const uint8_t * | data,
|  | uint32_t | len
| ) |  |
| inline override virtual

write()

- Writes data to device register

Returns:

- 0 → Success
- <0 → Error

Implements Interface_7Semi.

Definition at line 75 of file 7Semi_I2C_Interface.h.

## Member Data Documentation

## ◆ address

uint8_t I2C_Interface::address = 0

Definition at line 9 of file 7Semi_I2C_Interface.h.

## ◆ i2c

TwoWire* I2C_Interface::i2c = nullptr

Definition at line 8 of file 7Semi_I2C_Interface.h.

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

- src/7Semi_I2C_Interface.h