@@ -69,7 +69,12 @@ class FRAM:
6969 Must be a ``DigitalInOut`` object.
7070 """
7171
72- def __init__ (self , max_size : int , write_protect : bool = False , wp_pin : Optional [DigitalInOut ] = None ) -> None :
72+ def __init__ (
73+ self ,
74+ max_size : int ,
75+ write_protect : bool = False ,
76+ wp_pin : Optional [DigitalInOut ] = None ,
77+ ) -> None :
7378 self ._max_size = max_size
7479 self ._wp = write_protect
7580 self ._wraparound = False
@@ -219,7 +224,9 @@ def _read_address(self, address: int, read_buffer: bytearray) -> bytearray:
219224 # Implemented by subclass
220225 raise NotImplementedError
221226
222- def _write (self , start_address : int , data : Union [int , Sequence [int ]], wraparound : bool ) -> None :
227+ def _write (
228+ self , start_address : int , data : Union [int , Sequence [int ]], wraparound : bool
229+ ) -> None :
223230 # Implemened by subclass
224231 raise NotImplementedError
225232
@@ -236,7 +243,13 @@ class FRAM_I2C(FRAM):
236243 """
237244
238245 # pylint: disable=too-many-arguments
239- def __init__ (self , i2c_bus : I2C , address : int = 0x50 , write_protect : bool = False , wp_pin : Optional [DigitalInOut ] = None ) -> None :
246+ def __init__ (
247+ self ,
248+ i2c_bus : I2C ,
249+ address : int = 0x50 ,
250+ write_protect : bool = False ,
251+ wp_pin : Optional [DigitalInOut ] = None ,
252+ ) -> None :
240253 from adafruit_bus_device .i2c_device import ( # pylint: disable=import-outside-toplevel
241254 I2CDevice as i2cdev ,
242255 )
@@ -261,7 +274,12 @@ def _read_address(self, address: int, read_buffer: bytearray) -> bytearray:
261274 i2c .write_then_readinto (write_buffer , read_buffer )
262275 return read_buffer
263276
264- def _write (self , start_address : int , data : Union [int , Sequence [int ]], wraparound : bool = False ) -> None :
277+ def _write (
278+ self ,
279+ start_address : int ,
280+ data : Union [int , Sequence [int ]],
281+ wraparound : bool = False ,
282+ ) -> None :
265283 # Decided against using the chip's "Page Write", since that would require
266284 # doubling the memory usage by creating a buffer that includes the passed
267285 # in data so that it can be sent all in one `i2c.write`. The single-write
@@ -359,7 +377,12 @@ def _read_address(self, address: int, read_buffer: bytearray) -> bytearray:
359377 spi .readinto (read_buffer )
360378 return read_buffer
361379
362- def _write (self , start_address : int , data : Union [int , Sequence [int ]], wraparound : bool = False ) -> None :
380+ def _write (
381+ self ,
382+ start_address : int ,
383+ data : Union [int , Sequence [int ]],
384+ wraparound : bool = False ,
385+ ) -> None :
363386 buffer = bytearray (4 )
364387 if not isinstance (data , int ):
365388 data_length = len (data )
0 commit comments