UART Tx¶
The PxUartTx class implements the functionality of a UART Transmitter. It provides methods to transmit data.
PxUartTx
¶
PxUartTx(
exerciser: AqProtocolExerciser,
baud_rate: int = 9600,
stop_bits: int = 1,
data_bits: int = 8,
parity: PxUartParityMode = PARITY_MODE_NONE,
config: PxUartConfig | None = None,
*args,
**kwargs
)
Uart Tx Class.
| METHOD | DESCRIPTION |
|---|---|
add_event_handler |
Add an event handler to the current device instance. |
attach_to_bus |
Attach the controller to a bus. |
config |
Set the config of the controller. |
detach_from_bus |
Detach the device from the bus. |
get_event_handlers |
Retreive handlers registerd on this device. |
on_event |
Add an event handler to the instance by decorator. |
perform_operation |
Send an operation. |
remove_event_handler |
Remove an event handler. |
write_bytes |
Write a list of data in bytes to the bus. |
write_data |
Write a list of data to the bus. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
available_events_map |
A reverse mapping of |
is_attached |
Check if the device is attached to a bus.
TYPE:
|
name |
Get the name of the device.
TYPE:
|
state |
Get the state of the device.
TYPE:
|
available_events_map
¶
A reverse mapping of field_name_by_number, which uses field name as key.
add_event_handler
¶
Add an event handler to the current device instance.
attach_to_bus
¶
attach_to_bus(bus: PxAbstractBus) -> None
Attach the controller 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.
get_event_handlers
¶
Retreive handlers registerd on this device.
on_event
¶
Add an event handler to the instance by decorator.
perform_operation
¶
Send an operation.
write_bytes
¶
Write a list of data in bytes to the bus.