📄 eeprom.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. */
/****************************************************************************/
/****************************************************************************/
/* eeprom.h */
/* */
/* EEPROM data manager. */
/****************************************************************************/
#ifndef __EEPROM_H
#define __EEPROM_H
#include "stddef.h"
#include "common.h"
#include "sysmon.h"
#include "app_cfg.h"
/****************************************************************************/
/* Public EEPROM read/write macros. */
/* */
/* Substitutions used in the macros: */
/* object: The name of a scalar or structure object contained in EEPROM. */
/* type: The type of a scalar or structure object contained in EEPROM. */
/* cons: A scalar constant to be written to EEPROM. */
/* var: A scalar or structure object to be read/written from/to EEPROM. */
/* */
/* EE_GETCONST() will return an 8, 16, or 32-bit parameter. This macro must */
/* be used with care since it does not indicate success or failure. */
/* */
/* The remaining macros return TRUE on success or FALSE on failure. */
/* */
/* EE_PUTCONST() writes an 8, 16, or 32-bit parameter to EEPROM */
/* */
/* EE_GETVAR() will return a scalar or structure object to a corresponding */
/* object in the caller's namespace. */
/* */
/* EE_PUTVAR() will copy a scalar or structure object from the caller's */
/* namespace to the corresponding object in the EEPROM. */
/****************************************************************************/
#define EE_GETCONST( parm, type ) ((type)_eeGetConstFromEEPROM( &tsp->parm, sizeof( type )) )
#define EE_PUTCONST( parm, cons ) ( _eePutConstToEEPROM( &tsp->parm, sizeof( tsp->parm ), (int)cons ) )
#define EE_GETVAR( parm, value ) ( _eeGetVarFromEEPROM( &tsp->parm, sizeof( tsp->parm ), &value ) )
#define EE_PUTVAR( parm, value ) ( _eePutVarToEEPROM ( &tsp->parm, sizeof( tsp->parm ), &value ) )
/****************************************************************************/
/* Public interface functions. */
/****************************************************************************/
BOOL eeprom_start( SettingsStruct *pSet, BOOL retain );
EXEC_CC_ENUM eeprom_init( void );
BOOL eeprom_restoreDefault( void );
/****************************************************************************/
/* The following objects are used by the EEPROM read/write macros. They are */
/* not intended to be called by an application program */
/****************************************************************************/
extern SettingsStruct *tsp;
int _eeGetConstFromEEPROM( void *offset, size_t size );
BOOL _eePutConstToEEPROM ( void *offset, size_t size, int cons );
BOOL _eeGetVarFromEEPROM ( void *offset, size_t size, void *pValue );
BOOL _eePutVarToEEPROM ( void *offset, size_t size, void *pValue );
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -