µGFX  2.9
version 2.9
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 GFXON in your gfxconf.h
GINPUT_NEED_TOGGLE must be set to GFXON in your gfxconf.h

Functions

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

Function Documentation

◆ ginputGetToggle()

GSourceHandle ginputGetToggle ( gU16  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().

◆ ginputGetToggleStatus()

gBool ginputGetToggleStatus ( gU16  instance,
GEventToggle *  ptoggle 
)

Get the current toggle status.

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

Definition at line 132 of file ginput_toggle.c.

References gfxSleepMilliseconds().

◆ ginputInvertToggle()

void ginputInvertToggle ( gU16  instance,
gBool  invert 
)

Can be used to invert the sense of a toggle.

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

Definition at line 113 of file ginput_toggle.c.