[−][src]Function mynewt::hw::hal::hal_spi_set_txrx_cb
pub unsafe extern "C" fn hal_spi_set_txrx_cb(
spi_num: c_int,
txrx_cb: hal_spi_txrx_cb,
arg: *mut c_void
) -> c_int
Sets the txrx callback (executed at interrupt context) when the buffer is transferred by the master or the slave using the non-blocking API. Cannot be called when the spi is enabled. This callback will also be called when chip select is de-asserted on the slave.
NOTE: This callback is only used for the non-blocking interface and must be called prior to using the non-blocking API.
spi_num
: SPI interface on which to set callbacktxrx
: Callback functionarg
: Argument to be passed to callback function
Return: int 0 on success, non-zero error code on failure.