00001 /* 00002 * QEMU EEPROM 93xx emulation 00003 * 00004 * Copyright (c) 2006-2007 Stefan Weil 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 #ifndef EEPROM93XX_H 00022 #define EEPROM93XX_H 00023 00024 typedef struct _eeprom_t eeprom_t; 00025 00026 /* Create a new EEPROM with (nwords * 2) bytes. */ 00027 eeprom_t *eeprom93xx_new(uint16_t nwords); 00028 00029 /* Destroy an existing EEPROM. */ 00030 void eeprom93xx_free(eeprom_t *eeprom); 00031 00032 /* Read from the EEPROM. */ 00033 uint16_t eeprom93xx_read(eeprom_t *eeprom); 00034 00035 /* Write to the EEPROM. */ 00036 void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi); 00037 00038 /* Get EEPROM data array. */ 00039 uint16_t *eeprom93xx_data(eeprom_t *eeprom); 00040 00041 #endif /* EEPROM93XX_H */