10 #ifndef CInterfaceFTDI_H 11 #define CInterfaceFTDI_H 13 #include <mrpt/config.h> 39 #if defined(MRPT_OS_LINUX) || defined(MRPT_OS_APPLE) 41 void *usb_device_struct;
98 void OpenBySerialNumber(
const std::string &serialNumber );
102 void OpenByDescription(
const std::string &description );
114 void SetLatencyTimer (
unsigned char latency_ms);
117 void SetTimeouts(
unsigned long dwReadTimeout_ms,
unsigned long dwWriteTimeout_ms);
128 return Read(Buffer,Count);
135 return Write(Buffer,Count);
142 virtual size_t ReadBufferImmediate(
void *Buffer,
size_t Count);
148 size_t Read(
void *Buffer,
size_t Count);
155 size_t Write(
const void *Buffer,
size_t Count);
159 uint64_t Seek(
int64_t Offset, CStream::TSeekOrigin Origin = sFromBeginning);
170 void ftdi_read(
void *lpvBuffer,
unsigned long dwBuffSize,
unsigned long *lpdwBytesRead);
171 void ftdi_write(
const void *lpvBuffer,
unsigned long dwBuffSize,
unsigned long *lpdwBytes);
173 #if defined(MRPT_OS_WINDOWS) 175 void checkErrorAndRaise(
int errorCode);
177 void ftdi_open(
void* pvDevice);
178 void ftdi_openEx(
void* pArg1,
unsigned long dwFlags);
179 void ftdi_listDevices(
void *pArg1,
void *pArg2,
unsigned long dwFlags);
180 void ftdi_getQueueStatus(
unsigned long *lpdwAmountInRxQueue);
183 unsigned long m_ftHandle;
192 typedef FT_STATUS (__stdcall *PtrToOpen)(
void*,
unsigned long *);
195 typedef FT_STATUS (__stdcall *PtrToOpenEx)(
void*,
unsigned long,
unsigned long *);
196 PtrToOpenEx m_pOpenEx;
198 typedef FT_STATUS (__stdcall *PtrToListDevices)(
void*,
void*,
unsigned long);
199 PtrToListDevices m_pListDevices;
201 typedef FT_STATUS (__stdcall *PtrToClose)(
unsigned long );
204 typedef FT_STATUS (__stdcall *PtrToRead)(
unsigned long ,
void *,
unsigned long,
unsigned long *);
207 typedef FT_STATUS (__stdcall *PtrToWrite)(
unsigned long ,
const void *,
unsigned long,
unsigned long *);
210 typedef FT_STATUS (__stdcall *PtrToResetDevice)(
unsigned long );
211 PtrToResetDevice m_pResetDevice;
213 typedef FT_STATUS (__stdcall *PtrToPurge)(
unsigned long ,
unsigned long);
216 typedef FT_STATUS (__stdcall *PtrToSetTimeouts)(
unsigned long ,
unsigned long,
unsigned long);
217 PtrToSetTimeouts m_pSetTimeouts;
219 typedef FT_STATUS (__stdcall *PtrToGetQueueStatus)(
unsigned long ,
unsigned long *);
220 PtrToGetQueueStatus m_pGetQueueStatus;
222 typedef FT_STATUS (__stdcall *PtrToSetLatencyTimer )(
unsigned long ,
unsigned char);
223 PtrToSetLatencyTimer m_pSetLatencyTimer;
230 void recursive_fill_list_devices(
void *usb_device_structure ,
TFTDIDeviceList &outList );
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 ...
unsigned __int16 uint16_t
std::ostream HWDRIVERS_IMPEXP & operator<<(std::ostream &o, const TFTDIDevice &d)
Print out all the information of a FTDI device in textual form.
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
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...
std::string ftdi_description
GLsizei const GLchar ** string
unsigned __int64 uint64_t
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::string ftdi_manufacturer
std::deque< TFTDIDevice > TFTDIDeviceList
Used in CInterfaceFTDI::ListAllDevices.
A list of FTDI devices and their descriptors.
A definition of a CStream actually representing a USB connection to a FTDI chip.
mrpt::utils::circular_buffer< uint8_t > m_readBuffer
Used in Read.