Tscope5
serialport.c File Reference

Go to the source code of this file.

Functions

Trigger input/output

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

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

int ts5_define_serialport_trigger_input (char *portname)
void ts5_simulate_serialport_trigger_input (int device, unsigned char value, double interval)
int ts5_define_serialport_trigger_output (char *portname)
void ts5_send_serialport_trigger (int device, unsigned char value)
TS5_SERIALPORT * ts5_get_serialport (int device)

Detailed Description

Definition in file serialport.c.


Function Documentation

int ts5_define_serialport_trigger_input ( char *  portname)

Define a serial port as a trigger input device.

Parameters:
portnameName of the serial port (COM1, ... on Windows, /etc/tty... on Posix systems).
Returns:
The device number of the port (the first serial port opened by Tscope5 gets number 1, etc.).

Definition at line 28 of file serialport.c.

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

Turn on serial port input simulation.

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

Definition at line 47 of file serialport.c.

int ts5_define_serialport_trigger_output ( char *  portname)

Define a serial port as a trigger output device.

Parameters:
portnameName of the serial port (COM1, ... on Windows, /etc/tty... on Posix systems).
Returns:
The device number of the port (the first serial port opened by Tscope5 gets number 1, etc.).

Definition at line 69 of file serialport.c.

void ts5_send_serialport_trigger ( int  device,
unsigned char  value 
)

Send a trigger trough a serial port.

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

Definition at line 87 of file serialport.c.

TS5_SERIALPORT* ts5_get_serialport ( int  device)

Get a pointer to a serial port.

Parameters:
deviceNumber of the serial port (devices are numbered from 1).
Returns:
pointer to the serial port.

Definition at line 137 of file serialport.c.