LIB: pm_clcd
CStyle Lib: LCD Manipulations
pmrom_clcd.s
Type: Source File
Dependency: pm_init.s and pm_cstyle.s
Including Rules: Must be after ROM (PM_HEADER) declaration
Functions
Set constrast
c_lcd_contrast contrast
[CVar] contrast: Contrast level
No return
Set LCD contrast, $1F or $20 is the balanced level, $00 is fully light and $3F is fully dark
Fade screen
c_lcd_fade contrasts, time
[CVar] contrasts: Contrasts (High = Start, Low = End)
[CVar] time: Time per tick
No return
Higher byte of contrasts is the starting constrast and lower byte is the ending contrast, for example to fade in from white use 0x001F, to fade out use 0x1F00.
time is the amount of time the routine takes to step up or down the contrast, the delay is approx. 64 cycles per unit (16µs).
Fill 1x8 pattern directly to the LCD
c_lcd_fill8 range, pattern
[CVar] range: Range in pages (High = Start, Low = End)
[CVar] pattern: 8-bits pattern
No return
Higher byte of range is the starting page and lower byte is the ending page, each page is a group of 8x96 pixels in vertical strip, less significant bit starts on top and go toward 96 pixels.
There's a total of 8 pages, 0 for the top up to 7 for the bottom.
To completely clear the LCD use: c_lcd_fill8 $0007, $00
Warning! Range MUST always start from lower to higher, invalid range will lock up the system!
Fill 2x8 pattern directly to the LCD
c_lcd_fill16 range, pattern
[CVar] range: Range in pages (High = Start, Low = End)
[CVar] pattern: 16-bits pattern (Low = Odd pixel, High = Even pixel)
No return
Higher byte of range is the starting page and lower byte is the ending page, each page is a group of 8x96 pixels in vertical strip, less significant bit starts on top and go toward 96 pixels.
There's a total of 8 pages, 0 for the top up to 7 for the bottom.
To use fine checkboard pattern use: c_lcd_fill16 $0007, $AA55
Warning! Range MUST always start from lower to higher, invalid range will lock up the system!
Send raw image directly to the LCD
c_lcd_sendraw range, addr
[CVar] range: Range in pages (High = Start, Low = End)
[CPtr] addr: Pointer to raw data
No return
Higher byte of range is the starting page and lower byte is the ending page, each page is a group of 8x96 pixels in vertical strip, less significant bit starts on top and go toward 96 pixels.
There's a total of 8 pages, 0 for the top up to 7 for the bottom.
Raw data must be 96 bytes of data * number of pages.
To send an image to the LCD use: c_lcd_sendraw $0007, image_addr