diff options
| author | Tero Kontkanen <tero.k@granitedevices.com> | 2017-08-23 14:44:10 +0300 |
|---|---|---|
| committer | Tero Kontkanen <tero.k@granitedevices.com> | 2017-08-23 14:44:10 +0300 |
| commit | 98a89371108bbcdedb201caf7be8b82a323e60cc (patch) | |
| tree | 915a5596c632256ab77d5dc42236644307ea3b66 /drivers/ftdi_d2xx/sm_d2xx.h | |
| parent | 5d21340928cd46b3cb97cae0b9c707a71ef9ced0 (diff) | |
| parent | 4176d9358a526ff207bb5f4d127f4143a632d748 (diff) | |
| download | SimpleMotionV2-98a89371108bbcdedb201caf7be8b82a323e60cc.tar.gz SimpleMotionV2-98a89371108bbcdedb201caf7be8b82a323e60cc.zip | |
Merge branch 'feature/port_driver_ftdi_d2xx' into develop
Diffstat (limited to 'drivers/ftdi_d2xx/sm_d2xx.h')
| -rw-r--r-- | drivers/ftdi_d2xx/sm_d2xx.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/ftdi_d2xx/sm_d2xx.h b/drivers/ftdi_d2xx/sm_d2xx.h new file mode 100644 index 0000000..289ae8a --- /dev/null +++ b/drivers/ftdi_d2xx/sm_d2xx.h @@ -0,0 +1,40 @@ +/* + * ftdi_d2xx.h + * + * Header for FTDI D2XX serial port access library + * + * Created on: 19.8.2017 + * Author: Tero Kontkanen + */ + + +#ifndef SM_D2XX_H +#define SM_D2XX_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "simplemotion.h" + +//max number of simultaneously connected FTDI devices +#define MAX_OPEN_PORTS 32 + +//return port handle or -1 if fails +smint32 d2xxPortOpen(const char *port_device_name, smint32 baudrate_bps); +smint32 d2xxPortRead(smint32 serialport_handle, unsigned char *buf, smint32 size); +smint32 d2xxPortWriteByte(smint32 serialport_handle, unsigned char byte); +smint32 d2xxPortWriteBuffer(smint32 serialport_handle, unsigned char *buf, smint32 size); +void d2xxPortClose(smint32 serialport_handle); + +//Return number of bus devices found. details of each device may be consequently fetched by smGetBusDeviceDetails() +smint d2xxGetNumberOfDetectedBuses(); +smbool d2xxGetBusDeviceDetails( smint index, SM_BUS_DEVICE_INFO *info ); + +#ifdef __cplusplus +} +#endif + +#endif + + |
