# eric7.MicroPython.RP2040Devices

Module implementing the device interface class for RP2040 based boards (e.g. Raspberry Pi Pico).

### Global Attributes

None

### Classes

RP2040Device | Class implementing the device for RP2040 based boards.

### Functions

None

## RP2040Device

Class implementing the device for RP2040 based boards.

### Derived from

MicroPythonDevice

### Class Attributes

None

### Class Methods

None

### Methods

RP2040Device | Constructor
__activateBootloader | Private method to switch the board into 'bootloader' mode.
__flashPython | Private slot to flash a MicroPython firmware to the device.
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.
runScript | Public method to run the given Python script.
setButtons | Public method to enable the supported action buttons.

### Static Methods

None

#### RP2040Device (Constructor)

RP2040Device(microPythonWidget, deviceType, parent=None)

Constructor

microPythonWidget (MicroPythonWidget)
  reference to the main MicroPython widget
deviceType (str)
  device type assigned to this device interface
parent (QObject)
  reference to the parent object

#### RP2040Device.__activateBootloader

__activateBootloader()

Private method to switch the board into 'bootloader' mode.

#### RP2040Device.__flashPython

__flashPython()

Private slot to flash a MicroPython firmware to the device.

#### RP2040Device.addDeviceMenuEntries

addDeviceMenuEntries(menu)

Public method to add device specific entries to the given menu.

menu (QMenu)
  reference to the context menu

#### RP2040Device.canRunScript

canRunScript()

Public method to determine, if a script can be executed.

Return:
  tuple containing a flag indicating it is safe to start a Plotter and a reason why it cannot.

Return Type:
  tuple of (bool, str)

#### RP2040Device.canStartFileManager

canStartFileManager()

Public method to determine, if a File Manager can be started.

Return:
  tuple containing a flag indicating it is safe to start a File Manager and a reason why it cannot.

Return Type:
  tuple of (bool, str)

#### RP2040Device.canStartPlotter

canStartPlotter()

Public method to determine, if a Plotter can be started.

Return:
  tuple containing a flag indicating it is safe to start a Plotter and a reason why it cannot.

Return Type:
  tuple of (bool, str)

#### RP2040Device.canStartRepl

canStartRepl()

Public method to determine, if a REPL can be started.

Return:
  tuple containing a flag indicating it is safe to start a REPL and a reason why it cannot.

Return Type:
  tuple of (bool, str)

#### RP2040Device.deviceName

deviceName()

Public method to get the name of the device.

Return:
  name of the device

Return Type:
  str

#### RP2040Device.forceInterrupt

forceInterrupt()

Public method to determine the need for an interrupt when opening the serial connection.

Return:
  flag indicating an interrupt is needed

Return Type:
  bool

#### RP2040Device.getDocumentationUrl

getDocumentationUrl()

Public method to get the device documentation URL.

Return:
  documentation URL of the device

Return Type:
  str

#### RP2040Device.getDownloadMenuEntries

getDownloadMenuEntries()

Public method to retrieve the entries for the downloads menu.

Return:
  list of tuples with menu text and URL to be opened for each entry

Return Type:
  list of tuple of (str, str)

#### RP2040Device.hasFlashMenuEntry

hasFlashMenuEntry()

Public method to check, if the device has its own flash menu entry.

Return:
  flag indicating a specific flash menu entry

Return Type:
  bool

#### RP2040Device.runScript

runScript(script)

Public method to run the given Python script.

script (str)
  script to be executed

#### RP2040Device.setButtons

setButtons()

Public method to enable the supported action buttons.

Up