]> git.sur5r.net Git - freertos/blob - Demo/AVR32_UC3A_GCC/conf_isp.h
05fd4dcf73c870eeef78fdd83c5391cc10c9c852
[freertos] / Demo / AVR32_UC3A_GCC / conf_isp.h
1 /*This file is prepared for Doxygen automatic documentation generation.*/\r
2 /*! \file ******************************************************************\r
3  *\r
4  * \brief ISP configuration file.\r
5  *\r
6  * This file contains the possible external configuration of the ISP.\r
7  *\r
8  * - Compiler:           IAR EWAVR32 and GNU GCC for AVR32\r
9  * - Supported devices:  All AVR32 devices with a USB module can be used.\r
10  * - AppNote:\r
11  *\r
12  * \author               Atmel Corporation: http://www.atmel.com \n\r
13  *                       Support and FAQ: http://support.atmel.no/\r
14  *\r
15  ***************************************************************************/\r
16 \r
17 /* Copyright (c) 2007, Atmel Corporation All rights reserved.\r
18  *\r
19  * Redistribution and use in source and binary forms, with or without\r
20  * modification, are permitted provided that the following conditions are met:\r
21  *\r
22  * 1. Redistributions of source code must retain the above copyright notice,\r
23  * this list of conditions and the following disclaimer.\r
24  *\r
25  * 2. Redistributions in binary form must reproduce the above copyright notice,\r
26  * this list of conditions and the following disclaimer in the documentation\r
27  * and/or other materials provided with the distribution.\r
28  *\r
29  * 3. The name of ATMEL may not be used to endorse or promote products derived\r
30  * from this software without specific prior written permission.\r
31  *\r
32  * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
33  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
34  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND\r
35  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,\r
36  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
37  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
38  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
39  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
40  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
41  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
42  */\r
43 \r
44 \r
45 #ifndef _CONF_ISP_H_\r
46 #define _CONF_ISP_H_\r
47 \r
48 #include <avr32/io.h>\r
49 #include "compiler.h"\r
50 \r
51 \r
52 //_____ D E F I N I T I O N S ______________________________________________\r
53 \r
54 #define PRODUCT_MANUFACTURER_ID       0x58\r
55 #define PRODUCT_FAMILY_ID             0x20\r
56 \r
57 #define ISP_VERSION                   0x00\r
58 #define ISP_ID0                       0x00\r
59 #define ISP_ID1                       0x00\r
60 \r
61 #define ISP_GPFB_FORCE                31\r
62 #define ISP_GPFB_FORCE_MASK           0x80000000\r
63 #define ISP_GPFB_FORCE_OFFSET         31\r
64 #define ISP_GPFB_FORCE_SIZE           1\r
65 \r
66 #define ISP_GPFB_IO_COND_EN           30\r
67 #define ISP_GPFB_IO_COND_EN_MASK      0x40000000\r
68 #define ISP_GPFB_IO_COND_EN_OFFSET    30\r
69 #define ISP_GPFB_IO_COND_EN_SIZE      1\r
70 \r
71 #define ISP_GPFB_BOD_EN               29\r
72 #define ISP_GPFB_BOD_EN_MASK          0x20000000\r
73 #define ISP_GPFB_BOD_EN_OFFSET        29\r
74 #define ISP_GPFB_BOD_EN_SIZE          1\r
75 \r
76 #define ISP_CFG                       (*(volatile U32 *)ISP_CFG_ADDRESS)\r
77 #define ISP_CFG_ADDRESS               (AVR32_FLASHC_USER_PAGE_ADDRESS + ISP_CFG_OFFSET)\r
78 #define ISP_CFG_OFFSET                0x000001FC\r
79 #define ISP_CFG_SIZE                  4\r
80 \r
81 #define ISP_CFG_BOOT_KEY              17\r
82 #define ISP_CFG_BOOT_KEY_MASK         0xFFFE0000\r
83 #define ISP_CFG_BOOT_KEY_OFFSET       17\r
84 #define ISP_CFG_BOOT_KEY_SIZE         15\r
85 #define ISP_CFG_BOOT_KEY_VALUE        0x494F\r
86 \r
87 #define ISP_CFG_IO_COND_LEVEL         16\r
88 #define ISP_CFG_IO_COND_LEVEL_MASK    0x00010000\r
89 #define ISP_CFG_IO_COND_LEVEL_OFFSET  16\r
90 #define ISP_CFG_IO_COND_LEVEL_SIZE    1\r
91 \r
92 #define ISP_CFG_IO_COND_PIN           8\r
93 #define ISP_CFG_IO_COND_PIN_MASK      0x0000FF00\r
94 #define ISP_CFG_IO_COND_PIN_OFFSET    8\r
95 #define ISP_CFG_IO_COND_PIN_SIZE      8\r
96 \r
97 #define ISP_CFG_CRC8                  0\r
98 #define ISP_CFG_CRC8_MASK             0x000000FF\r
99 #define ISP_CFG_CRC8_OFFSET           0\r
100 #define ISP_CFG_CRC8_SIZE             8\r
101 #define ISP_CFG_CRC8_POLYNOMIAL       0x107\r
102 \r
103 #define ISP_KEY                       (*(volatile U32 *)ISP_KEY_ADDRESS)\r
104 #define ISP_KEY_ADDRESS               (AVR32_SRAM_ADDRESS + ISP_KEY_OFFSET)\r
105 #define ISP_KEY_OFFSET                0x00000000\r
106 #define ISP_KEY_SIZE                  4\r
107 #define ISP_KEY_VALUE                 ('I' << 24 | 'S' << 16 | 'P' << 8 | 'K')\r
108 \r
109 #ifndef ISP_OSC\r
110   #define ISP_OSC                     0\r
111 #endif\r
112 \r
113 #define DFU_FRAME_LENGTH              2048\r
114 \r
115 #define PROGRAM_START_ADDRESS         (AVR32_FLASH_ADDRESS + PROGRAM_START_OFFSET)\r
116 #define PROGRAM_START_OFFSET          0x00002000\r
117 \r
118 \r
119 #endif  // _CONF_ISP_H_\r