1 |
581 |
jeremybenn |
//*****************************************************************************
|
2 |
|
|
//
|
3 |
|
|
// flash.h - Prototypes for the flash driver.
|
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 991 of the Stellaris Driver Library.
|
25 |
|
|
//
|
26 |
|
|
//*****************************************************************************
|
27 |
|
|
|
28 |
|
|
#ifndef __FLASH_H__
|
29 |
|
|
#define __FLASH_H__
|
30 |
|
|
|
31 |
|
|
#ifdef __cplusplus
|
32 |
|
|
extern "C"
|
33 |
|
|
{
|
34 |
|
|
#endif
|
35 |
|
|
|
36 |
|
|
//*****************************************************************************
|
37 |
|
|
//
|
38 |
|
|
// Values that can be passed to FlashProtectSet(), and returned by
|
39 |
|
|
// FlashProtectGet().
|
40 |
|
|
//
|
41 |
|
|
//*****************************************************************************
|
42 |
|
|
typedef enum
|
43 |
|
|
{
|
44 |
|
|
FlashReadWrite, // Flash can be read and written
|
45 |
|
|
FlashReadOnly, // Flash can only be read
|
46 |
|
|
FlashExecuteOnly // Flash can only be executed
|
47 |
|
|
}
|
48 |
|
|
tFlashProtection;
|
49 |
|
|
|
50 |
|
|
//*****************************************************************************
|
51 |
|
|
//
|
52 |
|
|
// Prototypes for the APIs.
|
53 |
|
|
//
|
54 |
|
|
//*****************************************************************************
|
55 |
|
|
extern unsigned long FlashUsecGet(void);
|
56 |
|
|
extern void FlashUsecSet(unsigned long ulClocks);
|
57 |
|
|
extern long FlashErase(unsigned long ulAddress);
|
58 |
|
|
extern long FlashProgram(unsigned long *pulData, unsigned long ulAddress,
|
59 |
|
|
unsigned long ulCount);
|
60 |
|
|
extern tFlashProtection FlashProtectGet(unsigned long ulAddress);
|
61 |
|
|
extern long FlashProtectSet(unsigned long ulAddress,
|
62 |
|
|
tFlashProtection eProtect);
|
63 |
|
|
extern long FlashProtectSave(void);
|
64 |
|
|
extern void FlashIntRegister(void (*pfnHandler)(void));
|
65 |
|
|
extern void FlashIntUnregister(void);
|
66 |
|
|
extern void FlashIntEnable(unsigned long ulIntFlags);
|
67 |
|
|
extern void FlashIntDisable(unsigned long ulIntFlags);
|
68 |
|
|
extern unsigned long FlashIntGetStatus(tBoolean bMasked);
|
69 |
|
|
extern void FlashIntClear(unsigned long ulIntFlags);
|
70 |
|
|
|
71 |
|
|
#ifdef __cplusplus
|
72 |
|
|
}
|
73 |
|
|
#endif
|
74 |
|
|
|
75 |
|
|
#endif // __FLASH_H__
|