Skip to content

Commit 29fe5e1

Browse files
authored
Update I2C.md
add `addr` and `max_chips_count` example code
1 parent 0b08e08 commit 29fe5e1

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

eeprom/i2c/I2C.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,25 @@ Arguments:
131131
4. `block_size=9` The block size reported to the filesystem. The size in bytes
132132
is `2**block_size` so is 512 bytes by default.
133133
5. `addr` override base address for first chip
134-
6. 'max_chips_count` override max_chips_count
135-
134+
6. `max_chips_count` override max_chips_count
135+
136+
With `addr` and `max_chips_count` override, it's possible to make multiple
137+
configuration
138+
139+
example:
140+
array with custom chips count:
141+
```python
142+
eeprom0 = EEPROM( i2c, max_chips_count=2 )
143+
eeprom1 = EEPROM( i2c, addr=0x52, max_chips_count=2 )
144+
```
145+
1st array using address 0x50 and 0x51 and 2nd using array address 0x52 and 0x53.
146+
147+
individual chip usage:
148+
```python
149+
eeprom0 = EEPROM( i2c, addr=0x50, max_chips_count=1 )
150+
eeprom1 = EEPROM( i2c, addr=0x51, max_chips_count=1 )
151+
```
152+
136153
### 4.1.2 Methods providing byte level access
137154

138155
It is possible to read and write individual bytes or arrays of arbitrary size.

0 commit comments

Comments
 (0)