AVR Libc Home Page |  | AVR Libc Development Pages
Main Page | User Manual | Library Reference | FAQ | Alphabetical Index | Example Projects

# AVR Libc

### 1.5.1.20071029

## Introduction

The latest version of this document is always available from http://savannah.nongnu.org/projects/avr-libc/

The AVR Libc package provides a subset of the standard C library for Atmel AVR 8-bit RISC microcontrollers. In addition, the library provides the basic startup code needed by most applications.

There is a wealth of information in this document which goes beyond simply describing the interfaces and routines provided by the library. We hope that this document provides enough information to get a new AVR developer up to speed quickly using the freely available development tools: binutils, gcc avr-libc and many others.

If you find yourself stuck on a problem which this document doesn't quite address, you may wish to post a message to the avr-gcc mailing list. Most of the developers of the AVR binutils and gcc ports in addition to the devleopers of avr-libc subscribe to the list, so you will usually be able to get your problem resolved. You can subscribe to the list at http://lists.nongnu.org/mailman/listinfo/avr-gcc-list . Before posting to the list, you might want to try reading the Frequently Asked Questions chapter of this document.

Note:
  If you think you've found a bug, or have a suggestion for an improvement, either in this documentation or in the library itself, please use the bug tracker at https://savannah.nongnu.org/bugs/?group=avr-libc to ensure the issue won't be forgotten.

## General information about this library

In general, it has been the goal to stick as best as possible to established standards while implementing this library. Commonly, this refers to the C library as described by the ANSI X3.159-1989 and ISO/IEC 9899:1990 ("ANSI-C") standard, as well as parts of their successor ISO/IEC 9899:1999 ("C99"). Some additions have been inspired by other standards like IEEE Std 1003.1-1988 ("POSIX.1"), while other extensions are purely AVR-specific (like the entire program-space string interface).

Unless otherwise noted, functions of this library are not guaranteed to be reentrant. In particular, any functions that store local state are known to be non-reentrant, as well as functions that manipulate IO registers like the EEPROM access routines. If these functions are used within both standard and interrupt contexts undefined behaviour will result.

## Supported Devices

The following is a list of AVR devices currently supported by the library. Note that actual support for some newer devices depends on the ability of the compiler/assembler to support these devices at library compile-time.

megaAVR Devices:

- atmega103
- atmega128
- atmega1280
- atmega1281
- atmega16
- atmega161
- atmega162
- atmega163
- atmega164p
- atmega165
- atmega165p
- atmega168
- atmega168p
- atmega2560
- atmega2561
- atmega32
- atmega323
- atmega324p
- atmega325
- atmega325p
- atmega3250
- atmega3250p
- atmega328p
- atmega48
- atmega48p
- atmega64
- atmega640
- atmega644
- atmega644p
- atmega645
- atmega6450
- atmega8
- atmega88
- atmega88p
- atmega8515
- atmega8535

tinyAVR Devices:

- attiny11 [1]
- attiny12 [1]
- attiny13
- attiny15 [1]
- attiny22
- attiny24
- attiny25
- attiny26
- attiny261
- attiny28 [1]
- attiny2313
- attiny43u
- attiny44
- attiny45
- attiny461
- attiny48
- attiny84
- attiny85
- attiny861

CAN AVR Devices:

- at90can32
- at90can64
- at90can128

LCD AVR Devices:

- atmega169
- atmega169p
- atmega329
- atmega329p
- atmega3290
- atmega3290p
- atmega649
- atmega6490

Lighting AVR Devices:

- at90pwm1
- at90pwm2
- at90pwm2b
- at90pwm216
- at90pwm3
- at90pwm3b
- at90pwm316

Smart Battery AVR Devices:

- atmega8hva
- atmega16hva
- atmega406

USB AVR Devices:

- at90usb82
- at90usb162
- at90usb646
- at90usb647
- at90usb1286
- at90usb1287

Miscellaneous Devices:

- at94K [2]
- at76c711 [3]
- at43usb320
- at43usb355
- at86rf401

Classic AVR Devices:

- at90s1200 [1]
- at90s2313
- at90s2323
- at90s2333
- at90s2343
- at90s4414
- at90s4433
- at90s4434
- at90s8515
- at90c8534
- at90s8535

Note:
  [1] Assembly only. There is no direct support for these devices to be programmed in C since they do not have a RAM based stack. Still, it could be possible to program them in C, see the FAQ for an option.

Note:
  [2] The at94K devices are a combination of FPGA and AVR microcontroller. [TRoth-2002/11/12: Not sure of the level of support for these. More information would be welcomed.]

Note:
  [3] The at76c711 is a USB to fast serial interface bridge chip using an AVR core.

## avr-libc License

avr-libc can be freely used and redistributed, provided the following license conditions are met.

    Portions of avr-libc are Copyright (c) 1999-2007
    Keith Gudger,
    Bjoern Haase,
    Steinar Haugen,
    Peter Jansen,
    Reinhard Jessich,
    Magnus Johansson,
    Artur Lipowski,
    Marek Michalkiewicz,
    Colin O'Flynn,
    Bob Paddock,
    Reiner Patommel,
    Michael Rickman,
    Theodore A. Roth,
    Juergen Schilling,
    Philip Soeberg,
    Anatoly Sokolov,
    Nils Kristian Strom,
    Michael Stumpf,
    Stefan Swanepoel,
    Eric B. Weddington,
    Joerg Wunsch,
    Dmitry Xmelkov,
    The Regents of the University of California.
    All rights reserved.

       Redistribution and use in source and binary forms, with or without
       modification, are permitted provided that the following conditions are met:

       * Redistributions of source code must retain the above copyright
         notice, this list of conditions and the following disclaimer.

       * Redistributions in binary form must reproduce the above copyright
         notice, this list of conditions and the following disclaimer in
         the documentation and/or other materials provided with the
         distribution.

       * Neither the name of the copyright holders nor the names of
         contributors may be used to endorse or promote products derived
         from this software without specific prior written permission.

       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
       IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
       ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
       LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
       CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
       SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
       INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
       CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
       POSSIBILITY OF SUCH DAMAGE.

Automatically generated by Doxygen 1.5.2 on 14 Feb 2008.