Hi Diego,
Let's try this again... Posting through the new web interface seems a little
hit or miss.
Here's the code sections taken from my application. After defining and mapping
the control register (MISCregs), the screen and backlight can be controlled
from a single register write.
Hope this helps,
PJE
#define _VGAregsAdr 0x600FF000
volatile unsigned short *VGAregs; // VGA Registers
(16 Bit)
volatile unsigned short *MISCregs; // Misc Registers (16 Bit)
volatile unsigned short *TOUCHregs; // Touch screen regs (16 Bit)
volatile unsigned short *WDOGfeed; // Watchdog Feed Reg (16 bit)
/* Map Registers */
VGAregs = (UINT16 *)mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd,
_VGAregsAdr);
if (VGAregs == MAP_FAILED) { perror("mmap1:"); return 0; }
TOUCHregs = (VGAregs+(0x40/sizeof(UINT16)));
MISCregs = (VGAregs+(0x86/sizeof(UINT16)));
WDOGfeed = (VGAregs+(0xD6/sizeof(UINT16)));
VGAregs += (0x30/sizeof(UINT16));
// MISCregs
// Bit 15 - (BUS_TXD)
// Bit 14 - LCD On (EN_LCD_3.3V)
// Bit 13 - Dim LCD (DIM_BK_LITE)
// Bit 12 - NAND On (EN_BACK_LITE)
// Bit 11 - Speaker On (FLASH_WP)
// Bit 9 - (EN_SPKR)
// Bit 8
// Bit 7
// Bit 6
// Bit 5
// Bit 4
// Bit 3
// Bit 2
// Bit 1
// Bit 0
/* Add these lines where needed to control the screen brightness */
MISCregs[0] |= 0x2000;
// Dim the screen
MISCregs[0] &= ~(0x2000);
// Full Brightness
/* Add these lines where needed to control the screen ON/OFF */
MISCregs[0] |= 0x4000;
// Turn Screen On
MISCregs[0] &= ~(0x4000);
// Turn Screen Off
/* Unmap registers before exiting...*/
munmap((void *)_VGAregsAdr,getpagesize()); // Release Registers
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|