the size itself to the binary logarithm of the size.
- Default value of this parameter changed from None to 7, to match the
behaviour of the constructor in its previous form, as discussed in the PR.
- Dictionary _PAGE_SIZES removed.
- Documentation updated.
[Description]
Adds support of:
1. Microchip AT24C32 (4 KiB)
2. Support of single chip setup for `EEPROM` class when single chip has address is
0x57 so entire set of chips (1 chip in our case) addresses are not started from 0x50.
Example:
```python
from eeprom_i2c import EEPROM, T24C32
eeprom = PROM(machine.I2C(0), T24C32)
```
Improves tests implementation by adding dependency injection of `EEPROM`
object used during testing with support of old use case when object
had not been provided for testing.
Example (for AT24C32 connected to I2C0 of my Raspberry Pi Pico W) when we
creating instance of `EEPROM` and then passing it to `full_test` and also
providing proper block size for this chip:
```python
import machine
from eeprom_i2c import EEPROM, T24C32
from eep_i2c import full_test
def get_eep():
return EEPROM(machine.I2C(0), T24C32)
def main():
print("App started")
print("Running tests")
eep = get_eep()
full_test(eep, block_size=32)
print("App finished")
if __name__ == "__main__":
main()
```
[Motivation]
Have DS3231 with soldered AT24C32 chip and want to use both RTC and EEPROM.
In my case AT24C32 has 0x57 as it's address and `EEPROM` class refused to
work with this setup.
[Testing]
Executed `full_test` from `eep_i2c` against AT24C32 (with address 0x57)
connected to my Raspberry Pi Pico W.
Test code:
```python
import machine
from eeprom_i2c import EEPROM, T24C32
from eep_i2c import full_test
def get_eep():
return EEPROM(machine.I2C(0), T24C32)
def main():
print("App started")
print("Running tests")
eep = get_eep()
full_test(eep, block_size=32)
print("App finished")
if __name__ == "__main__":
main()
```
Currently flash_spi.py is hardcoded for a small set of devices, all of
which can use 4-byte addressing. Fix this by allowing the command set and
address generation to be switched dynamically.
We also remove the whitelist of tested devices since the interfaces used
is very common amoung different flash devices. However as a safety measure
the user can provide the expected flash size and this will be checked
against the density field.