blob: 72a7c81efced2c3589faa1fc154a349d8f530164 [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
malc99a09492009-10-01 22:20:47 +040023typedef struct eeprom a_eeprom;
ths663e8e52007-04-02 12:35:34 +000024
25/* Create a new EEPROM with (nwords * 2) bytes. */
malc99a09492009-10-01 22:20:47 +040026a_eeprom *eeprom93xx_new(uint16_t nwords);
ths663e8e52007-04-02 12:35:34 +000027
28/* Destroy an existing EEPROM. */
malc99a09492009-10-01 22:20:47 +040029void eeprom93xx_free(a_eeprom *eeprom);
ths663e8e52007-04-02 12:35:34 +000030
31/* Read from the EEPROM. */
malc99a09492009-10-01 22:20:47 +040032uint16_t eeprom93xx_read(a_eeprom *eeprom);
ths663e8e52007-04-02 12:35:34 +000033
34/* Write to the EEPROM. */
malc99a09492009-10-01 22:20:47 +040035void eeprom93xx_write(a_eeprom *eeprom, int eecs, int eesk, int eedi);
ths663e8e52007-04-02 12:35:34 +000036
37/* Get EEPROM data array. */
malc99a09492009-10-01 22:20:47 +040038uint16_t *eeprom93xx_data(a_eeprom *eeprom);
ths663e8e52007-04-02 12:35:34 +000039
40#endif /* EEPROM93XX_H */