Re: [cc65] Serial port API

Date view Thread view Subject view

From: groepaz (groepaz_at_gmx.net)
Date: 2001-11-05 16:57:10


Hello MagerValp,

gpz>> sio_init(portname,baudrate); /* init port, return 0 on success or -1 on error) */

M> Might I suggest that you add controls for word length, stop bits and
M> parity as well? And is baudrate a long or a named constant? 115200 and
M> up doesn't fit in an int.

well :o)
a) baudrate is obviously an unsigned long
b) wordlength/parity/stopbit parameters are fixed at 8n1 ...
programming that kinda stuff for ~10 years i have never ever seen
anything else used.... if you'd ever need 5o2 or sth i am sure you can
implement it yourself ;=P

gpz>> sio_readbyte();              /* waits until character arrives and returns it */
gpz>> sio_readbyte_nowait();       /* if character is waiting, returns it. otherwhise return 0 */
gpz>> sio_writebyte(val);          /* send byte, waits until byte has been send */

gpz>> all routines incorporate a timeout, and they set the global
gpz>> variables sio_readerr and sio_writerr for further error-handling.

M> Can you control the timeout value?

no :o) again, i have done that kinda stuff for long and this way it
always worked perfectly fine for me (infact thats not even a real
timeout but "check data $ffff times max." ,=))

M> Just wrote a small driver that allows the C64 to use the PC's HD using
M> a SwiftLink and a null modem cable the other night. Right now it just
M> supports load"file",6, load"$",6, and load"dir",6 (to change
M> directory). CD:ing into a D64 is halfway done. The C64 side is just
M> $110 bytes of code but if I decide to add some more exotic features
M> (like a nice menu controlled D64 reader/writer) I'd prefer doing it in
M> C. Hey, I'd even have a stab at writing the first real app for cc65 :)
M>   Oh, the server side is written in Perl and should work on both Win32
M> (use Win32::SerialPort;) and Unix (use Device::SerialPort;).

reading this, i'd really think we should work together a bit ;=P
actually a fileserver is among the features planned for the debugger i
am working on (actually one of the few things NOT implemented by now),
and a .d64 reciever is planned for the retro-replay software (my
debugger would be serving data on the pc side for that)....

also, i have designed the debugger code in a way so that it can easily
support whatever target is connected, so i'd happily support your c64
end aswell. (only thing beeing kinda hard at this point, i wouldnt
have a swithlink for testing ;=P)

-- 
Best regards,
 groepaz                            mailto:groepaz_at_gmx.net


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:43 CET