avr-libc uart.h not found

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the avr-lib manual they present a uart.h file that has functions to talk to the serial port. When I #include this file in my code it cant be found by the compiler. Is this file part of the avr-lib?

Quote:

6.38.3.7 uart.h Public interface definition for the RS-232 UART driver, much like in lcd.h except there is now also a character input function available.
As the RS-232 input is line-buffered in this example, the macro RX_BUFSIZE determines the size of that buffer.

My code:

#include 
#include 
#include 
#include 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

C:\WinAVR\examples\stdiodemo

or grab them here-

http://www.nongnu.org/avr-libc/u...

put them in your project directory, then
#include "uart.h"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The file is not part of avr-libc itself but is included in an example of how to use stdio. Try looking in \winavr\doc\avr-libc\examples\stdiodemo

If you want to use it (or something similar) I would not use that version of the file but simply make a copy of it in your local project directory then just #include "uart.h"

(you'll also want to copy over uart.c and add it to a list of your build components - you'll probably also want to "borrow" the UART specific bits from stdiodemo.c)

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Is this file part of the avr-lib?

Believe it or not but your own PC can help you locate files on your hard disk...

Start a Windows Explorer. Go to the WinAVR installation folder (top of the installation). Click Search. Type "uart.h" in the field for filename. Click Search Now.

The file is part of an example project. Copy uart.h and uart.c to your project folder. Add uart.c to your project (assuming you use AVR Studio, if you roll your own makefile you alone knows exactly what is needed).

Include the header file where needed with

#include "uart.h"

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Mon. Dec 15, 2008 - 01:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks guys,

Quote:

The file is not part of avr-libc itself but is included in an example of how to use stdio. Try looking in \winavr\doc\avr-libc\examples\stdiodemo

This was the problem. I had the impression that uart.h is part of the library itself.