blob: 47282d381ef1dd528c8c4464f1b7134f4a88ccac [file] [log] [blame]
ths663e8e52007-04-02 12:35:34 +00001/*
2 * QEMU EEPROM 93xx emulation
3 *
4 * Copyright (c) 2006-2007 Stefan Weil
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
Blue Swirl8167ee82009-07-16 20:47:01 +000017 * along with this program; if not, see <http://www.gnu.org/licenses/>.
ths663e8e52007-04-02 12:35:34 +000018 */
19
20#ifndef EEPROM93XX_H
21#define EEPROM93XX_H
22
Anthony Liguoric227f092009-10-01 16:12:16 -050023typedef struct _eeprom_t eeprom_t;
ths663e8e52007-04-02 12:35:34 +000024
25/* Create a new EEPROM with (nwords * 2) bytes. */
Anthony Liguoric227f092009-10-01 16:12:16 -050026eeprom_t *eeprom93xx_new(uint16_t nwords);
ths663e8e52007-04-02 12:35:34 +000027
28/* Destroy an existing EEPROM. */
Anthony Liguoric227f092009-10-01 16:12:16 -050029void eeprom93xx_free(eeprom_t *eeprom);
ths663e8e52007-04-02 12:35:34 +000030
31/* Read from the EEPROM. */
Anthony Liguoric227f092009-10-01 16:12:16 -050032uint16_t eeprom93xx_read(eeprom_t *eeprom);
ths663e8e52007-04-02 12:35:34 +000033
34/* Write to the EEPROM. */
Anthony Liguoric227f092009-10-01 16:12:16 -050035void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi);
ths663e8e52007-04-02 12:35:34 +000036
37/* Get EEPROM data array. */
Anthony Liguoric227f092009-10-01 16:12:16 -050038uint16_t *eeprom93xx_data(eeprom_t *eeprom);
ths663e8e52007-04-02 12:35:34 +000039
40#endif /* EEPROM93XX_H */