SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::lib::bsp::spi Class Referenceabstract

SPI device abstraction. More...

#include <spi.hpp>

Inheritance diagram for satnogs::comms::lib::bsp::spi:
satnogs::comms::spi_bsp satnogs::comms::spi_manual_cs_bsp

Public Member Functions

 spi ()
 Construct a new SPI object.
 ~spi ()
virtual void read (uint8_t *rx, const uint8_t *tx, size_t tx_len, size_t rx_len)=0
 Performs an SPI read operation.
virtual void write (const uint8_t *tx, size_t len)=0
 Performs an SPI write operation.
virtual gpiocs ()
 Returns a GPIO control handle for the CS of the SPI. If this is performed automatically by the hardware, users does not have to provide an implementation for this method, as it returns an object of dummy_gpio class, which has no effect.

Detailed Description

SPI device abstraction.

This class provides a generic SPI communication abstraction.

Warning
Depending on the target platform/RTOS users are expected to define a class that inherits this one and implement at least the pure virtual methods

Definition at line 40 of file spi.hpp.

Constructor & Destructor Documentation

◆ spi()

satnogs::comms::lib::bsp::spi::spi ( )
inline

Construct a new SPI object.

Definition at line 47 of file spi.hpp.

◆ ~spi()

satnogs::comms::lib::bsp::spi::~spi ( )
inline

Definition at line 48 of file spi.hpp.

Member Function Documentation

◆ cs()

virtual gpio & satnogs::comms::lib::bsp::spi::cs ( )
inlinevirtual

Returns a GPIO control handle for the CS of the SPI. If this is performed automatically by the hardware, users does not have to provide an implementation for this method, as it returns an object of dummy_gpio class, which has no effect.

Returns
gpio&

Reimplemented in satnogs::comms::spi_manual_cs_bsp.

Definition at line 79 of file spi.hpp.

◆ read()

virtual void satnogs::comms::lib::bsp::spi::read ( uint8_t * rx,
const uint8_t * tx,
size_t tx_len,
size_t rx_len )
pure virtual

Performs an SPI read operation.

Parameters
rxthe receive buffer. Should be at least len bytes in size
txthe transmit buffer. Should be at least len bytes in size
tx_lennumber of bytes to be transmitted
rx_lennumber of bytes to be received

Implemented in satnogs::comms::spi_bsp.

◆ write()

virtual void satnogs::comms::lib::bsp::spi::write ( const uint8_t * tx,
size_t len )
pure virtual

Performs an SPI write operation.

Parameters
txthe transmit buffer. Should be at least len bytes in size
lennumber of bytes to be transmitted

Implemented in satnogs::comms::spi_bsp.


The documentation for this class was generated from the following file:
  • libsatnogs-comms/include/satnogs-comms-lib/bsp/spi.hpp