Astra MCU SDK Peripheral Driver Library
Loading...
Searching...
No Matches

Public API functions for I3C driver. More...

Functions

INIT_CODE i3c_status_en i3c_init (i3c_instance_en id, i3c_peripheral_mode_t mode)
INIT_CODE i3c_status_en i3c_deinit (i3c_instance_en id)
i3c_status_en i3c_enable (i3c_instance_en id)
i3c_status_en i3c_disable (i3c_instance_en id)
i3c_status_en i3c_controller_set_config (i3c_instance_en id, i3c_controller_config_t *cfg)
i3c_status_en i3c_controller_set_policy_config (i3c_instance_en id, const i3c_controller_policy_config_t *cfg)
i3c_status_en i3c_controller_set_interrupt_config (i3c_instance_en id, const i3c_interrupt_config_t *cfg)
i3c_status_en i3c_controller_config_hdr_mode (i3c_instance_en id, const i3c_hdr_config_t *cfg)
i3c_status_en i3c_controller_perform_daa (i3c_instance_en id, const i3c_device_config_t *device_configs, uint8_t device_count, i3c_device_t *discovered_devices, uint8_t *discovered_count)
i3c_status_en i3c_controller_get_device_count (i3c_instance_en id, uint8_t *device_count)
i3c_status_en i3c_controller_get_device (i3c_instance_en id, uint8_t device_index, i3c_device_t *device)
i3c_status_en i3c_controller_find_device_by_dynamic_addr (i3c_instance_en id, uint8_t dynamic_addr, i3c_device_t *device)
i3c_status_en i3c_controller_find_device_by_pid (i3c_instance_en id, uint64_t pid, i3c_device_t *device)
i3c_status_en i3c_controller_config_targets (i3c_instance_en id, const i3c_device_config_t *device_configs, uint8_t device_count)
i3c_status_en i3c_controller_send_ccc (i3c_instance_en id, uint8_t ccc_id, i3c_ccc_type_en ccc_type, int8_t dat_index, uint8_t *req_buffer, uint16_t req_length, uint8_t *resp_buffer, uint16_t resp_max_length, uint16_t *resp_length)
i3c_status_en i3c_controller_ccc_response_get_count (i3c_instance_en id, uint8_t *count)
i3c_status_en i3c_controller_ccc_response_read (i3c_instance_en id, i3c_ccc_response_entry_t *entry, uint8_t *payload_buffer, uint16_t payload_capacity)
i3c_status_en i3c_controller_ccc_response_peek (i3c_instance_en id, i3c_ccc_response_entry_t *entry)
i3c_status_en i3c_controller_get_dat_entry (i3c_instance_en id, uint8_t dat_index, i3c_dat_entry_t *dat_entry)
i3c_status_en i3c_controller_set_target_device_by_addr (i3c_instance_en id, uint8_t static_addr, i3c_xfer_speed_en speed)
i3c_status_en i3c_controller_set_target_device_by_dynamic_addr (i3c_instance_en id, uint8_t dynamic_addr, i3c_xfer_speed_en speed)
i3c_status_en i3c_controller_set_target_device_by_id (i3c_instance_en id, i3c_target_id_t device_id, i3c_xfer_speed_en speed)
i3c_status_en i3c_controller_abort (i3c_instance_en id)
i3c_transfer_status_en i3c_controller_get_transfer_status (i3c_instance_en id)
i3c_status_en i3c_clear_all_interrupts (i3c_instance_en id)
i3c_status_en i3c_controller_get_queue_status (i3c_instance_en id, uint8_t *cmd_queue_level, uint8_t *resp_queue_level, uint8_t *tx_fifo_level, uint8_t *rx_fifo_level)
i3c_status_en i3c_controller_peek_response_word (i3c_instance_en id, uint32_t *response_word)
i3c_status_en i3c_register_callback (i3c_instance_en id, i3c_event_cb_t cb, void *user_data)
i3c_status_en i3c_controller_write_blocking (i3c_instance_en id, i3c_transfer_t *xfer)
i3c_status_en i3c_controller_read_blocking (i3c_instance_en id, i3c_transfer_t *xfer)
i3c_status_en i3c_controller_write_non_blocking (i3c_instance_en id, i3c_transfer_t *xfer)
i3c_status_en i3c_controller_read_non_blocking (i3c_instance_en id, i3c_transfer_t *xfer)
i3c_status_en i3c_controller_enable_ibi (i3c_instance_en id, i3c_ibi_config_t *ibi_cfg)
i3c_status_en i3c_controller_read_ibi_data (i3c_instance_en id, uint8_t *buffer, uint16_t *data_length)
i3c_status_en i3c_controller_config_hot_join (i3c_instance_en id, bool enable_hot_join)
i3c_status_en i3c_controller_process_hot_join_req (i3c_instance_en id)
i3c_status_en i3c_controller_process_hot_join_and_enumerate (i3c_instance_en id, i3c_device_t *discovered_devices, uint8_t *discovered_count)
i3c_status_en i3c_target_set_config (i3c_instance_en id, i3c_target_config_t *cfg)
i3c_status_en i3c_target_prep_controller_write (i3c_instance_en id, uint8_t *buf, uint32_t size)
i3c_status_en i3c_target_prep_controller_read (i3c_instance_en id, uint8_t *buf, uint32_t size)
i3c_status_en i3c_target_raise_ibi_sir (i3c_instance_en id, i3c_sir_config_t *xfer)
i3c_status_en i3c_target_get_ibi_sir_response (i3c_instance_en id)
i3c_status_en i3c_target_raise_master_request (i3c_instance_en id)
i3c_status_en i3c_target_get_master_request_response (i3c_instance_en id)
i3c_status_en i3c_target_config_hot_join (i3c_instance_en id, bool enable)

Detailed Description

Public API functions for I3C driver.

Function Documentation

◆ i3c_init()

INIT_CODE i3c_status_en i3c_init ( i3c_instance_en id,
i3c_peripheral_mode_t mode )

Initialize the I³C peripheral for the given instance (e.g., I3C0 for controller, I3C1 for target). This function must be called before any other I³C operations. It resets the peripheral to its default state and enables the interface clock.

Parameters
idI³C Instance ID.
modePeripheral mode configuration (I³C or I²C).
Returns
i3c_status_en Status code indicating success or failure reason.

◆ i3c_deinit()

INIT_CODE i3c_status_en i3c_deinit ( i3c_instance_en id)

Reset context structure and hardware registers to default state, disable interrupts, disable the I³C peripheral, and disable clock to I³C peripheral registers interface.

Parameters
idI³C Instance ID.
Returns
i3c_status_en. Status code indicating success or the reason for failure.

◆ i3c_enable()

i3c_status_en i3c_enable ( i3c_instance_en id)

Enable the I³C peripheral. After enabling, configuration cannot be changed, nor can the target address be changed until the block is disabled again.

Parameters
idI³C Instance ID.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_disable()

i3c_status_en i3c_disable ( i3c_instance_en id)

Disable the I³C peripheral. Masks and clears all interrupts.

Parameters
idI³C Instance ID.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_controller_set_config()

i3c_status_en i3c_controller_set_config ( i3c_instance_en id,
i3c_controller_config_t * cfg )

Configures the I³C peripheral for controller mode (formerly "master" mode). This includes:

  • Setting thresholds for command/response and data buffers
  • Assigning the controller's dynamic address
  • Selecting timing preset (or manual SCL timing) and bus timing parameters
  • Setting bus free and idle times
  • Resetting the Device Address Table (DAT)
Parameters
idI³C instance identifier.
cfgPointer to the controller configuration structure.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_set_policy_config()

i3c_status_en i3c_controller_set_policy_config ( i3c_instance_en id,
const i3c_controller_policy_config_t * cfg )

Configure controller behavior policy independent from hardware timing setup.

Parameters
idI³C instance identifier.
cfgPointer to controller policy configuration.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_set_interrupt_config()

i3c_status_en i3c_controller_set_interrupt_config ( i3c_instance_en id,
const i3c_interrupt_config_t * cfg )

Configure notification and interrupt policy for controller mode.

Parameters
idI³C instance identifier.
cfgPointer to interrupt configuration.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_config_hdr_mode()

i3c_status_en i3c_controller_config_hdr_mode ( i3c_instance_en id,
const i3c_hdr_config_t * cfg )

Explicitly enable/disable and configure HDR mode behavior.

Parameters
idI³C instance identifier.
cfgPointer to HDR mode configuration.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_perform_daa()

i3c_status_en i3c_controller_perform_daa ( i3c_instance_en id,
const i3c_device_config_t * device_configs,
uint8_t device_count,
i3c_device_t * discovered_devices,
uint8_t * discovered_count )

Performs Dynamic Address Assignment (DAA) for I³C devices on the bus. Resets existing dynamic addresses and assigns new ones using CCC commands. Discovered devices are always persisted in an internal controller device list.

Parameters
idI³C instance identifier.
device_configsPointer to array of device configuration structures.
device_countNumber of devices in the device_configs array.
discovered_devicesOptional output array to copy discovered device descriptors.
discovered_countInput: capacity of discovered_devices array. Output: number of descriptors filled (or internal discovered count if discovered_devices is NULL).
Note
I²C devices do not participate in the DAA process.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_get_device_count()

i3c_status_en i3c_controller_get_device_count ( i3c_instance_en id,
uint8_t * device_count )

Get number of devices currently cached in the internal controller device list.

Parameters
idI³C instance identifier.
device_countPointer to receive device count.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_get_device()

i3c_status_en i3c_controller_get_device ( i3c_instance_en id,
uint8_t device_index,
i3c_device_t * device )

Read one device descriptor from the internal controller device list.

Parameters
idI³C instance identifier.
device_indexInternal device list index.
devicePointer to receive device descriptor.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_find_device_by_dynamic_addr()

i3c_status_en i3c_controller_find_device_by_dynamic_addr ( i3c_instance_en id,
uint8_t dynamic_addr,
i3c_device_t * device )

Find a device descriptor from internal controller list by dynamic address.

Parameters
idI³C instance identifier.
dynamic_addrDynamic address to look up.
devicePointer to receive matching device descriptor.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_find_device_by_pid()

i3c_status_en i3c_controller_find_device_by_pid ( i3c_instance_en id,
uint64_t pid,
i3c_device_t * device )

Find a device descriptor from internal controller list by PID value.

Parameters
idI³C instance identifier.
pid48-bit provisional ID value to look up.
devicePointer to receive matching device descriptor.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_config_targets()

i3c_status_en i3c_controller_config_targets ( i3c_instance_en id,
const i3c_device_config_t * device_configs,
uint8_t device_count )

Configures controller DAT entries (cache + hardware) without issuing any address-assignment CCC on the bus.

Parameters
idI³C instance identifier.
device_configsPointer to array of device configuration structures.
device_countNumber of devices in the device_configs array.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_send_ccc()

i3c_status_en i3c_controller_send_ccc ( i3c_instance_en id,
uint8_t ccc_id,
i3c_ccc_type_en ccc_type,
int8_t dat_index,
uint8_t * req_buffer,
uint16_t req_length,
uint8_t * resp_buffer,
uint16_t resp_max_length,
uint16_t * resp_length )

Sends a Common Command Code (CCC) to I³C devices on the bus.

Parameters
idI³C instance identifier.
ccc_idCCC command identifier (0x00-0x7F for broadcast, 0x80+ for direct).
ccc_typeCCC routing type (broadcast/direct). API validates ccc_id and route matching.
dat_indexDevice Address Table index for direct CCCs. Ignored for broadcast CCC.

HAL validation rules:

  • Broadcast CCC requires I3C_CCC_BROADCAST and ignores dat_index.
  • Direct CCC requires I3C_CCC_DIRECT and a valid dat_index referencing an enumerated target.
  • Payload pointers/lengths are validated against CCC direction and expected request/response behavior.
  • For response CCC, resp_buffer/resp_max_length must be sufficient to hold controller-returned payload or I3C_ERROR_BUFFER_TOO_SMALL is returned.
Parameters
req_bufferPointer to request payload buffer (NULL if no request payload).
req_lengthNumber of request payload bytes.
resp_bufferPointer to response payload destination buffer (NULL if response not required).
resp_max_lengthMaximum response bytes allowed in resp_buffer.
resp_lengthPointer to receive actual response payload length.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_ccc_response_get_count()

i3c_status_en i3c_controller_ccc_response_get_count ( i3c_instance_en id,
uint8_t * count )

Get the number of pending entries in the CCC response queue.

Parameters
idI3C instance identifier.
countPointer to a variable that will receive the number of pending CCC response entries currently available in the response queue.
Returns
i3c_status_en
  • I3C_OK : Operation successful
  • I3C_ERROR_PARAMETER : Invalid pointer provided

◆ i3c_controller_ccc_response_read()

i3c_status_en i3c_controller_ccc_response_read ( i3c_instance_en id,
i3c_ccc_response_entry_t * entry,
uint8_t * payload_buffer,
uint16_t payload_capacity )

Pop one entry from the CCC response queue and optionally copy the associated payload data.

If the response entry contains payload data and payload_buffer is not NULL, up to payload_capacity bytes will be copied into the buffer.

The actual payload length returned by the controller is stored in entry->payload_length.

Parameters
idI3C instance identifier.
entryPointer to a structure that will receive metadata describing the CCC response entry (e.g. CCC ID, DAT index, status, payload length).
payload_bufferOptional pointer to a buffer where the payload data will be copied. Can be NULL if the payload is not required.
payload_capacitySize of the destination payload buffer in bytes. Ignored if payload_buffer is NULL.
Returns
i3c_status_en
  • I3C_OK : Response entry successfully read
  • I3C_ERROR_NO_DATA : Response queue is empty
  • I3C_ERROR_PARAMETER : Invalid parameter provided
  • I3C_ERROR_BUFFER_TOO_SMALL : Payload buffer smaller than payload length

◆ i3c_controller_ccc_response_peek()

i3c_status_en i3c_controller_ccc_response_peek ( i3c_instance_en id,
i3c_ccc_response_entry_t * entry )

Inspect the next CCC response queue entry without popping it.

Parameters
idI3C instance identifier.
entryPointer to a structure that will receive metadata for the next response entry.
Returns
i3c_status_en
  • I3C_OK : Entry metadata available
  • I3C_ERROR_NO_DATA : Response queue is empty
  • I3C_ERROR_PARAMETER : Invalid parameter provided

◆ i3c_controller_get_dat_entry()

i3c_status_en i3c_controller_get_dat_entry ( i3c_instance_en id,
uint8_t dat_index,
i3c_dat_entry_t * dat_entry )

Read a cached Device Address Table (DAT) entry by index.

Parameters
idI³C instance identifier.
dat_indexDAT index to read.
dat_entryPointer to receive DAT entry contents.
Returns
i3c_status_en Status code indicating success or reason for failure.

◆ i3c_controller_set_target_device_by_addr()

i3c_status_en i3c_controller_set_target_device_by_addr ( i3c_instance_en id,
uint8_t static_addr,
i3c_xfer_speed_en speed )

Sets the target I²C device for communication by using its static address.

Deprecated
Descriptor-based transfer APIs no longer require stateful target selection. Prefer passing address information via i3c_transfer_t.
Parameters
idI³C instance identifier.
static_addrStatic address of the target device.
speedDesired transfer speed (e.g., FM, FMP).
Returns
i3c_status_en Status code indicating success or reason for failure. Returns I3C_ERROR_NO_DATA when no cached target matches static_addr.

◆ i3c_controller_set_target_device_by_dynamic_addr()

i3c_status_en i3c_controller_set_target_device_by_dynamic_addr ( i3c_instance_en id,
uint8_t dynamic_addr,
i3c_xfer_speed_en speed )

Sets the target I²C device for communication by using its dynamic address.

Deprecated
Descriptor-based transfer APIs no longer require stateful target selection. Prefer passing address information via i3c_transfer_t.
Parameters
idI³C instance identifier.
dynamic_addrDynamic address of the target device.
speedDesired transfer speed (e.g., FM, FMP).
Returns
i3c_status_en Status code indicating success or reason for failure. Returns I3C_ERROR_NO_DATA when no cached target matches dynamic_addr.

◆ i3c_controller_set_target_device_by_id()

i3c_status_en i3c_controller_set_target_device_by_id ( i3c_instance_en id,
i3c_target_id_t device_id,
i3c_xfer_speed_en speed )

Sets the target I³C device for communication using its device ID.

Parameters
idI³C instance identifier.
device_idDevice ID from the Device Address Table (DAT).
speedDesired transfer speed (e.g., SDR, HDR).
Returns
i3c_status_en Status code indicating success or reason for failure. Returns I3C_ERROR_NO_DATA when no cached target matches device_id.

◆ i3c_controller_abort()

i3c_status_en i3c_controller_abort ( i3c_instance_en id)

Abort an ongoing controller transfer. Issues STOP and clears FIFOs.

Parameters
idI³C Instance ID.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_controller_get_transfer_status()

i3c_transfer_status_en i3c_controller_get_transfer_status ( i3c_instance_en id)

Returns the status of the ongoing non-blocking read or write transfer.

Parameters
idI³C Instance ID.
Returns
i3c_transfer_status_en - Status:
  • I3C_TRANSFER_STATUS_IDLE
  • I3C_TRANSFER_STATUS_IN_PROGRESS
  • I3C_TRANSFER_STATUS_COMPLETE
  • I3C_TRANSFER_STATUS_ABORTED
  • I3C_TRANSFER_STATUS_ERROR
  • I3C_TRANSFER_INVALID_ID

◆ i3c_clear_all_interrupts()

i3c_status_en i3c_clear_all_interrupts ( i3c_instance_en id)

Clears all interrupts.

Parameters
idI³C Instance ID.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_controller_get_queue_status()

i3c_status_en i3c_controller_get_queue_status ( i3c_instance_en id,
uint8_t * cmd_queue_level,
uint8_t * resp_queue_level,
uint8_t * tx_fifo_level,
uint8_t * rx_fifo_level )

Low-level queue/FIFO occupancy snapshot for debugging and advanced tuning.

Parameters
idI³C Instance ID.
cmd_queue_levelPointer to receive command queue occupancy.
resp_queue_levelPointer to receive response queue occupancy.
tx_fifo_levelPointer to receive TX FIFO occupancy.
rx_fifo_levelPointer to receive RX FIFO occupancy.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_controller_peek_response_word()

i3c_status_en i3c_controller_peek_response_word ( i3c_instance_en id,
uint32_t * response_word )

Read one raw response queue word for low-level debugging.

Parameters
idI³C Instance ID.
response_wordPointer to receive raw response queue word.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_register_callback()

i3c_status_en i3c_register_callback ( i3c_instance_en id,
i3c_event_cb_t cb,
void * user_data )

Register a callback. A majority of I³C block logic is handled in the driver ISR. Notification filtering is configured by i3c_controller_set_interrupt_config.

Note
That the callback can be called at anytime after the I³C block is enabled, Especially in target mode if the controller sends a read request, start writing data, or general call.
Parameters
idI³C Instance ID.
cbUser callback function.
user_dataUser context passed back in callback.

◆ i3c_controller_write_blocking()

i3c_status_en i3c_controller_write_blocking ( i3c_instance_en id,
i3c_transfer_t * xfer )

Performs a blocking write transfer as controller using descriptor-supplied target addressing and flags.

Parameters
idI³C Instance ID.
xferUnified transfer descriptor. i3c_transfer_t::direction shall be I3C_TRANSFER_WRITE. i3c_transfer_t::size shall be <= I3C_MAX_TRANSFER_SIZE_BYTES.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_controller_read_blocking()

i3c_status_en i3c_controller_read_blocking ( i3c_instance_en id,
i3c_transfer_t * xfer )

Performs a blocking read transfer as controller using descriptor-supplied target addressing and flags.

Parameters
idI³C Instance ID.
xferUnified transfer descriptor. i3c_transfer_t::direction shall be I3C_TRANSFER_READ. i3c_transfer_t::size shall be <= I3C_MAX_TRANSFER_SIZE_BYTES.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_controller_write_non_blocking()

i3c_status_en i3c_controller_write_non_blocking ( i3c_instance_en id,
i3c_transfer_t * xfer )

Start a non-blocking write as controller using descriptor-supplied target addressing and flags. This function loads the TX FIFO with data and configures the I³C interrupts to handle the rest of the transfer in the driver ISR.

The callback set in i3c_register_callback will be called when:

  • Data is loaded into the TX FIFO and transmitted to the target
  • An error occurs (e.g., NACK from target, bus error, etc.)
Note
The caller retains ownership of i3c_transfer_t::buf. The buffer must remain allocated, 32-bit aligned when required by platform/FIFO access path, and not be modified until the transfer completes (callback/status) or is aborted.
Parameters
idI³C Instance ID.
xferUnified transfer descriptor. i3c_transfer_t::direction shall be I3C_TRANSFER_WRITE.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_controller_read_non_blocking()

i3c_status_en i3c_controller_read_non_blocking ( i3c_instance_en id,
i3c_transfer_t * xfer )

Start a non-blocking read as controller using descriptor-supplied target addressing and flags. This function configures the I³C interrupts to handle the transfer in the driver ISR.

The callback set in i3c_register_callback will be called when:

  • All data has been received and written into the passed buffer
  • An error occurs
Note
The caller retains ownership of i3c_transfer_t::buf. The buffer must remain allocated, writable, and 32-bit aligned when required by platform/FIFO access path until transfer completion (callback/status) or explicit abort.
Parameters
idI³C Instance ID.
xferUnified transfer descriptor. i3c_transfer_t::direction shall be I3C_TRANSFER_READ.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_controller_enable_ibi()

i3c_status_en i3c_controller_enable_ibi ( i3c_instance_en id,
i3c_ibi_config_t * ibi_cfg )

Configures IBI handling for the target device selected using i3c_controller_set_target_device_by_addr or i3c_controller_set_target_device_by_id. Enables IBI and sets mandatory byte requirement. IBI payload (if present) is processed via the registered IBI handler.

Parameters
idI³C Instance ID.
ibi_cfgPointer to IBI configuration structure.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_controller_read_ibi_data()

i3c_status_en i3c_controller_read_ibi_data ( i3c_instance_en id,
uint8_t * buffer,
uint16_t * data_length )

Read IBI data from controller buffer.

Parameters
idI³C Instance ID.
bufferBuffer to store IBI data.
data_lengthPointer to store data length.
Returns
i3c_status_en Status code indicating success or failure.

◆ i3c_controller_config_hot_join()

i3c_status_en i3c_controller_config_hot_join ( i3c_instance_en id,
bool enable_hot_join )

Configure hot join functionality for controller.

Parameters
idI³C Instance ID.
enable_hot_joinEnable or disable hot join.
Returns
i3c_status_en Status code indicating success or failure.

◆ i3c_controller_process_hot_join_req()

i3c_status_en i3c_controller_process_hot_join_req ( i3c_instance_en id)

Process hot join request from target device.

Parameters
idI³C Instance ID.
Returns
i3c_status_en Status code indicating success or failure.

◆ i3c_controller_process_hot_join_and_enumerate()

i3c_status_en i3c_controller_process_hot_join_and_enumerate ( i3c_instance_en id,
i3c_device_t * discovered_devices,
uint8_t * discovered_count )

Process Hot-Join request and perform automatic enumeration helper flow.

Parameters
idI³C Instance ID.
discovered_devicesOptional output array for newly discovered devices.
discovered_countInput: output array capacity. Output: number of devices discovered.
Returns
i3c_status_en Status code indicating success or failure.

◆ i3c_target_set_config()

i3c_status_en i3c_target_set_config ( i3c_instance_en id,
i3c_target_config_t * cfg )

Initializes the I³C target configuration such as static address, vendor ID, part ID, and max read/write length. Must be called before target enable. This information is used during DAA or SETDASA operations by the controller.

Parameters
idI³C Instance ID.
cfgPointer to target device configuration structure.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_target_prep_controller_write()

i3c_status_en i3c_target_prep_controller_write ( i3c_instance_en id,
uint8_t * buf,
uint32_t size )

Prepares the target to receive data from the controller by assigning the buffer where incoming data will be stored.

Parameters
idI³C Instance ID.
bufPointer to buffer where the received data should be stored.
sizeSize of the buffer in bytes. Must be <= I3C_MAX_TRANSFER_SIZE_BYTES.
Note
Align buf to 32-bit boundary when platform/FIFO access path requires word-aligned accesses.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_target_prep_controller_read()

i3c_status_en i3c_target_prep_controller_read ( i3c_instance_en id,
uint8_t * buf,
uint32_t size )

Prepares the target with data to be sent when the controller initiates a read operation. The data in the buffer will be transmitted to the controller upon request.

Parameters
idI³C Instance ID.
bufPointer to buffer containing data to send to the controller.
sizeNumber of bytes to send from the buffer. Must be <= I3C_MAX_TRANSFER_SIZE_BYTES.
Note
Align buf to 32-bit boundary when platform/FIFO access path requires word-aligned accesses.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_target_raise_ibi_sir()

i3c_status_en i3c_target_raise_ibi_sir ( i3c_instance_en id,
i3c_sir_config_t * xfer )

Used by an I³C target to raise an In-Band Interrupt (IBI) with SIR payload. The controller must have previously enabled IBI for this request to succeed. Data in the provided config will be transmitted as part of the IBI request.

Parameters
idI³C Instance ID (in target mode).
xferPointer to SIR transfer configuration structure.
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_target_get_ibi_sir_response()

i3c_status_en i3c_target_get_ibi_sir_response ( i3c_instance_en id)

Retrieves the response status of the previously sent IBI SIR by the target. This can indicate if the controller accepted or rejected the IBI request. Should be called after initiating an IBI using i3c_target_raise_ibi_sir. Useful for error recovery or retry logic in the target firmware.

Parameters
idI³C Instance ID (in target mode).
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_target_raise_master_request()

i3c_status_en i3c_target_raise_master_request ( i3c_instance_en id)

Used by an I3C secondary controller (target mode) to generate a Master Request (MR) and request bus ownership from the active controller. Callback subscribers can observe I3C_EVENT_MR_RESPONSE to track result.

Parameters
idI3C Instance ID (in target mode).
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_target_get_master_request_response()

i3c_status_en i3c_target_get_master_request_response ( i3c_instance_en id)

Retrieves the response status of a previously raised Master Request (MR). Should be called after i3c_target_raise_master_request.

Parameters
idI3C Instance ID (in target mode).
Returns
i3c_status_en Status code indicating success or the reason for failure.

◆ i3c_target_config_hot_join()

i3c_status_en i3c_target_config_hot_join ( i3c_instance_en id,
bool enable )

Configure hot join functionality for target device.

Parameters
idI³C Instance ID.
enableEnable or disable hot join.
Returns
i3c_status_en Status code indicating success or failure.