I3C Target CCC Support¶
For each Common Command Code (CCC) that the AQPXLIB I3C targets respond to, this page gives the target behavior and the constructor arguments that change it.
The page applies to these classes:
All three targets handle the same CCCs, with one difference: only PxI3C32BitRegisterTarget accepts ENTHDR0 (see HDR entry).
To send a CCC from a controller, see PxI3CBaseController.
Summary¶
| CCC | ID | Type | Supported | Configuration that affects it |
|---|---|---|---|---|
| ENEC | 0x00 / 0x80 |
Broadcast / Direct | Yes | None |
| DISEC | 0x01 / 0x81 |
Broadcast / Direct | Yes | None |
| RSTDAA | 0x06 |
Broadcast | Yes | None |
| ENTDAA | 0x07 |
Broadcast | Yes | pid, bcr, dcr |
| SETMWL | 0x09 / 0x89 |
Broadcast / Direct | Yes | minimum_mwl |
| SETMRL | 0x0A / 0x8A |
Broadcast / Direct | Yes | minimum_mrl, bcr |
| ENTHDR0 | 0x20 |
Broadcast | PxI3C32BitRegisterTarget only |
None |
| ENTHDR1 to ENTHDR7 | 0x21 to 0x27 |
Broadcast | No | None |
| SETAASA | 0x29 |
Broadcast | Yes | static_addr |
| RSTACT | 0x2A / 0x9A |
Broadcast / Direct | Yes | reset_actions |
| RSTGRPA | 0x2C / 0x9C |
Broadcast / Direct | Yes | supported_group_address_count |
| SETDASA | 0x87 |
Direct | Yes | static_addr |
| SETNEWDA | 0x88 |
Direct | Yes | None |
| GETMWL | 0x8B |
Direct | Yes | minimum_mwl |
| GETMRL | 0x8C |
Direct | Yes | minimum_mrl, bcr |
| GETPID | 0x8D |
Direct | Yes | pid |
| GETBCR | 0x8E |
Direct | Yes | bcr |
| GETDCR | 0x8F |
Direct | Yes | dcr |
| GETSTATUS | 0x90 |
Direct | Yes | getstatus_std_value, getstatus_usr_value |
| GETACCCR | 0x91 |
Direct | No | None |
| GETMXDS | 0x94 |
Direct | Yes | getmxds_std_value, getmxds_usr_value |
| GETCAPS | 0x95 |
Direct | Yes | getcaps_std_value, getcaps_usr_value, supported_group_address_count |
| SETGRPA | 0x9B |
Direct | Yes | supported_group_address_count |
| Other CCCs | No | None |
When a target receives a CCC that it does not support, it does not respond and ignores the rest of the transaction. The target state does not change.
General behavior¶
- A direct CCC runs only when the CCC is addressed to the target. The target must have a dynamic address, except for
SETDASA, which is addressed to the static address. - A direct CCC that uses the wrong read/write direction, such as a
GETPIDsent as a write, is not executed. - A target with no dynamic address assigned ignores all direct CCCs except
SETDASA. - The
getcaps_*,getstatus_*, andgetmxds_*arguments accept at most one user-defined entry for GETCAPS, two for GETSTATUS, and one for GETMXDS. Passing more raisesNotImplementedError.
Address assignment CCCs¶
ENTDAA (0x07)¶
A target that has no dynamic address takes part in Dynamic Address Assignment. It sends its 48-bit PID, BCR, and DCR, then accepts the 7-bit dynamic address that the controller sends.
A target that already has a dynamic address does not take part.
| Argument | Effect |
|---|---|
pid |
Sent as the PID. If omitted, the target uses a random PID with the Acute manufacturer ID. |
bcr |
Sent as the BCR. |
dcr |
Sent as the DCR. |
After assignment, the target emits a PxI3CTargetAssignedAddressEvent. The assigned_address property returns the new address.
SETDASA (0x87)¶
If the target has no dynamic address, it accepts the dynamic address from the data byte and assigns it. The controller addresses this CCC to the target's static address.
A target that already has a dynamic address ignores SETDASA.
| Argument | Effect |
|---|---|
static_addr |
The address that this CCC must use. The default 0 means the target has no static address. |
SETAASA (0x29)¶
If the target has no dynamic address, it sets its dynamic address equal to its static address. A target that already has a dynamic address ignores the CCC.
| Argument | Effect |
|---|---|
static_addr |
Becomes the dynamic address. |
SETNEWDA (0x88)¶
The target replaces its dynamic address with the new address in the data byte. The CCC is addressed to the target's current dynamic address.
RSTDAA (0x06)¶
The target clears its dynamic address. After this CCC, assigned_address is 0 and the target takes part in ENTDAA again.
All address assignment CCCs emit a PxI3CTargetAssignedAddressEvent.
Event enable and disable CCCs¶
ENEC and DISEC (0x00, 0x01, 0x80, 0x81)¶
The CCC data byte is a bit mask of events.
ENECsets the bits that are 1 in the mask.DISECclears the bits that are 1 in the mask.
The result is available in the event_state property, and the target emits a PxI3CTargetUpdatedEventStateEvent.
| Bit | Event | Effect on the target |
|---|---|---|
| 0 | Target interrupt requests (ENINT) | ibi_request() raises ValueError while this bit is 0. |
| 1 | Controller role requests (ENCR) | Tracked in event_state only. |
| 3 | Hot-Join (ENHJ) | Tracked in event_state only. |
The initial event_state is 0x0B (all three events enabled).
Maximum length CCCs¶
SETMWL and SETMRL (0x09, 0x0A, 0x89, 0x8A)¶
The CCC carries a 16-bit length, most significant byte first. The target stores the length and reports it in the mwl or mrl property.
The target ignores a length that is smaller than the configured minimum.
| Argument | Effect |
|---|---|
minimum_mwl |
Smallest accepted SETMWL value. Also the initial mwl. Default 0x10. Must be 255 or less. |
minimum_mrl |
Smallest accepted SETMRL value. Also the initial mrl. Default 0x10. Must be 255 or less. |
bcr |
If bit 2 is set, SETMRL can carry a third byte that sets the maximum IBI payload size. |
When the third SETMRL byte is present, the target stores it and reports it in the ibi_payload_size property. A value of 0 means unlimited. If BCR bit 2 is clear, ibi_payload_size is None and the third byte is not read.
GETMWL and GETMRL (0x8B, 0x8C)¶
The target returns the current length as two bytes, most significant byte first. GETMRL returns a third byte, the IBI payload size, when BCR bit 2 is set.
The returned values follow the minimum_mwl and minimum_mrl arguments, any later SETMWL or SETMRL, and the reset actions.
Identity CCCs¶
| CCC | ID | Response | Controlled by |
|---|---|---|---|
| GETPID | 0x8D |
6 bytes, most significant byte first | pid |
| GETBCR | 0x8E |
1 byte | bcr |
| GETDCR | 0x8F |
1 byte | dcr |
For an example, see Directly Get the PID, BCR and DCR.
Capability and status CCCs¶
These CCCs return a configured value. The target does not compute the value from its runtime state.
The first byte after the CCC is the defining byte. A defining byte of 0x00, or no defining byte, selects the standard value. Other defining bytes select a user-defined value. If the defining byte does not match any value, the target does not respond.
GETCAPS (0x95)¶
| Defining byte | Response | Controlled by |
|---|---|---|
0x00 |
The standard value. | getcaps_std_value |
0x5A |
The fixed test pattern A5 5A A5 5A. |
Not configurable |
Value from getcaps_usr_value |
The user-defined value. | getcaps_usr_value=[(defining_byte, value)] |
If you omit getcaps_std_value, the target returns four bytes: 00, then (supported_group_address_count << 4) | 0x01, then 00 00. If you provide it, the value must not be empty.
GETSTATUS (0x90)¶
| Defining byte | Response | Controlled by |
|---|---|---|
0x00 |
Two bytes. The default is 00 00. |
getstatus_std_value |
First defining byte in getstatus_usr_value |
The user-defined value. | getstatus_usr_value[0] |
Second defining byte in getstatus_usr_value |
The user-defined value. | getstatus_usr_value[1] |
GETMXDS (0x94)¶
| Defining byte | Response | Controlled by |
|---|---|---|
0x00 |
The standard value. The default is two zero bytes. | getmxds_std_value |
Defining byte in getmxds_usr_value |
The user-defined value. | getmxds_usr_value=[(defining_byte, value)] |
Example¶
target = PxI3CFifoTarget(
exerciser,
static_addr=0x30,
getcaps_std_value=bytes([0x00, 0x31, 0x00, 0x00]),
getcaps_usr_value=[(0xC0, bytes([0x01, 0x02]))],
getstatus_std_value=bytes([0x00, 0x00]),
getmxds_std_value=bytes([0x00, 0x00]),
)
With this target, GETCAPS with defining byte 0x00 returns 00 31 00 00, and with defining byte 0xC0 returns 01 02.
Group address CCCs¶
A target can hold up to three group addresses. supported_group_address_count sets how many (0 to 3, default 3). A larger value raises NotImplementedError.
The group_addresses property lists the assigned group addresses.
SETGRPA (0x9B)¶
The target stores the group address from the data byte in its first free slot. If all supported slots are in use, the target does not respond. With supported_group_address_count=0, the target never accepts a group address.
RSTGRPA (0x2C, 0x9C)¶
- Broadcast, or direct to the target's dynamic address: the target clears all of its group addresses.
- Sent to a group address: the target clears only that group address.
Both CCCs emit a PxI3CTargetAssignedGroupAddressEvent.
CCCs sent to a group address¶
A target accepts only these CCCs when they are sent to one of its group addresses: ENEC, DISEC, SETMWL, SETMRL, SETGRPA, and RSTGRPA. The CCCs behave as described above. Group addresses accept writes only, so the target ignores reads.
HDR entry (CCC IDs 0x20 to 0x27)¶
| CCC | PxI3C32BitRegisterTarget |
PxI3C8BitAddressMemoryTarget and PxI3CFifoTarget |
|---|---|---|
ENTHDR0 |
Enters HDR-DDR mode. | Not supported. |
ENTHDR1 to ENTHDR7 |
Not supported. | Not supported. |
A target that does not support the requested HDR mode ignores the bus until the controller sends an HDR Exit pattern.
Target reset and CCC state¶
reset_actions selects which state a Target Reset Pattern, or a signal on the reset_pin GPIO, restores. It is a bit mask of PxI3CTargetResetAction values. If you omit it, the target uses all actions except DATA.
| Action | Value | Effect |
|---|---|---|
SPIKE_FILTER |
1 | Resets the target bus state. |
ASSIGNED_ADDRESS |
2 | Clears the dynamic address, as RSTDAA does. |
GROUP_ADDRESSES |
4 | Clears all group addresses, as RSTGRPA does. |
MWL |
8 | Restores mwl to minimum_mwl. |
MRL |
16 | Restores mrl to minimum_mrl and the IBI payload size to the configured value. |
DATA |
32 | Clears the target data, such as the FIFO or memory contents. |
RSTACT (0x2A, 0x9A)¶
RSTACT selects what the target does on the next Target Reset Pattern. It does not change reset_actions, and it does not affect reset_pin.
| Defining byte | Write (broadcast or direct) | Direct read |
|---|---|---|
0x00 |
The next Target Reset Pattern restores nothing. | Returns one byte: 0x00 if the next Target Reset Pattern restores nothing, otherwise 0x01. |
0x01 |
The next Target Reset Pattern restores the state that reset_actions selects. |
Same as 0x00. |
| Any other value, or none | Broadcast: ignored. Direct: the target does not respond. | The target does not respond. For 0x81 to 0x83, this tells the controller to use the default reset times. |
The selection lasts until the next START. Other CCCs after a repeated START keep it. A STOP or a Target Reset Pattern does not end it either, so a Target Reset Pattern sent from an idle bus afterwards still uses it. At the next START, the target goes back to reset_actions. broadcast_rstact and direct_rstact end the transaction with a Target Reset Pattern by default, so the selection applies to that pattern.