From 2ce0a77758d98d7d8ee6a4967daa1d15cb7f6eba Mon Sep 17 00:00:00 2001 From: ecarozzo Date: Sat, 26 Nov 2022 22:02:17 +0100 Subject: [PATCH 1/3] Added support to SeeedStudio Odyssey X86J4105 SBC --- src/adafruit_blinka/board/x86j4105.py | 50 +++++++++++++++++ .../microcontroller/pentium/j4105/__init__.py | 0 .../microcontroller/pentium/j4105/pin.py | 56 +++++++++++++++++++ src/board.py | 3 + src/digitalio.py | 2 + src/microcontroller/__init__.py | 2 + src/microcontroller/pin.py | 2 + 7 files changed, 115 insertions(+) create mode 100644 src/adafruit_blinka/board/x86j4105.py create mode 100644 src/adafruit_blinka/microcontroller/pentium/j4105/__init__.py create mode 100644 src/adafruit_blinka/microcontroller/pentium/j4105/pin.py diff --git a/src/adafruit_blinka/board/x86j4105.py b/src/adafruit_blinka/board/x86j4105.py new file mode 100644 index 00000000..a107135a --- /dev/null +++ b/src/adafruit_blinka/board/x86j4105.py @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries +# +# SPDX-License-Identifier: MIT +"""Pin definitions for the Odyssey X86j4105.""" + +from adafruit_blinka.microcontroller.pentium.j4105 import pin + +D0 = pin.GPIO388 +D1 = pin.GPIO389 +D2 = pin.GPIO386 +D3 = pin.GPIO387 +D4 = pin.GPIO337 +D5 = pin.GPIO415 +D6 = pin.GPIO416 +D7 = pin.GPIO357 +D8 = pin.GPIO356 +D9 = pin.GPIO358 +D10 = pin.GPIO359 +D11 = pin.GPIO355 +D12 = pin.GPIO391 +D13 = pin.GPIO417 +D14 = pin.GPIO493 +D15 = pin.GPIO492 +D16 = pin.GPIO410 +D17 = pin.GPIO364 +D18 = pin.GPIO338 +D19 = pin.GPIO339 +D20 = pin.GPIO340 +D21 = pin.GPIO341 +D22 = pin.GPIO413 +D23 = pin.GPIO421 +D24 = pin.GPIO422 +D25 = pin.GPIO390 +D26 = pin.GPIO419 +D27 = pin.GPIO412 + +SDA = D2 +SCL = D3 + +SCL2 = D1 +SDA2 = D0 + +SCLK = D11 +MOSI = D10 +MISO = D9 +CS = D8 +SCK = SCLK + +UART_TX = D14 +UART_RX = D15 diff --git a/src/adafruit_blinka/microcontroller/pentium/j4105/__init__.py b/src/adafruit_blinka/microcontroller/pentium/j4105/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py b/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py new file mode 100644 index 00000000..d68bc98a --- /dev/null +++ b/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py @@ -0,0 +1,56 @@ +# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries +# +# SPDX-License-Identifier: MIT +"""Intel Celeron j4105 pin names""" + +from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin + +GPIO388 = Pin((1,36)) +GPIO389 = Pin((1,37)) +GPIO386 = Pin((1,34)) +GPIO387 = Pin((1,35)) +GPIO337 = Pin((2,5)) +GPIO415 = Pin((1,63)) +GPIO416 = Pin((1,64)) +GPIO357 = Pin((1,5)) +GPIO356 = Pin((1,4)) +GPIO358 = Pin((1,6)) +GPIO359 = Pin((1,7)) +GPIO355 = Pin((1,3)) +GPIO391 = Pin((1,39)) +GPIO417 = Pin((1,65)) +GPIO493 = Pin((0,61)) +GPIO492 = Pin((0,60)) +GPIO410 = Pin((1,58)) +GPIO364 = Pin((1,12)) +GPIO338 = Pin((2,6)) +GPIO339 = Pin((2,7)) +GPIO340 = Pin((2,8)) +GPIO341 = Pin((2,9)) +GPIO413 = Pin((1,61)) +GPIO421 = Pin((1,69)) +GPIO422 = Pin((1,70)) +GPIO390 = Pin((1,38)) +GPIO419 = Pin((1,67)) +GPIO412 = Pin((1,60)) + +SPI0_SCLK = GPIO355 +SPI0_MOSI = GPIO359 +SPI0_MISO = GPIO358 +SPI0_FSO = GPIO356 +SPI0_FS1 = GPIO357 + +UART0_TX = GPIO493 +UART0_RX = GPIO492 + +I2C5_SDA = GPIO386 +I2C5_SCL = GPIO387 + +I2C6_SDA = GPIO388 +I2C6_SCL = GPIO389 + +i2cPorts = ((2, I2C5_SCL, I2C5_SDA),(3, I2C6_SCL, I2C6_SDA),) +# ordered as spiId, sckId, mosiId, misoId +spiPorts = ((0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),) +# ordered as uartId, txId, rxId +uartPorts = ((0, UART0_TX, UART0_RX),) diff --git a/src/board.py b/src/board.py index bde2686e..fce4a513 100644 --- a/src/board.py +++ b/src/board.py @@ -238,6 +238,9 @@ elif board_id == ap_board.UDOO_X86: from adafruit_blinka.board.udoo_x86ultra import * +elif board_id == ap_board.ODYSSEY_X86J4105: + from adafruit_blinka.board.x86j4105 import * + elif board_id == ap_board.STM32MP157C_DK2: from adafruit_blinka.board.stm32.stm32mp157c_dk2 import * diff --git a/src/digitalio.py b/src/digitalio.py index 69e1af6d..cbd0ae23 100644 --- a/src/digitalio.py +++ b/src/digitalio.py @@ -73,6 +73,8 @@ from adafruit_blinka.microcontroller.rockchip.rk3328.pin import Pin elif detector.chip.PENTIUM_N3710: from adafruit_blinka.microcontroller.pentium.n3710.pin import Pin +elif detector.chip.ATOM_J4105: + from adafruit_blinka.microcontroller.pentium.j4105.pin import Pin elif detector.chip.STM32MP157: from adafruit_blinka.microcontroller.stm32.stm32mp157.pin import Pin elif detector.chip.MT8167: diff --git a/src/microcontroller/__init__.py b/src/microcontroller/__init__.py index 58584810..6015cd9d 100644 --- a/src/microcontroller/__init__.py +++ b/src/microcontroller/__init__.py @@ -118,6 +118,8 @@ def delay_us(delay): from adafruit_blinka.microcontroller.ftdi_mpsse.ft2232h import * elif chip_id == ap_chip.PENTIUM_N3710: from adafruit_blinka.microcontroller.pentium.n3710 import * +elif chip_id == ap_chip.ATOM_J4105: + from adafruit_blinka.microcontroller.pentium.j4105 import * elif chip_id == ap_chip.STM32MP157: from adafruit_blinka.microcontroller.stm32.stm32mp157 import * elif chip_id == ap_chip.MT8167: diff --git a/src/microcontroller/pin.py b/src/microcontroller/pin.py index d13437a4..e7f7765d 100644 --- a/src/microcontroller/pin.py +++ b/src/microcontroller/pin.py @@ -103,6 +103,8 @@ from adafruit_blinka.microcontroller.mips24kec.pin import * elif chip_id == ap_chip.PENTIUM_N3710: from adafruit_blinka.microcontroller.pentium.n3710.pin import * +elif chip_id == ap_chip.ATOM_J4105: + from adafruit_blinka.microcontroller.pentium.j4105.pin import * elif chip_id == ap_chip.STM32MP157: from adafruit_blinka.microcontroller.stm32.stm32mp157.pin import * elif chip_id == ap_chip.MT8167: From 0878a8bec23e8b5da023f0fb5eea76c19bd84316 Mon Sep 17 00:00:00 2001 From: ecarozzo Date: Sat, 26 Nov 2022 22:30:33 +0100 Subject: [PATCH 2/3] Pin name modify --- .../microcontroller/pentium/j4105/pin.py | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py b/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py index d68bc98a..0c1de21f 100644 --- a/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py +++ b/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py @@ -34,23 +34,23 @@ GPIO419 = Pin((1,67)) GPIO412 = Pin((1,60)) -SPI0_SCLK = GPIO355 -SPI0_MOSI = GPIO359 -SPI0_MISO = GPIO358 -SPI0_FSO = GPIO356 -SPI0_FS1 = GPIO357 +SPI1_SCLK = GPIO355 +SPI1_MOSI = GPIO359 +SPI1_MISO = GPIO358 +SPI1_FSO = GPIO356 +SPI1_FS1 = GPIO357 -UART0_TX = GPIO493 -UART0_RX = GPIO492 +UART4_TX = GPIO493 +UART4_RX = GPIO492 -I2C5_SDA = GPIO386 -I2C5_SCL = GPIO387 +I2C2_SDA = GPIO386 +I2C2_SCL = GPIO387 -I2C6_SDA = GPIO388 -I2C6_SCL = GPIO389 +I2C3_SDA = GPIO388 +I2C3_SCL = GPIO389 -i2cPorts = ((2, I2C5_SCL, I2C5_SDA),(3, I2C6_SCL, I2C6_SDA),) +i2cPorts = ((2, I2C2_SCL, I2C2_SDA),(3, I2C3_SCL, I2C3_SDA),) # ordered as spiId, sckId, mosiId, misoId -spiPorts = ((0, SPI0_SCLK, SPI0_MOSI, SPI0_MISO),) +spiPorts = ((1, SPI1_SCLK, SPI1_MOSI, SPI1_MISO),) # ordered as uartId, txId, rxId -uartPorts = ((0, UART0_TX, UART0_RX),) +uartPorts = ((4, UART4_TX, UART4_RX),) From 7809f92a453b37b48bb1f56cab48b4fa37213c17 Mon Sep 17 00:00:00 2001 From: ecarozzo Date: Sat, 26 Nov 2022 22:51:45 +0100 Subject: [PATCH 3/3] Black pylint formatting --- .../microcontroller/pentium/j4105/pin.py | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py b/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py index 0c1de21f..0266b518 100644 --- a/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py +++ b/src/adafruit_blinka/microcontroller/pentium/j4105/pin.py @@ -5,34 +5,34 @@ from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin -GPIO388 = Pin((1,36)) -GPIO389 = Pin((1,37)) -GPIO386 = Pin((1,34)) -GPIO387 = Pin((1,35)) -GPIO337 = Pin((2,5)) -GPIO415 = Pin((1,63)) -GPIO416 = Pin((1,64)) -GPIO357 = Pin((1,5)) -GPIO356 = Pin((1,4)) -GPIO358 = Pin((1,6)) -GPIO359 = Pin((1,7)) -GPIO355 = Pin((1,3)) -GPIO391 = Pin((1,39)) -GPIO417 = Pin((1,65)) -GPIO493 = Pin((0,61)) -GPIO492 = Pin((0,60)) -GPIO410 = Pin((1,58)) -GPIO364 = Pin((1,12)) -GPIO338 = Pin((2,6)) -GPIO339 = Pin((2,7)) -GPIO340 = Pin((2,8)) -GPIO341 = Pin((2,9)) -GPIO413 = Pin((1,61)) -GPIO421 = Pin((1,69)) -GPIO422 = Pin((1,70)) -GPIO390 = Pin((1,38)) -GPIO419 = Pin((1,67)) -GPIO412 = Pin((1,60)) +GPIO388 = Pin((1, 36)) +GPIO389 = Pin((1, 37)) +GPIO386 = Pin((1, 34)) +GPIO387 = Pin((1, 35)) +GPIO337 = Pin((2, 5)) +GPIO415 = Pin((1, 63)) +GPIO416 = Pin((1, 64)) +GPIO357 = Pin((1, 5)) +GPIO356 = Pin((1, 4)) +GPIO358 = Pin((1, 6)) +GPIO359 = Pin((1, 7)) +GPIO355 = Pin((1, 3)) +GPIO391 = Pin((1, 39)) +GPIO417 = Pin((1, 65)) +GPIO493 = Pin((0, 61)) +GPIO492 = Pin((0, 60)) +GPIO410 = Pin((1, 58)) +GPIO364 = Pin((1, 12)) +GPIO338 = Pin((2, 6)) +GPIO339 = Pin((2, 7)) +GPIO340 = Pin((2, 8)) +GPIO341 = Pin((2, 9)) +GPIO413 = Pin((1, 61)) +GPIO421 = Pin((1, 69)) +GPIO422 = Pin((1, 70)) +GPIO390 = Pin((1, 38)) +GPIO419 = Pin((1, 67)) +GPIO412 = Pin((1, 60)) SPI1_SCLK = GPIO355 SPI1_MOSI = GPIO359 @@ -49,7 +49,10 @@ I2C3_SDA = GPIO388 I2C3_SCL = GPIO389 -i2cPorts = ((2, I2C2_SCL, I2C2_SDA),(3, I2C3_SCL, I2C3_SDA),) +i2cPorts = ( + (2, I2C2_SCL, I2C2_SDA), + (3, I2C3_SCL, I2C3_SDA), +) # ordered as spiId, sckId, mosiId, misoId spiPorts = ((1, SPI1_SCLK, SPI1_MOSI, SPI1_MISO),) # ordered as uartId, txId, rxId