root / hw / eeprom93xx.h @ 62ec4832
History | View | Annotate | Download (1.3 kB)
1 | 663e8e51 | ths | /*
|
---|---|---|---|
2 | 663e8e51 | ths | * QEMU EEPROM 93xx emulation
|
3 | 663e8e51 | ths | *
|
4 | 663e8e51 | ths | * Copyright (c) 2006-2007 Stefan Weil
|
5 | 663e8e51 | ths | *
|
6 | 663e8e51 | ths | * This program is free software; you can redistribute it and/or modify
|
7 | 663e8e51 | ths | * it under the terms of the GNU General Public License as published by
|
8 | 663e8e51 | ths | * the Free Software Foundation; either version 2 of the License, or
|
9 | 663e8e51 | ths | * (at your option) any later version.
|
10 | 663e8e51 | ths | *
|
11 | 663e8e51 | ths | * This program is distributed in the hope that it will be useful,
|
12 | 663e8e51 | ths | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | 663e8e51 | ths | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 | 663e8e51 | ths | * GNU General Public License for more details.
|
15 | 663e8e51 | ths | *
|
16 | 663e8e51 | ths | * You should have received a copy of the GNU General Public License
|
17 | 8167ee88 | Blue Swirl | * along with this program; if not, see <http://www.gnu.org/licenses/>.
|
18 | 663e8e51 | ths | */
|
19 | 663e8e51 | ths | |
20 | 663e8e51 | ths | #ifndef EEPROM93XX_H
|
21 | 663e8e51 | ths | #define EEPROM93XX_H
|
22 | 663e8e51 | ths | |
23 | c227f099 | Anthony Liguori | typedef struct _eeprom_t eeprom_t; |
24 | 663e8e51 | ths | |
25 | 663e8e51 | ths | /* Create a new EEPROM with (nwords * 2) bytes. */
|
26 | 5fce2b3e | Alex Williamson | eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords); |
27 | 663e8e51 | ths | |
28 | 663e8e51 | ths | /* Destroy an existing EEPROM. */
|
29 | 5fce2b3e | Alex Williamson | void eeprom93xx_free(DeviceState *dev, eeprom_t *eeprom);
|
30 | 663e8e51 | ths | |
31 | 663e8e51 | ths | /* Read from the EEPROM. */
|
32 | c227f099 | Anthony Liguori | uint16_t eeprom93xx_read(eeprom_t *eeprom); |
33 | 663e8e51 | ths | |
34 | 663e8e51 | ths | /* Write to the EEPROM. */
|
35 | c227f099 | Anthony Liguori | void eeprom93xx_write(eeprom_t *eeprom, int eecs, int eesk, int eedi); |
36 | 663e8e51 | ths | |
37 | 663e8e51 | ths | /* Get EEPROM data array. */
|
38 | c227f099 | Anthony Liguori | uint16_t *eeprom93xx_data(eeprom_t *eeprom); |
39 | 663e8e51 | ths | |
40 | 663e8e51 | ths | #endif /* EEPROM93XX_H */ |