MCUXpresso SDK API Reference Manual  Rev 2.12.1
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
I3C Slave Driver

Overview

Data Structures

struct  i3c_slave_config_t
 Structure with settings to initialize the I3C slave module. More...
 
struct  i3c_slave_transfer_t
 I3C slave transfer structure. More...
 
struct  i3c_slave_handle_t
 I3C slave handle structure. More...
 

Typedefs

typedef void(* i3c_slave_transfer_callback_t )(I3C_Type *base, i3c_slave_transfer_t *transfer, void *userData)
 Slave event callback function pointer type. More...
 

Enumerations

enum  _i3c_slave_flags {
  kI3C_SlaveNotStopFlag = I3C_SSTATUS_STNOTSTOP_MASK,
  kI3C_SlaveMessageFlag = I3C_SSTATUS_STMSG_MASK,
  kI3C_SlaveRequiredReadFlag = I3C_SSTATUS_STREQRD_MASK,
  kI3C_SlaveRequiredWriteFlag = I3C_SSTATUS_STREQWR_MASK,
  kI3C_SlaveBusDAAFlag = I3C_SSTATUS_STDAA_MASK,
  kI3C_SlaveBusHDRModeFlag = I3C_SSTATUS_STHDR_MASK,
  kI3C_SlaveBusStartFlag = I3C_SSTATUS_START_MASK,
  kI3C_SlaveMatchedFlag = I3C_SSTATUS_MATCHED_MASK,
  kI3C_SlaveBusStopFlag = I3C_SSTATUS_STOP_MASK,
  kI3C_SlaveRxReadyFlag = I3C_SSTATUS_RX_PEND_MASK,
  kI3C_SlaveTxReadyFlag = I3C_SSTATUS_TXNOTFULL_MASK,
  kI3C_SlaveDynamicAddrChangedFlag,
  kI3C_SlaveReceivedCCCFlag = I3C_SSTATUS_CCC_MASK,
  kI3C_SlaveErrorFlag = I3C_SSTATUS_ERRWARN_MASK,
  kI3C_SlaveHDRCommandMatchFlag = I3C_SSTATUS_HDRMATCH_MASK,
  kI3C_SlaveCCCHandledFlag,
  kI3C_SlaveEventSentFlag = I3C_SSTATUS_EVENT_MASK,
  kI3C_SlaveIbiDisableFlag = I3C_SSTATUS_IBIDIS_MASK,
  kI3C_SlaveMasterRequestDisabledFlag = I3C_SSTATUS_MRDIS_MASK,
  kI3C_SlaveHotJoinDisabledFlag = I3C_SSTATUS_HJDIS_MASK,
  kI3C_SlaveClearFlags = kI3C_SlaveBusStartFlag | kI3C_SlaveMatchedFlag | kI3C_SlaveBusStopFlag
}
 I3C slave peripheral flags. More...
 
enum  _i3c_slave_error_flags {
  kI3C_SlaveErrorOverrunFlag = I3C_SERRWARN_ORUN_MASK,
  kI3C_SlaveErrorUnderrunFlag = I3C_SERRWARN_URUN_MASK,
  kI3C_SlaveErrorUnderrunNakFlag,
  kI3C_SlaveErrorTermFlag = I3C_SERRWARN_TERM_MASK,
  kI3C_SlaveErrorInvalidStartFlag = I3C_SERRWARN_INVSTART_MASK,
  kI3C_SlaveErrorSdrParityFlag = I3C_SERRWARN_SPAR_MASK,
  kI3C_SlaveErrorHdrParityFlag = I3C_SERRWARN_HPAR_MASK,
  kI3C_SlaveErrorHdrCRCFlag = I3C_SERRWARN_HCRC_MASK,
  kI3C_SlaveErrorS0S1Flag = I3C_SERRWARN_S0S1_MASK,
  kI3C_SlaveErrorOverreadFlag = I3C_SERRWARN_OREAD_MASK,
  kI3C_SlaveErrorOverwriteFlag = I3C_SERRWARN_OWRITE_MASK
}
 I3C slave error flags to indicate the causes. More...
 
enum  i3c_slave_event_t {
  kI3C_SlaveEventNormal = 0U,
  kI3C_SlaveEventIBI = 1U,
  kI3C_SlaveEventMasterReq = 2U,
  kI3C_SlaveEventHotJoinReq = 3U
}
 I3C slave.event. More...
 
enum  i3c_slave_activity_state_t {
  kI3C_SlaveNoLatency = 0U,
  kI3C_SlaveLatency1Ms = 1U,
  kI3C_SlaveLatency100Ms = 2U,
  kI3C_SlaveLatency10S = 3U
}
 I3C slave.activity state. More...
 
enum  i3c_slave_transfer_event_t {
  kI3C_SlaveAddressMatchEvent = 0x01U,
  kI3C_SlaveTransmitEvent = 0x02U,
  kI3C_SlaveReceiveEvent = 0x04U,
  kI3C_SlaveRequiredTransmitEvent = 0x08U,
  kI3C_SlaveStartEvent = 0x10U,
  kI3C_SlaveHDRCommandMatchEvent = 0x20U,
  kI3C_SlaveCompletionEvent = 0x40U,
  kI3C_SlaveRequestSentEvent = 0x80U,
  kI3C_SlaveReceivedCCCEvent = 0x100L,
  kI3C_SlaveAllEvents
}
 Set of events sent to the callback for non blocking slave transfers. More...
 

Initialization and deinitialization

void I3C_SlaveGetDefaultConfig (i3c_slave_config_t *slaveConfig)
 Provides a default configuration for the I3C slave peripheral. More...
 
void I3C_SlaveInit (I3C_Type *base, const i3c_slave_config_t *slaveConfig, uint32_t slowClock_Hz)
 Initializes the I3C slave peripheral. More...
 
void I3C_SlaveDeinit (I3C_Type *base)
 Deinitializes the I3C slave peripheral. More...
 
static void I3C_SlaveEnable (I3C_Type *base, bool isEnable)
 Enable/Disable Slave. More...
 

Status

static uint32_t I3C_SlaveGetStatusFlags (I3C_Type *base)
 Gets the I3C slave status flags. More...
 
static void I3C_SlaveClearStatusFlags (I3C_Type *base, uint32_t statusMask)
 Clears the I3C slave status flag state. More...
 
static uint32_t I3C_SlaveGetErrorStatusFlags (I3C_Type *base)
 Gets the I3C slave error status flags. More...
 
static void I3C_SlaveClearErrorStatusFlags (I3C_Type *base, uint32_t statusMask)
 Clears the I3C slave error status flag state. More...
 
i3c_slave_activity_state_t I3C_SlaveGetActivityState (I3C_Type *base)
 Gets the I3C slave state. More...
 

Interrupts

static void I3C_SlaveEnableInterrupts (I3C_Type *base, uint32_t interruptMask)
 Enables the I3C slave interrupt requests. More...
 
static void I3C_SlaveDisableInterrupts (I3C_Type *base, uint32_t interruptMask)
 Disables the I3C slave interrupt requests. More...
 
static uint32_t I3C_SlaveGetEnabledInterrupts (I3C_Type *base)
 Returns the set of currently enabled I3C slave interrupt requests. More...
 
static uint32_t I3C_SlaveGetPendingInterrupts (I3C_Type *base)
 Returns the set of pending I3C slave interrupt requests. More...
 

DMA control

static void I3C_SlaveEnableDMA (I3C_Type *base, bool enableTx, bool enableRx, uint32_t width)
 Enables or disables I3C slave DMA requests. More...
 
static uint32_t I3C_SlaveGetTxFifoAddress (I3C_Type *base, uint32_t width)
 Gets I3C slave transmit data register address for DMA transfer. More...
 
static uint32_t I3C_SlaveGetRxFifoAddress (I3C_Type *base, uint32_t width)
 Gets I3C slave receive data register address for DMA transfer. More...
 

FIFO control

static void I3C_SlaveSetWatermarks (I3C_Type *base, i3c_tx_trigger_level_t txLvl, i3c_rx_trigger_level_t rxLvl, bool flushTx, bool flushRx)
 Sets the watermarks for I3C slave FIFOs. More...
 
static void I3C_SlaveGetFifoCounts (I3C_Type *base, size_t *rxCount, size_t *txCount)
 Gets the current number of bytes in the I3C slave FIFOs. More...
 

Bus operations

void I3C_SlaveRequestEvent (I3C_Type *base, i3c_slave_event_t event)
 I3C slave request event. More...
 
status_t I3C_SlaveSend (I3C_Type *base, const void *txBuff, size_t txSize)
 Performs a polling send transfer on the I3C bus. More...
 
status_t I3C_SlaveReceive (I3C_Type *base, void *rxBuff, size_t rxSize)
 Performs a polling receive transfer on the I3C bus. More...
 

Slave non-blocking

void I3C_SlaveTransferCreateHandle (I3C_Type *base, i3c_slave_handle_t *handle, i3c_slave_transfer_callback_t callback, void *userData)
 Creates a new handle for the I3C slave non-blocking APIs. More...
 
status_t I3C_SlaveTransferNonBlocking (I3C_Type *base, i3c_slave_handle_t *handle, uint32_t eventMask)
 Starts accepting slave transfers. More...
 
status_t I3C_SlaveTransferGetCount (I3C_Type *base, i3c_slave_handle_t *handle, size_t *count)
 Gets the slave transfer status during a non-blocking transfer. More...
 
void I3C_SlaveTransferAbort (I3C_Type *base, i3c_slave_handle_t *handle)
 Aborts the slave non-blocking transfers. More...
 

Slave IRQ handler

void I3C_SlaveTransferHandleIRQ (I3C_Type *base, i3c_slave_handle_t *handle)
 Reusable routine to handle slave interrupts. More...
 
void I3C_SlaveRequestIBIWithData (I3C_Type *base, i3c_slave_handle_t *handle, uint8_t *data, size_t dataSize)
 I3C slave request IBI event with payload. More...
 

Data Structure Documentation

struct i3c_slave_config_t

This structure holds configuration settings for the I3C peripheral. To initialize this structure to reasonable defaults, call the I3C_SlaveGetDefaultConfig() function and pass a pointer to your configuration structure instance.

The configuration structure can be made constant so it resides in flash.

Data Fields

bool enableSlave
 Whether to enable slave. More...
 
bool isHotJoin
 Whether to enable slave hotjoin before enable slave. More...
 
uint8_t staticAddr
 Static address. More...
 
uint16_t vendorID
 Device vendor ID(manufacture ID). More...
 
bool enableRandomPart
 Whether to generate random part number, if using random part number, the partNumber variable setting is meaningless. More...
 
uint32_t partNumber
 Device part number info.
 
uint8_t dcr
 Device characteristics register information. More...
 
uint8_t bcr
 Bus characteristics register information. More...
 
uint8_t hdrMode
 Support hdr mode, could be OR logic in enumeration:i3c_hdr_mode_t. More...
 
bool nakAllRequest
 Whether to reply NAK to all requests except broadcast CCC. More...
 
bool ignoreS0S1Error
 Whether to ignore S0/S1 error in SDR mode. More...
 
bool offline
 Whether to wait 60 us of bus quiet or HDR request to ensure slave track SDR mode safely. More...
 
bool matchSlaveStartStop
 Whether to assert start/stop status only the time slave is addressed. More...
 
uint32_t maxWriteLength
 Maximum write length. More...
 
uint32_t maxReadLength
 Maximum read length. More...
 

Field Documentation

bool i3c_slave_config_t::enableSlave
bool i3c_slave_config_t::isHotJoin
uint8_t i3c_slave_config_t::staticAddr
uint16_t i3c_slave_config_t::vendorID
bool i3c_slave_config_t::enableRandomPart
uint8_t i3c_slave_config_t::dcr
uint8_t i3c_slave_config_t::bcr
uint8_t i3c_slave_config_t::hdrMode
bool i3c_slave_config_t::nakAllRequest
bool i3c_slave_config_t::ignoreS0S1Error
bool i3c_slave_config_t::offline
bool i3c_slave_config_t::matchSlaveStartStop
uint32_t i3c_slave_config_t::maxWriteLength
uint32_t i3c_slave_config_t::maxReadLength
struct i3c_slave_transfer_t

Data Fields

uint32_t event
 Reason the callback is being invoked. More...
 
uint8_t * txData
 Transfer buffer.
 
size_t txDataSize
 Transfer size.
 
uint8_t * rxData
 Transfer buffer.
 
size_t rxDataSize
 Transfer size.
 
status_t completionStatus
 Success or error code describing how the transfer completed. More...
 
size_t transferredCount
 Number of bytes actually transferred since start or last repeated start. More...
 

Field Documentation

uint32_t i3c_slave_transfer_t::event
status_t i3c_slave_transfer_t::completionStatus

Only applies for kI3C_SlaveCompletionEvent.

size_t i3c_slave_transfer_t::transferredCount
struct _i3c_slave_handle
Note
The contents of this structure are private and subject to change.

Data Fields

i3c_slave_transfer_t transfer
 I3C slave transfer copy. More...
 
bool isBusy
 Whether transfer is busy. More...
 
bool wasTransmit
 Whether the last transfer was a transmit. More...
 
uint32_t eventMask
 Mask of enabled events. More...
 
uint32_t transferredCount
 Count of bytes transferred. More...
 
i3c_slave_transfer_callback_t callback
 Callback function called at transfer event. More...
 
void * userData
 Callback parameter passed to callback. More...
 
uint8_t * ibiData
 IBI data buffer.
 
size_t ibiDataSize
 IBI data size.
 

Field Documentation

i3c_slave_transfer_t i3c_slave_handle_t::transfer
bool i3c_slave_handle_t::isBusy
bool i3c_slave_handle_t::wasTransmit
uint32_t i3c_slave_handle_t::eventMask
uint32_t i3c_slave_handle_t::transferredCount
i3c_slave_transfer_callback_t i3c_slave_handle_t::callback
void* i3c_slave_handle_t::userData

Typedef Documentation

typedef void(* i3c_slave_transfer_callback_t)(I3C_Type *base, i3c_slave_transfer_t *transfer, void *userData)

This callback is used only for the slave non-blocking transfer API. To install a callback, use the I3C_SlaveSetCallback() function after you have created a handle.

Parameters
baseBase address for the I3C instance on which the event occurred.
transferPointer to transfer descriptor containing values passed to and/or from the callback.
userDataArbitrary pointer-sized value passed from the application.

Enumeration Type Documentation

The following status register flags can be cleared:

Only below flags can be enabled as interrupts.

Note
These enums are meant to be OR'd together to form a bit mask.
Enumerator
kI3C_SlaveNotStopFlag 

Slave status not stop flag.

kI3C_SlaveMessageFlag 

Slave status message, indicating slave is listening to the bus traffic or responding.

kI3C_SlaveRequiredReadFlag 

Slave status required, either is master doing SDR read from slave, or is IBI pushing out.

kI3C_SlaveRequiredWriteFlag 

Slave status request write, master is doing SDR write to slave, except slave in ENTDAA mode.

kI3C_SlaveBusDAAFlag 

I3C bus is in ENTDAA mode.

kI3C_SlaveBusHDRModeFlag 

I3C bus is in HDR mode.

kI3C_SlaveBusStartFlag 

Start/Re-start event is seen since the bus was last cleared.

kI3C_SlaveMatchedFlag 

Slave address(dynamic/static) matched since last cleared.

kI3C_SlaveBusStopFlag 

Stop event is seen since the bus was last cleared.

kI3C_SlaveRxReadyFlag 

Rx data ready in rx buffer flag.

kI3C_SlaveTxReadyFlag 

Tx buffer ready for Tx data flag.

kI3C_SlaveDynamicAddrChangedFlag 

Slave dynamic address has been assigned, re-assigned, or lost.

kI3C_SlaveReceivedCCCFlag 

Slave received Common command code.

kI3C_SlaveErrorFlag 

Error occurred flag.

kI3C_SlaveHDRCommandMatchFlag 

High data rate command match.

kI3C_SlaveCCCHandledFlag 

Slave received Common command code is handled by I3C module.

kI3C_SlaveEventSentFlag 

Slave IBI/P2P/MR/HJ event has been sent.

kI3C_SlaveIbiDisableFlag 

Slave in band interrupt is disabled.

kI3C_SlaveMasterRequestDisabledFlag 

Slave master request is disabled.

kI3C_SlaveHotJoinDisabledFlag 

Slave Hot-Join is disabled.

kI3C_SlaveClearFlags 

All flags which are cleared by the driver upon starting a transfer.

Note
These enums are meant to be OR'd together to form a bit mask.
Enumerator
kI3C_SlaveErrorOverrunFlag 

Slave internal from-bus buffer/FIFO overrun.

kI3C_SlaveErrorUnderrunFlag 

Slave internal to-bus buffer/FIFO underrun.

kI3C_SlaveErrorUnderrunNakFlag 

Slave internal from-bus buffer/FIFO underrun and NACK error.

kI3C_SlaveErrorTermFlag 

Terminate error from master.

kI3C_SlaveErrorInvalidStartFlag 

Slave invalid start flag.

kI3C_SlaveErrorSdrParityFlag 

SDR parity error.

kI3C_SlaveErrorHdrParityFlag 

HDR parity error.

kI3C_SlaveErrorHdrCRCFlag 

HDR-DDR CRC error.

kI3C_SlaveErrorS0S1Flag 

S0 or S1 error.

kI3C_SlaveErrorOverreadFlag 

Over-read error.

kI3C_SlaveErrorOverwriteFlag 

Over-write error.

Enumerator
kI3C_SlaveEventNormal 

Normal mode.

kI3C_SlaveEventIBI 

In band interrupt event.

kI3C_SlaveEventMasterReq 

Master request event.

kI3C_SlaveEventHotJoinReq 

Hot-join event.

Enumerator
kI3C_SlaveNoLatency 

Normal bus operation.

kI3C_SlaveLatency1Ms 

1ms of latency.

kI3C_SlaveLatency100Ms 

100ms of latency.

kI3C_SlaveLatency10S 

10s latency.

These event enumerations are used for two related purposes. First, a bit mask created by OR'ing together events is passed to I3C_SlaveTransferNonBlocking() in order to specify which events to enable. Then, when the slave callback is invoked, it is passed the current event through its transfer parameter.

Note
These enumerations are meant to be OR'd together to form a bit mask of events.
Enumerator
kI3C_SlaveAddressMatchEvent 

Received the slave address after a start or repeated start.

kI3C_SlaveTransmitEvent 

Callback is requested to provide data to transmit (slave-transmitter role).

kI3C_SlaveReceiveEvent 

Callback is requested to provide a buffer in which to place received data (slave-receiver role).

kI3C_SlaveRequiredTransmitEvent 

Callback is requested to provide a buffer in which to place received data (slave-receiver role).

kI3C_SlaveStartEvent 

A start/repeated start was detected.

kI3C_SlaveHDRCommandMatchEvent 

Slave Match HDR Command.

kI3C_SlaveCompletionEvent 

A stop was detected, completing the transfer.

kI3C_SlaveRequestSentEvent 

Slave request event sent.

kI3C_SlaveReceivedCCCEvent 

Slave received CCC event, need to handle by application.

kI3C_SlaveAllEvents 

Bit mask of all available events.

Function Documentation

void I3C_SlaveGetDefaultConfig ( i3c_slave_config_t slaveConfig)

This function provides the following default configuration for the I3C slave peripheral:

* slaveConfig->enableslave = true;
*

After calling this function, you can override any settings in order to customize the configuration, prior to initializing the slave driver with I3C_SlaveInit().

Parameters
[out]slaveConfigUser provided configuration structure for default values. Refer to i3c_slave_config_t.
void I3C_SlaveInit ( I3C_Type *  base,
const i3c_slave_config_t slaveConfig,
uint32_t  slowClock_Hz 
)

This function enables the peripheral clock and initializes the I3C slave peripheral as described by the user provided configuration.

Parameters
baseThe I3C peripheral base address.
slaveConfigUser provided peripheral configuration. Use I3C_SlaveGetDefaultConfig() to get a set of defaults that you can override.
slowClock_HzFrequency in Hertz of the I3C slow clock. Used to calculate the bus match condition values.
void I3C_SlaveDeinit ( I3C_Type *  base)

This function disables the I3C slave peripheral and gates the clock.

Parameters
baseThe I3C peripheral base address.
static void I3C_SlaveEnable ( I3C_Type *  base,
bool  isEnable 
)
inlinestatic
Parameters
baseThe I3C peripheral base address.
isEnableEnable or disable.
static uint32_t I3C_SlaveGetStatusFlags ( I3C_Type *  base)
inlinestatic

A bit mask with the state of all I3C slave status flags is returned. For each flag, the corresponding bit in the return value is set if the flag is asserted.

Parameters
baseThe I3C peripheral base address.
Returns
State of the status flags:
  • 1: related status flag is set.
  • 0: related status flag is not set.
See Also
_i3c_slave_flags
static void I3C_SlaveClearStatusFlags ( I3C_Type *  base,
uint32_t  statusMask 
)
inlinestatic

The following status register flags can be cleared:

Attempts to clear other flags has no effect.

Parameters
baseThe I3C peripheral base address.
statusMaskA bitmask of status flags that are to be cleared. The mask is composed of _i3c_slave_flags enumerators OR'd together. You may pass the result of a previous call to I3C_SlaveGetStatusFlags().
See Also
_i3c_slave_flags.
static uint32_t I3C_SlaveGetErrorStatusFlags ( I3C_Type *  base)
inlinestatic

A bit mask with the state of all I3C slave error status flags is returned. For each flag, the corresponding bit in the return value is set if the flag is asserted.

Parameters
baseThe I3C peripheral base address.
Returns
State of the error status flags:
  • 1: related status flag is set.
  • 0: related status flag is not set.
See Also
_i3c_slave_error_flags
static void I3C_SlaveClearErrorStatusFlags ( I3C_Type *  base,
uint32_t  statusMask 
)
inlinestatic
Parameters
baseThe I3C peripheral base address.
statusMaskA bitmask of error status flags that are to be cleared. The mask is composed of _i3c_slave_error_flags enumerators OR'd together. You may pass the result of a previous call to I3C_SlaveGetErrorStatusFlags().
See Also
_i3c_slave_error_flags.
i3c_slave_activity_state_t I3C_SlaveGetActivityState ( I3C_Type *  base)
Parameters
baseThe I3C peripheral base address.
Returns
I3C slave activity state, refer i3c_slave_activity_state_t.
static void I3C_SlaveEnableInterrupts ( I3C_Type *  base,
uint32_t  interruptMask 
)
inlinestatic

Only below flags can be enabled as interrupts.

Parameters
baseThe I3C peripheral base address.
interruptMaskBit mask of interrupts to enable. See _i3c_slave_flags for the set of constants that should be OR'd together to form the bit mask.
static void I3C_SlaveDisableInterrupts ( I3C_Type *  base,
uint32_t  interruptMask 
)
inlinestatic

Only below flags can be disabled as interrupts.

Parameters
baseThe I3C peripheral base address.
interruptMaskBit mask of interrupts to disable. See _i3c_slave_flags for the set of constants that should be OR'd together to form the bit mask.
static uint32_t I3C_SlaveGetEnabledInterrupts ( I3C_Type *  base)
inlinestatic
Parameters
baseThe I3C peripheral base address.
Returns
A bitmask composed of _i3c_slave_flags enumerators OR'd together to indicate the set of enabled interrupts.
static uint32_t I3C_SlaveGetPendingInterrupts ( I3C_Type *  base)
inlinestatic
Parameters
baseThe I3C peripheral base address.
Returns
A bitmask composed of _i3c_slave_flags enumerators OR'd together to indicate the set of pending interrupts.
static void I3C_SlaveEnableDMA ( I3C_Type *  base,
bool  enableTx,
bool  enableRx,
uint32_t  width 
)
inlinestatic
Parameters
baseThe I3C peripheral base address.
enableTxEnable flag for transmit DMA request. Pass true for enable, false for disable.
enableRxEnable flag for receive DMA request. Pass true for enable, false for disable.
widthDMA read/write unit in bytes.
static uint32_t I3C_SlaveGetTxFifoAddress ( I3C_Type *  base,
uint32_t  width 
)
inlinestatic
Parameters
baseThe I3C peripheral base address.
widthDMA read/write unit in bytes.
Returns
The I3C Slave Transmit Data Register address.
static uint32_t I3C_SlaveGetRxFifoAddress ( I3C_Type *  base,
uint32_t  width 
)
inlinestatic
Parameters
baseThe I3C peripheral base address.
widthDMA read/write unit in bytes.
Returns
The I3C Slave Receive Data Register address.
static void I3C_SlaveSetWatermarks ( I3C_Type *  base,
i3c_tx_trigger_level_t  txLvl,
i3c_rx_trigger_level_t  rxLvl,
bool  flushTx,
bool  flushRx 
)
inlinestatic
Parameters
baseThe I3C peripheral base address.
txLvlTransmit FIFO watermark level. The kI3C_SlaveTxReadyFlag flag is set whenever the number of words in the transmit FIFO reaches txLvl.
rxLvlReceive FIFO watermark level. The kI3C_SlaveRxReadyFlag flag is set whenever the number of words in the receive FIFO reaches rxLvl.
flushTxtrue if TX FIFO is to be cleared, otherwise TX FIFO remains unchanged.
flushRxtrue if RX FIFO is to be cleared, otherwise RX FIFO remains unchanged.
static void I3C_SlaveGetFifoCounts ( I3C_Type *  base,
size_t *  rxCount,
size_t *  txCount 
)
inlinestatic
Parameters
baseThe I3C peripheral base address.
[out]txCountPointer through which the current number of bytes in the transmit FIFO is returned. Pass NULL if this value is not required.
[out]rxCountPointer through which the current number of bytes in the receive FIFO is returned. Pass NULL if this value is not required.
void I3C_SlaveRequestEvent ( I3C_Type *  base,
i3c_slave_event_t  event 
)
Parameters
baseThe I3C peripheral base address.
eventI3C slave event of type i3c_slave_event_t
status_t I3C_SlaveSend ( I3C_Type *  base,
const void *  txBuff,
size_t  txSize 
)
Parameters
baseThe I3C peripheral base address.
txBuffThe pointer to the data to be transferred.
txSizeThe length in bytes of the data to be transferred.
Returns
Error or success status returned by API.
status_t I3C_SlaveReceive ( I3C_Type *  base,
void *  rxBuff,
size_t  rxSize 
)
Parameters
baseThe I3C peripheral base address.
rxBuffThe pointer to the data to be transferred.
rxSizeThe length in bytes of the data to be transferred.
Returns
Error or success status returned by API.
void I3C_SlaveTransferCreateHandle ( I3C_Type *  base,
i3c_slave_handle_t *  handle,
i3c_slave_transfer_callback_t  callback,
void *  userData 
)

The creation of a handle is for use with the non-blocking APIs. Once a handle is created, there is not a corresponding destroy handle. If the user wants to terminate a transfer, the I3C_SlaveTransferAbort() API shall be called.

Note
The function also enables the NVIC IRQ for the input I3C. Need to notice that on some SoCs the I3C IRQ is connected to INTMUX, in this case user needs to enable the associated INTMUX IRQ in application.
Parameters
baseThe I3C peripheral base address.
[out]handlePointer to the I3C slave driver handle.
callbackUser provided pointer to the asynchronous callback function.
userDataUser provided pointer to the application callback data.
status_t I3C_SlaveTransferNonBlocking ( I3C_Type *  base,
i3c_slave_handle_t *  handle,
uint32_t  eventMask 
)

Call this API after calling I2C_SlaveInit() and I3C_SlaveTransferCreateHandle() to start processing transactions driven by an I2C master. The slave monitors the I2C bus and pass events to the callback that was passed into the call to I3C_SlaveTransferCreateHandle(). The callback is always invoked from the interrupt context.

The set of events received by the callback is customizable. To do so, set the eventMask parameter to the OR'd combination of i3c_slave_transfer_event_t enumerators for the events you wish to receive. The kI3C_SlaveTransmitEvent and kI3C_SlaveReceiveEvent events are always enabled and do not need to be included in the mask. Alternatively, you can pass 0 to get a default set of only the transmit and receive events that are always enabled. In addition, the kI3C_SlaveAllEvents constant is provided as a convenient way to enable all events.

Parameters
baseThe I3C peripheral base address.
handlePointer to struct: _i3c_slave_handle structure which stores the transfer state.
eventMaskBit mask formed by OR'ing together i3c_slave_transfer_event_t enumerators to specify which events to send to the callback. Other accepted values are 0 to get a default set of only the transmit and receive events, and kI3C_SlaveAllEvents to enable all events.
Return values
kStatus_SuccessSlave transfers were successfully started.
kStatus_I3C_BusySlave transfers have already been started on this handle.
status_t I3C_SlaveTransferGetCount ( I3C_Type *  base,
i3c_slave_handle_t *  handle,
size_t *  count 
)
Parameters
baseThe I3C peripheral base address.
handlePointer to i2c_slave_handle_t structure.
[out]countPointer to a value to hold the number of bytes transferred. May be NULL if the count is not required.
Return values
kStatus_Success
kStatus_NoTransferInProgress
void I3C_SlaveTransferAbort ( I3C_Type *  base,
i3c_slave_handle_t *  handle 
)
Note
This API could be called at any time to stop slave for handling the bus events.
Parameters
baseThe I3C peripheral base address.
handlePointer to struct: _i3c_slave_handle structure which stores the transfer state.
Return values
kStatus_Success
kStatus_I3C_Idle
void I3C_SlaveTransferHandleIRQ ( I3C_Type *  base,
i3c_slave_handle_t *  handle 
)
Note
This function does not need to be called unless you are reimplementing the non blocking API's interrupt handler routines to add special functionality.
Parameters
baseThe I3C peripheral base address.
handlePointer to struct: _i3c_slave_handle structure which stores the transfer state.
void I3C_SlaveRequestIBIWithData ( I3C_Type *  base,
i3c_slave_handle_t *  handle,
uint8_t *  data,
size_t  dataSize 
)
Parameters
baseThe I3C peripheral base address.
handlePointer to struct: _i3c_slave_handle structure which stores the transfer state.
dataPointer to IBI data to be sent in the request.
dataSizeIBI data size.