This is a guide to the
brightness C example project included in the EMAC OE SDK.
This is a simple backlight brightness control. It's written for the EMAC PPC-E7 and SoM-9307 but it will probably run on anything with a backlight. It implements a slider application in GTK+ that directly controls the backlight through its sysfs interface. It has been tested under Xfbdev/Matchbox.
brightness project builds one executable:
Opening, Building and Uploading the Project Files
For information on opening the project from within Eclipse, please see Importing the EMAC OE SDK Projects with Eclipse. Then, follow Using the EMAC OE SDK Projects with Eclipse for information on how to build, upload and execute the example.
Makefile can be used with the
make command from the commandline to build and upload the example. For more information on this method, please see Using EMAC OE SDK Example Projects.
Usage and Behavior
brightness C example project creates a GTK+ UI for controlling the backlight brightness. It gives us a slider, a spinner and a textfield.
brightness C example project is written for the EMAC PPC-E7 and SoM-9307 but it will probably run on anything with a backlight.
From the terminal, first set the DISPLAY variable:
Then run the
brightness C executable:
A GTK+ UI appears on the LCD.
Slide the slider, click the spinner arrows or enter a new brightness value (in range [0,255]) to change the LCD backlight value.
Behind the Scenes
sysclass_set_level() functions are responsible for retrieving and setting the backlight's brightness value, respectively. These functions demonstrate a method of interfacing with the
/sys virtual filesystem to set and retrieve values to and from the backlight driver in the kernel.
brightness C example project creates a GTK+ UI for controlling the backlight-brightness on a EMAC PPC-E7, SoM-9307 or just about any other board with an LCD.