- Main Page
- Modules
- Data Structures
- Files
- Related Pages

# flash.h

Go to the documentation of this file.

    00001 /*This file has been prepared for Doxygen automatic documentation generation.*/
    00013
    00014 /* Copyright (c) 2007, Atmel Corporation All rights reserved.
    00015  *
    00016  * Redistribution and use in source and binary forms, with or without
    00017  * modification, are permitted provided that the following conditions are met:
    00018  *
    00019  * 1. Redistributions of source code must retain the above copyright notice,
    00020  * this list of conditions and the following disclaimer.
    00021  *
    00022  * 2. Redistributions in binary form must reproduce the above copyright notice,
    00023  * this list of conditions and the following disclaimer in the documentation
    00024  * and/or other materials provided with the distribution.
    00025  *
    00026  * 3. The name of ATMEL may not be used to endorse or promote products derived
    00027  * from this software without specific prior written permission.
    00028  *
    00029  * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED
    00030  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    00031  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND
    00032  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
    00033  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    00034  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    00035  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    00036  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    00037  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    00038  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    00039  */
    00040
    00041 #ifndef FLASH_H
    00042 #define FLASH_H
    00043
    00044
    00045 //_____ D E F I N I T I O N S ______________________________________________
    00046
    00047 #ifdef __ICCAVR__
    00048    #if (defined(__AT90USB1287__) || defined(__AT90USB1286__))
    00049       #define  FLASH_END         0x1FFFF  // Size of flash
    00050       #define  FLASH_PAGE_SIZE   0x100    // Size of page flash
    00051       #define  BOOT_SIZE         0x2000   // Size of bootloader
    00052    #elif (defined(__AT90USB647__) || defined(__AT90USB646__))
    00053       #define  FLASH_END         0x0FFFF  // Size of flash
    00054       #define  FLASH_PAGE_SIZE   0x100    // Size of page flash
    00055       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00056    #elif (defined(__ATmega32U4__) || defined(__ATmega32U6__))
    00057       #define  FLASH_END         0x7FFF   // Size of flash
    00058       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00059       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00060    #elif defined(__ATmega16U4__)
    00061       #define  FLASH_END         0x3FFF   // Size of flash
    00062       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00063       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00064    #elif (defined(__AT90USB162__) )
    00065       #define  FLASH_END         0x3FFF   // Size of flash
    00066       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00067       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00068    #elif (defined(__AT90USB82__) )
    00069       #define  FLASH_END         0x1FFF   // Size of flash
    00070       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00071       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00072    #else
    00073       #error TARGET should be defined
    00074    #endif
    00075 #elif defined __GNUC__
    00076    #if (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__))
    00077       #define  FLASH_END         0x1FFFF  // Size of flash
    00078       #define  FLASH_PAGE_SIZE   0x100    // Size of page flash
    00079       #define  BOOT_SIZE         0x2000   // Size of bootloader
    00080    #elif (defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB646__))
    00081       #define  FLASH_END         0x0FFFF  // Size of flash
    00082       #define  FLASH_PAGE_SIZE   0x100    // Size of page flash
    00083       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00084    #elif (defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB646__))
    00085       #define  FLASH_END         0x0FFFF  // Size of flash
    00086       #define  FLASH_PAGE_SIZE   0x100    // Size of page flash
    00087    #elif (defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega32U6__))
    00088       #define  FLASH_END         0x7FFF   // Size of flash
    00089       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00090       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00091    #elif defined(__AVR_ATmega16U4__)
    00092       #define  FLASH_END         0x3FFF   // Size of flash
    00093       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00094       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00095    #elif (defined(__AVR_AT90USB162__) )
    00096       #define  FLASH_END         0x3FFF   // Size of flash
    00097       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00098       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00099    #elif (defined(__AVR_AT90USB82__) )
    00100       #define  FLASH_END         0x1FFF   // Size of flash
    00101       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00102       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00103    #else
    00104       #error TARGET should be defined
    00105    #endif
    00106 #else // Other compiler
    00107    #error Compiler unknow
    00108 #endif
    00109
    00110 #define  LAST_BOOT_ENTRY   (((FLASH_END+1)/2)-2)   // Last boot entry is the last Word of flash (unit Word 16-bit)
    00111 #define  FLASH_SIZE        FLASH_END-BOOT_SIZE
    00112
    00113
    00114 #endif  // FLASH_H
    00115
    00116
    00117
    00118
    00119
    00120
    00121
    00122
    00123
    00124
    00125
    00126
    00127
    00128