C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
HW_SPI_Master Class Reference

this is a C++ wrapper for the original pico SDK spi master API More...

#include <hw_spi.h>

Inheritance diagram for HW_SPI_Master:
Inheritance graph
Collaboration diagram for HW_SPI_Master:
Collaboration graph

Public Member Functions

 HW_SPI_Master (struct_ConfigMasterSPI master_config)
 Construct a new hw spi master object.
 
virtual int burst_write_8 (uint8_t *src, size_t len)
 send a serie of 8 bit data on the SPI MOSI port
 
virtual int burst_write_16 (uint16_t *src, size_t len)
 send a serie of 16 bit data on the SPI MOSI port
 
virtual int burst_write_read_8 (uint8_t *src, uint8_t *dest, size_t len)
 read / write a serie of 8 bit data on the SPI MISO/MOSI ports
 
int single_write_8 (uint8_t byte_value)
 write a single byte on the SPI MOSI port
 
int single_write_16 (uint16_t word_value)
 write a single 16bit word on the SPI MOSI port
 
int single_read_8 (uint8_t *dest)
 read a single byte on the SPI MISO port
 
int burst_read_8 (uint8_t repeated_tx_data, uint8_t *dest, size_t len)
 read a serie of byte on the SPI MISO port
 
bool device_is_connected (uint8_t slave_address)
 a test that checks if the slave_address device is connected
 

Public Attributes

spi_inst_t * spi
 the spi hardware instance of the Pico that handles the spi master
 

Detailed Description

this is a C++ wrapper for the original pico SDK spi master API

Constructor & Destructor Documentation

◆ HW_SPI_Master()

HW_SPI_Master::HW_SPI_Master ( struct_ConfigMasterSPI master_config)

Construct a new hw spi master object.

Parameters
master_config
Here is the caller graph for this function:

Member Function Documentation

◆ burst_read_8()

int HW_SPI_Master::burst_read_8 ( uint8_t repeated_tx_data,
uint8_t * dest,
size_t len )

read a serie of byte on the SPI MISO port

Parameters
repeated_tx_datathe byte sent on MOSI port during the read transfer
destthe destination that receives the data
lenthe length of the serie
Returns
int

◆ burst_write_16()

int HW_SPI_Master::burst_write_16 ( uint16_t * src,
size_t len )
virtual

send a serie of 16 bit data on the SPI MOSI port

Parameters
srcthe source of the data
lenthe lenght of the serie
Returns
int the number of byte sent

Reimplemented in rtos_HW_SPI_Master.

◆ burst_write_8()

int HW_SPI_Master::burst_write_8 ( uint8_t * src,
size_t len )
virtual

send a serie of 8 bit data on the SPI MOSI port

Parameters
srcthe source of the data
lenthe lenght of the serie
Returns
int the number of byte sent

Reimplemented in rtos_HW_SPI_Master.

◆ burst_write_read_8()

int HW_SPI_Master::burst_write_read_8 ( uint8_t * src,
uint8_t * dest,
size_t len )
virtual

read / write a serie of 8 bit data on the SPI MISO/MOSI ports

Parameters
srcthe source of the data
destthe destination of the data
lenthe length of the serie
Returns
int

Reimplemented in rtos_HW_SPI_Master.

◆ device_is_connected()

bool HW_SPI_Master::device_is_connected ( uint8_t slave_address)

a test that checks if the slave_address device is connected

Parameters
slave_address
Returns
true
false

◆ single_read_8()

int HW_SPI_Master::single_read_8 ( uint8_t * dest)

read a single byte on the SPI MISO port

Parameters
destthe destination that receives the data
Returns
int

◆ single_write_16()

int HW_SPI_Master::single_write_16 ( uint16_t word_value)

write a single 16bit word on the SPI MOSI port

Parameters
word_value
Returns
int

◆ single_write_8()

int HW_SPI_Master::single_write_8 ( uint8_t byte_value)

write a single byte on the SPI MOSI port

Parameters
byte_value
Returns
int

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