3.16 I3C - Improved Inter-Integrated Circuit

3.16.1 Introduction

The MPLAB® Code Configurator (MCC) Melody Improved Inter-Integrated Circuit Peripheral Library (PLIBs) drivers generates APIs to support I3C-specific peripheral functionality on target MCUs. This PLIB is supported by the Melody I3C Target Drivers. Refer to I3C Target Driver for more details on the various I3C Target driver and use case examples.

The Improved Inter-Integrated Circuit (I3C) interface is also backward compatible with the I2C standard. Devices on the I3C bus communicate in a Controller/Target environment where either the Controller or the Target device can initiate the communication. The I3C module on PIC18F-Q20 adheres to MIPI I3C® Basic Specification 1.0. It only supports the Target functionality, without Controller capabilities.

Features

The I3C module supports the following key features :

  • Single Data Rate (SDR) Mode and High Data Rate (HDR) Exit Pattern. PIC18F-Q20 supports only SDR Mode and recognizes HDR Exit Pattern
  • Dynamic Address Assignment, Direct and Broadcast Common Command Codes (CCCs), and Private Read/Write Transfers
  • In-Band Interrupt (IBI) and Hot-Join Capabilities
  • Built-in Error Detection and Recovery
  • Integrated Direct Memory Access (DMA) Support
  • Five system level interrupts ie, General, Error, Transmit, Receive and Reset Interrupts. Further there are module level interrupts for General and Error Interrupts
  • Dedicated I3C SDA and SCL Pads with MVIO Support for 0.95V-3.63V. Supports communication up to 12.9 MHz

3.16.2 Supported Device Families

PIC18F-Q20

3.16.3 How to Use the I3C PLIB

The I3C PLIB consists of all the settings specific to the I3C hardware peripheral.

I3C Module Clock Selection

Clock selection is available under the Hardware Settings tab in the I3C PLIB .

I3C Pins Buffer Selection

The I3C SDA and SCL pins are in a different voltage domain powered by the Multi-Voltage I/O (MVIO). The VDDIOx power pin corresponding to the SDA/SCL pins must be powered up to the desired operating voltage level for the device to be present on the I3C bus.

To operate properly at a designated voltage level, the MVIO must be configured appropriately using the VDDIOxMD configuration bit.

This bit setting is available under Configuration bits under System module of the project resources.

The I3C SDA and SCL pads are equipped with a variety of input buffers. Refer to the below image to set appropriate input buffer based on the VDDIOx voltage level.

Input buffer selection option is available under Pins Advanced Settings tab in I3C PLIB.

Interrupt Settings

  • The I3C Target module has five top level system interrupts: Transmit, Receive, General, Error and Reset interrupts.
  • When the system level interrupts are enabled, the respective Interrupt Service Routine (ISR) is generated, and interrupt callbacks APIs are called in the ISRs. When the system level interrupts are disabled, the interrupt callback APIs are polled in I3Cx_Tasks() API.
  • I3C module has various module level interrupts for General and Error system level interrupts.
  • The system level General I3C Interrupt (I3CxIF) is a logical OR of various general interrupts at the I3C module level. Similarly, the system level Error I3C Interrupt (I3CxEIF) is a logical OR of various error interrupts at the I3C module level.
  • The user may enable only the desired module level interrupts. Callbacks are generated only if the module level interrupts are enabled.
  • If the user disables any module-level interrupt, then the respective callbacks will not be generated in the code.
    Note: The generated callbacks are either called in ISR or in I3Cx_Tasks() API as per the system level interrupt status (mentioned above)
  • If interrupts are enabled, enable the Global Interrupt (GIE) by uncommenting the below lines in main.c.

3.16.4 Module Documentation

3.16.4.1 I3C TARGET DRIVER

This file contains API prototypes and other data types for the I3C1 Target DMA driver.

3.16.4.1.1 Module description

This file contains API prototypes and other data types for the I3C1 Target DMA driver.

Version: I3C Target DMA Source Code Driver Version 1.0.0 I3C Melody Peripheral Library (PLIB) Version 1.0.0
Definitions
Functions

3.16.4.1.2 Definition Documentation

I3C1_Target_AbortErrorCallbackRegister

#define I3C1_Target_AbortErrorCallbackRegister I3C1_AbortErrorCallbackRegister

Defines the Custom Name for I3C1_AbortErrorCallbackRegister() API.

I3C1_Target_AllPrivateTransactionACK

#define I3C1_Target_AllPrivateTransactionACK I3C1_AllPrivateTransactionACK

Defines the Custom Name for I3C1_AllPrivateTransactionACK() API.

I3C1_Target_AllPrivateTransactionNACK

#define I3C1_Target_AllPrivateTransactionNACK I3C1_AllPrivateTransactionNACK

Defines the Custom Name for I3C1_AllPrivateTransactionNACK() API.

I3C1_Target_BufferReceive

#define I3C1_Target_BufferReceive I3C1_BufferReceive

Defines the Custom Name for I3C1_BufferReceive() API.

I3C1_Target_BufferTransmit

#define I3C1_Target_BufferTransmit I3C1_BufferTransmit

Defines the Custom Name for I3C1_BufferTransmit() API.

I3C1_Target_BusContextGet

#define I3C1_Target_BusContextGet I3C1_BusContextGet

Defines the Custom Name for I3C1_BusContextGet() API.

I3C1_Target_BusErrorCallbackRegister

#define I3C1_Target_BusErrorCallbackRegister I3C1_BusErrorCallbackRegister

Defines the Custom Name for I3C1_BusErrorCallbackRegister() API.

I3C1_Target_BusErrorStatusGetAndClear

#define I3C1_Target_BusErrorStatusGetAndClear I3C1_BusErrorStatusGetAndClear

Defines the Custom Name for I3C1_BusErrorStatusGetAndClear() API.

I3C1_Target_BusTimeoutCallbackRegister

#define I3C1_Target_BusTimeoutCallbackRegister I3C1_BusTimeoutCallbackRegister

Defines the Custom Name for I3C1_BusTimeoutCallbackRegister() API.

I3C1_Target_BusTimeoutDisable

#define I3C1_Target_BusTimeoutDisable I3C1_BusTimeoutDisable

Defines the Custom Name for I3C1_BusTimeoutDisable() API.

I3C1_Target_BusTimeoutEnable

#define I3C1_Target_BusTimeoutEnable I3C1_BusTimeoutEnable

Defines the Custom Name for I3C1_BusTimeoutEnable() API.

I3C1_Target_ByteReceive

#define I3C1_Target_ByteReceive I3C1_ByteReceive

Defines the Custom Name for I3C1_ByteReceive() API.

I3C1_Target_ByteTransferFinishedCallbackRegister

#define I3C1_Target_ByteTransferFinishedCallbackRegister I3C1_ByteTransferFinishedCallbackRegister

Defines the Custom Name for I3C1_ByteTransferFinishedCallbackRegister() API.

I3C1_Target_Disable

#define I3C1_Target_Disable I3C1_Disable

Defines the Custom Name for I3C1_Disable() API.

I3C1_Target_DynamicAddressChangedCallbackRegister

#define I3C1_Target_DynamicAddressChangedCallbackRegister I3C1_DynamicAddressChangedCallbackRegister

Defines the Custom Name for I3C1_DynamicAddressChangedCallbackRegister() API.

I3C1_Target_DynamicAddressMatchCallbackRegister

#define I3C1_Target_DynamicAddressMatchCallbackRegister I3C1_DynamicAddressMatchCallbackRegister

Defines the Custom Name for I3C1_DynamicAddressMatchCallbackRegister() API.

I3C1_Target_Enable

#define I3C1_Target_Enable I3C1_Enable

Defines the Custom Name for I3C1_Enable() API.

I3C1_Target_HotJoinErrorCallbackRegister

#define I3C1_Target_HotJoinErrorCallbackRegister I3C1_HotJoinErrorCallbackRegister

Defines the Custom Name for I3C1_HotJoinErrorCallbackRegister() API.

I3C1_Target_HotJoinRequest

#define I3C1_Target_HotJoinRequest I3C1_HotJoinRequest

Defines the Custom Name for I3C1_HotJoinRequest() API.

I3C1_Target_HotJoinStatusGet

#define I3C1_Target_HotJoinStatusGet I3C1_HotJoinStatusGet

Defines the Custom Name for I3C1_HotJoinStatusGet() API.

I3C1_Target_I2CAckReceivedCallbackRegister

#define I3C1_Target_I2CAckReceivedCallbackRegister I3C1_I2CAckReceivedCallbackRegister

Defines the Custom Name for I3C1_I2CAckReceivedCallbackRegister() API.

I3C1_Target_I2CNackReceivedCallbackRegister

#define I3C1_Target_I2CNackReceivedCallbackRegister I3C1_I2CNackReceivedCallbackRegister

Defines the Custom Name for I3C1_I2CNackReceivedCallbackRegister() API.

I3C1_Target_IBIDoneCallbackRegister

#define I3C1_Target_IBIDoneCallbackRegister I3C1_IBIDoneCallbackRegister

Defines the Custom Name for I3C1_IBIDoneCallbackRegister() API.

I3C1_Target_IBIErrorCallbackRegister

#define I3C1_Target_IBIErrorCallbackRegister I3C1_IBIErrorCallbackRegister

Defines the Custom Name for I3C1_IBIErrorCallbackRegister() API.

I3C1_Target_IBIMandatoryDataByteSet

#define I3C1_Target_IBIMandatoryDataByteSet I3C1_IBIMandatoryDataByteSet

Defines the Custom Name for I3C1_IBIMandatoryDataByteSet() API.

I3C1_Target_IBIPayloadSizeGet

#define I3C1_Target_IBIPayloadSizeGet I3C1_IBIPayloadSizeGet

Defines the Custom Name for I3C1_IBIPayloadSizeGet() API.

I3C1_Target_IBIPayloadSizeSet

#define I3C1_Target_IBIPayloadSizeSet I3C1_IBIPayloadSizeSet

Defines the Custom Name for I3C1_IBIPayloadSizeSet() API.

I3C1_Target_IBIRequest

#define I3C1_Target_IBIRequest I3C1_IBIRequest

Defines the Custom Name for I3C1_IBIRequest() API.

I3C1_Target_Initialize

#define I3C1_Target_Initialize I3C1_Initialize

Defines the Custom Name for I3C1_Initialize() API.

I3C1_Target_IsBusFree

#define I3C1_Target_IsBusFree I3C1_IsBusFree

Defines the Custom Name for I3C1_IsBusFree() API.

I3C1_Target_IsHotJoinEnabledOnBus

#define I3C1_Target_IsHotJoinEnabledOnBus I3C1_IsHotJoinEnabledOnBus

Defines the Custom Name for I3C1_IsHotJoinEnabledOnBus() API.

I3C1_Target_IsIBIEnabledOnBus

#define I3C1_Target_IsIBIEnabledOnBus I3C1_IsIBIEnabledOnBus

Defines the Custom Name for I3C1_IsIBIEnabledOnBus() API.

I3C1_Target_IsRxBufferFull

#define I3C1_Target_IsRxBufferFull I3C1_IsRxBufferFull

Defines the Custom Name for I3C1_IsRxBufferFull() API.

I3C1_Target_IsTxBufferEmpty

#define I3C1_Target_IsTxBufferEmpty I3C1_IsTxBufferEmpty

Defines the Custom Name for I3C1_IsTxBufferEmpty() API.

I3C1_Target_IsTxFIFOEmpty

#define I3C1_Target_IsTxFIFOEmpty I3C1_IsTxFIFOEmpty

Defines the Custom Name for I3C1_IsTxFIFOEmpty() API.

I3C1_Target_LastCCCReceivedGet

#define I3C1_Target_LastCCCReceivedGet I3C1_LastCCCReceivedGet

Defines the Custom Name for I3C1_LastCCCReceivedGet() API.

I3C1_Target_MaxReadLengthGet

#define I3C1_Target_MaxReadLengthGet I3C1_MaxReadLengthGet

Defines the Custom Name for I3C1_MaxReadLengthGet() API.

I3C1_Target_MaxReadLengthSet

#define I3C1_Target_MaxReadLengthSet I3C1_MaxReadLengthSet

Defines the Custom Name for I3C1_MaxReadLengthSet() API.

I3C1_Target_MaxWriteLengthGet

#define I3C1_Target_MaxWriteLengthGet I3C1_MaxWriteLengthGet

Defines the Custom Name for I3C1_MaxWriteLengthGet() API.

I3C1_Target_MaxWriteLengthOverSizeCallbackRegister

#define I3C1_Target_MaxWriteLengthOverSizeCallbackRegister I3C1_MaxWriteLengthOverSizeCallbackRegister

Defines the Custom Name for I3C1_MaxWriteLengthOverSizeCallbackRegister() API.

I3C1_Target_MaxWriteLengthSet

#define I3C1_Target_MaxWriteLengthSet I3C1_MaxWriteLengthSet

Defines the Custom Name for I3C1_MaxWriteLengthSet() API.

I3C1_Target_NextPrivateTransactionACK

#define I3C1_Target_NextPrivateTransactionACK I3C1_NextPrivateTransactionACK

Defines the Custom Name for I3C1_NextPrivateTransactionACK() API.

I3C1_Target_OperatingModeGet

#define I3C1_Target_OperatingModeGet I3C1_OperatingModeGet

Defines the Custom Name for I3C1_OperatingModeGet() API.

I3C1_Target_PeripheralReset

#define I3C1_Target_PeripheralReset I3C1_PeripheralReset

Defines the Custom Name for I3C1_PeripheralReset() API.

I3C1_Target_ReceiveBufferReadErrorCallbackRegister

#define I3C1_Target_ReceiveBufferReadErrorCallbackRegister I3C1_ReceiveBufferReadErrorCallbackRegister

Defines the Custom Name for I3C1_ReceiveBufferReadErrorCallbackRegister() API.

I3C1_Target_ReceiveOverrunCallbackRegister

#define I3C1_Target_ReceiveOverrunCallbackRegister I3C1_ReceiveOverrunCallbackRegister

Defines the Custom Name for I3C1_ReceiveOverrunCallbackRegister() API.

I3C1_Target_ResetActionGetAndClear

#define I3C1_Target_ResetActionGetAndClear I3C1_ResetActionGetAndClear

Defines the Custom Name for I3C1_ResetActionGetAndClear() API.

I3C1_Target_ResetPatternDetectedCallbackRegister

#define I3C1_Target_ResetPatternDetectedCallbackRegister I3C1_ResetPatternDetectedCallbackRegister

Defines the Custom Name for I3C1_ResetPatternDetectedCallbackRegister() API.

I3C1_Target_RestartConditionDetectedCallbackRegister

#define I3C1_Target_RestartConditionDetectedCallbackRegister I3C1_RestartConditionDetectedCallbackRegister

Defines the Custom Name for I3C1_RestartConditionDetectedCallbackRegister() API.

I3C1_Target_RxBufferFIFOClear

#define I3C1_Target_RxBufferFIFOClear I3C1_RxBufferFIFOClear

Defines the Custom Name for I3C1_RxBufferFIFOClear() API.

I3C1_Target_RxSoftwareBufferFullCallbackRegister

#define I3C1_Target_RxSoftwareBufferFullCallbackRegister I3C1_RxSoftwareBufferFullCallbackRegister

Defines the Custom Name for I3C1_RxSoftwareBufferFullCallbackRegister() API.

I3C1_Target_StartConditionDetectedCallbackRegister

#define I3C1_Target_StartConditionDetectedCallbackRegister I3C1_StartConditionDetectedCallbackRegister

Defines the Custom Name for I3C1_StartConditionDetectedCallbackRegister() API.

I3C1_Target_StaticAddressMatchCallbackRegister

#define I3C1_Target_StaticAddressMatchCallbackRegister I3C1_StaticAddressMatchCallbackRegister

Defines the Custom Name for I3C1_StaticAddressMatchCallbackRegister() API.

I3C1_Target_StopConditionDetectedCallbackRegister

#define I3C1_Target_StopConditionDetectedCallbackRegister I3C1_StopConditionDetectedCallbackRegister

Defines the Custom Name for I3C1_StopConditionDetectedCallbackRegister() API.

I3C1_Target_SupportedCCCReceivedCallbackRegister

#define I3C1_Target_SupportedCCCReceivedCallbackRegister I3C1_SupportedCCCReceivedCallbackRegister

Defines the Custom Name for I3C1_SupportedCCCReceivedCallbackRegister() API.

I3C1_Target_TransactionCompleteCallbackRegister

#define I3C1_Target_TransactionCompleteCallbackRegister I3C1_TransactionCompleteCallbackRegister

Defines the Custom Name for I3C1_TransactionCompleteCallbackRegister() API.

I3C1_Target_TransmitBufferWriteErrorCallbackRegister

#define I3C1_Target_TransmitBufferWriteErrorCallbackRegister I3C1_TransmitBufferWriteErrorCallbackRegister

Defines the Custom Name for I3C1_TransmitBufferWriteErrorCallbackRegister() API.

I3C1_Target_TransmitUnderrunCallbackRegister

#define I3C1_Target_TransmitUnderrunCallbackRegister I3C1_TransmitUnderrunCallbackRegister

Defines the Custom Name for I3C1_TransmitUnderrunCallbackRegister() API.

I3C1_Target_TxBufferFIFOClear

#define I3C1_Target_TxBufferFIFOClear I3C1_TxBufferFIFOClear

Defines the Custom Name for I3C1_TxBufferFIFOClear() API.

I3C1_Target_UnsupportedCCCReceivedCallbackRegister

#define I3C1_Target_UnsupportedCCCReceivedCallbackRegister I3C1_UnsupportedCCCReceivedCallbackRegister

Defines the Custom Name for I3C1_UnsupportedCCCReceivedCallbackRegister() API.

3.16.4.1.3 Function Documentation

I3C1_AbortErrorCallbackRegister()

void I3C1_AbortErrorCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_AbortError callback.

Parameters:
in handler

- Pointer to the function to be called when controller aborts transmission of IBI Payload or a Private Read data.  

Returns:

None.  

I3C1_AllPrivateTransactionACK()

void I3C1_AllPrivateTransactionACK (void )

Sets the target to always ACK a Private Read and Private Write transaction request.

Note:

This API is limited only to Private Write transactions for PIC18F06/16Q20 B2 silicon revision.

Returns:

None.  

I3C1_AllPrivateTransactionNACK()

void I3C1_AllPrivateTransactionNACK (void )

Sets the target to always NACK a Private Read and Private Write transaction request.

Note:

This API is limited only to Private Write transactions for PIC18F06/16Q20 B2 silicon revision.

Parameters:
None.
Returns:

None.  

I3C1_BufferReceive()

enum I3C_TARGET_BUFFER_RECEIVE_ERROR I3C1_BufferReceive (uint8_t * rxBuf, uint16_t len)

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

Parameters:
in rxBuf

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

Note:

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

Parameters:
in len

- Size of the buffer.

Note:

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

Returns:

Status of the I3C1 buffer receive operation as described in I3C_TARGET_BUFFER_RECEIVE_ERROR.

I3C1_BufferTransmit()

enum I3C_TARGET_BUFFER_TRANSMIT_ERROR I3C1_BufferTransmit (uint8_t * txBuf, uint16_t len)

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

Parameters:
in txBuf

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

Note:

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

Parameters:
in len

- Number of data bytes to be transmitted.

Returns:

Status of the I3C1 buffer transmit operation as described in I3C_TARGET_BUFFER_TRANSMIT_ERROR.

I3C1_BusContextGet()

uint8_t I3C1_BusContextGet (void )

Returns the context used on the bus.

Parameters:
None.
Returns:

Bus context as described by MIPI specification.  

I3C1_BusErrorCallbackRegister()

void I3C1_BusErrorCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_BusError callback.

Parameters:
in handler

- Pointer to the function to be called when an TE0-TE6 type error on the bus is detected.

Returns:

None.  

I3C1_BusErrorStatusGetAndClear()

uint8_t I3C1_BusErrorStatusGetAndClear (void )

Returns the Bus Error status and clears the status.  

Parameters:
None.
Returns:

Status of Bus Error.

I3C1_BusTimeoutCallbackRegister()

void I3C1_BusTimeoutCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_BusTimeout callback.

Parameters:
in handler

- Pointer to the function to be called when a Bus Time-out is detected.

Returns:

None.  

I3C1_BusTimeoutDisable()

void I3C1_BusTimeoutDisable (void )

Disables the bus time-out counter.

Parameters:
None.
Returns:

None.  

I3C1_BusTimeoutEnable()

void I3C1_BusTimeoutEnable (void )

Enables the bus time-out counter.  

Parameters:
None.
Returns:

None.  

I3C1_ByteReceive()

uint8_t I3C1_ByteReceive (void )

Reads one byte from the Receive Buffer.

Note:

This API must be called to read only the residue bytes available in the hardware buffer.

Precondition:

I3C1_BufferReceive() function is already called.

Parameters:
None.
Returns:

Byte read from the Receive Buffer.

I3C1_ByteTransferFinishedCallbackRegister()

void I3C1_ByteTransferFinishedCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_ByteTransferFinished callback.

Parameters:
in handler

- Pointer to the function to be called when a byte transfer is completed during Private I3C or an IBI transaction.

Returns:

None.  

I3C1_Disable()

void I3C1_Disable (void )

Disables I3C1 Target module.

Parameters:
None.
Returns:

None.  

I3C1_DynamicAddressChangedCallbackRegister()

void I3C1_DynamicAddressChangedCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_DynamicAddressChanged callback.

Parameters:
in handler

- Pointer to the function to be called when a new dynamic address is assigned.

Returns:

None.  

I3C1_DynamicAddressMatchCallbackRegister()

void I3C1_DynamicAddressMatchCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_DynamicAddressMatch callback.

Parameters:
in handler

- Pointer to the function to be called when a dynamic address match occurs during Private or Direct CCC transaction.

Returns:

None.  

I3C1_Enable()

void I3C1_Enable (void )

Enables the I3C1 Target module.

Parameters:
None.

 

Returns:

None.

I3C1_HotJoinErrorCallbackRegister()

void I3C1_HotJoinErrorCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_HotJoinError callback.

Parameters:
in handler

- Pointer to the function to be called when a Hot-Join request exceeded the arbitration retry limit.

Returns:

None.  

I3C1_HotJoinRequest()

enum I3C_TARGET_HJ_REQUEST_ERROR I3C1_HotJoinRequest (void )

Initiates the target's request for a Hot-Join to an I3C bus.

Parameters:
None.
Returns:

Error status of the Hot-Join request as described in I3C_TARGET_HJ_REQUEST_ERROR.  

I3C1_HotJoinStatusGet()

enum I3C_TARGET_HJ_STATUS I3C1_HotJoinStatusGet (void )

Returns the status of a Hot-Join request operation by a target.

Parameters:
None.
Returns:

Status of a Hot-Join request operation as described in I3C_TARGET_HJ_STATUS.  

I3C1_I2CAckReceivedCallbackRegister()

void I3C1_I2CAckReceivedCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_I2CAckReceived callback.

Parameters:
in handler

- Pointer to the function to be called when an I2C ACK signal is received.

Returns:

None.  

I3C1_I2CNackReceivedCallbackRegister()

void I3C1_I2CNackReceivedCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_I2CNackReceived callback.

Parameters:
in handler

- Pointer to the function to be called when an I2C NACK signal is received.

Returns:

None.  

I3C1_IBIDoneCallbackRegister()

void I3C1_IBIDoneCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_IBIDone callback.

Parameters:
in handler

- Pointer to the function to be called when an In-Band Interrupt request process is completed or controller aborts the IBI transaction.

Returns:

None.  

I3C1_IBIErrorCallbackRegister()

void I3C1_IBIErrorCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_IBIError callback.

Parameters:
in handler

- Pointer to the function to be called when an In-Band Interrupt request exceeded the arbitration retry limit.

Returns:

None.  

I3C1_IBIMandatoryDataByteSet()

void I3C1_IBIMandatoryDataByteSet (uint8_t mdb)

Sets the value of mandatory data byte in an In-Band Interrupt.  

Parameters:
in mdb

- Mandatory data byte.  

Returns:

None.

I3C1_IBIPayloadSizeGet()

uint8_t I3C1_IBIPayloadSizeGet (void )

Returns the payload size of an In-Band Interrupt.

Parameters:
None.
Returns:

Payload size of In-Band Interrupt.

I3C1_IBIPayloadSizeSet()

void I3C1_IBIPayloadSizeSet (uint8_t payload_len)

Sets the payload size of an In-Band Interrupt.

Parameters:
in payload_len

- Number of bytes of the payload.

Returns:

None.

I3C1_IBIRequest()

enum I3C_TARGET_IBI_REQUEST_ERROR I3C1_IBIRequest (uint8_t * payloadBuf, uint16_t payload_len)

Configures buffer for the next In-Band Interrupt (IBI) transaction and initiates a IBI request.

Parameters:
in payloadBuf

- Pointer to the payload buffer of In-Band Interrupt.

Note:

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

Parameters:
in payload_len

- Length the payload in bytes.

Note:

Payload Buffer and its length does not include Mandatory Data Byte.

Returns:

Error status of the In-Band Interrupt request as described in I3C_TARGET_IBI_REQUEST_ERROR.  

I3C1_Initialize()

void I3C1_Initialize (void )

Initializes the I3C1 module.

Parameters:
None.
Returns:

None.

I3C1_IsBusFree()

bool I3C1_IsBusFree (void )

Checks if the I3C1 bus is free.  

Parameters:
None.

 

Return values:
True

- I3C1 bus is free.

False

- I3C1 bus is not free.  

I3C1_IsHotJoinEnabledOnBus()

bool I3C1_IsHotJoinEnabledOnBus (void )

Checks if the Hot-Join capability is enabled on the bus.  

Parameters:
None.

 

Return values:
True

- Hot-Join is enabled on the bus.

False

- Hot-Join is not enabled on the bus.  

I3C1_IsIBIEnabledOnBus()

bool I3C1_IsIBIEnabledOnBus (void )

Checks if an In-Band Interrupt is enabled on the I3C bus.

Parameters:
None.
Return values:
True

- In-Band Interrupt is enabled.

False

- In-Band Interrupt is not enabled.

I3C1_IsRxBufferFull()

bool I3C1_IsRxBufferFull (void )

Returns the status of the Receive buffer.

Parameters:
None.
Return values:
True

- Receive Buffer is full.

False

- Receive Buffer is not full.

I3C1_IsTxBufferEmpty()

bool I3C1_IsTxBufferEmpty (void )

Returns the status of the Transmit buffer.

Parameters:
None.
Return values:
True

- Transmit Buffer is empty.

False

- Transmit Buffer is not empty.  

I3C1_IsTxFIFOEmpty()

bool I3C1_IsTxFIFOEmpty (void )

Returns the status of the Transmit File In, File Out (FIFO) buffer.

Parameters:
None.
Return values:
True

- Transmit FIFO is empty.

False

- Transmit FIFO is not empty.

I3C1_LastCCCReceivedGet()

enum I3C_CCC I3C1_LastCCCReceivedGet (void )

Returns the most recently received Common Code Command (CCC) from the controller.

Parameters:
None.
Returns:

Common Code Command received from the controller.

I3C1_MaxReadLengthGet()

uint16_t I3C1_MaxReadLengthGet (void )

Returns the maximum read length configured for a Private Read transaction.

Parameters:
None.
Returns:

Maximum read length for a Private Read transaction.

I3C1_MaxReadLengthSet()

void I3C1_MaxReadLengthSet (uint16_t maxReadLen)

Sets the maximum read length for a Private Read transaction.

Parameters:
in maxReadLen

- Maximum read length for a Private Read transaction.

Returns:

None.

I3C1_MaxWriteLengthGet()

uint16_t I3C1_MaxWriteLengthGet (void )

Returns the maximum write length configured for a Private Write transaction.

Parameters:
None.
Returns:

Maximum write length for a Private Write transaction.

I3C1_MaxWriteLengthOverSizeCallbackRegister()

void I3C1_MaxWriteLengthOverSizeCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_MaxWriteLengthOverSize callback.

Parameters:
I3C1_MaxWriteLengthSet()

void I3C1_MaxWriteLengthSet (uint16_t maxWriteLen)

Sets the maximum write length configured for a Private Write transaction.

Parameters:
in maxWriteLen

- Maximum write length for a Private Write transaction.

Returns:

None.

I3C1_NextPrivateTransactionACK()

void I3C1_NextPrivateTransactionACK (void )

Enables the one-shot ACK of a Private Read and Private Write transaction request.

Note:

This API is limited only to Private Write transactions for PIC18F06/16Q20 B2 silicon revision.

Parameters:
None.
Returns:

None.  

I3C1_OperatingModeGet()

enum I3C_TARGET_OPERATING_MODE I3C1_OperatingModeGet (void )

Returns the Operating mode of the I3C1 module.  

Parameters:
None.

 

Returns:

Operating mode as described in I3C_TARGET_OPERATING_MODE.  

I3C1_PeripheralReset()

void I3C1_PeripheralReset (void )

Resets I3C1 Target module to default state.  

Parameters:
None.

 

Returns:

None.

I3C1_ReceiveBufferReadErrorCallbackRegister()

void I3C1_ReceiveBufferReadErrorCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_ReceiveBufferReadError callback.

Parameters:
in handler

- Pointer to the function to be called when Receive Buffer is attempted to read when not full.

Returns:

None.  

I3C1_ReceiveOverrunCallbackRegister()

void I3C1_ReceiveOverrunCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_ReceiveOverrun callback.

Parameters:
in handler

- Pointer to the function to be called when controller attempted to write to a full Receive FIFO.

Returns:

None.  

I3C1_ResetActionGetAndClear()

enum I3C_RESET_ACTION I3C1_ResetActionGetAndClear (void )

Returns the target reset action and clears the action to the default value.

Parameters:
None.

 

Returns:

The value of target reset action as described in I3C_RESET_ACTION.

I3C1_ResetPatternDetectedCallbackRegister()

void I3C1_ResetPatternDetectedCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_ResetPatternDetected callback.

Parameters:
in handler

- Pointer to the function to be called when a Reset Pattern is detected.

Returns:

None.

I3C1_RestartConditionDetectedCallbackRegister()

void I3C1_RestartConditionDetectedCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_RestartConditionDetected callback.

Parameters:
in handler

- Pointer to the function to be called when a Restart Condition is detected in SDR mode.

Returns:

None.  

I3C1_RxBufferFIFOClear()

void I3C1_RxBufferFIFOClear (void )

Clears the Receive buffer and FIFO.  

Parameters:
None.
Returns:

None.  

I3C1_RxSoftwareBufferFullCallbackRegister()

void I3C1_RxSoftwareBufferFullCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_RxSoftwareBufferFull callback.

Parameters:
in handler

- Pointer to the function to be called when the Driver Receive Buffer is full.

Returns:

None.

I3C1_StartConditionDetectedCallbackRegister()

void I3C1_StartConditionDetectedCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_StartConditionDetected callback.

Parameters:
in handler

- Pointer to the function to be called when a Start Condition is detected in SDR mode.

Returns:

None.  

I3C1_StaticAddressMatchCallbackRegister()

void I3C1_StaticAddressMatchCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_StaticAddressMatch callback.

Parameters:
in handler

- Pointer to the function to be called when a static address match occurs in Static Address SDR mode.

Returns:

None.  

I3C1_StopConditionDetectedCallbackRegister()

void I3C1_StopConditionDetectedCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_StopConditionDetected callback.

Parameters:
in handler

- Pointer to the function to be called when a Stop Condition is detected in SDR mode.

Returns:

None.  

I3C1_SupportedCCCReceivedCallbackRegister()

void I3C1_SupportedCCCReceivedCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_SupportedCCCReceived callback.

Parameters:
in handler

- Pointer to the function to be called when a Supported Common Code Command is received.

Returns:

None.  

I3C1_Tasks()

void I3C1_Tasks (void )

Used to implement the tasks for polled implementations.

Parameters:
None.
Returns:

None.

I3C1_TransactionCompleteCallbackRegister()

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

Setter function for the I3C1_TransactionComplete callback.

Parameters:
in handler

- Pointer to the function to be called when Stop or Restart condition is detected after a Private I3C or an IBI transaction.  

Returns:

None.  

I3C1_TransmitBufferWriteErrorCallbackRegister()

void I3C1_TransmitBufferWriteErrorCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_TransmitBufferWriteError callback.

Parameters:
in handler

- Pointer to the function to be called when Transmit Buffer is attempted to write when not empty.

Returns:

None.  

I3C1_TransmitUnderrunCallbackRegister()

void I3C1_TransmitUnderrunCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_TransmitUnderrun callback.

Parameters:
in handler

- Pointer to the function to be called when a controller attempted to read from an empty Transmit FIFO.

Returns:

None.  

I3C1_TxBufferFIFOClear()

void I3C1_TxBufferFIFOClear (void )

Clears the Transmit buffer and FIFO.

Parameters:
None.
Returns:

None.

I3C1_UnsupportedCCCReceivedCallbackRegister()

void I3C1_UnsupportedCCCReceivedCallbackRegister (void(*)(void) handler)

Setter function for the I3C1_UnsupportedCCCReceived callback.

Parameters:
in handler

- Pointer to the function to be called when an unsupported Common Code Command is received.

Returns:

None.  

3.16.5 File Documentation

3.16.5.1 source/i3c1_interrupt.c File Reference

#include <xc.h>
#include "../i3c1.h"
#include "../../dma/dma1.h"
#include "../../dma/dma2.h"

3.16.5.1.1 Maximum data bytes supported in a DMA transaction.

3.16.5.1.2 Function Documentation

__interrupt()[1/3]

void __interrupt (irq(IRQ_I3C1) , base(8) )

__interrupt()[2/3]

void __interrupt (irq(IRQ_I3C1E) , base(8) )

__interrupt()[3/3]

void __interrupt (irq(IRQ_I3C1R) , base(8) )

I3C1_NumOfBytesReceivedGet()

static uint16_t I3C1_NumOfBytesReceivedGet (void )[static]

I3C1_ResetRxDMA()

static void I3C1_ResetRxDMA (void )[static]

I3C1_RxDMA_DCNTI_Handler()

static void I3C1_RxDMA_DCNTI_Handler (void )[static]

3.16.5.1.3 Macro Definition Documentation

DMA_MAX_BYTES_PER_TRANSACTION

#define DMA_MAX_BYTES_PER_TRANSACTION (4095U)

3.16.5.1.4 Variable Documentation

I3C1_AbortErrorHandler

void(* I3C1_AbortErrorHandler) (void) = NULL[static]

I3C1_BusErrorHandler

void(* I3C1_BusErrorHandler) (void) = NULL[static]

I3C1_BusTimeoutHandler

void(* I3C1_BusTimeoutHandler) (void) = NULL[static]

I3C1_ByteTransferFinishedHandler

void(* I3C1_ByteTransferFinishedHandler) (void) = NULL[static]

I3C1_DynamicAddressChangedHandler

void(* I3C1_DynamicAddressChangedHandler) (void) = NULL[static]

I3C1_DynamicAddressMatchHandler

void(* I3C1_DynamicAddressMatchHandler) (void) = NULL[static]

I3C1_HotJoinErrorHandler

void(* I3C1_HotJoinErrorHandler) (void) = NULL[static]

I3C1_I2CAckReceivedHandler

void(* I3C1_I2CAckReceivedHandler) (void) = NULL[static]

I3C1_I2CNackReceivedHandler

void(* I3C1_I2CNackReceivedHandler) (void) = NULL[static]

I3C1_IBIDoneHandler

void(* I3C1_IBIDoneHandler) (void) = NULL[static]

I3C1_IBIErrorHandler

void(* I3C1_IBIErrorHandler) (void) = NULL[static]

I3C1_MaxWriteLengthOverSizeHandler

void(* I3C1_MaxWriteLengthOverSizeHandler) (void) = NULL[static]

I3C1_ReceiveBufferReadErrorHandler

void(* I3C1_ReceiveBufferReadErrorHandler) (void) = NULL[static]

I3C1_ReceiveOverrunHandler

void(* I3C1_ReceiveOverrunHandler) (void) = NULL[static]

I3C1_ResetPatternDetectedHandler

void(* I3C1_ResetPatternDetectedHandler) (void) = NULL[static]

I3C1_RestartConditionDetectedHandler

void(* I3C1_RestartConditionDetectedHandler) (void) = NULL[static]

I3C1_RxSoftwareBufferFullHandler

void(* I3C1_RxSoftwareBufferFullHandler) (void) = NULL[static]

I3C1_StartConditionDetectedHandler

void(* I3C1_StartConditionDetectedHandler) (void) = NULL[static]

I3C1_StaticAddressMatchHandler

void(* I3C1_StaticAddressMatchHandler) (void) = NULL[static]

I3C1_StopConditionDetectedHandler

void(* I3C1_StopConditionDetectedHandler) (void) = NULL[static]

I3C1_SupportedCCCReceivedHandler

void(* I3C1_SupportedCCCReceivedHandler) (void) = NULL[static]

I3C1_TransactionCompleteHandler

void(* I3C1_TransactionCompleteHandler) (struct I3C_TARGET_TRANSACTION_COMPLETE_STATUS *transactionCompleteStatus) = NULL[static]

I3C1_TransmitBufferWriteErrorHandler

void(* I3C1_TransmitBufferWriteErrorHandler) (void) = NULL[static]

I3C1_TransmitUnderrunHandler

void(* I3C1_TransmitUnderrunHandler) (void) = NULL[static]

I3C1_UnsupportedCCCReceivedHandler

void(* I3C1_UnsupportedCCCReceivedHandler) (void) = NULL[static]

isI3C1RxSoftwareBufferFull

volatile bool isI3C1RxSoftwareBufferFull = false[static]

transactionCompleteStatus

struct I3C_TARGET_TRANSACTION_COMPLETE_STATUS transactionCompleteStatus[static]

3.16.5.2 source/i3c1_interrupt.h File Reference

#include <stdbool.h>
#include <stdint.h>
#include "i3c_target_types.h"

3.16.5.2.1 Functions

3.16.5.2.2 Macros

3.16.5.3 source/i3c1_polling.c File Reference

#include <xc.h>
#include "../i3c1.h"
#include "../../dma/dma1.h"
#include "../../dma/dma2.h"

3.16.5.3.1 Maximum data bytes supported in a DMA transaction.

3.16.5.3.2 Function Documentation

I3C1_NumOfBytesReceivedGet()

static uint16_t I3C1_NumOfBytesReceivedGet (void )[static]

I3C1_ResetRxDMA()

static void I3C1_ResetRxDMA (void )[static]

I3C1_RxDMA_DCNTI_Handler()

static void I3C1_RxDMA_DCNTI_Handler (void )[static]

3.16.5.3.3 Macro Definition Documentation

DMA_MAX_BYTES_PER_TRANSACTION

#define DMA_MAX_BYTES_PER_TRANSACTION (4095U)

3.16.5.3.4 Variable Documentation

I3C1_AbortErrorHandler

void(* I3C1_AbortErrorHandler) (void) = NULL[static]

I3C1_BusErrorHandler

void(* I3C1_BusErrorHandler) (void) = NULL[static]

I3C1_BusTimeoutHandler

void(* I3C1_BusTimeoutHandler) (void) = NULL[static]

I3C1_ByteTransferFinishedHandler

void(* I3C1_ByteTransferFinishedHandler) (void) = NULL[static]

I3C1_DynamicAddressChangedHandler

void(* I3C1_DynamicAddressChangedHandler) (void) = NULL[static]

I3C1_DynamicAddressMatchHandler

void(* I3C1_DynamicAddressMatchHandler) (void) = NULL[static]

I3C1_HotJoinErrorHandler

void(* I3C1_HotJoinErrorHandler) (void) = NULL[static]

I3C1_I2CAckReceivedHandler

void(* I3C1_I2CAckReceivedHandler) (void) = NULL[static]

I3C1_I2CNackReceivedHandler

void(* I3C1_I2CNackReceivedHandler) (void) = NULL[static]

I3C1_IBIDoneHandler

void(* I3C1_IBIDoneHandler) (void) = NULL[static]

I3C1_IBIErrorHandler

void(* I3C1_IBIErrorHandler) (void) = NULL[static]

I3C1_MaxWriteLengthOverSizeHandler

void(* I3C1_MaxWriteLengthOverSizeHandler) (void) = NULL[static]

I3C1_ReceiveBufferReadErrorHandler

void(* I3C1_ReceiveBufferReadErrorHandler) (void) = NULL[static]

I3C1_ReceiveOverrunHandler

void(* I3C1_ReceiveOverrunHandler) (void) = NULL[static]

I3C1_ResetPatternDetectedHandler

void(* I3C1_ResetPatternDetectedHandler) (void) = NULL[static]

I3C1_RestartConditionDetectedHandler

void(* I3C1_RestartConditionDetectedHandler) (void) = NULL[static]

I3C1_RxSoftwareBufferFullHandler

void(* I3C1_RxSoftwareBufferFullHandler) (void) = NULL[static]

I3C1_StartConditionDetectedHandler

void(* I3C1_StartConditionDetectedHandler) (void) = NULL[static]

I3C1_StaticAddressMatchHandler

void(* I3C1_StaticAddressMatchHandler) (void) = NULL[static]

I3C1_StopConditionDetectedHandler

void(* I3C1_StopConditionDetectedHandler) (void) = NULL[static]

I3C1_SupportedCCCReceivedHandler

void(* I3C1_SupportedCCCReceivedHandler) (void) = NULL[static]

I3C1_TransactionCompleteHandler

void(* I3C1_TransactionCompleteHandler) (struct I3C_TARGET_TRANSACTION_COMPLETE_STATUS *transactionCompleteStatus) = NULL[static]

I3C1_TransmitBufferWriteErrorHandler

void(* I3C1_TransmitBufferWriteErrorHandler) (void) = NULL[static]

I3C1_TransmitUnderrunHandler

void(* I3C1_TransmitUnderrunHandler) (void) = NULL[static]

I3C1_UnsupportedCCCReceivedHandler

void(* I3C1_UnsupportedCCCReceivedHandler) (void) = NULL[static]

isI3C1RxSoftwareBufferFull

volatile bool isI3C1RxSoftwareBufferFull = false[static]

transactionCompleteStatus

struct I3C_TARGET_TRANSACTION_COMPLETE_STATUS transactionCompleteStatus[static]

3.16.5.4 source/i3c1_polling.h File Reference

#include <stdbool.h>
#include <stdint.h>
#include "i3c_target_types.h"

3.16.5.4.1 Functions