From 51478824525f90ff8c65e8ad9b7e532f0a5c4585 Mon Sep 17 00:00:00 2001 From: Lukas Date: Wed, 29 Apr 2026 16:12:47 +0200 Subject: [PATCH] checking utils, delay.h files --- src/utils/delay.h | 264 +++++++++++++++++++ src/utils/io.h | 632 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 896 insertions(+) create mode 100644 src/utils/delay.h create mode 100644 src/utils/io.h diff --git a/src/utils/delay.h b/src/utils/delay.h new file mode 100644 index 0000000..0571077 --- /dev/null +++ b/src/utils/delay.h @@ -0,0 +1,264 @@ +/* Copyright (c) 2002, Marek Michalkiewicz + Copyright (c) 2004,2005,2007 Joerg Wunsch + Copyright (c) 2007 Florin-Viorel Petrov + 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. */ + +/* $Id: delay.h.in 2251 2011-09-14 08:20:33Z joerg_wunsch $ */ + +#ifndef _UTIL_DELAY_H_ +#define _UTIL_DELAY_H_ 1 + +#ifndef __HAS_DELAY_CYCLES +#define __HAS_DELAY_CYCLES 1 +#endif + +#include +#include +#include + +/** \file */ +/** \defgroup util_delay : Convenience functions for busy-wait delay loops + \code + #define F_CPU 1000000UL // 1 MHz + //#define F_CPU 14.7456E6 + #include + \endcode + + \note As an alternative method, it is possible to pass the + F_CPU macro down to the compiler from the Makefile. + Obviously, in that case, no \c \#define statement should be + used. + + The functions in this header file are wrappers around the basic + busy-wait functions from . They are meant as + convenience functions where actual time values can be specified + rather than a number of cycles to wait for. The idea behind is + that compile-time constant expressions will be eliminated by + compiler optimization so floating-point expressions can be used + to calculate the number of delay cycles needed based on the CPU + frequency passed by the macro F_CPU. + + \note In order for these functions to work as intended, compiler + optimizations must be enabled, and the delay time + must be an expression that is a known constant at + compile-time. If these requirements are not met, the resulting + delay will be much longer (and basically unpredictable), and + applications that otherwise do not use floating-point calculations + will experience severe code bloat by the floating-point library + routines linked into the application. + + The functions available allow the specification of microsecond, and + millisecond delays directly, using the application-supplied macro + F_CPU as the CPU clock frequency (in Hertz). + +*/ + +#if !defined(__DOXYGEN__) +static inline void _delay_us(double __us) __attribute__((always_inline)); +static inline void _delay_ms(double __ms) __attribute__((always_inline)); +#endif + +#ifndef F_CPU +/* prevent compiler error by supplying a default */ +# warning "F_CPU not defined for " +# define F_CPU 1000000UL +#endif + +#ifndef __OPTIMIZE__ +# warning "Compiler optimizations disabled; functions from won't work as designed" +#endif + +#if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \ + !defined(__DELAY_BACKWARD_COMPATIBLE__) && \ + __STDC_HOSTED__ +# include +#endif + +/** + \ingroup util_delay + + Perform a delay of \c __ms milliseconds, using _delay_loop_2(). + + The macro F_CPU is supposed to be defined to a + constant defining the CPU clock frequency (in Hertz). + + The maximal possible delay is 262.14 ms / F_CPU in MHz. + + When the user request delay which exceed the maximum possible one, + _delay_ms() provides a decreased resolution functionality. In this + mode _delay_ms() will work with a resolution of 1/10 ms, providing + delays up to 6.5535 seconds (independent from CPU frequency). The + user will not be informed about decreased resolution. + + If the avr-gcc toolchain has __builtin_avr_delay_cycles(unsigned long) + support, maximal possible delay is 4294967.295 ms/ F_CPU in MHz. For + values greater than the maximal possible delay, overflows results in + no delay i.e., 0ms. + + Conversion of __us into clock cycles may not always result in integer. + By default, the clock cycles rounded up to next integer. This ensures that + the user gets atleast __us microseconds of delay. + + Alternatively, user can define __DELAY_ROUND_DOWN__ and __DELAY_ROUND_CLOSEST__ + to round down and round to closest integer. + + Note: The new implementation of _delay_ms(double __ms) with + __builtin_avr_delay_cycles(unsigned long) support is not backward compatible. + User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible delay. + Also, the backward compatible + algorithm will be chosen if the code is compiled in a freestanding + environment (GCC option \c -ffreestanding), as the math functions + required for rounding are not available to the compiler then. + + */ +void +_delay_ms(double __ms) +{ + uint16_t __ticks; + double __tmp ; +#if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \ + !defined(__DELAY_BACKWARD_COMPATIBLE__) && \ + __STDC_HOSTED__ + uint32_t __ticks_dc; + extern void __builtin_avr_delay_cycles(unsigned long); + __tmp = ((F_CPU) / 1e3) * __ms; + + #if defined(__DELAY_ROUND_DOWN__) + __ticks_dc = (uint32_t)fabs(__tmp); + + #elif defined(__DELAY_ROUND_CLOSEST__) + __ticks_dc = (uint32_t)(fabs(__tmp)+0.5); + + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + +#else + __tmp = ((F_CPU) / 4e3) * __ms; + if (__tmp < 1.0) + __ticks = 1; + else if (__tmp > 65535) + { + // __ticks = requested delay in 1/10 ms + __ticks = (uint16_t) (__ms * 10.0); + while(__ticks) + { + // wait 1/10 ms + _delay_loop_2(((F_CPU) / 4e3) / 10); + __ticks --; + } + return; + } + else + __ticks = (uint16_t)__tmp; + _delay_loop_2(__ticks); +#endif +} + +/** + \ingroup util_delay + + Perform a delay of \c __us microseconds, using _delay_loop_1(). + + The macro F_CPU is supposed to be defined to a + constant defining the CPU clock frequency (in Hertz). + + The maximal possible delay is 768 us / F_CPU in MHz. + + If the user requests a delay greater than the maximal possible one, + _delay_us() will automatically call _delay_ms() instead. The user + will not be informed about this case. + + If the avr-gcc toolchain has __builtin_avr_delay_cycles(unsigned long) + support, maximal possible delay is 4294967.295 us/ F_CPU in MHz. For + values greater than the maximal possible delay, overflow results in + no delay i.e., 0us. + + Conversion of __us into clock cycles may not always result in integer. + By default, the clock cycles rounded up to next integer. This ensures that + the user gets atleast __us microseconds of delay. + + Alternatively, user can define __DELAY_ROUND_DOWN__ and __DELAY_ROUND_CLOSEST__ + to round down and round to closest integer. + + Note: The new implementation of _delay_us(double __us) with + __builtin_avr_delay_cycles(unsigned long) support is not backward compatible. + User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible delay. + Also, the backward compatible + algorithm will be chosen if the code is compiled in a freestanding + environment (GCC option \c -ffreestanding), as the math functions + required for rounding are not available to the compiler then. + + */ +void +_delay_us(double __us) +{ + uint8_t __ticks; + double __tmp ; +#if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \ + !defined(__DELAY_BACKWARD_COMPATIBLE__) && \ + __STDC_HOSTED__ + uint32_t __ticks_dc; + extern void __builtin_avr_delay_cycles(unsigned long); + __tmp = ((F_CPU) / 1e6) * __us; + + #if defined(__DELAY_ROUND_DOWN__) + __ticks_dc = (uint32_t)fabs(__tmp); + + #elif defined(__DELAY_ROUND_CLOSEST__) + __ticks_dc = (uint32_t)(fabs(__tmp)+0.5); + + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + +#else + __tmp = ((F_CPU) / 3e6) * __us; + if (__tmp < 1.0) + __ticks = 1; + else if (__tmp > 255) + { + _delay_ms(__us / 1000.0); + return; + } + else + __ticks = (uint8_t)__tmp; + _delay_loop_1(__ticks); +#endif +} + + +#endif /* _UTIL_DELAY_H_ */ diff --git a/src/utils/io.h b/src/utils/io.h new file mode 100644 index 0000000..16a4e94 --- /dev/null +++ b/src/utils/io.h @@ -0,0 +1,632 @@ +/* Copyright (c) 2002,2003,2005,2006,2007 Marek Michalkiewicz, Joerg Wunsch + Copyright (c) 2007 Eric B. Weddington + 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. */ + +/* $Id$ */ + +/** \file */ +/** \defgroup avr_io : AVR device-specific IO definitions + \code #include \endcode + + This header file includes the apropriate IO definitions for the + device that has been specified by the -mmcu= compiler + command-line switch. This is done by diverting to the appropriate + file <avr/ioXXXX.h> which should + never be included directly. Some register names common to all + AVR devices are defined directly within <avr/common.h>, + which is included in <avr/io.h>, + but most of the details come from the respective include file. + + Note that this file always includes the following files: + \code + #include + #include + #include + #include + \endcode + See \ref avr_sfr for more details about that header file. + + Included are definitions of the IO register set and their + respective bit values as specified in the Atmel documentation. + Note that inconsistencies in naming conventions, + so even identical functions sometimes get different names on + different devices. + + Also included are the specific names useable for interrupt + function definitions as documented + \ref avr_signames "here". + + Finally, the following macros are defined: + + - \b RAMEND +
+ The last on-chip RAM address. +
+ - \b XRAMEND +
+ The last possible RAM location that is addressable. This is equal to + RAMEND for devices that do not allow for external RAM. For devices + that allow external RAM, this will be larger than RAMEND. +
+ - \b E2END +
+ The last EEPROM address. +
+ - \b FLASHEND +
+ The last byte address in the Flash program space. +
+ - \b SPM_PAGESIZE +
+ For devices with bootloader support, the flash pagesize + (in bytes) to be used for the \c SPM instruction. + - \b E2PAGESIZE +
+ The size of the EEPROM page. + +*/ + +#ifndef _AVR_IO_H_ +#define _AVR_IO_H_ + +#include + +#if defined (__AVR_AT94K__) +# include +#elif defined (__AVR_AT43USB320__) +# include +#elif defined (__AVR_AT43USB355__) +# include +#elif defined (__AVR_AT76C711__) +# include +#elif defined (__AVR_AT86RF401__) +# include +#elif defined (__AVR_AT90PWM1__) +# include +#elif defined (__AVR_AT90PWM2__) +# include +#elif defined (__AVR_AT90PWM2B__) +# include +#elif defined (__AVR_AT90PWM3__) +# include +#elif defined (__AVR_AT90PWM3B__) +# include +#elif defined (__AVR_AT90PWM216__) +# include +#elif defined (__AVR_AT90PWM316__) +# include +#elif defined (__AVR_AT90PWM161__) +# include +#elif defined (__AVR_AT90PWM81__) +# include +#elif defined (__AVR_ATmega8U2__) +# include +#elif defined (__AVR_ATmega16M1__) +# include +#elif defined (__AVR_ATmega16U2__) +# include +#elif defined (__AVR_ATmega16U4__) +# include +#elif defined (__AVR_ATmega32C1__) +# include +#elif defined (__AVR_ATmega32M1__) +# include +#elif defined (__AVR_ATmega32U2__) +# include +#elif defined (__AVR_ATmega32U4__) +# include +#elif defined (__AVR_ATmega32U6__) +# include +#elif defined (__AVR_ATmega64C1__) +# include +#elif defined (__AVR_ATmega64M1__) +# include +#elif defined (__AVR_ATmega128__) +# include +#elif defined (__AVR_ATmega128A__) +# include +#elif defined (__AVR_ATmega1280__) +# include +#elif defined (__AVR_ATmega1281__) +# include +#elif defined (__AVR_ATmega1284__) +# include +#elif defined (__AVR_ATmega1284P__) +# include +#elif defined (__AVR_ATmega128RFA1__) +# include +#elif defined (__AVR_ATmega128RFR2__) +# include +#elif defined (__AVR_ATmega1284RFR2__) +# include +#elif defined (__AVR_ATmega256RFR2__) +# include +#elif defined (__AVR_ATmega2564RFR2__) +# include +#elif defined (__AVR_ATmega2560__) +# include +#elif defined (__AVR_ATmega2561__) +# include +#elif defined (__AVR_AT90CAN32__) +# include +#elif defined (__AVR_AT90CAN64__) +# include +#elif defined (__AVR_AT90CAN128__) +# include +#elif defined (__AVR_AT90USB82__) +# include +#elif defined (__AVR_AT90USB162__) +# include +#elif defined (__AVR_AT90USB646__) +# include +#elif defined (__AVR_AT90USB647__) +# include +#elif defined (__AVR_AT90USB1286__) +# include +#elif defined (__AVR_AT90USB1287__) +# include +#elif defined (__AVR_ATmega64RFR2__) +# include +#elif defined (__AVR_ATmega644RFR2__) +# include +#elif defined (__AVR_ATmega64__) +# include +#elif defined (__AVR_ATmega64A__) +# include +#elif defined (__AVR_ATmega640__) +# include +#elif defined (__AVR_ATmega644__) +# include +#elif (defined __AVR_ATmega644A__) +#include +#elif defined (__AVR_ATmega644P__) +# include +#elif defined (__AVR_ATmega644PA__) +# include +#elif defined (__AVR_ATmega645__) +# include +#elif (defined __AVR_ATmega645A__) +#include +#elif (defined __AVR_ATmega645P__) +#include +#elif defined (__AVR_ATmega6450__) +# include +#elif (defined __AVR_ATmega6450A__) +#include +#elif (defined __AVR_ATmega6450P__) +#include +#elif defined (__AVR_ATmega649__) +# include +#elif (defined __AVR_ATmega649A__) +#include +#elif defined (__AVR_ATmega6490__) +# include +#elif (defined __AVR_ATmega6490A__) +#include +#elif (defined __AVR_ATmega6490P__) +#include +#elif defined (__AVR_ATmega649P__) +# include +#elif defined (__AVR_ATmega64HVE__) +# include +#elif defined (__AVR_ATmega64HVE2__) +# include +#elif defined (__AVR_ATmega103__) +# include +#elif defined (__AVR_ATmega32__) +# include +#elif defined (__AVR_ATmega32A__) +# include +#elif defined (__AVR_ATmega323__) +# include +#elif defined (__AVR_ATmega324P__) +# include +#elif (defined __AVR_ATmega324A__) +#include +#elif defined (__AVR_ATmega324PA__) +# include +#elif defined (__AVR_ATmega325__) +# include +#elif (defined __AVR_ATmega325A__) +#include +#elif defined (__AVR_ATmega325P__) +# include +#elif defined (__AVR_ATmega325PA__) +# include +#elif defined (__AVR_ATmega3250__) +# include +#elif (defined __AVR_ATmega3250A__) +#include +#elif defined (__AVR_ATmega3250P__) +# include +#elif defined (__AVR_ATmega3250PA__) +# include +#elif defined (__AVR_ATmega328P__) +# include +#elif (defined __AVR_ATmega328__) +#include +#elif defined (__AVR_ATmega329__) +# include +#elif (defined __AVR_ATmega329A__) +#include +#elif defined (__AVR_ATmega329P__) +# include +#elif (defined __AVR_ATmega329PA__) +#include +#elif (defined __AVR_ATmega3290PA__) +#include +#elif defined (__AVR_ATmega3290__) +# include +#elif (defined __AVR_ATmega3290A__) +#include +#elif defined (__AVR_ATmega3290P__) +# include +#elif defined (__AVR_ATmega32HVB__) +# include +#elif defined (__AVR_ATmega32HVBREVB__) +# include +#elif defined (__AVR_ATmega406__) +# include +#elif defined (__AVR_ATmega16__) +# include +#elif defined (__AVR_ATmega16A__) +# include +#elif defined (__AVR_ATmega161__) +# include +#elif defined (__AVR_ATmega162__) +# include +#elif defined (__AVR_ATmega163__) +# include +#elif defined (__AVR_ATmega164P__) +# include +#elif (defined __AVR_ATmega164A__) +#include +#elif defined (__AVR_ATmega164PA__) +# include +#elif defined (__AVR_ATmega165__) +# include +#elif (defined __AVR_ATmega165A__) +#include +#elif defined (__AVR_ATmega165P__) +# include +#elif defined (__AVR_ATmega165PA__) +# include +#elif defined (__AVR_ATmega168__) +# include +#elif (defined __AVR_ATmega168A__) +#include +#elif defined (__AVR_ATmega168P__) +# include +#elif defined (__AVR_ATmega168PA__) +# include +#elif defined (__AVR_ATmega168PB__) +# include +#elif defined (__AVR_ATmega169__) +# include +#elif (defined __AVR_ATmega169A__) +#include +#elif defined (__AVR_ATmega169P__) +# include +#elif defined (__AVR_ATmega169PA__) +# include +#elif defined (__AVR_ATmega8HVA__) +# include +#elif defined (__AVR_ATmega16HVA__) +# include +#elif defined (__AVR_ATmega16HVA2__) +# include +#elif defined (__AVR_ATmega16HVB__) +# include +#elif defined (__AVR_ATmega16HVBREVB__) +# include +#elif defined (__AVR_ATmega8__) +# include +#elif defined (__AVR_ATmega8A__) +# include +#elif (defined __AVR_ATmega48A__) +# include +#elif defined (__AVR_ATmega48__) +# include +#elif defined (__AVR_ATmega48PA__) +# include +#elif defined (__AVR_ATmega48PB__) +# include +#elif defined (__AVR_ATmega48P__) +# include +#elif defined (__AVR_ATmega88__) +# include +#elif (defined __AVR_ATmega88A__) +# include +#elif defined (__AVR_ATmega88P__) +# include +#elif defined (__AVR_ATmega88PA__) +# include +#elif defined (__AVR_ATmega88PB__) +# include +#elif defined (__AVR_ATmega8515__) +# include +#elif defined (__AVR_ATmega8535__) +# include +#elif defined (__AVR_AT90S8535__) +# include +#elif defined (__AVR_AT90C8534__) +# include +#elif defined (__AVR_AT90S8515__) +# include +#elif defined (__AVR_AT90S4434__) +# include +#elif defined (__AVR_AT90S4433__) +# include +#elif defined (__AVR_AT90S4414__) +# include +#elif defined (__AVR_ATtiny22__) +# include +#elif defined (__AVR_ATtiny26__) +# include +#elif defined (__AVR_AT90S2343__) +# include +#elif defined (__AVR_AT90S2333__) +# include +#elif defined (__AVR_AT90S2323__) +# include +#elif defined (__AVR_AT90S2313__) +# include +#elif defined (__AVR_ATtiny4__) +# include +#elif defined (__AVR_ATtiny5__) +# include +#elif defined (__AVR_ATtiny9__) +# include +#elif defined (__AVR_ATtiny10__) +# include +#elif defined (__AVR_ATtiny20__) +# include +#elif defined (__AVR_ATtiny40__) +# include +#elif defined (__AVR_ATtiny2313__) +# include +#elif defined (__AVR_ATtiny2313A__) +# include +#elif defined (__AVR_ATtiny13__) +# include +#elif defined (__AVR_ATtiny13A__) +# include +#elif defined (__AVR_ATtiny25__) +# include +#elif defined (__AVR_ATtiny4313__) +# include +#elif defined (__AVR_ATtiny45__) +# include +#elif defined (__AVR_ATtiny85__) +# include +#elif defined (__AVR_ATtiny24__) +# include +#elif defined (__AVR_ATtiny24A__) +# include +#elif defined (__AVR_ATtiny44__) +# include +#elif defined (__AVR_ATtiny44A__) +# include +#elif defined (__AVR_ATtiny441__) +# include +#elif defined (__AVR_ATtiny84__) +# include +#elif defined (__AVR_ATtiny84A__) +# include +#elif defined (__AVR_ATtiny841__) +# include +#elif defined (__AVR_ATtiny261__) +# include +#elif defined (__AVR_ATtiny261A__) +# include +#elif defined (__AVR_ATtiny461__) +# include +#elif defined (__AVR_ATtiny461A__) +# include +#elif defined (__AVR_ATtiny861__) +# include +#elif defined (__AVR_ATtiny861A__) +# include +#elif defined (__AVR_ATtiny43U__) +# include +#elif defined (__AVR_ATtiny48__) +# include +#elif defined (__AVR_ATtiny88__) +# include +#elif defined (__AVR_ATtiny828__) +# include +#elif defined (__AVR_ATtiny87__) +# include +#elif defined (__AVR_ATtiny167__) +# include +#elif defined (__AVR_ATtiny1634__) +# include +#elif defined (__AVR_AT90SCR100__) +# include +#elif defined (__AVR_ATxmega16A4__) +# include +#elif defined (__AVR_ATxmega16A4U__) +# include +#elif defined (__AVR_ATxmega16C4__) +# include +#elif defined (__AVR_ATxmega16D4__) +# include +#elif defined (__AVR_ATxmega32A4__) +# include +#elif defined (__AVR_ATxmega32A4U__) +# include +#elif defined (__AVR_ATxmega32C3__) +# include +#elif defined (__AVR_ATxmega32C4__) +# include +#elif defined (__AVR_ATxmega32D3__) +# include +#elif defined (__AVR_ATxmega32D4__) +# include +#elif defined (__AVR_ATxmega8E5__) +# include +#elif defined (__AVR_ATxmega16E5__) +# include +#elif defined (__AVR_ATxmega32E5__) +# include +#elif defined (__AVR_ATxmega64A1__) +# include +#elif defined (__AVR_ATxmega64A1U__) +# include +#elif defined (__AVR_ATxmega64A3__) +# include +#elif defined (__AVR_ATxmega64A3U__) +# include +#elif defined (__AVR_ATxmega64A4U__) +# include +#elif defined (__AVR_ATxmega64B1__) +# include +#elif defined (__AVR_ATxmega64B3__) +# include +#elif defined (__AVR_ATxmega64C3__) +# include +#elif defined (__AVR_ATxmega64D3__) +# include +#elif defined (__AVR_ATxmega64D4__) +# include +#elif defined (__AVR_ATxmega128A1__) +# include +#elif defined (__AVR_ATxmega128A1U__) +# include +#elif defined (__AVR_ATxmega128A4U__) +# include +#elif defined (__AVR_ATxmega128A3__) +# include +#elif defined (__AVR_ATxmega128A3U__) +# include +#elif defined (__AVR_ATxmega128B1__) +# include +#elif defined (__AVR_ATxmega128B3__) +# include +#elif defined (__AVR_ATxmega128C3__) +# include +#elif defined (__AVR_ATxmega128D3__) +# include +#elif defined (__AVR_ATxmega128D4__) +# include +#elif defined (__AVR_ATxmega192A3__) +# include +#elif defined (__AVR_ATxmega192A3U__) +# include +#elif defined (__AVR_ATxmega192C3__) +# include +#elif defined (__AVR_ATxmega192D3__) +# include +#elif defined (__AVR_ATxmega256A3__) +# include +#elif defined (__AVR_ATxmega256A3U__) +# include +#elif defined (__AVR_ATxmega256A3B__) +# include +#elif defined (__AVR_ATxmega256A3BU__) +# include +#elif defined (__AVR_ATxmega256C3__) +# include +#elif defined (__AVR_ATxmega256D3__) +# include +#elif defined (__AVR_ATxmega384C3__) +# include +#elif defined (__AVR_ATxmega384D3__) +# include +#elif defined (__AVR_ATA5790__) +# include +#elif defined (__AVR_ATA5790N__) +# include +#elif defined (__AVR_ATA5272__) +# include +#elif defined (__AVR_ATA5505__) +# include +#elif defined (__AVR_ATA5795__) +# include +#elif defined (__AVR_ATA5702M322__) +# include +#elif defined (__AVR_ATA5782__) +# include +#elif defined (__AVR_ATA5831__) +# include +#elif defined (__AVR_ATA6285__) +# include +#elif defined (__AVR_ATA6286__) +# include +#elif defined (__AVR_ATA6289__) +# include +#elif defined (__AVR_ATA6612C__) +# include +#elif defined (__AVR_ATA6613C__) +# include +#elif defined (__AVR_ATA6614Q__) +# include +#elif defined (__AVR_ATA6616C__) +# include +#elif defined (__AVR_ATA6617C__) +# include +#elif defined (__AVR_ATA664251__) +# include +/* avr1: the following only supported for assembler programs */ +#elif defined (__AVR_ATtiny28__) +# include +#elif defined (__AVR_AT90S1200__) +# include +#elif defined (__AVR_ATtiny15__) +# include +#elif defined (__AVR_ATtiny12__) +# include +#elif defined (__AVR_ATtiny11__) +# include +#elif defined (__AVR_M3000__) +# include +#else +# if !defined(__COMPILING_AVR_LIBC__) +# warning "device type not defined" +# endif +#endif + +#include + +#include + +#include + +#if __AVR_ARCH__ >= 100 +# include +#endif + +/* Include fuse.h after individual IO header files. */ +#include + +/* Include lock.h after individual IO header files. */ +#include + +#endif /* _AVR_IO_H_ */