📄 spl78k0_kx2_const.h
字号:
/************************************************************************************/
/* */
/* File: spl78k0_kx2_const.h */
/* Project: Selfprogramming application note, MF2 single voltage flash */
/* Device: 78k0/Kx2 */
/* Version: 1v06 */
/* Date: 12.09.2006 09:31 */
/* */
/* Copyright: (c)2004-2006 by NEC Electronics (Europe) GmbH. All rights reserved. */
/* */
/* Description: contains global constant definitions of the selfprogramming library */
/* */
/* Environment: IAR environment for 78K0 and 78K0S (version V3.xx and V4.xx) */
/* */
/************************************************************************************/
#ifndef __SPL78K0_KX2_CONST_H_INCLUDED
#define __SPL78K0_KX2_CONST_H_INCLUDED
// constant definitions
// --------------------
#define BLOCK_SIZE 1024
#define ENTRY_RAM_SIZE 100
#define ERASE_RETRY_COUNTER 9
// offset index within the entry RAM array
#define IDX_START_ADDR_L 0x00
#define IDX_START_ADDR_M 0x01
#define IDX_START_ADDR_H 0x02
#define IDX_BLOCK_NO 0x03
#define IDX_BLOCK_NO_INFO 0x00
#define IDX_WORD_COUNT 0x03
#define IDX_OPTION_BYTE 0x03
#define IDX_DATA_BUF_H 0x04
#define IDX_DATA_BUF_L 0x05
#define IDX_ERASE_RETRY_COUNTER 0x13
// command code definitions
#define CMD_INIT 0x00
#define CMD_ERASE_BLOCK 0x03
#define CMD_WRITE_WORD 0x04
#define CMD_VERIFY_BLOCK 0x06
#define CMD_BLANKCHECK_BLOCK 0x08
#define CMD_GET_INFO 0x09
#define CMD_SET_INFO 0x0A
#define CMD_SET_USER_HANDLER 0x0D
#define CMD_CHECK_FLMD 0x0E
#define CMD_EEP_WRITE_WORD 0x17
// status code definitions (status information returned by self-lib functions)
#define STS_NO_ERROR 0x00
#define STS_FLMD_ERROR 0x01
#define STS_PARAMETER_ERROR 0x05
#define STS_PROTECTION_ERROR 0x10
#define STS_MRG10_ERROR 0x1A
#define STS_MRG11_ERROR 0x1B
#define STS_WRITE_ERROR 0x1C
#define STS_EEPWRITE_VERIFY_ERROR 0x1D
#define STS_EEPWRITE_BLANK_ERROR 0x1E
#define STS_INTERRUPTED 0x1F
#define STS_READ_ERROR 0x20
// option code definitions of the CMD_GET_INFO command
#define OPT_SECURITY_INFO 0x03
#define OPT_BOOTCLUSTER_INFO 0x04
#define OPT_LASTADDRESS_INFO 0x05
// mask pattern for writing security flags
#define MASK_SWAP_BOOTCLUSTER 0xFE
#define MASK_CHIP_ERASE_PROTECTION 0xFD
#define MASK_BLOCK_ERASE_PROTECTION 0xFB
#define MASK_WRITE_PROTECTION 0xF7
#define MASK_BOOTCLUSTER_PROTECTION 0xDF
#define SPL_DEVICE '78k0/kx2'
#define SPL_VERSION '1v06'
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -