Main Page   Modules   File List   Globals  

Platform Specific Routines

Platform-specific functions You must implement these to port the library to a new platform. More...

Functions

int gp3openport (char *port)
 Open the GP3 serial port.

void gp3closeport ()
 Close the GP3 port.

int gp3write (int byte)
 Write a byte to the GP3.

unsigned int gp3read (void)
 Read a byte from the GP3.

int gp3ready (void)
 Optional function reads the CTS input to determine if the GP3 is ready.


Detailed Description

Platform-specific functions You must implement these to port the library to a new platform.


Function Documentation

void gp3closeport  
 

Close the GP3 port.

Definition at line 60 of file gp3cygwin.c.

Referenced by main().

int gp3openport char *    port
 

Open the GP3 serial port.

Parameters:
port  The name of the port (varies by platform, e.g., COM1, /dev/cua0, etc.)
Returns:
-1 for error

Definition at line 36 of file gp3cygwin.c.

References BAUDRATE.

unsigned int gp3read void   
 

Read a byte from the GP3.

This function blocks until a byte is received

Returns:
Character or -1 in case of error

Definition at line 76 of file gp3cygwin.c.

References DEBUG.

Referenced by gp3check(), gp3getpins(), gp3gettris(), gp3input(), gp3readee(), and gp3readword().

int gp3ready void   
 

Optional function reads the CTS input to determine if the GP3 is ready.

None of the functions use this (although the demo program does). Using this function it is possible to avoid calling gp3write when it would cause the program to block.

Returns:
1 if GP3 is ready; 0 otherwise

Definition at line 95 of file gp3cygwin.c.

Referenced by gp3write(), and main().

int gp3write int    byte
 

Write a byte to the GP3.

This function blocks if the GP3 is not ready.

Parameters:
byte  The byte to write
Returns:
1 for success

Definition at line 67 of file gp3cygwin.c.

References DEBUG.


Generated on Wed Feb 18 00:34:20 2004 for GP3LIB by doxygen1.2.18