DevLab_ICM20948 1.0.0
ICM-20948 9-Axis Motion Sensor Driver
Loading...
Searching...
No Matches
SPI_Interface Class Reference

#include <7Semi_SPI_Interface.h>

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

Public Member Functions

bool beginSPI (uint8_t csPin, SPIClass &spiPort, uint32_t spiSpeed, uint8_t sck=255, uint8_t miso=255, uint8_t mosi=255) override
 
bool beginI2C (uint8_t, TwoWire &, uint32_t, uint8_t, uint8_t) override
 
int8_t read (uint8_t reg, uint8_t *data, uint32_t len) 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

SPIClass * spi = nullptr
 
uint8_t cs = 255
 
uint32_t speed = 1000000
 

Additional Inherited Members

- Static Protected Member Functions inherited from Interface_7Semi
static void delay_us (uint32_t us)
 

Detailed Description

7Semi SPI Interface Implementation

Definition at line 7 of file 7Semi_SPI_Interface.h.

Member Function Documentation

◆ beginI2C()

bool SPI_Interface::beginI2C ( uint8_t  address,
TwoWire &  wire,
uint32_t  speed,
uint8_t  sda,
uint8_t  scl 
)
inlineoverridevirtual

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 51 of file 7Semi_SPI_Interface.h.

◆ beginSPI()

bool SPI_Interface::beginSPI ( uint8_t  csPin,
SPIClass &  spiPort,
uint32_t  spiSpeed,
uint8_t  sck = 255,
uint8_t  miso = 255,
uint8_t  mosi = 255 
)
inlineoverridevirtual

beginSPI()

  • Initialize SPI interface
  • Configure CS and SPI bus

Implements Interface_7Semi.

Definition at line 21 of file 7Semi_SPI_Interface.h.

Here is the caller graph for this function:

◆ read()

int8_t SPI_Interface::read ( uint8_t  reg,
uint8_t *  data,
uint32_t  len 
)
inlineoverridevirtual

read()

  • Read multiple bytes from register

Send register address (read)

Read data

Implements Interface_7Semi.

Definition at line 62 of file 7Semi_SPI_Interface.h.

◆ write()

int8_t SPI_Interface::write ( uint8_t  reg,
const uint8_t *  data,
uint32_t  len 
)
inlineoverridevirtual

write()

  • Write multiple bytes to register

Send register address (write)

Write data

Implements Interface_7Semi.

Definition at line 108 of file 7Semi_SPI_Interface.h.

Member Data Documentation

◆ cs

uint8_t SPI_Interface::cs = 255

Definition at line 12 of file 7Semi_SPI_Interface.h.

◆ speed

uint32_t SPI_Interface::speed = 1000000

Definition at line 13 of file 7Semi_SPI_Interface.h.

◆ spi

SPIClass* SPI_Interface::spi = nullptr

Definition at line 11 of file 7Semi_SPI_Interface.h.


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