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

📄 eeprom_drv.h

📁 飞思卡尔车身控制技术研讨会资料范例 基于LIN的收发通信
💻 H
字号:
/*******************************************************************************/
/*
Copyright (c) 2008 Freescale Semiconductor
\file       EEPROM_Drv.h
\brief      Definitions and function prototypes for S08DZ60 EEPROM driver
\author     Freescale Semiconductor
\author     B01246/ B07297
\version    0.1
\date       January/2008
*/
/*******************************************************************************/

#ifndef EEPROMDRV_H        /*prevent duplicated includes*/
#define EEPROMDRV_H

#include "derivative.h" /* include peripheral declarations */

#define EEPROM_DIV      (39) //Clock divisor for Busclock=8Mhz.

/*------------------------------------------------------------------------------*/
#define EEPROMStart                     0x1400 
#define EEPROMEnd                       0x17FF 

#define ERR_OK                          0             /* OK */
#define ERR_RANGE                       1             /* Parameter out of range */
#define ERR_BUSY                        2             /* Device is busy */
#define ERR_MISALIGN                    3             /* Requested value or method not available */
#define ERR_NON_BLANK                   4             /* EEPROM word not blank */

#define EEPROM_BUSY                     0
#define EEPROM_READY                    1

#define NO_TASK_PENDING                 0
#define BYTE_PROGRAM_REQUEST            1
#define SECTOR_ERASE_REQUEST            2
#define BYTE_ERASE_REQUEST              3
#define WAIT_COMMAND_COMPLETION         4

/*-- Function Prototypes -------------------------------------------------------*/
void vfnEE_Init(UINT8 val);
UINT8 EE_GetByte(UINT16 Addr,UINT8 *Data);
UINT8 EE_GetWord(UINT16 Addr,UINT16 *Data);

UINT8 IsEEPROMBusy(void);
UINT8 u8ByteWriteOnlyEEPROM(UINT16 AddrByte,UINT8 *Data8_ptr, UINT8 Bytes);
UINT8 u8ByteWriteEEPROM(UINT16 AddrByte,UINT8 *Data8_ptr, UINT8 Bytes);
UINT8 u8SectorEraseEEPROM(UINT16 AddrSect, UINT8 Sectors);
void vfnEEPROM_Tasks(void);
/*------------------------------------------------------------------------------*/
#endif /*EEPROM_DRV_H*/


/*******************************************************************************/
/*                                                                             */
/* All software, source code, included documentation, and any implied know-how */
/* are property of Freescale Semiconductor and therefore considered            */ 
/* CONFIDENTIAL INFORMATION.                                                   */
/*                                                                             */
/* This confidential information is disclosed FOR DEMONSTRATION PURPOSES ONLY. */
/*                                                                             */
/* All Confidential Information remains the property of Freescale Semiconductor*/
/* and will not be copied or reproduced without the express written permission */
/* of the Discloser, except for copies that are absolutely necessary in order  */
/* to fulfill the Purpose.                                                     */
/*                                                                             */
/* Services performed by FREESCALE in this matter are performed AS IS and      */
/* without any warranty. CUSTOMER retains the final decision relative to the   */
/* total design and functionality of the end product.                          */
/*                                                                             */
/* FREESCALE neither guarantees nor will be held liable by CUSTOMER for the    */
/* success of this project.                                                    */
/*                                                                             */
/* FREESCALE disclaims all warranties, express, implied or statutory including,*/
/* but not limited to, implied warranty of merchantability or fitness for a    */
/* particular purpose on any hardware, software ore advise supplied to the     */
/* project by FREESCALE, and or any product resulting from FREESCALE services. */
/*                                                                             */
/* In no event shall FREESCALE be liable for incidental or consequential       */
/* damages arising out of this agreement. CUSTOMER agrees to hold FREESCALE    */
/* harmless against any and all claims demands or actions by anyone on account */
/* of any damage,or injury, whether commercial, contractual, or tortuous,      */
/* rising directly or indirectly as a result of the advise or assistance       */
/* supplied CUSTOMER in connectionwith product, services or goods supplied     */
/* under this Agreement.                                                       */
/*                                                                             */
/*******************************************************************************/

⌨️ 快捷键说明

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