📄 rom400_flash.h
字号:
/*---------------------------------------------------------------------------
* Copyright (C) 2003 Dallas Semiconductor Corporation, All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of Dallas Semiconductor
* shall not be used except as stated in the Dallas Semiconductor
* Branding Policy.
* ---------------------------------------------------------------------------
*
* This file contains function definitions for the built-in ROM functions
* of the Dallas Semiconductor 400 processor. This file is intended for use
* with the Keil MicroVision (uVision) C compiler.
*
* ---------------------------------------------------------------------------
*/
#ifndef __rom400_flash_
#define __rom400_flash_
/** \file rom400_flash.h
* \brief Flash programming functions for the TINIm400 module.
*
* This library contains functions that allow applications to access the
* ROM's flash erasing and programming algorithms. Any flash that is
* compatible with the DS80C400 boot loader's functions will be compatible
* with this library.
*
* For detailed information on the DS80C400 please see the
* <a href="http://pdfserv.maxim-ic.com/arpdf/Design/DS80C400UG.pdf">
* High-Speed Microcontroller User's Guide: DS80C400 Supplement</a>.
*
* The functions in this library are multi-process safe--that is, if you
* call the same method from two different processes at the same time,
* the parameters to the function will not be destroyed. However, multiple
* processes should not be performing flash altering operations without some
* kind of synchronization control.
*/
/** Version number associated with this header file. Should be the same as
* the version number returned by the <i>#flash_version</i> function.
* \sa #flash_version */
#define ROM400_FLASH_VERSION 2
/**
* \brief Erase a flash block.
*
* Erases the block of flash that begins at address <i>blocknum</i>:00:00.
* This operation checks to see if the block is RAM or is the ROM (<i>blocknum</i>
* equals FF), in which case the operation fails.
*
* \param blocknum bank/block number of flash to erase
*
* \return 0 if the erase was successful, 1 if the erase could not be
* performed.
*/
// ---------------------------------------------------------------------------
unsigned char flash_eraseblock(unsigned char blocknum);
/**
* \brief Program a byte of flash.
*
* Programs the byte <i>b</i> to the address <i>location</i>. If the location
* is unprogrammable (too many zero bits have already been set) the operation
* fails.
*
* \param location The address to write the value <i>b</i> to
* \param b The value to be programmed
*
* \return 0 if the program is successful, 1 if the operation could not
* be performed.
*/
// ---------------------------------------------------------------------------
unsigned char flash_programbyte(void* location, unsigned char b);
/**
* \brief Returns the version number of this flash library.
*
* \return Version number of this flash library.
*/
//---------------------------------------------------------------------------
unsigned int flash_version(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -