kopia lustrzana https://github.com/peterhinch/micropython_eeprom
Reference Winbond W25Q128JV support. Add ioctl code comments.
rodzic
2792ab31d3
commit
65ac90a559
|
@ -89,11 +89,17 @@ for compatibility.
|
||||||
### 1.4.1 Chips tested by users
|
### 1.4.1 Chips tested by users
|
||||||
|
|
||||||
If you have success with other chips please raise an issue and I will update
|
If you have success with other chips please raise an issue and I will update
|
||||||
this doc.
|
this doc. Please note the `cmd5` arg. It is essential to know whether a chip
|
||||||
|
uses 4 or 5 byte commands and to set this correctly otherise very confusing
|
||||||
|
behaviour results.
|
||||||
|
|
||||||
CAT24C256LI-G I2C EEPROM 32KiB tested by
|
CAT24C256LI-G I2C EEPROM 32KiB tested by
|
||||||
[Julien Phalip](https://github.com/peterhinch/micropython_eeprom/issues/6#issuecomment-825801065).
|
[Julien Phalip](https://github.com/peterhinch/micropython_eeprom/issues/6#issuecomment-825801065).
|
||||||
|
|
||||||
|
Winbond W25Q128JV Flash 128MiB tested by
|
||||||
|
[mweber-bg](https://github.com/peterhinch/micropython_eeprom/issues/8#issuecomment-917603913).
|
||||||
|
This requires setting `cmd5=False`.
|
||||||
|
|
||||||
## 1.5 Performance
|
## 1.5 Performance
|
||||||
|
|
||||||
FRAM is truly byte-addressable: its speed is limited only by the speed of the
|
FRAM is truly byte-addressable: its speed is limited only by the speed of the
|
||||||
|
|
|
@ -68,6 +68,7 @@ class BlockDevice:
|
||||||
def writeblocks(self, blocknum, buf, offset=0):
|
def writeblocks(self, blocknum, buf, offset=0):
|
||||||
self.readwrite(offset + (blocknum << self._nbits), buf, False)
|
self.readwrite(offset + (blocknum << self._nbits), buf, False)
|
||||||
|
|
||||||
|
# https://docs.micropython.org/en/latest/library/os.html#os.AbstractBlockDev.ioctl
|
||||||
def ioctl(self, op, arg): # ioctl calls: see extmod/vfs.h
|
def ioctl(self, op, arg): # ioctl calls: see extmod/vfs.h
|
||||||
if op == 3: # SYNCHRONISE
|
if op == 3: # SYNCHRONISE
|
||||||
self.sync()
|
self.sync()
|
||||||
|
@ -76,7 +77,7 @@ class BlockDevice:
|
||||||
return self._a_bytes >> self._nbits
|
return self._a_bytes >> self._nbits
|
||||||
if op == 5: # BP_IOCTL_SEC_SIZE
|
if op == 5: # BP_IOCTL_SEC_SIZE
|
||||||
return self._block_size
|
return self._block_size
|
||||||
if op == 6: # ERASE
|
if op == 6: # Ignore ERASE because handled by driver.
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
# Hardware agnostic base class for flash memory.
|
# Hardware agnostic base class for flash memory.
|
||||||
|
|
Ładowanie…
Reference in New Issue