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
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] | cb | The event callback function |
[in] | event | The logical OR of SPI events to modify. Look at spi hal header file for SPI events. |
- Returns
- a reference to the SPITransferAdder
Set the receive buffer Sets the receive buffer pointer and receive size
NOTE: Repeated calls to rx() override buffer parameters.
- Parameters
-
[in] | rxBuf | a pointer to the receive buffer |
[in] | rxSize | the size of the receive buffer |
- Returns
- a reference to the SPITransferAdder
Set the transmit buffer Sets the transmit buffer pointer and transmit size.
NOTE: Repeated calls to tx() override buffer parameters.
- Parameters
-
[in] | txBuf | a pointer to the transmit buffer |
[in] | txSize | the size of the transmit buffer |
- Returns
- a reference to the SPITransferAdder
The documentation for this class was generated from the following files:
- mbed-drivers/SPI.h
- source/SPI.cpp