version 2.8
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 TRUE in your gfxconf.h
GINPUT_NEED_DIAL must be set to TRUE in your gfxconf.h

Functions

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

Function Documentation

GSourceHandle ginputGetDial ( uint16_t  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
uint16_t ginputGetDialRange ( uint16_t  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
bool_t ginputGetDialStatus ( uint16_t  instance,
GEventDial *  pdial 
)

Get the current dial status.

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

Reset the value back to the hardware default.

Parameters
[in]instanceThe ID of the dial input instance
void ginputSetDialRange ( uint16_t  instance,
uint16_t  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
void ginputSetDialSensitivity ( uint16_t  instance,
uint16_t  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