version 2.8
Toggle

Detailed Description

Sub-Module to handle physical controls that provide provide a digital value (on/off, pressed/released, 1/0, ...).

GINPUT allows it to interface toggle buttons easily to your application.

Precondition
GFX_USE_GINPUT must be set to TRUE in your gfxconf.h
GINPUT_NEED_TOGGLE must be set to TRUE in your gfxconf.h

Functions

GSourceHandle ginputGetToggle (uint16_t instance)
 Create a toggle input instance. More...
 
void ginputInvertToggle (uint16_t instance, bool_t invert)
 Can be used to invert the sense of a toggle. More...
 
bool_t ginputGetToggleStatus (uint16_t instance, GEventToggle *ptoggle)
 Get the current toggle status. More...
 

Function Documentation

GSourceHandle ginputGetToggle ( uint16_t  instance)

Create a toggle input instance.

Parameters
[in]instanceThe ID of the toggle input instance (from 0 to 9999)
Returns
The source handle of the created instance

Definition at line 95 of file ginput_toggle.c.

References gtimerIsActive(), gtimerStart(), and TRUE.

bool_t ginputGetToggleStatus ( uint16_t  instance,
GEventToggle *  ptoggle 
)

Get the current toggle status.

Parameters
[in]instanceThe ID of the toggle input instance
[in]ptoggleThe toggle event struct
Returns
Returns FALSE on an error (eg invalid instance)

Definition at line 132 of file ginput_toggle.c.

References FALSE, gfxSleepMilliseconds(), gtimerJab(), gtimerJabI(), and TRUE.

void ginputInvertToggle ( uint16_t  instance,
bool_t  invert 
)

Can be used to invert the sense of a toggle.

Parameters
[in]instanceThe ID of the toggle input instance
[in]invertIf TRUE, will be inverted

Definition at line 113 of file ginput_toggle.c.