Go to the source code of this file.
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. | |
unsigned int | gp3readword (void) |
Read a 16-bit word from the GP3. | |
void | gp3setLED (int onoff) |
Set the GP3's onboard LED. | |
unsigned int | gp3a2d (int chan) |
Read an analog channel. | |
void | gp3high (int pin) |
Set a GP3 pin High The pin is automatically made an output. | |
void | gp3low (int pin) |
Set a GP3 pin Low The pin is automatically made an output. | |
void | gp3toggle (int pin) |
Toggle a GP3 output pin (that is set from low to high or high to low) The pin is automatically made an output. | |
int | gp3input (int pin) |
Read a GP3 input pin. | |
void | gp3settris (int tris) |
Set the GP3 direction register. | |
unsigned int | gp3gettris (void) |
Get the GP3 direction register. | |
void | gp3setpins (int byte) |
Set all output pins at once (does not affect input pins). | |
unsigned int | gp3getpins (void) |
Read all input pins at once. | |
void | gp3writeee (int address, int byte) |
Write to EEPROM. | |
unsigned int | gp3readee (int address) |
Read from EEPROM. | |
void | gp3pwm (int chan, int dc, int dfreq) |
Generate PWM. | |
unsigned int | gp3count (int pin, unsigned int ms) |
Count transitions on a digital input. | |
unsigned int | gp3rctime (int pin, int state) |
Read an RC charge/discharge time. | |
unsigned int | gp3pulsein (int pin, int state) |
Measure a single pulse. | |
void | gp3pulseout (int pin, int duration) |
Generate a single pulse. | |
void | gp3freq (int pin, int ms, int freq) |
Generate a psuedo sine wave. | |
void | gp3setcounter (int prescale, int ext) |
Set hardware counter options. | |
unsigned int | gp3counter (void) |
Read hardware counter and reset to 0. | |
void | gp3resetall (void) |
Reset GP3 to power up state. | |
void | gp3reset (void) |
Reset GP3's communicatios state. | |
void | gp3repeat (int count) |
Repeat next command. | |
void | gp3argincr (void) |
Increment the internal argument. | |
void | gp3argdecr (void) |
Decrement the internal argument. | |
unsigned int | gp3check (void) |
Check the GP3 status. |
Definition in file gp3lib.h.
|
Read an analog channel.
Definition at line 74 of file gp3lib.c. References gp3readword(), and gp3write(). Referenced by main(). |
|
Decrement the internal argument. You should not need to call this function under normal circumstances. Definition at line 224 of file gp3lib.c. References gp3write(). |
|
Increment the internal argument. You should not need to call this function under normal circumstances. Definition at line 218 of file gp3lib.c. References gp3write(). |
|
Check the GP3 status. If the GP3 is ready and connected it will return a version number (currently 0x33).
Definition at line 229 of file gp3lib.c. References gp3read(), and gp3write(). Referenced by main(). |
|
Count transitions on a digital input. The pin automatically becomes an input. This command always counts rising edges. Sampling occurs every 4uS.
Definition at line 146 of file gp3lib.c. References gp3readword(), and gp3write(). |
|
Read hardware counter and reset to 0.
Definition at line 195 of file gp3lib.c. References gp3readword(), and gp3write(). |
|
Generate a psuedo sine wave.
Definition at line 172 of file gp3lib.c. References gp3write(). |
|
Read all input pins at once.
Definition at line 119 of file gp3lib.c. References gp3read(), and gp3write(). |
|
Get the GP3 direction register. The tris parameter has 8 bits that each correspond to a GP3 digital I/O pin A 0 in a tris bit indicates an output bit and a 1 indicates an input bit
Definition at line 107 of file gp3lib.c. References gp3read(), and gp3write(). |
|
Set a GP3 pin High The pin is automatically made an output.
Definition at line 80 of file gp3lib.c. References gp3write(). Referenced by main(). |
|
Read a GP3 input pin. The pin is automatically made an input.
Definition at line 95 of file gp3lib.c. References gp3read(), and gp3write(). |
|
Set a GP3 pin Low The pin is automatically made an output.
Definition at line 85 of file gp3lib.c. References gp3write(). Referenced by main(). |
|
Measure a single pulse.
Definition at line 160 of file gp3lib.c. References gp3readword(), and gp3write(). |
|
Generate a single pulse. This command inverts the output pin's state for the specified duration.
Definition at line 166 of file gp3lib.c. References gp3write(). |
|
Generate PWM.
Definition at line 139 of file gp3lib.c. References gp3write(). Referenced by main(). |
|
Read an RC charge/discharge time. This command allows you to read the amount of time required for an RC (resistor/capacitor) network to charge or discharge. It is useful for measuring resistive or capacitive sensors like thermistors, pots, etc.
Definition at line 153 of file gp3lib.c. References gp3readword(), and gp3write(). |
|
Read from EEPROM.
Definition at line 132 of file gp3lib.c. References gp3read(), and gp3write(). |
|
Read a 16-bit word from the GP3. The user may call this function after using gp3repeat and a command that returns 16-bit results. Definition at line 60 of file gp3lib.c. References gp3read(). Referenced by gp3a2d(), gp3count(), gp3counter(), gp3pulsein(), and gp3rctime(). |
|
Repeat next command. Eligible commands include gp3a2d(), gp3input(), gp3rctime(),gp3getpins(), gp3gettris(), and gp3pulsein() If you set the count to 100, for example, and then issued one gp3a2d() command, you'd follow it with 99 gp3readword() calls to fetch the other 99 A/D samples.
Definition at line 211 of file gp3lib.c. References gp3write(). |
|
Reset GP3's communicatios state.
Definition at line 206 of file gp3lib.c. References gp3write(). |
|
Reset GP3 to power up state.
Definition at line 201 of file gp3lib.c. References gp3write(). Referenced by main(). |
|
Set hardware counter options.
Definition at line 181 of file gp3lib.c. References gp3write(). |
|
Set the GP3's onboard LED.
Definition at line 69 of file gp3lib.c. References gp3write(). Referenced by main(). |
|
Set all output pins at once (does not affect input pins).
Definition at line 113 of file gp3lib.c. References gp3write(). |
|
Set the GP3 direction register. The tris parameter has 8 bits that each correspond to a GP3 digital I/O pin A 0 in a tris bit indicates an output bit and a 1 indicates an input bit This overrides previous calls to gp3high, gp3low, gp3input, etc.
Definition at line 101 of file gp3lib.c. References gp3write(). |
|
Toggle a GP3 output pin (that is set from low to high or high to low) The pin is automatically made an output.
Definition at line 90 of file gp3lib.c. References gp3write(). |
|
Write to EEPROM.
Definition at line 125 of file gp3lib.c. References gp3write(). |