diff --git a/os/hal/ports/GD/GD32VF103/CAN/driver.mk b/os/hal/ports/GD/GD32VF103/CAN/driver.mk deleted file mode 100644 index 83db5502..00000000 --- a/os/hal/ports/GD/GD32VF103/CAN/driver.mk +++ /dev/null @@ -1,9 +0,0 @@ -ifeq ($(USE_SMART_BUILD),yes) -ifneq ($(findstring HAL_USE_CAN TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CAN/hal_can_lld.c -endif -else -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CAN/hal_can_lld.c -endif - -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CAN diff --git a/os/hal/ports/GD/GD32VF103/CANv1/driver.mk b/os/hal/ports/GD/GD32VF103/CANv1/driver.mk new file mode 100644 index 00000000..c08f7996 --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/CANv1/driver.mk @@ -0,0 +1,9 @@ +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_CAN TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CANv1/hal_can_lld.c +endif +else +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CANv1/hal_can_lld.c +endif + +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CANv1 diff --git a/os/hal/ports/GD/GD32VF103/CAN/hal_can_lld.c b/os/hal/ports/GD/GD32VF103/CANv1/hal_can_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/CAN/hal_can_lld.c rename to os/hal/ports/GD/GD32VF103/CANv1/hal_can_lld.c diff --git a/os/hal/ports/GD/GD32VF103/CAN/hal_can_lld.h b/os/hal/ports/GD/GD32VF103/CANv1/hal_can_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/CAN/hal_can_lld.h rename to os/hal/ports/GD/GD32VF103/CANv1/hal_can_lld.h diff --git a/os/hal/ports/GD/GD32VF103/CRC/driver.mk b/os/hal/ports/GD/GD32VF103/CRC/driver.mk deleted file mode 100644 index 48a73155..00000000 --- a/os/hal/ports/GD/GD32VF103/CRC/driver.mk +++ /dev/null @@ -1,11 +0,0 @@ -ifeq ($(USE_SMART_BUILD),yes) -ifneq ($(findstring HAL_USE_CRC TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CRC/hal_crc_lld.c \ - ${CHIBIOS_CONTRIB}/os/various/crcsw.c -endif -else -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CRC/hal_crc_lld.c \ - ${CHIBIOS_CONTRIB}/os/various/crcsw.c -endif - -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CRC diff --git a/os/hal/ports/GD/GD32VF103/CRCv1/driver.mk b/os/hal/ports/GD/GD32VF103/CRCv1/driver.mk new file mode 100644 index 00000000..16edfc51 --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/CRCv1/driver.mk @@ -0,0 +1,11 @@ +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_CRC TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CRCv1/hal_crc_lld.c \ + ${CHIBIOS_CONTRIB}/os/various/crcsw.c +endif +else +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CRCv1/hal_crc_lld.c \ + ${CHIBIOS_CONTRIB}/os/various/crcsw.c +endif + +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CRCv1 diff --git a/os/hal/ports/GD/GD32VF103/CRC/hal_crc_lld.c b/os/hal/ports/GD/GD32VF103/CRCv1/hal_crc_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/CRC/hal_crc_lld.c rename to os/hal/ports/GD/GD32VF103/CRCv1/hal_crc_lld.c diff --git a/os/hal/ports/GD/GD32VF103/CRC/hal_crc_lld.h b/os/hal/ports/GD/GD32VF103/CRCv1/hal_crc_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/CRC/hal_crc_lld.h rename to os/hal/ports/GD/GD32VF103/CRCv1/hal_crc_lld.h diff --git a/os/hal/ports/GD/GD32VF103/DAC/driver.mk b/os/hal/ports/GD/GD32VF103/DAC/driver.mk deleted file mode 100644 index 1f2a501f..00000000 --- a/os/hal/ports/GD/GD32VF103/DAC/driver.mk +++ /dev/null @@ -1,9 +0,0 @@ -ifeq ($(USE_SMART_BUILD),yes) -ifneq ($(findstring HAL_USE_DAC TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DAC/hal_dac_lld.c -endif -else -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DAC/hal_dac_lld.c -endif - -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DAC diff --git a/os/hal/ports/GD/GD32VF103/DACv1/driver.mk b/os/hal/ports/GD/GD32VF103/DACv1/driver.mk new file mode 100644 index 00000000..c790bb2a --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/DACv1/driver.mk @@ -0,0 +1,9 @@ +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_DAC TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DACv1/hal_dac_lld.c +endif +else +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DACv1/hal_dac_lld.c +endif + +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DACv1 diff --git a/os/hal/ports/GD/GD32VF103/DAC/hal_dac_lld.c b/os/hal/ports/GD/GD32VF103/DACv1/hal_dac_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/DAC/hal_dac_lld.c rename to os/hal/ports/GD/GD32VF103/DACv1/hal_dac_lld.c diff --git a/os/hal/ports/GD/GD32VF103/DAC/hal_dac_lld.h b/os/hal/ports/GD/GD32VF103/DACv1/hal_dac_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/DAC/hal_dac_lld.h rename to os/hal/ports/GD/GD32VF103/DACv1/hal_dac_lld.h diff --git a/os/hal/ports/GD/GD32VF103/DMA/driver.mk b/os/hal/ports/GD/GD32VF103/DMA/driver.mk deleted file mode 100644 index bf1fdf5e..00000000 --- a/os/hal/ports/GD/GD32VF103/DMA/driver.mk +++ /dev/null @@ -1,2 +0,0 @@ -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DMA/gd32_dma.c -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DMA diff --git a/os/hal/ports/GD/GD32VF103/DMAv1/driver.mk b/os/hal/ports/GD/GD32VF103/DMAv1/driver.mk new file mode 100644 index 00000000..6624f149 --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/DMAv1/driver.mk @@ -0,0 +1,2 @@ +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DMAv1/gd32_dma.c +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DMAv1 diff --git a/os/hal/ports/GD/GD32VF103/DMA/gd32_dma.c b/os/hal/ports/GD/GD32VF103/DMAv1/gd32_dma.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/DMA/gd32_dma.c rename to os/hal/ports/GD/GD32VF103/DMAv1/gd32_dma.c diff --git a/os/hal/ports/GD/GD32VF103/DMA/gd32_dma.h b/os/hal/ports/GD/GD32VF103/DMAv1/gd32_dma.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/DMA/gd32_dma.h rename to os/hal/ports/GD/GD32VF103/DMAv1/gd32_dma.h diff --git a/os/hal/ports/GD/GD32VF103/GPIO/driver.mk b/os/hal/ports/GD/GD32VF103/GPIO/driver.mk deleted file mode 100644 index 2f0fca3f..00000000 --- a/os/hal/ports/GD/GD32VF103/GPIO/driver.mk +++ /dev/null @@ -1,9 +0,0 @@ -ifeq ($(USE_SMART_BUILD),yes) -ifneq ($(findstring HAL_USE_PAL TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/GPIO/hal_pal_lld.c -endif -else -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/GPIO/hal_pal_lld.c -endif - -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/GPIO diff --git a/os/hal/ports/GD/GD32VF103/GPIOv1/driver.mk b/os/hal/ports/GD/GD32VF103/GPIOv1/driver.mk new file mode 100644 index 00000000..6494b9bf --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/GPIOv1/driver.mk @@ -0,0 +1,9 @@ +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_PAL TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/GPIOv1/hal_pal_lld.c +endif +else +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/GPIOv1/hal_pal_lld.c +endif + +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/GPIOv1 diff --git a/os/hal/ports/GD/GD32VF103/GPIO/hal_pal_lld.c b/os/hal/ports/GD/GD32VF103/GPIOv1/hal_pal_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/GPIO/hal_pal_lld.c rename to os/hal/ports/GD/GD32VF103/GPIOv1/hal_pal_lld.c diff --git a/os/hal/ports/GD/GD32VF103/GPIO/hal_pal_lld.h b/os/hal/ports/GD/GD32VF103/GPIOv1/hal_pal_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/GPIO/hal_pal_lld.h rename to os/hal/ports/GD/GD32VF103/GPIOv1/hal_pal_lld.h diff --git a/os/hal/ports/GD/GD32VF103/I2C/driver.mk b/os/hal/ports/GD/GD32VF103/I2C/driver.mk deleted file mode 100644 index 3a24ac87..00000000 --- a/os/hal/ports/GD/GD32VF103/I2C/driver.mk +++ /dev/null @@ -1,21 +0,0 @@ -ifeq ($(USE_HAL_I2C_FALLBACK),yes) - # Fallback SW driver. - ifeq ($(USE_SMART_BUILD),yes) - ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),) - PLATFORMSRC += $(CHIBIOS)/os/hal/lib/fallback/I2C/hal_i2c_lld.c - endif - else - PLATFORMSRC += $(CHIBIOS)/os/hal/lib/fallback/I2C/hal_i2c_lld.c - endif - PLATFORMINC += $(CHIBIOS)/os/hal/lib/fallback/I2C -else - # Default HW driver. - ifeq ($(USE_SMART_BUILD),yes) - ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),) - PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/I2C/hal_i2c_lld.c - endif - else - PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/I2C/hal_i2c_lld.c - endif - PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/I2C -endif diff --git a/os/hal/ports/GD/GD32VF103/I2Cv1/driver.mk b/os/hal/ports/GD/GD32VF103/I2Cv1/driver.mk new file mode 100644 index 00000000..5a4e22f5 --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/I2Cv1/driver.mk @@ -0,0 +1,21 @@ +ifeq ($(USE_HAL_I2C_FALLBACK),yes) + # Fallback SW driver. + ifeq ($(USE_SMART_BUILD),yes) + ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),) + PLATFORMSRC_CONTRIB += $(CHIBIOS)/os/hal/lib/fallback/I2C/hal_i2c_lld.c + endif + else + PLATFORMSRC_CONTRIB += $(CHIBIOS)/os/hal/lib/fallback/I2C/hal_i2c_lld.c + endif + PLATFORMINC_CONTRIB += $(CHIBIOS)/os/hal/lib/fallback/I2C +else + # Default HW driver. + ifeq ($(USE_SMART_BUILD),yes) + ifneq ($(findstring HAL_USE_I2C TRUE,$(HALCONF)),) + PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/I2Cv1/hal_i2c_lld.c + endif + else + PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/I2Cv1/hal_i2c_lld.c + endif + PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/I2Cv1 +endif diff --git a/os/hal/ports/GD/GD32VF103/I2C/hal_i2c_lld.c b/os/hal/ports/GD/GD32VF103/I2Cv1/hal_i2c_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/I2C/hal_i2c_lld.c rename to os/hal/ports/GD/GD32VF103/I2Cv1/hal_i2c_lld.c diff --git a/os/hal/ports/GD/GD32VF103/I2C/hal_i2c_lld.h b/os/hal/ports/GD/GD32VF103/I2Cv1/hal_i2c_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/I2C/hal_i2c_lld.h rename to os/hal/ports/GD/GD32VF103/I2Cv1/hal_i2c_lld.h diff --git a/os/hal/ports/GD/GD32VF103/OTG/driver.mk b/os/hal/ports/GD/GD32VF103/OTG/driver.mk deleted file mode 100644 index cbc3bc5a..00000000 --- a/os/hal/ports/GD/GD32VF103/OTG/driver.mk +++ /dev/null @@ -1,9 +0,0 @@ -ifeq ($(USE_SMART_BUILD),yes) -ifneq ($(findstring HAL_USE_USB TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/OTG/hal_usb_lld.c -endif -else -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/OTG/hal_usb_lld.c -endif - -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/OTG diff --git a/os/hal/ports/GD/GD32VF103/OTGv1/driver.mk b/os/hal/ports/GD/GD32VF103/OTGv1/driver.mk new file mode 100644 index 00000000..a44bc43e --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/OTGv1/driver.mk @@ -0,0 +1,9 @@ +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_USB TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/OTGv1/hal_usb_lld.c +endif +else +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/OTGv1/hal_usb_lld.c +endif + +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/OTGv1 diff --git a/os/hal/ports/GD/GD32VF103/OTG/gd32_otg.h b/os/hal/ports/GD/GD32VF103/OTGv1/gd32_otg.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/OTG/gd32_otg.h rename to os/hal/ports/GD/GD32VF103/OTGv1/gd32_otg.h diff --git a/os/hal/ports/GD/GD32VF103/OTG/hal_usb_lld.c b/os/hal/ports/GD/GD32VF103/OTGv1/hal_usb_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/OTG/hal_usb_lld.c rename to os/hal/ports/GD/GD32VF103/OTGv1/hal_usb_lld.c diff --git a/os/hal/ports/GD/GD32VF103/OTG/hal_usb_lld.h b/os/hal/ports/GD/GD32VF103/OTGv1/hal_usb_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/OTG/hal_usb_lld.h rename to os/hal/ports/GD/GD32VF103/OTGv1/hal_usb_lld.h diff --git a/os/hal/ports/GD/GD32VF103/RTC/driver.mk b/os/hal/ports/GD/GD32VF103/RTC/driver.mk deleted file mode 100644 index 0e1a6c69..00000000 --- a/os/hal/ports/GD/GD32VF103/RTC/driver.mk +++ /dev/null @@ -1,9 +0,0 @@ -ifeq ($(USE_SMART_BUILD),yes) -ifneq ($(findstring HAL_USE_RTC TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/RTC/hal_rtc_lld.c -endif -else -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/RTC/hal_rtc_lld.c -endif - -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/RTC diff --git a/os/hal/ports/GD/GD32VF103/RTCv1/driver.mk b/os/hal/ports/GD/GD32VF103/RTCv1/driver.mk new file mode 100644 index 00000000..b74c4db8 --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/RTCv1/driver.mk @@ -0,0 +1,9 @@ +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_RTC TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/RTCv1/hal_rtc_lld.c +endif +else +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/RTCv1/hal_rtc_lld.c +endif + +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/RTCv1 diff --git a/os/hal/ports/GD/GD32VF103/RTC/hal_rtc_lld.c b/os/hal/ports/GD/GD32VF103/RTCv1/hal_rtc_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/RTC/hal_rtc_lld.c rename to os/hal/ports/GD/GD32VF103/RTCv1/hal_rtc_lld.c diff --git a/os/hal/ports/GD/GD32VF103/RTC/hal_rtc_lld.h b/os/hal/ports/GD/GD32VF103/RTCv1/hal_rtc_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/RTC/hal_rtc_lld.h rename to os/hal/ports/GD/GD32VF103/RTCv1/hal_rtc_lld.h diff --git a/os/hal/ports/GD/GD32VF103/SPI/driver.mk b/os/hal/ports/GD/GD32VF103/SPI/driver.mk deleted file mode 100644 index 50d26c41..00000000 --- a/os/hal/ports/GD/GD32VF103/SPI/driver.mk +++ /dev/null @@ -1,13 +0,0 @@ -ifeq ($(USE_SMART_BUILD),yes) -ifneq ($(findstring HAL_USE_I2S TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPI/hal_i2s_lld.c -endif -ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPI/hal_spi_lld.c -endif -else -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPI/hal_i2s_lld.c -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPI/hal_spi_lld.c -endif - -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPI diff --git a/os/hal/ports/GD/GD32VF103/SPIv1/driver.mk b/os/hal/ports/GD/GD32VF103/SPIv1/driver.mk new file mode 100644 index 00000000..203992b3 --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/SPIv1/driver.mk @@ -0,0 +1,13 @@ +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_I2S TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPIv1/hal_i2s_lld.c +endif +ifneq ($(findstring HAL_USE_SPI TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPIv1/hal_spi_lld.c +endif +else +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPIv1/hal_i2s_lld.c +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPIv1/hal_spi_lld.c +endif + +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPIv1 diff --git a/os/hal/ports/GD/GD32VF103/SPI/hal_i2s_lld.c b/os/hal/ports/GD/GD32VF103/SPIv1/hal_i2s_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/SPI/hal_i2s_lld.c rename to os/hal/ports/GD/GD32VF103/SPIv1/hal_i2s_lld.c diff --git a/os/hal/ports/GD/GD32VF103/SPI/hal_i2s_lld.h b/os/hal/ports/GD/GD32VF103/SPIv1/hal_i2s_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/SPI/hal_i2s_lld.h rename to os/hal/ports/GD/GD32VF103/SPIv1/hal_i2s_lld.h diff --git a/os/hal/ports/GD/GD32VF103/SPI/hal_spi_lld.c b/os/hal/ports/GD/GD32VF103/SPIv1/hal_spi_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/SPI/hal_spi_lld.c rename to os/hal/ports/GD/GD32VF103/SPIv1/hal_spi_lld.c diff --git a/os/hal/ports/GD/GD32VF103/SPI/hal_spi_lld.h b/os/hal/ports/GD/GD32VF103/SPIv1/hal_spi_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/SPI/hal_spi_lld.h rename to os/hal/ports/GD/GD32VF103/SPIv1/hal_spi_lld.h diff --git a/os/hal/ports/GD/GD32VF103/TIM/driver.mk b/os/hal/ports/GD/GD32VF103/TIM/driver.mk deleted file mode 100644 index fb16144b..00000000 --- a/os/hal/ports/GD/GD32VF103/TIM/driver.mk +++ /dev/null @@ -1,19 +0,0 @@ -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIM/hal_st_lld.c - -ifeq ($(USE_SMART_BUILD),yes) -ifneq ($(findstring HAL_USE_GPT TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIM/hal_gpt_lld.c -endif -ifneq ($(findstring HAL_USE_ICU TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIM/hal_icu_lld.c -endif -ifneq ($(findstring HAL_USE_PWM TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIM/hal_pwm_lld.c -endif -else -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIM/hal_gpt_lld.c -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIM/hal_icu_lld.c -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIM/hal_pwm_lld.c -endif - -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIM diff --git a/os/hal/ports/GD/GD32VF103/TIMv1/driver.mk b/os/hal/ports/GD/GD32VF103/TIMv1/driver.mk new file mode 100644 index 00000000..0653d300 --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/TIMv1/driver.mk @@ -0,0 +1,19 @@ +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIMv1/hal_st_lld.c + +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_GPT TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIMv1/hal_gpt_lld.c +endif +ifneq ($(findstring HAL_USE_ICU TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIMv1/hal_icu_lld.c +endif +ifneq ($(findstring HAL_USE_PWM TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIMv1/hal_pwm_lld.c +endif +else +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIMv1/hal_gpt_lld.c +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIMv1/hal_icu_lld.c +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIMv1/hal_pwm_lld.c +endif + +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIMv1 diff --git a/os/hal/ports/GD/GD32VF103/TIM/gd32_tim.h b/os/hal/ports/GD/GD32VF103/TIMv1/gd32_tim.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/TIM/gd32_tim.h rename to os/hal/ports/GD/GD32VF103/TIMv1/gd32_tim.h diff --git a/os/hal/ports/GD/GD32VF103/TIM/hal_gpt_lld.c b/os/hal/ports/GD/GD32VF103/TIMv1/hal_gpt_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/TIM/hal_gpt_lld.c rename to os/hal/ports/GD/GD32VF103/TIMv1/hal_gpt_lld.c diff --git a/os/hal/ports/GD/GD32VF103/TIM/hal_gpt_lld.h b/os/hal/ports/GD/GD32VF103/TIMv1/hal_gpt_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/TIM/hal_gpt_lld.h rename to os/hal/ports/GD/GD32VF103/TIMv1/hal_gpt_lld.h diff --git a/os/hal/ports/GD/GD32VF103/TIM/hal_icu_lld.c b/os/hal/ports/GD/GD32VF103/TIMv1/hal_icu_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/TIM/hal_icu_lld.c rename to os/hal/ports/GD/GD32VF103/TIMv1/hal_icu_lld.c diff --git a/os/hal/ports/GD/GD32VF103/TIM/hal_icu_lld.h b/os/hal/ports/GD/GD32VF103/TIMv1/hal_icu_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/TIM/hal_icu_lld.h rename to os/hal/ports/GD/GD32VF103/TIMv1/hal_icu_lld.h diff --git a/os/hal/ports/GD/GD32VF103/TIM/hal_pwm_lld.c b/os/hal/ports/GD/GD32VF103/TIMv1/hal_pwm_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/TIM/hal_pwm_lld.c rename to os/hal/ports/GD/GD32VF103/TIMv1/hal_pwm_lld.c diff --git a/os/hal/ports/GD/GD32VF103/TIM/hal_pwm_lld.h b/os/hal/ports/GD/GD32VF103/TIMv1/hal_pwm_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/TIM/hal_pwm_lld.h rename to os/hal/ports/GD/GD32VF103/TIMv1/hal_pwm_lld.h diff --git a/os/hal/ports/GD/GD32VF103/TIM/hal_st_lld.c b/os/hal/ports/GD/GD32VF103/TIMv1/hal_st_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/TIM/hal_st_lld.c rename to os/hal/ports/GD/GD32VF103/TIMv1/hal_st_lld.c diff --git a/os/hal/ports/GD/GD32VF103/TIM/hal_st_lld.h b/os/hal/ports/GD/GD32VF103/TIMv1/hal_st_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/TIM/hal_st_lld.h rename to os/hal/ports/GD/GD32VF103/TIMv1/hal_st_lld.h diff --git a/os/hal/ports/GD/GD32VF103/USART/driver.mk b/os/hal/ports/GD/GD32VF103/USART/driver.mk deleted file mode 100644 index 2e048d4a..00000000 --- a/os/hal/ports/GD/GD32VF103/USART/driver.mk +++ /dev/null @@ -1,13 +0,0 @@ -ifeq ($(USE_SMART_BUILD),yes) -ifneq ($(findstring HAL_USE_SERIAL TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USART/hal_serial_lld.c -endif -ifneq ($(findstring HAL_USE_UART TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USART/hal_uart_lld.c -endif -else -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USART/hal_serial_lld.c -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USART/hal_uart_lld.c -endif - -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USART diff --git a/os/hal/ports/GD/GD32VF103/USARTv1/driver.mk b/os/hal/ports/GD/GD32VF103/USARTv1/driver.mk new file mode 100644 index 00000000..68239da7 --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/USARTv1/driver.mk @@ -0,0 +1,13 @@ +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_SERIAL TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USARTv1/hal_serial_lld.c +endif +ifneq ($(findstring HAL_USE_UART TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USARTv1/hal_uart_lld.c +endif +else +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USARTv1/hal_serial_lld.c +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USARTv1/hal_uart_lld.c +endif + +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USARTv1 diff --git a/os/hal/ports/GD/GD32VF103/USART/hal_serial_lld.c b/os/hal/ports/GD/GD32VF103/USARTv1/hal_serial_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/USART/hal_serial_lld.c rename to os/hal/ports/GD/GD32VF103/USARTv1/hal_serial_lld.c diff --git a/os/hal/ports/GD/GD32VF103/USART/hal_serial_lld.h b/os/hal/ports/GD/GD32VF103/USARTv1/hal_serial_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/USART/hal_serial_lld.h rename to os/hal/ports/GD/GD32VF103/USARTv1/hal_serial_lld.h diff --git a/os/hal/ports/GD/GD32VF103/USART/hal_uart_lld.c b/os/hal/ports/GD/GD32VF103/USARTv1/hal_uart_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/USART/hal_uart_lld.c rename to os/hal/ports/GD/GD32VF103/USARTv1/hal_uart_lld.c diff --git a/os/hal/ports/GD/GD32VF103/USART/hal_uart_lld.h b/os/hal/ports/GD/GD32VF103/USARTv1/hal_uart_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/USART/hal_uart_lld.h rename to os/hal/ports/GD/GD32VF103/USARTv1/hal_uart_lld.h diff --git a/os/hal/ports/GD/GD32VF103/gd32_registry.h b/os/hal/ports/GD/GD32VF103/gd32_registry.h index 28c0f6e7..cb869dc8 100644 --- a/os/hal/ports/GD/GD32VF103/gd32_registry.h +++ b/os/hal/ports/GD/GD32VF103/gd32_registry.h @@ -215,8 +215,19 @@ /* Flash attributes.*/ #define GD32_FLASH_NUMBER_OF_BANKS 1 #define GD32_FLASH_SECTOR_SIZE 1024U + +#if defined(GD32VF103T4) || defined(GD32VF103R4) || defined(GD32VF103C4) +#define GD32_FLASH_SECTORS_PER_BANK 16 +#elif defined(GD32VF103C6) || defined(GD32VF103T6) || defined(GD32VF103R6) +#define GD32_FLASH_SECTORS_PER_BANK 32 +#elif defined(GD32VF103C8) || defined(GD32VF103T8) || defined(GD32VF103R8) || defined(GD32VF103V8) +#define GD32_FLASH_SECTORS_PER_BANK 64 +#elif defined(GD32VF103TB) || defined(GD32VF103VB) || defined(GD32VF103CB) || defined(GD32VF103RB) +#define GD32_FLASH_SECTORS_PER_BANK 128 +#endif + #if !defined(GD32_FLASH_SECTORS_PER_BANK) || defined(__DOXYGEN__) -#define GD32_FLASH_SECTORS_PER_BANK 128 /* Maximum, can be redefined.*/ +#define GD32_FLASH_SECTORS_PER_BANK 128 /* Maximum, can be redefined.*/ #endif /* GPIO attributes.*/ diff --git a/os/hal/ports/GD/GD32VF103/platform.mk b/os/hal/ports/GD/GD32VF103/platform.mk index 3a1f2dbd..57d899f0 100644 --- a/os/hal/ports/GD/GD32VF103/platform.mk +++ b/os/hal/ports/GD/GD32VF103/platform.mk @@ -1,11 +1,11 @@ # Required platform files. -PLATFORMSRC := ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/hal_lld.c \ +PLATFORMSRC_CONTRIB := ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/hal_lld.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/common/RISCV-ECLIC/eclic.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/gd32_isr.c \ ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/hal_efl_lld.c # Required include directories. -PLATFORMINC := ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103 \ +PLATFORMINC_CONTRIB := ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103 \ ${CHIBIOS_CONTRIB}/os/hal/ports/common/RISCV-ECLIC # Optional platform files. @@ -23,26 +23,26 @@ endif HALCONF := $(strip $(shell cat $(HALCONFDIR)/halconf.h $(HALCONFDIR)/halconf_community.h | egrep -e "\#define")) ifneq ($(findstring HAL_USE_ADC TRUE,$(HALCONF)),) -PLATFORMSRC += $(CHIBIOS_CONTRIB)/os/hal/ports/GD/GD32VF103/hal_adc_lld.c +PLATFORMSRC_CONTRIB += $(CHIBIOS_CONTRIB)/os/hal/ports/GD/GD32VF103/hal_adc_lld.c endif else -PLATFORMSRC += $(CHIBIOS_CONTRIB)/os/hal/ports/GD/GD32VF103/hal_adc_lld.c +PLATFORMSRC_CONTRIB += $(CHIBIOS_CONTRIB)/os/hal/ports/GD/GD32VF103/hal_adc_lld.c endif # Drivers compatible with the platform. -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CAN/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CRC/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DAC/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DMA/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/GPIO/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/I2C/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/RTC/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPI/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIM/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USART/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/OTG/driver.mk -include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/xWDG/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CANv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/CRCv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DACv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/DMAv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/GPIOv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/I2Cv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/RTCv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/SPIv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/TIMv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/USARTv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/OTGv1/driver.mk +include ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/xWDGv1/driver.mk # Shared variables -ALLCSRC += $(PLATFORMSRC) -ALLINC += $(PLATFORMINC) \ No newline at end of file +ALLCSRC += $(PLATFORMSRC_CONTRIB) +ALLINC += $(PLATFORMINC_CONTRIB) diff --git a/os/hal/ports/GD/GD32VF103/xWDG/driver.mk b/os/hal/ports/GD/GD32VF103/xWDG/driver.mk deleted file mode 100644 index c7cf3a00..00000000 --- a/os/hal/ports/GD/GD32VF103/xWDG/driver.mk +++ /dev/null @@ -1,9 +0,0 @@ -ifeq ($(USE_SMART_BUILD),yes) -ifneq ($(findstring HAL_USE_WDG TRUE,$(HALCONF)),) -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/xWDG/hal_wdg_lld.c -endif -else -PLATFORMSRC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/xWDG/hal_wdg_lld.c -endif - -PLATFORMINC += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/xWDG diff --git a/os/hal/ports/GD/GD32VF103/xWDGv1/driver.mk b/os/hal/ports/GD/GD32VF103/xWDGv1/driver.mk new file mode 100644 index 00000000..41479438 --- /dev/null +++ b/os/hal/ports/GD/GD32VF103/xWDGv1/driver.mk @@ -0,0 +1,9 @@ +ifeq ($(USE_SMART_BUILD),yes) +ifneq ($(findstring HAL_USE_WDG TRUE,$(HALCONF)),) +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/xWDGv1/hal_wdg_lld.c +endif +else +PLATFORMSRC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/xWDGv1/hal_wdg_lld.c +endif + +PLATFORMINC_CONTRIB += ${CHIBIOS_CONTRIB}/os/hal/ports/GD/GD32VF103/xWDGv1 diff --git a/os/hal/ports/GD/GD32VF103/xWDG/hal_wdg_lld.c b/os/hal/ports/GD/GD32VF103/xWDGv1/hal_wdg_lld.c similarity index 100% rename from os/hal/ports/GD/GD32VF103/xWDG/hal_wdg_lld.c rename to os/hal/ports/GD/GD32VF103/xWDGv1/hal_wdg_lld.c diff --git a/os/hal/ports/GD/GD32VF103/xWDG/hal_wdg_lld.h b/os/hal/ports/GD/GD32VF103/xWDGv1/hal_wdg_lld.h similarity index 100% rename from os/hal/ports/GD/GD32VF103/xWDG/hal_wdg_lld.h rename to os/hal/ports/GD/GD32VF103/xWDGv1/hal_wdg_lld.h