blob: 289ae8ac990e92d780369c9ea151dbdb9a13569c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
|