?? s12_eets.h
字號:
//=============================================================================
// File: S12_EETS.H - V1.00
// Rem.: The ACPRD Project Page on the Web -> http://hc12web.de/acprd
//=============================================================================
#ifndef __S12_EETS_H
#define __S12_EETS_H
//-- Includes -----------------------------------------------------------------
#include "s12_crg.h" // contains S12_OSCCLK value
//-- EETS Bit Mask Definitions ------------------------------------------------
// Bits in ECLKDIV:
#define UINT16 unsigned int
#define INT8 char
#define BM_EDIVLD 0x80
#define BM_PRDIV8 0x40
// Bits in ECNFG:
#define BM_CBEIE 0x80
#define BM_CCIE 0x40
// Bits in EPROT:
#define BM_EPOPEN 0x80
#define BM_NV6 0x40
#define BM_NV5 0x20
#define BM_NV4 0x10
#define BM_EPDIS 0x08
#define BM_EP2 0x04
#define BM_EP1 0x02
#define BM_EP0 0x01
// Bits in ESTAT:
#define BM_CBEIF 0x80
#define BM_CCIF 0x40
#define BM_PVIOL 0x20
#define BM_ACCERR 0x10
//#define reserved 0x08
#define BM_BLANK 0x04
//#define reserved 0x02
//#define reserved 0x01
//-- Defines ------------------------------------------------------------------
#define EETS_START 0x2000 // 0x0000..0x03ff hidden by Register Block
#define EETS_LAST 0x27ef // 0x0ff0..0x0fff reserved
#define EETS_MAX_SECTOR (((EETS_LAST+1) - EETS_START) / 4)
// This is a simplified equation, suitable for a large number of
// apps - please refer to EETS4K Block Guide for detailed information,
// especially if low clock/bus frequencies (below 4 Mhz) are used!
#if (S12_OSCCLK > 12800000)
#define EETS_ECLKDIV (S12_OSCCLK/1600000 + BM_PRDIV8)
#else
#define EETS_ECLKDIV (S12_OSCCLK/200000)
#endif
// EEPROM Commands:
#define EETS_CMD_EVERIFY 0x05
#define EETS_CMD_PROGRAM 0x20
#define EETS_CMD_SERASE 0x40
#define EETS_CMD_MERASE 0x41
#define EETS_CMD_SMODIFY 0x60
//-- Function Prototypes ------------------------------------------------------
void EEPROM_Init(void);
INT8 wrSectEETS(UINT16 *dest, UINT16 *src);
INT8 writeItemEETS(UINT16 item_no, void *item);
INT8 readItemEETS(UINT16 item_no, void *item);
#endif //__S12_EETS_H =========================================================
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -