pub type otPlatSpiSlaveTransactionCompleteCallback = Option<unsafe extern "C" fn(aContext: *mut c_void, aOutputBuf: *mut u8, aOutputBufLen: u16, aInputBuf: *mut u8, aInputBufLen: u16, aTransactionLength: u16) -> bool>;
Expand description

Indicates that a SPI transaction has completed with the given length. The data written to the slave has been written to the pointer indicated by the aInputBuf argument to the previous call to otPlatSpiSlavePrepareTransaction().

Once this function is called, otPlatSpiSlavePrepareTransaction() is invalid and must be called again for the next transaction to be valid.

Note that this function is always called at the end of a transaction, even if otPlatSpiSlavePrepareTransaction() has not yet been called. In such cases, aOutputBufLen and aInputBufLen will be zero.

This callback can be called from ISR context. The return value from this function indicates if any further processing is required. If TRUE is returned the platform spi-slave driver implementation must invoke the transaction process callback (aProcessCallback set in otPlatSpiSlaveEnable()) which unlike this callback must be called from the same OS context that any other OpenThread API/callback is called.

@param[in] aContext Context pointer passed into otPlatSpiSlaveEnable(). @param[in] aOutputBuf Value of aOutputBuf from last call to otPlatSpiSlavePrepareTransaction(). @param[in] aOutputBufLen Value of aOutputBufLen from last call to otPlatSpiSlavePrepareTransaction(). @param[in] aInputBuf Value of aInputBuf from last call to otPlatSpiSlavePrepareTransaction(). @param[in] aInputBufLen Value of aInputBufLen from last call to otPlatSpiSlavePrepareTransaction() @param[in] aTransactionLength Length of the completed transaction, in bytes.

@returns TRUE if after this call returns the platform should invoke the process callback aProcessCallback, FALSE if there is nothing to process and no need to invoke the process callback.

Aliased Type§

enum otPlatSpiSlaveTransactionCompleteCallback {
    None,
    Some(unsafe extern "C" fn(_: *mut c_void, _: *mut u8, _: u16, _: *mut u8, _: u16, _: u16) -> bool),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: *mut c_void, _: *mut u8, _: u16, _: *mut u8, _: u16, _: u16) -> bool)

Some value of type T.