Skip to content

Commit e8831b2

Browse files
committed
move consts out of class
1 parent 107bf5c commit e8831b2

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

adafruit_fram.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@
6060
_SPI_MANF_ID = const(0x04)
6161
_SPI_PROD_ID = const(0x302)
6262

63+
_SPI_OPCODE_WREN = const(0x6) # Set write enable latch
64+
_SPI_OPCODE_WRDI = const(0x4) # Reset write enable latch
65+
_SPI_OPCODE_RDSR = const(0x5) # Read status register
66+
_SPI_OPCODE_WRSR = const(0x1) # Write status register
67+
_SPI_OPCODE_READ = const(0x3) # Read memory code
68+
_SPI_OPCODE_WRITE = const(0x2) # Write memory code
69+
_SPI_OPCODE_RDID = const(0x9F) # Read device ID
6370

6471
class FRAM:
6572
"""
@@ -282,12 +289,6 @@ def write_protected(self, value):
282289
self._wp_pin.value = value
283290

284291

285-
# the following pylint disables are related to the '_SPI_OPCODE' consts, the super
286-
# class setter '@FRAM.write_protected.setter', and pylint not being able to see
287-
# 'spi.write()' in SPIDevice. Travis run for reference:
288-
# https://travis-ci.com/sommersoft/Adafruit_CircuitPython_FRAM/builds/87112669
289-
290-
# pylint: disable=no-member,undefined-variable
291292
class FRAM_SPI(FRAM):
292293
""" SPI class for FRAM.
293294
@@ -301,14 +302,6 @@ class FRAM_SPI(FRAM):
301302
:param int max_size: Size of FRAM in Bytes. Default is ``8192``.
302303
"""
303304

304-
_SPI_OPCODE_WREN = const(0x6) # Set write enable latch
305-
_SPI_OPCODE_WRDI = const(0x4) # Reset write enable latch
306-
_SPI_OPCODE_RDSR = const(0x5) # Read status register
307-
_SPI_OPCODE_WRSR = const(0x1) # Write status register
308-
_SPI_OPCODE_READ = const(0x3) # Read memory code
309-
_SPI_OPCODE_WRITE = const(0x2) # Write memory code
310-
_SPI_OPCODE_RDID = const(0x9F) # Read device ID
311-
312305
# pylint: disable=too-many-arguments,too-many-locals
313306
def __init__(
314307
self,

0 commit comments

Comments
 (0)