📄 nv_flash.h
字号:
/*****************************************************************************
* This file contains header information for the NV_flash.c file.
*
*
* (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 _NV_FLASH_H_
#define _NV_FLASH_H_
#include "NV_Data.h"
#if (gNV_FlashIncluded_d)
#include "icg.h"
/*****************************************************************************
******************************************************************************
* Public macros
******************************************************************************
*****************************************************************************/
#define HCS08FlashLibVersionNumber_c "V5.20" /* Version number for the
HCS08 flash library */
#define HCS08FlashLibVersionText "HCS08 Flash Lib" \
HCS08FlashLibVersionNumber_c " "__DATE__" "__TIME__
#define HCS08FlashLibVersionTextLen_c 49 /*Not used */
#define gProtectFlashEnabled_d 1
/* Any application embedding the HCS08 Flash Lib must allocate some memory for
critical flash programming functions. This is necessary because code cannot
execute from flash being programmed. The memory can be on the stack,
heap (malloc) or a static reserve memory area. Use the below define to
reserve enough memory.*/
/* Absolute address for NV function in RAM - be carefull*/
/*If size is changed in Linker file these values must be changed accordingly*/
#define CriticalFlashCodeSize_c (0x40) /* The code size of
pfNVFlashCommomExecuteCmdInFlash().The size can be found in the map
file (max. 255 bytes) Not used */
#ifdef gProtectFlashEnabled_d
#define ProtectFlash DisableInterrupts
#define UnprotectFlash EnableInterrupts
#else
#define ProtectFlash /* Empty */
#define UnprotectFlash /* Empty */
#endif gProtectFlashEnabled_d
#define NVFOPT_VALUE 0x02 /* No backdoor key allowed, vectors redirect
enabled, unsecure.Used in crt0.h */
#define NVFPROT_VALUE 0x98 /* Any flash location (not protected) can be
erased or programmed, flash is protected as specified in
FPS2:FPS1:FPS0 (0xF000-0xFFFF)(=4KB),Used in crt0.h */
/*****************************************************************************
******************************************************************************
* Public prototypes
******************************************************************************
*****************************************************************************/
extern void NVM_FindNVRAM(void);
/*****************************************************************************
******************************************************************************
* Public type definitions
******************************************************************************
*****************************************************************************/
typedef bool_t(*pfNVFlashCommomExecuteCMD_tag) \
(uint8_t data, uint8_t *pDestination, uint8_t flashCommand);
/*public typedefs*/
enum {
gMacEventNwkMlmeMsgQueued_c = 1 << 0, /* A message from NWK to MLME was queued */
gMacEventNwkMcpsMsgQueued_c = 1 << 1, /* A message from NWK to MCPS was queued */
gMacEventMemMlmeMsgQueued_c = 1 << 2, /* A message from MEM to MLME was queued */
gMacEventMemAspMsgQueued_c = 1 << 3, /* A message from MEM to ASP was queued */
};
/*****************************************************************************
******************************************************************************
* Public memory declarations
*****************************************************************************
*****************************************************************************/
#pragma DATA_SEG NV_FLASH_RAM
extern pfNVFlashCommomExecuteCMD_tag pfNVFlashCommomExecuteCMD_t; /*Pointer
to NV function copied to RAM */
#pragma DATA_SEG DEFAULT
/*****************************************************************************
******************************************************************************
* Public functions
******************************************************************************
*****************************************************************************/
void BUtl_ChangeReceiverStatus
(
uint8_t requestedStatus
);
bool_t FlashEraseSector(
uint8_t sectorNumber /* IN:sector to be erased */
);
#endif /*(gNV_FlashIncluded_d) */
#endif _NV_FLASH_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -