Module implementing the device interface class for BBC micro:bit and Calliope mini boards.
None |
MicrobitDevice | Class implementing the device for BBC micro:bit and Calliope mini boards. |
createDevice | Function to instantiate a MicroPython device object. |
Class implementing the device for BBC micro:bit and Calliope mini boards.
None |
None |
MicrobitDevice | Constructor |
__createMicrobitMenu | Private method to create the microbit submenu. |
__firmwareVersionResponse | Private method handling the response of the latest version request. |
__flashMicroPython | Private slot to flash MicroPython or the DAPLink firmware to the device. |
__isCalliope | Private method to check, if the device is a Calliope mini. |
__isMicroBitV1 | Private method to check, if the device is a BBC micro:bit v1. |
__isMicroBitV2 | Private method to check, if the device is a BBC micro:bit v2. |
__resetDevice | Private slot to reset the connected device. |
__saveMain | Private slot to copy the current script as 'main.py' onto the connected device. |
__showFirmwareVersions | Private slot to show the firmware version of the connected device and the available firmware version. |
_getSetTimeCode | Protected method to get the device code to set the time. |
addDeviceMenuEntries | Public method to add device specific entries to the given menu. |
canRunScript | Public method to determine, if a script can be executed. |
canStartFileManager | Public method to determine, if a File Manager can be started. |
canStartPlotter | Public method to determine, if a Plotter can be started. |
canStartRepl | Public method to determine, if a REPL can be started. |
deviceName | Public method to get the name of the device. |
forceInterrupt | Public method to determine the need for an interrupt when opening the serial connection. |
getDocumentationUrl | Public method to get the device documentation URL. |
getDownloadMenuEntries | Public method to retrieve the entries for the downloads menu. |
hasFlashMenuEntry | Public method to check, if the device has its own flash menu entry. |
hasTimeCommands | Public method to check, if the device supports time commands. |
lls | Public method to get a long directory listing of the connected device including meta data. |
ls | Public method to get a directory listing of the connected device. |
pwd | Public method to get the current directory of the connected device. |
runScript | Public method to run the given Python script. |
setButtons | Public method to enable the supported action buttons. |
None |
Constructor
Private method to create the microbit submenu.
Private method handling the response of the latest version request.
Private slot to flash MicroPython or the DAPLink firmware to the device.
Private method to check, if the device is a Calliope mini.
Private method to check, if the device is a BBC micro:bit v1.
Private method to check, if the device is a BBC micro:bit v2.
Private slot to reset the connected device.
Private slot to copy the current script as 'main.py' onto the connected device.
Private slot to show the firmware version of the connected device and the available firmware version.
Protected method to get the device code to set the time.
Note: This method must be implemented in the various device specific subclasses.
Public method to add device specific entries to the given menu.
Public method to determine, if a script can be executed.
Public method to determine, if a File Manager can be started.
Public method to determine, if a Plotter can be started.
Public method to determine, if a REPL can be started.
Public method to get the name of the device.
Public method to determine the need for an interrupt when opening the serial connection.
Public method to get the device documentation URL.
Public method to retrieve the entries for the downloads menu.
Public method to check, if the device has its own flash menu entry.
Public method to check, if the device supports time commands.
The default returns True.
Public method to get a long directory listing of the connected device including meta data.
Public method to get a directory listing of the connected device.
Public method to get the current directory of the connected device.
Public method to run the given Python script.
Public method to enable the supported action buttons.
Function to instantiate a MicroPython device object.