Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
i3c_target_callbacks Struct Reference

#include <target_device.h>

Data Fields

int(* write_requested_cb )(struct i3c_target_config *config)
 Function called when a write to the device is initiated.
 
int(* write_received_cb )(struct i3c_target_config *config, uint8_t val)
 Function called when a write to the device is continued.
 
int(* read_requested_cb )(struct i3c_target_config *config, uint8_t *val)
 Function called when a read from the device is initiated.
 
int(* read_processed_cb )(struct i3c_target_config *config, uint8_t *val)
 Function called when a read from the device is continued.
 
int(* stop_cb )(struct i3c_target_config *config)
 Function called when a stop condition is observed after a start condition addressed to a particular device.
 

Field Documentation

◆ read_processed_cb

int(* i3c_target_callbacks::read_processed_cb) (struct i3c_target_config *config, uint8_t *val)

Function called when a read from the device is continued.

This function is invoked by the controller when the bus is ready to provide additional data for a read operation from the address associated with the device device.

The value returned in val will be transmitted. A success return shall cause the controller to react to additional read operations. An error return shall cause the controller to ignore bus operations until a new start condition is received.

Parameters
configConfiguration structure associated with the device to which the operation is addressed.
valPointer to storage for the next byte of data to return for the read request.
Returns
0 if data has been provided, or a negative error code.

◆ read_requested_cb

int(* i3c_target_callbacks::read_requested_cb) (struct i3c_target_config *config, uint8_t *val)

Function called when a read from the device is initiated.

This function is invoked by the controller when the bus completes a start condition for a read operation from the address associated with a particular device.

The value returned in val will be transmitted. A success return shall cause the controller to react to additional read operations. An error return shall cause the controller to ignore bus operations until a new start condition is received.

Parameters
configConfiguration structure associated with the device to which the operation is addressed.
valPointer to storage for the first byte of data to return for the read request.
Returns
0 if more data can be requested, or a negative error code.

◆ stop_cb

int(* i3c_target_callbacks::stop_cb) (struct i3c_target_config *config)

Function called when a stop condition is observed after a start condition addressed to a particular device.

This function is invoked by the controller when the bus is ready to provide additional data for a read operation from the address associated with the device device. After the function returns the controller shall enter a state where it is ready to react to new start conditions.

Parameters
configConfiguration structure associated with the device to which the operation is addressed.
Returns
Ignored.

◆ write_received_cb

int(* i3c_target_callbacks::write_received_cb) (struct i3c_target_config *config, uint8_t val)

Function called when a write to the device is continued.

This function is invoked by the controller when it completes reception of a byte of data in an ongoing write operation to the 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
configConfiguration structure associated with the device to which the operation is addressed.
valthe byte received by the controller.
Returns
0 if more data can be accepted, or a negative error code.

◆ write_requested_cb

int(* i3c_target_callbacks::write_requested_cb) (struct i3c_target_config *config)

Function called when a write to the device is initiated.

This function is invoked by the controller when the bus completes a start condition for a write operation to the address associated with a particular 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
configConfiguration structure associated with the device to which the operation is addressed.
Returns
0 if the write is accepted, or a negative error code.

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