Main module¶
This is the module that handles all the communication with the current Gramophone device.
Gramophone class¶
-
class
Gramophone.
Gramophone
(device, verbose=False)[source]¶ Representation of a Gramophone device.
Parameters: device (usb.core.Device) – The USB device identity -
class
Parameter
(name, info, type)¶ -
info
¶ Alias for field number 1
-
name
¶ Alias for field number 0
-
type
¶ Alias for field number 2
-
-
decode_response
(response)[source]¶ Decodes a response. Returns the error message if the command was not successful and None otherwise.
Parameters: response – The response to decode. Ptype response: Packet
-
read_dev_state
()[source]¶ Read the state of the device. The device should be in 0x01 state for usage. The 0x00 state is for setup.
Returns: The device state. ‘Application’ or ‘IAP’ Return type: str
-
read_firmware_info
()[source]¶ Read the firmware information from the Gramophone. Sets the fimware related variables of the object.
Returns: A dictionary with the firmware info fields in a human readable format. Return type: dict
-
read_homing_state
()[source]¶ 0 if the encoder is not trying to find the home position, 1 if it is homing and 2 if the home position was found.
-
class