#include <FalconCommFTD2XX.h>
Inherits libnifalcon::FalconComm.
Public Member Functions | |
FalconCommFTD2XX () | |
virtual | ~FalconCommFTD2XX () |
virtual bool | getDeviceCount (unsigned int &count) |
virtual void | poll () |
virtual bool | open (unsigned int index) |
virtual bool | close () |
virtual bool | read (uint8_t *str, unsigned int size) |
virtual bool | write (uint8_t *str, unsigned int size) |
virtual bool | readBlocking (uint8_t *str, unsigned int size) |
virtual bool | writeBlocking (uint8_t *str, unsigned int size) |
virtual bool | setFirmwareMode () |
virtual bool | setNormalMode () |
Protected Member Functions | |
int8_t | openDeviceFTD2XX (unsigned int index, bool should_open) |
Protected Attributes | |
void * | m_falconDevice |
Static Protected Attributes | |
static const char * | FALCON_DESCRIPTION = "FALCON HAPTIC" |
FalconCommFTD2XX is built directly into the libnifalcon core library, as is chosen for the user by default by the FalconDevice constructor, so it is usually not needed. However, it is left here for code compatibility for code that already used comm behavior setting, which was required before libnifalcon v1.0
libnifalcon::FalconCommFTD2XX::FalconCommFTD2XX | ( | ) | [inline] |
Constructor
libnifalcon::FalconCommFTD2XX::~FalconCommFTD2XX | ( | ) | [virtual] |
Destructor
bool libnifalcon::FalconCommFTD2XX::close | ( | ) | [virtual] |
Closes the device, if open
Implements libnifalcon::FalconComm.
bool libnifalcon::FalconCommFTD2XX::getDeviceCount | ( | unsigned int & | count | ) | [virtual] |
Returns the number of devices connected to the system
[out] | count | The number of devices available |
Implements libnifalcon::FalconComm.
bool libnifalcon::FalconCommFTD2XX::open | ( | unsigned int | index | ) | [virtual] |
Opens the device at the specified index
[in] | index | Index of the device to open |
Implements libnifalcon::FalconComm.
int8_t libnifalcon::FalconCommFTD2XX::openDeviceFTD2XX | ( | unsigned int | index, | |
bool | should_open | |||
) | [protected] |
Internal device opening function
[in] | index | Index of device to open |
[in] | should_open | If true, open. If false, return count |
void libnifalcon::FalconCommFTD2XX::poll | ( | ) | [virtual] |
Polls the object for confirmation of write/read return
Reimplemented from libnifalcon::FalconComm.
bool libnifalcon::FalconCommFTD2XX::read | ( | uint8_t * | str, | |
unsigned int | size | |||
) | [virtual] |
Read a specified number of bytes from the device
[out] | str | Buffer to read data into |
[in] | size | Amount of bytes to read |
Implements libnifalcon::FalconComm.
bool libnifalcon::FalconCommFTD2XX::readBlocking | ( | uint8_t * | str, | |
unsigned int | size | |||
) | [virtual] |
Read a specified number of bytes from the device
[out] | str | Buffer to read data into |
[in] | size | Amount of bytes to read |
Implements libnifalcon::FalconComm.
bool libnifalcon::FalconCommFTD2XX::setFirmwareMode | ( | ) | [virtual] |
Sets the communications mode and initializes the device to load firmware
Implements libnifalcon::FalconComm.
bool libnifalcon::FalconCommFTD2XX::setNormalMode | ( | ) | [virtual] |
Sets the communications mode and initializes the device to run in normal operation
Implements libnifalcon::FalconComm.
bool libnifalcon::FalconCommFTD2XX::write | ( | uint8_t * | str, | |
unsigned int | size | |||
) | [virtual] |
Write a specified number of bytes to the device
[in] | str | Buffer to write data from |
[in] | size | Amount of bytes to write |
Implements libnifalcon::FalconComm.
virtual bool libnifalcon::FalconCommFTD2XX::writeBlocking | ( | uint8_t * | str, | |
unsigned int | size | |||
) | [inline, virtual] |
Write a specified number of bytes to the device
[in] | str | Buffer to write data from |
[in] | size | Amount of bytes to write |
Implements libnifalcon::FalconComm.
const char * libnifalcon::FalconCommFTD2XX::FALCON_DESCRIPTION = "FALCON HAPTIC" [static, protected] |
String describing the falcon (used for identification)
void* libnifalcon::FalconCommFTD2XX::m_falconDevice [protected] |
Internal pointer to ftdi device struct
This would usually be a FT_HANDLE, but FT_HANDLE is just a void*, so this saves us having to deal with the include at this level.