|
1 | 1 | import abc
|
2 | 2 | from datetime import timedelta
|
3 |
| -from multiprocessing import Queue |
4 |
| -from typing import Any, Callable, Dict, Final, List, Optional |
| 3 | +from typing import Any, Dict, Final, List, Optional |
5 | 4 |
|
6 | 5 | from viam.proto.common import BoardStatus
|
7 | 6 | from viam.proto.component.board import PowerMode
|
8 | 7 | from viam.resource.types import RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, Subtype
|
9 | 8 |
|
10 | 9 | from ..component_base import ComponentBase
|
11 | 10 |
|
12 |
| -PostProcessor = Callable[[int], int] |
13 |
| - |
14 | 11 |
|
15 | 12 | class Board(ComponentBase):
|
16 | 13 | """
|
@@ -57,41 +54,6 @@ async def value(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Option
|
57 | 54 | """
|
58 | 55 | ...
|
59 | 56 |
|
60 |
| - @abc.abstractmethod |
61 |
| - async def tick(self, high: bool, nanos: int): |
62 |
| - """ |
63 |
| - This method is to be called either manually if the interrupt |
64 |
| - is a proxy to some real hardware interrupt or for tests. |
65 |
| -
|
66 |
| - Args: |
67 |
| - high (bool): If the signal of the interrupt is high. |
68 |
| - nanos (int): Nanoseconds from an arbitrary point in time, |
69 |
| - but always increasing and always needs to be accurate. |
70 |
| - Using ``time.time_ns()`` would be acceptable. |
71 |
| - """ |
72 |
| - ... |
73 |
| - |
74 |
| - @abc.abstractmethod |
75 |
| - async def add_callback(self, queue: Queue): |
76 |
| - """ |
77 |
| - Add a callback to be sent the low/high value on ``tick()``. |
78 |
| -
|
79 |
| - Args: |
80 |
| - queue (Queue): The receiving queue. |
81 |
| - """ |
82 |
| - ... |
83 |
| - |
84 |
| - @abc.abstractmethod |
85 |
| - async def add_post_processor(self, processor: PostProcessor): |
86 |
| - """ |
87 |
| - Add a post processor that should be used to modify what |
88 |
| - is returned by ``self.value()`` |
89 |
| -
|
90 |
| - Args: |
91 |
| - processor (PostProcessor): The post processor to add. |
92 |
| - """ |
93 |
| - ... |
94 |
| - |
95 | 57 | class GPIOPin(ComponentBase):
|
96 | 58 | """
|
97 | 59 | Abstract representation of an individual GPIO pin on a board
|
|
0 commit comments