From 303b4abfc5b6e7f1fd85876a2c644a4661d9dd02 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 1 Dec 2004 00:33:18 +0000 Subject: Button driver overhaul: (1) Unified the button driver functions as much as possible (2) Proper #defines for FM recorder button ADC channels (3) Got rid of old port B #defines only valid for recorder (4) button filtering for all models (5) RoLo with ON after panic should now work for FM/V2 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5472 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/adc.h | 4 ++-- firmware/export/sh7034.h | 15 +++------------ 2 files changed, 5 insertions(+), 14 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/adc.h b/firmware/export/adc.h index 044391b..e2c87fa 100644 --- a/firmware/export/adc.h +++ b/firmware/export/adc.h @@ -41,8 +41,6 @@ #define ADC_BUTTON_ROW1 4 /* Used for scanning the keys, different voltages for different keys */ #define ADC_UNREG_POWER 7 /* Battery voltage */ -/* FixMe: this doesn't exist, just to make the compiler happy */ -#define ADC_EXT_POWER 5 /* The external power voltage, V=X*0.0148 */ #else /* normal JBR channel assignment */ @@ -51,6 +49,8 @@ #ifdef HAVE_FMADC #define ADC_CHARGE_REGULATOR 0 /* Uh, we read the battery voltage? */ #define ADC_USB_POWER 1 /* USB, reads 0x000 when USB is inserted */ +#define ADC_BUTTON_OFF 2 /* the off button, high value if pressed */ +#define ADC_BUTTON_ON 3 /* the on button, low value if pressed */ #else #define ADC_CHARGE_REGULATOR 1 /* Regulator reference voltage, should read about 0x1c0 when charging, else 0x3FF */ diff --git a/firmware/export/sh7034.h b/firmware/export/sh7034.h index 90cbb5a..c15ee2a 100644 --- a/firmware/export/sh7034.h +++ b/firmware/export/sh7034.h @@ -140,7 +140,7 @@ #define RSTCSR_ADDR 0x05FFFFBB #define SBYCR_ADDR 0x05FFFFBC - + #define PADR_ADDR 0x05FFFFC0 #define PBDR_ADDR 0x05FFFFC2 #define PAIOR_ADDR 0x05FFFFC4 @@ -150,7 +150,7 @@ #define PBCR1_ADDR 0x05FFFFCC #define PBCR2_ADDR 0x05FFFFCE #define PCDR_ADDR 0x05FFFFD0 - + #define CASCR_ADDR 0x05FFFFEE /* byte halves of the ports */ @@ -164,15 +164,6 @@ #define PBIORL_ADDR 0x05FFFFC7 -/* Port B data register bits */ -#define PBDR_LCD_SDA 0x0001 /* LCD serial data */ -#define PBDR_LCD_SCK 0x0002 /* LCD serial clock */ -#define PBDR_LCD_DC 0x0004 /* LCD data (1) / command (0) */ -#define PBDR_LCD_CS1 0x0008 /* LCD chip select 1 (active low) */ -#define PBDR_BTN_OFF 0x0010 /* Off button (active low) */ -#define PBDR_LED_RED 0x0040 /* Red LED */ -#define PBDR_BTN_ON 0x0100 /* On button (active low) */ - /* A/D control/status register bits */ #define ADCSR_CH 0x07 /* Channel/group select */ #define ADCSR_CKS 0x08 /* Clock select */ @@ -195,7 +186,7 @@ #define SMR1 (*((volatile unsigned char*)SMR1_ADDR)) #define BRR1 (*((volatile unsigned char*)BRR1_ADDR)) #define SCR1 (*((volatile unsigned char*)SCR1_ADDR)) -#define TDR1 (*((volatile unsigned char*)TDR1_ADDR)) +#define TDR1 (*((volatile unsigned char*)TDR1_ADDR)) #define SSR1 (*((volatile unsigned char*)SSR1_ADDR)) #define RDR1 (*((volatile unsigned char*)RDR1_ADDR)) -- cgit v1.1