Contiki 2.5
flash.h
Go to the documentation of this file.
1 /**
2  * \file
3  * Functions for reading and writing MSP430 flash ROM.
4  * \author Adam Dunkels <adam@sics.se>
5  */
6 
7 /* Copyright (c) 2004 Swedish Institute of Computer Science.
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * 1. Redistributions of source code must retain the above copyright notice,
15  * this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  * 3. The name of the author may not be used to endorse or promote products
20  * derived from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
23  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
26  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
28  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  * $Id: flash.h,v 1.1 2006/06/17 22:41:21 adamdunkels Exp $
35  *
36  * Author: Adam Dunkels <adam@sics.se>
37  *
38  */
39 
40 #ifndef __FLASH_H__
41 #define __FLASH_H__
42 
43 /**
44  * Setup function to be called before any of the flash programming functions.
45  *
46  */
47 void flash_setup(void);
48 
49 /**
50  * Function that is to be called after flashing is done.
51  */
52 void flash_done(void);
53 
54 /**
55  * Write a 16-bit word to flash ROM.
56  *
57  * This function writes a 16-bit word to flash ROM. The function
58  * flash_setup() must have been called first.
59  *
60  * \param addr A pointer to the address in flash ROM which is to be
61  * written.
62  *
63  * \param word The 16-bit word that is to be written.
64  */
65 void flash_write(unsigned short *addr, unsigned short word);
66 
67 /**
68  * Clear a 16-bit word in flash ROM.
69  *
70  * This function clears a 16-bit word in flash ROM. The function
71  * flash_setup() must have been called first.
72  *
73  * \param addr A pointer to the address in flash ROM which is to be
74  * cleared.
75  */
76 void flash_clear(unsigned short *addr);
77 
78 #endif /* __FLASH_H__ */