diff options
author | Robert Kukla <roolku@rockbox.org> | 2009-07-26 14:26:14 +0000 |
---|---|---|
committer | Robert Kukla <roolku@rockbox.org> | 2009-07-26 14:26:14 +0000 |
commit | 275a30092e84f9d026a18bcf90b2f29721302a33 (patch) | |
tree | 8c8c84673fbee68dd79d65a8269744c82669392a | |
parent | 682a991f0f5df93a4b32042d64d9a9ccb1d0dcdf (diff) | |
download | rockbox-275a30092e84f9d026a18bcf90b2f29721302a33.tar.gz rockbox-275a30092e84f9d026a18bcf90b2f29721302a33.zip |
initial commit of remote support for m:robe 100 courtesy of lowlight; simulator support including small fixes for the m:robe 500
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22053 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/keymaps/keymap-mr100.c | 10 | ||||
-rw-r--r-- | apps/plugins/stats.c | 1 | ||||
-rw-r--r-- | firmware/SOURCES | 1 | ||||
-rw-r--r-- | firmware/export/config-mrobe100.h | 24 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/backlight-mr100.c | 13 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/backlight-target.h | 5 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/button-mr100.c | 72 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/button-target.h | 30 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c | 562 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h | 40 | ||||
-rw-r--r-- | firmware/target/arm/olympus/mrobe-100/power-mr100.c | 5 | ||||
-rw-r--r-- | firmware/target/arm/system-pp502x.c | 6 | ||||
-rwxr-xr-x | tools/configure | 2 | ||||
-rw-r--r-- | uisimulator/common/README | 3 | ||||
-rw-r--r-- | uisimulator/sdl/UI-mrobe100.bmp | bin | 309558 -> 343782 bytes | |||
-rwxr-xr-x | uisimulator/sdl/UI-mrobe500.bmp | bin | 630054 -> 473254 bytes | |||
-rw-r--r-- | uisimulator/sdl/button.c | 28 | ||||
-rw-r--r-- | uisimulator/sdl/uisdl.h | 10 |
18 files changed, 777 insertions, 35 deletions
diff --git a/apps/keymaps/keymap-mr100.c b/apps/keymaps/keymap-mr100.c index 514d38b4e6..efbbca4d1b 100644 --- a/apps/keymaps/keymap-mr100.c +++ b/apps/keymaps/keymap-mr100.c | |||
@@ -275,12 +275,12 @@ static const struct button_mapping button_context_keyboard[] = { | |||
275 | static const struct button_mapping remote_button_context_standard[] = { | 275 | static const struct button_mapping remote_button_context_standard[] = { |
276 | { ACTION_STD_PREV, BUTTON_RC_PLAY, BUTTON_NONE }, | 276 | { ACTION_STD_PREV, BUTTON_RC_PLAY, BUTTON_NONE }, |
277 | { ACTION_STD_PREVREPEAT, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE }, | 277 | { ACTION_STD_PREVREPEAT, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE }, |
278 | { ACTION_STD_NEXT, BUTTON_RC_DISPLAY, BUTTON_NONE }, | 278 | { ACTION_STD_NEXT, BUTTON_RC_DOWN, BUTTON_NONE }, |
279 | { ACTION_STD_NEXTREPEAT, BUTTON_RC_DISPLAY|BUTTON_REPEAT,BUTTON_NONE }, | 279 | { ACTION_STD_NEXTREPEAT, BUTTON_RC_DOWN|BUTTON_REPEAT,BUTTON_NONE }, |
280 | { ACTION_STD_CANCEL, BUTTON_RC_REW, BUTTON_NONE }, | 280 | { ACTION_STD_CANCEL, BUTTON_RC_REW, BUTTON_NONE }, |
281 | { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF }, | 281 | { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF }, |
282 | { ACTION_STD_CONTEXT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF }, | 282 | { ACTION_STD_CONTEXT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF }, |
283 | { ACTION_STD_MENU, BUTTON_RC_FAV, BUTTON_NONE }, | 283 | { ACTION_STD_MENU, BUTTON_RC_HEART, BUTTON_NONE }, |
284 | 284 | ||
285 | LAST_ITEM_IN_LIST | 285 | LAST_ITEM_IN_LIST |
286 | }; | 286 | }; |
@@ -297,7 +297,7 @@ static const struct button_mapping remote_button_context_wps[] = { | |||
297 | { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT }, | 297 | { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT }, |
298 | 298 | ||
299 | { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, | 299 | { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, |
300 | { ACTION_WPS_MENU, BUTTON_RC_FAV, BUTTON_NONE }, | 300 | { ACTION_WPS_MENU, BUTTON_RC_HEART, BUTTON_NONE }, |
301 | 301 | ||
302 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, | 302 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, |
303 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | 303 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
@@ -340,7 +340,7 @@ static const struct button_mapping remote_button_context_usb_hid[] = { | |||
340 | { ACTION_USB_HID_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | 340 | { ACTION_USB_HID_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, |
341 | { ACTION_USB_HID_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, | 341 | { ACTION_USB_HID_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, |
342 | { ACTION_USB_HID_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | 342 | { ACTION_USB_HID_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
343 | { ACTION_USB_HID_MENU, BUTTON_RC_FAV, BUTTON_NONE }, | 343 | { ACTION_USB_HID_MENU, BUTTON_RC_HEART, BUTTON_NONE }, |
344 | 344 | ||
345 | LAST_ITEM_IN_LIST | 345 | LAST_ITEM_IN_LIST |
346 | }; /* remote_button_context_usb_hid */ | 346 | }; /* remote_button_context_usb_hid */ |
diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c index 976fd262f8..accb286369 100644 --- a/apps/plugins/stats.c +++ b/apps/plugins/stats.c | |||
@@ -75,6 +75,7 @@ static bool abort; | |||
75 | 75 | ||
76 | #elif CONFIG_KEYPAD == MROBE100_PAD | 76 | #elif CONFIG_KEYPAD == MROBE100_PAD |
77 | #define STATS_STOP BUTTON_POWER | 77 | #define STATS_STOP BUTTON_POWER |
78 | #define STATS_STOP_REMOTE BUTTON_RC_DOWN | ||
78 | 79 | ||
79 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | 80 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD |
80 | #define STATS_STOP BUTTON_REC | 81 | #define STATS_STOP BUTTON_REC |
diff --git a/firmware/SOURCES b/firmware/SOURCES index 3a6e49d0d2..46c1f58cb3 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES | |||
@@ -909,6 +909,7 @@ target/arm/tms320dm320/creative-zvm/usb-creativezvm.c | |||
909 | #ifndef SIMULATOR | 909 | #ifndef SIMULATOR |
910 | #ifndef BOOTLOADER | 910 | #ifndef BOOTLOADER |
911 | drivers/synaptics-mep.c | 911 | drivers/synaptics-mep.c |
912 | target/arm/olympus/mrobe-100/lcd-remote-mr100.c | ||
912 | #endif /* BOOTLOADER */ | 913 | #endif /* BOOTLOADER */ |
913 | drivers/sw_i2c.c | 914 | drivers/sw_i2c.c |
914 | target/arm/ata-as-arm.S | 915 | target/arm/ata-as-arm.S |
diff --git a/firmware/export/config-mrobe100.h b/firmware/export/config-mrobe100.h index b1299a820a..3fcef555d4 100644 --- a/firmware/export/config-mrobe100.h +++ b/firmware/export/config-mrobe100.h | |||
@@ -45,7 +45,24 @@ | |||
45 | 45 | ||
46 | /*#define IRAM_LCDFRAMEBUFFER IDATA_ATTR */ /* put the lcd frame buffer in IRAM */ | 46 | /*#define IRAM_LCDFRAMEBUFFER IDATA_ATTR */ /* put the lcd frame buffer in IRAM */ |
47 | 47 | ||
48 | #define CONFIG_KEYPAD MROBE100_PAD | 48 | #ifndef BOOTLOADER |
49 | /* Define this if you have an remote lcd */ | ||
50 | #define HAVE_REMOTE_LCD | ||
51 | |||
52 | #define LCD_REMOTE_WIDTH 79 | ||
53 | #define LCD_REMOTE_HEIGHT 16 | ||
54 | #define LCD_REMOTE_DEPTH 1 | ||
55 | #define LCD_REMOTE_PIXELFORMAT VERTICAL_PACKING | ||
56 | |||
57 | /* Remote display colours, for screenshots and sim (0xRRGGBB) */ | ||
58 | #define LCD_REMOTE_DARKCOLOR 0x000000 | ||
59 | #define LCD_REMOTE_BRIGHTCOLOR 0x5a915a | ||
60 | #define LCD_REMOTE_BL_DARKCOLOR 0x000000 | ||
61 | #define LCD_REMOTE_BL_BRIGHTCOLOR 0x82b4fa | ||
62 | #endif /* BOOTLOADER */ | ||
63 | |||
64 | #define CONFIG_KEYPAD MROBE100_PAD | ||
65 | #define CONFIG_REMOTE_KEYPAD MROBE_REMOTE | ||
49 | 66 | ||
50 | /* Define this if you do software codec */ | 67 | /* Define this if you do software codec */ |
51 | #define CONFIG_CODEC SWCODEC | 68 | #define CONFIG_CODEC SWCODEC |
@@ -90,6 +107,11 @@ | |||
90 | 107 | ||
91 | #define HAVE_BUTTONLIGHT_BRIGHTNESS | 108 | #define HAVE_BUTTONLIGHT_BRIGHTNESS |
92 | 109 | ||
110 | /* Remote LCD contrast range and defaults */ | ||
111 | #define MIN_REMOTE_CONTRAST_SETTING 0 | ||
112 | #define MAX_REMOTE_CONTRAST_SETTING 15 | ||
113 | #define DEFAULT_REMOTE_CONTRAST_SETTING 8 | ||
114 | |||
93 | /* Define this if your LCD can be enabled/disabled */ | 115 | /* Define this if your LCD can be enabled/disabled */ |
94 | /* TODO: #define HAVE_LCD_ENABLE */ | 116 | /* TODO: #define HAVE_LCD_ENABLE */ |
95 | 117 | ||
diff --git a/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c b/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c index f3891c5000..7dd80946cd 100644 --- a/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c +++ b/firmware/target/arm/olympus/mrobe-100/backlight-mr100.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "config.h" | 22 | #include "config.h" |
23 | #include "system.h" | 23 | #include "system.h" |
24 | #include "backlight-target.h" | 24 | #include "backlight-target.h" |
25 | #include "lcd-remote-target.h" | ||
25 | 26 | ||
26 | #define MIN_BRIGHTNESS 0x80ff08ff | 27 | #define MIN_BRIGHTNESS 0x80ff08ff |
27 | 28 | ||
@@ -62,3 +63,15 @@ void _buttonlight_off(void) | |||
62 | /* turn off all touchpad leds */ | 63 | /* turn off all touchpad leds */ |
63 | GPIOA_OUTPUT_VAL &= ~BUTTONLIGHT_ALL; | 64 | GPIOA_OUTPUT_VAL &= ~BUTTONLIGHT_ALL; |
64 | } | 65 | } |
66 | |||
67 | #ifdef HAVE_REMOTE_LCD | ||
68 | void _remote_backlight_on(void) | ||
69 | { | ||
70 | lcd_remote_backlight(true); | ||
71 | } | ||
72 | |||
73 | void _remote_backlight_off(void) | ||
74 | { | ||
75 | lcd_remote_backlight(false); | ||
76 | } | ||
77 | #endif | ||
diff --git a/firmware/target/arm/olympus/mrobe-100/backlight-target.h b/firmware/target/arm/olympus/mrobe-100/backlight-target.h index ca5c548eff..df25106d1a 100644 --- a/firmware/target/arm/olympus/mrobe-100/backlight-target.h +++ b/firmware/target/arm/olympus/mrobe-100/backlight-target.h | |||
@@ -26,6 +26,11 @@ bool _backlight_init(void); /* Returns backlight current state (true=ON). */ | |||
26 | void _backlight_hw_on(void); | 26 | void _backlight_hw_on(void); |
27 | void _backlight_hw_off(void); | 27 | void _backlight_hw_off(void); |
28 | 28 | ||
29 | #ifdef HAVE_REMOTE_LCD | ||
30 | void _remote_backlight_on(void); | ||
31 | void _remote_backlight_off(void); | ||
32 | #endif | ||
33 | |||
29 | #ifdef BOOTLOADER | 34 | #ifdef BOOTLOADER |
30 | #define _backlight_on() _backlight_hw_on() | 35 | #define _backlight_on() _backlight_hw_on() |
31 | #define _backlight_off() _backlight_hw_off() | 36 | #define _backlight_off() _backlight_hw_off() |
diff --git a/firmware/target/arm/olympus/mrobe-100/button-mr100.c b/firmware/target/arm/olympus/mrobe-100/button-mr100.c index d4479278ef..e7979a4174 100644 --- a/firmware/target/arm/olympus/mrobe-100/button-mr100.c +++ b/firmware/target/arm/olympus/mrobe-100/button-mr100.c | |||
@@ -25,6 +25,12 @@ | |||
25 | #include "backlight-target.h" | 25 | #include "backlight-target.h" |
26 | #include "synaptics-mep.h" | 26 | #include "synaptics-mep.h" |
27 | 27 | ||
28 | #ifdef HAVE_REMOTE_LCD | ||
29 | #include "lcd-remote-target.h" | ||
30 | static bool remote_hold = false; | ||
31 | static bool headphones_status = true; | ||
32 | #endif | ||
33 | |||
28 | #define LOGF_ENABLE | 34 | #define LOGF_ENABLE |
29 | #include "logf.h" | 35 | #include "logf.h" |
30 | 36 | ||
@@ -56,6 +62,13 @@ void button_init_device(void) | |||
56 | { | 62 | { |
57 | logf("touchpad not ready"); | 63 | logf("touchpad not ready"); |
58 | } | 64 | } |
65 | |||
66 | /* headphone detection bit */ | ||
67 | GPIOD_OUTPUT_EN &= ~0x80; | ||
68 | GPIOD_ENABLE |= 0x80; | ||
69 | |||
70 | /* remote detection (via headphone state) */ | ||
71 | headphones_int(); | ||
59 | } | 72 | } |
60 | 73 | ||
61 | /* | 74 | /* |
@@ -102,13 +115,35 @@ void button_init_device(void){} | |||
102 | */ | 115 | */ |
103 | int button_read_device(void) | 116 | int button_read_device(void) |
104 | { | 117 | { |
105 | int btn = int_btn; | 118 | int btn = BUTTON_NONE; |
106 | 119 | ||
107 | if(button_hold()) | 120 | #ifdef HAVE_REMOTE_LCD |
108 | return BUTTON_NONE; | 121 | unsigned char data[5]; |
109 | 122 | ||
110 | if (~GPIOA_INPUT_VAL & 0x40) | 123 | if (lcd_remote_read_device(data)) |
111 | btn |= BUTTON_POWER; | 124 | { |
125 | remote_hold = (data[2] & 0x80) ? true : false; | ||
126 | if (!remote_hold) | ||
127 | { | ||
128 | if (data[1] & 0x1) btn |= BUTTON_RC_PLAY; | ||
129 | if (data[1] & 0x2) btn |= BUTTON_RC_DOWN; | ||
130 | if (data[1] & 0x4) btn |= BUTTON_RC_FF; | ||
131 | if (data[1] & 0x8) btn |= BUTTON_RC_REW; | ||
132 | if (data[1] & 0x10) btn |= BUTTON_RC_VOL_UP; | ||
133 | if (data[1] & 0x20) btn |= BUTTON_RC_VOL_DOWN; | ||
134 | if (data[1] & 0x40) btn |= BUTTON_RC_MODE; | ||
135 | if (data[1] & 0x80) btn |= BUTTON_RC_HEART; | ||
136 | } | ||
137 | } | ||
138 | #endif | ||
139 | |||
140 | if(!button_hold()) | ||
141 | { | ||
142 | btn |= int_btn; | ||
143 | |||
144 | if (~GPIOA_INPUT_VAL & 0x40) | ||
145 | btn |= BUTTON_POWER; | ||
146 | } | ||
112 | 147 | ||
113 | return btn; | 148 | return btn; |
114 | } | 149 | } |
@@ -118,7 +153,32 @@ bool button_hold(void) | |||
118 | return (GPIOD_INPUT_VAL & 0x10) ? false : true; | 153 | return (GPIOD_INPUT_VAL & 0x10) ? false : true; |
119 | } | 154 | } |
120 | 155 | ||
156 | #ifdef HAVE_REMOTE_LCD | ||
157 | bool remote_button_hold(void) | ||
158 | { | ||
159 | return remote_hold; | ||
160 | } | ||
161 | |||
162 | bool headphones_inserted(void) | ||
163 | { | ||
164 | return headphones_status; | ||
165 | } | ||
166 | |||
167 | void headphones_int(void) | ||
168 | { | ||
169 | int state = 0x80 & ~GPIOD_INPUT_VAL; | ||
170 | headphones_status = (state) ? true : false; | ||
171 | |||
172 | GPIO_CLEAR_BITWISE(GPIOD_INT_EN, 0x80); | ||
173 | GPIO_WRITE_BITWISE(GPIOD_INT_LEV, state, 0x80); | ||
174 | GPIO_WRITE_BITWISE(GPIOD_INT_CLR, 0x80, 0x80); | ||
175 | GPIO_SET_BITWISE(GPIOD_INT_EN, 0x80); | ||
176 | |||
177 | lcd_remote_on(); | ||
178 | } | ||
179 | #else | ||
121 | bool headphones_inserted(void) | 180 | bool headphones_inserted(void) |
122 | { | 181 | { |
123 | return (GPIOD_INPUT_VAL & 0x80) ? false : true; | 182 | return (GPIOD_INPUT_VAL & 0x80) ? false : true; |
124 | } | 183 | } |
184 | #endif | ||
diff --git a/firmware/target/arm/olympus/mrobe-100/button-target.h b/firmware/target/arm/olympus/mrobe-100/button-target.h index 900211ebe4..93d42d62fb 100644 --- a/firmware/target/arm/olympus/mrobe-100/button-target.h +++ b/firmware/target/arm/olympus/mrobe-100/button-target.h | |||
@@ -29,22 +29,14 @@ | |||
29 | #define MEP_BUTTON_ID 0x09 | 29 | #define MEP_BUTTON_ID 0x09 |
30 | #define MEP_ABSOLUTE_HEADER 0x0b | 30 | #define MEP_ABSOLUTE_HEADER 0x0b |
31 | 31 | ||
32 | #define HAS_BUTTON_HOLD | ||
33 | |||
34 | bool button_hold(void); | 32 | bool button_hold(void); |
35 | void button_init_device(void); | 33 | void button_init_device(void); |
36 | int button_read_device(void); | 34 | int button_read_device(void); |
37 | 35 | ||
38 | #ifndef BOOTLOADER | 36 | #ifndef BOOTLOADER |
39 | void button_int(void); | 37 | void button_int(void); |
40 | #endif | 38 | #endif |
41 | 39 | ||
42 | #define POWEROFF_BUTTON BUTTON_POWER | ||
43 | #define POWEROFF_COUNT 10 | ||
44 | |||
45 | /* FIXME: Until the buttons are figured out, we use the button definitions | ||
46 | for the H10 keypad & remote. THESE ARE NOT CORRECT! */ | ||
47 | |||
48 | /* Main unit's buttons */ | 40 | /* Main unit's buttons */ |
49 | #define BUTTON_PLAY 0x00000001 | 41 | #define BUTTON_PLAY 0x00000001 |
50 | #define BUTTON_MENU 0x00000002 | 42 | #define BUTTON_MENU 0x00000002 |
@@ -61,18 +53,32 @@ void button_int(void); | |||
61 | |BUTTON_RIGHT|BUTTON_SELECT|BUTTON_UP|BUTTON_SLIDE_UP\ | 53 | |BUTTON_RIGHT|BUTTON_SELECT|BUTTON_UP|BUTTON_SLIDE_UP\ |
62 | |BUTTON_DOWN|BUTTON_SLIDE_DOWN|BUTTON_POWER) | 54 | |BUTTON_DOWN|BUTTON_SLIDE_DOWN|BUTTON_POWER) |
63 | 55 | ||
56 | #define HAS_BUTTON_HOLD | ||
57 | |||
58 | #define POWEROFF_BUTTON BUTTON_POWER | ||
59 | #define POWEROFF_COUNT 10 | ||
60 | |||
61 | #ifdef HAVE_REMOTE_LCD | ||
62 | void headphones_int(void); | ||
63 | bool remote_button_hold(void); | ||
64 | |||
64 | /* Remote control's buttons */ | 65 | /* Remote control's buttons */ |
65 | #define BUTTON_RC_PLAY 0x00010000 | 66 | #define BUTTON_RC_PLAY 0x00010000 |
66 | #define BUTTON_RC_REW 0x00020000 | 67 | #define BUTTON_RC_REW 0x00020000 |
67 | #define BUTTON_RC_FF 0x00040000 | 68 | #define BUTTON_RC_FF 0x00040000 |
68 | #define BUTTON_RC_DISPLAY 0x00080000 | 69 | #define BUTTON_RC_DOWN 0x00080000 |
69 | #define BUTTON_RC_FAV 0x00100000 | 70 | #define BUTTON_RC_HEART 0x00100000 |
70 | #define BUTTON_RC_MODE 0x00200000 | 71 | #define BUTTON_RC_MODE 0x00200000 |
71 | #define BUTTON_RC_VOL_UP 0x00400000 | 72 | #define BUTTON_RC_VOL_UP 0x00400000 |
72 | #define BUTTON_RC_VOL_DOWN 0x00800000 | 73 | #define BUTTON_RC_VOL_DOWN 0x00800000 |
73 | #define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_REW|BUTTON_RC_FF\ | 74 | #define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_REW|BUTTON_RC_FF\ |
74 | |BUTTON_RC_DISPLAY|BUTTON_RC_FAV|BUTTON_RC_MODE\ | 75 | |BUTTON_RC_DOWN|BUTTON_RC_HEART|BUTTON_RC_MODE\ |
75 | |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN) | 76 | |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN) |
77 | |||
78 | #define HAS_REMOTE_BUTTON_HOLD | ||
76 | #define RC_POWEROFF_BUTTON BUTTON_RC_PLAY | 79 | #define RC_POWEROFF_BUTTON BUTTON_RC_PLAY |
80 | #else | ||
81 | #define BUTTON_REMOTE 0 | ||
82 | #endif /* HAVE_REMOTE_LCD */ | ||
77 | 83 | ||
78 | #endif /* _BUTTON_TARGET_H_ */ | 84 | #endif /* _BUTTON_TARGET_H_ */ |
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c b/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c new file mode 100644 index 0000000000..036b6ae71c --- /dev/null +++ b/firmware/target/arm/olympus/mrobe-100/lcd-remote-mr100.c | |||
@@ -0,0 +1,562 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 Mark Arigo | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "cpu.h" | ||
23 | #include "kernel.h" | ||
24 | #include "thread.h" | ||
25 | #include "system.h" | ||
26 | #include "lcd-remote.h" | ||
27 | #include "button.h" | ||
28 | #include "button-target.h" | ||
29 | |||
30 | /* Temporary defines until we sort out why the gui stuff doesn't like this size | ||
31 | (I believe the status bar isn't doing sanity checks and is writing outside | ||
32 | the frame buffer size). */ | ||
33 | #define RC_WIDTH 79 | ||
34 | #define RC_HEIGHT 16 | ||
35 | |||
36 | #define RC_CONTRAST_MASK 0x000000ff | ||
37 | #define RC_SCREEN_ON 0x00000100 | ||
38 | #define RC_BACKLIGHT_ON 0x00000200 | ||
39 | |||
40 | #define RC_DEV_INIT 0x00001000 | ||
41 | #define RC_DETECTED 0x00002000 | ||
42 | #define RC_AWAKE 0x00004000 | ||
43 | #define RC_POWER_OFF 0x00008000 | ||
44 | |||
45 | #define RC_UPDATE_LCD 0x00010000 | ||
46 | #define RC_UPDATE_CONTROLLER 0x00020000 | ||
47 | #define RC_UPDATE_ICONS 0x00040000 | ||
48 | #define RC_UPDATE_MASK (RC_UPDATE_LCD|RC_UPDATE_CONTROLLER|RC_UPDATE_ICONS) | ||
49 | |||
50 | #define RC_TX_ERROR 0x00100000 | ||
51 | #define RC_RX_ERROR 0x00200000 | ||
52 | #define RC_TIMEOUT_ERROR 0x00400000 | ||
53 | #define RC_ERROR_MASK (RC_TX_ERROR|RC_RX_ERROR|RC_TIMEOUT_ERROR) | ||
54 | |||
55 | #define RC_FORCE_DETECT 0x80000000 | ||
56 | |||
57 | #define RX_READY 0x01 | ||
58 | #define TX_READY 0x20 | ||
59 | |||
60 | #define POLL_TIMEOUT 50000 | ||
61 | |||
62 | bool remote_initialized = false; | ||
63 | unsigned int rc_status = 0; | ||
64 | unsigned char rc_buf[5]; | ||
65 | |||
66 | /* ================================================== */ | ||
67 | /* Remote thread functions */ | ||
68 | /* These functions are private to the remote thread */ | ||
69 | /* ================================================== */ | ||
70 | static struct wakeup rc_thread_wakeup; | ||
71 | static unsigned int remote_thread_id; | ||
72 | static int remote_stack[256/sizeof(int)]; | ||
73 | static const char * const remote_thread_name = "remote"; | ||
74 | |||
75 | static bool remote_wait_ready(int ready_mask) | ||
76 | { | ||
77 | unsigned long current; | ||
78 | unsigned long start = USEC_TIMER; | ||
79 | unsigned long timeout = start + POLL_TIMEOUT; | ||
80 | |||
81 | rc_status &= ~RC_TIMEOUT_ERROR; | ||
82 | |||
83 | if (start <= timeout) | ||
84 | { | ||
85 | do | ||
86 | { | ||
87 | if (SER1_LSR & ready_mask) | ||
88 | return true; | ||
89 | |||
90 | //~ sleep(1); | ||
91 | |||
92 | current = USEC_TIMER; | ||
93 | } while (current < timeout); | ||
94 | } | ||
95 | else | ||
96 | { | ||
97 | do | ||
98 | { | ||
99 | if (SER1_LSR & ready_mask) | ||
100 | return true; | ||
101 | |||
102 | //~ sleep(1); | ||
103 | |||
104 | current = USEC_TIMER - POLL_TIMEOUT; | ||
105 | } while (current < start); | ||
106 | } | ||
107 | |||
108 | rc_status |= RC_TIMEOUT_ERROR; | ||
109 | return false; | ||
110 | } | ||
111 | |||
112 | static bool remote_rx(void) | ||
113 | { | ||
114 | int i; | ||
115 | unsigned char chksum[2]; | ||
116 | |||
117 | rc_status &= ~RC_RX_ERROR; | ||
118 | |||
119 | for (i = 0; i < 5; i++) | ||
120 | { | ||
121 | if (!remote_wait_ready(RX_READY)) | ||
122 | { | ||
123 | rc_status |= RC_RX_ERROR; | ||
124 | return false; | ||
125 | } | ||
126 | |||
127 | rc_buf[i] = SER1_RBR; | ||
128 | } | ||
129 | |||
130 | /* check opcode */ | ||
131 | if ((rc_buf[0] & 0xf0) != 0xf0) | ||
132 | { | ||
133 | rc_status |= RC_RX_ERROR; | ||
134 | return false; | ||
135 | } | ||
136 | |||
137 | /* verify the checksums */ | ||
138 | chksum[0] = chksum[1] = 0; | ||
139 | for (i = 0; i < 3; i++) | ||
140 | { | ||
141 | chksum[0] ^= rc_buf[i]; | ||
142 | chksum[1] += rc_buf[i]; | ||
143 | } | ||
144 | |||
145 | if ((chksum[0] != rc_buf[3]) && (chksum[1] != rc_buf[4])) | ||
146 | { | ||
147 | rc_status |= RC_RX_ERROR; | ||
148 | return false; | ||
149 | } | ||
150 | |||
151 | /* reception error */ | ||
152 | if ((rc_buf[0] & 0x1) || (rc_buf[0] & 0x2) || (rc_buf[0] & 0x4)) | ||
153 | { | ||
154 | rc_status |= RC_RX_ERROR; | ||
155 | return false; | ||
156 | } | ||
157 | |||
158 | return true; | ||
159 | } | ||
160 | |||
161 | static bool remote_tx(unsigned char *data, int len) | ||
162 | { | ||
163 | int i; | ||
164 | unsigned char chksum[2]; | ||
165 | |||
166 | rc_status &= ~RC_TX_ERROR; | ||
167 | |||
168 | chksum[0] = chksum[1] = 0; | ||
169 | |||
170 | for (i = 0; i < len; i++) | ||
171 | { | ||
172 | if (!remote_wait_ready(TX_READY)) | ||
173 | { | ||
174 | rc_status |= RC_TX_ERROR; | ||
175 | return false; | ||
176 | } | ||
177 | |||
178 | SER1_THR = data[i]; | ||
179 | chksum[0] ^= data[i]; | ||
180 | chksum[1] += data[i]; | ||
181 | } | ||
182 | |||
183 | for (i = 0; i < 2; i++) | ||
184 | { | ||
185 | if (!remote_wait_ready(TX_READY)) | ||
186 | { | ||
187 | rc_status |= RC_TX_ERROR; | ||
188 | return false; | ||
189 | } | ||
190 | |||
191 | SER1_THR = chksum[i]; | ||
192 | } | ||
193 | |||
194 | return remote_rx(); | ||
195 | } | ||
196 | |||
197 | static void remote_dev_enable(bool enable) | ||
198 | { | ||
199 | if (enable) | ||
200 | { | ||
201 | outl(inl(0x70000018) | 0xaa000, 0x70000018); | ||
202 | DEV_INIT2 &= ~0x800; | ||
203 | |||
204 | GPIO_CLEAR_BITWISE(GPIOL_OUTPUT_VAL, 0x80); | ||
205 | GPIO_SET_BITWISE(GPIOL_OUTPUT_EN, 0x80); | ||
206 | |||
207 | DEV_EN |= DEV_SER1; | ||
208 | |||
209 | SER1_RBR; | ||
210 | SER1_LCR = 0x80; | ||
211 | SER1_DLL = 0x50; | ||
212 | SER1_DLM = 0x00; | ||
213 | SER1_LCR = 0x03; | ||
214 | SER1_FCR = 0x07; | ||
215 | |||
216 | rc_status |= RC_DEV_INIT; | ||
217 | } | ||
218 | else | ||
219 | { | ||
220 | outl(inl(0x70000018) & ~0xaa000, 0x70000018); | ||
221 | DEV_INIT2 &= ~0x800; | ||
222 | |||
223 | GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL, 0x80); | ||
224 | GPIO_SET_BITWISE(GPIOL_OUTPUT_EN, 0x80); | ||
225 | |||
226 | DEV_RS |= DEV_SER1; | ||
227 | nop; | ||
228 | DEV_RS &= ~DEV_SER1; | ||
229 | |||
230 | DEV_EN &= ~DEV_SER1; | ||
231 | |||
232 | rc_status &= ~RC_DEV_INIT; | ||
233 | } | ||
234 | } | ||
235 | |||
236 | void remote_update_lcd(void) | ||
237 | { | ||
238 | int x, y, draw_now; | ||
239 | unsigned char data[RC_WIDTH + 7]; | ||
240 | |||
241 | /* If the draw_now bit is set, the draw occurs directly on the LCD. | ||
242 | Otherwise, the data is stored in an off-screen buffer and displayed | ||
243 | the next time a draw operation is executed with this flag set. */ | ||
244 | draw_now = 0; | ||
245 | |||
246 | for (y = 0; y < 2; y++) | ||
247 | { | ||
248 | data[0] = 0x51; | ||
249 | data[1] = draw_now << 7; | ||
250 | data[2] = RC_WIDTH; /* width */ | ||
251 | data[3] = 0; /* x1 */ | ||
252 | data[4] = y << 3; /* y1 */ | ||
253 | data[5] = RC_WIDTH; /* x2 */ | ||
254 | data[6] = (y + 1) << 3; /* y2 */ | ||
255 | |||
256 | for (x = 0; x < RC_WIDTH; x++) | ||
257 | data[x + 7] = lcd_remote_framebuffer[y][x]; | ||
258 | |||
259 | remote_tx(data, RC_WIDTH + 7); | ||
260 | |||
261 | draw_now = 1; | ||
262 | } | ||
263 | } | ||
264 | |||
265 | static void remote_update_controller(void) | ||
266 | { | ||
267 | unsigned char data[3]; | ||
268 | |||
269 | data[0] = 0x31; | ||
270 | data[1] = 0x00; | ||
271 | if (rc_status & RC_SCREEN_ON) | ||
272 | data[1] |= 0x80; | ||
273 | if (rc_status & RC_BACKLIGHT_ON) | ||
274 | data[1] |= 0x40; | ||
275 | data[2] = (unsigned char)(rc_status & RC_CONTRAST_MASK); | ||
276 | remote_tx(data, 3); | ||
277 | } | ||
278 | |||
279 | #if 0 | ||
280 | static void remote_update_icons(unsigned char symbols) | ||
281 | { | ||
282 | unsigned char data[2]; | ||
283 | |||
284 | if (!(rc_status & RC_AWAKE) && !(rc_status & RC_SCREEN_ON)) | ||
285 | return; | ||
286 | |||
287 | data[0] = 0x41; | ||
288 | data[1] = symbols; | ||
289 | remote_tx(data, 2); | ||
290 | } | ||
291 | #endif | ||
292 | |||
293 | static bool remote_nop(void) | ||
294 | { | ||
295 | unsigned char val[2]; | ||
296 | |||
297 | val[0] = 0x11; | ||
298 | val[1] = 0x30; | ||
299 | return remote_tx(val, 2); | ||
300 | } | ||
301 | |||
302 | static void remote_wake(void) | ||
303 | { | ||
304 | if (remote_nop()) | ||
305 | { | ||
306 | rc_status |= RC_AWAKE; | ||
307 | return; | ||
308 | } | ||
309 | |||
310 | rc_status &= ~RC_AWAKE; | ||
311 | return; | ||
312 | } | ||
313 | |||
314 | static void remote_sleep(void) | ||
315 | { | ||
316 | unsigned char data[2]; | ||
317 | |||
318 | if (rc_status & RC_AWAKE) | ||
319 | { | ||
320 | data[0] = 0x71; | ||
321 | data[1] = 0x30; | ||
322 | remote_tx(data, 2); | ||
323 | |||
324 | udelay(25000); | ||
325 | } | ||
326 | |||
327 | rc_status &= ~RC_AWAKE; | ||
328 | } | ||
329 | |||
330 | static void remote_off(void) | ||
331 | { | ||
332 | if (rc_status & RC_AWAKE) | ||
333 | remote_sleep(); | ||
334 | |||
335 | if (rc_status & RC_DEV_INIT) | ||
336 | remote_dev_enable(false); | ||
337 | |||
338 | rc_status &= ~(RC_DETECTED | RC_ERROR_MASK | RC_UPDATE_MASK); | ||
339 | remote_initialized = false; | ||
340 | } | ||
341 | |||
342 | static void remote_on(void) | ||
343 | { | ||
344 | if (!(rc_status & RC_DEV_INIT)) | ||
345 | remote_dev_enable(true); | ||
346 | |||
347 | remote_wake(); | ||
348 | |||
349 | if (rc_status & RC_AWAKE) | ||
350 | { | ||
351 | rc_status |= RC_DETECTED; | ||
352 | remote_initialized = true; | ||
353 | |||
354 | rc_status |= (RC_UPDATE_MASK | RC_SCREEN_ON | RC_BACKLIGHT_ON); | ||
355 | //~ remote_update_icons(0xf0); /* show battery */ | ||
356 | } | ||
357 | else | ||
358 | { | ||
359 | rc_status &= ~RC_DETECTED; | ||
360 | remote_initialized = false; | ||
361 | } | ||
362 | } | ||
363 | |||
364 | static void remote_thread(void) | ||
365 | { | ||
366 | int rc_thread_sleep_count = 10; | ||
367 | int rc_thread_wait_timeout = TIMEOUT_BLOCK; | ||
368 | |||
369 | while (1) | ||
370 | { | ||
371 | wakeup_wait(&rc_thread_wakeup, rc_thread_wait_timeout); | ||
372 | |||
373 | /* Error handling (most likely due to remote not present) */ | ||
374 | if (rc_status & RC_ERROR_MASK) | ||
375 | { | ||
376 | if (--rc_thread_sleep_count == 0) | ||
377 | rc_status |= RC_POWER_OFF; | ||
378 | } | ||
379 | |||
380 | /* Power-off (thread sleeps) */ | ||
381 | if (rc_status & RC_POWER_OFF) | ||
382 | { | ||
383 | remote_off(); | ||
384 | |||
385 | rc_thread_sleep_count = 10; | ||
386 | rc_thread_wait_timeout = TIMEOUT_BLOCK; | ||
387 | |||
388 | continue; | ||
389 | } | ||
390 | |||
391 | /* Detection */ | ||
392 | if (!(rc_status & RC_DETECTED)) | ||
393 | { | ||
394 | rc_thread_wait_timeout = HZ; | ||
395 | |||
396 | if (headphones_inserted()) | ||
397 | { | ||
398 | remote_on(); | ||
399 | |||
400 | if (rc_status & RC_AWAKE) | ||
401 | { | ||
402 | rc_thread_sleep_count = 10; | ||
403 | rc_thread_wait_timeout = HZ/20; /* ~50ms for updates */ | ||
404 | } | ||
405 | } | ||
406 | else | ||
407 | { | ||
408 | if (--rc_thread_sleep_count == 0) | ||
409 | rc_status &= ~RC_POWER_OFF; | ||
410 | } | ||
411 | |||
412 | continue; | ||
413 | } | ||
414 | |||
415 | /* Update the remote (one per wakeup cycle) */ | ||
416 | if (headphones_inserted() && (rc_status & RC_AWAKE)) | ||
417 | { | ||
418 | if (rc_status & RC_SCREEN_ON) | ||
419 | { | ||
420 | /* In order of importance */ | ||
421 | if (rc_status & RC_UPDATE_CONTROLLER) | ||
422 | { | ||
423 | remote_update_controller(); | ||
424 | rc_status &= ~RC_UPDATE_CONTROLLER; | ||
425 | } | ||
426 | else if (rc_status & RC_UPDATE_LCD) | ||
427 | { | ||
428 | remote_update_lcd(); | ||
429 | rc_status &= ~RC_UPDATE_LCD; | ||
430 | } | ||
431 | else | ||
432 | { | ||
433 | remote_nop(); | ||
434 | } | ||
435 | } | ||
436 | else | ||
437 | { | ||
438 | remote_nop(); | ||
439 | } | ||
440 | } | ||
441 | } | ||
442 | } | ||
443 | |||
444 | /* ============================================= */ | ||
445 | /* Public functions */ | ||
446 | /* These should only set the update flags that */ | ||
447 | /* will be executed in the remote thread. */ | ||
448 | /* ============================================= */ | ||
449 | bool lcd_remote_read_device(unsigned char *data) | ||
450 | { | ||
451 | if (!(rc_status & RC_AWAKE) || (rc_status & RC_ERROR_MASK)) | ||
452 | return false; | ||
453 | |||
454 | /* Return the most recent data. While the remote is plugged, | ||
455 | this is updated ~50ms */ | ||
456 | data[0] = rc_buf[0]; | ||
457 | data[1] = rc_buf[1]; | ||
458 | data[2] = rc_buf[2]; | ||
459 | data[3] = rc_buf[3]; | ||
460 | data[4] = rc_buf[4]; | ||
461 | |||
462 | return true; | ||
463 | } | ||
464 | |||
465 | void lcd_remote_set_invert_display(bool yesno) | ||
466 | { | ||
467 | /* dummy function...need to introduce HAVE_LCD_REMOTE_INVERT */ | ||
468 | (void)yesno; | ||
469 | } | ||
470 | |||
471 | /* turn the display upside down (call lcd_remote_update() afterwards) */ | ||
472 | void lcd_remote_set_flip(bool yesno) | ||
473 | { | ||
474 | /* dummy function...need to introduce HAVE_LCD_REMOTE_FLIP */ | ||
475 | (void)yesno; | ||
476 | } | ||
477 | |||
478 | int lcd_remote_default_contrast(void) | ||
479 | { | ||
480 | return DEFAULT_REMOTE_CONTRAST_SETTING; | ||
481 | } | ||
482 | |||
483 | void lcd_remote_set_contrast(int val) | ||
484 | { | ||
485 | rc_status = (rc_status & ~RC_CONTRAST_MASK) | (val & RC_CONTRAST_MASK); | ||
486 | rc_status |= RC_UPDATE_CONTROLLER; | ||
487 | } | ||
488 | |||
489 | void lcd_remote_backlight(bool on) | ||
490 | { | ||
491 | if (on) | ||
492 | rc_status |= RC_BACKLIGHT_ON; | ||
493 | else | ||
494 | rc_status &= ~RC_BACKLIGHT_ON; | ||
495 | |||
496 | rc_status |= RC_UPDATE_CONTROLLER; | ||
497 | } | ||
498 | |||
499 | void lcd_remote_off(void) | ||
500 | { | ||
501 | /* should only be used to power off at shutdown */ | ||
502 | rc_status |= RC_POWER_OFF; | ||
503 | wakeup_signal(&rc_thread_wakeup); | ||
504 | |||
505 | /* wait until the things are powered off */ | ||
506 | while (rc_status & RC_DEV_INIT) | ||
507 | sleep(HZ/10); | ||
508 | } | ||
509 | |||
510 | void lcd_remote_on(void) | ||
511 | { | ||
512 | /* Only wake the remote thread if it's in the blocked state. */ | ||
513 | struct thread_entry *rc_thread = thread_id_entry(remote_thread_id); | ||
514 | if (rc_thread->state == STATE_BLOCKED || (rc_status & RC_FORCE_DETECT)) | ||
515 | { | ||
516 | rc_status &= ~RC_FORCE_DETECT; | ||
517 | rc_status &= ~RC_POWER_OFF; | ||
518 | wakeup_signal(&rc_thread_wakeup); | ||
519 | } | ||
520 | } | ||
521 | |||
522 | bool remote_detect(void) | ||
523 | { | ||
524 | return (rc_status & RC_DETECTED); | ||
525 | } | ||
526 | |||
527 | void lcd_remote_init_device(void) | ||
528 | { | ||
529 | /* reset */ | ||
530 | remote_dev_enable(false); | ||
531 | rc_status |= RC_FORCE_DETECT; /* force detection at startup */ | ||
532 | |||
533 | /* unknown */ | ||
534 | GPIO_SET_BITWISE(GPIOL_ENABLE, 0x80); | ||
535 | GPIO_CLEAR_BITWISE(GPIOL_OUTPUT_VAL, 0x80); | ||
536 | GPIO_SET_BITWISE(GPIOL_OUTPUT_EN, 0x80); | ||
537 | |||
538 | /* a thread is required to poll & update the remote */ | ||
539 | wakeup_init(&rc_thread_wakeup); | ||
540 | remote_thread_id = create_thread(remote_thread, remote_stack, | ||
541 | sizeof(remote_stack), 0, remote_thread_name | ||
542 | IF_PRIO(, PRIORITY_SYSTEM) | ||
543 | IF_COP(, CPU)); | ||
544 | } | ||
545 | |||
546 | /* Update the display. | ||
547 | This must be called after all other LCD functions that change the display. */ | ||
548 | void lcd_remote_update(void) | ||
549 | { | ||
550 | rc_status |= RC_UPDATE_LCD; | ||
551 | } | ||
552 | |||
553 | /* Update a fraction of the display. */ | ||
554 | void lcd_remote_update_rect(int x, int y, int width, int height) | ||
555 | { | ||
556 | (void)x; | ||
557 | (void)y; | ||
558 | (void)width; | ||
559 | (void)height; | ||
560 | |||
561 | rc_status |= RC_UPDATE_LCD; | ||
562 | } | ||
diff --git a/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h b/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h new file mode 100644 index 0000000000..b5a501046a --- /dev/null +++ b/firmware/target/arm/olympus/mrobe-100/lcd-remote-target.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: lcd-remote-target.h 11967 2007-01-09 23:29:07Z linus $ | ||
9 | * | ||
10 | * Copyright (C) 2007 by Jens Arnold | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #ifndef LCD_REMOTE_TARGET_H | ||
22 | #define LCD_REMOTE_TARGET_H | ||
23 | |||
24 | bool remote_detect(void); /* returns detection status */ | ||
25 | |||
26 | void lcd_remote_set_invert_display(bool yesno); | ||
27 | void lcd_remote_set_flip(bool yesno); | ||
28 | void lcd_remote_backlight(bool on); | ||
29 | |||
30 | void lcd_remote_init_device(void); | ||
31 | void lcd_remote_on(void); | ||
32 | void lcd_remote_off(void); | ||
33 | void lcd_remote_update(void); | ||
34 | void lcd_remote_update_rect(int, int, int, int); | ||
35 | bool lcd_remote_read_device(unsigned char *data); | ||
36 | |||
37 | extern bool remote_initialized; | ||
38 | extern unsigned int rc_status; | ||
39 | extern unsigned char rc_buf[5]; | ||
40 | #endif | ||
diff --git a/firmware/target/arm/olympus/mrobe-100/power-mr100.c b/firmware/target/arm/olympus/mrobe-100/power-mr100.c index 25757f62c1..26dd4ef14f 100644 --- a/firmware/target/arm/olympus/mrobe-100/power-mr100.c +++ b/firmware/target/arm/olympus/mrobe-100/power-mr100.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "power.h" | 27 | #include "power.h" |
28 | #include "logf.h" | 28 | #include "logf.h" |
29 | #include "usb.h" | 29 | #include "usb.h" |
30 | #include "lcd-remote-target.h" | ||
30 | 31 | ||
31 | void power_init(void) | 32 | void power_init(void) |
32 | { | 33 | { |
@@ -57,6 +58,10 @@ bool ide_powered(void) | |||
57 | 58 | ||
58 | void power_off(void) | 59 | void power_off(void) |
59 | { | 60 | { |
61 | #ifdef HAVE_REMOTE_LCD | ||
62 | lcd_remote_off(); | ||
63 | #endif | ||
64 | |||
60 | /* Disable interrupts on this core */ | 65 | /* Disable interrupts on this core */ |
61 | disable_interrupt(IRQ_FIQ_STATUS); | 66 | disable_interrupt(IRQ_FIQ_STATUS); |
62 | 67 | ||
diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c index 967144ad0b..6ce45a12f3 100644 --- a/firmware/target/arm/system-pp502x.c +++ b/firmware/target/arm/system-pp502x.c | |||
@@ -29,6 +29,9 @@ | |||
29 | #include "button-target.h" | 29 | #include "button-target.h" |
30 | #include "usb-target.h" | 30 | #include "usb-target.h" |
31 | #include "usb_drv.h" | 31 | #include "usb_drv.h" |
32 | #ifdef HAVE_REMOTE_LCD | ||
33 | #include "lcd-remote-target.h" | ||
34 | #endif | ||
32 | 35 | ||
33 | #ifndef BOOTLOADER | 36 | #ifndef BOOTLOADER |
34 | extern void TIMER1(void); | 37 | extern void TIMER1(void); |
@@ -121,6 +124,9 @@ void __attribute__((interrupt("IRQ"))) irq_handler(void) | |||
121 | else if (CPU_HI_INT_STAT & GPIO0_MASK) { | 124 | else if (CPU_HI_INT_STAT & GPIO0_MASK) { |
122 | if (GPIOD_INT_STAT & 0x02) | 125 | if (GPIOD_INT_STAT & 0x02) |
123 | button_int(); | 126 | button_int(); |
127 | if (GPIOD_INT_STAT & 0x80) | ||
128 | headphones_int(); | ||
129 | |||
124 | } | 130 | } |
125 | else if (CPU_HI_INT_STAT & GPIO2_MASK) { | 131 | else if (CPU_HI_INT_STAT & GPIO2_MASK) { |
126 | if (GPIOL_INT_STAT & 0x04) | 132 | if (GPIOL_INT_STAT & 0x04) |
diff --git a/tools/configure b/tools/configure index 802173f1b6..946cbdac75 100755 --- a/tools/configure +++ b/tools/configure | |||
@@ -1569,6 +1569,8 @@ fi | |||
1569 | tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS" | 1569 | tool="$rootdir/tools/scramble -mi4v2 -model=m100 -type=RBOS" |
1570 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" | 1570 | bmp2rb_mono="$rootdir/tools/bmp2rb -f 0" |
1571 | bmp2rb_native="$rootdir/tools/bmp2rb -f 0" | 1571 | bmp2rb_native="$rootdir/tools/bmp2rb -f 0" |
1572 | bmp2rb_remotemono="$rootdir/tools/bmp2rb -f 0" | ||
1573 | bmp2rb_remotenative="$rootdir/tools/bmp2rb -f 0" | ||
1572 | output="rockbox.mi4" | 1574 | output="rockbox.mi4" |
1573 | appextra="recorder:gui" | 1575 | appextra="recorder:gui" |
1574 | plugins="yes" | 1576 | plugins="yes" |
diff --git a/uisimulator/common/README b/uisimulator/common/README index 6f920cf43e..3ee2b45f0e 100644 --- a/uisimulator/common/README +++ b/uisimulator/common/README | |||
@@ -8,6 +8,3 @@ | |||
8 | This directory is for code that is shared between all versions of the | 8 | This directory is for code that is shared between all versions of the |
9 | simulator, but is not needed for the target device. | 9 | simulator, but is not needed for the target device. |
10 | 10 | ||
11 | The first code is for the software mpeg audio decoder. The actual | ||
12 | mpeg decoding code is here and the O/S specific sound drivers should | ||
13 | be located in the x11 and win32 directories as appropriate. | ||
diff --git a/uisimulator/sdl/UI-mrobe100.bmp b/uisimulator/sdl/UI-mrobe100.bmp index 19e5e1f3d3..2a9df60cf1 100644 --- a/uisimulator/sdl/UI-mrobe100.bmp +++ b/uisimulator/sdl/UI-mrobe100.bmp | |||
Binary files differ | |||
diff --git a/uisimulator/sdl/UI-mrobe500.bmp b/uisimulator/sdl/UI-mrobe500.bmp index 6aebbee8fd..c7d0bec362 100755 --- a/uisimulator/sdl/UI-mrobe500.bmp +++ b/uisimulator/sdl/UI-mrobe500.bmp | |||
Binary files differ | |||
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c index 5f92b655d1..5987584420 100644 --- a/uisimulator/sdl/button.c +++ b/uisimulator/sdl/button.c | |||
@@ -760,6 +760,30 @@ void button_event(int key, bool pressed) | |||
760 | new_btn = BUTTON_POWER; | 760 | new_btn = BUTTON_POWER; |
761 | break; | 761 | break; |
762 | #elif CONFIG_KEYPAD == MROBE100_PAD | 762 | #elif CONFIG_KEYPAD == MROBE100_PAD |
763 | case SDLK_F9: | ||
764 | new_btn = BUTTON_RC_HEART; | ||
765 | break; | ||
766 | case SDLK_F10: | ||
767 | new_btn = BUTTON_RC_MODE; | ||
768 | break; | ||
769 | case SDLK_F11: | ||
770 | new_btn = BUTTON_RC_VOL_DOWN; | ||
771 | break; | ||
772 | case SDLK_F12: | ||
773 | new_btn = BUTTON_RC_VOL_UP; | ||
774 | break; | ||
775 | case SDLK_LEFT: | ||
776 | new_btn = BUTTON_RC_FF; | ||
777 | break; | ||
778 | case SDLK_RIGHT: | ||
779 | new_btn = BUTTON_RC_REW; | ||
780 | break; | ||
781 | case SDLK_UP: | ||
782 | new_btn = BUTTON_RC_PLAY; | ||
783 | break; | ||
784 | case SDLK_DOWN: | ||
785 | new_btn = BUTTON_RC_DOWN; | ||
786 | break; | ||
763 | case SDLK_KP1: | 787 | case SDLK_KP1: |
764 | new_btn = BUTTON_DISPLAY; | 788 | new_btn = BUTTON_DISPLAY; |
765 | break; | 789 | break; |
@@ -770,19 +794,15 @@ void button_event(int key, bool pressed) | |||
770 | new_btn = BUTTON_PLAY; | 794 | new_btn = BUTTON_PLAY; |
771 | break; | 795 | break; |
772 | case SDLK_KP4: | 796 | case SDLK_KP4: |
773 | case SDLK_LEFT: | ||
774 | new_btn = BUTTON_LEFT; | 797 | new_btn = BUTTON_LEFT; |
775 | break; | 798 | break; |
776 | case SDLK_KP6: | 799 | case SDLK_KP6: |
777 | case SDLK_RIGHT: | ||
778 | new_btn = BUTTON_RIGHT; | 800 | new_btn = BUTTON_RIGHT; |
779 | break; | 801 | break; |
780 | case SDLK_KP8: | 802 | case SDLK_KP8: |
781 | case SDLK_UP: | ||
782 | new_btn = BUTTON_UP; | 803 | new_btn = BUTTON_UP; |
783 | break; | 804 | break; |
784 | case SDLK_KP2: | 805 | case SDLK_KP2: |
785 | case SDLK_DOWN: | ||
786 | new_btn = BUTTON_DOWN; | 806 | new_btn = BUTTON_DOWN; |
787 | break; | 807 | break; |
788 | case SDLK_KP5: | 808 | case SDLK_KP5: |
diff --git a/uisimulator/sdl/uisdl.h b/uisimulator/sdl/uisdl.h index 0fe0463b60..1543dcec37 100644 --- a/uisimulator/sdl/uisdl.h +++ b/uisimulator/sdl/uisdl.h | |||
@@ -163,14 +163,14 @@ | |||
163 | #define UI_LCD_POSY 90 /* y position of lcd */ | 163 | #define UI_LCD_POSY 90 /* y position of lcd */ |
164 | 164 | ||
165 | #elif defined(MROBE_500) | 165 | #elif defined(MROBE_500) |
166 | #if LCD_WIDHT==320 | 166 | #if LCD_WIDTH==320 |
167 | #define UI_TITLE "Olympus M:Robe 500" | 167 | #define UI_TITLE "Olympus M:Robe 500" |
168 | #define UI_WIDTH 450 /* width of GUI window */ | 168 | #define UI_WIDTH 450 /* width of GUI window */ |
169 | #define UI_HEIGHT 350 /* height of GUI window */ | 169 | #define UI_HEIGHT 350 /* height of GUI window */ |
170 | #define UI_LCD_POSX 65 /* x position of lcd */ | 170 | #define UI_LCD_POSX 65 /* x position of lcd */ |
171 | #define UI_LCD_POSY 30 /* y position of lcd */ | 171 | #define UI_LCD_POSY 30 /* y position of lcd */ |
172 | #define UI_REMOTE_POSX 50 /* x position of remote lcd */ | 172 | #define UI_REMOTE_POSX 36 /* x position of remote lcd */ |
173 | #define UI_REMOTE_POSY 325 /* y position of remote lcd */ | 173 | #define UI_REMOTE_POSY 318 /* y position of remote lcd */ |
174 | #else | 174 | #else |
175 | #define UI_TITLE "Olympus M:Robe 500" | 175 | #define UI_TITLE "Olympus M:Robe 500" |
176 | #define UI_WIDTH 900 /* width of GUI window */ | 176 | #define UI_WIDTH 900 /* width of GUI window */ |
@@ -235,9 +235,11 @@ | |||
235 | #elif defined(MROBE_100) | 235 | #elif defined(MROBE_100) |
236 | #define UI_TITLE "Olympus M:Robe 100" | 236 | #define UI_TITLE "Olympus M:Robe 100" |
237 | #define UI_WIDTH 247 /* width of GUI window */ | 237 | #define UI_WIDTH 247 /* width of GUI window */ |
238 | #define UI_HEIGHT 416 /* height of GUI window */ | 238 | #define UI_HEIGHT 462 /* height of GUI window */ |
239 | #define UI_LCD_POSX 43 /* x position of lcd */ | 239 | #define UI_LCD_POSX 43 /* x position of lcd */ |
240 | #define UI_LCD_POSY 25 /* y position of lcd */ | 240 | #define UI_LCD_POSY 25 /* y position of lcd */ |
241 | #define UI_REMOTE_POSX 34 /* x position of remote lcd */ | ||
242 | #define UI_REMOTE_POSY 432 /* y position of remote lcd */ | ||
241 | 243 | ||
242 | #elif defined(COWON_D2) | 244 | #elif defined(COWON_D2) |
243 | #define UI_TITLE "Cowon D2" | 245 | #define UI_TITLE "Cowon D2" |