aboutsummaryrefslogtreecommitdiff
path: root/simplemotion.h
diff options
context:
space:
mode:
authorTero Kontkanen <tero.kontkanen@granitedevices.fi>2017-08-19 17:05:51 +0300
committerTero Kontkanen <tero.kontkanen@granitedevices.fi>2017-08-19 17:34:34 +0300
commit6ef9e8c44e29d270c64c22b73ae00508966b4892 (patch)
treeda4561d6e961d0403689dc175ab288d8e127f134 /simplemotion.h
parentd78fb3d4aac4ed7c28311a69ae86ffb88d03b972 (diff)
downloadSimpleMotionV2-6ef9e8c44e29d270c64c22b73ae00508966b4892.tar.gz
SimpleMotionV2-6ef9e8c44e29d270c64c22b73ae00508966b4892.zip
Add functions to list compatible bus device (ftdi d2xx only)
Diffstat (limited to 'simplemotion.h')
-rw-r--r--simplemotion.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/simplemotion.h b/simplemotion.h
index c189af8..80db602 100644
--- a/simplemotion.h
+++ b/simplemotion.h
@@ -46,10 +46,18 @@ typedef int32_t smint32;
typedef int16_t smint16;
typedef int8_t smint8;
typedef int8_t smbool;
+typedef smint32 smint;
#define smtrue 1
#define smfalse 0
typedef int SM_STATUS;
typedef smuint8 smaddr;
+typedef struct
+{
+ smbool is_simplemotion_device;//smtrue if usable in SM lib
+ char device_name[64];//name that should be fed to smOpenBus
+ char description[128];//such as "SimpleMotion USB"
+} SM_BUS_DEVICE_INFO;
+
//comment out to disable, gives smaller & faster code
#define ENABLE_DEBUG_PRINTS
@@ -147,6 +155,28 @@ LIB SM_STATUS smGetBufferClock( const smbus handle, const smaddr targetaddr, smu
*content are application specific and defined . */
LIB SM_STATUS smFastUpdateCycle( smbus handle, smuint8 nodeAddress, smuint16 write1, smuint16 write2, smuint16 *read1, smuint16 *read2);
+/** Return number of bus devices found. details of each device may be consequently fetched by smGetBusDeviceDetails() */
+LIB smint smGetNumberOfDetectedBuses();
+
+/** Fetch information of detected bus nodes at certain index. Example:
+
+ smint num=smGetNumberOfDetectedBuses();
+ for(int i=0;i<num;i++)
+ {
+ SM_BUS_DEVICE_INFO info;
+ SM_STATUS s=smGetBusDeviceDetails(i,&info);
+ if(s==SM_OK)
+ {
+ ...do something with info...
+ }
+ else
+ {
+ ...report error...
+ }
+ }
+*/
+LIB SM_STATUS smGetBusDeviceDetails( smint index, SM_BUS_DEVICE_INFO *info );
+
#ifdef __cplusplus
}
#endif