From 29fe5e1aabf456aa03759dbe301f6e4308990740 Mon Sep 17 00:00:00 2001 From: Rinaldi Jandrinata <48564964+puppet13th@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:30:46 +0700 Subject: [PATCH] Update I2C.md add `addr` and `max_chips_count` example code --- eeprom/i2c/I2C.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/eeprom/i2c/I2C.md b/eeprom/i2c/I2C.md index 87d92eb..711ad83 100644 --- a/eeprom/i2c/I2C.md +++ b/eeprom/i2c/I2C.md @@ -131,8 +131,25 @@ Arguments: 4. `block_size=9` The block size reported to the filesystem. The size in bytes is `2**block_size` so is 512 bytes by default. 5. `addr` override base address for first chip - 6. 'max_chips_count` override max_chips_count + 6. `max_chips_count` override max_chips_count + With `addr` and `max_chips_count` override, it's possible to make multiple + configuration + + example: + array with custom chips count: + ```python + eeprom0 = EEPROM( i2c, max_chips_count=2 ) + eeprom1 = EEPROM( i2c, addr=0x52, max_chips_count=2 ) + ``` + 1st array using address 0x50 and 0x51 and 2nd using array address 0x52 and 0x53. + + individual chip usage: + ```python + eeprom0 = EEPROM( i2c, addr=0x50, max_chips_count=1 ) + eeprom1 = EEPROM( i2c, addr=0x51, max_chips_count=1 ) + ``` + ### 4.1.2 Methods providing byte level access It is possible to read and write individual bytes or arrays of arbitrary size.