1663e8e51Sths /* 2663e8e51Sths * QEMU EEPROM 93xx emulation 3663e8e51Sths * 4663e8e51Sths * Copyright (c) 2006-2007 Stefan Weil 5663e8e51Sths * 6663e8e51Sths * This program is free software; you can redistribute it and/or modify 7663e8e51Sths * it under the terms of the GNU General Public License as published by 8663e8e51Sths * the Free Software Foundation; either version 2 of the License, or 9663e8e51Sths * (at your option) any later version. 10663e8e51Sths * 11663e8e51Sths * This program is distributed in the hope that it will be useful, 12663e8e51Sths * but WITHOUT ANY WARRANTY; without even the implied warranty of 13663e8e51Sths * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14663e8e51Sths * GNU General Public License for more details. 15663e8e51Sths * 16663e8e51Sths * You should have received a copy of the GNU General Public License 178167ee88SBlue Swirl * along with this program; if not, see <http://www.gnu.org/licenses/>. 18663e8e51Sths */ 19663e8e51Sths 20663e8e51Sths #ifndef EEPROM93XX_H 21663e8e51Sths #define EEPROM93XX_H 22663e8e51Sths 23c227f099SAnthony Liguori typedef struct _eeprom_t eeprom_t; 24663e8e51Sths 25663e8e51Sths /* Create a new EEPROM with (nwords * 2) bytes. */ 26*5fce2b3eSAlex Williamson eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords); 27663e8e51Sths 28663e8e51Sths /* Destroy an existing EEPROM. */ 29*5fce2b3eSAlex Williamson void eeprom93xx_free(DeviceState *dev, eeprom_t *eeprom); 30663e8e51Sths 31663e8e51Sths /* Read from the EEPROM. */ 32c227f099SAnthony Liguori uint16_t eeprom93xx_read(eeprom_t *eeprom); 33663e8e51Sths 34663e8e51Sths /* Write to the EEPROM. */ 35c227f099SAnthony Liguori void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi); 36663e8e51Sths 37663e8e51Sths /* Get EEPROM data array. */ 38c227f099SAnthony Liguori uint16_t *eeprom93xx_data(eeprom_t *eeprom); 39663e8e51Sths 40663e8e51Sths #endif /* EEPROM93XX_H */ 41