On 07-Jun-2000 [EMAIL PROTECTED] wrote:

> From Palm docs, the Palm Pro, III, ... connect the GP2 pin to the 
> Dragonball UART GPIO pin (pin 32) whereas the IIIc with the DragonballEZ 
> connects the GP2 pin to CSA1 (pin 56).

Page 7-18 of the MC68328 manual shows the Port M bits (GPIO is bit 7).  Page
7-12 of the MC68EZ328 manual shows the Port F bits (CSA1 is bit 7).

#define SET_BIT(x,b)     x|=b
#define CLEAR_BIT(x,b)   x&=~b
#define READ_BIT(x,b)    (x&b)
#define GPIO_LINE        0x80
#define EZ_CPA1_LINE     0x80

/* from the memory map */
Byte *PMDATA = (Byte *) 0xFFFFF449;
Byte *PFDATA = (Byte *) 0xFFFFF429;

/* for non-EZ */
if (READ_BIT(*PMDATA, GPIO_LINE)) {
        /* GPIO is on */
}

/* for EZ */
if (READ_BIT(*PFDATA, EZ_CPA1_LINE)) {
        /* CPA1 is on */
}

I think the above is correct.  Haven't tried it.  Not sure if the direction
needs to be set to read CPIO or CPA1, probably not.


> Speaking of which, does anyone know a solid way to determine if the
> processor is a Dragonball or Dragonball EZ? At worst I will have the user
> enter the hardware type, but if this can be avoided, great.

Here's what I use.  Probably expensive so store the result in a global rather
than calling it each time.

#ifndef sysFtrNumProcessorID
#define sysFtrNumProcessorID 2
#endif
#ifndef sysFtrNumProcessorMask
#define sysFtrNumProcessorMask 0xFFFF0000
#endif
#ifndef sysFtrNumProcessor328
#define sysFtrNumProcessor328 0x00010000
#endif
#ifndef sysFtrNumProcessorEZ
#define sysFtrNumProcessorEZ 0x00020000
#endif

static Word Which_Processor(void)
{
    DWord id, chip;
    Word which;

    /* Determine which processor */
    if (!FtrGet(sysFtrCreator, sysFtrNumProcessorID, &id)) {
        chip = id & sysFtrNumProcessorMask;
        if (chip==sysFtrNumProcessor328) which = 0;
        else if (chip==sysFtrNumProcessorEZ) which = 1;
        else which = 0;
    } else which = 0; /* feature is only in >= OS3.1 so it must be earlier */

    return which;
}


/* Chris Faherty <[EMAIL PROTECTED]>                 */
/* Your Stock has crashed - you must now restart your system */


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to