]> git.sur5r.net Git - freertos/blob - Demo/CORTEX_LM3S2965_KEIL/LuminaryDrivers/hw_flash.h
Update to V4.3.0 as described in http://www.FreeRTOS.org/History.txt
[freertos] / Demo / CORTEX_LM3S2965_KEIL / LuminaryDrivers / hw_flash.h
1 //*****************************************************************************\r
2 //\r
3 // hw_flash.h - Macros used when accessing the flash controller.\r
4 //\r
5 // Copyright (c) 2005-2007 Luminary Micro, Inc.  All rights reserved.\r
6 // \r
7 // Software License Agreement\r
8 // \r
9 // Luminary Micro, Inc. (LMI) is supplying this software for use solely and\r
10 // exclusively on LMI's microcontroller products.\r
11 // \r
12 // The software is owned by LMI and/or its suppliers, and is protected under\r
13 // applicable copyright laws.  All rights are reserved.  Any use in violation\r
14 // of the foregoing restrictions may subject the user to criminal sanctions\r
15 // under applicable laws, as well as to civil liability for the breach of the\r
16 // terms and conditions of this license.\r
17 // \r
18 // THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED\r
19 // OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF\r
20 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.\r
21 // LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR\r
22 // CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.\r
23 // \r
24 // This is part of revision 1408 of the Stellaris Peripheral Driver Library.\r
25 //\r
26 //*****************************************************************************\r
27 \r
28 #ifndef __HW_FLASH_H__\r
29 #define __HW_FLASH_H__\r
30 \r
31 //*****************************************************************************\r
32 //\r
33 // The following define the offsets of the FLASH registers.\r
34 //\r
35 //*****************************************************************************\r
36 #define FLASH_FMA               0x400FD000  // Memory address register\r
37 #define FLASH_FMD               0x400FD004  // Memory data register\r
38 #define FLASH_FMC               0x400FD008  // Memory control register\r
39 #define FLASH_FCRIS             0x400FD00c  // Raw interrupt status register\r
40 #define FLASH_FCIM              0x400FD010  // Interrupt mask register\r
41 #define FLASH_FCMISC            0x400FD014  // Interrupt status register\r
42 #define FLASH_FMPRE             0x400FE130  // FLASH read protect register\r
43 #define FLASH_FMPPE             0x400FE134  // FLASH program protect register\r
44 #define FLASH_USECRL            0x400FE140  // uSec reload register\r
45 #define FLASH_FMPRE0            0x400FE200  // FLASH read protect register 0\r
46 #define FLASH_FMPRE1            0x400FE204  // FLASH read protect register 1\r
47 #define FLASH_FMPRE2            0x400FE208  // FLASH read protect register 2\r
48 #define FLASH_FMPRE3            0x400FE20C  // FLASH read protect register 3\r
49 #define FLASH_FMPPE0            0x400FE400  // FLASH program protect register 0\r
50 #define FLASH_FMPPE1            0x400FE404  // FLASH program protect register 1\r
51 #define FLASH_FMPPE2            0x400FE408  // FLASH program protect register 2\r
52 #define FLASH_FMPPE3            0x400FE40C  // FLASH program protect register 3\r
53 \r
54 //*****************************************************************************\r
55 //\r
56 // The following define the bit fields in the FLASH_FMC register.\r
57 //\r
58 //*****************************************************************************\r
59 #define FLASH_FMC_WRKEY_MASK    0xFFFF0000  // FLASH write key mask\r
60 #define FLASH_FMC_WRKEY         0xA4420000  // FLASH write key\r
61 #define FLASH_FMC_COMT          0x00000008  // Commit user register\r
62 #define FLASH_FMC_MERASE        0x00000004  // Mass erase FLASH\r
63 #define FLASH_FMC_ERASE         0x00000002  // Erase FLASH page\r
64 #define FLASH_FMC_WRITE         0x00000001  // Write FLASH word\r
65 \r
66 //*****************************************************************************\r
67 //\r
68 // The following define the bit fields in the FLASH_FCRIS register.\r
69 //\r
70 //*****************************************************************************\r
71 #define FLASH_FCRIS_PROGRAM     0x00000002  // Programming status\r
72 #define FLASH_FCRIS_ACCESS      0x00000001  // Invalid access status\r
73 \r
74 //*****************************************************************************\r
75 //\r
76 // The following define the bit fields in the FLASH_FCIM register.\r
77 //\r
78 //*****************************************************************************\r
79 #define FLASH_FCIM_PROGRAM      0x00000002  // Programming mask\r
80 #define FLASH_FCIM_ACCESS       0x00000001  // Invalid access mask\r
81 \r
82 //*****************************************************************************\r
83 //\r
84 // The following define the bit fields in the FLASH_FMIS register.\r
85 //\r
86 //*****************************************************************************\r
87 #define FLASH_FCMISC_PROGRAM    0x00000002  // Programming status\r
88 #define FLASH_FCMISC_ACCESS     0x00000001  // Invalid access status\r
89 \r
90 //*****************************************************************************\r
91 //\r
92 // The following define the bit fields in the FLASH_FMPRE and FLASH_FMPPE\r
93 // registers.\r
94 //\r
95 //*****************************************************************************\r
96 #define FLASH_FMP_BLOCK_31      0x80000000  // Enable for block 31\r
97 #define FLASH_FMP_BLOCK_30      0x40000000  // Enable for block 30\r
98 #define FLASH_FMP_BLOCK_29      0x20000000  // Enable for block 29\r
99 #define FLASH_FMP_BLOCK_28      0x10000000  // Enable for block 28\r
100 #define FLASH_FMP_BLOCK_27      0x08000000  // Enable for block 27\r
101 #define FLASH_FMP_BLOCK_26      0x04000000  // Enable for block 26\r
102 #define FLASH_FMP_BLOCK_25      0x02000000  // Enable for block 25\r
103 #define FLASH_FMP_BLOCK_24      0x01000000  // Enable for block 24\r
104 #define FLASH_FMP_BLOCK_23      0x00800000  // Enable for block 23\r
105 #define FLASH_FMP_BLOCK_22      0x00400000  // Enable for block 22\r
106 #define FLASH_FMP_BLOCK_21      0x00200000  // Enable for block 21\r
107 #define FLASH_FMP_BLOCK_20      0x00100000  // Enable for block 20\r
108 #define FLASH_FMP_BLOCK_19      0x00080000  // Enable for block 19\r
109 #define FLASH_FMP_BLOCK_18      0x00040000  // Enable for block 18\r
110 #define FLASH_FMP_BLOCK_17      0x00020000  // Enable for block 17\r
111 #define FLASH_FMP_BLOCK_16      0x00010000  // Enable for block 16\r
112 #define FLASH_FMP_BLOCK_15      0x00008000  // Enable for block 15\r
113 #define FLASH_FMP_BLOCK_14      0x00004000  // Enable for block 14\r
114 #define FLASH_FMP_BLOCK_13      0x00002000  // Enable for block 13\r
115 #define FLASH_FMP_BLOCK_12      0x00001000  // Enable for block 12\r
116 #define FLASH_FMP_BLOCK_11      0x00000800  // Enable for block 11\r
117 #define FLASH_FMP_BLOCK_10      0x00000400  // Enable for block 10\r
118 #define FLASH_FMP_BLOCK_9       0x00000200  // Enable for block 9\r
119 #define FLASH_FMP_BLOCK_8       0x00000100  // Enable for block 8\r
120 #define FLASH_FMP_BLOCK_7       0x00000080  // Enable for block 7\r
121 #define FLASH_FMP_BLOCK_6       0x00000040  // Enable for block 6\r
122 #define FLASH_FMP_BLOCK_5       0x00000020  // Enable for block 5\r
123 #define FLASH_FMP_BLOCK_4       0x00000010  // Enable for block 4\r
124 #define FLASH_FMP_BLOCK_3       0x00000008  // Enable for block 3\r
125 #define FLASH_FMP_BLOCK_2       0x00000004  // Enable for block 2\r
126 #define FLASH_FMP_BLOCK_1       0x00000002  // Enable for block 1\r
127 #define FLASH_FMP_BLOCK_0       0x00000001  // Enable for block 0\r
128 \r
129 //*****************************************************************************\r
130 //\r
131 // The following define the bit fields in the FLASH_USECRL register.\r
132 //\r
133 //*****************************************************************************\r
134 #define FLASH_USECRL_MASK       0x000000FF  // Clock per uSec\r
135 #define FLASH_USECRL_SHIFT      0\r
136 \r
137 //*****************************************************************************\r
138 //\r
139 // The erase size is the size of the FLASH block that is erased by an erase\r
140 // operation, and the protect size is the size of the FLASH block that is\r
141 // protected by each protection register.\r
142 //\r
143 //*****************************************************************************\r
144 #define FLASH_ERASE_SIZE        0x00000400\r
145 #define FLASH_PROTECT_SIZE      0x00000800\r
146 \r
147 #endif // __HW_FLASH_H__\r