kopia lustrzana https://github.com/peterhinch/micropython_eeprom
Flash: cmdlen constructor arg renamed cmd5.
rodzic
e8a29df07b
commit
55f62ce514
|
@ -155,11 +155,11 @@ Arguments. In most cases only the first two mandatory args are required:
|
|||
5. `sec_size=4096` Chip sector size.
|
||||
6. `block_size=9` The block size reported to the filesystem. The size in bytes
|
||||
is `2**block_size` so is 512 bytes by default.
|
||||
7. `cmdset=None` Flash chips can support two low level command sets, an old 4
|
||||
7. `cmd5=None` Flash chips can support two low level command sets, an old 4
|
||||
byte set and a newer 5 byte set capable of supporting a larger address
|
||||
space. By default if the size read from the chip's ID is <= 4096KiB the 4 byte
|
||||
set is used oterwise the 5 byte set is adopted. This works for supported
|
||||
chips. Setting `cmdset` `True` forces 5 byte commands, `False` forces 4 byte.
|
||||
chips. Setting `cmd5` `True` forces 5 byte commands, `False` forces 4 byte.
|
||||
This override is necessary for certain chip types (e.g. WinBond W25Q64FV).
|
||||
|
||||
Size values (KiB):
|
||||
|
|
|
@ -26,7 +26,7 @@ _SEC_SIZE = const(4096) # Flash sector size 0x1000
|
|||
class FLASH(FlashDevice):
|
||||
|
||||
def __init__(self, spi, cspins, size=None, verbose=True,
|
||||
sec_size=_SEC_SIZE, block_size=9, cmdset=None):
|
||||
sec_size=_SEC_SIZE, block_size=9, cmd5=None):
|
||||
self._spi = spi
|
||||
self._cspins = cspins
|
||||
self._ccs = None # Chip select Pin object for current chip
|
||||
|
@ -43,7 +43,7 @@ class FLASH(FlashDevice):
|
|||
super().__init__(block_size, len(cspins), size * 1024, sec_size)
|
||||
|
||||
# Select the correct command set
|
||||
if (cmdset is None and size <= 4096) or (cmdset == False):
|
||||
if (cmd5 is None and size <= 4096) or (cmd5 == False):
|
||||
self._cmds = _CMDS3BA
|
||||
self._cmdlen = 4
|
||||
else:
|
||||
|
|
Ładowanie…
Reference in New Issue