nrfxlib API 3.3.99
Loading...
Searching...
No Matches

◆ p_xfer_write_async

int32_t(* mpsl_fem_twi_if_t::p_xfer_write_async) (void *p_instance, uint8_t slave_address, const uint8_t *p_data, uint8_t data_length, mpsl_fem_twi_async_xfer_write_cb_t p_callback, void *p_context)

Pointer to a function starting an asynchronous write transfer on a TWI bus.

This function may be called only when exclusive access to the TWI bus is granted. This must be ensured externally.

The function pointed by this pointer may be called from any interrupt priority, including those related to MPSL timeslot signalling.

Parameters
p_instancePointer to object representing TWI instance. The value of p_instance field is put here. The meaning is fully up to the implementation of the function.
slave_addressAddress of the slave device on TWI bus.
p_dataPointer to a buffer containing data to be written. In case of successful call the caller is responsible for holding the buffer pointed by p_data until p_callback is called.
data_lengthLength of buffer pointed by p_data. The number of bytes to write.
p_callbackPointer to a callback function that will be called when the TWI transfer is finished. This callback informs about the result of the operation. It is called from an ISR of the TWI peripheral.
p_contextPointer to a context that the p_callback will be notified with.
Return values
0In case of success. The TWI transfer is being performed. It will end with a call to p_callback
otherFailure of TWI transfer initialization. The p_callback will not be called.