Skip to content

Commit

Permalink
updated message defs
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Dec 18, 2023
1 parent 2086f17 commit 286e501
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 42 deletions.
8 changes: 3 additions & 5 deletions hardware/opentrons_hardware/firmware_bindings/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,9 @@ class MessageId(int, Enum):
write_motor_current_request = 0x33
read_motor_current_request = 0x34
read_motor_current_response = 0x35
motor_driver_error_encountered = 0x36
read_motor_driver_error_register_request = 0x37
read_motor_driver_error_register_response = 0x38
reset_motor_driver_error_handling = 0x39
motor_driver_in_error_state = 0x3b
read_motor_driver_error_status_request = 0x36
read_motor_driver_error_status_response = 0x37
motor_driver_in_error_state = 0x38

set_brushed_motor_vref_request = 0x40
set_brushed_motor_pwm_request = 0x41
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,25 +335,25 @@ class ReadMotorDriverResponse(BaseMessage): # noqa: D101


@dataclass
class MotorDriverErrorEncountered(BaseMessage): # noqa: D101
class ReadMotorDriverErrorStatusRequest(BaseMessage): # noqa: D101
payload: payloads.EmptyPayload
payload_type: Type[
payloads.EmptyPayload
] = payloads.EmptyPayload
message_id: Literal[
MessageId.motor_driver_error_encountered
] = MessageId.motor_driver_error_encountered
MessageId.read_motor_driver_error_status_request
] = MessageId.read_motor_driver_error_status_request


@dataclass
class ResetMotorDriverErrorHandling(BaseMessage): # noqa: D101
payload: payloads.EmptyPayload
class ReadMotorDriverErrorStatusResponse(BaseMessage): # noqa: D101
payload: payloads.ReadMotorDriverErrorStatusResponsePayload
payload_type: Type[
payloads.EmptyPayload
] = payloads.EmptyPayload
payloads.ReadMotorDriverErrorStatusResponsePayload
] = payloads.ReadMotorDriverErrorStatusResponsePayload
message_id: Literal[
MessageId.reset_motor_driver_error_handling
] = MessageId.reset_motor_driver_error_handling
MessageId.read_motor_driver_error_status_response
] = MessageId.read_motor_driver_error_status_response


@dataclass
Expand All @@ -367,28 +367,6 @@ class MotorDriverInErrorState(BaseMessage): # noqa: D101
] = MessageId.motor_driver_in_error_state


@dataclass
class ReadMotorDriverErrorRequest(BaseMessage): # noqa: D101
payload: payloads.EmptyPayload
payload_type: Type[
payloads.EmptyPayload
] = payloads.EmptyPayload
message_id: Literal[
MessageId.read_motor_driver_error_register_request
] = MessageId.read_motor_driver_error_register_request


@dataclass
class ReadMotorDriverErrorResponse(BaseMessage): # noqa: D101
payload: payloads.ReadMotorDriverErrorRegisterResponsePayload
payload_type: Type[
payloads.ReadMotorDriverErrorRegisterResponsePayload
] = payloads.ReadMotorDriverErrorRegisterResponsePayload
message_id: Literal[
MessageId.read_motor_driver_error_register_response
] = MessageId.read_motor_driver_error_register_response


@dataclass
class WriteMotorCurrentRequest(BaseMessage): # noqa: D101
payload: payloads.MotorCurrentPayload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@
defs.WriteMotorDriverRegister,
defs.ReadMotorDriverRequest,
defs.ReadMotorDriverResponse,
defs.MotorDriverErrorEncountered,
defs.ReadMotorDriverErrorRequest,
defs.ReadMotorDriverErrorResponse,
defs.ResetMotorDriverErrorHandling,
defs.ReadMotorDriverErrorStatusRequest,
defs.ReadMotorDriverErrorStatusResponse,
defs.MotorDriverInErrorState,
defs.WriteMotorCurrentRequest,
defs.SetBrushedMotorVrefRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ class ReadMotorDriverRegisterResponsePayload(EmptyPayload):


@dataclass(eq=False)
class ReadMotorDriverErrorRegisterResponsePayload(EmptyPayload):
"""Read motor driver error register response payload."""
class ReadMotorDriverErrorStatusResponsePayload(EmptyPayload):
"""Read motor driver error status response payload."""

reg_addr: utils.UInt8Field
data: utils.UInt32Field
Expand Down

0 comments on commit 286e501

Please sign in to comment.