1
0
Fork 0
forked from len0rd/rockbox

More VX767 work...

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18489 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2008-09-10 22:02:36 +00:00
parent 37a384c541
commit 2b64418a17
3 changed files with 41 additions and 15 deletions

View file

@ -24,26 +24,35 @@
#include "jz4740.h" #include "jz4740.h"
#include "button-target.h" #include "button-target.h"
#define BTN_VOL_DOWN (1 << 27) #define BTN_VOL_DOWN ((1 << 27) | (1 << 21) | (1 << 30))
#define BTN_VOL_UP (1 << 0) #define BTN_VOL_UP (1 << 0)
#define BTN_MENU (1 << 1) #define BTN_MENU (1 << 3)
#define BTN_OFF (1 << 29) #define BTN_BACK (1 << 4)
#define BTN_HOLD (1 << 16) #define BTN_SELECT (1 << 29)
#define BTN_MASK (BTN_VOL_DOWN | BTN_VOL_UP \ #define BTN_REWIND (1 << 1)
| BTN_MENU | BTN_OFF ) #define BTN_FAST_FWD (1 << 2)
#define BTN_HOLD (1 << 31) /* Unknown currently */
#define BTN_MASK (BTN_VOL_DOWN | BTN_VOL_UP | BTN_MENU \
| BTN_BACK | BTN_SELECT | BTN_REWIND \
| BTN_FAST_FWD)
bool button_hold(void) bool button_hold(void)
{ {
return (~REG_GPIO_PXPIN(3) & BTN_HOLD ? 1 : 0); return (~__gpio_get_port(3) & BTN_HOLD ? 1 : 0);
} }
void button_init_device(void) void button_init_device(void)
{ {
__gpio_port_as_input(3, 29); __gpio_port_as_input(3, 30);
__gpio_port_as_input(3, 21);
__gpio_port_as_input(3, 27); __gpio_port_as_input(3, 27);
__gpio_port_as_input(3, 16);
__gpio_port_as_input(3, 1);
__gpio_port_as_input(3, 0); __gpio_port_as_input(3, 0);
__gpio_port_as_input(3, 3);
__gpio_port_as_input(3, 4);
__gpio_port_as_input(3, 29);
__gpio_port_as_input(3, 1);
__gpio_port_as_input(3, 2);
/* __gpio_port_as_input(3, 31); */
} }
int button_read_device(void) int button_read_device(void)
@ -60,10 +69,16 @@ int button_read_device(void)
ret |= BUTTON_VOL_DOWN; ret |= BUTTON_VOL_DOWN;
if(key & BTN_VOL_UP) if(key & BTN_VOL_UP)
ret |= BUTTON_VOL_UP; ret |= BUTTON_VOL_UP;
if(key & BTN_SELECT)
ret |= BUTTON_SELECT;
if(key & BTN_MENU) if(key & BTN_MENU)
ret |= BUTTON_MENU; ret |= BUTTON_MENU;
if(key & BTN_OFF) if(key & BTN_BACK)
ret |= BUTTON_POWER; ret |= BUTTON_BACK;
if(key & BTN_REWIND)
ret |= BUTTON_REWIND;
if(key & BTN_FAST_FWD)
ret |= BUTTON_FAST_FWD;
} }
return ret; return ret;

View file

@ -31,10 +31,13 @@ void button_init_device(void);
int button_read_device(void); int button_read_device(void);
/* Main unit's buttons */ /* Main unit's buttons */
#define BUTTON_POWER 0x00000001 #define BUTTON_SELECT 0x00000001
#define BUTTON_VOL_UP 0x00000002 #define BUTTON_VOL_UP 0x00000002
#define BUTTON_VOL_DOWN 0x00000004 #define BUTTON_VOL_DOWN 0x00000004
#define BUTTON_MENU 0x00000008 #define BUTTON_MENU 0x00000008
#define BUTTON_BACK 0x00000010
#define BUTTON_REWIND 0x00000020
#define BUTTON_FAST_FWD 0x00000040
/* Compatibility hacks for flipping. Needs a somewhat better fix. */ /* Compatibility hacks for flipping. Needs a somewhat better fix. */
#define BUTTON_LEFT 0 #define BUTTON_LEFT 0
@ -42,13 +45,16 @@ int button_read_device(void);
#define BUTTON_UP 0 #define BUTTON_UP 0
#define BUTTON_DOWN 0 #define BUTTON_DOWN 0
#define BUTTON_MAIN (BUTTON_POWER | BUTTON_VOL_UP | BUTTON_VOL_DOWN | BUTTON_MENU) #define BUTTON_MAIN (BUTTON_SELECT | BUTTON_VOL_UP | BUTTON_VOL_DOWN | BUTTON_MENU \
BUTTON_MENU | BUTTON_BACK | BUTTON_REWIND | BUTTON_FAST_FWD)
/* No remote */ /* No remote */
#define BUTTON_REMOTE 0 #define BUTTON_REMOTE 0
#define BUTTON_POWER 0 /* HACK */
/* Software power-off */ /* Software power-off */
#define POWEROFF_BUTTON BUTTON_POWER #define POWEROFF_BUTTON BUTTON_SELECT /* TODO */
#define POWEROFF_COUNT 10 #define POWEROFF_COUNT 10
#endif /* BUTTON_TARGET_H */ #endif /* BUTTON_TARGET_H */

View file

@ -192,6 +192,11 @@ void lcd_set_target(short x, short y, short width, short height)
SLCD_SEND_COMMAND(0x52, x); SLCD_SEND_COMMAND(0x52, x);
SLCD_SEND_COMMAND(0x53, x+width-1); SLCD_SEND_COMMAND(0x53, x+width-1);
/* TODO */ /* TODO */
__gpio_clear_pin(PIN_UNK_N);
SLCD_SET_COMMAND(0x22);
WAIT_ON_SLCD;
__gpio_set_pin(PIN_UNK_N);
} }
void lcd_on(void) void lcd_on(void)