summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320/creative-zvm
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-05-03 14:43:43 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-05-03 14:43:43 +0000
commited5f1ed3e21e44cf052834c7d6fd70abfd1a6196 (patch)
tree2a7ea36bf7739227091878407c1484f2a1a3cb5a /firmware/target/arm/tms320dm320/creative-zvm
parent5fc59065032fda288e5f64405492ba8a949819f1 (diff)
downloadrockbox-ed5f1ed3e21e44cf052834c7d6fd70abfd1a6196.tar.gz
rockbox-ed5f1ed3e21e44cf052834c7d6fd70abfd1a6196.zip
1) add debug menu for USB & PIC
2) update keymap 3) fix yellow git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17324 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/tms320dm320/creative-zvm')
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c81
-rw-r--r--firmware/target/arm/tms320dm320/creative-zvm/usb-target.h1
2 files changed, 58 insertions, 24 deletions
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c
index 09d3cf7c67..334ef25683 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c
+++ b/firmware/target/arm/tms320dm320/creative-zvm/pic-creativezvm.c
@@ -25,7 +25,6 @@
25#include "button-target.h" 25#include "button-target.h"
26#include "i2c-dm320.h" 26#include "i2c-dm320.h"
27 27
28
29#include "lcd-target.h" 28#include "lcd-target.h"
30#include "lcd.h" 29#include "lcd.h"
31#include "sprintf.h" 30#include "sprintf.h"
@@ -46,8 +45,10 @@
46#define BTN_REL 1 45#define BTN_REL 1
47 46
48#define BTN_TOUCHPAD_PRESS 0x1F00 47#define BTN_TOUCHPAD_PRESS 0x1F00
48#define BTN_TOUCHPAD_SCROLL_DOWN 0x0F03
49#define BTN_TOUCHPAD_CORNER_DOWN 0xAF00 49#define BTN_TOUCHPAD_CORNER_DOWN 0xAF00
50#define BTN_TOUCHPAD_CORNER_UP 0x3F00 50#define BTN_TOUCHPAD_CORNER_UP 0x3F00
51#define BTN_TOUCHPAD_SCROLL_UP 0x0F04
51 52
52#define HEADPHONE_PLUGIN_A 0x5707 53#define HEADPHONE_PLUGIN_A 0x5707
53#define HEADPHONE_PLUGIN_B 0x5F07 54#define HEADPHONE_PLUGIN_B 0x5F07
@@ -176,6 +177,9 @@ static bool sw = false;
176 177
177void GIO0(void) 178void GIO0(void)
178{ 179{
180 /* Mask GIO0 interrupt */
181 IO_INTC_IRQ1 = INTR_IRQ1_EXT0;
182
179 unsigned char msg[4]; 183 unsigned char msg[4];
180 i2c_read(PIC_ADR, msg, sizeof(msg)); 184 i2c_read(PIC_ADR, msg, sizeof(msg));
181 tick_diff = current_tick - last_tick; 185 tick_diff = current_tick - last_tick;
@@ -200,6 +204,12 @@ void GIO0(void)
200 map_button(BTN_TOUCHPAD_PRESS, BUTTON_SELECT); 204 map_button(BTN_TOUCHPAD_PRESS, BUTTON_SELECT);
201 map_button(BTN_TOUCHPAD_CORNER_DOWN, BUTTON_DOWN); 205 map_button(BTN_TOUCHPAD_CORNER_DOWN, BUTTON_DOWN);
202 map_button(BTN_TOUCHPAD_CORNER_UP, BUTTON_UP); 206 map_button(BTN_TOUCHPAD_CORNER_UP, BUTTON_UP);
207 case BTN_TOUCHPAD_SCROLL_DOWN:
208 btn = BUTTON_DOWN;
209 break;
210 case BTN_TOUCHPAD_SCROLL_UP:
211 btn = BUTTON_UP;
212 break;
203 case BTN_HOLD: 213 case BTN_HOLD:
204 hold_switch = true; 214 hold_switch = true;
205 break; 215 break;
@@ -252,8 +262,6 @@ void GIO0(void)
252 lcd_update(); 262 lcd_update();
253 sw = !sw; 263 sw = !sw;
254#endif 264#endif
255 /* Mask GIO0 interrupt */
256 IO_INTC_IRQ1 = INTR_IRQ1_EXT0;
257} 265}
258 266
259void send_command_to_pic(unsigned char in, unsigned char* out, 267void send_command_to_pic(unsigned char in, unsigned char* out,
@@ -292,8 +300,7 @@ void button_init_device(void)
292 it? */ 300 it? */
293 /* Enable GIO0 interrupt */ 301 /* Enable GIO0 interrupt */
294 IO_INTC_EINT1 |= INTR_EINT1_EXT0; 302 IO_INTC_EINT1 |= INTR_EINT1_EXT0;
295 btn = nonbtn = pic_init_value = pic_init2_value = last_btn = hold_switch = 303 btn=nonbtn=pic_init_value=pic_init2_value=last_btn=hold_switch=0;
296 0;
297 /* Initialize PIC */ 304 /* Initialize PIC */
298 send_command_to_pic(1, (unsigned char *)&pic_init_value, 305 send_command_to_pic(1, (unsigned char *)&pic_init_value,
299 sizeof(pic_init_value)); 306 sizeof(pic_init_value));
@@ -301,27 +308,12 @@ void button_init_device(void)
301 sizeof(pic_init2_value)); 308 sizeof(pic_init2_value));
302} 309}
303 310
304int get_debug_info(int choice)
305{
306 switch(choice)
307 {
308 case 1:
309 return pic_init_value;
310 case 2:
311 return pic_init2_value;
312 case 3:
313 return last_btn;
314 case 4:
315 return nonbtn;
316 case 5:
317 return tick_diff;
318 }
319 return -1;
320}
321
322int button_read_device(void) 311int button_read_device(void)
323{ 312{
324 return btn; 313 if(hold_switch)
314 return 0;
315 else
316 return btn;
325} 317}
326 318
327bool button_hold(void) 319bool button_hold(void)
@@ -333,3 +325,44 @@ bool button_usb_connected(void)
333{ 325{
334 return (bool)(nonbtn & NONBUTTON_USB); 326 return (bool)(nonbtn & NONBUTTON_USB);
335} 327}
328
329int pic_dbg_num_items(void)
330{
331 return 13;
332}
333
334char* pic_dbg_item(int selected_item, void *data, char *buffer, size_t buffer_len)
335{
336 (void)data;
337 switch(selected_item)
338 {
339 case 0:
340 snprintf(buffer, buffer_len, "Init value 1: 0x%04x", pic_init_value);
341 return buffer;
342 case 1:
343 snprintf(buffer, buffer_len, "Init value 2: 0x%04x", pic_init2_value);
344 return buffer;
345 case 2:
346 snprintf(buffer, buffer_len, "Last button value: 0x%04x Raw value: 0x%04x", last_btn, btn);
347 return buffer;
348 case 3:
349 snprintf(buffer, buffer_len, "Last button differs in ticks: 0x%04x", tick_diff);
350 return buffer;
351 case 4:
352 snprintf(buffer, buffer_len, "Dock values: 0x%04x", nonbtn);
353 return buffer;
354 #define B(n,w,b) case n: \
355 snprintf(buffer, buffer_len, "%s: 0x%04x", w, b); \
356 return buffer;
357 B(5, "MASK_TV_OUT", MASK_TV_OUT(pic_init_value));
358 B(6, "MASK_xx1", MASK_xx1(pic_init_value));
359 B(7, "MASK_xx2", MASK_xx2(pic_init_value));
360 B(8, "MASK_xx3", MASK_xx3(pic_init_value));
361 B(9, "MASK_xx4", MASK_xx4(pic_init_value));
362 B(10, "MASK_xx5", MASK_xx5(pic_init_value));
363 B(11, "MASK_xx6", MASK_xx6(pic_init_value));
364 B(12, "MASK_xx7", MASK_xx7(pic_init_value));
365 #undef B
366 }
367 return NULL;
368}
diff --git a/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h b/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h
index 4e3303911c..14ddc6eb0a 100644
--- a/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h
+++ b/firmware/target/arm/tms320dm320/creative-zvm/usb-target.h
@@ -22,6 +22,7 @@
22 22
23#include "dm320.h" 23#include "dm320.h"
24 24
25/* General purpose memory region #2 */
25#define ISP1583_IOBASE 0x60FFC000 26#define ISP1583_IOBASE 0x60FFC000
26#define ISP1583_H_OVERRIDE 27#define ISP1583_H_OVERRIDE
27 28