ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
SPI functions

Functions for using SPI bus. More...

Files

file  ruuvi_interface_spi_bme280.h
 SPI read/write functions for Bosch BME280.
 
file  ruuvi_interface_spi_dps310.h
 SPI read/write functions for Infineon DPS310.
 

Functions

int8_t ri_spi_bme280_write (uint8_t dev_id, uint8_t reg_addr, uint8_t *p_reg_data, uint16_t len)
 SPI write function for BME280. More...
 
int8_t ri_spi_bme280_read (uint8_t dev_id, uint8_t reg_addr, uint8_t *p_reg_data, uint16_t len)
 SPI Read function for BME280. More...
 
uint32_t ri_spi_dps310_write (const void *const comm_ctx, const uint8_t reg_addr, const uint8_t *const p_reg_data, const uint8_t data_len)
 SPI write function for DPS310. More...
 
uint32_t ri_spi_dps310_read (const void *const comm_ctx, const uint8_t reg_addr, uint8_t *const p_reg_data, const uint8_t data_len)
 SPI Read function for DPS310. More...
 

Detailed Description

Functions for using SPI bus.

Function Documentation

◆ ri_spi_bme280_read()

int8_t ri_spi_bme280_read ( uint8_t  dev_id,
uint8_t  reg_addr,
uint8_t *  p_reg_data,
uint16_t  len 
)

SPI Read function for BME280.

Binds Ruuvi Interface SPI functions into official Bosch BME280 driver. Handles GPIO chip select, there is no forced delay to let th CS settle.

Parameters
[in]dev_idSPI functions interface handle, i.e. pin number of the chip select pin of BME280.
[in]reg_addrBME280 register address to read.
[in]p_reg_datapointer to data to be received.
[in]lenlength of data to be received.

Definition at line 40 of file ruuvi_interface_spi_bme280.c.

◆ ri_spi_bme280_write()

int8_t ri_spi_bme280_write ( uint8_t  dev_id,
uint8_t  reg_addr,
uint8_t *  p_reg_data,
uint16_t  len 
)

SPI write function for BME280.

Binds Ruuvi Interface SPI functions into official Bosch BME280 driver. Handles GPIO chip select, there is no forced delay to let th CS settle.

Parameters
[in]dev_idSPI functions interface handle, i.e. pin number of the chip select pin of BME280.
[in]reg_addrBME280 register address to write.
[in]p_reg_datapointer to data to be written.
[in]lenlength of data to be written.

Definition at line 27 of file ruuvi_interface_spi_bme280.c.

◆ ri_spi_dps310_read()

uint32_t ri_spi_dps310_read ( const void *const  comm_ctx,
const uint8_t  reg_addr,
uint8_t *const  p_reg_data,
const uint8_t  data_len 
)

SPI Read function for DPS310.

Binds Ruuvi Interface SPI functions into Ruuvi DPS310 driver. Handles GPIO chip select, there is no forced delay to let the CS settle.

Parameters
[in]comm_ctxSPI functions interface handle, i.e. pin number of the chip select pin of DPS310.
[in]reg_addrDPS310 register address to read.
[in]p_reg_datapointer to data to be received.
[in]data_lenlength of data to be received.
Return values
0on Success.
Returns
Error code from SPI implementation on error.

◆ ri_spi_dps310_write()

uint32_t ri_spi_dps310_write ( const void *const  comm_ctx,
const uint8_t  reg_addr,
const uint8_t *const  p_reg_data,
const uint8_t  data_len 
)

SPI write function for DPS310.

Binds Ruuvi Interface SPI functions into Ruuvi's DPS310 driver. Handles GPIO chip select, there is no forced delay to let the CS settle.

Parameters
[in]comm_ctxSPI functions interface handle, i.e. pin number of the chip select pin of DPS310.
[in]reg_addrDPS310 register address to write.
[in]p_reg_datapointer to data to be written.
[in]data_lenlength of data to be written.
Return values
0on Success.
Returns
Error code from SPI implementation on error.