Tscope5
parport.c
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // __ ______
4 // / /_______________ ____ ___ / ____/
5 // / __/ ___/ ___/ __ \/ __ \/ _ \ /___ )
6 // / /_(__ ) /__/ /_/ / /_/ / __/ ____/ /
7 // \__/____/\___/\____/ .___/\___/ /_____/
8 // /_/
9 //
10 /// \file parport.c
11 /// Definitions of parallel port functions.
12 /// \example parport01.c
13 /// \example parport02.c
14 /// \example parport03.c
15 ////////////////////////////////////////////////////////////////////////////////
16 
17 
18 #include "../include/tscope5/parport.h"
19 #include "../include/tscope5/timer.h"
20 #include "../include/tscope5/parport_internal.h"
21 #include "../include/tscope5/system_internal.h"
22 
23 #ifdef TS5_WINDOWS
24  #include <windows.h>
25  HINSTANCE hLib;
26  typedef short (_stdcall *inbptr)(short portaddr);
27  typedef short (_stdcall *outbptr)(short portaddr, short value);
28  inbptr inb;
29  outbptr outb;
30 
31 #elif defined TS5_LINUX
32  #include <unistd.h>
33  #include <sys/io.h>
34 
35 #endif
36 
37 
38 ////////////////////////////////////////////////////////////////////////////////
39 /// @name Response registration
40 /// Parallel port boxes can be used as response devices.
41 /// See timer.c for more information about response registration.
42 //@{
43 ////////////////////////////////////////////////////////////////////////////////
44 
45 
46 ////////////////////////////////////////////////////////////////////////////////
47 /// Define a parallel port button as a response button.
48 ///
49 /// \param device Number of the parallel port (devices are numbered from 1).
50 /// \param button Number of the button (buttons are counted from 1).
51 ///
52 /// \return The reponse number associated with the button.
53 ///
54 /// Give a positive number for the button if you want to monitor button press events,
55 /// a negative number if you want to monitor button release events.
56 ////////////////////////////////////////////////////////////////////////////////
57 int ts5_define_parport_button(int device, int button)
58 {
59  ts5_check_parport2("ts5_define_parport_button");
60  ts5_log(TS5_LOGLEVEL_3, "ts5_define_parport_button(%d,%d)\n", device, button);
61 
62  if (device<1 || device>_ts5_status.timer.num_parports) {
63  ts5_fatal("%s: %s %d %s %d\n", "ts5_define_parport_button",
64  "device argument is", device,
65  "number of parallel ports is",
66  _ts5_status.timer.num_parports);
67  }
68 
69  if (_ts5_status.timer.parport[device-1].is_trigger_input_device) {
70  ts5_fatal("%s: %s %d %s\n", "ts5_define_parport_button",
71  "parallel port", device,
72  "is already defined as a trigger input device");
73  }
74 
75  if (_ts5_status.timer.parport[device-1].is_trigger_output_device) {
76  ts5_fatal("%s: %s %d %s\n", "ts5_define_parport_button",
77  "parallel port", device,
78  "is already defined as a trigger output device");
79  }
80 
81  if (button==0) {
82  ts5_fatal("%s: %s\n", "ts5_define_parport_button",
83  "button argument is 0, response buttons are numbered from 1");
84  }
85 
86  if (abs(button)>_ts5_status.timer.parport[device-1].num_buttons) {
87  ts5_fatal("%s: %s %d, %s %d is %d\n", "ts5_define_parport_button",
88  "button argument is", button,
89  "number of parport buttons for device", device,
90  _ts5_status.timer.parport[device-1].num_buttons);
91  }
92 
93  if (button>0 && _ts5_status.timer.parport[device-1]
94  .button_press_defined[button-1]!=0) {
95  ts5_fatal("%s: %s %d %s\n", "ts5_define_parport_button",
96  "button press", button, "is already defined");
97  }
98 
99  if (button<0 && _ts5_status.timer.parport[device-1]
100  .button_release_defined[-button-1]!=0) {
101  ts5_fatal("%s: %s %d %s\n", "ts5_define_parport_button",
102  "button release", button, "is already defined");
103  }
104 
105  _ts5_status.timer.parport_is_response_device = 1;
106  _ts5_status.timer.num_defined_buttons++;
107  _ts5_status.timer.num_active_buttons++;
108  _ts5_status.timer.parport[device-1].num_defined_buttons++;
109  _ts5_status.timer.parport[device-1].num_active_buttons++;
110 
111  if (button>0) {
112  _ts5_status.timer.parport[device-1]
113  .button_press_defined[button-1] =
114  _ts5_status.timer.num_defined_buttons;
115 
116  _ts5_status.timer.parport[device-1]
117  .button_press_active[button-1] =
118  _ts5_status.timer.num_defined_buttons;
119  }
120  else {
121  _ts5_status.timer.parport[device-1]
122  .button_release_defined[-button-1] =
123  _ts5_status.timer.num_defined_buttons;
124 
125  _ts5_status.timer.parport[device-1]
126  .button_release_active[-button-1] =
127  _ts5_status.timer.num_defined_buttons;
128  }
129 
130  return _ts5_status.timer.num_defined_buttons;
131 }
132 
133 
134 ////////////////////////////////////////////////////////////////////////////////
135 /// Get the number of buttons available on a parallel port.
136 ///
137 /// \param device Number of the parallel port (devices are numbered from 1).
138 ///
139 /// \return The number of buttons on the parallel port.
140 ////////////////////////////////////////////////////////////////////////////////
142 {
143  ts5_check_parport2("ts5_get_num_parport_buttons");
144  ts5_log(TS5_LOGLEVEL_4, "ts5_get_num_parport_buttons(%d)\n", device);
145 
146  return _ts5_status.timer.parport[device-1].num_buttons;
147 }
148 
149 
150 ////////////////////////////////////////////////////////////////////////////////
151 /// Set the button debounce time of a parallel port response box.
152 ///
153 /// \param device Number of the parallel port
154 /// \param button_debounce_time Debounce time in seconds
155 ///
156 /// \return The previous setting
157 ///
158 ///
159 /// The debounce time is the minimum amount of time between two state changes of
160 /// the buttons of the box before Tscope5 really counts it as a state change.
161 /// On some button boxes it is necessary to set this value because
162 /// the press or release of a button causes a ripple in the electrical current
163 /// sent to the parallel port
164 /// (instead of a single state change between on and off).
165 ///
166 /// The debounce time is the amount of time between the press and the release
167 /// of a button (or vice versa).
168 /// So the minimum amount of time between two presses (or two releases)
169 /// will be twice the debounce time set here.
170 ///
171 /// The default debounce time is set to 0.0
172 /// (The button boxes at our department have an internal debouncing circuit).
173 ////////////////////////////////////////////////////////////////////////////////
175  double button_debounce_time)
176 {
177  ts5_check_parport2("ts5_set_parport_button_debounce_time");
178  ts5_log(TS5_LOGLEVEL_4, "ts5_set_parport_button_debounce_time(%d,%f)\n",
179  device, button_debounce_time);
180 
181  if (device<1 || device>_ts5_status.timer.num_parports) {
182  ts5_fatal("%s: %s %d %s %d\n", "ts5_set_parport_button_debounce_time",
183  "device argument is", device,
184  "number of parallel ports is",
185  _ts5_status.timer.num_parports);
186  }
187 
188  if (button_debounce_time < 0.0) {
189  ts5_fatal("%s: %s (is %f)\n", "ts5_set_parport_button_debounce_time",
190  "debounce time should be positive", button_debounce_time);
191  }
192 
193  double retval =
194  _ts5_status.timer.parport[device-1].button_debounce_time;
195 
196  _ts5_status.timer.parport[device-1].button_debounce_time =
197  button_debounce_time;
198 
199  ts5_log(TS5_LOGLEVEL_4, "%s: %s %d to %f (was %f)\n",
200  "ts5_set_parport_button_debounce_time",
201  "set debounce time of device",
202  device,
203  _ts5_status.timer.parport[device-1].button_debounce_time,
204  retval);
205 
206  return retval;
207 }
208 
209 
210 ////////////////////////////////////////////////////////////////////////////////
211 /// Get the button debounce time of a parallel port response box.
212 ///
213 /// \param device Number of the parallel port
214 ///
215 /// \return The debounce time
216 ////////////////////////////////////////////////////////////////////////////////
218 {
219  ts5_check_parport2("ts5_get_parport_button_debounce_time");
220  ts5_log(TS5_LOGLEVEL_4, "ts5_get_parport_button_debounce_time(%d)\n",
221  device);
222 
223  if (device<1 || device>_ts5_status.timer.num_parports) {
224  ts5_fatal("%s: %s %d %s %d\n", "ts5_get_parport_button_debounce_time",
225  "device argument is", device,
226  "number of parallel ports is",
227  _ts5_status.timer.num_parports);
228 
229  }
230 
231  return _ts5_status.timer.parport[device-1].button_debounce_time;
232 }
233 
234 
235 ////////////////////////////////////////////////////////////////////////////////
236 //@}
237 ////////////////////////////////////////////////////////////////////////////////
238 
239 
240 ////////////////////////////////////////////////////////////////////////////////
241 /// @name Trigger input/output
242 /// The parallel ports can be used as trigger input/output devices.
243 /// See timer.c for more information about trigger input/output.
244 //@{
245 ////////////////////////////////////////////////////////////////////////////////
246 
247 
248 ////////////////////////////////////////////////////////////////////////////////
249 /// Define a parallel port as a trigger input device
250 ///
251 /// \param device Number of the parallel port (devices are numbered from 1).
252 ////////////////////////////////////////////////////////////////////////////////
254 {
255  ts5_check_parport2("ts5_define_parport_trigger_input");
256  ts5_log(TS5_LOGLEVEL_3, "ts5_define_parport_trigger_input(%d)\n", device);
257 
258  if (device<1 || device>_ts5_status.timer.num_parports) {
259  ts5_fatal("%s: %s %d %s %d\n", "ts5_define_parport_trigger_input",
260  "device argument is", device,
261  "number of parallel ports is",
262  _ts5_status.timer.num_parports);
263  }
264 
265  ts5_set_parport_trigger_input("ts5_define_parport_trigger_input", device);
266 }
267 
268 
269 ////////////////////////////////////////////////////////////////////////////////
270 /// Turn on parallel port input simulation.
271 ///
272 /// \param device Number of the parallel port (devices are numbered from 1).
273 /// \param value Input value that has to be simulated
274 /// (0-255, 0 turns the simulation off).
275 /// \param interval Interval in seconds between two triggers.
276 ////////////////////////////////////////////////////////////////////////////////
277 void ts5_simulate_parport_trigger_input(int device, unsigned char value,
278  double interval)
279 {
280  ts5_check_parport2("ts5_simulate_parport_trigger_input");
281  ts5_log(TS5_LOGLEVEL_3, "ts5_simulate_parport_trigger_input(%d,%d,%f)\n",
282  device, value, interval);
283 
284  if (device<1 || device>_ts5_status.timer.num_parports) {
285  ts5_fatal("%s: %s %d %s %d\n", "ts5_simulate_parport_trigger_input",
286  "device argument is", device,
287  "number of parallel ports is",
288  _ts5_status.timer.num_parports);
289  }
290 
291  _ts5_status.timer.parport[device-1].simulate_trigger_input =
292  value;
293 
294  _ts5_status.timer.parport[device-1].trigger_simulation_interval =
295  interval;
296 }
297 
298 
299 ////////////////////////////////////////////////////////////////////////////////
300 /// Set the trigger debounce time of a parallel port.
301 ///
302 /// \param device Number of the parallel port
303 /// \param trigger_debounce_time Debounce time in seconds
304 ///
305 /// \return The previous setting
306 ///
307 /// The default debounce time is set to 0.0
308 ////////////////////////////////////////////////////////////////////////////////
310  double trigger_debounce_time)
311 {
312  ts5_check_parport2("ts5_set_parport_trigger_debounce_time");
313  ts5_log(TS5_LOGLEVEL_4, "ts5_set_parport_trigger_debounce_time(%d,%f)\n",
314  device, trigger_debounce_time);
315 
316  if (device<1 || device>_ts5_status.timer.num_parports) {
317  ts5_fatal("%s: %s %d %s %d\n", "ts5_set_parport_trigger_debounce_time",
318  "device argument is", device,
319  "number of parallel ports is",
320  _ts5_status.timer.num_parports);
321  }
322 
323  if (trigger_debounce_time < 0.0) {
324  ts5_fatal("%s: %s (is %f)\n", "ts5_set_parport_trigger_debounce_time",
325  "debounce time should be positive", trigger_debounce_time);
326  }
327 
328  double retval = _ts5_status.timer.parport[device-1]
329  .trigger_debounce_time;
330 
331  _ts5_status.timer.parport[device-1].trigger_debounce_time =
332  trigger_debounce_time;
333 
334  ts5_log(TS5_LOGLEVEL_4, "%s: %s %d to %f (was %f)\n",
335  "ts5_set_parport_trigger_debounce_time",
336  "set debounce time of device",
337  device, _ts5_status.timer.parport[device-1]
338  .trigger_debounce_time, retval);
339 
340  return retval;
341 }
342 
343 
344 ////////////////////////////////////////////////////////////////////////////////
345 /// Get the trigger debounce time of a parallel port.
346 ///
347 /// \param device Number of the parallel port
348 ///
349 /// \return The debounce time
350 ////////////////////////////////////////////////////////////////////////////////
352 {
353  ts5_check_parport2("ts5_get_parport_trigger_debounce_time");
354  ts5_log(TS5_LOGLEVEL_4, "ts5_get_parport_trigger_debounce_time(%d)\n",
355  device);
356 
357  if (device<1 || device>_ts5_status.timer.num_parports) {
358  ts5_fatal("%s: %s %d %s %d\n", "ts5_get_parport_trigger_debounce_time",
359  "device argument is", device,
360  "number of parallel ports is",
361  _ts5_status.timer.num_parports);
362  }
363 
364  return _ts5_status.timer.parport[device-1].trigger_debounce_time;
365 }
366 
367 
368 ////////////////////////////////////////////////////////////////////////////////
369 /// Send a trigger trough a parallel port
370 ///
371 /// \param device Number of the parallel port (devices are numbered from 1).
372 /// \param value The trigger value that has to be sent (0-255).
373 ////////////////////////////////////////////////////////////////////////////////
374 void ts5_send_parport_trigger(int device, unsigned char value)
375 {
376  ts5_check_parport2("ts5_send_parport_trigger");
377  ts5_log(TS5_LOGLEVEL_3, "ts5_send_parport_trigger(%d,%d)\n", device, value);
378 
379  if (device<1 || device>_ts5_status.timer.num_parports) {
380  ts5_fatal("%s: %s %d %s %d\n", "ts5_send_parport_trigger",
381  "device argument is", device,
382  "number of parallel ports is",
383  _ts5_status.timer.num_parports);
384  }
385 
386  ts5_set_parport_trigger_output("ts5_send_parport_trigger", device);
387 
388  #ifdef TS5_WINDOWS
389  outb(_ts5_status.timer.parport_data_register[device-1], value);
390 
391  ts5_wait(_ts5_status.timer.parport[device-1]
392  .trigger_output_time);
393 
394  outb(_ts5_status.timer.parport_data_register[device-1], 0);
395 
396  #elif defined TS5_LINUX
397  outb(value, _ts5_status.timer.parport_data_register[device-1]);
398 
399  ts5_wait(_ts5_status.timer.parport[device-1]
400  .trigger_output_time);
401 
402  outb(0, _ts5_status.timer.parport_data_register[device-1]);
403 
404  #endif
405 }
406 
407 
408 ////////////////////////////////////////////////////////////////////////////////
409 /// Set the trigger output time of a parallel port.
410 ///
411 /// \param device Number of the parallel port
412 /// \param trigger_output_time Output time in seconds
413 ///
414 /// \return The previous setting
415 ///
416 /// The default output time is 0.002 seconds.
417 ////////////////////////////////////////////////////////////////////////////////
419  double trigger_output_time)
420 {
421  ts5_check_parport2("ts5_set_parport_trigger_output_time");
422  ts5_log(TS5_LOGLEVEL_4, "ts5_set_parport_trigger_output_time(%d,%f)\n",
423  device, trigger_output_time);
424 
425  if (device<1 || device>_ts5_status.timer.num_parports) {
426  ts5_fatal("%s: %s %d %s %d\n", "ts5_set_parport_trigger_output_time",
427  "device argument is", device,
428  "number of parallel ports is",
429  _ts5_status.timer.num_parports);
430  }
431 
432  if (trigger_output_time < 0.0) {
433  ts5_fatal("%s: %s (is %f)\n", "ts5_set_parport_trigger_output_time",
434  "output time should be positive", trigger_output_time);
435  }
436 
437  double retval = _ts5_status.timer.parport[device-1]
438  .trigger_output_time;
439 
440  _ts5_status.timer.parport[device-1].trigger_output_time =
441  trigger_output_time;
442 
443  ts5_log(TS5_LOGLEVEL_4, "%s: %s %d to %f (was %f)\n",
444  "ts5_set_parport_trigger_output_time",
445  "set output time of device", device,
446  _ts5_status.timer.parport[device-1].trigger_output_time,
447  retval);
448 
449  return retval;
450 }
451 
452 
453 ////////////////////////////////////////////////////////////////////////////////
454 /// Get the trigger output time of a parallel port.
455 ///
456 /// \param device Number of the parallel port
457 ///
458 /// \return The output time
459 ////////////////////////////////////////////////////////////////////////////////
461 {
462  ts5_check_parport2("ts5_get_parport_trigger_output_time");
463  ts5_log(TS5_LOGLEVEL_4, "ts5_get_parport_trigger_output_time(%d)\n",
464  device);
465 
466  if (device<1 || device>_ts5_status.timer.num_parports) {
467  ts5_fatal("%s: %s %d %s %d\n", "ts5_get_parport_trigger_output_time",
468  "device argument is", device,
469  "number of parallel ports is",
470  _ts5_status.timer.num_parports);
471  }
472 
473  return _ts5_status.timer.parport[device-1].trigger_output_time;
474 }
475 
476 
477 ////////////////////////////////////////////////////////////////////////////////
478 //@}
479 ////////////////////////////////////////////////////////////////////////////////
480 
481 
482 ////////////////////////////////////////////////////////////////////////////////
483 /// @name Port settings
484 /// On older motherboards there were three parallel ports,
485 /// with addresses 0x378, 0x278, 0x3BC.
486 ///
487 /// This is the default setting in Tscope5.
488 ///
489 /// On newer motherboards there are no parallel ports,
490 /// but PCI parallel port cards can be added.
491 ///
492 /// If you have such a card,
493 /// you will need set the number of parallel ports
494 /// and their addresses using the functions below.
495 //@{
496 ////////////////////////////////////////////////////////////////////////////////
497 
498 
499 ////////////////////////////////////////////////////////////////////////////////
500 /// Set the number of parallel ports that are connected to the system.
501 ///
502 /// \param num_parports
503 ///
504 /// \return The previous setting.
505 ////////////////////////////////////////////////////////////////////////////////
506 int ts5_set_num_parports(int num_parports)
507 {
508  ts5_check_parport("ts5_get_num_parports");
509  ts5_log(TS5_LOGLEVEL_4, "ts5_set_num_parports(%d)\n", num_parports);
510 
511  int retval = _ts5_status.timer.num_parports;
512 
513  if (num_parports < 0) {
514  ts5_fatal("ts5_set_num_parports: num_parports should be >= 0\n");
515  }
516 
517  if (num_parports > TS5_PARPORT_MAXPORT) {
518  ts5_fatal("ts5_set_num_parports: num_parports should be < %d\n",
519  TS5_PARPORT_MAXPORT);
520  }
521 
522  _ts5_status.timer.num_parports = num_parports;
523 
524  ts5_log(TS5_LOGLEVEL_4,
525  "ts5_set_num_parports: set num_parports to %d (was %d)\n",
526  _ts5_status.timer.num_parports, retval);
527 
528  return retval;
529 }
530 
531 
532 ////////////////////////////////////////////////////////////////////////////////
533 /// Get the number of parallel ports that are connected to the system.
534 ///
535 /// \return The number of parallel ports that are connected to the system.
536 ////////////////////////////////////////////////////////////////////////////////
538 {
539  ts5_check_parport2("ts5_get_num_parports");
540  ts5_log(TS5_LOGLEVEL_4, "ts5_get_num_parports()\n");
541 
542  return _ts5_status.timer.num_parports;
543 }
544 
545 
546 ////////////////////////////////////////////////////////////////////////////////
547 /// Set the address of a parallel port.
548 ///
549 /// \param device Number of the parallel port
550 /// \param address The address of the parallel port
551 ///
552 /// \return The previous address of the parallel port.
553 ////////////////////////////////////////////////////////////////////////////////
554 short ts5_set_parport_address(int device, short address)
555 {
556  ts5_check_parport("ts5_set_parport_address");
557  ts5_log(TS5_LOGLEVEL_4, "ts5_set_parport_address(%d, %d)\n", device, address);
558 
559  if (device < 1) {
560  ts5_fatal("ts5_set_parport_address: device should be >= 1\n");
561  }
562 
563  if (device > _ts5_status.timer.num_parports) {
564  ts5_fatal("ts5_set_parport_address: device should be <= %d\n",
565  _ts5_status.timer.num_parports);
566  }
567 
568  short retval = _ts5_status.timer.parport_base_address[device-1];
569 
570  _ts5_status.timer.parport_base_address[device-1] = address;
571 
572  _ts5_status.timer.parport_data_register[device-1] =
573  _ts5_status.timer.parport_base_address[device-1];
574 
575  _ts5_status.timer.parport_status_register[device-1] =
576  _ts5_status.timer.parport_base_address[device-1]+1;
577 
578  _ts5_status.timer.parport_control_register[device-1] =
579  _ts5_status.timer.parport_base_address[device-1]+2;
580 
581  return retval;
582 }
583 
584 
585 ////////////////////////////////////////////////////////////////////////////////
586 /// Get the address of a parallel port.
587 ///
588 /// \param device Number of the parallel port
589 ///
590 /// \return The address of the parallel port.
591 ////////////////////////////////////////////////////////////////////////////////
592 short ts5_get_parport_address(int device)
593 {
594  ts5_check_parport2("ts5_get_parport_address");
595  ts5_log(TS5_LOGLEVEL_4, "ts5_get_parport_address(%d)\n", device);
596 
597  if (device < 1) {
598  ts5_fatal("ts5_get_parport_address: device should be >= 1\n");
599  }
600 
601  if (device > _ts5_status.timer.num_parports) {
602  ts5_fatal("ts5_get_parport_address: device should be <= %d\n",
603  _ts5_status.timer.num_parports);
604  }
605 
606  return _ts5_status.timer.parport_base_address[device-1];
607 }
608 
609 
610 ////////////////////////////////////////////////////////////////////////////////
611 //@}
612 ////////////////////////////////////////////////////////////////////////////////
613 
double ts5_get_parport_trigger_output_time(int device)
Get the trigger output time of a parallel port.
Definition: parport.c:460
int ts5_set_num_parports(int num_parports)
Set the number of parallel ports that are connected to the system.
Definition: parport.c:506
void ts5_check_parport2(char *calling_function)
Do some checks at the start of each parport function.
void ts5_set_parport_trigger_output(char *calling_function, int device)
Set the DATA register of the parallel port to output mode.
void ts5_wait(double waittime)
Wait for a number of seconds.
Definition: timer.c:220
void ts5_send_parport_trigger(int device, unsigned char value)
Send a trigger trough a parallel port.
Definition: parport.c:374
short ts5_get_parport_address(int device)
Get the address of a parallel port.
Definition: parport.c:592
double ts5_set_parport_trigger_debounce_time(int device, double trigger_debounce_time)
Set the trigger debounce time of a parallel port.
Definition: parport.c:309
void ts5_check_parport(char *calling_function)
Do some checks at the start of each parport function.
double ts5_get_parport_trigger_debounce_time(int device)
Get the trigger debounce time of a parallel port.
Definition: parport.c:351
void ts5_define_parport_trigger_input(int device)
Define a parallel port as a trigger input device.
Definition: parport.c:253
int ts5_get_num_parports()
Get the number of parallel ports that are connected to the system.
Definition: parport.c:537
double ts5_get_parport_button_debounce_time(int device)
Get the button debounce time of a parallel port response box.
Definition: parport.c:217
void ts5_log(const unsigned int level, const char *format,...)
Send info to a logging window.
Definition: system.c:45
int ts5_get_num_parport_buttons(int device)
Get the number of buttons available on a parallel port.
Definition: parport.c:141
double ts5_set_parport_button_debounce_time(int device, double button_debounce_time)
Set the button debounce time of a parallel port response box.
Definition: parport.c:174
void ts5_set_parport_trigger_input(char *calling_function, int device)
Set the DATA register of the parallel port to input mode.
void ts5_simulate_parport_trigger_input(int device, unsigned char value, double interval)
Turn on parallel port input simulation.
Definition: parport.c:277
int ts5_define_parport_button(int device, int button)
Define a parallel port button as a response button.
Definition: parport.c:57
short ts5_set_parport_address(int device, short address)
Set the address of a parallel port.
Definition: parport.c:554
void ts5_fatal(const char *format,...)
Exit safely with an error message.
Definition: system.c:533
double ts5_set_parport_trigger_output_time(int device, double trigger_output_time)
Set the trigger output time of a parallel port.
Definition: parport.c:418