Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
I3C In-Band Interrupts

I3C In-Band Interrupts. More...

Data Structures

struct  i3c_ibi
 Struct for IBI request. More...
 
struct  i3c_ibi_payload
 Structure of payload buffer for IBI. More...
 
struct  i3c_ibi_work
 Node about a queued IBI. More...
 

Macros

#define CONFIG_I3C_IBI_MAX_PAYLOAD_SIZE   0
 

Typedefs

typedef int(* i3c_target_ibi_cb_t) (struct i3c_device_desc *target, struct i3c_ibi_payload *payload)
 Function called when In-Band Interrupt received from target device.
 

Enumerations

enum  i3c_ibi_type {
  I3C_IBI_TARGET_INTR , I3C_IBI_CONTROLLER_ROLE_REQUEST , I3C_IBI_HOTJOIN , I3C_IBI_TYPE_MAX = I3C_IBI_HOTJOIN ,
  I3C_IBI_WORKQUEUE_CB
}
 IBI Types. More...
 

Functions

static int i3c_ibi_raise (const struct device *dev, struct i3c_ibi *request)
 Raise an In-Band Interrupt (IBI).
 
static int i3c_ibi_enable (struct i3c_device_desc *target)
 Enable IBI of a target device.
 
static int i3c_ibi_disable (struct i3c_device_desc *target)
 Disable IBI of a target device.
 
static int i3c_ibi_has_payload (struct i3c_device_desc *target)
 Check if target's IBI has payload.
 
static int i3c_device_is_ibi_capable (struct i3c_device_desc *target)
 Check if device is IBI capable.
 
int i3c_ibi_work_enqueue (struct i3c_ibi_work *ibi_work)
 Queue an IBI work item for future processing.
 
int i3c_ibi_work_enqueue_target_irq (struct i3c_device_desc *target, uint8_t *payload, size_t payload_len)
 Queue a target interrupt IBI for future processing.
 
int i3c_ibi_work_enqueue_hotjoin (const struct device *dev)
 Queue a hot join IBI for future processing.
 
int i3c_ibi_work_enqueue_cb (const struct device *dev, k_work_handler_t work_cb)
 Queue a generic callback for future processing.
 

Detailed Description

I3C In-Band Interrupts.

Macro Definition Documentation

◆ CONFIG_I3C_IBI_MAX_PAYLOAD_SIZE

#define CONFIG_I3C_IBI_MAX_PAYLOAD_SIZE   0

Typedef Documentation

◆ i3c_target_ibi_cb_t

typedef int(* i3c_target_ibi_cb_t) (struct i3c_device_desc *target, struct i3c_ibi_payload *payload)

#include <zephyr/drivers/i3c/ibi.h>

Function called when In-Band Interrupt received from target device.

This function is invoked by the controller when the controller receives an In-Band Interrupt from the target device.

A success return shall cause the controller to ACK the next byte received. An error return shall cause the controller to NACK the next byte received.

Parameters
targetthe device description structure associated with the device to which the operation is addressed.
payloadPayload associated with the IBI. NULL if there is no payload.
Returns
0 if the IBI is accepted, or a negative error code.

Enumeration Type Documentation

◆ i3c_ibi_type

#include <zephyr/drivers/i3c/ibi.h>

IBI Types.

Enumerator
I3C_IBI_TARGET_INTR 

Target interrupt.

I3C_IBI_CONTROLLER_ROLE_REQUEST 

Controller Role Request.

I3C_IBI_HOTJOIN 

Hot Join Request.

I3C_IBI_TYPE_MAX 
I3C_IBI_WORKQUEUE_CB 

Not an actual IBI type, but simply used by the IBI workq for generic callbacks.

Function Documentation

◆ i3c_device_is_ibi_capable()

static int i3c_device_is_ibi_capable ( struct i3c_device_desc target)
inlinestatic

#include <zephyr/drivers/i3c.h>

Check if device is IBI capable.

This reads the BCR from the device descriptor struct to determine whether device is capable of IBI.

Note that BCR must have been obtained from device and

See also
i3c_device_desc::bcr must be set.
Returns
True if IBI has payload, false otherwise.

◆ i3c_ibi_disable()

static int i3c_ibi_disable ( struct i3c_device_desc target)
inlinestatic

#include <zephyr/drivers/i3c.h>

Disable IBI of a target device.

This enables IBI of a target device where the IBI has already been request.

Parameters
targetI3C target device descriptor.
Return values
0If successful.
-EIOGeneral Input / output error.
-ENODEVIf IBI is not previously enabled for target.

◆ i3c_ibi_enable()

static int i3c_ibi_enable ( struct i3c_device_desc target)
inlinestatic

#include <zephyr/drivers/i3c.h>

Enable IBI of a target device.

This enables IBI of a target device where the IBI has already been request.

Parameters
targetI3C target device descriptor.
Return values
0If successful.
-EIOGeneral Input / output error.
-ENOMEMIf these is no more empty entries in the controller's IBI table (if the controller uses such table).

◆ i3c_ibi_has_payload()

static int i3c_ibi_has_payload ( struct i3c_device_desc target)
inlinestatic

#include <zephyr/drivers/i3c.h>

Check if target's IBI has payload.

This reads the BCR from the device descriptor struct to determine whether IBI from device has payload.

Note that BCR must have been obtained from device and

See also
i3c_device_desc::bcr must be set.
Returns
True if IBI has payload, false otherwise.

◆ i3c_ibi_raise()

static int i3c_ibi_raise ( const struct device dev,
struct i3c_ibi request 
)
inlinestatic

#include <zephyr/drivers/i3c.h>

Raise an In-Band Interrupt (IBI).

This raises an In-Band Interrupt (IBI) to the active controller.

Parameters
devPointer to controller device driver instance.
requestPointer to the IBI request struct.
Return values
0if operation is successful.
-EIOGeneral input / output error.

◆ i3c_ibi_work_enqueue()

int i3c_ibi_work_enqueue ( struct i3c_ibi_work ibi_work)

#include <zephyr/drivers/i3c/ibi.h>

Queue an IBI work item for future processing.

This queues up an IBI work item in the IBI workqueue for future processing.

Note that this will copy the ibi_work struct into internal structure. If there is not enough space to copy the ibi_work struct, this returns -ENOMEM.

Parameters
ibi_workPointer to the IBI work item struct.
Return values
0If work item is successfully queued.
-ENOMEMIf no more free internal node to store IBI work item.
Others
See also
k_work_submit_to_queue

◆ i3c_ibi_work_enqueue_cb()

int i3c_ibi_work_enqueue_cb ( const struct device dev,
k_work_handler_t  work_cb 
)

#include <zephyr/drivers/i3c/ibi.h>

Queue a generic callback for future processing.

This queues up a generic callback in the IBI workqueue for future processing.

Parameters
devPointer to controller device driver instance.
work_cbCallback function.
Return values
0If work item is successfully queued.
-ENOMEMIf no more free internal node to store IBI work item.
Others
See also
k_work_submit_to_queue

◆ i3c_ibi_work_enqueue_hotjoin()

int i3c_ibi_work_enqueue_hotjoin ( const struct device dev)

#include <zephyr/drivers/i3c/ibi.h>

Queue a hot join IBI for future processing.

This queues up a hot join IBI in the IBI workqueue for future processing.

Parameters
devPointer to controller device driver instance.
Return values
0If work item is successfully queued.
-ENOMEMIf no more free internal node to store IBI work item.
Others
See also
k_work_submit_to_queue

◆ i3c_ibi_work_enqueue_target_irq()

int i3c_ibi_work_enqueue_target_irq ( struct i3c_device_desc target,
uint8_t payload,
size_t  payload_len 
)

#include <zephyr/drivers/i3c/ibi.h>

Queue a target interrupt IBI for future processing.

This queues up a target interrupt IBI in the IBI workqueue for future processing.

Parameters
targetPointer to target device descriptor.
payloadPointer to IBI payload byte array.
payload_lenLength of payload byte array.
Return values
0If work item is successfully queued.
-ENOMEMIf no more free internal node to store IBI work item.
Others
See also
k_work_submit_to_queue