simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] Simple UART support


From: Theodore A. Roth
Subject: Re: [Simulavr-devel] Simple UART support
Date: Fri Sep 13 01:16:01 2002

Cool. Thanks Ken.

Couple of notes:

- The copyright should be this:

+ * Copyright (C) 2002  Ken Restivo

- If you use cvs to generate the patch, it is _sooo_ much easier. For new 
files, you'll just need to do this:

   $ cvs diff -u > foo.diff
   $ for file in $new_files
   do
     diff -u /dev/null $file >> foo.diff
   done

Make sure the patch to $new_files is the same as that which cvs diff gives.

I'll take a better look at this over the weekend and see about committing 
it.

Ted Roth

On Thu, 12 Sep 2002, ken restivo wrote:

:)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
:)

Attachment: kr-simulavr-uart.patch.gz
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]