DevLab_ICM20948 1.0.0 Driver para sensor ICM-20948

Loading...
Searching...
No Matches
Interface_7Semi Class Referenceabstract

`#include <7Semi_Interface.h>`

Inheritance diagram for Interface_7Semi:
[legend]

## Public Member Functions
virtual | ~Interface_7Semi ()
virtual bool | beginI2C (uint8_t address, TwoWire &wire, uint32_t speed, uint8_t sda=255, uint8_t scl=255)=0
virtual bool | beginSPI (uint8_t cs_pin, SPIClass &wire, uint32_t speed, uint8_t csk=255, uint8_t miso=255, uint8_t mosi=255)=0
virtual int8_t | read (uint8_t reg, uint8_t *data, uint32_t len)=0
virtual int8_t | write (uint8_t reg, const uint8_t *data, uint32_t len)=0

## Static Protected Member Functions
static void | delay_us (uint32_t us)

## Detailed Description

7Semi Universal Interface Layer

- Abstract communication layer for I2C / SPI
- Ensures sensor drivers remain hardware independent

Definition at line 15 of file 7Semi_Interface.h.

## Constructor & Destructor Documentation

## ◆ ~Interface_7Semi()

virtual Interface_7Semi::~Interface_7Semi | ( |  | ) |
| inline virtual

Definition at line 18 of file 7Semi_Interface.h.

## Member Function Documentation

## ◆ beginI2C()

virtual bool Interface_7Semi::beginI2C | ( | uint8_t | address,
|  | TwoWire & | wire,
|  | uint32_t | speed,
|  | uint8_t | sda = 255,
|  | uint8_t | scl = 255 )
| pure virtual

beginI2C()

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

Returns:

- true → Initialization successful
- false → Initialization failed

Implemented in I2C_Interface, and SPI_Interface.

## ◆ beginSPI()

virtual bool Interface_7Semi::beginSPI | ( | uint8_t | cs_pin,
|  | SPIClass & | wire,
|  | uint32_t | speed,
|  | uint8_t | csk = 255,
|  | uint8_t | miso = 255,
|  | uint8_t | mosi = 255 )
| pure virtual

Implemented in I2C_Interface, and SPI_Interface.

## ◆ delay_us()

void Interface_7Semi::delay_us | ( | uint32_t | us | ) |
| inline static protected

Delay wrapper

Definition at line 82 of file 7Semi_Interface.h.

## ◆ read()

virtual int8_t Interface_7Semi::read | ( | uint8_t | reg,
|  | uint8_t * | data,
|  | uint32_t | len )
| pure virtual

read()

- Reads data from device register

Parameters:

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

Returns:

- 0 → Success
- <0 → Error

Implemented in I2C_Interface, and SPI_Interface.

## ◆ write()

virtual int8_t Interface_7Semi::write | ( | uint8_t | reg,
|  | const uint8_t * | data,
|  | uint32_t | len )
| pure virtual

write()

- Writes data to device register

Returns:

- 0 → Success
- <0 → Error

Implemented in I2C_Interface, and SPI_Interface.

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

- src/7Semi_Interface.h