2 * Copyright (c) Meta Platforms, Inc. and affiliates.
4 * SPDX-License-Identifier: GPL-2.0-only
10 #include "hw/i2c/i2c.h"
13 * Create and realize an AT24C EEPROM device on the heap.
14 * @bus: I2C bus to put it on
15 * @address: I2C address of the EEPROM slave when put on a bus
16 * @rom_size: size of the EEPROM
18 * Create the device state structure, initialize it, put it on the specified
19 * @bus, and drop the reference to it (the device is realized).
21 I2CSlave
*at24c_eeprom_init(I2CBus
*bus
, uint8_t address
, uint32_t rom_size
);
25 * Create and realize an AT24C EEPROM device on the heap with initial data.
26 * @bus: I2C bus to put it on
27 * @address: I2C address of the EEPROM slave when put on a bus
28 * @rom_size: size of the EEPROM
29 * @init_rom: Array of bytes to initialize EEPROM memory with
30 * @init_rom_size: Size of @init_rom, must be less than or equal to @rom_size
32 * Create the device state structure, initialize it, put it on the specified
33 * @bus, and drop the reference to it (the device is realized). Copies the data
34 * from @init_rom to the beginning of the EEPROM memory buffer.
36 I2CSlave
*at24c_eeprom_init_rom(I2CBus
*bus
, uint8_t address
, uint32_t rom_size
,
37 const uint8_t *init_rom
, uint32_t init_rom_size
);