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

📄 eeprom_24cxx.h

📁 IT projecotr reference design.
💻 H
字号:
/****************************************************************************/
/*             TEXAS INSTRUMENTS PROPRIETARY INFORMATION                    */
/*                                                                          */
/*  (c) Copyright, Texas Instruments Incorporated, 2006.                    */
/*      All Rights Reserved.                                                */
/*                                                                          */
/*  Property of Texas Instruments Incorporated. Restricted Rights -         */
/*  Use, duplication, or disclosure is subject to restrictions set          */
/*  forth in TI's program license agreement and associated documentation.   */
/****************************************************************************/

/****************************************************************************/
/* eeeprom_24cXX.h.                                                         */
/*                                                                          */
/* 24cXX-family EEPROM driver.                                              */
/****************************************************************************/

#ifndef __EEPROM24CXX_H
#define __EEPROM24CXX_H

#include <stddef.h>

#include "common.h"
#include "i2c.h"


/****************************************************************************/
/* Driver declarations.                                                     */
/****************************************************************************/

#define EEWRITECYCLE    5000   /* max EEPROM write cycle time, microseconds */


typedef enum                              /* EEPROM driver completion codes */
{
    EEPROM_FAIL,                                         /* general failure */
    EEPROM_PASS,                                       /* normal completion */
    EEPROM_ADDR,                                         /* invalid address */
    EEPROM_SEM,                              /* can't acquire i2c semaphore */
    EEPROM_API,                                       /* i2c API call error */
    EEPROM_DEVICE,                            /* unknown EERPOM device type */
    EEPROM_CLOSED                        /* device is closed, not available */
    
} EEPROM_CC;


typedef enum                                           /* 24cXX device type */
{
    EE_24C01,
    EE_24C02,
    EE_24C04,
    EE_24C08,
    EE_24C16,
    EE_24C32,
    EE_24C64,
    
    EE_24MAX
    
} EE_TYPE;


typedef struct _eepromInitStruct
{
    I2CPORT portNo;                                  /* API i2c Port number */
    EE_TYPE eeType;                                          /* device type */
    uint08  baseAddr;                       /* base i2c device address << 1 */
    uint08  ttimeout; /* tenths of seconds operation timeout (25.5 sec max) */
    
} EEPROM_INITSTRUCT;
 
  
  
  
/****************************************************************************/
/* Driver functions.                                                        */
/****************************************************************************/

EEPROM_CC EEPROM_Open( const EEPROM_INITSTRUCT *pInitStruct );
EEPROM_CC EEPROM_GetData( BOOL mirror, uint16 offset, size_t numBytes, void *data );
EEPROM_CC EEPROM_PutData( BOOL mirror, uint16 offset, size_t numBytes, void *data );

#endif

⌨️ 快捷键说明

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