[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Simulavr-devel] Simple UART support
From: |
ken restivo |
Subject: |
[Simulavr-devel] Simple UART support |
Date: |
Fri Sep 13 00:23:01 2002 |
User-agent: |
Mutt/1.3.25i |
And here it is: a patch against today's CVS which adds rudimentary UART support.
What it does:
- Read/write UART data from apps which use a simple tight polled loop
- Accept an arg (--uart-tty=/path) from which to send/receive UART chars
- Check RXEN/TXEN and complain if the app doesn't set them properly
- Let the app read/write UDR, UBRR, UCSRA, and UCSRB.
- Defines all the bits and masks for my part (atmega163).
What it does not:
- UART interrupts
- Deal with RXC/TXC bits intelligently.
- Any tty mode-mangling. I figured the sim shouldn't; let the user do
it.
- Network or UNIX sockets, though it'd be pretty easy to implement.
- Other UART register layouts from other parts, or multiple UARTS.
I'm using it with a /dev/pts/xx on linux, simulating a mega163, and all is
well so far. This should get me through testing/debugging my app (I'm really
fatigued with object-oriented programming at this point, and am chomping at
the bit to get back to my assembly code again! ;-). But, at some point soon,
I'll need to add interrupt support, if someone else doesn't do it first.
Oh, and I wasn't sure where to put the read/write functions, so I left them in
main.c. Also all the opening of fd's and adding of callbacks probably wants to
get moved into a setup_uart_external() or some such method, but I wasn't sure
where to put it or what to call it, so I left all that stuff sitting there
loose in main(). My apologies.
-ken
--
---------------
The world's most affordable web hosting.
http://www.nearlyfreespeech.net
kr-simulavr-uart.patch.gz
Description: Binary data
pgpRHWS8roy0a.pgp
Description: PGP signature
- [Simulavr-devel] Simple UART support,
ken restivo <=