From: Limor "Ladyada" Fried Date: Sat, 22 May 2021 14:00:43 +0000 (-0400) Subject: Merge pull request #476 from caternuson/feather_u2if X-Git-Tag: 6.10.0~1 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/4320a101dd8a5f27dc528101d9a9f22c72005355?hp=6f5e65bd280a7de6cc9439d1be08a3742b598bbd Merge pull request #476 from caternuson/feather_u2if Adding more u2if firmware boards --- diff --git a/src/adafruit_blinka/microcontroller/rp2040/i2c.py b/src/adafruit_blinka/microcontroller/rp2040/i2c.py index 16ff2e3..785769d 100644 --- a/src/adafruit_blinka/microcontroller/rp2040/i2c.py +++ b/src/adafruit_blinka/microcontroller/rp2040/i2c.py @@ -28,14 +28,13 @@ class I2C: """Perform an I2C Device Scan""" return self._i2c.scan() - # pylint: disable=unused-argument def writeto(self, address, buffer, *, stop=True): "Write data to the address from the buffer" - return self._i2c.writeto(address, buffer) + return self._i2c.writeto(address, buffer, stop) def readfrom_into(self, address, buffer, *, stop=True): """Read data from an address and into the buffer""" - return self._i2c.readfrom_into(address, buffer) + return self._i2c.readfrom_into(address, buffer, stop) def writeto_then_readfrom( self, @@ -52,14 +51,13 @@ class I2C: """Write data from buffer_out to an address and then read data from an address and into buffer_in """ - self._i2c.writeto_then_readfrom( - address, - buffer_out, - buffer_in, - out_start=out_start, - out_end=out_end, - in_start=in_start, - in_end=in_end, - ) - - # pylint: enable=unused-argument + if out_end: + self.writeto(address, buffer_out[out_start:out_end], stop=stop) + else: + self.writeto(address, buffer_out[out_start:], stop=stop) + read_buffer = buffer_in + self.readfrom_into(address, read_buffer, stop=stop) + if in_end: + buffer_in[in_start:in_end] = read_buffer[in_start:in_end] + else: + buffer_in[in_start:] = read_buffer[in_start:] diff --git a/src/adafruit_blinka/microcontroller/rp2040/pin.py b/src/adafruit_blinka/microcontroller/rp2040/pin.py index e16890f..bc086c9 100755 --- a/src/adafruit_blinka/microcontroller/rp2040/pin.py +++ b/src/adafruit_blinka/microcontroller/rp2040/pin.py @@ -37,12 +37,31 @@ GP29 = Pin(29) spiPorts = ( (0, GP2, GP3, GP0), (0, GP2, GP3, GP4), + (0, GP2, GP3, GP16), (0, GP2, GP7, GP0), (0, GP2, GP7, GP4), + (0, GP2, GP7, GP16), + (0, GP2, GP19, GP0), + (0, GP2, GP19, GP4), + (0, GP2, GP19, GP16), (0, GP6, GP3, GP0), (0, GP6, GP3, GP4), + (0, GP6, GP3, GP16), (0, GP6, GP7, GP0), (0, GP6, GP7, GP4), + (0, GP6, GP7, GP16), + (0, GP6, GP19, GP0), + (0, GP6, GP19, GP4), + (0, GP6, GP19, GP16), + (0, GP18, GP3, GP0), + (0, GP18, GP3, GP4), + (0, GP18, GP3, GP16), + (0, GP18, GP7, GP0), + (0, GP18, GP7, GP4), + (0, GP18, GP7, GP16), + (0, GP18, GP19, GP0), + (0, GP18, GP19, GP4), + (0, GP18, GP19, GP16), (1, GP10, GP11, GP8), (1, GP10, GP11, GP12), (1, GP10, GP15, GP8),