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