Re: Use serial Port in a special way

2002-07-10 Thread GB

I don't see why not.  You'd need to get a hardware manual for the
microprocessor and deal with the data-direction register for the
port, etc.  Obviously you would have to disable the UART's
control of the port.  Now whether the PalmOS will be happy
with this is anyone's guess.  And you'd have portability issues,
etc. etc.

The other alternative is to create an external RS-232 to I2C
device and run it from the UART.  This is fairly easy to do in
a small 8-bit micro (which could be extremely tiny).  I have
gone this route before, but not for the Palm.

GB

"Christophe Gouwy" <[EMAIL PROTECTED]> wrote in message
news:90694@palm-dev-forum...
>
> Hello
>
> I would like to know if someone has got information about the serial port
> of PAlm
>
> Moreover, i would like to know if it is possible to command individualy
the
> signals of the serial port (like on a PC: with RX,TX...)
>
> Because I would like to plug a I2C system to my palm, so I have to create
a
> special protocol on the serial port of the palm.
>
> Thank you for your help.
>
>
>
>
>
>
>



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



RE: Use serial Port in a special way

2002-07-10 Thread Dominique Martel

I'm working with the serial port. Here is what I did, may be there are
better ideas, but it works.


To open the serial port, I use the following functions:

SysLibFind (const Char* nameP, UInt16* refNumP); //Open library for serial
port, where
//nameP = "Serial Library"

SerOpen(UInt16 refNum, UInt16 port, UInt32 baud); //Open serial port

SerSetReceiveBuffer (UInt16 refNum, void *bufP, UInt16 bufSize); //Prepare
buffer that
//receives datas on queue

SerReceiveFlush (UInt16 refNum, Int32 timeout); //Flush datas on queues



Then, to read on the serial port:

SerReceiveCheck (UInt16 refNum, UInt32 *numBytesP); //Get number of bytes in
the receive
//queue

SerReceive (UInt16 refNum, void *bufP, UInt32 count, Int32 timeout, Err*
errP); //Returns//number of bytes
worth of datas and if there are errors

SerReceiveFlush (UInt16 refNum, Int32 timeout); //Flush datas in the queue




So this is the functions I'm using, you can verify for errors. You could
also set a boolean to acknowledge when the serial port is opened and read
only if this is the case. I'M relatively new to Palm programming, so may be
someone will have a better idea.

Dominique Martel




-Original Message-
From: Christophe Gouwy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 2:41 AM
To: Palm Developer Forum
Subject: Use serial Port in a special way


Hello

I would like to know if someone has got information about the serial port
of PAlm

Moreover, i would like to know if it is possible to command individualy the
signals of the serial port (like on a PC: with RX,TX...)

Because I would like to plug a I2C system to my palm, so I have to create a
special protocol on the serial port of the palm.

Thank you for your help.






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


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