mbed-drivers
Public Member Functions | List of all members
mbed::SPI::SPITransferAdder Class Reference

Public Member Functions

SPITransferAddertx (void *txBuf, size_t txSize)
 
SPITransferAdderrx (void *rxBuf, size_t rxSize)
 
SPITransferAddercallback (const event_callback_t &cb, int event)
 
int apply ()
 

Member Function Documentation

int mbed::SPI::SPITransferAdder::apply ( )

Initiate the transfer apply() allows the user to explicitly activate the transfer and obtain the return code from the validation of the transfer parameters.

Returns
Zero if the transfer has started, or -1 if SPI peripheral is busy
SPI::SPITransferAdder & mbed::SPI::SPITransferAdder::callback ( const event_callback_t cb,
int  event 
)

Set the SPI Event callback Sets the callback to invoke when an event occurs and the mask of which events should trigger it. The callback will be scheduled to execute in main context, not invoked in interrupt context.

NOTE: Repeated calls to callback() override callback parameters.

Parameters
[in]cbThe event callback function
[in]eventThe logical OR of SPI events to modify. Look at spi hal header file for SPI events.
Returns
a reference to the SPITransferAdder
SPI::SPITransferAdder & mbed::SPI::SPITransferAdder::rx ( void *  rxBuf,
size_t  rxSize 
)

Set the receive buffer Sets the receive buffer pointer and receive size

NOTE: Repeated calls to rx() override buffer parameters.

Parameters
[in]rxBufa pointer to the receive buffer
[in]rxSizethe size of the receive buffer
Returns
a reference to the SPITransferAdder
SPI::SPITransferAdder & mbed::SPI::SPITransferAdder::tx ( void *  txBuf,
size_t  txSize 
)

Set the transmit buffer Sets the transmit buffer pointer and transmit size.

NOTE: Repeated calls to tx() override buffer parameters.

Parameters
[in]txBufa pointer to the transmit buffer
[in]txSizethe size of the transmit buffer
Returns
a reference to the SPITransferAdder

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