Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for lpc11uxx #21743

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[submodule "lib/chibios-contrib"]
path = lib/chibios-contrib
url = https://github.com/qmk/ChibiOS-Contrib
branch = master
branch = qmk-develop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to update this file (submodule updates refer to some specific commits anyway).

[submodule "lib/googletest"]
path = lib/googletest
url = https://github.com/qmk/googletest
Expand Down
4 changes: 4 additions & 0 deletions data/schemas/definitions.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@
"type": "string",
"pattern": "^GP\\d{1,2}$"
},
{
"type": "string",
"pattern": "^P[0-1]_\\d{1,2}$"
},
{
"type": "integer"
},
Expand Down
2 changes: 1 addition & 1 deletion lib/chibios
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update looks like a revert for the current state of the develop branch; you should rebase your changes to develop and drop the lib/chibios submodule update.

Submodule chibios updated 146 files
2 changes: 1 addition & 1 deletion lib/chibios-contrib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently the develop branch already has the same version of the lib/chibios-contrib submodule; you should rebase your changes to develop and drop this update.

Submodule chibios-contrib updated 99 files
+2 −1 demos/TIVA/RT-TM4C123G-LAUNCHPAD/Makefile
+1 −0 demos/TIVA/RT-TM4C123G-LAUNCHPAD/README.md
+8 −5 demos/TIVA/RT-TM4C123G-LAUNCHPAD/halconf.h
+2 −1 demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/Makefile
+4 −0 demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/README.md
+8 −5 demos/TIVA/RT-TM4C1294-LAUNCHPAD-LWIP/halconf.h
+2 −1 demos/TIVA/RT-TM4C1294-LAUNCHPAD/Makefile
+1 −0 demos/TIVA/RT-TM4C1294-LAUNCHPAD/README.md
+7 −5 demos/TIVA/RT-TM4C1294-LAUNCHPAD/halconf.h
+2 −2 demos/WB32/RT-WB32FQ95-GENERIC/cfg/halconf.h
+3 −26 demos/WB32/RT-WB32FQ95-GENERIC/keil/ch.uvoptx
+4 −8 demos/WB32/RT-WB32FQ95-GENERIC/keil/ch.uvprojx
+1 −0 os/common/ext/CMSIS/HT32/HT32F165x/ht32f165x_reg.h
+1 −0 os/common/ext/CMSIS/HT32/HT32F523xx/ht32f523x2_reg.h
+6 −7 os/common/ext/CMSIS/LPC/LPC11Uxx.h
+154 −0 os/common/startup/ARMCMx/compilers/GCC/ld/MIMXRT1064.ld
+19 −0 os/common/startup/ARMCMx/compilers/GCC/mk/startup_MIMXRT1064.mk
+80 −0 os/common/startup/ARMCMx/devices/MIMXRT1064/cmparams.h
+47 −0 os/hal/boards/EDGEPRO1/board.c
+172 −0 os/hal/boards/EDGEPRO1/board.h
+9 −0 os/hal/boards/EDGEPRO1/board.mk
+31 −0 os/hal/boards/LPC11U35_GENERIC/board.c
+66 −0 os/hal/boards/LPC11U35_GENERIC/board.h
+10 −0 os/hal/boards/LPC11U35_GENERIC/board.mk
+9 −3 os/hal/ports/HT32/LLD/SPIv1/hal_spi_lld.c
+20 −3 os/hal/ports/LPC/LLD/GPIO/hal_pal_lld.h
+1 −0 os/hal/ports/LPC/LPC11Uxx/hal_lld.c
+37 −1 os/hal/ports/LPC/LPC11Uxx/hal_lld.h
+9 −0 os/hal/ports/MIMXRT1064/LLD/GPIOv1/driver.mk
+297 −0 os/hal/ports/MIMXRT1064/LLD/GPIOv1/hal_pal_lld.c
+316 −0 os/hal/ports/MIMXRT1064/LLD/GPIOv1/hal_pal_lld.h
+16 −0 os/hal/ports/MIMXRT1064/LLD/I2Cv1/driver.mk
+228 −0 os/hal/ports/MIMXRT1064/LLD/I2Cv1/hal_i2c_lld.c
+203 −0 os/hal/ports/MIMXRT1064/LLD/I2Cv1/hal_i2c_lld.h
+3 −0 os/hal/ports/MIMXRT1064/LLD/PITv1/driver.mk
+391 −0 os/hal/ports/MIMXRT1064/LLD/PITv1/hal_gpt_lld.c
+333 −0 os/hal/ports/MIMXRT1064/LLD/PITv1/hal_gpt_lld.h
+109 −0 os/hal/ports/MIMXRT1064/LLD/PITv1/hal_st_lld.c
+156 −0 os/hal/ports/MIMXRT1064/LLD/PITv1/hal_st_lld.h
+16 −0 os/hal/ports/MIMXRT1064/LLD/UARTv1/driver.mk
+444 −0 os/hal/ports/MIMXRT1064/LLD/UARTv1/hal_serial_lld.c
+274 −0 os/hal/ports/MIMXRT1064/LLD/UARTv1/hal_serial_lld.h
+22 −0 os/hal/ports/MIMXRT1064/LLD/USBHSv1/driver.mk
+787 −0 os/hal/ports/MIMXRT1064/LLD/USBHSv1/hal_usb_lld.c
+451 −0 os/hal/ports/MIMXRT1064/LLD/USBHSv1/hal_usb_lld.h
+178 −0 os/hal/ports/MIMXRT1064/LLD/USBHSv1/usb_device_config.h
+339 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/bootable_image.c
+516 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/clock_config.c
+126 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/clock_config.h
+165 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/hal_lld.c
+113 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/hal_lld.h
+160 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/mimxrt1064_registry.h
+175 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/mpu.c
+365 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/platform.dox
+39 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/platform.mk
+114 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/printf_debug.c
+13 −0 os/hal/ports/MIMXRT1064/MIMXRT1064/printf_debug.h
+14 −38 os/hal/ports/RP/LLD/USBDv1/hal_usb_lld.c
+4 −8 os/hal/ports/RP/LLD/USBDv1/hal_usb_lld.h
+34 −12 os/hal/ports/SN32/LLD/SN32F2xx/CT/hal_gpt_lld.c
+1 −1 os/hal/ports/SN32/LLD/SN32F2xx/CT/hal_gpt_lld.h
+0 −762 os/hal/ports/SN32/LLD/SN32F2xx/GPIO/GPIO.c
+0 −110 os/hal/ports/SN32/LLD/SN32F2xx/GPIO/GPIO.h
+189 −22 os/hal/ports/SN32/LLD/SN32F2xx/GPIO/hal_pal_lld.c
+139 −10 os/hal/ports/SN32/LLD/SN32F2xx/GPIO/hal_pal_lld.h
+0 −368 os/hal/ports/SN32/LLD/SN32F2xx/I2C/I2C.c
+0 −120 os/hal/ports/SN32/LLD/SN32F2xx/I2C/I2C.h
+21 −0 os/hal/ports/SN32/LLD/SN32F2xx/I2C/driver.mk
+406 −0 os/hal/ports/SN32/LLD/SN32F2xx/I2C/hal_i2c_lld.c
+229 −0 os/hal/ports/SN32/LLD/SN32F2xx/I2C/hal_i2c_lld.h
+85 −0 os/hal/ports/SN32/LLD/SN32F2xx/I2C/sn32_i2c.h
+0 −194 os/hal/ports/SN32/LLD/SN32F2xx/SPI/SPI.h
+0 −138 os/hal/ports/SN32/LLD/SN32F2xx/SPI/SPI0.c
+0 −133 os/hal/ports/SN32/LLD/SN32F2xx/SPI/SPI1.c
+7 −1 os/hal/ports/SN32/LLD/SN32F2xx/SPI/driver.mk
+381 −0 os/hal/ports/SN32/LLD/SN32F2xx/SPI/hal_spi_v2_lld.c
+207 −0 os/hal/ports/SN32/LLD/SN32F2xx/SPI/hal_spi_v2_lld.h
+99 −0 os/hal/ports/SN32/LLD/SN32F2xx/SPI/sn32_spi.h
+6 −0 os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.c
+5 −0 os/hal/ports/SN32/SN32F240B/hal_lld.h
+1 −0 os/hal/ports/SN32/SN32F240B/platform.mk
+5 −0 os/hal/ports/SN32/SN32F260/hal_lld.h
+1 −0 os/hal/ports/SN32/SN32F260/platform.mk
+77 −3 os/hal/ports/STM32/LLD/COMPv1/hal_comp_lld.c
+2 −2 os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c
+6 −2 os/hal/ports/WB32/LLD/GPIOv1/hal_pal_lld.c
+6 −0 os/hal/ports/WB32/LLD/USBv1/hal_usb_lld.c
+27 −15 os/hal/ports/WB32/WB32F3G71xx/hal_efl_lld.c
+397 −394 os/hal/ports/WB32/WB32F3G71xx/hal_lld.c
+9 −16 os/hal/ports/WB32/WB32F3G71xx/wb32_isr.c
+27 −15 os/hal/ports/WB32/WB32FQ95xx/hal_efl_lld.c
+6 −3 os/hal/ports/WB32/WB32FQ95xx/hal_lld.c
+9 −16 os/hal/ports/WB32/WB32FQ95xx/wb32_isr.c
+2 −2 os/hal/src/hal_eeprom.c
+0 −1 testhal/RP/RP2040/RT-RP2040-PICO-ADC/cfg/mcuconf.h
+0 −1 testhal/RP/RP2040/RT-RP2040-PICO-HID/cfg/mcuconf.h
+0 −1 testhal/RP/RP2040/RT-RP2040-PICO-I2C-24AA01/cfg/mcuconf.h
+0 −1 testhal/RP/RP2040/RT-RP2040-PICO-SERIAL/cfg/mcuconf.h
+37 −15 testhal/STM32/STM32F4xx/USB_HOST/halconf.h
60 changes: 60 additions & 0 deletions platforms/chibios/_pin_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,63 @@
# define K14 PAL_LINE(GPIOK, 14)
# define K15 PAL_LINE(GPIOK, 15)
#endif

#if defined(MCU_LPC)
// GPIO Port 0
# define P0_0 PAL_LINE(IOPORT0, 0)
Comment on lines +296 to +298
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be handled like https://github.com/qmk/qmk_firmware/blob/develop/platforms/chibios/vendors/RP/_pin_defs.h instead of creating a file full of platform ifdefs.

# define P0_1 PAL_LINE(IOPORT0, 1)
# define P0_2 PAL_LINE(IOPORT0, 2)
# define P0_3 PAL_LINE(IOPORT0, 3)
# define P0_4 PAL_LINE(IOPORT0, 4)
# define P0_5 PAL_LINE(IOPORT0, 5)
# define P0_6 PAL_LINE(IOPORT0, 6)
# define P0_7 PAL_LINE(IOPORT0, 7)
# define P0_8 PAL_LINE(IOPORT0, 8)
# define P0_9 PAL_LINE(IOPORT0, 9)
# define P0_10 PAL_LINE(IOPORT0, 10)
# define P0_11 PAL_LINE(IOPORT0, 11)
# define P0_12 PAL_LINE(IOPORT0, 12)
# define P0_13 PAL_LINE(IOPORT0, 13)
# define P0_14 PAL_LINE(IOPORT0, 14)
# define P0_15 PAL_LINE(IOPORT0, 15)
# define P0_16 PAL_LINE(IOPORT0, 16)
# define P0_17 PAL_LINE(IOPORT0, 17)
# define P0_18 PAL_LINE(IOPORT0, 18)
# define P0_19 PAL_LINE(IOPORT0, 19)
# define P0_20 PAL_LINE(IOPORT0, 20)
# define P0_21 PAL_LINE(IOPORT0, 21)
# define P0_22 PAL_LINE(IOPORT0, 22)
# define P0_23 PAL_LINE(IOPORT0, 23)
// GPIO Port 1
Comment on lines +321 to +322
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the whole LPC family have only pins 0…23 on P0, or is that specific to a particular chip in that family?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other chips have the same amount or less in that family. It depends on the size of the chip.

# define P1_0 PAL_LINE(IOPORT1, 0)
# define P1_1 PAL_LINE(IOPORT1, 1)
# define P1_2 PAL_LINE(IOPORT1, 2)
# define P1_3 PAL_LINE(IOPORT1, 3)
# define P1_4 PAL_LINE(IOPORT1, 4)
# define P1_5 PAL_LINE(IOPORT1, 5)
# define P1_6 PAL_LINE(IOPORT1, 6)
# define P1_7 PAL_LINE(IOPORT1, 7)
# define P1_8 PAL_LINE(IOPORT1, 8)
# define P1_9 PAL_LINE(IOPORT1, 9)
# define P1_10 PAL_LINE(IOPORT1, 10)
# define P1_11 PAL_LINE(IOPORT1, 11)
# define P1_12 PAL_LINE(IOPORT1, 12)
# define P1_13 PAL_LINE(IOPORT1, 13)
# define P1_14 PAL_LINE(IOPORT1, 14)
# define P1_15 PAL_LINE(IOPORT1, 15)
# define P1_16 PAL_LINE(IOPORT1, 16)
# define P1_17 PAL_LINE(IOPORT1, 17)
# define P1_18 PAL_LINE(IOPORT1, 18)
# define P1_19 PAL_LINE(IOPORT1, 19)
# define P1_20 PAL_LINE(IOPORT1, 20)
# define P1_21 PAL_LINE(IOPORT1, 21)
# define P1_22 PAL_LINE(IOPORT1, 22)
# define P1_23 PAL_LINE(IOPORT1, 23)
# define P1_24 PAL_LINE(IOPORT1, 24)
# define P1_25 PAL_LINE(IOPORT1, 25)
# define P1_26 PAL_LINE(IOPORT1, 26)
# define P1_27 PAL_LINE(IOPORT1, 27)
# define P1_28 PAL_LINE(IOPORT1, 28)
# define P1_29 PAL_LINE(IOPORT1, 29)
# define P1_31 PAL_LINE(IOPORT1, 31)
#endif
Loading