Go to the documentation of this file.
11 #include <mrpt/config.h>
35 #if defined(MRPT_OS_LINUX) || defined(__APPLE__)
38 void* usb_device_struct;
122 unsigned long dwReadTimeout_ms,
unsigned long dwWriteTimeout_ms);
131 size_t ReadSync(
void* Buffer,
size_t Count) {
return Read(Buffer, Count); }
137 return Write(Buffer, Count);
154 size_t Read(
void* Buffer,
size_t Count);
160 size_t Write(
const void* Buffer,
size_t Count);
179 void* lpvBuffer,
unsigned long dwBuffSize,
180 unsigned long* lpdwBytesRead);
182 const void* lpvBuffer,
unsigned long dwBuffSize,
183 unsigned long* lpdwBytes);
190 void ftdi_openEx(
void* pArg1,
unsigned long dwFlags);
205 void*,
unsigned long,
unsigned long*);
215 unsigned long,
void*,
unsigned long,
unsigned long*);
219 unsigned long,
const void*,
unsigned long,
unsigned long*);
229 unsigned long,
unsigned long,
unsigned long);
233 unsigned long,
unsigned long*);
237 unsigned long,
unsigned char);
242 void* m_ftdi_context;
245 void recursive_fill_list_devices(
void Purge()
Purge the I/O buffers.
void ListAllDevices(TFTDIDeviceList &outList)
Generates a list with all FTDI devices connected right now.
FT_STATUS(__stdcall * PtrToSetLatencyTimer)(unsigned long, unsigned char)
uint64_t Seek(int64_t Offset, CStream::TSeekOrigin Origin=sFromBeginning)
This virtual method does nothing in this class.
FT_STATUS(__stdcall * PtrToListDevices)(void *, void *, unsigned long)
FT_STATUS(__stdcall * PtrToClose)(unsigned long)
void ftdi_listDevices(void *pArg1, void *pArg2, unsigned long dwFlags)
unsigned __int16 uint16_t
void ftdi_open(void *pvDevice)
FT_STATUS(__stdcall * PtrToResetDevice)(unsigned long)
PtrToResetDevice m_pResetDevice
virtual ~CInterfaceFTDI()
Destructor, which closes the connection with the chip and unloads the driver interface.
std::deque< TFTDIDevice > TFTDIDeviceList
Used in CInterfaceFTDI::ListAllDevices.
uint64_t getTotalBytesCount() const
This virtual method does nothing in this class.
FT_STATUS(__stdcall * PtrToOpenEx)(void *, unsigned long, unsigned long *)
bool isOpen()
Checks whether the chip has been successfully open.
FT_STATUS(__stdcall * PtrToPurge)(unsigned long, unsigned long)
size_t Read(void *Buffer, size_t Count)
Introduces a pure virtual method responsible for reading from the stream.
PtrToSetTimeouts m_pSetTimeouts
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
PtrToListDevices m_pListDevices
void ResetDevice()
Reset the USB device.
void ftdi_openEx(void *pArg1, unsigned long dwFlags)
std::string ftdi_description
void OpenByDescription(const std::string &description)
Open by device description.
PtrToGetQueueStatus m_pGetQueueStatus
virtual size_t ReadBufferImmediate(void *Buffer, size_t Count)
Reads a block of bytes from the stream into Buffer, and returns the amound of bytes actually read,...
uint64_t getPosition() const
This virtual method does nothing in this class.
FT_STATUS(__stdcall * PtrToSetTimeouts)(unsigned long, unsigned long, unsigned long)
A definition of a CStream actually representing a USB connection to a FTDI chip.
FT_STATUS(__stdcall * PtrToRead)(unsigned long, void *, unsigned long, unsigned long *)
A list of FTDI devices and their descriptors.
unsigned __int64 uint64_t
void Close()
Close the USB device.
size_t WriteSync(const void *Buffer, size_t Count)
Tries to write, raising no exception if not all the bytes are available, but raising one if there is ...
mrpt::containers::circular_buffer< uint8_t > m_readBuffer
Used in Read.
CInterfaceFTDI()
Constructor, which loads driver interface (the DLL under Windows).
size_t Write(const void *Buffer, size_t Count)
Introduces a pure virtual method responsible for writing to the stream.
CInterfaceFTDI & operator=(const CInterfaceFTDI &o)=delete
This object cannot be copied.
PtrToSetLatencyTimer m_pSetLatencyTimer
size_t ReadSync(void *Buffer, size_t Count)
Tries to read, raising no exception if not all the bytes are available, but raising one if there is s...
void ftdi_read(void *lpvBuffer, unsigned long dwBuffSize, unsigned long *lpdwBytesRead)
void ftdi_getQueueStatus(unsigned long *lpdwAmountInRxQueue)
FT_STATUS(__stdcall * PtrToOpen)(void *, unsigned long *)
FT_STATUS(__stdcall * PtrToGetQueueStatus)(unsigned long, unsigned long *)
std::string ftdi_manufacturer
GLsizei const GLchar ** string
void OpenBySerialNumber(const std::string &serialNumber)
Open by device serial number.
void SetLatencyTimer(unsigned char latency_ms)
Change the latency timer (in milliseconds) implemented on the FTDI chip: for a few ms,...
void SetTimeouts(unsigned long dwReadTimeout_ms, unsigned long dwWriteTimeout_ms)
Change read & write timeouts, in milliseconds.
void checkErrorAndRaise(int errorCode)
void ftdi_write(const void *lpvBuffer, unsigned long dwBuffSize, unsigned long *lpdwBytes)
std::ostream & operator<<(std::ostream &o, const TFTDIDevice &d)
Print out all the information of a FTDI device in textual form.
FT_STATUS(__stdcall * PtrToWrite)(unsigned long, const void *, unsigned long, unsigned long *)
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |