The PropellerDevice class provides access to serial Propeller devices. More...

#include <PropellerDevice>

Inherits QSerialPort.

Public Slots

void handleError (QSerialPort::SerialPortError e)
 
bool reset ()
 

Signals

void finished ()
 
void sendError (const QString &)
 

Public Member Functions

 PropellerDevice (QObject *parent=0)
 
 ~PropellerDevice ()
 
bool open ()
 
void useReset (const QString &name, int pin=17)
 
void useDefaultReset ()
 
void setPortName (const QString &name)
 
quint32 calculateTimeout (quint32 bytes, quint32 safety_factor=15)
 
quint32 minimumTimeout ()
 
quint32 resetPeriod ()
 
void setMinimumTimeout (quint32 milliseconds)
 

Static Public Member Functions

static QStringList list ()
 

Detailed Description

The PropellerDevice class provides access to serial Propeller devices.

This class inherits from QSerialPort but provides Propeller specific functionality such as hardware reset and download timeouts.

Constructor & Destructor Documentation

PropellerDevice::PropellerDevice ( QObject *  parent = 0)
PropellerDevice::~PropellerDevice ( )

Member Function Documentation

quint32 PropellerDevice::calculateTimeout ( quint32  bytes,
quint32  safety_factor = 15 
)

The total timeout period is calculated as follows.

timeout = bytes * bits_per_character / bits_per_second
                  (1000ms / 1s) * safety_factor / 10
                + minimumTimeout()

safety_factor defaults to 10, and is divided by 10, allowing <1 safety factors.

void PropellerDevice::finished ( )
signal
void PropellerDevice::handleError ( QSerialPort::SerialPortError  e)
slot
QStringList PropellerDevice::list ( )
static

List all available hardware devices.

This function does not check whether Propeller hardware attached to the given devices.

quint32 PropellerDevice::minimumTimeout ( )

Return the minimum timeout for downloading to the Propeller.

The default value is 200 ms.

bool PropellerDevice::open ( )

Open the PropellerDevice for use.

bool PropellerDevice::reset ( )
slot

Reset your attached Propeller hardware using the configured hardware reset.

DTR is the default hardware reset on all PropellerIDE distributions, with the exception of Raspberry Pi, where it is GPIO reset.

quint32 PropellerDevice::resetPeriod ( )
void PropellerDevice::sendError ( const QString &  )
signal
void PropellerDevice::setMinimumTimeout ( quint32  milliseconds)

Set the minimum timeout for downloading to the Propeller.

The default value is 200 ms.

void PropellerDevice::setPortName ( const QString &  name)
void PropellerDevice::useDefaultReset ( )

Use the default reset strategy for your device.

Most Parallax products use DTR for reset, but some third-party boards use RTS as the reset pin.

Raspberry Pi builds of PropellerManager are configured to use GPIO reset by default for as this is the hardware configuration of the Propeller HAT.

void PropellerDevice::useReset ( const QString &  name,
int  pin = 17 
)

Set the reset strategy for your device.