ATMEL: flash.h Source File

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

# flash.h

Go to the documentation of this file.

    00001 /*This file is prepared for Doxygen automatic documentation generation.*/
    00013
    00014 /* Copyright (c) 2009 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  * 4. This software may only be redistributed and used in connection with an Atmel
    00030  * AVR product.
    00031  *
    00032  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
    00033  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    00034  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND
    00035  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
    00036  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    00037  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    00038  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    00039  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    00040  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    00041  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    00042  */
    00043
    00044 #ifndef FLASH_H
    00045 #define FLASH_H
    00046
    00047
    00048 //_____ D E F I N I T I O N S ______________________________________________
    00049
    00050 #ifdef __ICCAVR__
    00051    #if (defined(__AT90USB1287__) || defined(__AT90USB1286__))
    00052       #define  FLASH_END         0x1FFFF  // Size of flash
    00053       #define  FLASH_PAGE_SIZE   0x100    // Size of page flash
    00054       #define  BOOT_SIZE         0x2000   // Size of bootloader
    00055    #elif (defined(__AT90USB647__) || defined(__AT90USB646__))
    00056       #define  FLASH_END         0x0FFFF  // Size of flash
    00057       #define  FLASH_PAGE_SIZE   0x100    // Size of page flash
    00058       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00059    #elif (defined(__ATmega32U4__) || defined(__ATmega32U6__))
    00060       #define  FLASH_END         0x7FFF   // Size of flash
    00061       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00062       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00063    #elif defined(__ATmega16U4__)
    00064       #define  FLASH_END         0x3FFF   // Size of flash
    00065       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00066       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00067    #elif (defined(__AT90USB162__) )
    00068       #define  FLASH_END         0x3FFF   // Size of flash
    00069       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00070       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00071    #elif (defined(__AT90USB82__) )
    00072       #define  FLASH_END         0x1FFF   // Size of flash
    00073       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00074       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00075    #else
    00076       #error TARGET should be defined
    00077    #endif
    00078 #elif defined __GNUC__
    00079    #if (defined(__AVR_AT90USB1287__) || defined(__AVR_AT90USB1286__))
    00080       #define  FLASH_END         0x1FFFF  // Size of flash
    00081       #define  FLASH_PAGE_SIZE   0x100    // Size of page flash
    00082       #define  BOOT_SIZE         0x2000   // Size of bootloader
    00083    #elif (defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB646__))
    00084       #define  FLASH_END         0x0FFFF  // Size of flash
    00085       #define  FLASH_PAGE_SIZE   0x100    // Size of page flash
    00086       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00087    #elif (defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB646__))
    00088       #define  FLASH_END         0x0FFFF  // Size of flash
    00089       #define  FLASH_PAGE_SIZE   0x100    // Size of page flash
    00090    #elif (defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega32U6__))
    00091       #define  FLASH_END         0x7FFF   // Size of flash
    00092       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00093       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00094    #elif defined(__AVR_ATmega16U4__)
    00095       #define  FLASH_END         0x3FFF   // Size of flash
    00096       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00097       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00098    #elif (defined(__AVR_AT90USB162__) )
    00099       #define  FLASH_END         0x3FFF   // Size of flash
    00100       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00101       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00102    #elif (defined(__AVR_AT90USB82__) )
    00103       #define  FLASH_END         0x1FFF   // Size of flash
    00104       #define  FLASH_PAGE_SIZE   0x80     // Size of page flash
    00105       #define  BOOT_SIZE         0x1000   // Size of bootloader
    00106    #else
    00107       #error TARGET should be defined
    00108    #endif
    00109 #else // Other compiler
    00110    #error Compiler unknow
    00111 #endif
    00112
    00113 #define  LAST_BOOT_ENTRY   (((FLASH_END+1)/2)-2)   // Last boot entry is the last Word of flash (unit Word 16-bit)
    00114 #define  FLASH_SIZE        FLASH_END-BOOT_SIZE
    00115
    00116
    00117 #endif  // FLASH_H
    00118
    00119
    00120
    00121
    00122
    00123
    00124
    00125
    00126
    00127
    00128
    00129
    00130
    00131