Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/facts-engineering/circuitpython_at24mac_eeprom


https://github.com/facts-engineering/circuitpython_at24mac_eeprom

Last synced: about 16 hours ago
JSON representation

Awesome Lists containing this project

README

        

# circuitpython-at24mac-eeprom

Driver to interface with AT24MAC402 and AT24MAC602 devices using I2C

## Usage

the AT24MACx02 devices are EEPROM devices with a built-in MAC address.

```python
import at24mac
import board
i2c = busio.I2C(board.SCL, board.SDA)
eeprom = at24mac_eeprom.AT24MAC(i2c)

print(eeprom.mac) # Format for use with Wiznet5k
print([hex(val) for val in eeprom.mac]) # Readable format
print(eeprom.serial_number)
print()

# Write and read to address 0
eeprom[0] = 76
print(eeprom[0])
print()

# Write and read to address 100-104
eeprom[100] = [6, 7, 8, 9, 10]
print([val for val in eeprom[100:105]])
print()

```