Main Page   Modules   File List   Globals  

gp3win.c File Reference

This is the windows-specific gp3 file. More...

#include <windows.h>
#include <stdio.h>
#include "gp3lib.h"

Go to the source code of this file.

Defines

#define DEBUGOUT   0
 If DEBUGOUT=1 then the platform-specific code will generate interesting debug messages.

#define DEBUG(tag, x)

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

This is the windows-specific gp3 file.

Compile and link with gp3lib.c. Do not link with other files (such as gp3cygwin.c).

Author:
Al Williams alw@al-williams.com
Version:
1.1
Date:
17 Feb 2004

Definition in file gp3win.c.


Define Documentation

#define DEBUG tag,
 
 

Definition at line 21 of file gp3win.c.

#define DEBUGOUT   0
 

If DEBUGOUT=1 then the platform-specific code will generate interesting debug messages.

Definition at line 17 of file gp3win.c.


Function Documentation

void gp3closeport  
 

Close the GP3 port.

Definition at line 69 of file gp3win.c.

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 31 of file gp3win.c.

Referenced by main().

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 87 of file gp3win.c.

References DEBUG.

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 108 of file gp3win.c.

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 75 of file gp3win.c.

References DEBUG, and gp3ready().

Referenced by gp3a2d(), gp3argdecr(), gp3argincr(), gp3check(), gp3count(), gp3counter(), gp3freq(), gp3getpins(), gp3gettris(), gp3high(), gp3input(), gp3low(), gp3pulsein(), gp3pulseout(), gp3pwm(), gp3rctime(), gp3readee(), gp3repeat(), gp3reset(), gp3resetall(), gp3setcounter(), gp3setLED(), gp3setpins(), gp3settris(), gp3toggle(), and gp3writeee().


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