Difference between revisions of "SimpleMotion V2 API documentation"

From Granite Devices Knowledge Wiki
Jump to: navigation, search
[checked revision][checked revision]
Line 7: Line 7:
 
;simplemotion.lib or smv.lib
 
;simplemotion.lib or smv.lib
 
:A library file needed by some Microsoft C/C++ development tools to allow usage of DLL file. Most of other tools don't need these.
 
:A library file needed by some Microsoft C/C++ development tools to allow usage of DLL file. Most of other tools don't need these.
 
+
==Types==
 +
SMV2 library uses custom integer types in order to have explicitly defined bit lengths. All types translate to standard C-types.
 +
<syntaxhighlight lang="c">
 +
typedef long smbus;
 +
typedef unsigned long smuint32;
 +
typedef unsigned short smuint16;
 +
typedef unsigned char smuint8;
 +
typedef long smint32;
 +
typedef short smint16;
 +
typedef char smint8;
 +
typedef char smbool;
 +
#define smtrue 1
 +
#define smfalse 0
 +
typedef int SM_STATUS;
 +
typedef smuint8 smaddr;
 +
</syntaxhighlight>
 
==Functions==
 
==Functions==
{{APIdoc|void main()|desc dasfdas fdsa fdasf dasfas|getversion()}}
+
{{APIdoc|smuint32 smGetVersion()|Return SM lib version number in hexadecimal format.
[[category:SimpleMotion]]
+
Ie V 2.5.1 would be 0x020501 and 1.2.33 0x010233}}

Revision as of 14:29, 26 March 2014

This page lists files and the API calls of SimpleMotion V2 C-library.

Files

simplemotion.h
The header file that declares API functions and constants used in SMV2 programs. Include this file in the C-file where SMV2 is used.
simplemotion.dll or smv.dll
A Win32 dynamic library. Place this file in application .exe folder if program is linked against the DLL. If project is being compiled with GNU GCC, then all library .c files may be added in the project to compile library statically in the program thus eliminate the need of .dll.
simplemotion.lib or smv.lib
A library file needed by some Microsoft C/C++ development tools to allow usage of DLL file. Most of other tools don't need these.

Types

SMV2 library uses custom integer types in order to have explicitly defined bit lengths. All types translate to standard C-types.

typedef long smbus;
typedef unsigned long smuint32;
typedef unsigned short smuint16;
typedef unsigned char smuint8;
typedef long smint32;
typedef short smint16;
typedef char smint8;
typedef char smbool;
#define smtrue 1
#define smfalse 0
typedef int SM_STATUS;
typedef smuint8 smaddr;

Functions

smuint32 smGetVersion() Return SM lib version number in hexadecimal format.

Ie V 2.5.1 would be 0x020501 and 1.2.33 0x010233{{{3}}} ====Return SM lib version number in hexadecimal format. Ie V 2.5.1 would be 0x020501 and 1.2.33 0x010233====