Tscope5
parport.c File Reference

Go to the source code of this file.

Functions

Response registration

Parallel port boxes can be used as response devices.

See timer.c for more information about response registration.

int ts5_define_parport_key (int device, int key)
double ts5_set_parport_button_debounce_time (int device, double button_debounce_time)
double ts5_get_parport_button_debounce_time (int device)
Trigger input/output

The parallel ports can be used as trigger input/output devices.

See timer.c for more information about trigger input/output.

void ts5_define_parport_trigger_input (int device)
void ts5_simulate_parport_trigger_input (int device, unsigned char value, double interval)
double ts5_set_parport_trigger_debounce_time (int device, double trigger_debounce_time)
double ts5_get_parport_trigger_debounce_time (int device)
void ts5_send_parport_trigger (int device, unsigned char value)
double ts5_set_parport_trigger_output_time (int device, double trigger_output_time)
double ts5_get_parport_trigger_output_time (int device)

Detailed Description

Definition in file parport.c.


Function Documentation

int ts5_define_parport_key ( int  device,
int  key 
)

Define a parallel port key as a response key.

Parameters:
deviceNumber of the parallel port (devices are numbered from 1).
keyNumber of the key (keys are counted from 1).
Returns:
The reponse number associated with the key.

Give a positive number for the key if you want to monitor key press events, a negative number if you want to monitor key release events.

Definition at line 46 of file parport.c.

double ts5_set_parport_button_debounce_time ( int  device,
double  button_debounce_time 
)

Set the button debounce time of a parallel port response box.

Parameters:
deviceNumber of the parallel port
button_debounce_timeDebounce time in seconds
Returns:
The previous setting

The debounce time is the minimum amount of time between two state changes of the buttons of the box before Tscope5 really counts it as a state change. On some button boxes it is necessary to set this value because the press or release of a button causes a ripple in the electrical current sent to the parallel port (instead of a single state change between on and off).

The debounce time is the amount of time between the press and the release of a button (or vice versa). So the minimum amount of time between two presses (or two releases) will be twice the debounce time set here.

The default debounce time is set to 0.0 (because the button boxes at our department have an internal debouncing circuit).

Definition at line 131 of file parport.c.

double ts5_get_parport_button_debounce_time ( int  device)

Get the button debounce time of a parallel port response box.

Parameters:
deviceNumber of the parallel port
Returns:
The debounce time

Definition at line 163 of file parport.c.

void ts5_define_parport_trigger_input ( int  device)

Define a parallel port as a trigger input device.

Parameters:
deviceNumber of the parallel port (devices are numbered from 1).

Definition at line 195 of file parport.c.

void ts5_simulate_parport_trigger_input ( int  device,
unsigned char  value,
double  interval 
)

Turn on parallel port input simulation.

Parameters:
deviceNumber of the parallel port (devices are numbered from 1).
valueInput value that has to be simulated (0-255, 0 turns the simulation off).
intervalInterval in seconds between two triggers.

Definition at line 216 of file parport.c.

double ts5_set_parport_trigger_debounce_time ( int  device,
double  trigger_debounce_time 
)

Set the trigger debounce time of a parallel port.

Parameters:
deviceNumber of the parallel port
trigger_debounce_timeDebounce time in seconds
Returns:
The previous setting

Definition at line 239 of file parport.c.

double ts5_get_parport_trigger_debounce_time ( int  device)

Get the trigger debounce time of a parallel port.

Parameters:
deviceNumber of the parallel port
Returns:
The debounce time

Definition at line 271 of file parport.c.

void ts5_send_parport_trigger ( int  device,
unsigned char  value 
)

Send a trigger trough a parallel port.

Parameters:
deviceNumber of the parallel port (devices are numbered from 1).
valueThe trigger value that has to be sent (0-255).

Definition at line 291 of file parport.c.

double ts5_set_parport_trigger_output_time ( int  device,
double  trigger_output_time 
)

Set the trigger output time of a parallel port.

Parameters:
deviceNumber of the parallel port
trigger_output_timeOutput time in seconds
Returns:
The previous setting

The default output time is 0.002 seconds.

Definition at line 332 of file parport.c.

double ts5_get_parport_trigger_output_time ( int  device)

Get the trigger output time of a parallel port.

Parameters:
deviceNumber of the parallel port
Returns:
The output time

Definition at line 364 of file parport.c.