diff --git a/README.md b/README.md index baa795d29f..b646392af7 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ For general information, please check the stm32duino [README.md](https://github. - [Catena 480x Features](#catena-480x-features) - [Model 4916 Features](#model-4916-features) - [Model 4917 Features](#model-4917-features) + - [Model 4931 Features](#model-4931-features) + - [Model 4933 Features](#model-4933-features) - [Troubleshooting](#troubleshooting) - [Installing a Development Copy of this BSP](#installing-a-development-copy-of-this-bsp) - [Release History](#release-history) @@ -64,6 +66,8 @@ The Arduino IDE allows you to select the following items. | MCCI Catena 4802 | Murata CMWX1ZZABZ module, STM32L082 | [480x](#catena-480x-features) | Primary battery, Modbus, SHT31-DIS-F, I2C Expander | | MCCI Model 4916 | Murata CMWX1ZZABZ module, STM32L082 | [4916](#model-4916-features) | Type-C battery, GPS, BME680, SHT31-DIS-F, IPS7100, Spec sensors, SCD30 | | MCCI Model 4917 | Murata CMWX1ZZABZ module, STM32L082 | [4917](#model-4917-features) | Primary battery, JST-XH for OneWire sensor | +| MCCI Model 4931 | Murata CMWX1ZZABZ module, STM32L082 | [4931](#model-4931-features) | Primary battery, SHT35, BMP581, OneWire sensor, MS10 soil sensor, Davis rain gauge, Pressure transducer, solar panel, SD card | +| MCCI Model 4933 | Murata CMWX1ZZABZ module, STM32L082 | [4933](#model-4933-features) | Primary battery, GPS, BMP581, SHT35, IPS7100, Spec sensors | ### Catena 461x Series @@ -162,6 +166,40 @@ The 4917 is a dedicated board designed for temperature monitoring using onewire | Sensors | None | | External interfaces | TTL Serial | +### Model 4931 Features + +The 4931 is a dedicated board designed for sap flow monitoring. + +| Feature | 4931 | +|---------|------| +| TCXO Control | Controlled by code | +| Battery type | Primary rechargeable Lipo battery | +| System voltage | 3.3V +| High-side switch for power for external sensors | Yes | +| Screw terminals for external sensors | Yes | +| QWIIC for external sensors | Yes | +| Feather physical compatibility | No | +| USB | Yes, DFU download, runtime dat | +| Sensors | BMP581, SHT35 | +| External interfaces | TTL Serial, OneWire sensor, Davis rain gauge, MS10 soil sensor, Pressure transducer, Solar panel, SD card | + +### Model 4933 Features + +The 4933 is a dedicated board designed for monitoring air quality. + +| Feature | 4933 | +|---------|------| +| TCXO Control | Controlled by code | +| Battery type | Primary rechargeable Lipo battery | +| System voltage | 3.3V +| High-side switch for power for external sensors | Yes | +| Screw terminals for external sensors | None | +| QWIIC for external sensors | Yes | +| Feather physical compatibility | No | +| USB | Yes, DFU download, runtime dat | +| Sensors | BMP581, SHT35, GPS | +| External interfaces | TTL Serial, Spec Sensors, IPS7100 | + ## Troubleshooting If you have any issue, you may [file an issue on GitHub](https://github.com/mcci-catena/Arduino_Core_STM32/issues/new). You may also submit a support request on the [MCCI support forum](http://portal.mcci.com). @@ -196,6 +234,8 @@ Remember to restart the IDE whenever you change `platform.txt`, `boards.txt` or ## Release History +- [HEAD](https://github.com/mcci-catena/Arduino_Core_STM32/). Added support for new board Model 4931 and Model 4933. + - [v3.1.0](https://github.com/mcci-catena/Arduino_Core_STM32/releases/tag/v3.1.0). Feature enhancement. Added support for new board Model 4917 ([#196](https://github.com/mcci-catena/Arduino_Core_STM32/issues/196)) and Model 4916 ([#198](https://github.com/mcci-catena/Arduino_Core_STM32/issues/198)). Added Two HW Serial support for Catena 4630 ([#199](https://github.com/mcci-catena/Arduino_Core_STM32/issues/199)). - [v3.0.5](https://github.com/mcci-catena/Arduino_Core_STM32/releases/tag/v3.0.5) Patch release. Don't use `` to implement `min()` and `max()` ([#184](https://github.com/mcci-catena/Arduino_Core_STM32/issues/184)). Prevent hangs if USB is enabled but D+/D- float to high/high ([#189](https://github.com/mcci-catena/Arduino_Core_STM32/issues/189), [#190](https://github.com/mcci-catena/Arduino_Core_STM32/issues/190)) -- thanks to Mohammed Mayyan ([@mmayyan](https://github.com/mhmayyan)) for help in finding this. diff --git a/boards.json b/boards.json index 527aae05b2..215e48eb21 100644 --- a/boards.json +++ b/boards.json @@ -124,5 +124,33 @@ "build_variant_extra_flags": "-DMCCI_MODEL_4917_PA0_SWITCHES_VDD=1", "build_board_old_flags": "-DARDUINO_MODEL_{{modelnumber}}" }, + + { + "modelnumber": "4931", + "board": "mcci_model_{{modelnumber}}", + "name": "MCCI Model {{modelnumber}}", + "pid": "0215", + "build_board": "MCCI_MODEL_{{modelnumber}}", + "build_variant": "MODEL_4931", + "build_board_old_flags": "-DARDUINO_MODEL_{{modelnumber}}", + "extra_sections": [ + { "name": "usb" }, + { "name": "DFU" }, + { "name": "xserial", + "using": "xserial_usb_serial12" + } + ] + }, + + { + "modelnumber": "4933", + "board": "mcci_model_{{modelnumber}}", + "name": "MCCI Model {{modelnumber}}", + "pid": "0216", + "build_board": "MCCI_MODEL_{{modelnumber}}", + "build_variant": "MODEL_4933", + "bootloader_file": "McciBootloader_4801", + "build_board_old_flags": "-DARDUINO_MODEL_{{modelnumber}}" + }, ] -} +} \ No newline at end of file diff --git a/boards.template b/boards.template index 6c1e3ecdda..30cba871a2 100644 --- a/boards.template +++ b/boards.template @@ -5,7 +5,7 @@ # Input to generate_boards.bri, produces Arduino IDE boards.txt. # # Copyright: -# Copyright (c) 2018-2023 MCCI Corporation +# Copyright (c) 2018-2025 MCCI Corporation # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/boards.txt b/boards.txt index e8303a9a54..de65521a83 100644 --- a/boards.txt +++ b/boards.txt @@ -5,7 +5,7 @@ # Define all the boards for this board support package to the Arduino IDE # # Copyright: -# Copyright (c) 2018-2023 MCCI Corporation +# Copyright (c) 2018-2025 MCCI Corporation # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -2174,3 +2174,403 @@ mcci_model_4917.menu.lorawan_subband.sb11.build.lorawan_subband_flags=-DARDUINO_ #### end of configuration info for MCCI Model 4917 +# +# Configuration information for MCCI Model 4931 +# See template in https://github.com/mcci-catena/Arduino_Core_STM32/boards.template +# +mcci_model_4931.name=MCCI Model 4931 +mcci_model_4931.build.vid=0x040E +mcci_model_4931.build.pid=0x0215 +mcci_model_4931.vid.0=0x040E +mcci_model_4931.pid.0=0x0215 +mcci_model_4931.build.usb_product="MCCI Model 4931" +mcci_model_4931.build.usb_manufacturer="MCCI Corporation" + +mcci_model_4931.build.core=arduino +mcci_model_4931.build.board=MCCI_MODEL_4931 +mcci_model_4931.build.product_line=STM32L082xx + +mcci_model_4931.upload.maximum_size=196608 +mcci_model_4931.upload.maximum_data_size=20480 +mcci_model_4931.build.mcu=cortex-m0 +mcci_model_4931.build.series=STM32L0xx +mcci_model_4931.build.variant=MODEL_4931 +mcci_model_4931.build.variant_extra_flags= +mcci_model_4931.build.cmsis_lib_gcc=arm_cortexM0l_math +mcci_model_4931.build.ldscript= +mcci_model_4931.build.extra_flags=-DARDUINO_STM32 -DARDUINO_{build.series} -DARDUINO_{build.product_line} -DARDUINO_MODEL_4931 -D{build.product_line} {build.sysclk_flags} {build.xSerial} -D__CORTEX_SC=0 -D{build.board} {build.lorawan_flags} {build.lorawan_network_flags} {build.lorawan_subband_flags} {build.variant_extra_flags} +# mcci_model_4931.build.c.Werror= +# mcci_model_4931.build.cpp.Werror= +# mcci_model_4931.build.S.Werror= +mcci_model_4931.bootloader.tool=stm32l0_dfu +mcci_model_4931.bootloader.file=McciBootloader_46xx + +# +# menu.upload_method +mcci_model_4931.menu.upload_method.DFU_bl=DFU (include bootloader) +mcci_model_4931.menu.upload_method.DFU_bl.upload.tool=stm32l0_dfu_bootloader +mcci_model_4931.menu.upload_method.DFU_bl.upload.protocol=dfu +mcci_model_4931.menu.upload_method.DFU_bl.upload.maximum_size=172032 +mcci_model_4931.menu.upload_method.DFU_bl.upload.maximum_data_size=20480 + +mcci_model_4931.menu.upload_method.DFU=DFU +mcci_model_4931.menu.upload_method.DFU.upload.tool=stm32l0_dfu +mcci_model_4931.menu.upload_method.DFU.upload.protocol=dfu +mcci_model_4931.menu.upload_method.DFU.upload.maximum_size=196608 +mcci_model_4931.menu.upload_method.DFU.upload.maximum_data_size=20480 + +mcci_model_4931.menu.upload_method.STLink_bl=STLink (include bootloader) +mcci_model_4931.menu.upload_method.STLink_bl.upload.protocol=STLink +mcci_model_4931.menu.upload_method.STLink_bl.upload.tool=stlink_upload_bootloader +mcci_model_4931.menu.upload_method.STLink_bl.upload.maximum_size=172032 +mcci_model_4931.menu.upload_method.STLink_bl.upload.maximum_data_size=20480 + +mcci_model_4931.menu.upload_method.STLink=STLink +mcci_model_4931.menu.upload_method.STLink.upload.protocol=STLink +mcci_model_4931.menu.upload_method.STLink.upload.tool=stlink_upload +mcci_model_4931.menu.upload_method.STLink.upload.maximum_size=196608 +mcci_model_4931.menu.upload_method.STLink.upload.maximum_data_size=20480 + +#mcci_model_4931.menu.upload_method.Serial=Serial +#mcci_model_4931.menu.upload_method.Serial.upload.protocol=Serial +#mcci_model_4931.menu.upload_method.Serial.upload.tool=serial_upload + +# +# menu.xserial +mcci_model_4931.menu.xserial.usbhwserial=USB + Two HW Serial +mcci_model_4931.menu.xserial.usb=USB Serial Only +mcci_model_4931.menu.xserial.two=Two HW Serial +mcci_model_4931.menu.xserial.generic=Generic Serial +mcci_model_4931.menu.xserial.none=No Serial +mcci_model_4931.menu.xserial.usbhwserial.build.xSerial={build.usb_flags} -DARDUINO_BSP_CONFIG_SERIAL_MASK=0x7 +mcci_model_4931.menu.xserial.usb.build.xSerial={build.usb_flags} -DARDUINO_BSP_CONFIG_SERIAL_MASK=0x1 +mcci_model_4931.menu.xserial.generic.build.xSerial=-DARDUINO_BSP_CONFIG_SERIAL_MASK=0x2 +mcci_model_4931.menu.xserial.none.build.xSerial=-DARDUINO_BSP_CONFIG_SERIAL_MASK=0x0 +mcci_model_4931.menu.xserial.two.build.xSerial=-DARDUINO_BSP_CONFIG_SERIAL_MASK=0x6 + +# +# menu.sysclk +mcci_model_4931.menu.sysclk.pll32m=32 MHz (most power) +mcci_model_4931.menu.sysclk.pll24m=24 MHz +mcci_model_4931.menu.sysclk.hsi16m=16 MHz +mcci_model_4931.menu.sysclk.msi4194k=4.194 MHz (no USB) +mcci_model_4931.menu.sysclk.msi2097k=2.097 MHz (no USB, least power) +mcci_model_4931.menu.sysclk.pll32m.build.sysclk_flags=-DCATENA_CFG_SYSCLK=32 +mcci_model_4931.menu.sysclk.pll24m.build.sysclk_flags=-DCATENA_CFG_SYSCLK=24 +mcci_model_4931.menu.sysclk.hsi16m.build.sysclk_flags=-DCATENA_CFG_SYSCLK=16 +mcci_model_4931.menu.sysclk.msi4194k.build.sysclk_flags=-DCATENA_CFG_SYSCLK=4 +mcci_model_4931.menu.sysclk.msi2097k.build.sysclk_flags=-DCATENA_CFG_SYSCLK=2 + +# +# menu.bootloader +mcci_model_4931.menu.boot.trusted=MCCI Trusted Boot +mcci_model_4931.menu.boot.basic=Basic (no bootloader) + +# convert boot selections to settings +mcci_model_4931.menu.boot.basic.build.ldscript=../mcci-ldscript-basic.ld +mcci_model_4931.menu.boot.basic.build.baseaddr=0x08000000 +mcci_model_4931.menu.boot.trusted.build.ldscript=../mcci-ldscript-trusted.ld +mcci_model_4931.menu.boot.trusted.build.baseaddr=0x08005000 + +# +# menu.opt +mcci_model_4931.menu.opt.osstd=Smallest (-Os default) +mcci_model_4931.menu.opt.osstd.build.flags.optimize=-Os +mcci_model_4931.menu.opt.osstd.build.flags.ldspecs= +# mcci_model_4931.menu.opt.oslto=Smallest (-Os) with LTO +# mcci_model_4931.menu.opt.oslto.build.flags.optimize=-Os -flto +# mcci_model_4931.menu.opt.oslto.build.flags.ldspecs=-flto +mcci_model_4931.menu.opt.o1std=Fast (-O1) +mcci_model_4931.menu.opt.o1std.build.flags.optimize=-O1 +mcci_model_4931.menu.opt.o1std.build.flags.ldspecs= +# mcci_model_4931.menu.opt.o1lto=Fast (-O1) with LTO +# mcci_model_4931.menu.opt.o1lto.build.flags.optimize=-O1 -flto +# mcci_model_4931.menu.opt.o1lto.build.flags.ldspecs=-flto +mcci_model_4931.menu.opt.o2std=Faster (-O2) +mcci_model_4931.menu.opt.o2std.build.flags.optimize=-O2 +mcci_model_4931.menu.opt.o2std.build.flags.ldspecs= +# mcci_model_4931.menu.opt.o2lto=Faster (-O2) with LTO +# mcci_model_4931.menu.opt.o2lto.build.flags.optimize=-O2 -flto +# mcci_model_4931.menu.opt.o2lto.build.flags.ldspecs=-flto +mcci_model_4931.menu.opt.o3std=Fastest (-O3) +mcci_model_4931.menu.opt.o3std.build.flags.optimize=-O3 +mcci_model_4931.menu.opt.o3std.build.flags.ldspecs= +# mcci_model_4931.menu.opt.o3lto=Fastest (-O3) with LTO +# mcci_model_4931.menu.opt.o3lto.build.flags.optimize=-O3 -flto +# mcci_model_4931.menu.opt.o3lto.build.flags.ldspecs=-flto +mcci_model_4931.menu.opt.ogstd=Debug (-g) +mcci_model_4931.menu.opt.ogstd.build.flags.optimize=-Og -gdwarf-2 +mcci_model_4931.menu.opt.ogstd.build.flags.ldspecs= + +# +# menu.lorawan_region +mcci_model_4931.menu.lorawan_region.us915=North America 915 MHz +mcci_model_4931.menu.lorawan_region.eu868=Europe 868 MHz +mcci_model_4931.menu.lorawan_region.au915=Australia 915 MHz +mcci_model_4931.menu.lorawan_region.as923=Asia 923 MHz +mcci_model_4931.menu.lorawan_region.as923jp=Japan 923 MHz +mcci_model_4931.menu.lorawan_region.kr920=Korea 920 MHz +mcci_model_4931.menu.lorawan_region.in866=India 866 MHz +mcci_model_4931.menu.lorawan_region.projcfg=Use arduino-lmic/project_config/lmic_project_lmic_config_preconditions.h +mcci_model_4931.menu.lorawan_region.us915.build.lorawan_flags=-DCFG_us915=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4931.menu.lorawan_region.eu868.build.lorawan_flags=-DCFG_eu868=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4931.menu.lorawan_region.au915.build.lorawan_flags=-DCFG_au921=1 -DCFG_au915=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4931.menu.lorawan_region.as923.build.lorawan_flags=-DCFG_as923=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4931.menu.lorawan_region.as923jp.build.lorawan_flags=-DCFG_as923=1 -DLMIC_COUNTRY_CODE=LMIC_COUNTRY_CODE_JP -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4931.menu.lorawan_region.kr920.build.lorawan_flags=-DCFG_kr920=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4931.menu.lorawan_region.in866.build.lorawan_flags=-DCFG_in866=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4931.menu.lorawan_region.projcfg.build.lorawan_flags= + +# +# menu.lorawan_network +mcci_model_4931.menu.lorawan_network.ttn=The Things Network +mcci_model_4931.menu.lorawan_network.ttn.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_TTN=1 +mcci_model_4931.menu.lorawan_network.actility=Actility ThingsPark +mcci_model_4931.menu.lorawan_network.actility.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_ACTILITY=1 +mcci_model_4931.menu.lorawan_network.helium=Helium +mcci_model_4931.menu.lorawan_network.helium.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_HELIUM=1 +mcci_model_4931.menu.lorawan_network.machineq=machineQ +mcci_model_4931.menu.lorawan_network.machineq.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_MACHINEQ=1 +mcci_model_4931.menu.lorawan_network.senet=Senet +mcci_model_4931.menu.lorawan_network.senet.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_SENET=1 +mcci_model_4931.menu.lorawan_network.senra=Senra +mcci_model_4931.menu.lorawan_network.senra.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_SENRA=1 +mcci_model_4931.menu.lorawan_network.swisscom=Swisscom +mcci_model_4931.menu.lorawan_network.swisscom.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_SWISSCOM=1 +mcci_model_4931.menu.lorawan_network.chirpstack=ChirpStack +mcci_model_4931.menu.lorawan_network.chirpstack.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_CHIRPSTACK=1 +mcci_model_4931.menu.lorawan_network.generic=Generic +mcci_model_4931.menu.lorawan_network.generic.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_GENERIC=1 +mcci_model_4931.menu.lorawan_network.projcfg=Use arduino-lmic/project_config/lmic_project_lmic_config_preconditions.h +mcci_model_4931.menu.lorawan_network.projcfg.build.lorawan_network_flags= + +# +# menul.lorawan_subband +mcci_model_4931.menu.lorawan_subband.default=Default, works everywhere +mcci_model_4931.menu.lorawan_subband.default.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=-1 +mcci_model_4931.menu.lorawan_subband.sb0=sb0, ch 0~7 (US/AU/CN470) +mcci_model_4931.menu.lorawan_subband.sb0.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=0 +mcci_model_4931.menu.lorawan_subband.sb1=sb1, ch 8~15 (US/AU/CN470) +mcci_model_4931.menu.lorawan_subband.sb1.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=1 +mcci_model_4931.menu.lorawan_subband.sb2=sb2, ch 16~23 (US/AU/CN470) +mcci_model_4931.menu.lorawan_subband.sb2.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=2 +mcci_model_4931.menu.lorawan_subband.sb3=sb3, ch 24~31 (US/AU/CN470) +mcci_model_4931.menu.lorawan_subband.sb3.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=3 +mcci_model_4931.menu.lorawan_subband.sb4=sb4, ch 32~39 (US/AU/CN470) +mcci_model_4931.menu.lorawan_subband.sb4.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=4 +mcci_model_4931.menu.lorawan_subband.sb5=sb5, ch 40~47 (US/AU/CN470) +mcci_model_4931.menu.lorawan_subband.sb5.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=5 +mcci_model_4931.menu.lorawan_subband.sb6=sb6, ch 48~55 (US/AU/CN470) +mcci_model_4931.menu.lorawan_subband.sb6.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=6 +mcci_model_4931.menu.lorawan_subband.sb7=sb7, ch 56~63 (US/AU/CN470) +mcci_model_4931.menu.lorawan_subband.sb7.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=7 +mcci_model_4931.menu.lorawan_subband.sb8=sb8, ch 64~71 (CN470) +mcci_model_4931.menu.lorawan_subband.sb8.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=8 +mcci_model_4931.menu.lorawan_subband.sb9=sb9, ch 72~79 (CN470) +mcci_model_4931.menu.lorawan_subband.sb9.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=9 +mcci_model_4931.menu.lorawan_subband.sb10=sb10, ch 80~87 (CN470) +mcci_model_4931.menu.lorawan_subband.sb10.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=10 +mcci_model_4931.menu.lorawan_subband.sb11=sb11, ch 88~95 (CN470) +mcci_model_4931.menu.lorawan_subband.sb11.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=11 + +#### end of configuration info for MCCI Model 4931 + +# +# Configuration information for MCCI Model 4933 +# See template in https://github.com/mcci-catena/Arduino_Core_STM32/boards.template +# +mcci_model_4933.name=MCCI Model 4933 +mcci_model_4933.build.vid=0x040E +mcci_model_4933.build.pid=0x0216 +mcci_model_4933.vid.0=0x040E +mcci_model_4933.pid.0=0x0216 +mcci_model_4933.build.usb_product="MCCI Model 4933" +mcci_model_4933.build.usb_manufacturer="MCCI Corporation" + +mcci_model_4933.build.core=arduino +mcci_model_4933.build.board=MCCI_MODEL_4933 +mcci_model_4933.build.product_line=STM32L082xx + +mcci_model_4933.upload.maximum_size=196608 +mcci_model_4933.upload.maximum_data_size=20480 +mcci_model_4933.build.mcu=cortex-m0 +mcci_model_4933.build.series=STM32L0xx +mcci_model_4933.build.variant=MODEL_4933 +mcci_model_4933.build.variant_extra_flags= +mcci_model_4933.build.cmsis_lib_gcc=arm_cortexM0l_math +mcci_model_4933.build.ldscript= +mcci_model_4933.build.extra_flags=-DARDUINO_STM32 -DARDUINO_{build.series} -DARDUINO_{build.product_line} -DARDUINO_MODEL_4933 -D{build.product_line} {build.sysclk_flags} {build.xSerial} -D__CORTEX_SC=0 -D{build.board} {build.lorawan_flags} {build.lorawan_network_flags} {build.lorawan_subband_flags} {build.variant_extra_flags} +# mcci_model_4933.build.c.Werror= +# mcci_model_4933.build.cpp.Werror= +# mcci_model_4933.build.S.Werror= +mcci_model_4933.bootloader.tool=stm32l0_dfu +mcci_model_4933.bootloader.file=McciBootloader_4801 + +# +# menu.upload_method +mcci_model_4933.menu.upload_method.DFU_bl=DFU (include bootloader) +mcci_model_4933.menu.upload_method.DFU_bl.upload.tool=stm32l0_dfu_bootloader +mcci_model_4933.menu.upload_method.DFU_bl.upload.protocol=dfu +mcci_model_4933.menu.upload_method.DFU_bl.upload.maximum_size=172032 +mcci_model_4933.menu.upload_method.DFU_bl.upload.maximum_data_size=20480 + +mcci_model_4933.menu.upload_method.DFU=DFU +mcci_model_4933.menu.upload_method.DFU.upload.tool=stm32l0_dfu +mcci_model_4933.menu.upload_method.DFU.upload.protocol=dfu +mcci_model_4933.menu.upload_method.DFU.upload.maximum_size=196608 +mcci_model_4933.menu.upload_method.DFU.upload.maximum_data_size=20480 + +mcci_model_4933.menu.upload_method.STLink_bl=STLink (include bootloader) +mcci_model_4933.menu.upload_method.STLink_bl.upload.protocol=STLink +mcci_model_4933.menu.upload_method.STLink_bl.upload.tool=stlink_upload_bootloader +mcci_model_4933.menu.upload_method.STLink_bl.upload.maximum_size=172032 +mcci_model_4933.menu.upload_method.STLink_bl.upload.maximum_data_size=20480 + +mcci_model_4933.menu.upload_method.STLink=STLink +mcci_model_4933.menu.upload_method.STLink.upload.protocol=STLink +mcci_model_4933.menu.upload_method.STLink.upload.tool=stlink_upload +mcci_model_4933.menu.upload_method.STLink.upload.maximum_size=196608 +mcci_model_4933.menu.upload_method.STLink.upload.maximum_data_size=20480 + +#mcci_model_4933.menu.upload_method.Serial=Serial +#mcci_model_4933.menu.upload_method.Serial.upload.protocol=Serial +#mcci_model_4933.menu.upload_method.Serial.upload.tool=serial_upload + +# +# menu.xserial +mcci_model_4933.menu.xserial.usb=USB Serial +mcci_model_4933.menu.xserial.generic=Generic Serial +mcci_model_4933.menu.xserial.none=No Serial +mcci_model_4933.menu.xserial.usbhwserial=USB + HW Serial +mcci_model_4933.menu.xserial.usb.build.xSerial={build.usb_flags} -DARDUINO_BSP_CONFIG_SERIAL_MASK=0x1 +mcci_model_4933.menu.xserial.generic.build.xSerial=-DARDUINO_BSP_CONFIG_SERIAL_MASK=0x2 +mcci_model_4933.menu.xserial.none.build.xSerial=-DARDUINO_BSP_CONFIG_SERIAL_MASK=0x0 +mcci_model_4933.menu.xserial.usbhwserial.build.xSerial={build.usb_flags} -DARDUINO_BSP_CONFIG_SERIAL_MASK=0x3 + +# +# menu.sysclk +mcci_model_4933.menu.sysclk.pll32m=32 MHz (most power) +mcci_model_4933.menu.sysclk.pll24m=24 MHz +mcci_model_4933.menu.sysclk.hsi16m=16 MHz +mcci_model_4933.menu.sysclk.msi4194k=4.194 MHz (no USB) +mcci_model_4933.menu.sysclk.msi2097k=2.097 MHz (no USB, least power) +mcci_model_4933.menu.sysclk.pll32m.build.sysclk_flags=-DCATENA_CFG_SYSCLK=32 +mcci_model_4933.menu.sysclk.pll24m.build.sysclk_flags=-DCATENA_CFG_SYSCLK=24 +mcci_model_4933.menu.sysclk.hsi16m.build.sysclk_flags=-DCATENA_CFG_SYSCLK=16 +mcci_model_4933.menu.sysclk.msi4194k.build.sysclk_flags=-DCATENA_CFG_SYSCLK=4 +mcci_model_4933.menu.sysclk.msi2097k.build.sysclk_flags=-DCATENA_CFG_SYSCLK=2 + +# +# menu.bootloader +mcci_model_4933.menu.boot.trusted=MCCI Trusted Boot +mcci_model_4933.menu.boot.basic=Basic (no bootloader) + +# convert boot selections to settings +mcci_model_4933.menu.boot.basic.build.ldscript=../mcci-ldscript-basic.ld +mcci_model_4933.menu.boot.basic.build.baseaddr=0x08000000 +mcci_model_4933.menu.boot.trusted.build.ldscript=../mcci-ldscript-trusted.ld +mcci_model_4933.menu.boot.trusted.build.baseaddr=0x08005000 + +# +# menu.opt +mcci_model_4933.menu.opt.osstd=Smallest (-Os default) +mcci_model_4933.menu.opt.osstd.build.flags.optimize=-Os +mcci_model_4933.menu.opt.osstd.build.flags.ldspecs= +# mcci_model_4933.menu.opt.oslto=Smallest (-Os) with LTO +# mcci_model_4933.menu.opt.oslto.build.flags.optimize=-Os -flto +# mcci_model_4933.menu.opt.oslto.build.flags.ldspecs=-flto +mcci_model_4933.menu.opt.o1std=Fast (-O1) +mcci_model_4933.menu.opt.o1std.build.flags.optimize=-O1 +mcci_model_4933.menu.opt.o1std.build.flags.ldspecs= +# mcci_model_4933.menu.opt.o1lto=Fast (-O1) with LTO +# mcci_model_4933.menu.opt.o1lto.build.flags.optimize=-O1 -flto +# mcci_model_4933.menu.opt.o1lto.build.flags.ldspecs=-flto +mcci_model_4933.menu.opt.o2std=Faster (-O2) +mcci_model_4933.menu.opt.o2std.build.flags.optimize=-O2 +mcci_model_4933.menu.opt.o2std.build.flags.ldspecs= +# mcci_model_4933.menu.opt.o2lto=Faster (-O2) with LTO +# mcci_model_4933.menu.opt.o2lto.build.flags.optimize=-O2 -flto +# mcci_model_4933.menu.opt.o2lto.build.flags.ldspecs=-flto +mcci_model_4933.menu.opt.o3std=Fastest (-O3) +mcci_model_4933.menu.opt.o3std.build.flags.optimize=-O3 +mcci_model_4933.menu.opt.o3std.build.flags.ldspecs= +# mcci_model_4933.menu.opt.o3lto=Fastest (-O3) with LTO +# mcci_model_4933.menu.opt.o3lto.build.flags.optimize=-O3 -flto +# mcci_model_4933.menu.opt.o3lto.build.flags.ldspecs=-flto +mcci_model_4933.menu.opt.ogstd=Debug (-g) +mcci_model_4933.menu.opt.ogstd.build.flags.optimize=-Og -gdwarf-2 +mcci_model_4933.menu.opt.ogstd.build.flags.ldspecs= + +# +# menu.lorawan_region +mcci_model_4933.menu.lorawan_region.us915=North America 915 MHz +mcci_model_4933.menu.lorawan_region.eu868=Europe 868 MHz +mcci_model_4933.menu.lorawan_region.au915=Australia 915 MHz +mcci_model_4933.menu.lorawan_region.as923=Asia 923 MHz +mcci_model_4933.menu.lorawan_region.as923jp=Japan 923 MHz +mcci_model_4933.menu.lorawan_region.kr920=Korea 920 MHz +mcci_model_4933.menu.lorawan_region.in866=India 866 MHz +mcci_model_4933.menu.lorawan_region.projcfg=Use arduino-lmic/project_config/lmic_project_lmic_config_preconditions.h +mcci_model_4933.menu.lorawan_region.us915.build.lorawan_flags=-DCFG_us915=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4933.menu.lorawan_region.eu868.build.lorawan_flags=-DCFG_eu868=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4933.menu.lorawan_region.au915.build.lorawan_flags=-DCFG_au921=1 -DCFG_au915=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4933.menu.lorawan_region.as923.build.lorawan_flags=-DCFG_as923=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4933.menu.lorawan_region.as923jp.build.lorawan_flags=-DCFG_as923=1 -DLMIC_COUNTRY_CODE=LMIC_COUNTRY_CODE_JP -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4933.menu.lorawan_region.kr920.build.lorawan_flags=-DCFG_kr920=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4933.menu.lorawan_region.in866.build.lorawan_flags=-DCFG_in866=1 -DCFG_sx1276_radio=1 -DARDUINO_LMIC_PROJECT_CONFIG_H=lmic_config_preconditions.h +mcci_model_4933.menu.lorawan_region.projcfg.build.lorawan_flags= + +# +# menu.lorawan_network +mcci_model_4933.menu.lorawan_network.ttn=The Things Network +mcci_model_4933.menu.lorawan_network.ttn.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_TTN=1 +mcci_model_4933.menu.lorawan_network.actility=Actility ThingsPark +mcci_model_4933.menu.lorawan_network.actility.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_ACTILITY=1 +mcci_model_4933.menu.lorawan_network.helium=Helium +mcci_model_4933.menu.lorawan_network.helium.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_HELIUM=1 +mcci_model_4933.menu.lorawan_network.machineq=machineQ +mcci_model_4933.menu.lorawan_network.machineq.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_MACHINEQ=1 +mcci_model_4933.menu.lorawan_network.senet=Senet +mcci_model_4933.menu.lorawan_network.senet.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_SENET=1 +mcci_model_4933.menu.lorawan_network.senra=Senra +mcci_model_4933.menu.lorawan_network.senra.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_SENRA=1 +mcci_model_4933.menu.lorawan_network.swisscom=Swisscom +mcci_model_4933.menu.lorawan_network.swisscom.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_SWISSCOM=1 +mcci_model_4933.menu.lorawan_network.chirpstack=ChirpStack +mcci_model_4933.menu.lorawan_network.chirpstack.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_CHIRPSTACK=1 +mcci_model_4933.menu.lorawan_network.generic=Generic +mcci_model_4933.menu.lorawan_network.generic.build.lorawan_network_flags=-DARDUINO_LMIC_CFG_NETWORK_GENERIC=1 +mcci_model_4933.menu.lorawan_network.projcfg=Use arduino-lmic/project_config/lmic_project_lmic_config_preconditions.h +mcci_model_4933.menu.lorawan_network.projcfg.build.lorawan_network_flags= + +# +# menul.lorawan_subband +mcci_model_4933.menu.lorawan_subband.default=Default, works everywhere +mcci_model_4933.menu.lorawan_subband.default.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=-1 +mcci_model_4933.menu.lorawan_subband.sb0=sb0, ch 0~7 (US/AU/CN470) +mcci_model_4933.menu.lorawan_subband.sb0.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=0 +mcci_model_4933.menu.lorawan_subband.sb1=sb1, ch 8~15 (US/AU/CN470) +mcci_model_4933.menu.lorawan_subband.sb1.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=1 +mcci_model_4933.menu.lorawan_subband.sb2=sb2, ch 16~23 (US/AU/CN470) +mcci_model_4933.menu.lorawan_subband.sb2.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=2 +mcci_model_4933.menu.lorawan_subband.sb3=sb3, ch 24~31 (US/AU/CN470) +mcci_model_4933.menu.lorawan_subband.sb3.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=3 +mcci_model_4933.menu.lorawan_subband.sb4=sb4, ch 32~39 (US/AU/CN470) +mcci_model_4933.menu.lorawan_subband.sb4.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=4 +mcci_model_4933.menu.lorawan_subband.sb5=sb5, ch 40~47 (US/AU/CN470) +mcci_model_4933.menu.lorawan_subband.sb5.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=5 +mcci_model_4933.menu.lorawan_subband.sb6=sb6, ch 48~55 (US/AU/CN470) +mcci_model_4933.menu.lorawan_subband.sb6.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=6 +mcci_model_4933.menu.lorawan_subband.sb7=sb7, ch 56~63 (US/AU/CN470) +mcci_model_4933.menu.lorawan_subband.sb7.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=7 +mcci_model_4933.menu.lorawan_subband.sb8=sb8, ch 64~71 (CN470) +mcci_model_4933.menu.lorawan_subband.sb8.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=8 +mcci_model_4933.menu.lorawan_subband.sb9=sb9, ch 72~79 (CN470) +mcci_model_4933.menu.lorawan_subband.sb9.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=9 +mcci_model_4933.menu.lorawan_subband.sb10=sb10, ch 80~87 (CN470) +mcci_model_4933.menu.lorawan_subband.sb10.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=10 +mcci_model_4933.menu.lorawan_subband.sb11=sb11, ch 88~95 (CN470) +mcci_model_4933.menu.lorawan_subband.sb11.build.lorawan_subband_flags=-DARDUINO_LMIC_CFG_SUBBAND=11 + +#### end of configuration info for MCCI Model 4933 + diff --git a/variants/MODEL_4931/PeripheralPins.c b/variants/MODEL_4931/PeripheralPins.c new file mode 100644 index 0000000000..5d262de9c7 --- /dev/null +++ b/variants/MODEL_4931/PeripheralPins.c @@ -0,0 +1,250 @@ +/* +Module: PeripheralPins.c +Function: + Defines the special-function pins for this board. +Copyright Notice: + Copyright (c) 2025, MCCI Corporation + Copyright (c) 2016, STMicroelectronics + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of STMicroelectronics nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Authors: + STMicroelecronics + Dhinesh Kumar Pitchai, MCCI Corporation +*/ + +#include "Arduino.h" +#include "PeripheralPins.h" + +// ===== +// Note: Commented lines are alternative possibilities which are not used per default. +// If you change them, you will have to know what you do +// ===== + + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0 +// {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3 + // {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4 + {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5 +// {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6 +// {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7 +// {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8 +// {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9 +// {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC_IN10 +// {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC_IN11 +// {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC_IN12 + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +const PinMap PinMap_DAC[] = { +// {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 +// {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SDA[] = { +// {PA_10, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C1)}, +// {PB_4, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF7_I2C3)}, +// {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, +// {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C2)}, +// {PB_14, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF5_I2C2)}, +// {PC_1, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF7_I2C3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SCL[] = { +// {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF7_I2C3)}, +// {PA_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C1)}, +// {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, +// {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C2)}, +// {PB_13, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF5_I2C2)}, +// {PC_0, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF7_I2C3)}, + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +const PinMap PinMap_PWM[] = { +// {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1 +// {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2 +// {PA_2, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 1, 0)}, // TIM21_CH1 +// {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 +// {PA_3, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 2, 0)}, // TIM21_CH2 +// {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4 +// {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 +// {PA_6, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 1, 0)}, // TIM22_CH1 +// {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 +// {PA_7, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 2, 0)}, // TIM22_CH2 +// {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 +// {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 +// {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 +// {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 +// {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2 +// {PB_4, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 1, 0)}, // TIM22_CH1 +// {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 +// {PB_5, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 2, 0)}, // TIM22_CH2 +// {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM3, 2, 0)}, // TIM3_CH2 +// {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 +// {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4 +// {PB_13, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21, 1, 0)}, // TIM21_CH1 +// {PB_14, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21, 2, 0)}, // TIM21_CH2 + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_TX[] = { +// {PA_0, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART4)}, +// {PA_2, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, + {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_USART2)}, + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_USART1)}, +// {PA_14, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, +// {PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, +// {PB_3, USART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART5)}, +// {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)}, +// {PB_10, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, +// {PB_11, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_LPUART1)}, +// {PC_1, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_RX[] = { +// {PA_1, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART4)}, +// {PA_3, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, + {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_USART2)}, + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_USART1)}, +// {PA_13, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, +// {PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, +// {PB_4, USART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART5)}, +// {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)}, +// {PB_10, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_LPUART1)}, +// {PB_11, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, +// {PC_0, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_RTS[] = { +// {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, +// {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, +// {PA_15, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART4)}, +// {PB_1, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, +// {PB_3, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_USART1)}, +// {PB_5, USART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART5)}, +// {PB_12, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_LPUART1)}, +// {PB_14, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_CTS[] = { +// {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, +// {PA_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, +// {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, +// {PB_4, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_USART1)}, +// {PB_7, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART4)}, +// {PB_13, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)}, +// {PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, +// {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)}, +// {PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, +// {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)}, +// {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_SPI2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_SCLK[] = { +// {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, + {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)}, +// {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_SSEL[] = { +// {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, + {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)}, +// {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)}, + {NC, NP, 0} +}; +#endif + +//*** CAN *** + +//*** No CAN_RD *** + +//*** No CAN_TD *** + +//*** ETHERNET *** + +//*** No Ethernet *** + +//*** QUADSPI *** + +//*** No QUADSPI *** \ No newline at end of file diff --git a/variants/MODEL_4931/README.md b/variants/MODEL_4931/README.md new file mode 100644 index 0000000000..29996bf9b6 --- /dev/null +++ b/variants/MODEL_4931/README.md @@ -0,0 +1,4 @@ +This the variant directory for Model 4931 family. + +For background, see the stm32duino Wiki: +https://github.com/stm32duino/wiki/wiki/Add-a-new-variant-(board) \ No newline at end of file diff --git a/variants/MODEL_4931/override_usbd_ll_connectionstate.c b/variants/MODEL_4931/override_usbd_ll_connectionstate.c new file mode 100644 index 0000000000..ad64037e5e --- /dev/null +++ b/variants/MODEL_4931/override_usbd_ll_connectionstate.c @@ -0,0 +1,49 @@ +/* + +Module: override_usbd_ll_connectionstate.c + +Function: + Override USBD_LL_ConnectionState() function for MODEL_4931 variant. + +Copyright notice and license information: + Copyright 2018-2025 MCCI Corporation. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA + +Author: + Dhinesh Kumar Pitchai, MCCI Corporation + +*/ + +#include +#include + +#ifdef USBCON + +/** + * @brief Get USB connection state + * @param None + * @retval 0 if disconnected + */ +USBD_LL_ConnectionState_WEAK uint32_t USBD_LL_ConnectionState(void) +{ + uint32_t vBus; + + vBus = analogRead(14); + return vBus > 270 ? 1 : 0; +} + +#endif // USBCON \ No newline at end of file diff --git a/variants/MODEL_4931/stm32l0xx_hal_conf.h b/variants/MODEL_4931/stm32l0xx_hal_conf.h new file mode 100644 index 0000000000..d99d12c58c --- /dev/null +++ b/variants/MODEL_4931/stm32l0xx_hal_conf.h @@ -0,0 +1,313 @@ +/** + ****************************************************************************** + * @file stm32l0xx_hal_conf.h + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2017 STMicroelectronics

+ *

© COPYRIGHT(c) 2025 MCCI Corporation

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32L0xx_HAL_CONF_H +#define __STM32L0xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ + +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +/*#define HAL_CRYP_MODULE_ENABLED */ +/*#define HAL_COMP_MODULE_ENABLED */ +/*#define HAL_CRC_MODULE_ENABLED */ +/*#define HAL_CRYP_MODULE_ENABLED */ +/*#define HAL_DAC_MODULE_ENABLED */ +/*#define HAL_FIREWALL_MODULE_ENABLED */ +/*#define HAL_I2S_MODULE_ENABLED */ +/*#define HAL_IWDG_MODULE_ENABLED */ +/*#define HAL_LCD_MODULE_ENABLED */ +/*#define HAL_LPTIM_MODULE_ENABLED */ +/*#define HAL_RNG_MODULE_ENABLED */ +#define HAL_RTC_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +/*#define HAL_TSC_MODULE_ENABLED */ +#define HAL_UART_MODULE_ENABLED +/*#define HAL_USART_MODULE_ENABLED */ +/*#define HAL_IRDA_MODULE_ENABLED */ +/*#define HAL_SMARTCARD_MODULE_ENABLED */ +/*#define HAL_SMBUS_MODULE_ENABLED */ +/*#define HAL_WWDG_MODULE_ENABLED */ +#ifdef USBCON +# define HAL_PCD_MODULE_ENABLED +#endif +#define HAL_GPIO_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE ((uint32_t)2097000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator for USB (HSI48) value. + */ +#if !defined (HSI48_VALUE) +#define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)37000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define PREREAD_ENABLE 1U +#define BUFFER_CACHE_DISABLE 0U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l0xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l0xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FIREWALL_MODULE_ENABLED + #include "stm32l0xx_hal_firewall.h" +#endif /* HAL_FIREWALL_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32l0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l0xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32l0xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32l0xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l0xx_hal_rtc.h" + +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32l0xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32l0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l0xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((char *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(char *file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32L0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ \ No newline at end of file diff --git a/variants/MODEL_4931/variant.cpp b/variants/MODEL_4931/variant.cpp new file mode 100644 index 0000000000..a455dd9463 --- /dev/null +++ b/variants/MODEL_4931/variant.cpp @@ -0,0 +1,70 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + Copyright (c) 2025 MCCI Corporation. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "variant.h" +#include "stm32l0xx_ll_rcc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Pin number +// This array allows to map Arduino pin number(Dx or x) +// to STM32 PinName (PX_n) -- don't forget to also change variant.h +const PinName digitalPin[] = { +//PX_n, //Dx + PA_10, //D0 D0_UART_RX + PA_9, //D1 D1_UART_TX + PA_7, //D2 RADIO_MOSI Murata internal + PA_6, //D3 RADIO_MISO Murata internal + PB_3, //D4 RADIO_SCK Murata internal + PB_6, //D5 D5_TEMP1 + PA_13, //D6 D6_SWDIO + PA_15, //D7 RADIO_NSS Murata internal + PC_0, //D8 RADIO_RESET Murata internal + PA_14, //D9 D9_SWCLK + PA_4, //D10 D10_TEMP2 + PB_5, //D11 D11_nCS + PB_7, //D12 D12_PULSE2 + PB_2, //D13 D13_LED + PA_0, //D14/A0 A0_VBUS_MON + PA_5, //D15/A1 A1_VBAT_MON + PH_1, //D16 D16_PULSE1 + PA_3, //D17/A3 A3_RS485_RX + PA_2, //D18/A4 A4_RS485_TX + PB_12, //D19 D19_NSS + PB_9, //D20 SDA + PB_8, //D21 SCL + PB_14, //D22 MISO + PB_15, //D23 MOSI + PB_13, //D24 SCK + PB_4, //D25 RADIO_DIO_0 + PB_1, //D26 RADIO_DIO_1 + PB_0, //D27 RADIO_DIO_2 + PC_13, //D28 RADIO_DIO_3 + PA_1, //D29 RADIO_ANT_SWITCH_RX CRF1 + PC_1, //D30 RADIO_ANT_SWITCH_TX_BOOST CRF3 + PC_2, //D31 RADIO_ANT_SWITCH_TX_RFO CRF2 + NC, //D32 Flash Write-Protect (not supported these platforms) + PA_8, //D33 RADIO_TCXO TCXO VDD, possibly VDD boost enable. +}; + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/variants/MODEL_4931/variant.h b/variants/MODEL_4931/variant.h new file mode 100644 index 0000000000..cba4cd56b6 --- /dev/null +++ b/variants/MODEL_4931/variant.h @@ -0,0 +1,153 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + Copyright (c) 2025 MCCI Corporation. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _VARIANT_ARDUINO_MODEL_4931_ +#define _VARIANT_ARDUINO_MODEL_4931_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ +#include "PeripheralPins.h" + +#ifdef __cplusplus +extern "C"{ +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ +extern const PinName digitalPin[]; + +// Enum defining pin names to match digital pin number --> Dx +// !!! +// !!! Copy the digitalPin[] array in variant.cpp +// !!! and remove all '_': PX_n --> PXn +// !!! For NC, suffix by _x where x is the number of NC: +// !!! NC_1, NC_2,... +// !!! For duplicated pin name, suffix by _x where x is the number of pin: +// !!! PA7, PA7_2, PA7_3,... +enum { + PA10, //D0 D0_UART_RX + PA9, //D1 D1_UART_TX + PA7, //D2 RADIO_MOSI Murata internal + PA6, //D3 RADIO_MISO Murata internal + PB3, //D4 RADIO_SCK Murata internal + PB6, //D5 D5_TEMP1 + PA13, //D6 D6_SWDIO + PA15, //D7 RADIO_NSS Murata internal + PC0, //D8 RADIO_RESET Murata internal + PA14, //D9 D9_SWCLK + PA4, //D10 D10_TEMP2 + PB5, //D11 D11_nCS + PB7, //D12 D12_PULSE2 + PB2, //D13 D13_LED + PA0, //D14/A0 A0_VBUS_MON + PA5, //D15/A1 A1_VBAT_MON + PH1, //D16 D16_PULSE1 + PA3, //D17/A3 A3_RS485_RX + PA2, //D18/A4 A4_RS485_TX + PB12, //D19 D19_NSS + PB9, //D20 SDA + PB8, //D21 SCL + PB14, //D22 MISO + PB15, //D23 MOSI + PB13, //D24 SCK + PB4, //D25 RADIO_DIO_0 + PB1, //D26 RADIO_DIO_1 + PB0, //D27 RADIO_DIO_2 + PC13, //D28 RADIO_DIO_3 + PA1, //D29 RADIO_ANT_SWITCH_RX CRF1 + PC1, //D30 RADIO_ANT_SWITCH_TX_BOOST CRF3 + PC2, //D31 RADIO_ANT_SWITCH_TX_RFO CRF2 + NC_1, //D32 Flash Write-Protect (not supported these platforms) + PA8, //D33 RADIO_TCXO TCXO VDD, possibly VDD boost enable. + PEND +}; + +// This must be a literal with the same value as PEND +#define NUM_DIGITAL_PINS 34 +// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS +#define NUM_ANALOG_INPUTS 5 // this must be <= 8 for STM32L0 +#define NUM_ANALOG_FIRST 14 + +//On-board LED pin number +#define LED_BUILTIN D13 +#define LED_RED LED_BUILTIN + +//On-board user button +//#define USER_BTN NC + + +//SPI definitions +#define RADIO_SS D7 +#define RADIO_MOSI D2 +#define RADIO_MISO D3 +#define RADIO_SCK D4 +#define RADIO_RESET D8 +#define RADIO_TCXO D33 +#define RADIO_DIO_0 D25 +#define RADIO_DIO_1 D26 +#define RADIO_DIO_2 D27 +#define RADIO_DIO_3 D28 + +#define FLASH_SS D19 +#define FLASH_MOSI D23 +#define FLASH_MISO D22 +#define FLASH_SCK D24 + +#define PIN_SPI_SS RADIO_SS // Default for Arduino connector compatibility +#define PIN_SPI_MOSI RADIO_MOSI // Default for Arduino connector compatibility +#define PIN_SPI_MISO RADIO_MISO // Default for Arduino connector compatibility +#define PIN_SPI_SCK RADIO_SCK // Default for Arduino connector compatibility + +//I2C Definitions +#define PIN_WIRE_SDA D20 // Default for Arduino connector compatibility +#define PIN_WIRE_SCL D21 // Default for Arduino connector compatibility + +//Timer Definitions +//Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c +#define TIMER_TONE TIM3 + +//Do not use basic timer: OC is required +#define TIMER_SERVO TIM2 //TODO: advanced-control timers don't work + +// UART Definitions + +#ifdef __cplusplus +} // extern "C" +#endif + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#include "../mcci_common_uart.h" + +#endif /* _VARIANT_ARDUINO_MODEL_4931_ */ \ No newline at end of file diff --git a/variants/MODEL_4933/PeripheralPins.c b/variants/MODEL_4933/PeripheralPins.c new file mode 100644 index 0000000000..4288575a33 --- /dev/null +++ b/variants/MODEL_4933/PeripheralPins.c @@ -0,0 +1,250 @@ +/* +Module: PeripheralPins.c +Function: + Defines the special-function pins for this board. +Copyright Notice: + Copyright (c) 2025, MCCI Corporation + Copyright (c) 2016, STMicroelectronics + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + 3. Neither the name of STMicroelectronics nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +Authors: + STMicroelecronics + Dhinesh Kumar Pitchai, MCCI Corporation +*/ + +#include "Arduino.h" +#include "PeripheralPins.h" + +// ===== +// Note: Commented lines are alternative possibilities which are not used per default. +// If you change them, you will have to know what you do +// ===== + + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +const PinMap PinMap_ADC[] = { + {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0 +// {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2 + {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3 + {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4 + {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5 +// {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6 +// {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7 +// {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8 +// {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9 +// {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC_IN10 +// {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC_IN11 +// {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC_IN12 + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +const PinMap PinMap_DAC[] = { +// {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 +// {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SDA[] = { +// {PA_10, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C1)}, +// {PB_4, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF7_I2C3)}, +// {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)}, + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, +// {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C2)}, +// {PB_14, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF5_I2C2)}, +// {PC_1, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF7_I2C3)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +const PinMap PinMap_I2C_SCL[] = { +// {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF7_I2C3)}, +// {PA_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C1)}, +// {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)}, + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, +// {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C2)}, +// {PB_13, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF5_I2C2)}, +// {PC_0, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF7_I2C3)}, + {NC, NP, 0} +}; +#endif + +//*** PWM *** + +#ifdef HAL_TIM_MODULE_ENABLED +const PinMap PinMap_PWM[] = { +// {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1 +// {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2 +// {PA_2, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 1, 0)}, // TIM21_CH1 +// {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 +// {PA_3, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 2, 0)}, // TIM21_CH2 +// {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4 +// {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 +// {PA_6, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 1, 0)}, // TIM22_CH1 +// {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 +// {PA_7, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 2, 0)}, // TIM22_CH2 +// {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 +// {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 +// {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 +// {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 +// {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2 +// {PB_4, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 1, 0)}, // TIM22_CH1 +// {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 +// {PB_5, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 2, 0)}, // TIM22_CH2 +// {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM3, 2, 0)}, // TIM3_CH2 +// {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 +// {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4 +// {PB_13, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21, 1, 0)}, // TIM21_CH1 +// {PB_14, TIM21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_TIM21, 2, 0)}, // TIM21_CH2 + {NC, NP, 0} +}; +#endif + +//*** SERIAL *** + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_TX[] = { +// {PA_0, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART4)}, +// {PA_2, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, +// {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_USART2)}, + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_USART1)}, +// {PA_14, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, +// {PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, +// {PB_3, USART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART5)}, +// {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)}, +// {PB_10, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, +// {PB_11, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_LPUART1)}, +// {PC_1, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_RX[] = { +// {PA_1, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART4)}, +// {PA_3, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, +// {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_USART2)}, + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_USART1)}, +// {PA_13, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, +// {PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, +// {PB_4, USART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART5)}, +// {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)}, +// {PB_10, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_LPUART1)}, +// {PB_11, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, +// {PC_0, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_RTS[] = { +// {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, +// {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, +// {PA_15, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART4)}, +// {PB_1, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, +// {PB_3, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_USART1)}, +// {PB_5, USART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART5)}, +// {PB_12, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_LPUART1)}, +// {PB_14, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +const PinMap PinMap_UART_CTS[] = { +// {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)}, +// {PA_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, +// {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART1)}, +// {PB_4, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_USART1)}, +// {PB_7, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_USART4)}, +// {PB_13, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)}, + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)}, +// {PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, +// {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, + {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)}, +// {PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, +// {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, + {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)}, +// {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_SPI2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_SCLK[] = { +// {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, + {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)}, +// {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)}, + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +const PinMap PinMap_SPI_SSEL[] = { +// {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, + {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI1)}, +// {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF0_SPI2)}, + {NC, NP, 0} +}; +#endif + +//*** CAN *** + +//*** No CAN_RD *** + +//*** No CAN_TD *** + +//*** ETHERNET *** + +//*** No Ethernet *** + +//*** QUADSPI *** + +//*** No QUADSPI *** diff --git a/variants/MODEL_4933/README.md b/variants/MODEL_4933/README.md new file mode 100644 index 0000000000..8abf63162c --- /dev/null +++ b/variants/MODEL_4933/README.md @@ -0,0 +1,4 @@ +This the variant directory for Model 493x family. + +For background, see the stm32duino Wiki: +https://github.com/stm32duino/wiki/wiki/Add-a-new-variant-(board) \ No newline at end of file diff --git a/variants/MODEL_4933/override_usbd_ll_connectionstate.c b/variants/MODEL_4933/override_usbd_ll_connectionstate.c new file mode 100644 index 0000000000..de578a8a3e --- /dev/null +++ b/variants/MODEL_4933/override_usbd_ll_connectionstate.c @@ -0,0 +1,49 @@ +/* + +Module: override_usbd_ll_connectionstate.c + +Function: + Override USBD_LL_ConnectionState() function for CATENA_4933 variant. + +Copyright notice and license information: + Copyright 2018-2025 MCCI Corporation. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 51 Franklin St, Fifth Floor, + Boston, MA 02110-1301 USA + +Author: + Dhinesh Kumar Pitchai, MCCI Corporation + +*/ + +#include +#include + +#ifdef USBCON + +/** + * @brief Get USB connection state + * @param None + * @retval 0 if disconnected + */ +USBD_LL_ConnectionState_WEAK uint32_t USBD_LL_ConnectionState(void) +{ + uint32_t vBus; + + vBus = analogRead(14); + return vBus > 270 ? 1 : 0; +} + +#endif // USBCON diff --git a/variants/MODEL_4933/stm32l0xx_hal_conf.h b/variants/MODEL_4933/stm32l0xx_hal_conf.h new file mode 100644 index 0000000000..6bea41d69f --- /dev/null +++ b/variants/MODEL_4933/stm32l0xx_hal_conf.h @@ -0,0 +1,313 @@ +/** + ****************************************************************************** + * @file stm32l0xx_hal_conf.h + * @brief HAL configuration file. + ****************************************************************************** + * @attention + * + *

© COPYRIGHT(c) 2017 STMicroelectronics

+ *

© COPYRIGHT(c) 2025 MCCI Corporation

+ * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * 3. Neither the name of STMicroelectronics nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __STM32L0xx_HAL_CONF_H +#define __STM32L0xx_HAL_CONF_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Exported types ------------------------------------------------------------*/ +/* Exported constants --------------------------------------------------------*/ + +/* ########################## Module Selection ############################## */ +/** + * @brief This is the list of modules to be used in the HAL driver + */ + +#define HAL_MODULE_ENABLED +#define HAL_ADC_MODULE_ENABLED +/*#define HAL_CRYP_MODULE_ENABLED */ +/*#define HAL_COMP_MODULE_ENABLED */ +/*#define HAL_CRC_MODULE_ENABLED */ +/*#define HAL_CRYP_MODULE_ENABLED */ +/*#define HAL_DAC_MODULE_ENABLED */ +/*#define HAL_FIREWALL_MODULE_ENABLED */ +/*#define HAL_I2S_MODULE_ENABLED */ +/*#define HAL_IWDG_MODULE_ENABLED */ +/*#define HAL_LCD_MODULE_ENABLED */ +/*#define HAL_LPTIM_MODULE_ENABLED */ +/*#define HAL_RNG_MODULE_ENABLED */ +#define HAL_RTC_MODULE_ENABLED +#define HAL_SPI_MODULE_ENABLED +#define HAL_TIM_MODULE_ENABLED +/*#define HAL_TSC_MODULE_ENABLED */ +#define HAL_UART_MODULE_ENABLED +/*#define HAL_USART_MODULE_ENABLED */ +/*#define HAL_IRDA_MODULE_ENABLED */ +/*#define HAL_SMARTCARD_MODULE_ENABLED */ +/*#define HAL_SMBUS_MODULE_ENABLED */ +/*#define HAL_WWDG_MODULE_ENABLED */ +#ifdef USBCON +# define HAL_PCD_MODULE_ENABLED +#endif +#define HAL_GPIO_MODULE_ENABLED +#define HAL_DMA_MODULE_ENABLED +#define HAL_I2C_MODULE_ENABLED +#define HAL_RCC_MODULE_ENABLED +#define HAL_FLASH_MODULE_ENABLED +#define HAL_PWR_MODULE_ENABLED +#define HAL_CORTEX_MODULE_ENABLED + +/* ########################## Oscillator Values adaptation ####################*/ +/** + * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSE is used as system clock source, directly or through the PLL). + */ +#if !defined (HSE_VALUE) + #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ +#endif /* HSE_VALUE */ + +#if !defined (HSE_STARTUP_TIMEOUT) + #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ +#endif /* HSE_STARTUP_TIMEOUT */ + +/** + * @brief Internal Multiple Speed oscillator (MSI) default value. + * This value is the default MSI range value after Reset. + */ +#if !defined (MSI_VALUE) + #define MSI_VALUE ((uint32_t)2097000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* MSI_VALUE */ + +/** + * @brief Internal High Speed oscillator (HSI) value. + * This value is used by the RCC HAL module to compute the system frequency + * (when HSI is used as system clock source, directly or through the PLL). + */ +#if !defined (HSI_VALUE) + #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ +#endif /* HSI_VALUE */ + +/** + * @brief Internal High Speed oscillator for USB (HSI48) value. + */ +#if !defined (HSI48_VALUE) +#define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB in Hz. + The real value may vary depending on the variations + in voltage and temperature. */ +#endif /* HSI48_VALUE */ + +/** + * @brief Internal Low Speed oscillator (LSI) value. + */ +#if !defined (LSI_VALUE) + #define LSI_VALUE ((uint32_t)37000U) /*!< LSI Typical Value in Hz*/ +#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz + The real value may vary depending on the variations + in voltage and temperature.*/ +/** + * @brief External Low Speed oscillator (LSE) value. + * This value is used by the UART, RTC HAL module to compute the system frequency + */ +#if !defined (LSE_VALUE) + #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ +#endif /* LSE_VALUE */ + +#if !defined (LSE_STARTUP_TIMEOUT) + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ +#endif /* LSE_STARTUP_TIMEOUT */ + +/* Tip: To avoid modifying this file each time you need to use different HSE, + === you can define the HSE value in your toolchain compiler preprocessor. */ + +/* ########################### System Configuration ######################### */ +/** + * @brief This is the HAL system configuration section + */ +#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ +#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ +#define USE_RTOS 0U +#define PREFETCH_ENABLE 0U +#define PREREAD_ENABLE 1U +#define BUFFER_CACHE_DISABLE 0U + +/* ########################## Assert Selection ############################## */ +/** + * @brief Uncomment the line below to expanse the "assert_param" macro in the + * HAL drivers code + */ +/* #define USE_FULL_ASSERT 1 */ + +/* Includes ------------------------------------------------------------------*/ +/** + * @brief Include module's header file + */ + +#ifdef HAL_RCC_MODULE_ENABLED + #include "stm32l0xx_hal_rcc.h" +#endif /* HAL_RCC_MODULE_ENABLED */ + +#ifdef HAL_GPIO_MODULE_ENABLED + #include "stm32l0xx_hal_gpio.h" +#endif /* HAL_GPIO_MODULE_ENABLED */ + +#ifdef HAL_DMA_MODULE_ENABLED + #include "stm32l0xx_hal_dma.h" +#endif /* HAL_DMA_MODULE_ENABLED */ + +#ifdef HAL_CORTEX_MODULE_ENABLED + #include "stm32l0xx_hal_cortex.h" +#endif /* HAL_CORTEX_MODULE_ENABLED */ + +#ifdef HAL_ADC_MODULE_ENABLED + #include "stm32l0xx_hal_adc.h" +#endif /* HAL_ADC_MODULE_ENABLED */ + +#ifdef HAL_COMP_MODULE_ENABLED + #include "stm32l0xx_hal_comp.h" +#endif /* HAL_COMP_MODULE_ENABLED */ + +#ifdef HAL_CRC_MODULE_ENABLED + #include "stm32l0xx_hal_crc.h" +#endif /* HAL_CRC_MODULE_ENABLED */ + +#ifdef HAL_CRYP_MODULE_ENABLED + #include "stm32l0xx_hal_cryp.h" +#endif /* HAL_CRYP_MODULE_ENABLED */ + +#ifdef HAL_DAC_MODULE_ENABLED + #include "stm32l0xx_hal_dac.h" +#endif /* HAL_DAC_MODULE_ENABLED */ + +#ifdef HAL_FIREWALL_MODULE_ENABLED + #include "stm32l0xx_hal_firewall.h" +#endif /* HAL_FIREWALL_MODULE_ENABLED */ + +#ifdef HAL_FLASH_MODULE_ENABLED + #include "stm32l0xx_hal_flash.h" +#endif /* HAL_FLASH_MODULE_ENABLED */ + +#ifdef HAL_I2C_MODULE_ENABLED + #include "stm32l0xx_hal_i2c.h" +#endif /* HAL_I2C_MODULE_ENABLED */ + +#ifdef HAL_I2S_MODULE_ENABLED + #include "stm32l0xx_hal_i2s.h" +#endif /* HAL_I2S_MODULE_ENABLED */ + +#ifdef HAL_IWDG_MODULE_ENABLED + #include "stm32l0xx_hal_iwdg.h" +#endif /* HAL_IWDG_MODULE_ENABLED */ + +#ifdef HAL_LCD_MODULE_ENABLED + #include "stm32l0xx_hal_lcd.h" +#endif /* HAL_LCD_MODULE_ENABLED */ + +#ifdef HAL_LPTIM_MODULE_ENABLED +#include "stm32l0xx_hal_lptim.h" +#endif /* HAL_LPTIM_MODULE_ENABLED */ + +#ifdef HAL_PWR_MODULE_ENABLED + #include "stm32l0xx_hal_pwr.h" +#endif /* HAL_PWR_MODULE_ENABLED */ + +#ifdef HAL_RNG_MODULE_ENABLED + #include "stm32l0xx_hal_rng.h" +#endif /* HAL_RNG_MODULE_ENABLED */ + +#ifdef HAL_RTC_MODULE_ENABLED + #include "stm32l0xx_hal_rtc.h" + +#endif /* HAL_RTC_MODULE_ENABLED */ + +#ifdef HAL_SPI_MODULE_ENABLED + #include "stm32l0xx_hal_spi.h" +#endif /* HAL_SPI_MODULE_ENABLED */ + +#ifdef HAL_TIM_MODULE_ENABLED + #include "stm32l0xx_hal_tim.h" +#endif /* HAL_TIM_MODULE_ENABLED */ + +#ifdef HAL_TSC_MODULE_ENABLED + #include "stm32l0xx_hal_tsc.h" +#endif /* HAL_TSC_MODULE_ENABLED */ + +#ifdef HAL_UART_MODULE_ENABLED + #include "stm32l0xx_hal_uart.h" +#endif /* HAL_UART_MODULE_ENABLED */ + +#ifdef HAL_USART_MODULE_ENABLED + #include "stm32l0xx_hal_usart.h" +#endif /* HAL_USART_MODULE_ENABLED */ + +#ifdef HAL_IRDA_MODULE_ENABLED + #include "stm32l0xx_hal_irda.h" +#endif /* HAL_IRDA_MODULE_ENABLED */ + +#ifdef HAL_SMARTCARD_MODULE_ENABLED + #include "stm32l0xx_hal_smartcard.h" +#endif /* HAL_SMARTCARD_MODULE_ENABLED */ + +#ifdef HAL_SMBUS_MODULE_ENABLED + #include "stm32l0xx_hal_smbus.h" +#endif /* HAL_SMBUS_MODULE_ENABLED */ + +#ifdef HAL_WWDG_MODULE_ENABLED + #include "stm32l0xx_hal_wwdg.h" +#endif /* HAL_WWDG_MODULE_ENABLED */ + +#ifdef HAL_PCD_MODULE_ENABLED + #include "stm32l0xx_hal_pcd.h" +#endif /* HAL_PCD_MODULE_ENABLED */ + +/* Exported macro ------------------------------------------------------------*/ +#ifdef USE_FULL_ASSERT +/** + * @brief The assert_param macro is used for function's parameters check. + * @param expr: If expr is false, it calls assert_failed function + * which reports the name of the source file and the source + * line number of the call that failed. + * If expr is true, it returns no value. + * @retval None + */ + #define assert_param(expr) ((expr) ? (void)0U : assert_failed((char *)__FILE__, __LINE__)) +/* Exported functions ------------------------------------------------------- */ + void assert_failed(char *file, uint32_t line); +#else + #define assert_param(expr) ((void)0U) +#endif /* USE_FULL_ASSERT */ + +#ifdef __cplusplus +} +#endif + +#endif /* __STM32L0xx_HAL_CONF_H */ + + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/variants/MODEL_4933/variant.cpp b/variants/MODEL_4933/variant.cpp new file mode 100644 index 0000000000..220b919573 --- /dev/null +++ b/variants/MODEL_4933/variant.cpp @@ -0,0 +1,72 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + Copyright (c) 2025 MCCI Corporation. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "variant.h" +#include "stm32l0xx_ll_rcc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// Pin number +// This array allows to map Arduino pin number(Dx or x) +// to STM32 PinName (PX_n) -- don't forget to also change variant.h +const PinName digitalPin[] = { +//PX_n, //Dx + PA_10, //D0 D0_UART_RX JP4-2 + PA_9, //D1 D1_UART_TX JP4-3 + PA_7, //D2 RADIO_MOSI + PA_6, //D3 RADIO_MISO + PB_3, //D4 RADIO_SCK + PB_6, //D5 D5 + PA_13, //D6 D6_SWDIO JP1-4 + PA_15, //D7 RADIO_NSS + PC_0, //D8 RADIO_RESET + PA_14, //D9 D9_SWCLK JP1-3 + PH_1, //D10 No Connection (floating) + PB_5, //D11 D11_nCS + PB_7, //D12 D12_BOOST_EN + PB_2, //D13 D13_LED + PA_0, //D14/A0 A0_VBUS_MON + PA_5, //D15/A1 A1_VBAT_MON + PA_4, //D16/A2 A2_nCS_ADC + PA_3, //D17/A3 A3_ADC_SYNC + PA_2, //D18/A4 A4_ADC_DRDY + PB_12, //D19 D19_NSS + PB_9, //D20 SDA + PB_8, //D21 SCL + PB_14, //D22 MISO + PB_15, //D23 MOSI + PB_13, //D24 SCK + PB_4, //D25 RADIO_DIO_0 + PB_1, //D26 RADIO_DIO_1 + PB_0, //D27 RADIO_DIO_2 + PC_13, //D28 RADIO_DIO_3 + PA_1, //D29 RADIO_ANT_SWITCH_RX CRF1 + PC_1, //D30 RADIO_ANT_SWITCH_TX_BOOST CRF3 + PC_2, //D31 RADIO_ANT_SWITCH_TX_RFO CRF2 + NC, //D32 Flash Write-Protect (not supported these platforms) + PA_8, //D33 RADIO_TCXO TCXO VDD, possibly VDD boost enable. +}; + +#ifdef __cplusplus +} +#endif + +// ------------------------------------------------- diff --git a/variants/MODEL_4933/variant.h b/variants/MODEL_4933/variant.h new file mode 100644 index 0000000000..821f9f511b --- /dev/null +++ b/variants/MODEL_4933/variant.h @@ -0,0 +1,153 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + Copyright (c) 2025 MCCI Corporation. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef _VARIANT_ARDUINO_MODEL_4933_ +#define _VARIANT_ARDUINO_MODEL_4933_ + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ +#include "PeripheralPins.h" + +#ifdef __cplusplus +extern "C"{ +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ +extern const PinName digitalPin[]; + +// Enum defining pin names to match digital pin number --> Dx +// !!! +// !!! Copy the digitalPin[] array in variant.cpp +// !!! and remove all '_': PX_n --> PXn +// !!! For NC, suffix by _x where x is the number of NC: +// !!! NC_1, NC_2,... +// !!! For duplicated pin name, suffix by _x where x is the number of pin: +// !!! PA7, PA7_2, PA7_3,... +enum { + PA10, //D0 D0_UART_RX + PA9, //D1 D1_UART_TX + PA7, //D2 RADIO_MOSI Murata internal + PA6, //D3 RADIO_MISO Murata internal + PB3, //D4 RADIO_SCK Murata internal + PB6, //D5 D5 + PA13, //D6 D6_SWDIO + PA15, //D7 RADIO_NSS Murata internal + PC0, //D8 RADIO_RESET Murata internal + PA14, //D9 D9_SWCLK + PH1, //D10 No Connection (floating) + PB5, //D11 D11_nCS + PB7, //D12 D12_BOOST_EN + PB2, //D13 D13_LED + PA0, //D14/A0 A0_VBUS_MON + PA5, //D15/A1 A1_VBAT_MON + PA4, //D16/A2 A2_nCS_ADC + PA3, //D17/A3 A3_ADC_SYNC + PA2, //D18/A4 A4_ADC_DRDY + PB12, //D19 D19_NSS + PB9, //D20 SDA + PB8, //D21 SCL + PB14, //D22 MISO + PB15, //D23 MOSI + PB13, //D24 SCK + PB4, //D25 RADIO_DIO_0 + PB1, //D26 RADIO_DIO_1 + PB0, //D27 RADIO_DIO_2 + PC13, //D28 RADIO_DIO_3 + PA1, //D29 RADIO_ANT_SWITCH_RX CRF1 + PC1, //D30 RADIO_ANT_SWITCH_TX_BOOST CRF3 + PC2, //D31 RADIO_ANT_SWITCH_TX_RFO CRF2 + NC_1, //D32 Flash Write-Protect (not supported these platforms) + PA8, //D33 RADIO_TCXO TCXO VDD, possibly VDD boost enable. + PEND +}; + +// This must be a literal with the same value as PEND +#define NUM_DIGITAL_PINS 34 +// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS +#define NUM_ANALOG_INPUTS 5 +#define NUM_ANALOG_FIRST 14 + +//On-board LED pin number +#define LED_BUILTIN D13 +#define LED_RED LED_BUILTIN + +//On-board user button +//#define USER_BTN NC + + +//SPI definitions +#define RADIO_SS D7 +#define RADIO_MOSI D2 +#define RADIO_MISO D3 +#define RADIO_SCK D4 +#define RADIO_RESET D8 +#define RADIO_TCXO D33 +#define RADIO_DIO_0 D25 +#define RADIO_DIO_1 D26 +#define RADIO_DIO_2 D27 +#define RADIO_DIO_3 D28 + +#define FLASH_SS D19 +#define FLASH_MOSI D23 +#define FLASH_MISO D22 +#define FLASH_SCK D24 + +#define PIN_SPI_SS RADIO_SS // Default for Arduino connector compatibility +#define PIN_SPI_MOSI RADIO_MOSI // Default for Arduino connector compatibility +#define PIN_SPI_MISO RADIO_MISO // Default for Arduino connector compatibility +#define PIN_SPI_SCK RADIO_SCK // Default for Arduino connector compatibility + +//I2C Definitions +#define PIN_WIRE_SDA D20 // Default for Arduino connector compatibility +#define PIN_WIRE_SCL D21 // Default for Arduino connector compatibility + +//Timer Definitions +//Do not use timer used by PWM pins when possible. See PinMap_PWM in PeripheralPins.c +#define TIMER_TONE TIM3 + +//Do not use basic timer: OC is required +#define TIMER_SERVO TIM2 //TODO: advanced-control timers don't work + +// UART Definitions + +#ifdef __cplusplus +} // extern "C" +#endif + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#include "../mcci_common_uart.h" + +#endif /* _VARIANT_ARDUINO_MODEL_4933_ */