|
1 |
| -from typing import List, Protocol |
| 1 | +from typing import List, Optional, Protocol |
2 | 2 |
|
3 | 3 | from .types import (
|
| 4 | + LEDPattern, |
4 | 5 | LimitSwitchStatus,
|
5 | 6 | MoveResult,
|
6 | 7 | StackerAxis,
|
|
9 | 10 | MoveParams,
|
10 | 11 | StackerInfo,
|
11 | 12 | LEDColor,
|
| 13 | + StallGuardParams, |
12 | 14 | )
|
13 | 15 |
|
14 | 16 |
|
@@ -51,10 +53,30 @@ async def set_ihold_current(self, axis: StackerAxis, current: float) -> bool:
|
51 | 53 | """Set axis hold current in amps."""
|
52 | 54 | ...
|
53 | 55 |
|
| 56 | + async def set_stallguard_threshold( |
| 57 | + self, axis: StackerAxis, enable: bool, threshold: int |
| 58 | + ) -> bool: |
| 59 | + """Enables and sets the stallguard threshold for the given axis motor.""" |
| 60 | + ... |
| 61 | + |
| 62 | + async def set_motor_driver_register( |
| 63 | + self, axis: StackerAxis, reg: int, value: int |
| 64 | + ) -> bool: |
| 65 | + """Set the register of the given motor axis driver to the given value.""" |
| 66 | + ... |
| 67 | + |
| 68 | + async def get_motor_driver_register(self, axis: StackerAxis, reg: int) -> int: |
| 69 | + """Gets the register value of the given motor axis driver.""" |
| 70 | + ... |
| 71 | + |
54 | 72 | async def get_motion_params(self, axis: StackerAxis) -> MoveParams:
|
55 | 73 | """Get the motion parameters used by the given axis motor."""
|
56 | 74 | ...
|
57 | 75 |
|
| 76 | + async def get_stallguard_threshold(self, axis: StackerAxis) -> StallGuardParams: |
| 77 | + """Get the stallguard parameters by the given axis motor.""" |
| 78 | + ... |
| 79 | + |
58 | 80 | async def get_limit_switch(self, axis: StackerAxis, direction: Direction) -> bool:
|
59 | 81 | """Get limit switch status.
|
60 | 82 |
|
@@ -96,16 +118,26 @@ async def move_to_limit_switch(
|
96 | 118 | """Move until limit switch is triggered."""
|
97 | 119 | ...
|
98 | 120 |
|
99 |
| - async def home_axis(self, axis: StackerAxis, direction: Direction) -> bool: |
| 121 | + async def home_axis(self, axis: StackerAxis, direction: Direction) -> MoveResult: |
100 | 122 | """Home axis."""
|
101 | 123 | ...
|
102 | 124 |
|
103 | 125 | async def set_led(
|
104 |
| - self, power: float, color: LEDColor | None = None, external: bool | None = None |
| 126 | + self, |
| 127 | + power: float, |
| 128 | + color: Optional[LEDColor] = None, |
| 129 | + external: Optional[bool] = None, |
| 130 | + pattern: Optional[LEDPattern] = None, |
| 131 | + duration: Optional[int] = None, |
| 132 | + reps: Optional[int] = None, |
105 | 133 | ) -> bool:
|
106 |
| - """Set LED color of status bar.""" |
| 134 | + """Set LED Status bar color and pattern.""" |
107 | 135 | ...
|
108 | 136 |
|
109 | 137 | async def enter_programming_mode(self) -> None:
|
110 | 138 | """Reboot into programming mode"""
|
111 | 139 | ...
|
| 140 | + |
| 141 | + def reset_serial_buffers(self) -> None: |
| 142 | + """Reset the input and output serial buffers.""" |
| 143 | + ... |
0 commit comments