NW   NE
 

Sharp Zaurus Developer Information

Corrections and Comments: Spencer Huang
 
SW   SE
NW   NE
 
Howtos

Upgrading The ROM

Connectivity
Wireless 802.11b

Linux Connectivity
Generic (USB)
Debian (USB)
Red Hat (USB)
Suse (USB)
Mandrake (USB)
Generic (PPP USB)
Generic (PPP Serial)

Windows Connectivity
Win2K (Serial)
Win98se (Serial)
WinMe Over (Serial)
WinNTSP6 (Serial)
WinXP Over (Serial)

Developing
Compiler Setup
Compiling the Kernel
Special Considerations
Checklist
System Layout
Application Help Files
IPKG Howto
Buzzer Howto
Led Howto
IrDa Howto
Audio Howto
Fullscreen Howto
Resume Event
Keys
Turning off the screen

Syncing
Linux
Win2K
Wireless

Other
Wireless Comparison
The Z Boot Process
Ipv6 Setup
Servers Setup
SD And CF FAQ
Setting Up A Feed
Converting TTF fonts
Building a ROM
MPEG Encoding

Downloads
ZaurusZone Feed
Links
 
SW   SE
NW   NE
  Howto turn off the screen.

1) Intro

For some applications such as audio applications you don't want to waste battery life on the screen when only the audio is being used. Here is some code to turn the screen on and off.

2) Sample application
Here is a sample application that can be modified.
#include < fcntl.h >
#include < stdio.h >
#include < pthread.h >
#include < unistd.h >
#include < stdlib.h >
#include < sys/time.h >
#include < unistd.h >
#include < sys/ioctl.h >
#include < time.h >

#define VESA_NO_BLANKING        0
#define VESA_VSYNC_SUSPEND      1
#define VESAg_HSYNC_SUSPEND     2
#define VESA_POWERDOWN          3

#define FBIOBLANK		0x4611		/* arg: 0 or vesa level + 1 */

int main( int argc, char *argv[] )
{
  int fd,mode;

  if (argc>1) {
    if (strcmp(argv[1],"-on")==0)  mode = 0;
    if (strcmp(argv[1],"-off")==0)  mode = 1;
  } else {
    printf("blank  -on \n");
    printf("       -off\n");
    exit(1);
  }

  if ( mode == 1 ) {
    fd = open( "/dev/fb0", O_RDWR);
    ioctl( fd, FBIOBLANK,VESA_POWERDOWN );
    close(fd);
  } else {
    fd = open( "/dev/fb0", O_RDWR);
    ioctl( fd, FBIOBLANK,VESA_NO_BLANKING );
    close(fd);
  }

}
 
SW   SE

    This page was last updated: Wednesday, 09-Apr-2003 04:57:24 PDT