Rockbox Development > New Ports

Sandisk C100 series

<< < (6/10) > >>

MarcGuay:
Alrighty, I've got "things" displaying on the LCD, but I can't figure out two of the GPIO inits, so it's basically a bunch of moving garbage.  The difficulty is in translating these lines of asm, which define GPIOD and GPIOD_FUNC, respectively:


--- Code: ---ADD     R2, R0, #0x338          ; R2 = 0x80000338 = GPIOD_FUNC
LDR     R3, [R2]                      ; R3 = current val of GPIOD_FUNC
ORR     R3, R3, #2                 ; R3 = or
STR     R3, [R2]                      ;  Store R3 in GPIOD_FUNC
--- End code ---

--- Code: ---ADD     R1, R0, #0x330      ; R1 = GPIOD Data Register
LDR     R3, [R1] ;                ; R3 = current val of GPIOD
ORR     R3, R3, #0xC0        ; R3 = or
STR     R3, [R1]                   ;  Store R3 in GPIOD
--- End code ---

The notes are just me trying to figure out what's going on.  Am I right to think that the second line is using the current value of GPIO_D as part of the calculation? 

This is what I have so far for the gpio_init function, it shares a lot with the LogikDAX:

--- Code: ---    GPIOA_FUNC = 0;
    GPIOB_FUNC = 0x16A3;
    GPIOC_FUNC = 1;
    GPIOD_FUNC = 2; /* ? */
    GPIOE_FUNC = 0;

    GPIOA_DIR = 0xFFFF0E00;   /* 0 - 0xF200 */
    GPIOB_DIR = 0x6FFFF;
    GPIOC_DIR = 0x03FFFFFF;
    GPIOD_DIR = 0x3F7;
    GPIOE_DIR = 0x9B;
   
    GPIOA = 0x1080;
    GPIOB = 0;
    GPIOC = 0;
    GPIOD = 0xc0; /* ? */
    GPIOE = 0x9B;
--- End code ---

lowlight:

--- Quote from: MarcGuay on June 12, 2008, 12:00:12 PM ---

--- Code: ---ADD     R2, R0, #0x338          ; R2 = 0x80000338 = GPIOD_FUNC
LDR     R3, [R2]                      ; R3 = current val of GPIOD_FUNC
ORR     R3, R3, #2                 ; R3 = or
STR     R3, [R2]                      ;  Store R3 in GPIOD_FUNC
--- End code ---


--- Code: ---ADD     R1, R0, #0x330      ; R1 = GPIOD Data Register
LDR     R3, [R1] ;                ; R3 = current val of GPIOD
ORR     R3, R3, #0xC0        ; R3 = or
STR     R3, [R1]                   ;  Store R3 in GPIOD
--- End code ---


--- End quote ---

That's

GPIOD_FUNC |= 2

and

GPIOD |= 0xc0

MarcGuay:
Thanks lowlight, makes perfect sense.  I guess the fact that this is the initialization of the GPIOs made me wonder what the current value could be besides zero...?  Unfortunately, the display outputs the same nonsense using these values.  Time to look over lcd_update_rect()...

linuxstb:
Comparing your inits with the OF, I see one mistake - GPIOA should be set to 0x80, not 0x1080.  Everything else looks right though (with lowlight's changes).

Have you managed to work out which pin (if any) is the backlight control?

MarcGuay:
Thanks for pointing out the error, I caught it myself shortly after posting, and recompiling provides the same results.

As for the backlight pin, I went hunting through the gpio_init bit-by-bit and came up with the following:

Setting GPIOB_FUNC to 0x14A3, 0x16A1 or 0x16A2 = No display, while 0x1683 = backlight on but nothing displayed.  I just realized that in order to get the build to compile I set the LCD_DEPTH to 1 in the c100 config file, figuring it would be fine for debugging purposes, but perhaps it's naive/stupid to think it wouldn't have a larger effect? 

Up:  I've got it compiling as a colour target with the same results, except now it's junk in brilliant 16-bit colour!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version