I3C 32-bit Register Target¶
The PxI3C32BitRegisterTarget class represents a generic I3C target. It supports standard I3C features like IBI, Hot-Join, and CCC handling, along with a register-based memory model.
Features¶
- IBI Generation: Initiate In-Band Interrupts.
- Hot-Join: Request to join the bus after initialization.
- Configurable PID/BCR/DCR: Customize the device characteristics.
PxI3C32BitRegisterTarget
¶
PxI3C32BitRegisterTarget(
exerciser: AqProtocolExerciser,
*args: object,
pid: int | None = None,
bcr: int = 0,
dcr: int = 0,
config: PxI3C32BitRegisterTargetConfig | None = None,
static_addr: int = 0,
minimum_mrl: int | None = None,
minimum_mwl: int | None = None,
getcaps_std_value: bytes | None = None,
getcaps_usr_value: list[tuple[int, bytes]] | None = None,
sub_address_type: SubAddressType = NONE,
getstatus_std_value: bytes | None = None,
getstatus_usr_value: list[tuple[int, bytes]] | None = None,
getmxds_std_value: bytes | None = None,
getmxds_usr_value: list[tuple[int, bytes]] | None = None,
supported_group_address_count: int = 3,
reset_actions: int | PxI3CTargetResetAction | None = None,
reset_pin: int | None = None,
**kwargs: object
)
Bases: PxAbstractTarget[PxI3C32BitRegisterTargetConfig, PxI3C32BitRegisterTargetState]
I3C Base Target Class.
| PARAMETER | DESCRIPTION |
|---|---|
|
The exerciser instance to use.
TYPE:
|
|
The 48-bit Provisioned ID (PID) of the target. On a given I3C bus there should be no Provisioned ID collision, otherwise the discovery mechanism may fail. If not provided, a default PID will be generated with Acute's manufacturer ID and a random 32-bit vendor value.
TYPE:
|
|
The 8-bit Bus Characteristic Register (BCR) of the target. This register describes the device bus related capabilities.
TYPE:
|
|
The 8-bit Device Characteristic Register (DCR) of the target. This register describes the functionalities provided by the device
TYPE:
|
|
The static address of the target.
TYPE:
|
|
The minimum read length of the target.
TYPE:
|
|
The minimum write length of the target.
TYPE:
|
|
The sub-address type of the target.
TYPE:
|
|
The default value for GETCAPS.
TYPE:
|
|
The defining bytes and the corresponding value for GETCAPS. format: [(defining byte, getcaps value)] |
|
set the default value for GETSTATUS.
TYPE:
|
|
set the defining bytes and the corresponding value for GETSTATUS. format: [(first defining byte, first status value), (second defining byte, second status value)] |
|
set the default value for GETMXDS.
TYPE:
|
|
set the default bytes and the corresponding value for GETMXDS. format: [(defining byte, mxds value)] |
|
set the count of group address that the target can support.
TYPE:
|
|
Bitmask of target reset actions for Target Reset
Pattern and GPIO rst (see
TYPE:
|
|
Assign the GPIO index for the target RST pin location.
If
TYPE:
|
|
The configuration of the device using protobuf structure.
TYPE:
|
|
Additional arguments to pass to the device constructor.
TYPE:
|
|
Additional keyword arguments to pass to the device constructor.
TYPE:
|
| CLASS | DESCRIPTION |
|---|---|
SubAddressType |
Sub-address type enumeration. |
IbiType |
IBI type enumeration. |
HotJoinType |
IBI type enumeration. |
| METHOD | DESCRIPTION |
|---|---|
add_event_handler |
Add an event handler to the current device instance, by event class or event name. |
remove_event_handler |
Remove an event handler from the current device instance, by event class or event name. |
get_event_handlers |
Retreive handlers registerd on this device. |
on_event |
Add an event handler to the instance by decorator, by event class or event name. |
match |
Return whether a device config describes a device of this class. |
update_additional_data |
Atomically update additional_data with revision-aware retry. |
update_config |
Set the config of the target. |
set_config |
Set the config of the target. |
attach_to_bus |
Attach the target to a bus. |
detach_from_bus |
Detach the device from the bus. |
perform_operation |
Send an operation. |
ibi_request |
Initiate an IBI request from the current target. |
send_hotjoin |
Initiate an Hot-join request from the current target. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
available_events_map |
Map each available event name to its id in event topics. |
is_attached |
Check if the device is attached to a bus.
TYPE:
|
state |
Get the state of the device.
TYPE:
|
name |
Get the name of the device.
TYPE:
|
cts_op_name |
Get the name of CTS operation. Currently not available now.
TYPE:
|
additional_data |
Get the opaque additional data blob associated with this device.
TYPE:
|
config |
Get the config of the device.
TYPE:
|
assigned_address |
Get the assigned address of the target.
TYPE:
|
event_state |
Get the event state of the target.
TYPE:
|
group_addresses |
Get the group addresses assigned to the target. |
mrl |
Get the maximum read length of the target.
TYPE:
|
mwl |
Get the maximum write length of the target.
TYPE:
|
register_value |
Get the current register value of the target.
TYPE:
|
sub_address_type |
Get the current register type of the target.
TYPE:
|
available_events_map
¶
Map each available event name to its id in event topics.
additional_data
¶
additional_data: bytes
Get the opaque additional data blob associated with this device.
SubAddressType
¶
Bases: IntEnum
Sub-address type enumeration.
This is intended to avoid exporting protobuf enum to the interface.
IbiType
¶
Bases: IntEnum
IBI type enumeration.
This is intended to avoid exporting protobuf enum to the interface.
HotJoinType
¶
Bases: IntEnum
IBI type enumeration.
This is intended to avoid exporting protobuf enum to the interface.
add_event_handler
¶
Add an event handler to the current device instance, by event class or event name.
remove_event_handler
¶
remove_event_handler(
event: str | type[PxAbstractEvent], handler: Callable[[Any], Any] | None = None
) -> None
Remove an event handler from the current device instance, by event class or event name.
get_event_handlers
¶
get_event_handlers(
filter_by: Callable[[str], bool] | None = None,
) -> dict[str, list[Callable[[Any], Any]]]
Retreive handlers registerd on this device.
Handlers are always scoped to this device; an optional filter_by is
applied on friendly event names.
on_event
¶
on_event(
event_type: str | type[PxAbstractEvent],
) -> Callable[[Callable[..., Any]], Callable[..., Any]]
Add an event handler to the instance by decorator, by event class or event name.
match
¶
match(config: PxAbstractDeviceConfig) -> bool
Return whether a device config describes a device of this class.
update_additional_data
¶
Atomically update additional_data with revision-aware retry.
attach_to_bus
¶
Attach the target to a bus.
This method is used to make the device aware of the bus it is connected to. It is used to set the bus attribute of the device.
Note
This method will not automatically create an actual instance on
the Protocol Exerciser until user call the attach_to_bus method.
| PARAMETER | DESCRIPTION |
|---|---|
|
The bus to attach the device to
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If the device is already attached to a bus |
detach_from_bus
¶
Detach the device from the bus.
The opposite of the attach_to_bus method.
perform_operation
¶
perform_operation(
operation: PxDeviceOperation, *, timeout: int | None = None
) -> PxDeviceOperation
ibi_request
¶
ibi_request(
ibi_type: IbiType = IMMEDIATE,
mdb_value: bytes = b"",
additional_data: bytes = b"",
skip_bcr_check: bool = False,
) -> None
Initiate an IBI request from the current target.
| PARAMETER | DESCRIPTION |
|---|---|
|
The type of IBI to request, either
TYPE:
|
|
The mandatory data byte (MDB) value to send with the IBI.
TYPE:
|
|
Additional data to send along with the IBI payload.
TYPE:
|
|
If True, the BCR check will be dismissed and still proceed to send and IBI request.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
It the current target BCR does not allow IBI. |
ValueError
|
It the current target BCR does not allow IBI payload, but the caller still tries to send an IBI payload. |
ValueError
|
If the |