X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka.git/blobdiff_plain/a3770186a94117be56a8d9a8038a2d540bd2884c..bb9dd9909c672798b9d69c8e3689b2e443c8d936:/src/adafruit_blinka/microcontroller/bcm283x/pin.py diff --git a/src/adafruit_blinka/microcontroller/bcm283x/pin.py b/src/adafruit_blinka/microcontroller/bcm283x/pin.py index e95364c..dd8abe6 100644 --- a/src/adafruit_blinka/microcontroller/bcm283x/pin.py +++ b/src/adafruit_blinka/microcontroller/bcm283x/pin.py @@ -1,5 +1,6 @@ """Broadcom BCM283x pin names""" import RPi.GPIO as GPIO +from adafruit_blinka.agnostic import detector GPIO.setmode(GPIO.BCM) # Use BCM pins D4 = GPIO #4 GPIO.setwarnings(False) # shh! @@ -138,17 +139,30 @@ D44 = Pin(44) D45 = Pin(45) # ordered as spiId, sckId, mosiId, misoId -spiPorts = ( - (0, SCLK, MOSI, MISO), - (1, SCLK_1, MOSI_1, MISO_1), - (2, SCLK_2, MOSI_2, MISO_2), -) +if detector.board.id in ["RASPBERRY_PI_4B", "RASPBERRY_PI_CM4"]: + spiPorts = ( + (0, SCLK, MOSI, MISO), + (6, SCLK_1, MOSI_1, MISO_1), + (2, SCLK_2, MOSI_2, MISO_2), + (3, D3, D2, D1), + (4, D7, D6, D5), + (5, D15, D14, D13), + ) +else: + spiPorts = ( + (0, SCLK, MOSI, MISO), + (1, SCLK_1, MOSI_1, MISO_1), + (2, SCLK_2, MOSI_2, MISO_2), + ) # ordered as uartId, txId, rxId uartPorts = ((1, TXD, RXD),) +# These are the known hardware I2C ports / pins. +# For software I2C ports created with the i2c-gpio overlay, see: +# https://github.com/adafruit/Adafruit_Python_Extended_Bus i2cPorts = ( - (3, SCL, SDA), (1, SCL, SDA), (0, D1, D0), # both pi 1 and pi 2 i2c ports! + (10, D45, D44), # internal i2c bus for the CM4 )