From d29aef3d62b29df2034577b0467a74544745baa1 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Mon, 14 Nov 2005 22:12:50 +0000 Subject: H300 backlight git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7885 a1c6a512-1295-4272-9138-f99709370657 --- firmware/backlight.c | 18 +++++++++++++----- firmware/export/config-h100.h | 2 +- firmware/export/config-h120.h | 2 +- firmware/export/config-h300.h | 2 +- firmware/export/config.h | 15 ++++++++------- 5 files changed, 24 insertions(+), 15 deletions(-) (limited to 'firmware') diff --git a/firmware/backlight.c b/firmware/backlight.c index 1e9d1ce743..fa6a42be44 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c @@ -61,7 +61,7 @@ static int remote_backlight_timer; static unsigned int remote_backlight_timeout = 5; #endif -#if CONFIG_BACKLIGHT == BL_IRIVER +#if CONFIG_BACKLIGHT == BL_IRIVER_H100 /* backlight fading */ #define BL_PWM_INTERVAL 5000 /* Cycle interval in µs */ #define BL_PWM_COUNT 100 @@ -195,7 +195,7 @@ void backlight_set_fade_out(int index) static void __backlight_off(void) { -#if CONFIG_BACKLIGHT == BL_IRIVER +#if CONFIG_BACKLIGHT == BL_IRIVER_H100 if (fade_out_count > 0) backlight_dim(0); else @@ -203,6 +203,8 @@ static void __backlight_off(void) bl_dim_target = bl_dim_current = 0; or_l(0x00020000, &GPIO1_OUT); } +#elif CONFIG_BACKLIGHT == BL_IRIVER_H300 + and_l(~0x00020000, &GPIO1_OUT); #elif CONFIG_BACKLIGHT == BL_RTC /* Disable square wave */ rtc_write(0x0a, rtc_read(0x0a) & ~0x40); @@ -227,7 +229,7 @@ static void __backlight_off(void) static void __backlight_on(void) { -#if CONFIG_BACKLIGHT == BL_IRIVER +#if CONFIG_BACKLIGHT == BL_IRIVER_H100 if (fade_in_count > 0) backlight_dim(BL_PWM_COUNT); else @@ -235,6 +237,8 @@ static void __backlight_on(void) bl_dim_target = bl_dim_current = BL_PWM_COUNT; and_l(~0x00020000, &GPIO1_OUT); } +#elif CONFIG_BACKLIGHT == BL_IRIVER_H300 + or_l(0x00020000, &GPIO1_OUT); #elif CONFIG_BACKLIGHT == BL_RTC /* Enable square wave */ rtc_write(0x0a, rtc_read(0x0a) | 0x40); @@ -317,7 +321,7 @@ void backlight_thread(void) __backlight_off(); break; -#if CONFIG_BACKLIGHT == BL_IRIVER +#if CONFIG_BACKLIGHT == BL_IRIVER_H100 case BACKLIGHT_UNBOOST_CPU: cpu_boost(false); break; @@ -430,10 +434,14 @@ void backlight_init(void) create_thread(backlight_thread, backlight_stack, sizeof(backlight_stack), backlight_thread_name); -#if CONFIG_BACKLIGHT == BL_IRIVER +#if CONFIG_BACKLIGHT == BL_IRIVER_H100 or_l(0x00020000, &GPIO1_ENABLE); or_l(0x00020000, &GPIO1_FUNCTION); and_l(~0x00020000, &GPIO1_OUT); /* Start with the backlight ON */ +#elif CONFIG_BACKLIGHT == BL_IRIVER_H300 + or_l(0x00020000, &GPIO1_ENABLE); + or_l(0x00020000, &GPIO1_FUNCTION); + or_l(0x00020000, &GPIO1_OUT); /* Start with the backlight ON */ #elif CONFIG_BACKLIGHT == BL_PA14_LO || CONFIG_BACKLIGHT == BL_PA14_HI PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */ or_b(0x40, &PAIORH); /* ..and output */ diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index 1426913d41..19bb99bc04 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h @@ -75,7 +75,7 @@ #define FLASH_SIZE 0x200000 /* Define this for LCD backlight available */ -#define CONFIG_BACKLIGHT BL_IRIVER /* port controlled */ +#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */ /* Define this to the CPU frequency */ #define CPU_FREQ 11289600 diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index cdfc068626..b2c34c5a55 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h @@ -72,7 +72,7 @@ #define FLASH_SIZE 0x200000 /* Define this for LCD backlight available */ -#define CONFIG_BACKLIGHT BL_IRIVER /* port controlled */ +#define CONFIG_BACKLIGHT BL_IRIVER_H100 /* port controlled */ /* Define this to the CPU frequency */ #define CPU_FREQ 11289600 diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h index 9cb13c0195..b7105b74e1 100644 --- a/firmware/export/config-h300.h +++ b/firmware/export/config-h300.h @@ -69,7 +69,7 @@ #define FLASH_SIZE 0x400000 /* Define this for LCD backlight available */ -#define CONFIG_BACKLIGHT BL_IRIVER /* port controlled */ +#define CONFIG_BACKLIGHT BL_IRIVER_H300 /* port controlled PWM */ /* Define this to the CPU frequency */ #define CPU_FREQ 11289600 diff --git a/firmware/export/config.h b/firmware/export/config.h index 41e639f125..ea047cbace 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -77,13 +77,14 @@ #define LCD_IPODNANO 7 /* as used by iPod Nano */ /* CONFIG_BACKLIGHT */ -#define BL_PA14_LO 0 /* Player, PA14 low active */ -#define BL_RTC 1 /* Recorder, RTC square wave output */ -#define BL_PA14_HI 2 /* Ondio, PA14 high active */ -#define BL_IRIVER 3 /* IRiver GPIO */ -#define BL_GMINI 4 /* Archos GMini */ -#define BL_IPOD4G 5 /* Apple iPod 4G */ -#define BL_IPODNANO 6 /* Apple iPod Nano */ +#define BL_PA14_LO 0 /* Player, PA14 low active */ +#define BL_RTC 1 /* Recorder, RTC square wave output */ +#define BL_PA14_HI 2 /* Ondio, PA14 high active */ +#define BL_IRIVER_H100 3 /* IRiver GPIO */ +#define BL_GMINI 4 /* Archos GMini */ +#define BL_IPOD4G 5 /* Apple iPod 4G */ +#define BL_IPODNANO 6 /* Apple iPod Nano */ +#define BL_IRIVER_H300 7 /* IRiver PWM */ /* CONFIG_I2C */ #define I2C_PLAYREC 0 /* Archos Player/Recorder style */ -- cgit v1.2.3