Main Page | Modules | Data Structures | File List | Data Fields | Globals | Examples

flash.h

Go to the documentation of this file.
00001 /**
00002  * \file
00003  * Functions for reading and writing flash ROM.
00004  * \author Adam Dunkels <adam@sics.se> 
00005  */
00006 
00007 /* Copyright (c) 2004 Swedish Institute of Computer Science.
00008  * All rights reserved.
00009  *
00010  * Redistribution and use in source and binary forms, with or without modification,
00011  * are permitted provided that the following conditions are met:
00012  *
00013  * 1. Redistributions of source code must retain the above copyright notice,
00014  *    this list of conditions and the following disclaimer.
00015  * 2. Redistributions in binary form must reproduce the above copyright notice,
00016  *    this list of conditions and the following disclaimer in the documentation
00017  *    and/or other materials provided with the distribution.
00018  * 3. The name of the author may not be used to endorse or promote products
00019  *    derived from this software without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
00022  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00023  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
00024  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
00026  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00027  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00028  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
00029  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
00030  * OF SUCH DAMAGE.
00031  *
00032  * $Id: flash.h,v 1.1 2004/11/12 13:07:21 adam Exp $
00033  *
00034  * Author: Adam Dunkels <adam@sics.se>
00035  *
00036  */
00037 
00038 #ifndef __FLASH_H__
00039 #define __FLASH_H__
00040 
00041 /**
00042  * Setup function to be called before any of the flash programming functions.
00043  *
00044  */
00045 void flash_setup(void);
00046 
00047 /**
00048  * Function that is to be called after flashing is done.
00049  */
00050 void flash_done(void);
00051 
00052 /**
00053  * Write a 16-bit word to flash ROM.
00054  *
00055  * This function writes a 16-bit word to flash ROM. The function
00056  * flash_setup() must have been called first.
00057  *
00058  * \param addr A pointer to the address in flash ROM which is to be
00059  * written.
00060  *
00061  * \param word The 16-bit word that is to be written.
00062  */
00063 void flash_write(unsigned short *addr, unsigned short word);
00064 
00065 /**
00066  * Clear a 16-bit word in flash ROM.
00067  *
00068  * This function clears a 16-bit word in flash ROM. The function
00069  * flash_setup() must have been called first. 
00070  *
00071  * \param addr A pointer to the address in flash ROM which is to be
00072  * cleared.
00073  */
00074 void flash_clear(unsigned short *addr);
00075 
00076 #endif /* __FLASH_H__ */

Generated on Wed Jul 6 01:18:59 2005 for Contiki/ESB by doxygen 1.3.6