Mercurial > repos > blastem
annotate i2c.h @ 1569:0ec89dadb36d
Add code for loading PNG images. Added 360 controller image. WIP work on gamepad mapping UI
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 19 Apr 2018 00:51:10 -0700 |
parents | d94855080529 |
children |
rev | line source |
---|---|
1414
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef I2C_H_ |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define I2C_H_ |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 typedef struct { |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 char *buffer; |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 uint32_t size; |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
7 uint16_t address; |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
8 uint8_t host_sda; |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
9 uint8_t slave_sda; |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 uint8_t scl; |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 uint8_t state; |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 uint8_t counter; |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 uint8_t latch; |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 } eeprom_state; |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 void eeprom_init(eeprom_state *state, uint8_t *buffer, uint32_t size); |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 void * write_eeprom_i2c_w(uint32_t address, void * context, uint16_t value); |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 void * write_eeprom_i2c_b(uint32_t address, void * context, uint8_t value); |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 uint16_t read_eeprom_i2c_w(uint32_t address, void * context); |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 uint8_t read_eeprom_i2c_b(uint32_t address, void * context); |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 |
d94855080529
Move I2C EEPROM and NOR Flash functions out of romdb.c into new files
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 #endif //I2C_H_ |