view i2c.h @ 1821:4f3443ecb6d6

Separate compositing from final output. Fixes some minor accuracy issues with regards to when background color reg/CRAM changes take effect. Fixes minor glitch in DF Retro Direct Color DMA demo at inactive/active transition
author Michael Pavone <pavone@retrodev.com>
date Tue, 02 Apr 2019 23:55:21 -0700
parents d94855080529
children
line wrap: on
line source

#ifndef I2C_H_
#define I2C_H_

typedef struct {
	char        *buffer;
	uint32_t    size;
	uint16_t    address;
	uint8_t     host_sda;
	uint8_t     slave_sda;
	uint8_t     scl;
	uint8_t     state;
	uint8_t     counter;
	uint8_t     latch;
} eeprom_state;

void eeprom_init(eeprom_state *state, uint8_t *buffer, uint32_t size);
void * write_eeprom_i2c_w(uint32_t address, void * context, uint16_t value);
void * write_eeprom_i2c_b(uint32_t address, void * context, uint8_t value);
uint16_t read_eeprom_i2c_w(uint32_t address, void * context);
uint8_t read_eeprom_i2c_b(uint32_t address, void * context);

#endif //I2C_H_