⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eeprom.h

📁 Code Warrior 4.7 Target : MC9S12DG128B Crystal: 16.000Mhz busclock: 8.000MHz pllclock:16.000MHz
💻 H
字号:
/***********************************
Name:    EEPROMDG128.c
Function:Erase and Program the EEPROM  
Author:  QIU ZHAOPENG  
Data:    2008.10.01 
**     Contents  :
**         SetByte - byte IEE1_SetByte(word Addr,byte Data);
**         GetByte - byte IEE1_GetByte(word Addr,byte *Data);
**         SetWord - byte IEE1_SetWord(word Addr,word Data);
**         GetWord - byte IEE1_GetWord(word Addr,word *Data);
**         SetWait - void IEE1_SetWait(bool Wait);
**         Busy    - bool IEE1_Busy(void); 
** ###################################################################*/

#ifndef __IEE1
#define __IEE1

/* MODULE IEE1. */ 

#pragma CODE_SEG IEE1_CODE             /* Code section for this module. */

#define EEPROMStart        0x0800       /* Start address of EEPROM array */
#define EEPROMEnd          0x0c00       /* End address of EEPROM array */

byte IEE1_SetByte(word Addr,byte Data);
/*
** ===================================================================
**     Method      :  IEE1_SetByte (bean IntEEPROM)
**
**     Description :
**         Method writes given byte to the given address in EEPROM.
**     Parameters  :
**         NAME            - DESCRIPTION
**         Addr            - Address to EEPROM
**         Data            - Data to write
**     Returns     :
**         ---             - Error code
** ===================================================================
*/

byte IEE1_GetByte(word Addr,byte *Data);
/*
** ===================================================================
**     Method      :  IEE1_GetByte (bean IntEEPROM)
**
**     Description :
**         Method reads byte from the given EEPROM address
**     Parameters  :
**         NAME            - DESCRIPTION
**         Addr            - Address to EEPROM
**       * Data            - Pointer to returned 8-bit data
**     Returns     :
**         ---             - Error code
** ===================================================================
*/

byte IEE1_SetWord(word Addr,word Data);
/*
** ===================================================================
**     Method      :  IEE1_SetWord (bean IntEEPROM)
**
**     Description :
**         Method writes given word to the given address in EEPROM.
**     Parameters  :
**         NAME            - DESCRIPTION
**         Addr            - Address to EEPROM
**         Data            - Data to write
**     Returns     :
**         ---             - Error code
** ===================================================================
*/

byte IEE1_GetWord(word Addr,word *Data);
/*
** ===================================================================
**     Method      :  IEE1_GetWord (bean IntEEPROM)
**
**     Description :
**         Method reads word from the given EEPROM address
**     Parameters  :
**         NAME            - DESCRIPTION
**         Addr            - Address to EEPROM
**       * Data            - Pointer to returned 16-bit data
**     Returns     :
**         ---             - Error code
** ===================================================================
*/

#define IEE1_SetWait(Wait) (IEE1_Wait = Wait)
/*
** ===================================================================
**     Method      :  IEE1_SetWait (bean IntEEPROM)
**
**     Description :
**         Method changes wait status of methods SetByte, SetActByte
**         and SetPage.
**     Parameters  :
**         NAME            - DESCRIPTION
**         Wait            - TRUE - methods wait till the write
**                           operation to EEPROM is finished,
**                           FALSE - methods do not wait for the end
**                           of write operation
**     Returns     : Nothing
** ===================================================================
*/

#define IEE1_Busy() (!ESTAT_CBEIF)
/*
** ===================================================================
**     Method      :  IEE1_Busy (bean IntEEPROM)
**
**     Description :
**         Method return status of EEPROM device
**     Parameters  : None
**     Returns     :
**         ---             - TRUE/FALSE - EEPROM is busy/ready
** ===================================================================
*/

void IEE1_Init(void);
/*
** ===================================================================
**     Method      :  IEE1_Init (bean IntEEPROM)
**
**     Description :
**         This method is internal. It is used by Processor Expert
**         only.
** ===================================================================
*/

#pragma CODE_SEG DEFAULT               /* Change code section to DEFAULT. */

/* END IEE1. */

#endif /* ifndef __IEE1 */
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 03.33 for 
**     the Motorola HCS12 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -