📄 nvm_interface.h
字号:
/*****************************************************************************
* This module contains Interface for the NV flash module.
*
*
* (c) Copyright 2005, Freescale, Inc. All rights reserved.
*
* Freescale Semiconductor Confidential Proprietary
*
* No part of this document must be reproduced in any form - including copied,
* transcribed, printed or by any electronic means - without specific written
* permission from Freescale Semiconductor Danmark A/S.
*****************************************************************************/
#ifndef _NVM_INTERFACE_H
#define _NVM_INTERFACE_H
#include "NV_Data.h"
/*****************************************************************************
******************************************************************************
* Public macros
******************************************************************************
*****************************************************************************/
/* Macro definitions for accessing NVM sections */
#define NVM_GetScatchNVMLocation() gpScratchPadNvram
#define NVM_GetMacNVMLocation() gpMacNvram
#define NVM_GetNwkNVMLocation() gpNwkNvram
#define NVM_GetApsNVMLocation() gpApsZdoNvram
#define NVM_GetSspNVMLocation() gpSspNvram
/*****************************************************************************
* Updates the specified NV RAM data.The new data will be written to copy
* NV RAM section. All other data must be copied too.
*
* Interface assumptions:
* Assumes NVM is set by calling NVM_FlashSetup()
* Must protect from interrupts, because this function can be called from
* application.
*
* Arguments:
* pNVRAMDestination = points where data to be written in active NVRAM
* section (IN)
* pSource = points where data must be read from RAM (IN)
* cSourceLength - Length of the data to be updated (IN)
*
* Return value:
* TRUE - NV RAM updated succcessfully, FALSE - Something went wrong (error)
*
* Revison history:
* date Author Comments
* ------ ------- --------
* 02062005 LS, FSL Created
*****************************************************************************/
bool_t NVM_WriteNVRAM(uint8_t *pNVRAMDestination, uint8_t *pSource, \
uint16_t cSourceLength);
/*****************************************************************************
* Reads the NVRAM data from the specified Address.
*
* Interface assumptions:
* cSourceLength should give length including arry elements
*
* Arguments:
* PDestination = destination address (RAM address) where data has to be
* copied (IN)
* pNVRAMSource = address in NVRAM from where data has to be copied (IN)
* cSourceLength = length of data to be copied from NVRAM (IN)
*
* Return value:
* Status
*
* Revison history:
* date Author Comments
* ------ ------- --------
* 02062005 LS, FSL Created
*****************************************************************************/
bool_t NVM_ReadNVRAM (uint8_t *PDestination, uint8_t *pNVRAMSource, \
uint16_t cSourceLength);
/*****************************************************************************
* void NVM_FlashSetup(void)
*
* Sets flash specific registers and copies the critical flash execution part
* to RAM for execution.
*
* Interface assumptions:
*
* Note! Max. 255 bytes - else change counter to uint16_t
*
* Revison history:
* date Author Comments
* ------ ------- --------
* 02062005 LS, FSL Created
*****************************************************************************/
void NVM_FlashSetup(void);
/*****************************************************************************
* locates the NV RAM to use.
*
* Revison history:
* date Author Comments
* ------ ------- --------
* 02062005 LS, FSL Created
*****************************************************************************/
void NVM_FindNVRAM(void);
#endif _NVM_INTERFACE_H /* _NVM_INTERFACE_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -