overlay_task¶
Abstract base classes for overlay tasks (OverlayTask, DaemonTask) and a
reference BlinkLedTask implementation.
rfsoc_rfdc.overlay_task
¶
Attributes¶
TASK_STATE = {'IDLE': 0, 'RUNNING': 1, 'PAUSE': 2, 'STOP': 3}
module-attribute
¶
Classes¶
OverlayTask(overlay, name='OverlayTask')
¶
Bases: ABC
An abstract base class for creating tasks to be run on an RFSoCOverlay.
Attributes:
| Name | Type | Description |
|---|---|---|
ol |
RFSoCOverlay
|
An instance of RFSoCOverlay to operate on. |
task_name |
str
|
The name of the task. |
thread |
Thread
|
The thread on which the task runs. |
Methods:
| Name | Description |
|---|---|
run |
An abstract method to define the task's behavior. |
start |
Starts the task's thread. |
join |
Waits for the task's thread to complete. |
Initializes the OverlayTask with a given RFSoCOverlay instance and task name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
overlay
|
RFSoCOverlay
|
The RFSoCOverlay instance to operate on. |
required |
name
|
str
|
The name of the task. Defaults to "OverlayTask". |
'OverlayTask'
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If the overlay is not an instance of RFSoCOverlay. |
Source code in rfsoc_rfdc/overlay_task.py
DaemonTask
¶
BlinkLedTask(overlay)
¶
Bases: OverlayTask
A task that blinks LEDs on an RFSoCOverlay.
Inherits from OverlayTask.
Attributes:
| Name | Type | Description |
|---|---|---|
green_leds |
AxiGPIO
|
AxiGPIO instance for controlling green LEDs. |
red_leds |
AxiGPIO
|
AxiGPIO instance for controlling red LEDs. |
Methods:
| Name | Description |
|---|---|
run |
Implements the LED blinking behavior. |
Initializes the BlinkLedTask with a given RFSoCOverlay instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
overlay
|
RFSoCOverlay
|
The RFSoCOverlay instance to operate on. |
required |
Source code in rfsoc_rfdc/overlay_task.py
Attributes¶
green_leds = AxiGPIO(self.ol.ip_dict['axi_gpio_led']).channel1
instance-attribute
¶
red_leds = AxiGPIO(self.ol.ip_dict['axi_gpio_led']).channel2
instance-attribute
¶
Functions¶
run()
¶
Runs the LED blinking task. Alternates the LEDs between on and off states at a fixed interval.