µGFX  2.9
version 2.9
Dial

Detailed Description

Sub-Module to handle physical controls that provide a range value (eg. potentiometers and rotary encoders).

A dial provides a powerful way to navigate through menus on a display.

Precondition
GFX_USE_GINPUT must be set to GFXON in your gfxconf.h
GINPUT_NEED_DIAL must be set to GFXON in your gfxconf.h

Functions

GSourceHandle ginputGetDial (gU16 instance)
 Create a dial input instance. More...
 
void ginputResetDialRange (gU16 instance)
 Reset the value back to the hardware default. More...
 
gU16 ginputGetDialRange (gU16 instance)
 Get the maximum value. More...
 
void ginputSetDialRange (gU16 instance, gU16 max)
 Set the maximum value. More...
 
void ginputSetDialSensitivity (gU16 instance, gU16 diff)
 Set the level change required before a dial even is generated (threshold) More...
 
gBool ginputGetDialStatus (gU16 instance, GEventDial *pdial)
 Get the current dial status. More...
 

Function Documentation

◆ ginputGetDial()

GSourceHandle ginputGetDial ( gU16  instance)

Create a dial input instance.

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

◆ ginputGetDialRange()

gU16 ginputGetDialRange ( gU16  instance)

Get the maximum value.

The readings are scaled to be 0 ... max.

Parameters
[in]instanceThe ID of the dial input instance
Returns
The maximum value

◆ ginputGetDialStatus()

gBool ginputGetDialStatus ( gU16  instance,
GEventDial *  pdial 
)

Get the current dial status.

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

◆ ginputResetDialRange()

void ginputResetDialRange ( gU16  instance)

Reset the value back to the hardware default.

Parameters
[in]instanceThe ID of the dial input instance

◆ ginputSetDialRange()

void ginputSetDialRange ( gU16  instance,
gU16  max 
)

Set the maximum value.

The readings are scaled to be 0 ... max.

Parameters
[in]instanceThe ID of the dial input instance
[in]maxThe maximum value to be set

◆ ginputSetDialSensitivity()

void ginputSetDialSensitivity ( gU16  instance,
gU16  diff 
)

Set the level change required before a dial even is generated (threshold)

Note
This is done after range scaling
Parameters
[in]instanceThe ID of the dial input instance
[in]diffThe amount of level changes