3.14 I3C Target Driver

Overview

The Improved Inter-Integrated Circuit (I3C) Target driver provides a complete implementation for operating the

dsPIC33AK I3C peripheral in Target (Slave) mode. The I3C interface, developed by the MIPI® Alliance, is a high-speed,

low-power, managed two-wire digital interface designed for sensor and device integration. It is backward compatible

with legacy I2C devices and adheres to the MIPI I3C® Basic Specification v1.1.1.

In Target mode, the device responds to transfers initiated by the Active Controller on the bus. The Target supports

dynamic address assignment, can request bus access via In-Band Interrupts (IBI), and can join an active bus via the

Hot-Join mechanism. Data transfers are DMA-assisted for efficient high-throughput operation without CPU intervention

during the data phase.

Features

  • Two-wire serial interface supporting SDR speeds up to 12.5 MHz and HDR-DDR mode.
  • I2C backward compatible (Target responds to I2C transfers when configured with a static address).
  • Static address support for I2C/mixed-bus operation and dynamic address assignment via ENTDAA, SETDASA, or SETAASA.
  • In-Band Interrupt (IBI/SIR) support with configurable Mandatory Data Byte and up to 4-byte payload.
  • Hot-Join support with adaptive mode for safe operation on unknown bus types.
  • DMA-based transmit and receive for transfers up to 756 bytes without CPU-managed byte loops.
  • HDR-DDR (High Data Rate – Double Data Rate) private transfer support for increased throughput.
  • Packet Error Check (PEC) with CRC-8 generation and validation on SDR transfers.
  • Hardware-autonomous Common Command Code (CCC) handling with application notification on updates.
  • Bus-Available and Bus-Idle condition detection with configurable idle count multiplier.
  • SDA stuck bus recovery with hardware 100 µs timeout and automatic High-Z release.
  • ECC protection on internal SRAM (FIFOs/queues) with single-bit correction and double-bit detection interrupts.
  • Grouped addressing support for multicast CCC targeting.
  • Callback-driven architecture with 12 event callbacks (transaction complete, errors, IBI done, dynamic address, CCC

    update, ECC errors, start detection, read request, underrun, overrun).

3.14.1 Module Documentation

3.14.1.1 I3C Target Driver

I3C Target Driver Interface for dsPIC MCUs.

3.14.1.1.1 Module description

I3C Target Driver Interface for dsPIC MCUs.

Data structures
Enumerations
Functions
Variables
  • const struct I3C_TARGET_INTERFACE I3C1_Target

    Structure object of type I3C_TARGET_INTERFACE with the custom name given by the user in the Melody Driver User interface. The default name e.g. I3C_TARGET can be changed via the 'Custom Name' field. Application-specific naming allows API portability across peripheral instances.

3.14.1.1.2 Function Documentation

I3C1_Target_BufferReceive()

enum I3C_TARGET_BUFFER_RECEIVE_ERROR I3C1_Target_BufferReceive (uint8_t * rxBuf, uint16_t len)

Configures the buffer for the next Private Write transaction to receive data. The status of the transaction can be checked using the transaction complete callback.

Precondition:

The rxBuf pointer must be 4-byte aligned for DMA word transfers.

Parameters:
in rxBuf

- Pointer to the buffer in which data needs to be received.

Note:

Lifetime of the buffer must be maintained until data is received.

Parameters:
in len

- Size of the buffer.

Note:

Buffer size must be greater than the expected size of data received in the next Private Write transaction.

Returns:

Status of the buffer receive operation as described in I3C_TARGET_BUFFER_RECEIVE_ERROR.

I3C1_Target_BufferTransmit()

enum I3C_TARGET_BUFFER_TRANSMIT_ERROR I3C1_Target_BufferTransmit (uint8_t * txBuf, uint16_t len)

Configures the buffer for the next Private Read transaction to transmit data. The status of the transaction can be checked using the transaction complete callback.

Note:

Once the TX Command is programmed, it is valid for only one read transfer. The application must call this API again for the next read transfer after receiving the transaction complete callback for the previously programmed command.

Precondition:

The txBuf pointer must be 4-byte aligned for DMA word transfers.

Parameters:
in txBuf

- Pointer to the buffer from which data needs to be transmitted.

Note:

Lifetime of the buffer must be maintained until data is transmitted.

Parameters:
in len

- Number of data bytes to be transmitted.

Returns:

Status of the buffer transmit operation as described in I3C_TARGET_BUFFER_TRANSMIT_ERROR.

I3C1_Target_CCCTableUpdatedCallback()

void I3C1_Target_CCCTableUpdatedCallback (void )

Default weak callback for the CCC Table Updated event. Override this function or register a custom callback using I3C1_Target_CCCTableUpdatedCallbackRegister.

Parameters:
None.
Returns:

None.

I3C1_Target_CCCTableUpdatedCallbackRegister()

void I3C1_Target_CCCTableUpdatedCallbackRegister (void(*)(void) callback)

Registers a callback for the CCC Table Updated event. Triggered when the Active Controller updates CCC-mapped registers (e.g. MWL, MRL) via a supported CCC command.

Precondition:

None.

Parameters:
in callback

- Function pointer to the callback, or NULL to deregister.

Returns:

None.

I3C1_Target_CCCUpdateStatusGet()

void I3C1_Target_CCCUpdateStatusGet (struct I3C_TARGET_CCC_UPDATE_STATUS * status)

Reads the current CCC update status from the I3CxTGTESTA register. Clears the sticky status bits (MWLSTA, MRLSTA) after reading. Call this inside the CCCTableUpdatedCallback to determine which CCC was received from the Active Controller.

Precondition:

Called within or after the CCCTableUpdatedCallback.

Parameters:
out status

- Pointer to structure to fill with current CCC update info.

Returns:

None.

I3C1_Target_CommandQueueClear()

void I3C1_Target_CommandQueueClear (void )

Clears the I3C1 Target command queue.

Precondition:

None.

Parameters:
None.
Returns:

None.

I3C1_Target_Deinitialize()

void I3C1_Target_Deinitialize (void )

De-initializes the I3C1 Target peripheral. Disables DMA channels, interrupts, resets all queues/buffers/state machine, and powers off the module.

Precondition:

None.

Parameters:
None.
Returns:

None.

I3C1_Target_Disable()

void I3C1_Target_Disable (void )

Disables the I3C1 Target peripheral.

Note:

After disabling, the Target will not respond to any bus activity. Re-enabling requires a new placeholder transfer from the Controller to provide SCL clocks before the Target becomes operational again.

Precondition:

None.

Parameters:
None.
Returns:

None.

I3C1_Target_DoubleBitECCErrorCallback()

void I3C1_Target_DoubleBitECCErrorCallback (void )

Default weak callback for the Double-Bit ECC Error event. Override this function or register a custom callback using I3C1_Target_DoubleBitECCErrorCallbackRegister.

Parameters:
None.
Returns:

None.

I3C1_Target_DoubleBitECCErrorCallbackRegister()

void I3C1_Target_DoubleBitECCErrorCallbackRegister (void(*)(void) callback)

Registers a callback for the Double-Bit ECC Error (DERR) interrupt event.

Precondition:

None.

Parameters:
in callback

- Function pointer to the callback, or NULL to deregister.

Returns:

None.

I3C1_Target_DynamicAddressAssignedCallback()

void I3C1_Target_DynamicAddressAssignedCallback (void )

Default weak callback for the Dynamic Address Assigned event. Override this function or register a custom callback using I3C1_Target_DynamicAddressAssignedCallbackRegister.

Parameters:
None.
Returns:

None.

I3C1_Target_DynamicAddressAssignedCallbackRegister()

void I3C1_Target_DynamicAddressAssignedCallbackRegister (void(*)(void) callback)

Registers a callback for the Dynamic Address Assigned event.

Precondition:

None.

Parameters:
in callback

- Function pointer to the callback, or NULL to deregister.

Returns:

None.

I3C1_Target_Enable()

void I3C1_Target_Enable (void )

Enables the I3C1 Target peripheral.

Note:

In Target mode, I3C operation becomes active only after the Controller provides SCL clocks via a placeholder transfer (any transfer ending in STOP). The placeholder transfer is ignored by the Target. Once enabled, the module responds to bus transfers only after observing the Bus Available condition.

Precondition:

I3C1_Target_Initialize() must have been called.

Parameters:
None.
Returns:

None.

I3C1_Target_HDRCommandCodeSet()

void I3C1_Target_HDRCommandCodeSet (uint8_t hdrCmdCode)

Sets the HDR-DDR command code for the next BufferTransmit call. Default is 0x00 (SDR Private Read). For HDR-DDR transfers, set the appropriate HDR command code before calling BufferTransmit.

Note:

To revert back to SDR mode after an HDR-DDR transfer, call this function with hdrCmdCode = 0x00 before the next BufferTransmit.

Precondition:

None.

Parameters:
in hdrCmdCode

- HDR-DDR command code. Use 0x00 for SDR Private Read.

Returns:

None.

I3C1_Target_HotJoinStatusGet()

enum I3C_TARGET_HJ_STATUS I3C1_Target_HotJoinStatusGet (void )

Returns the current status of the Hot-Join operation.

Precondition:

None.

Parameters:
None.
Returns:

Hot-Join status as described in I3C_TARGET_HJ_STATUS.

I3C1_Target_IBIDoneCallback()

void I3C1_Target_IBIDoneCallback (enum I3C_TARGET_IBI_STATUS ibiStatus)

Default weak callback for the IBI Done event. Override this function or register a custom callback using I3C1_Target_IBIDoneCallbackRegister.

Parameters:
in ibiStatus

- The IBI completion status.

Returns:

None.

I3C1_Target_IBIDoneCallbackRegister()

void I3C1_Target_IBIDoneCallbackRegister (void(*)(enum I3C_TARGET_IBI_STATUS ibiStatus) handler)

Registers a callback for the IBI Done event.

Precondition:

None.

Parameters:
in handler

- Function pointer to the handler, or NULL to deregister.

Returns:

None.

I3C1_Target_IBIMandatoryDataByteSet()

void I3C1_Target_IBIMandatoryDataByteSet (uint8_t mdb)

Sets the Mandatory Data Byte (MDB) for IBI requests.

Precondition:

None.

Parameters:
in mdb

- Mandatory Data Byte value.

Returns:

None.

I3C1_Target_IBIPayloadSizeGet()

uint8_t I3C1_Target_IBIPayloadSizeGet (void )

Gets the current IBI payload size.

Precondition:

None.

Parameters:
None.
Returns:

Current payload size in bytes.

I3C1_Target_IBIPayloadSizeSet()

void I3C1_Target_IBIPayloadSizeSet (uint8_t size)

Sets the IBI payload size.

Precondition:

None.

Parameters:
in size

- Payload size in bytes (0-4).

Returns:

None.

I3C1_Target_IBIRequest()

enum I3C_TARGET_IBI_REQUEST_ERROR I3C1_Target_IBIRequest (uint8_t * payloadBuf, uint16_t payloadLen)

Initiates an In-Band Interrupt (IBI/SIR) request on the I3C bus.

Precondition:

Dynamic Address must be assigned and IBI must be enabled.

Parameters:
in payloadBuf

- Pointer to payload data, or NULL for no payload.

in payloadLen

- Payload length in bytes (0 for no payload, max 4).

Returns:

Status of the IBI request as described in I3C_TARGET_IBI_REQUEST_ERROR.

I3C1_Target_Initialize()

void I3C1_Target_Initialize (void )

Initializes the I3C1 Target peripheral with default configuration.

Precondition:

None.

Parameters:
None.
Returns:

None.

I3C1_Target_IsDynamicAddressValid()

bool I3C1_Target_IsDynamicAddressValid (void )

Checks whether the Dynamic Address has been assigned by the Controller.

Precondition:

None.

Parameters:
None.
Return values:
True

- Dynamic Address is valid.

False

- Dynamic Address is not yet assigned.

I3C1_Target_IsEnabled()

uint8_t I3C1_Target_IsEnabled (void )

Checks whether the I3C1 Target peripheral is enabled.

Precondition:

None.

Parameters:
None.
Returns:

1 if enabled, 0 if disabled.

I3C1_Target_IsIBIEnabledOnBus()

bool I3C1_Target_IsIBIEnabledOnBus (void )

Checks if the IBI capability is enabled on the bus.

Precondition:

None.

Parameters:
None.
Return values:
True

- IBI is enabled on the bus.

False

- IBI is not enabled on the bus.

I3C1_Target_MaxReadLengthGet()

uint16_t I3C1_Target_MaxReadLengthGet (void )

Returns the configured maximum read length.

Precondition:

None.

Parameters:
None.
Returns:

Maximum read length in bytes.

I3C1_Target_MaxReadLengthSet()

void I3C1_Target_MaxReadLengthSet (uint16_t maxReadLen)

Sets the maximum read length.

Precondition:

None.

Parameters:
in maxReadLen

- Maximum read length in bytes.

Returns:

None.

I3C1_Target_MaxWriteLengthGet()

uint16_t I3C1_Target_MaxWriteLengthGet (void )

Returns the configured maximum write length.

Precondition:

None.

Parameters:
None.
Returns:

Maximum write length in bytes.

I3C1_Target_MaxWriteLengthSet()

void I3C1_Target_MaxWriteLengthSet (uint16_t maxWriteLen)

Sets the maximum write length.

Precondition:

None.

Parameters:
in maxWriteLen

- Maximum write length in bytes.

Returns:

None.

I3C1_Target_PECDisable()

void I3C1_Target_PECDisable (void )

Disables Packet Error Check (PEC) for SDR transfers. After calling this function, the Target will no longer append or validate CRC-8 bytes on SDR transfers.

Note:

This is the counterpart to PECEnable().

Precondition:

None.

Parameters:
None.
Returns:

None.

I3C1_Target_PECEnable()

void I3C1_Target_PECEnable (void )

Enables Packet Error Check (PEC) for SDR transfers. When enabled, the Target appends a CRC-8 byte to read/IBI transfers and validates the CRC-8 byte on write transfers.

Note:

PEC is applicable only for SDR CCC, IBI, and SDR private transfers. It has no effect on HDR-DDR mode transfers.

Precondition:

Should be enabled after receiving DEVCTRL CCC from the Controller.

Parameters:
None.
Returns:

None.

I3C1_Target_PeripheralReset()

void I3C1_Target_PeripheralReset (void )

Resets the I3C1 Target peripheral using the SOFTRST core software reset bit.

Precondition:

None.

Parameters:
None.
Returns:

None.

I3C1_Target_ReadRequestReceivedCallback()

void I3C1_Target_ReadRequestReceivedCallback (void )

Default weak callback for the Read Request Received event. Override this function or register a custom callback using I3C1_Target_ReadRequestReceivedCallbackRegister.

Parameters:
None.
Returns:

None.

I3C1_Target_ReadRequestReceivedCallbackRegister()

void I3C1_Target_ReadRequestReceivedCallbackRegister (void(*)(void) callback)

Registers a callback for the Read Request Received event. Triggered when the Controller issues a read request and the command queue is empty.

Precondition:

None.

Parameters:
in callback

- Function pointer to the callback, or NULL to deregister.

Returns:

None.

I3C1_Target_ReceiveOverrunCallback()

void I3C1_Target_ReceiveOverrunCallback (void )

Default weak callback for the Receive Overrun event. Override this function or register a custom callback using I3C1_Target_ReceiveOverrunCallbackRegister.

Parameters:
None.
Returns:

None.

I3C1_Target_ReceiveOverrunCallbackRegister()

void I3C1_Target_ReceiveOverrunCallbackRegister (void(*)(void) callback)

Registers a callback for the Receive Overrun event. Triggered when the RX FIFO overflows during a Controller Write transfer.

Precondition:

None.

Parameters:
in callback

- Function pointer to the callback, or NULL to deregister.

Returns:

None.

I3C1_Target_ResponseQueueClear()

void I3C1_Target_ResponseQueueClear (void )

Clears the I3C1 Target response queue.

Precondition:

None.

Parameters:
None.
Returns:

None.

I3C1_Target_Resume()

void I3C1_Target_Resume (void )

Resumes the I3C1 Target peripheral after a halt condition.

Precondition:

None.

Parameters:
None.
Returns:

None.

I3C1_Target_RxBufferFIFOClear()

void I3C1_Target_RxBufferFIFOClear (void )

Clears the I3C1 Target RX buffer FIFO.

Precondition:

None.

Parameters:
None.
Returns:

None.

I3C1_Target_SingleBitECCErrorCallback()

void I3C1_Target_SingleBitECCErrorCallback (void )

Default weak callback for the Single-Bit ECC Error event. Override this function or register a custom callback using I3C1_Target_SingleBitECCErrorCallbackRegister.

Parameters:
None.
Returns:

None.

I3C1_Target_SingleBitECCErrorCallbackRegister()

void I3C1_Target_SingleBitECCErrorCallbackRegister (void(*)(void) callback)

Registers a callback for the Single-Bit ECC Error (SERR) interrupt event.

Precondition:

None.

Parameters:
in callback

- Function pointer to the callback, or NULL to deregister.

Returns:

None.

I3C1_Target_StartConditionDetectedCallback()

void I3C1_Target_StartConditionDetectedCallback (void )

Default weak callback for the Start Condition Detected event. Override this function or register a custom callback using I3C1_Target_StartConditionDetectedCallbackRegister.

Parameters:
None.
Returns:

None.

I3C1_Target_StartConditionDetectedCallbackRegister()

void I3C1_Target_StartConditionDetectedCallbackRegister (void(*)(void) callback)

Registers a callback for the Start Condition detection event.

Precondition:

None.

Parameters:
in callback

- Function pointer to the callback, or NULL to deregister.

Returns:

None.

I3C1_Target_TransactionCompleteCallback()

void I3C1_Target_TransactionCompleteCallback (struct I3C_TARGET_TRANSACTION_COMPLETE_STATUS * status)

Default weak callback for the Transaction Complete event. Override this function or register a custom callback using I3C1_Target_TransactionCompleteCallbackRegister.

Parameters:
in status

- Pointer to the transaction complete status structure.

Returns:

None.

I3C1_Target_TransactionCompleteCallbackRegister()

void I3C1_Target_TransactionCompleteCallbackRegister (void(*)(struct I3C_TARGET_TRANSACTION_COMPLETE_STATUS *transactionCompleteStatus) callback)

Registers a callback for the Transaction Complete event. The callback provides the data flow direction and total number of bytes transferred.

Precondition:

None.

Parameters:
in callback

- Function pointer to the handler, or NULL to deregister.

Returns:

None.

I3C1_Target_TransactionErrorCallback()

void I3C1_Target_TransactionErrorCallback (enum I3C_TARGET_TRANSACTION_ERROR_STATUS error)

Default weak callback for the Transaction Error event. Override this function or register a custom callback using I3C1_Target_TransactionErrorCallbackRegister.

Parameters:
in error

- The transaction error status.

Returns:

None.

I3C1_Target_TransactionErrorCallbackRegister()

void I3C1_Target_TransactionErrorCallbackRegister (void(*)(enum I3C_TARGET_TRANSACTION_ERROR_STATUS transactionError) handler)

Registers a callback for the Transaction Error event.

Precondition:

None.

Parameters:
in handler

- Function pointer to the handler, or NULL to deregister.

Returns:

None.

I3C1_Target_TransmitUnderrunCallback()

void I3C1_Target_TransmitUnderrunCallback (void )

Default weak callback for the Transmit Underrun event. Override this function or register a custom callback using I3C1_Target_TransmitUnderrunCallbackRegister.

Parameters:
None.
Returns:

None.

I3C1_Target_TransmitUnderrunCallbackRegister()

void I3C1_Target_TransmitUnderrunCallbackRegister (void(*)(void) callback)

Registers a callback for the Transmit Underrun event. Triggered when the Extended TX FIFO underflows during a Controller Read transfer.

Precondition:

None.

Parameters:
in callback

- Function pointer to the callback, or NULL to deregister.

Returns:

None.

I3C1_Target_TxBufferFIFOClear()

void I3C1_Target_TxBufferFIFOClear (void )

Clears the I3C1 Target TX buffer FIFO.

Precondition:

None.

Parameters:
None.
Returns:

None.

3.14.1.1.3 Enumeration Type Documentation

I3C_TARGET_ACTIVITY_STATE

enum I3C_TARGET_ACTIVITY_STATE

Defines the activity state of the Target as set by the Controller via ENTAS0/ENTAS1/ENTAS2/ENTAS3 CCC commands.

I3C_TARGET_ACTIVITY_STATE_0

Normal activity (ENTAS0)

I3C_TARGET_ACTIVITY_STATE_1

Activity state 1 (ENTAS1)

I3C_TARGET_ACTIVITY_STATE_2

Activity state 2 (ENTAS2)

I3C_TARGET_ACTIVITY_STATE_3

Activity state 3 - lowest power (ENTAS3)

I3C_TARGET_BUFFER_RECEIVE_ERROR

enum I3C_TARGET_BUFFER_RECEIVE_ERROR

Defines the error status of the buffer receive operation.

I3C_TARGET_BUFFER_RECEIVE_NO_ERROR
I3C_TARGET_BUFFER_RECEIVE_BUFFER_SIZE_EXCEEDED
I3C_TARGET_BUFFER_RECEIVE_NULL_BUFFER
I3C_TARGET_BUFFER_RECEIVE_TRANSFER_IN_PROGRESS
I3C_TARGET_BUFFER_TRANSMIT_ERROR

enum I3C_TARGET_BUFFER_TRANSMIT_ERROR

Defines the error status of the buffer transmit operation.

I3C_TARGET_BUFFER_TRANSMIT_NO_ERROR
I3C_TARGET_BUFFER_TRANSMIT_BUFFER_SIZE_EXCEEDED
I3C_TARGET_BUFFER_TRANSMIT_NULL_BUFFER
I3C_TARGET_BUFFER_TRANSMIT_COMMAND_QUEUE_FULL
I3C_TARGET_DATA_FLOW_DIRECTION

enum I3C_TARGET_DATA_FLOW_DIRECTION

Defines the data flow direction of an I3C transaction.

I3C_TARGET_DATA_TRANSMITTED

Data transmitted via Private Read or IBI

I3C_TARGET_DATA_RECEIVED

Data received via Private Write

I3C_TARGET_HJ_STATUS

enum I3C_TARGET_HJ_STATUS

Defines the status of the Hot-Join operation.

I3C_TARGET_HJ_COMPLETED_OR_NOT_STARTED
I3C_TARGET_HJ_COMPLETED
I3C_TARGET_HJ_FAILED
I3C_TARGET_HJ_PENDING
I3C_TARGET_IBI_REQUEST_ERROR

enum I3C_TARGET_IBI_REQUEST_ERROR

Defines the error states of the In-Band Interrupt request operation.

I3C_TARGET_IBI_REQUEST_NO_ERROR
I3C_TARGET_IBI_REQUEST_SEND_BUFFER_SIZE_EXCEEDED
I3C_TARGET_IBI_REQUEST_NOT_IN_I3C_MODE
I3C_TARGET_IBI_REQUEST_IBI_DISABLED_ON_BUS
I3C_TARGET_IBI_STATUS

enum I3C_TARGET_IBI_STATUS

Defines the status codes for In-Band Interrupt operations.

I3C_TARGET_IBI_STATUS_NONE

No IBI status / Reserved

I3C_TARGET_IBI_STATUS_ACCEPTED

IBI accepted (ACK received)

I3C_TARGET_IBI_STATUS_EARLY_TERMINATE

Controller early terminated

I3C_TARGET_IBI_STATUS_NOT_ATTEMPTED

IBI not attempted

I3C_TARGET_RX_CMD_SIZE

enum I3C_TARGET_RX_CMD_SIZE

Defines the command word size in the RX FIFO prefix for received transfers. Indicates whether the first word in the RX buffer is data or an encoded command.

I3C_TARGET_RX_NO_COMMAND_WORD

No command word. First RX FIFO word is the first data word of the transfer (SDR Private Write).

I3C_TARGET_RX_HDR_COMMAND_CODE_OR_CCC_CODE

1 command word in RX FIFO. Only byte 0 is valid. Contains the HDR command code or the CCC code based on the CCC bit in the response.

I3C_TARGET_RX_HDR_COMMAND_CODE_WITH_DEFINING_BYTE

1 command word in RX FIFO. Byte 0 and byte 1 are valid. Byte 0 = HDR command code or CCC code, byte 1 = defining byte for the CCC.

I3C_TARGET_RX_HDR_BULK_TRANSFER_COMMAND

1 command word in RX FIFO. All 4 bytes are valid. Contains HDR Bulk Transfer command words 0, 1, 2, and 3.

I3C_TARGET_TRANSACTION_ERROR_STATUS

enum I3C_TARGET_TRANSACTION_ERROR_STATUS

Defines the transaction error status codes.

I3C_TARGET_TRANSACTION_NO_ERR

No error

I3C_TARGET_TRANSACTION_ERR_CRC

CRC error (Controller writes in DDR mode)

I3C_TARGET_TRANSACTION_ERR_PARITY

Parity error (Controller writes in DDR and SDR modes)

I3C_TARGET_TRANSACTION_ERR_FRAME

Frame error (HDR mode Controller writes)

I3C_TARGET_TRANSACTION_ERR_OVERFLOW

Underflow/Overflow error

I3C_TARGET_TRANSACTION_ERR_SDA_STUCK_RELEASE

SDA released from stuck state after RELEASE_SDA_TIMING timeout

I3C_TARGET_TRANSACTION_ERR_CONTROLLER_EARLY_TERM

Controller early termination

I3C_TARGET_TRANSACTION_ERR_PEC

PEC Error

3.14.1.1.4 Variable Documentation

I3C1_Target

const struct I3C_TARGET_INTERFACE I3C1_Target

Structure object of type I3C_TARGET_INTERFACE with the custom name given by the user in the Melody Driver User interface. The default name e.g. I3C_TARGET can be changed via the 'Custom Name' field. Application-specific naming allows API portability across peripheral instances.

3.14.2 Data Structure Documentation

3.14.2.1 I3C_TARGET_CCC_UPDATE_STATUS Struct Reference

Contains the status of which CCC fields were updated by the Active Controller. Read via CCCUpdateStatusGet() inside the CCCTableUpdatedCallback.

3.14.2.1.2 Field Documentation

The documentation for this struct was generated from the following file:

source/

i3c_target_types.h

activityState

enum I3C_TARGET_ACTIVITY_STATE activityState

Current activity state from ENTAS CCC

controllerRequestEnabled

bool controllerRequestEnabled

Controller Request enabled on bus after ENEC/DISEC

hotJoinEnabled

bool hotJoinEnabled

Hot-Join enabled on bus after ENEC/DISEC

ibiEnabled

bool ibiEnabled

IBI (SIR) enabled on bus after ENEC/DISEC

mrlChanged

bool mrlChanged

SETMRL CCC received â?? MRL updated by Controller

mwlChanged

bool mwlChanged

SETMWL CCC received â?? MWL updated by Controller

3.14.2.2 I3C_TARGET_INTERFACE Struct Reference

Structure containing the function pointers of the I3C Target driver.

3.14.2.2.1 Detailed Description

Structure containing the function pointers of the I3C Target driver.

#include <i3c_target_interface.h>

Data Fields

3.14.2.2.2 Field Documentation

The documentation for this struct was generated from the following file:

source/

i3c_target_interface.h

BufferReceive

enum I3C_TARGET_BUFFER_RECEIVE_ERROR(* BufferReceive) (uint8_t *rxBuf, uint16_t len)

Pointer to I3C1_Target_BufferReceive e.g. I3C1_Target_BufferReceive.

BufferTransmit

enum I3C_TARGET_BUFFER_TRANSMIT_ERROR(* BufferTransmit) (uint8_t *txBuf, uint16_t len)

Pointer to I3C1_Target_BufferTransmit e.g. I3C1_Target_BufferTransmit.

CCCUpdateStatusGet

void(* CCCUpdateStatusGet) (struct I3C_TARGET_CCC_UPDATE_STATUS *status)

Pointer to I3C1_Target_CCCUpdateStatusGet e.g. I3C1_Target_CCCUpdateStatusGet

HotJoinStatusGet

enum I3C_TARGET_HJ_STATUS(* HotJoinStatusGet) (void)

Pointer to I3C1_Target_HotJoinStatusGet e.g. I3C1_Target_HotJoinStatusGet.

IBIDoneCallbackRegister

void(* IBIDoneCallbackRegister) (void(*handler)(enum I3C_TARGET_IBI_STATUS ibiStatus))

Pointer to I3C1_Target_IBIDoneCallbackRegister e.g. I3C1_Target_IBIDoneCallbackRegister

IBIRequest

enum I3C_TARGET_IBI_REQUEST_ERROR(* IBIRequest) (uint8_t *payloadBuf, uint16_t payloadLen)

Pointer to I3C1_Target_IBIRequest e.g. I3C1_Target_IBIRequest.

TransactionCompleteCallbackRegister

void(* TransactionCompleteCallbackRegister) (void(*handler)(struct I3C_TARGET_TRANSACTION_COMPLETE_STATUS *transactionCompleteStatus))

Pointer to I3C1_Target_TransactionCompleteCallbackRegister e.g. I3C1_Target_TransactionCompleteCallbackRegister

TransactionErrorCallbackRegister

void(* TransactionErrorCallbackRegister) (void(*handler)(enum I3C_TARGET_TRANSACTION_ERROR_STATUS transactionError))

Pointer to I3C1_Target_TransactionErrorCallbackRegister e.g. I3C1_Target_TransactionErrorCallbackRegister

3.14.2.3 I3C_TARGET_RESPONSE_DATA Union Reference

Extended Response Data Structure Format 2 (Table 24-31).

3.14.2.3.1 Detailed Description

Extended Response Data Structure Format 2 (Table 24-31).

Bit layout (LSB first): [2:0] ATTR - Response Attribute [3] LAST - This is the last response of the transfer [4] FIRST - This is the first response of the transfer [5] DEFTGTS - Response is for DEFTGTS CCC [6] RESERVED [7] CCC - Response is for Private Write (0) or CCC Write (1) [11:8] ERR_STATUS - Error Status (0=No Error, 1=CRC, 2=Parity, 3=Frame, 6=Underflow/Overflow) [15:12] CMD_SIZE - Reports if first data entry in RX FIFO is an encoded command [20:16] TARGET_ID - Target/Targets that this transfer is intended for [23:21] RESERVED [31:24] DATA_LENGTH - Data length of the transfer

#include <i3c_target_types.h>

3.14.2.3.2 Field Documentation

The documentation for this union was generated from the following file:

source/

i3c_target_types.h

ATTR

uint32_t ATTR

Response Attribute

CCC

uint32_t CCC

0 = Private Write, 1 = CCC Write

CMD_SIZE

uint32_t CMD_SIZE

Command size indicator

DATA_LENGTH

uint32_t DATA_LENGTH

Data length of the transfer

DEFTGTS

uint32_t DEFTGTS

Response is for DEFTGTS CCC

ERR_STATUS

uint32_t ERR_STATUS

Error Status

FIRST

uint32_t FIRST

First response of the transfer

frame

struct { ... } frame

LAST

uint32_t LAST

Last response of the transfer

RESERVED1

uint32_t RESERVED1

Reserved

RESERVED2

uint32_t RESERVED2

Reserved

RespondData

uint32_t RespondData

TARGET_ID

uint32_t TARGET_ID

Target ID

3.14.2.4 I3C_TARGET_TRANSACTION_COMPLETE_STATUS Struct Reference

Contains the status of the transaction complete operation.

3.14.2.4.2 Field Documentation

The documentation for this struct was generated from the following file:

source/

i3c_target_types.h

cmdSize

enum I3C_TARGET_RX_CMD_SIZE cmdSize

Command word prefix in RX buffer. CMD_NONE = SDR (all bytes are data). Non-zero = HDR (first word is command, rest is data).

dataFlowDirection

enum I3C_TARGET_DATA_FLOW_DIRECTION dataFlowDirection

numOfBytesReceived

uint16_t numOfBytesReceived

numOfBytesTransmitted

uint16_t numOfBytesTransmitted

3.14.2.5 I3C_TARGET_TRANSMIT_COMMAND Struct Reference

Transfer command register layout as a 64-bit (two-word) structure.

3.14.2.5.1 Detailed Description

Transfer command register layout as a 64-bit (two-word) structure.

CMD_BYTE1 layout (first 32 bits): [2:0] CMD_ATTR - Command attribute (1 = Transmit Command) [5:3] RESERVED1 [6] FINITE_DL - Finite data length flag [7] RESERVED2 [15:8] ERR_STATUS - Error status [16] CMD_VLD - Command valid flag [23:17] RESERVED3 [24] CCC - CCC flag [26:25] ADDR_MSK - Address mask [27] RESERVED4 [31:28] ADDR_OFFSET - Address offset

CMD_BYTE2 layout (second 32 bits): [7:0] CCC_HDR_HEADER - CCC/HDR header [15:8] DB - Defining Byte [31:16] DATA_LENGTH - Data length in bytes

#include <i3c_target_types.h>

3.14.2.5.2 Field Documentation

The documentation for this struct was generated from the following file:

source/

i3c_target_types.h

ADDR_MSK

uint32_t ADDR_MSK

ADDR_OFFSET

uint32_t ADDR_OFFSET

BYTE1

uint32_t BYTE1

BYTE2

uint32_t BYTE2

CCC

uint32_t CCC

CCC_HDR_HEADER

uint32_t CCC_HDR_HEADER

CMD_ATTR

uint32_t CMD_ATTR

CMD_BYTE1

union { ... } CMD_BYTE1

CMD_BYTE2

union { ... } CMD_BYTE2

CMD_VLD

uint32_t CMD_VLD

DATA_LENGTH

uint32_t DATA_LENGTH

DB

uint32_t DB

ERR_STATUS

uint32_t ERR_STATUS

F[1/2]

struct { ... } F

F[2/2]

struct { ... } F

FINITE_DL

uint32_t FINITE_DL

RESERVED1

uint32_t RESERVED1

RESERVED2

uint32_t RESERVED2

RESERVED3

uint32_t RESERVED3

RESERVED4

uint32_t RESERVED4

3.14.3 File Documentation

3.14.3.1 source/i3c1.h File Reference

This is the generated driver header file for the I3C1 Target driver.

3.14.3.1.1 Functions

3.14.3.1.2 Variables

  • const struct I3C_TARGET_INTERFACE I3C1_Target

    Structure object of type I3C_TARGET_INTERFACE with the custom name given by the user in the Melody Driver User interface. The default name e.g. I3C_TARGET can be changed via the 'Custom Name' field. Application-specific naming allows API portability across peripheral instances.

3.14.3.1.3 Detailed Description

This is the generated driver header file for the I3C1 Target driver.

I3C1 Generated Driver Header File

3.14.3.2 source/i3c_target_interface.h File Reference

3.14.3.2.1 Data structures

3.14.3.2.2 Detailed Description

I3C Target Generated Driver Interface Header File

3.14.3.3 source/i3c_target_types.h File Reference

This is the generated driver types header file for the I3C1 Target driver.

3.14.3.3.1 Data structures

3.14.3.3.2 Enumerations

3.14.3.3.3 Detailed Description

This is the generated driver types header file for the I3C1 Target driver.

I3C1 Generated Driver Types Header File