AgIsoStack++
A control-function-focused implementation of the major ISOBUS and J1939 protocols
Loading...
Searching...
No Matches
Public Member Functions | List of all members
isobus::SPIHardwarePlugin Class Referenceabstract

An abstract base class for SPI communication. More...

#include <spi_hardware_plugin.hpp>

Inheritance diagram for isobus::SPIHardwarePlugin:
[legend]

Public Member Functions

virtual void begin_transaction ()
 Begin a transaction on the SPI bus. This should be called before any of the read/write operations.
 
virtual void transmit (SPITransactionFrame *frame)=0
 Write a frame to the SPI bus. This should only be called after begin_transaction(). The result should only be read after end_transaction().
 
virtual bool end_transaction ()=0
 End a transaction on the SPI bus. This must be called after all write operations and before any read operation.
 

Detailed Description

An abstract base class for SPI communication.

Definition at line 26 of file spi_hardware_plugin.hpp.

Member Function Documentation

◆ begin_transaction()

virtual void isobus::SPIHardwarePlugin::begin_transaction ( )
inlinevirtual

Begin a transaction on the SPI bus. This should be called before any of the read/write operations.

Here the SPI bus can be acquired and prepared for a new transaction.

Note
If any error occurs, end_transaction() should return false to mark a failed transaction

Definition at line 32 of file spi_hardware_plugin.hpp.

Here is the caller graph for this function:

◆ end_transaction()

virtual bool isobus::SPIHardwarePlugin::end_transaction ( )
pure virtual

End a transaction on the SPI bus. This must be called after all write operations and before any read operation.

Here the SPI bus will be released and the transaction will be finalized.

Returns
True if the transaction was successful, false otherwise

Implemented in isobus::SPIInterfaceESP.

Here is the caller graph for this function:

◆ transmit()

virtual void isobus::SPIHardwarePlugin::transmit ( SPITransactionFrame * frame)
pure virtual

Write a frame to the SPI bus. This should only be called after begin_transaction(). The result should only be read after end_transaction().

Parameters
frameA pointer to the frame to transmit
Note
If any error occurs, end_transaction() should return false to mark a failed transaction.

Implemented in isobus::SPIInterfaceESP.

Here is the caller graph for this function:

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