📄 haleep.c
字号:
/* ============================================================================ Project Name : jayaCard Module Name : proto/hal/<template>/haleep.c Version : $Id: haleep.c,v 1.11 2004/01/11 09:56:33 dgil Exp $ Description: EEPROM read/write of byte/word/buffer The Original Code is jayaCard code. The Initial Developer of the Original Code is Gilles Dumortier. Portions created by the Initial Developer are Copyright (C) 2002-2004 the Initial Developer. All Rights Reserved. Contributor(s): This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see http://www.gnu.org/licenses/gpl.html History Rev Description 011903 dgil wrote it from scratch ============================================================================*/#include "precomp.h"/* ========================================================================= porting note: JAYACFG_EEPROM_INVERSED If defined, you must handle the EEPROM content inversion (except for the OTP area and other write-once areas) Otherwise, do nothing special. Why this configuration ? Some EEPROM have a preferred state of FF. But in our COS, our preferred state is 00. These primitives *must* check for bad reading/writing address. In such cases, the component *must* be blocked (HAL_HALT() primitive). ========================================================================= *//* ========================================================================= __hal_eeprom_read_byte() Read a single byte from the EEPROM !this is an unsecure version! BIOS will handle the security around this primitive ========================================================================= */jbyte __hal_eeprom_read_byte(jword src){ // ToBeImplemented return 0;}/* ========================================================================= __hal_eeprom_read_word() Read a word from the EEPROM !this is an unsecure version! BIOS will handle the security around this primitive ========================================================================= */jword __hal_eeprom_read_word(jword src){ // ToBeImplemented return 0;}/* ========================================================================= __hal_eeprom_read() Read a buffer from the EEPROM !this is an unsecure version! BIOS will handle the security around this primitive ========================================================================= */void __hal_eeprom_read(jbyte xdata* dest, jword src,jbyte length){ // ToBeImplemented}/* ========================================================================= __hal_eeprom_write_byte() Write a single byte to the EEPROM. Returns EEPROM_HAL_OK if the write was successful, EEPROM_HAL_ERROR otherwise. Note that this primitive *can* write to write-once and OTP areas !this is an unsecure version! BIOS will handle the security around this primitive ========================================================================= */jbyte __hal_eeprom_write_byte(jword dest,jbyte val){ // ToBeImplemented return EEPROM_HAL_ERROR;}/* ========================================================================= __hal_eeprom_write_word() Write a word to the EEPROM. Returns EEPROM_HAL_OK if the write was successful, EEPROM_HAL_ERROR otherwise. Note that this primitive *can* write to write-once and OTP areas !this is an unsecure version! BIOS will handle the security around this primitive ========================================================================= */jbyte __hal_eeprom_write_word(jword dest,jword word){ // ToBeImplemented return EEPROM_HAL_ERROR;}/* ========================================================================= __hal_eeprom_write() Write a buffer to the EEPROM. Returns EEPROM_HAL_OK if the write was successful, EEPROM_HAL_ERROR otherwise. Note that this primitive *can* write to write-once and OTP areas !this is an unsecure version! BIOS will handle the security around this primitive ========================================================================= */jbyte __hal_eeprom_write(jword dest, jbyte xdata* src,jbyte length){ // ToBeImplemented return EEPROM_HAL_ERROR;}/* ========================================================================= That's all folks ! ========================================================================= */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -