PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
SEIDrv.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*********** SEI functions ***********/
4 
5 // function: Initializes the SEI bus
6 // comm: CommPort of SEI devices
7 // -If comm is zero, INITIALIZESEI will search all available comm ports
8 // mode:
9 // -Modes may be combined together
10 // -If SKIPDEVICEINFO is set, AUTOASSIGN is ignored
11 // -If SKIPDEVICESEARCH is set, AUTOASSIGN is ignored
12 // devicesExpected:
13 // -The number of devices found that will cause the scan process to quit
14 // -Up to 15 devices supported on the SEI bus
15 // -USDigital's default is to only search for 1 device on the SEI bus
16 // return: 0 if no error
17 // This function can be called multiple times,
18 // but only the first call will have an effect.
19 // CloseSEI must be called the same number of times.
20 long InitializeSEI(long comm, long mode, int devicesExpected = 1);
21 
22 const long AUTOASSIGN = 0x0001; // autoassign addresses if they conflict
23 const long SKIPDEVICESEARCH = 0x0002; // don't check if devices exist on chosen comm port
24 const long SKIPDEVICEINFO = 0x0004; // don't retrieve devices info
25 const long NORESET = 0x0008; // don't generate reset to SEI devices
26 const long NOCHECKSUM = 0x0010; // don't check checksum of commands
27 const long REINITIALIZE = 0x0020; // reinitialize if already initialized
28 const long NOA2ERRORCLEAR = 0x0040; // don't clear A2 errors on powerup
29 
30 // function: returns status of initialization
31 bool IsInitialized();
32 
33 // function: returns number of devices found on the SEI bus
34 // return: number of devices 0-15, any number other than 0-15 is an error code
35 long GetNumberOfDevices();
36 
37 // function: Gets some information about a device
38 // devnum: 0 To GetNumberOfDevices - 1
39 // serialnum: devnum's serial#
40 // addr: devnum's address
41 // model: a pointer to allocated char* buffer, not filled with data if nullptr
42 // firmwareVersion: a pointer to allocated char* buffer, not filled with data if nullptr
43 // return: 0 if no error
44 long GetDeviceInfo(long devnum, long& serialnum, long& addr, char* model, char* firmwareVersion);
45 
46 // function: closes the SEI bus
47 void CloseSEI();
48 
49 
50 /*********** A2 functions ***********/
51 
52 // function: if the A2 is in strobe mode, it will take a position reading after receiving this command.
53 // return: 0 if no error
54 long A2SetStrobe();
55 
56 // function: makes all A2's on the SEI bus go to sleep, the current consumption then drops below 0.6 mA / device
57 // return: 0 if no error
58 long A2SetSleep();
59 
60 // function: wakes up all A2's on the SEI bus, wait at least 5mSec before sending the next command
61 // return: 0 if no error
62 long A2SetWakeup();
63 
64 // function: Sets the absolute zero to the current position, in single-turn mode the new position is stored in EEPROM
65 // address: SEI address 0-15
66 // return: 0 if no error
67 long A2SetOrigin(long address);
68 
69 // function: Gets the mode of an A2
70 // address: SEI address 0-14
71 // mode: A2's mode, see A2 Communications Protocol Datasheet
72 // return: 0 if no error
73 long A2GetMode(long address, long *mode);
74 
75 // function: Sets the mode of an A2
76 // address: SEI address 0-15
77 // mode: A2's mode, see A2 Communications Protocol Datasheet
78 // return: 0 if no error
79 long A2SetMode(long address, long mode);
80 
81 // function: Gets the resolution of an A2
82 // address: SEI address 0-14
83 // res: A2's resolution
84 // return: 0 if no error
85 long A2GetResolution(long address, long *res);
86 
87 // function: Sets the resolution of an A2
88 // address: SEI address 0-15
89 // res: A2's resolution
90 // return: 0 if no error
91 long A2SetResolution(long address, long res);
92 
93 // function: Gets the position of an A2
94 // address: SEI address 0-14
95 // pos: A2's position
96 // return: 0 if no error
97 long A2GetPosition(long address, long *pos);
98 
99 // function: Sets the position of an A2
100 // address: SEI address 0-15
101 // pos: A2's position
102 // return: 0 if no error
103 long A2SetPosition(long address, long pos);
Phidget_MeshMode mode
Definition: phidget22.h:1332
long A2GetPosition(long address, long *pos)
Definition: SEIDrv.cpp:259
long A2SetSleep()
Definition: SEIDrv.cpp:169
long A2SetOrigin(long address)
Definition: SEIDrv.cpp:179
long A2SetMode(long address, long mode)
Definition: SEIDrv.cpp:212
const long SKIPDEVICEINFO
Definition: SEIDrv.h:24
const long SKIPDEVICESEARCH
Definition: SEIDrv.h:23
const long NOA2ERRORCLEAR
Definition: SEIDrv.h:28
const char * address
Definition: phidget22.h:2552
long GetNumberOfDevices()
Definition: SEIDrv.cpp:112
long A2GetMode(long address, long *mode)
Definition: SEIDrv.cpp:193
long A2SetPosition(long address, long pos)
Definition: SEIDrv.cpp:281
long A2SetResolution(long address, long res)
Definition: SEIDrv.cpp:245
long InitializeSEI(long comm, long mode, int devicesExpected=1)
Definition: SEIDrv.cpp:67
bool IsInitialized()
Definition: SEIDrv.cpp:107
const long AUTOASSIGN
Definition: SEIDrv.h:22
const long REINITIALIZE
Definition: SEIDrv.h:27
const long NOCHECKSUM
Definition: SEIDrv.h:26
long A2GetResolution(long address, long *res)
Definition: SEIDrv.cpp:226
long A2SetStrobe()
Definition: SEIDrv.cpp:158
long GetDeviceInfo(long devnum, long &serialnum, long &addr, char *model, char *firmwareVersion)
Definition: SEIDrv.cpp:117
long A2SetWakeup()
Definition: SEIDrv.cpp:174
const long NORESET
Definition: SEIDrv.h:25
void CloseSEI()
Definition: SEIDrv.cpp:141