Porównaj commity

...

2 Commity

Autor SHA1 Wiadomość Data
Rinaldi Jandrinata 0b08e08b74
Update I2C.md
update constructor
2023-10-16 10:54:02 +07:00
Rinaldi Jandrinata 95215ebf3c
Update eeprom_i2c.py
fixed missing parameter for scan in __init__
2023-10-16 10:40:16 +07:00
2 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -130,6 +130,8 @@ Arguments:
devices it has detected.
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
### 4.1.2 Methods providing byte level access

Wyświetl plik

@ -23,7 +23,7 @@ class EEPROM(BlockDevice):
self._i2c = i2c
if chip_size not in (T24C32, T24C64, T24C128, T24C256, T24C512):
print("Warning: possible unsupported chip. Size:", chip_size)
nchips, min_chip_address = self.scan(verbose, chip_size) # No. of EEPROM chips
nchips, min_chip_address = self.scan(verbose, chip_size, addr, max_chips_count) # No. of EEPROM chips
super().__init__(block_size, nchips, chip_size)
self._min_chip_address = min_chip_address
self._i2c_addr = 0 # I2C address of current chip