> ## Documentation Index
> Fetch the complete documentation index at: https://docs.atopile.io/llms.txt
> Use this file to discover all available pages before exploring further.

# EEPROM

>  Generic EEPROM module with F.I2C interface. 

## Parameters

<ParamField path="memory_size" type="bit" />

## Interfaces

<ParamField path="address[0]" type="ElectricLogic" />

<ParamField path="address[1]" type="ElectricLogic" />

<ParamField path="address[2]" type="ElectricLogic" />

<ParamField path="i2c" type="I2C" />

<ParamField path="power" type="ElectricPower" />

<ParamField path="write_protect" type="ElectricLogic" />

## Global Attributes

These attributes are available to all modules and interfaces in a design.

<ParamField path="lcsc_id" type="str">
  Assign the LCSC ID of the module.

  If set, this will tell the picker to select that part from LCSC for this block.
</ParamField>

<ParamField path="manufacturer" type="str">
  This module's manufacturer name, as a string.

  Only exact matches on the manufacturer's name will be found by the picker.
  It's recommended to fill this information based on what `ato create component`
  provides.
</ParamField>

<ParamField path="mpn" type="str">
  This module's manufacturer part number, as a string.

  For the picker to select the correct part from the manufacturer,
  this must be set.
</ParamField>

<ParamField path="package" type="str">
  The package of the module.

  This drives which components can be selected, and what footprint is used.

  Must exactly match a known package name.
</ParamField>

<ParamField path="exclude_from_bom" type="bool" />

<ParamField path="override_net_name" type="str">
  When set on an interface, this will override the net name of the interface.

  This is useful for renaming nets which are automatically generated.
</ParamField>

<ParamField path="required" type="bool">
  Only for ModuleInterfaces.
  If set to `True`, require that interface is connected to something outside
  of the module it's defined in.
</ParamField>

<RequestExample>
  ```ato Basic Usage theme={null}
  import EEPROM, ElectricPower, I2C, Resistor

  eeprom = new EEPROM
  eeprom.memory_size = 32kbit  # Common sizes: 1k, 2k, 4k, 8k, 16k, 32k, 64k, 128k bit

  # Connect power supply
  power_3v3 = new ElectricPower
  assert power_3v3.voltage within 3.3V +/- 5%
  eeprom.power ~ power_3v3

  # Connect I2C bus
  i2c_bus = new I2C
  i2c_bus.frequency = 400kHz  # Fast mode
  eeprom.i2c ~ i2c_bus

  # Connect to microcontroller
  microcontroller.i2c ~ i2c_bus

  # Set device address using address pins
  eeprom.set_address(0)  # Device address 0b000

  # Connect address pins to power rails for different addresses
  eeprom.address[0].line ~ power_3v3.lv  # A0 = 0
  eeprom.address[1].line ~ power_3v3.lv  # A1 = 0
  eeprom.address[2].line ~ power_3v3.lv  # A2 = 0

  # Write protect control (optional)
  eeprom.write_protect.reference ~ power_3v3
  eeprom.write_protect.line ~ power_3v3.lv  # Enable writes

  # Pull-up resistors for I2C (if not provided elsewhere)
  sda_pullup = new Resistor
  scl_pullup = new Resistor
  sda_pullup.resistance = 4.7kohm +/- 5%
  scl_pullup.resistance = 4.7kohm +/- 5%
  i2c_bus.sda.line ~> sda_pullup ~> power_3v3.hv
  i2c_bus.scl.line ~> scl_pullup ~> power_3v3.hv
  ```
</RequestExample>
