mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
Use register defines
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18068 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
dff382cb9c
commit
ffddab1e66
2 changed files with 175 additions and 69 deletions
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "config.h"
|
||||
#include "jz4740.h"
|
||||
#include "r61509.h"
|
||||
#include "lcd-target.h"
|
||||
|
||||
#define PIN_CS_N (32*1+17) /* Chip select */
|
||||
|
|
@ -60,81 +61,81 @@ static void _display_on(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
SLCD_SEND_COMMAND(0x600, 1);
|
||||
SLCD_SEND_COMMAND(REG_SOFT_RESET, SOFT_RESET_EN);
|
||||
SLEEP(700000);
|
||||
SLCD_SEND_COMMAND(0x600, 0);
|
||||
SLCD_SEND_COMMAND(REG_SOFT_RESET, SOFT_RESET_DIS);
|
||||
SLEEP(700000);
|
||||
SLCD_SEND_COMMAND(0x606, 0);
|
||||
SLCD_SEND_COMMAND(REG_ENDIAN_CTRL, 0);
|
||||
|
||||
SLCD_SEND_COMMAND(1, 0x100);
|
||||
SLCD_SEND_COMMAND(2, 0x100);
|
||||
SLCD_SEND_COMMAND(3, 0x1028);
|
||||
SLCD_SEND_COMMAND(8, 0x503);
|
||||
SLCD_SEND_COMMAND(9, 1);
|
||||
SLCD_SEND_COMMAND(0xB, 0x10);
|
||||
SLCD_SEND_COMMAND(0xC, 0);
|
||||
SLCD_SEND_COMMAND(0xF, 0);
|
||||
SLCD_SEND_COMMAND(7, 1);
|
||||
SLCD_SEND_COMMAND(0x10, 0x12);
|
||||
SLCD_SEND_COMMAND(0x11, 0x202);
|
||||
SLCD_SEND_COMMAND(0x12, 0x300);
|
||||
SLCD_SEND_COMMAND(0x20, 0x21e);
|
||||
SLCD_SEND_COMMAND(0x21, 0x202);
|
||||
SLCD_SEND_COMMAND(0x22, 0x100);
|
||||
SLCD_SEND_COMMAND(0x90, 0x8000);
|
||||
SLCD_SEND_COMMAND(0x100, 0x16b0);
|
||||
SLCD_SEND_COMMAND(0x101, 0x147);
|
||||
SLCD_SEND_COMMAND(0x102, 0x1bd);
|
||||
SLCD_SEND_COMMAND(0x103, 0x2f00);
|
||||
SLCD_SEND_COMMAND(0x107, 0);
|
||||
SLCD_SEND_COMMAND(0x110, 1);
|
||||
SLCD_SEND_COMMAND(0x200, 0); /* set cursor at x_start */
|
||||
SLCD_SEND_COMMAND(0x201, 0); /* set cursor at y_start */
|
||||
SLCD_SEND_COMMAND(0x210, 0); /* y_start*/
|
||||
SLCD_SEND_COMMAND(0x211, 239); /* y_end */
|
||||
SLCD_SEND_COMMAND(0x212, 0); /* x_start */
|
||||
SLCD_SEND_COMMAND(0x213, 399); /* x_end */
|
||||
SLCD_SEND_COMMAND(0x280, 0);
|
||||
SLCD_SEND_COMMAND(0x281, 6);
|
||||
SLCD_SEND_COMMAND(0x282, 0);
|
||||
SLCD_SEND_COMMAND(0x300, 0x101);
|
||||
SLCD_SEND_COMMAND(0x301, 0xb27);
|
||||
SLCD_SEND_COMMAND(0x302, 0x132a);
|
||||
SLCD_SEND_COMMAND(0x303, 0x2a13);
|
||||
SLCD_SEND_COMMAND(0x304, 0x270b);
|
||||
SLCD_SEND_COMMAND(0x305, 0x101);
|
||||
SLCD_SEND_COMMAND(0x306, 0x1205);
|
||||
SLCD_SEND_COMMAND(0x307, 0x512);
|
||||
SLCD_SEND_COMMAND(0x308, 5);
|
||||
SLCD_SEND_COMMAND(0x309, 3);
|
||||
SLCD_SEND_COMMAND(0x30a, 0xf04);
|
||||
SLCD_SEND_COMMAND(0x30b, 0xf00);
|
||||
SLCD_SEND_COMMAND(0x30c, 0xf);
|
||||
SLCD_SEND_COMMAND(0x30d, 0x40f);
|
||||
SLCD_SEND_COMMAND(REG_DRIVER_OUTPUT, 0x100);
|
||||
SLCD_SEND_COMMAND(REG_LCD_DR_WAVE_CTRL, 0x100);
|
||||
SLCD_SEND_COMMAND(REG_ENTRY_MODE, 0x1028);
|
||||
SLCD_SEND_COMMAND(REG_DISP_CTRL2, 0x503);
|
||||
SLCD_SEND_COMMAND(REG_DISP_CTRL3, 1);
|
||||
SLCD_SEND_COMMAND(REG_LPCTRL, 0x10);
|
||||
SLCD_SEND_COMMAND(REG_EXT_DISP_CTRL1, 0);
|
||||
SLCD_SEND_COMMAND(REG_EXT_DISP_CTRL2, 0);
|
||||
SLCD_SEND_COMMAND(REG_DISP_CTRL1, 1);
|
||||
SLCD_SEND_COMMAND(REG_PAN_INTF_CTRL1, 0x12);
|
||||
SLCD_SEND_COMMAND(REG_PAN_INTF_CTRL2, 0x202);
|
||||
SLCD_SEND_COMMAND(REG_PAN_INTF_CTRL3, 0x300);
|
||||
SLCD_SEND_COMMAND(REG_PAN_INTF_CTRL4, 0x21e);
|
||||
SLCD_SEND_COMMAND(REG_PAN_INTF_CTRL5, 0x202);
|
||||
SLCD_SEND_COMMAND(REG_PAN_INTF_CTRL6, 0x100);
|
||||
SLCD_SEND_COMMAND(REG_FRM_MRKR_CTRL, 0x8000);
|
||||
SLCD_SEND_COMMAND(REG_PWR_CTRL1, 0x16b0);
|
||||
SLCD_SEND_COMMAND(REG_PWR_CTRL2, 0x147);
|
||||
SLCD_SEND_COMMAND(REG_PWR_CTRL3, 0x1bd);
|
||||
SLCD_SEND_COMMAND(REG_PWR_CTRL4, 0x2f00);
|
||||
SLCD_SEND_COMMAND(REG_PWR_CTRL5, 0);
|
||||
SLCD_SEND_COMMAND(REG_PWR_CTRL6, 1);
|
||||
SLCD_SEND_COMMAND(REG_RAM_HADDR_SET, 0); /* set cursor at x_start */
|
||||
SLCD_SEND_COMMAND(REG_RAM_VADDR_SET, 0); /* set cursor at y_start */
|
||||
SLCD_SEND_COMMAND(REG_RAM_HADDR_START, 0); /* y_start*/
|
||||
SLCD_SEND_COMMAND(REG_RAM_HADDR_END, 239); /* y_end */
|
||||
SLCD_SEND_COMMAND(REG_RAM_VADDR_START, 0); /* x_start */
|
||||
SLCD_SEND_COMMAND(REG_RAM_VADDR_END, 399); /* x_end */
|
||||
SLCD_SEND_COMMAND(REG_RW_NVM, 0);
|
||||
SLCD_SEND_COMMAND(REG_VCOM_HVOLTAGE1, 6);
|
||||
SLCD_SEND_COMMAND(REG_VCOM_HVOLTAGE2, 0);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL1, 0x101);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL2, 0xb27);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL3, 0x132a);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL4, 0x2a13);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL5, 0x270b);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL6, 0x101);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL7, 0x1205);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL8, 0x512);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL9, 5);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL10, 3);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL11, 0xf04);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL12, 0xf00);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL13, 0xf);
|
||||
SLCD_SEND_COMMAND(REG_GAMMA_CTRL14, 0x40f);
|
||||
SLCD_SEND_COMMAND(0x30e, 0x300);
|
||||
SLCD_SEND_COMMAND(0x30f, 0x500);
|
||||
SLCD_SEND_COMMAND(0x400, 0x3100);
|
||||
SLCD_SEND_COMMAND(0x401, 1);
|
||||
SLCD_SEND_COMMAND(0x404, 0);
|
||||
SLCD_SEND_COMMAND(0x500, 0);
|
||||
SLCD_SEND_COMMAND(0x501, 0);
|
||||
SLCD_SEND_COMMAND(0x502, 0);
|
||||
SLCD_SEND_COMMAND(0x503, 0);
|
||||
SLCD_SEND_COMMAND(0x504, 0);
|
||||
SLCD_SEND_COMMAND(0x505, 0);
|
||||
SLCD_SEND_COMMAND(0x606, 0);
|
||||
SLCD_SEND_COMMAND(0x6f0, 0);
|
||||
SLCD_SEND_COMMAND(REG_BIMG_NR_LINE, 0x3100);
|
||||
SLCD_SEND_COMMAND(REG_BIMG_DISP_CTRL, 1);
|
||||
SLCD_SEND_COMMAND(REG_BIMG_VSCROLL_CTRL, 0);
|
||||
SLCD_SEND_COMMAND(REG_PARTIMG1_POS, 0);
|
||||
SLCD_SEND_COMMAND(REG_PARTIMG1_RAM_START, 0);
|
||||
SLCD_SEND_COMMAND(REG_PARTIMG1_RAM_END, 0);
|
||||
SLCD_SEND_COMMAND(REG_PARTIMG2_POS, 0);
|
||||
SLCD_SEND_COMMAND(REG_PARTIMG2_RAM_START, 0);
|
||||
SLCD_SEND_COMMAND(REG_PARTIMG2_RAM_END, 0);
|
||||
SLCD_SEND_COMMAND(REG_ENDIAN_CTRL, 0);
|
||||
SLCD_SEND_COMMAND(REG_NVM_ACCESS_CTRL, 0);
|
||||
SLCD_SEND_COMMAND(0x7f0, 0x5420);
|
||||
SLCD_SEND_COMMAND(0x7f3, 0x288a);
|
||||
SLCD_SEND_COMMAND(0x7f4, 0x22);
|
||||
SLCD_SEND_COMMAND(0x7f5, 1);
|
||||
SLCD_SEND_COMMAND(0x7f0, 0);
|
||||
|
||||
SLCD_SEND_COMMAND(7, 0x173);
|
||||
SLCD_SEND_COMMAND(REG_DISP_CTRL1, 0x173);
|
||||
SLEEP(3500000);
|
||||
SLCD_SEND_COMMAND(7, 0x171);
|
||||
SLCD_SEND_COMMAND(REG_DISP_CTRL1, 0x171);
|
||||
SLEEP(3500000);
|
||||
SLCD_SEND_COMMAND(7, 0x173);
|
||||
SLCD_SEND_COMMAND(REG_DISP_CTRL1, 0x173);
|
||||
SLEEP(3500000);
|
||||
}
|
||||
|
||||
|
|
@ -181,13 +182,13 @@ void lcd_init_controller(void)
|
|||
|
||||
void lcd_set_target(short x, short y, short width, short height)
|
||||
{
|
||||
SLCD_SEND_COMMAND(0x210, y); /* y_start */
|
||||
SLCD_SEND_COMMAND(0x211, y+height); /* y_end */
|
||||
SLCD_SEND_COMMAND(0x212, x); /* x_start */
|
||||
SLCD_SEND_COMMAND(0x213, x+width); /* x_end */
|
||||
SLCD_SEND_COMMAND(0x200, x); /* set cursor at x_start */
|
||||
SLCD_SEND_COMMAND(0x201, y); /* set cursor at y_start */
|
||||
SLCD_SET_COMMAND(0x202); /* write data? */
|
||||
SLCD_SEND_COMMAND(REG_RAM_HADDR_START, y); /* y_start */
|
||||
SLCD_SEND_COMMAND(REG_RAM_HADDR_END, y+height); /* y_end */
|
||||
SLCD_SEND_COMMAND(REG_RAM_VADDR_START, x); /* x_start */
|
||||
SLCD_SEND_COMMAND(REG_RAM_VADDR_END, x+width); /* x_end */
|
||||
SLCD_SEND_COMMAND(REG_RAM_HADDR_SET, x); /* set cursor at x_start */
|
||||
SLCD_SEND_COMMAND(REG_RAM_VADDR_SET, y); /* set cursor at y_start */
|
||||
SLCD_SET_COMMAND(REG_RW_GRAM); /* write data to GRAM */
|
||||
}
|
||||
|
||||
void lcd_on(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue