From 98a53f0287a9eba03247f44667d84f659299aeef Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Mon, 9 Mar 2009 21:26:39 +0000 Subject: * Onda VX767: fix some redundant files + add some missing functions for apps/ compilation (still needs keymap though). * Add Onda VX767 SADC driver * Unify Onda VX747(+) and Onda VX767 backlight driver * Also be more consistent wrt file naming. * Add speaker-onda_vx747.c to SOURCES (forgot to commit this) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20259 a1c6a512-1295-4272-9138-f99709370657 --- .../ingenic_jz47xx/onda_vx767/lcd-onda_vx767.c | 215 +++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 firmware/target/mips/ingenic_jz47xx/onda_vx767/lcd-onda_vx767.c (limited to 'firmware/target/mips/ingenic_jz47xx/onda_vx767/lcd-onda_vx767.c') diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx767/lcd-onda_vx767.c b/firmware/target/mips/ingenic_jz47xx/onda_vx767/lcd-onda_vx767.c new file mode 100644 index 0000000000..3cf2586d46 --- /dev/null +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx767/lcd-onda_vx767.c @@ -0,0 +1,215 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2008 by Maurus Cuelenaere + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "config.h" +#include "jz4740.h" +#include "lcd-target.h" + +#define PIN_CS_N (32*1+17) /* Chip select */ +#define PIN_RESET_N (32*1+18) /* Reset */ +#define PIN_UNK_N (32*2+19) + +#define my__gpio_as_lcd_16bit() \ +do { \ + REG_GPIO_PXFUNS(2) = 0x0014ffff; \ + REG_GPIO_PXSELC(2) = 0x0014ffff; \ + REG_GPIO_PXPES(2) = 0x0014ffff; \ +} while (0) + + +#define SLEEP(x) for(i=0; i 0x1ff ) + val = 0x1ff; /* CPM_LPCDR is too large, set it to 0x1ff */ + __cpm_set_pixdiv(val); + __cpm_start_lcd(); +} + +void lcd_init_controller(void) +{ + int i; + _display_pin_init(); + _set_lcd_bus(); + _set_lcd_clock(); + SLEEP(1000); + _display_init(); +} + +void lcd_set_target(short x, short y, short width, short height) +{ + SLCD_SEND_COMMAND(0x50, y); + SLCD_SEND_COMMAND(0x51, y+height-1); + SLCD_SEND_COMMAND(0x52, x); + SLCD_SEND_COMMAND(0x53, x+width-1); + /* TODO */ + + __gpio_clear_pin(PIN_UNK_N); + SLCD_SET_COMMAND(0x22); + WAIT_ON_SLCD; + __gpio_set_pin(PIN_UNK_N); +} + +void lcd_on(void) +{ + _display_on(); +} + +void lcd_off(void) +{ + _display_off(); +} + +void lcd_set_contrast(int val) +{ + (void)val; +} -- cgit v1.2.3