From f19273aa7ae8b3a73380c24949e72d445207b8be Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Thu, 8 Feb 2024 22:46:20 -0800 Subject: [PATCH] Begin documenting Mbed OS target features and components (#240) * Start on documenting features and components * Missed some renames * Go through all cellular and 802.15.4 modules * Fix build * Fix style * Update copyright year --- .../drivers/802.15.4_RF/CMakeLists.txt | 41 +- .../CMakeLists.txt | 0 .../LICENSE | 0 .../README.md | 0 .../apache-2.0.txt | 0 .../atmel-rf-driver/NanostackRfPhyAtmel.h | 0 .../mbed_lib.json | 0 .../source/AT86RF215Reg.h | 0 .../source/AT86RFReg.h | 0 .../source/NanostackRfPhyAT86RF215.cpp | 0 .../source/NanostackRfPhyAtmel.cpp | 0 .../source/at24mac.cpp | 0 .../source/at24mac.h | 0 .../source/rfbits.h | 0 .../CMakeLists.txt | 0 .../LICENSE | 0 .../README.md | 0 .../apache-2.0.txt | 0 .../mbed_lib.json | 0 .../mcr20a-rf-driver/NanostackRfPhyMcr20a.h | 0 .../source/MCR20Drv.c | 0 .../source/MCR20Drv.h | 0 .../source/MCR20Overwrites.h | 0 .../source/MCR20Reg.h | 0 .../source/NanostackRfPhyMcr20a.cpp | 0 .../source/XcvrSpi.h | 0 .../CMakeLists.txt | 0 .../README.md | 0 .../mbed_lib.json | 0 .../source/NanostackRfPhys2lp.cpp | 0 .../source/at24mac_s2lp.cpp | 0 .../source/at24mac_s2lp.h | 0 .../source/rf_configuration.c | 0 .../source/rf_configuration.h | 0 .../source/s2lpReg.h | 0 .../stm-s2lp-rf-driver/NanostackRfPhys2lp.h | 0 .../drivers/cellular/Altair/CMakeLists.txt | 4 +- .../CMakeLists.txt | 0 .../PPP/ALT1250_PPP.cpp | 0 .../PPP/ALT1250_PPP.h | 0 .../PPP/ALT1250_PPP_CellularContext.cpp | 0 .../PPP/ALT1250_PPP_CellularContext.h | 0 .../PPP/ALT1250_PPP_CellularNetwork.cpp | 0 .../PPP/ALT1250_PPP_CellularNetwork.h | 0 .../PPP/CMakeLists.txt | 0 .../PPP/mbed_lib.json | 0 connectivity/drivers/cellular/CMakeLists.txt | 10 +- .../drivers/cellular/GEMALTO/CMakeLists.txt | 4 +- .../CMakeLists.txt | 0 .../GEMALTO_CINTERION.cpp | 0 .../GEMALTO_CINTERION.h | 0 .../GEMALTO_CINTERION_CellularContext.cpp | 0 .../GEMALTO_CINTERION_CellularContext.h | 0 .../GEMALTO_CINTERION_CellularInformation.cpp | 0 .../GEMALTO_CINTERION_CellularInformation.h | 0 .../GEMALTO_CINTERION_CellularStack.cpp | 0 .../GEMALTO_CINTERION_CellularStack.h | 0 .../mbed_lib.json | 0 .../drivers/cellular/GENERIC/CMakeLists.txt | 4 +- .../CMakeLists.txt | 0 .../GENERIC_AT3GPP.cpp | 0 .../GENERIC_AT3GPP.h | 0 .../mbed_lib.json | 0 .../drivers/cellular/MultiTech/CMakeLists.txt | 4 +- .../CMakeLists.txt | 4 + .../SARA4_PPP.cpp | 0 .../SARA4_PPP.h | 0 .../SARA4_PPP_CellularNetwork.cpp | 0 .../SARA4_PPP_CellularNetwork.h | 0 .../CMakeLists.txt | 6 +- .../ONBOARD_SARA4_PPP.cpp | 6 +- .../ONBOARD_SARA4_PPP.h | 0 .../mbed_lib.json | 0 .../drivers/cellular/QUECTEL/CMakeLists.txt | 25 +- .../CMakeLists.txt | 4 + .../QUECTEL_BC95.cpp | 0 .../QUECTEL_BC95.h | 0 .../QUECTEL_BC95_CellularContext.cpp | 0 .../QUECTEL_BC95_CellularContext.h | 0 .../QUECTEL_BC95_CellularInformation.cpp | 0 .../QUECTEL_BC95_CellularInformation.h | 0 .../QUECTEL_BC95_CellularNetwork.cpp | 0 .../QUECTEL_BC95_CellularNetwork.h | 0 .../QUECTEL_BC95_CellularStack.cpp | 0 .../QUECTEL_BC95_CellularStack.h | 0 .../TARGET_ADV_WISE_1570/CMakeLists.txt | 12 + .../ONBOARD_QUECTEL_BC95.cpp | 0 .../ONBOARD_QUECTEL_BC95.h | 0 .../mbed_lib.json | 0 .../CMakeLists.txt | 4 + .../QUECTEL_BG96.cpp | 0 .../QUECTEL_BG96.h | 0 .../QUECTEL_BG96_CellularContext.cpp | 0 .../QUECTEL_BG96_CellularContext.h | 0 .../QUECTEL_BG96_CellularInformation.cpp | 0 .../QUECTEL_BG96_CellularInformation.h | 0 .../QUECTEL_BG96_CellularNetwork.cpp | 0 .../QUECTEL_BG96_CellularNetwork.h | 0 .../QUECTEL_BG96_CellularStack.cpp | 0 .../QUECTEL_BG96_CellularStack.h | 0 .../QUECTEL_BG96_ControlPlane_netif.cpp | 0 .../QUECTEL_BG96_ControlPlane_netif.h | 0 .../TARGET_WIO_BG96/CMakeLists.txt | 12 + .../TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.cpp | 0 .../TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.h | 0 .../mbed_lib.json | 0 .../CMakeLists.txt | 4 + .../QUECTEL_EC2X.cpp | 0 .../QUECTEL_EC2X.h | 0 .../CMakeLists.txt | 12 + .../ONBOARD_QUECTEL_EG25.cpp | 16 +- .../ONBOARD_QUECTEL_EG25.h | 4 +- .../mbed_lib.json | 0 .../CMakeLists.txt | 0 .../QUECTEL_M26.cpp | 0 .../QUECTEL_M26.h | 0 .../QUECTEL_M26_CellularContext.cpp | 0 .../QUECTEL_M26_CellularContext.h | 0 .../QUECTEL_M26_CellularInformation.cpp | 0 .../QUECTEL_M26_CellularInformation.h | 0 .../QUECTEL_M26_CellularStack.cpp | 0 .../QUECTEL_M26_CellularStack.h | 0 .../mbed_lib.json | 0 .../CMakeLists.txt | 4 + .../QUECTEL_UG96.cpp | 0 .../QUECTEL_UG96.h | 0 .../QUECTEL_UG96_CellularContext.cpp | 0 .../QUECTEL_UG96_CellularContext.h | 0 .../TARGET_WIO_3G/CMakeLists.txt | 12 + .../TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.cpp | 0 .../TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.h | 0 .../mbed_lib.json | 0 .../drivers/cellular/RiotMicro/CMakeLists.txt | 6 +- .../CMakeLists.txt | 0 .../RM1000_AT.cpp | 0 .../RM1000_AT.h | 0 .../RM1000_AT_CellularContext.cpp | 0 .../RM1000_AT_CellularContext.h | 0 .../RM1000_AT_CellularNetwork.cpp | 0 .../RM1000_AT_CellularNetwork.h | 0 .../RM1000_AT_CellularStack.cpp | 0 .../RM1000_AT_CellularStack.h | 0 .../mbed_lib.json | 0 .../drivers/cellular/TELIT/CMakeLists.txt | 14 +- .../COMPONENT_TELIT_HE910/CMakeLists.txt | 20 + .../CMakeLists.txt | 6 +- .../ONBOARD_TELIT_HE910.cpp | 0 .../ONBOARD_TELIT_HE910.h | 0 .../CMakeLists.txt | 12 + .../ONBOARD_TELIT_HE910.cpp | 8 +- .../ONBOARD_TELIT_HE910.h | 0 .../TELIT_HE910.cpp | 0 .../TELIT_HE910.h | 0 .../mbed_lib.json | 0 .../CMakeLists.txt | 4 + .../TARGET_EP_ATLAS/CMakeLists.txt | 12 + .../TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.cpp | 0 .../TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.h | 0 .../TELIT_ME310.cpp | 0 .../TELIT_ME310.h | 0 .../TELIT_ME310_CellularContext.cpp | 0 .../TELIT_ME310_CellularContext.h | 0 .../TELIT_ME310_CellularNetwork.cpp | 0 .../TELIT_ME310_CellularNetwork.h | 0 .../TELIT_ME310_CellularStack.cpp | 0 .../TELIT_ME310_CellularStack.h | 0 .../mbed_lib.json | 0 .../CMakeLists.txt | 4 + .../TARGET_EP_AGORA/CMakeLists.txt | 12 + .../TARGET_EP_AGORA/ONBOARD_TELIT_ME910.cpp | 0 .../TARGET_EP_AGORA/ONBOARD_TELIT_ME910.h | 0 .../TELIT_ME910.cpp | 0 .../TELIT_ME910.h | 0 .../TELIT_ME910_CellularContext.cpp | 0 .../TELIT_ME910_CellularContext.h | 0 .../TELIT_ME910_CellularNetwork.cpp | 0 .../TELIT_ME910_CellularNetwork.h | 0 .../mbed_lib.json | 0 .../drivers/cellular/UBLOX/AT/CMakeLists.txt | 15 - .../drivers/cellular/UBLOX/AT/UBLOX_AT.cpp | 219 -------- .../drivers/cellular/UBLOX/AT/UBLOX_AT.h | 69 --- .../UBLOX/AT/UBLOX_AT_CellularContext.cpp | 370 -------------- .../UBLOX/AT/UBLOX_AT_CellularContext.h | 102 ---- .../UBLOX/AT/UBLOX_AT_CellularNetwork.cpp | 104 ---- .../UBLOX/AT/UBLOX_AT_CellularNetwork.h | 42 -- .../UBLOX/AT/UBLOX_AT_CellularStack.cpp | 480 ------------------ .../UBLOX/AT/UBLOX_AT_CellularStack.h | 103 ---- .../drivers/cellular/UBLOX/AT/mbed_lib.json | 29 -- .../drivers/cellular/UBLOX/CMakeLists.txt | 6 - .../cellular/UBLOX/N2XX/CMakeLists.txt | 16 - .../cellular/UBLOX/N2XX/UBLOX_N2XX.cpp | 175 ------- .../drivers/cellular/UBLOX/N2XX/UBLOX_N2XX.h | 76 --- .../UBLOX/N2XX/UBLOX_N2XX_CellularContext.cpp | 52 -- .../UBLOX/N2XX/UBLOX_N2XX_CellularContext.h | 42 -- .../UBLOX/N2XX/UBLOX_N2XX_CellularNetwork.cpp | 51 -- .../UBLOX/N2XX/UBLOX_N2XX_CellularNetwork.h | 36 -- .../UBLOX/N2XX/UBLOX_N2XX_CellularSMS.cpp | 53 -- .../UBLOX/N2XX/UBLOX_N2XX_CellularSMS.h | 49 -- .../UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp | 221 -------- .../UBLOX/N2XX/UBLOX_N2XX_CellularStack.h | 77 --- .../drivers/cellular/UBLOX/N2XX/mbed_lib.json | 29 -- .../drivers/cellular/UBLOX/PPP/UBLOX_PPP.cpp | 121 ----- .../drivers/cellular/UBLOX/PPP/UBLOX_PPP.h | 41 -- .../drivers/cellular/UBLOX/PPP/mbed_lib.json | 29 -- connectivity/drivers/cellular/UBLOX/README.md | 27 - .../TARGET_RZ_A1XX/rza1_eth.c | 4 +- .../TARGET_RZ_A1XX/rza1_eth.h | 2 +- doxyfile_options | 1 - doxygen_options.json | 2 +- .../pwm/pwm_fpga_test.h | 2 +- platform/include/platform/LocalFileSystem.h | 2 +- platform/include/platform/mbed_debug.h | 6 +- platform/include/platform/mbed_semihost_api.h | 4 +- platform/source/CMakeLists.txt | 11 +- platform/source/LocalFileSystem.cpp | 3 - platform/source/mbed_error.c | 3 - platform/source/mbed_retarget.cpp | 2 - platform/source/mbed_semihost_api.c | 4 +- .../TARGET_MPS2/SDK/mps2_ethernet_api.h | 2 +- .../TARGET_MCU_NRF52840/CMakeLists.txt | 5 - .../CMakeLists.txt | 1 - .../CMakeLists.txt | 1 - .../TARGET_WIO_3G/CMakeLists.txt | 1 - .../CMakeLists.txt | 1 - .../TARGET_ADV_WISE_1570/CMakeLists.txt | 1 - .../CMakeLists.txt | 1 - targets/features.json5 | 392 ++++++++++++++ targets/targets.json5 | 233 ++++----- 228 files changed, 732 insertions(+), 2876 deletions(-) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/CMakeLists.txt (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/LICENSE (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/README.md (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/apache-2.0.txt (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/atmel-rf-driver/NanostackRfPhyAtmel.h (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/mbed_lib.json (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/source/AT86RF215Reg.h (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/source/AT86RFReg.h (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/source/NanostackRfPhyAT86RF215.cpp (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/source/NanostackRfPhyAtmel.cpp (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/source/at24mac.cpp (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/source/at24mac.h (100%) rename connectivity/drivers/802.15.4_RF/{atmel-rf-driver => COMPONENT_MICROCHIP_AT86RF}/source/rfbits.h (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/CMakeLists.txt (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/LICENSE (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/README.md (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/apache-2.0.txt (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/mbed_lib.json (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/mcr20a-rf-driver/NanostackRfPhyMcr20a.h (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/source/MCR20Drv.c (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/source/MCR20Drv.h (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/source/MCR20Overwrites.h (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/source/MCR20Reg.h (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/source/NanostackRfPhyMcr20a.cpp (100%) rename connectivity/drivers/802.15.4_RF/{mcr20a-rf-driver => COMPONENT_NXP_MCR20A}/source/XcvrSpi.h (100%) rename connectivity/drivers/802.15.4_RF/{stm-s2lp-rf-driver => COMPONENT_STM_S2_LP}/CMakeLists.txt (100%) rename connectivity/drivers/802.15.4_RF/{stm-s2lp-rf-driver => COMPONENT_STM_S2_LP}/README.md (100%) rename connectivity/drivers/802.15.4_RF/{stm-s2lp-rf-driver => COMPONENT_STM_S2_LP}/mbed_lib.json (100%) rename connectivity/drivers/802.15.4_RF/{stm-s2lp-rf-driver => COMPONENT_STM_S2_LP}/source/NanostackRfPhys2lp.cpp (100%) rename connectivity/drivers/802.15.4_RF/{stm-s2lp-rf-driver => COMPONENT_STM_S2_LP}/source/at24mac_s2lp.cpp (100%) rename connectivity/drivers/802.15.4_RF/{stm-s2lp-rf-driver => COMPONENT_STM_S2_LP}/source/at24mac_s2lp.h (100%) rename connectivity/drivers/802.15.4_RF/{stm-s2lp-rf-driver => COMPONENT_STM_S2_LP}/source/rf_configuration.c (100%) rename connectivity/drivers/802.15.4_RF/{stm-s2lp-rf-driver => COMPONENT_STM_S2_LP}/source/rf_configuration.h (100%) rename connectivity/drivers/802.15.4_RF/{stm-s2lp-rf-driver => COMPONENT_STM_S2_LP}/source/s2lpReg.h (100%) rename connectivity/drivers/802.15.4_RF/{stm-s2lp-rf-driver => COMPONENT_STM_S2_LP}/stm-s2lp-rf-driver/NanostackRfPhys2lp.h (100%) rename connectivity/drivers/cellular/Altair/{ALT1250 => COMPONENT_ALTAIR_ALT1250}/CMakeLists.txt (100%) rename connectivity/drivers/cellular/Altair/{ALT1250 => COMPONENT_ALTAIR_ALT1250}/PPP/ALT1250_PPP.cpp (100%) mode change 100755 => 100644 rename connectivity/drivers/cellular/Altair/{ALT1250 => COMPONENT_ALTAIR_ALT1250}/PPP/ALT1250_PPP.h (100%) rename connectivity/drivers/cellular/Altair/{ALT1250 => COMPONENT_ALTAIR_ALT1250}/PPP/ALT1250_PPP_CellularContext.cpp (100%) rename connectivity/drivers/cellular/Altair/{ALT1250 => COMPONENT_ALTAIR_ALT1250}/PPP/ALT1250_PPP_CellularContext.h (100%) rename connectivity/drivers/cellular/Altair/{ALT1250 => COMPONENT_ALTAIR_ALT1250}/PPP/ALT1250_PPP_CellularNetwork.cpp (100%) mode change 100755 => 100644 rename connectivity/drivers/cellular/Altair/{ALT1250 => COMPONENT_ALTAIR_ALT1250}/PPP/ALT1250_PPP_CellularNetwork.h (100%) mode change 100755 => 100644 rename connectivity/drivers/cellular/Altair/{ALT1250 => COMPONENT_ALTAIR_ALT1250}/PPP/CMakeLists.txt (100%) rename connectivity/drivers/cellular/Altair/{ALT1250 => COMPONENT_ALTAIR_ALT1250}/PPP/mbed_lib.json (100%) rename connectivity/drivers/cellular/GEMALTO/{CINTERION => COMPONENT_GEMALTO_CINTERION}/CMakeLists.txt (100%) rename connectivity/drivers/cellular/GEMALTO/{CINTERION => COMPONENT_GEMALTO_CINTERION}/GEMALTO_CINTERION.cpp (100%) rename connectivity/drivers/cellular/GEMALTO/{CINTERION => COMPONENT_GEMALTO_CINTERION}/GEMALTO_CINTERION.h (100%) rename connectivity/drivers/cellular/GEMALTO/{CINTERION => COMPONENT_GEMALTO_CINTERION}/GEMALTO_CINTERION_CellularContext.cpp (100%) rename connectivity/drivers/cellular/GEMALTO/{CINTERION => COMPONENT_GEMALTO_CINTERION}/GEMALTO_CINTERION_CellularContext.h (100%) rename connectivity/drivers/cellular/GEMALTO/{CINTERION => COMPONENT_GEMALTO_CINTERION}/GEMALTO_CINTERION_CellularInformation.cpp (100%) rename connectivity/drivers/cellular/GEMALTO/{CINTERION => COMPONENT_GEMALTO_CINTERION}/GEMALTO_CINTERION_CellularInformation.h (100%) rename connectivity/drivers/cellular/GEMALTO/{CINTERION => COMPONENT_GEMALTO_CINTERION}/GEMALTO_CINTERION_CellularStack.cpp (100%) rename connectivity/drivers/cellular/GEMALTO/{CINTERION => COMPONENT_GEMALTO_CINTERION}/GEMALTO_CINTERION_CellularStack.h (100%) rename connectivity/drivers/cellular/GEMALTO/{CINTERION => COMPONENT_GEMALTO_CINTERION}/mbed_lib.json (100%) rename connectivity/drivers/cellular/GENERIC/{GENERIC_AT3GPP => COMPONENT_GENERIC_AT3GPP}/CMakeLists.txt (100%) rename connectivity/drivers/cellular/GENERIC/{GENERIC_AT3GPP => COMPONENT_GENERIC_AT3GPP}/GENERIC_AT3GPP.cpp (100%) rename connectivity/drivers/cellular/GENERIC/{GENERIC_AT3GPP => COMPONENT_GENERIC_AT3GPP}/GENERIC_AT3GPP.h (100%) rename connectivity/drivers/cellular/GENERIC/{GENERIC_AT3GPP => COMPONENT_GENERIC_AT3GPP}/mbed_lib.json (100%) rename connectivity/drivers/cellular/MultiTech/DragonflyNano/{PPP => COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR}/CMakeLists.txt (70%) rename connectivity/drivers/cellular/MultiTech/DragonflyNano/{PPP => COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR}/SARA4_PPP.cpp (100%) rename connectivity/drivers/cellular/MultiTech/DragonflyNano/{PPP => COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR}/SARA4_PPP.h (100%) rename connectivity/drivers/cellular/MultiTech/DragonflyNano/{PPP => COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR}/SARA4_PPP_CellularNetwork.cpp (100%) rename connectivity/drivers/cellular/MultiTech/DragonflyNano/{PPP => COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR}/SARA4_PPP_CellularNetwork.h (100%) rename connectivity/drivers/cellular/{TELIT/HE910 => MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/TARGET_MTS_DRAGONFLY_L471QG}/CMakeLists.txt (62%) rename {targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG => connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR}/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.cpp (98%) rename {targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG => connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR}/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.h (100%) rename connectivity/drivers/cellular/MultiTech/DragonflyNano/{PPP => COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR}/mbed_lib.json (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/CMakeLists.txt (79%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/QUECTEL_BC95.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/QUECTEL_BC95.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/QUECTEL_BC95_CellularContext.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/QUECTEL_BC95_CellularContext.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/QUECTEL_BC95_CellularInformation.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/QUECTEL_BC95_CellularInformation.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/QUECTEL_BC95_CellularNetwork.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/QUECTEL_BC95_CellularNetwork.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/QUECTEL_BC95_CellularStack.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/QUECTEL_BC95_CellularStack.h (100%) create mode 100644 connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/TARGET_ADV_WISE_1570/CMakeLists.txt rename {targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG => connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95}/TARGET_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.cpp (100%) rename {targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG => connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95}/TARGET_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BC95 => COMPONENT_QUECTEL_BC95}/mbed_lib.json (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/CMakeLists.txt (82%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96_CellularContext.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96_CellularContext.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96_CellularInformation.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96_CellularInformation.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96_CellularNetwork.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96_CellularNetwork.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96_CellularStack.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96_CellularStack.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96_ControlPlane_netif.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/QUECTEL_BG96_ControlPlane_netif.h (100%) create mode 100644 connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/TARGET_WIO_BG96/CMakeLists.txt rename {targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI => connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96}/TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.cpp (100%) rename {targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI => connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96}/TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.h (100%) rename connectivity/drivers/cellular/QUECTEL/{BG96 => COMPONENT_QUECTEL_BG96}/mbed_lib.json (100%) rename connectivity/drivers/cellular/QUECTEL/{EC2X => COMPONENT_QUECTEL_EC2X}/CMakeLists.txt (67%) rename connectivity/drivers/cellular/QUECTEL/{EC2X => COMPONENT_QUECTEL_EC2X}/QUECTEL_EC2X.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{EC2X => COMPONENT_QUECTEL_EC2X}/QUECTEL_EC2X.h (100%) create mode 100644 connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/TARGET_MTS_DRAGONFLY_L496VG/CMakeLists.txt rename {targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG => connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X}/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.cpp (95%) rename {targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG => connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X}/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.h (96%) rename connectivity/drivers/cellular/QUECTEL/{EC2X => COMPONENT_QUECTEL_EC2X}/mbed_lib.json (100%) rename connectivity/drivers/cellular/QUECTEL/{M26 => COMPONENT_QUECTEL_M26}/CMakeLists.txt (100%) rename connectivity/drivers/cellular/QUECTEL/{M26 => COMPONENT_QUECTEL_M26}/QUECTEL_M26.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{M26 => COMPONENT_QUECTEL_M26}/QUECTEL_M26.h (100%) rename connectivity/drivers/cellular/QUECTEL/{M26 => COMPONENT_QUECTEL_M26}/QUECTEL_M26_CellularContext.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{M26 => COMPONENT_QUECTEL_M26}/QUECTEL_M26_CellularContext.h (100%) rename connectivity/drivers/cellular/QUECTEL/{M26 => COMPONENT_QUECTEL_M26}/QUECTEL_M26_CellularInformation.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{M26 => COMPONENT_QUECTEL_M26}/QUECTEL_M26_CellularInformation.h (100%) rename connectivity/drivers/cellular/QUECTEL/{M26 => COMPONENT_QUECTEL_M26}/QUECTEL_M26_CellularStack.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{M26 => COMPONENT_QUECTEL_M26}/QUECTEL_M26_CellularStack.h (100%) rename connectivity/drivers/cellular/QUECTEL/{M26 => COMPONENT_QUECTEL_M26}/mbed_lib.json (100%) rename connectivity/drivers/cellular/QUECTEL/{UG96 => COMPONENT_QUECTEL_UG96}/CMakeLists.txt (75%) rename connectivity/drivers/cellular/QUECTEL/{UG96 => COMPONENT_QUECTEL_UG96}/QUECTEL_UG96.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{UG96 => COMPONENT_QUECTEL_UG96}/QUECTEL_UG96.h (100%) rename connectivity/drivers/cellular/QUECTEL/{UG96 => COMPONENT_QUECTEL_UG96}/QUECTEL_UG96_CellularContext.cpp (100%) rename connectivity/drivers/cellular/QUECTEL/{UG96 => COMPONENT_QUECTEL_UG96}/QUECTEL_UG96_CellularContext.h (100%) create mode 100644 connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/TARGET_WIO_3G/CMakeLists.txt rename {targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI => connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96}/TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.cpp (100%) rename {targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI => connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96}/TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.h (100%) rename connectivity/drivers/cellular/QUECTEL/{UG96 => COMPONENT_QUECTEL_UG96}/mbed_lib.json (100%) rename connectivity/drivers/cellular/RiotMicro/{AT => COMPONENT_RIOTMICRO_RM1000}/CMakeLists.txt (100%) rename connectivity/drivers/cellular/RiotMicro/{AT => COMPONENT_RIOTMICRO_RM1000}/RM1000_AT.cpp (100%) rename connectivity/drivers/cellular/RiotMicro/{AT => COMPONENT_RIOTMICRO_RM1000}/RM1000_AT.h (100%) rename connectivity/drivers/cellular/RiotMicro/{AT => COMPONENT_RIOTMICRO_RM1000}/RM1000_AT_CellularContext.cpp (100%) rename connectivity/drivers/cellular/RiotMicro/{AT => COMPONENT_RIOTMICRO_RM1000}/RM1000_AT_CellularContext.h (100%) rename connectivity/drivers/cellular/RiotMicro/{AT => COMPONENT_RIOTMICRO_RM1000}/RM1000_AT_CellularNetwork.cpp (100%) rename connectivity/drivers/cellular/RiotMicro/{AT => COMPONENT_RIOTMICRO_RM1000}/RM1000_AT_CellularNetwork.h (100%) rename connectivity/drivers/cellular/RiotMicro/{AT => COMPONENT_RIOTMICRO_RM1000}/RM1000_AT_CellularStack.cpp (100%) rename connectivity/drivers/cellular/RiotMicro/{AT => COMPONENT_RIOTMICRO_RM1000}/RM1000_AT_CellularStack.h (100%) rename connectivity/drivers/cellular/RiotMicro/{AT => COMPONENT_RIOTMICRO_RM1000}/mbed_lib.json (100%) create mode 100644 connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/CMakeLists.txt rename connectivity/drivers/cellular/{UBLOX/PPP => TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F411RE}/CMakeLists.txt (62%) rename {targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE => connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910}/TARGET_MTS_DRAGONFLY_F411RE/ONBOARD_TELIT_HE910.cpp (100%) rename {targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE => connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910}/TARGET_MTS_DRAGONFLY_F411RE/ONBOARD_TELIT_HE910.h (100%) create mode 100644 connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F413RH/CMakeLists.txt rename {targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH => connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910}/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp (98%) rename {targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH => connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910}/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.h (100%) rename connectivity/drivers/cellular/TELIT/{HE910 => COMPONENT_TELIT_HE910}/TELIT_HE910.cpp (100%) rename connectivity/drivers/cellular/TELIT/{HE910 => COMPONENT_TELIT_HE910}/TELIT_HE910.h (100%) rename connectivity/drivers/cellular/TELIT/{HE910 => COMPONENT_TELIT_HE910}/mbed_lib.json (100%) rename connectivity/drivers/cellular/TELIT/{ME310 => COMPONENT_TELIT_ME310}/CMakeLists.txt (78%) create mode 100644 connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TARGET_EP_ATLAS/CMakeLists.txt rename {targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840 => connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310}/TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.cpp (100%) rename {targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840 => connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310}/TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.h (100%) rename connectivity/drivers/cellular/TELIT/{ME310 => COMPONENT_TELIT_ME310}/TELIT_ME310.cpp (100%) rename connectivity/drivers/cellular/TELIT/{ME310 => COMPONENT_TELIT_ME310}/TELIT_ME310.h (100%) rename connectivity/drivers/cellular/TELIT/{ME310 => COMPONENT_TELIT_ME310}/TELIT_ME310_CellularContext.cpp (100%) rename connectivity/drivers/cellular/TELIT/{ME310 => COMPONENT_TELIT_ME310}/TELIT_ME310_CellularContext.h (100%) rename connectivity/drivers/cellular/TELIT/{ME310 => COMPONENT_TELIT_ME310}/TELIT_ME310_CellularNetwork.cpp (100%) rename connectivity/drivers/cellular/TELIT/{ME310 => COMPONENT_TELIT_ME310}/TELIT_ME310_CellularNetwork.h (100%) rename connectivity/drivers/cellular/TELIT/{ME310 => COMPONENT_TELIT_ME310}/TELIT_ME310_CellularStack.cpp (100%) rename connectivity/drivers/cellular/TELIT/{ME310 => COMPONENT_TELIT_ME310}/TELIT_ME310_CellularStack.h (100%) rename connectivity/drivers/cellular/TELIT/{ME310 => COMPONENT_TELIT_ME310}/mbed_lib.json (100%) rename connectivity/drivers/cellular/TELIT/{ME910 => COMPONENT_TELIT_ME910}/CMakeLists.txt (76%) create mode 100644 connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TARGET_EP_AGORA/CMakeLists.txt rename {targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840 => connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910}/TARGET_EP_AGORA/ONBOARD_TELIT_ME910.cpp (100%) rename {targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840 => connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910}/TARGET_EP_AGORA/ONBOARD_TELIT_ME910.h (100%) rename connectivity/drivers/cellular/TELIT/{ME910 => COMPONENT_TELIT_ME910}/TELIT_ME910.cpp (100%) rename connectivity/drivers/cellular/TELIT/{ME910 => COMPONENT_TELIT_ME910}/TELIT_ME910.h (100%) rename connectivity/drivers/cellular/TELIT/{ME910 => COMPONENT_TELIT_ME910}/TELIT_ME910_CellularContext.cpp (100%) rename connectivity/drivers/cellular/TELIT/{ME910 => COMPONENT_TELIT_ME910}/TELIT_ME910_CellularContext.h (100%) rename connectivity/drivers/cellular/TELIT/{ME910 => COMPONENT_TELIT_ME910}/TELIT_ME910_CellularNetwork.cpp (100%) rename connectivity/drivers/cellular/TELIT/{ME910 => COMPONENT_TELIT_ME910}/TELIT_ME910_CellularNetwork.h (100%) rename connectivity/drivers/cellular/TELIT/{ME910 => COMPONENT_TELIT_ME910}/mbed_lib.json (100%) delete mode 100644 connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt delete mode 100644 connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT.cpp delete mode 100644 connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT.h delete mode 100644 connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularContext.cpp delete mode 100644 connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularContext.h delete mode 100644 connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularNetwork.cpp delete mode 100644 connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularNetwork.h delete mode 100644 connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularStack.cpp delete mode 100644 connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularStack.h delete mode 100644 connectivity/drivers/cellular/UBLOX/AT/mbed_lib.json delete mode 100644 connectivity/drivers/cellular/UBLOX/CMakeLists.txt delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX.cpp delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX.h delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularContext.cpp delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularContext.h delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularNetwork.cpp delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularNetwork.h delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularSMS.cpp delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularSMS.h delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularStack.h delete mode 100644 connectivity/drivers/cellular/UBLOX/N2XX/mbed_lib.json delete mode 100644 connectivity/drivers/cellular/UBLOX/PPP/UBLOX_PPP.cpp delete mode 100644 connectivity/drivers/cellular/UBLOX/PPP/UBLOX_PPP.h delete mode 100644 connectivity/drivers/cellular/UBLOX/PPP/mbed_lib.json delete mode 100644 connectivity/drivers/cellular/UBLOX/README.md create mode 100644 targets/features.json5 diff --git a/connectivity/drivers/802.15.4_RF/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/CMakeLists.txt index 83dae10ac63..7f5529d6a1f 100644 --- a/connectivity/drivers/802.15.4_RF/CMakeLists.txt +++ b/connectivity/drivers/802.15.4_RF/CMakeLists.txt @@ -1,22 +1,43 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_library(mbed-802.15.4-rf STATIC EXCLUDE_FROM_ALL) +# The 'mbed-802.15.4-rf' target is lazily created because there might not be any subdirectories needing it at all. +macro(create_802_15_4_target) + if(NOT TARGET create_802_15_4_target) + add_library(mbed-802.15.4-rf STATIC EXCLUDE_FROM_ALL) + + # Nanostack drivers always require Mbed RTOS + target_link_libraries(mbed-802.15.4-rf PUBLIC mbed-core-flags mbed-rtos-flags) + + target_link_libraries(mbed-nanostack + INTERFACE + mbed-802.15.4-rf + ) + endif() +endmacro() -target_link_libraries(mbed-802.15.4-rf PUBLIC mbed-core-flags) if("Freescale" IN_LIST MBED_TARGET_LABELS) + create_802_15_4_target() add_subdirectory(TARGET_Freescale) - add_subdirectory(mcr20a-rf-driver) elseif("Silicon_Labs" IN_LIST MBED_TARGET_LABELS) + create_802_15_4_target() add_subdirectory(TARGET_Silicon_Labs) -elseif("STM" IN_LIST MBED_TARGET_LABELS) - add_subdirectory(stm-s2lp-rf-driver) endif() -add_subdirectory(atmel-rf-driver) +if("COMPONENT_MICROCHIP_AT86RF=1" IN_LIST MBED_TARGET_DEFINITIONS) + create_802_15_4_target() + add_subdirectory(COMPONENT_MICROCHIP_AT86RF) +endif() + +if("COMPONENT_NXP_MCR20A=1" IN_LIST MBED_TARGET_DEFINITIONS) + create_802_15_4_target() + add_subdirectory(COMPONENT_NXP_MCR20A) +endif() + +if("COMPONENT_STM_S2_LP=1" IN_LIST MBED_TARGET_DEFINITIONS) + create_802_15_4_target() + add_subdirectory(COMPONENT_STM_S2_LP) +endif() + -target_link_libraries(mbed-nanostack - INTERFACE - mbed-802.15.4-rf -) diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/CMakeLists.txt similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/CMakeLists.txt rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/CMakeLists.txt diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/LICENSE b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/LICENSE similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/LICENSE rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/LICENSE diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/README.md b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/README.md similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/README.md rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/README.md diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/apache-2.0.txt b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/apache-2.0.txt similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/apache-2.0.txt rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/apache-2.0.txt diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/atmel-rf-driver/NanostackRfPhyAtmel.h b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/atmel-rf-driver/NanostackRfPhyAtmel.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/atmel-rf-driver/NanostackRfPhyAtmel.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/atmel-rf-driver/NanostackRfPhyAtmel.h diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/mbed_lib.json b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/mbed_lib.json similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/mbed_lib.json rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/mbed_lib.json diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/AT86RF215Reg.h b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/AT86RF215Reg.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/AT86RF215Reg.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/AT86RF215Reg.h diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/AT86RFReg.h b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/AT86RFReg.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/AT86RFReg.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/AT86RFReg.h diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAT86RF215.cpp b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/NanostackRfPhyAT86RF215.cpp similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAT86RF215.cpp rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/NanostackRfPhyAT86RF215.cpp diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/NanostackRfPhyAtmel.cpp similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/NanostackRfPhyAtmel.cpp diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/at24mac.cpp b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/at24mac.cpp similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/at24mac.cpp rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/at24mac.cpp diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/at24mac.h b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/at24mac.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/at24mac.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/at24mac.h diff --git a/connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/rfbits.h b/connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/rfbits.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/rfbits.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_MICROCHIP_AT86RF/source/rfbits.h diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/CMakeLists.txt similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/CMakeLists.txt rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/CMakeLists.txt diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/LICENSE b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/LICENSE similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/LICENSE rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/LICENSE diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/README.md b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/README.md similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/README.md rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/README.md diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/apache-2.0.txt b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/apache-2.0.txt similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/apache-2.0.txt rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/apache-2.0.txt diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/mbed_lib.json b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/mbed_lib.json similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/mbed_lib.json rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/mbed_lib.json diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/mcr20a-rf-driver/NanostackRfPhyMcr20a.h b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/mcr20a-rf-driver/NanostackRfPhyMcr20a.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/mcr20a-rf-driver/NanostackRfPhyMcr20a.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/mcr20a-rf-driver/NanostackRfPhyMcr20a.h diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/MCR20Drv.c b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/MCR20Drv.c similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/MCR20Drv.c rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/MCR20Drv.c diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/MCR20Drv.h b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/MCR20Drv.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/MCR20Drv.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/MCR20Drv.h diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/MCR20Overwrites.h b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/MCR20Overwrites.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/MCR20Overwrites.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/MCR20Overwrites.h diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/MCR20Reg.h b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/MCR20Reg.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/MCR20Reg.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/MCR20Reg.h diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/NanostackRfPhyMcr20a.cpp similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/NanostackRfPhyMcr20a.cpp diff --git a/connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/XcvrSpi.h b/connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/XcvrSpi.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/mcr20a-rf-driver/source/XcvrSpi.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_NXP_MCR20A/source/XcvrSpi.h diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/CMakeLists.txt b/connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/CMakeLists.txt similarity index 100% rename from connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/CMakeLists.txt rename to connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/CMakeLists.txt diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/README.md b/connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/README.md similarity index 100% rename from connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/README.md rename to connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/README.md diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/mbed_lib.json b/connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/mbed_lib.json similarity index 100% rename from connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/mbed_lib.json rename to connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/mbed_lib.json diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp b/connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/NanostackRfPhys2lp.cpp similarity index 100% rename from connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp rename to connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/NanostackRfPhys2lp.cpp diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/at24mac_s2lp.cpp b/connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/at24mac_s2lp.cpp similarity index 100% rename from connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/at24mac_s2lp.cpp rename to connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/at24mac_s2lp.cpp diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/at24mac_s2lp.h b/connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/at24mac_s2lp.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/at24mac_s2lp.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/at24mac_s2lp.h diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/rf_configuration.c b/connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/rf_configuration.c similarity index 100% rename from connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/rf_configuration.c rename to connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/rf_configuration.c diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/rf_configuration.h b/connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/rf_configuration.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/rf_configuration.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/rf_configuration.h diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/s2lpReg.h b/connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/s2lpReg.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/s2lpReg.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/source/s2lpReg.h diff --git a/connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/stm-s2lp-rf-driver/NanostackRfPhys2lp.h b/connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/stm-s2lp-rf-driver/NanostackRfPhys2lp.h similarity index 100% rename from connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/stm-s2lp-rf-driver/NanostackRfPhys2lp.h rename to connectivity/drivers/802.15.4_RF/COMPONENT_STM_S2_LP/stm-s2lp-rf-driver/NanostackRfPhys2lp.h diff --git a/connectivity/drivers/cellular/Altair/CMakeLists.txt b/connectivity/drivers/cellular/Altair/CMakeLists.txt index 8ba299d8e8b..3ee15a06ebb 100644 --- a/connectivity/drivers/cellular/Altair/CMakeLists.txt +++ b/connectivity/drivers/cellular/Altair/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(ALT1250) +if("COMPONENT_ALTAIR_ALT1250=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(COMPONENT_ALTAIR_ALT1250) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/Altair/ALT1250/CMakeLists.txt b/connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/CMakeLists.txt similarity index 100% rename from connectivity/drivers/cellular/Altair/ALT1250/CMakeLists.txt rename to connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/CMakeLists.txt diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP.cpp b/connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP.cpp old mode 100755 new mode 100644 similarity index 100% rename from connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP.cpp rename to connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP.cpp diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP.h b/connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP.h similarity index 100% rename from connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP.h rename to connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP.h diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP_CellularContext.cpp b/connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP_CellularContext.cpp similarity index 100% rename from connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP_CellularContext.cpp rename to connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP_CellularContext.cpp diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP_CellularContext.h b/connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP_CellularContext.h similarity index 100% rename from connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP_CellularContext.h rename to connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP_CellularContext.h diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP_CellularNetwork.cpp b/connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP_CellularNetwork.cpp old mode 100755 new mode 100644 similarity index 100% rename from connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP_CellularNetwork.cpp rename to connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP_CellularNetwork.h b/connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP_CellularNetwork.h old mode 100755 new mode 100644 similarity index 100% rename from connectivity/drivers/cellular/Altair/ALT1250/PPP/ALT1250_PPP_CellularNetwork.h rename to connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/ALT1250_PPP_CellularNetwork.h diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt b/connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/CMakeLists.txt similarity index 100% rename from connectivity/drivers/cellular/Altair/ALT1250/PPP/CMakeLists.txt rename to connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/CMakeLists.txt diff --git a/connectivity/drivers/cellular/Altair/ALT1250/PPP/mbed_lib.json b/connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/Altair/ALT1250/PPP/mbed_lib.json rename to connectivity/drivers/cellular/Altair/COMPONENT_ALTAIR_ALT1250/PPP/mbed_lib.json diff --git a/connectivity/drivers/cellular/CMakeLists.txt b/connectivity/drivers/cellular/CMakeLists.txt index 9a0346fbe81..0363c4c2f1f 100644 --- a/connectivity/drivers/cellular/CMakeLists.txt +++ b/connectivity/drivers/cellular/CMakeLists.txt @@ -1,7 +1,7 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -if("STMOD_CELLULAR" IN_LIST MBED_TARGET_LABELS) +if("COMPONENT_STMOD_CELLULAR=1" IN_LIST MBED_TARGET_DEFINITIONS) add_subdirectory(COMPONENT_STMOD_CELLULAR) endif() @@ -11,10 +11,4 @@ add_subdirectory(GENERIC) add_subdirectory(MultiTech) add_subdirectory(QUECTEL) add_subdirectory(RiotMicro) -add_subdirectory(TELIT) -add_subdirectory(UBLOX) - -target_include_directories(mbed-cellular - PUBLIC - . -) +add_subdirectory(TELIT) \ No newline at end of file diff --git a/connectivity/drivers/cellular/GEMALTO/CMakeLists.txt b/connectivity/drivers/cellular/GEMALTO/CMakeLists.txt index e1fe296061e..d7bf4f24272 100644 --- a/connectivity/drivers/cellular/GEMALTO/CMakeLists.txt +++ b/connectivity/drivers/cellular/GEMALTO/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(CINTERION) +if("COMPONENT_GEMALTO_CINTERION=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(CINTERION) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt b/connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/CMakeLists.txt similarity index 100% rename from connectivity/drivers/cellular/GEMALTO/CINTERION/CMakeLists.txt rename to connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/CMakeLists.txt diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.cpp b/connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION.cpp similarity index 100% rename from connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.cpp rename to connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION.cpp diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.h b/connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION.h similarity index 100% rename from connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION.h rename to connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION.h diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp b/connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularContext.cpp similarity index 100% rename from connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.cpp rename to connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularContext.cpp diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.h b/connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularContext.h similarity index 100% rename from connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularContext.h rename to connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularContext.h diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularInformation.cpp b/connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularInformation.cpp similarity index 100% rename from connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularInformation.cpp rename to connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularInformation.h b/connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularInformation.h similarity index 100% rename from connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularInformation.h rename to connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularInformation.h diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp b/connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularStack.cpp similarity index 100% rename from connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.cpp rename to connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularStack.cpp diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.h b/connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularStack.h similarity index 100% rename from connectivity/drivers/cellular/GEMALTO/CINTERION/GEMALTO_CINTERION_CellularStack.h rename to connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/GEMALTO_CINTERION_CellularStack.h diff --git a/connectivity/drivers/cellular/GEMALTO/CINTERION/mbed_lib.json b/connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/GEMALTO/CINTERION/mbed_lib.json rename to connectivity/drivers/cellular/GEMALTO/COMPONENT_GEMALTO_CINTERION/mbed_lib.json diff --git a/connectivity/drivers/cellular/GENERIC/CMakeLists.txt b/connectivity/drivers/cellular/GENERIC/CMakeLists.txt index 6eeee2c57c3..86d84065609 100644 --- a/connectivity/drivers/cellular/GENERIC/CMakeLists.txt +++ b/connectivity/drivers/cellular/GENERIC/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(GENERIC_AT3GPP) +if("COMPONENT_GENERIC_AT3GPP=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(COMPONENT_GENERIC_AT3GPP) +endif() diff --git a/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt b/connectivity/drivers/cellular/GENERIC/COMPONENT_GENERIC_AT3GPP/CMakeLists.txt similarity index 100% rename from connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/CMakeLists.txt rename to connectivity/drivers/cellular/GENERIC/COMPONENT_GENERIC_AT3GPP/CMakeLists.txt diff --git a/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/GENERIC_AT3GPP.cpp b/connectivity/drivers/cellular/GENERIC/COMPONENT_GENERIC_AT3GPP/GENERIC_AT3GPP.cpp similarity index 100% rename from connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/GENERIC_AT3GPP.cpp rename to connectivity/drivers/cellular/GENERIC/COMPONENT_GENERIC_AT3GPP/GENERIC_AT3GPP.cpp diff --git a/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/GENERIC_AT3GPP.h b/connectivity/drivers/cellular/GENERIC/COMPONENT_GENERIC_AT3GPP/GENERIC_AT3GPP.h similarity index 100% rename from connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/GENERIC_AT3GPP.h rename to connectivity/drivers/cellular/GENERIC/COMPONENT_GENERIC_AT3GPP/GENERIC_AT3GPP.h diff --git a/connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/mbed_lib.json b/connectivity/drivers/cellular/GENERIC/COMPONENT_GENERIC_AT3GPP/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/GENERIC/GENERIC_AT3GPP/mbed_lib.json rename to connectivity/drivers/cellular/GENERIC/COMPONENT_GENERIC_AT3GPP/mbed_lib.json diff --git a/connectivity/drivers/cellular/MultiTech/CMakeLists.txt b/connectivity/drivers/cellular/MultiTech/CMakeLists.txt index af43b957916..4b57da308df 100644 --- a/connectivity/drivers/cellular/MultiTech/CMakeLists.txt +++ b/connectivity/drivers/cellular/MultiTech/CMakeLists.txt @@ -1,4 +1,6 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(DragonflyNano) +if("COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/CMakeLists.txt similarity index 70% rename from connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt rename to connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/CMakeLists.txt index 293be2378d7..91cc7c7c8f6 100644 --- a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/CMakeLists.txt +++ b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/CMakeLists.txt @@ -11,3 +11,7 @@ target_sources(mbed-cellular SARA4_PPP.cpp SARA4_PPP_CellularNetwork.cpp ) + +if("MTS_DRAGONFLY_L471QG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MTS_DRAGONFLY_L471QG) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/SARA4_PPP.cpp b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/SARA4_PPP.cpp similarity index 100% rename from connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/SARA4_PPP.cpp rename to connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/SARA4_PPP.cpp diff --git a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/SARA4_PPP.h b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/SARA4_PPP.h similarity index 100% rename from connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/SARA4_PPP.h rename to connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/SARA4_PPP.h diff --git a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/SARA4_PPP_CellularNetwork.cpp b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/SARA4_PPP_CellularNetwork.cpp similarity index 100% rename from connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/SARA4_PPP_CellularNetwork.cpp rename to connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/SARA4_PPP_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/SARA4_PPP_CellularNetwork.h b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/SARA4_PPP_CellularNetwork.h similarity index 100% rename from connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/SARA4_PPP_CellularNetwork.h rename to connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/SARA4_PPP_CellularNetwork.h diff --git a/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/TARGET_MTS_DRAGONFLY_L471QG/CMakeLists.txt similarity index 62% rename from connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt rename to connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/TARGET_MTS_DRAGONFLY_L471QG/CMakeLists.txt index 2f6c4b77a52..c0f911aae1a 100644 --- a/connectivity/drivers/cellular/TELIT/HE910/CMakeLists.txt +++ b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/TARGET_MTS_DRAGONFLY_L471QG/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2024 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular @@ -8,5 +8,5 @@ target_include_directories(mbed-cellular target_sources(mbed-cellular PRIVATE - TELIT_HE910.cpp -) + ONBOARD_SARA4_PPP.cpp +) \ No newline at end of file diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.cpp b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.cpp similarity index 98% rename from targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.cpp rename to connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.cpp index d09ef1cc8e9..691cb24db36 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.cpp +++ b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.cpp @@ -111,7 +111,7 @@ void ONBOARD_SARA4_PPP::onboard_modem_deinit() void ONBOARD_SARA4_PPP::onboard_modem_power_up() { // Make sure the radio is initialized so it can be powered on. - if (!initialized){ + if (!initialized) { onboard_modem_init(); } @@ -129,7 +129,7 @@ void ONBOARD_SARA4_PPP::onboard_modem_power_up() uint8_t retries = 5; do { // If it hasn't turned on after multiple tries, exit and return. - if(0 == retries--) { + if (0 == retries--) { return; } // Activate PWR_ON for 150ms-3.2s to switch on. Reference ublox SARA-R4 data sheet. @@ -153,7 +153,7 @@ void ONBOARD_SARA4_PPP::onboard_modem_power_down() } // Make sure the I/O are properly initialized. - if (!initialized){ + if (!initialized) { onboard_modem_init(); } // Activate PWR_ON for at least 1.5s to switch off. Reference ublox SARA-R4 data sheet. diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.h b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.h similarity index 100% rename from targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.h rename to connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.h diff --git a/connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/mbed_lib.json b/connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/MultiTech/DragonflyNano/PPP/mbed_lib.json rename to connectivity/drivers/cellular/MultiTech/DragonflyNano/COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR/mbed_lib.json diff --git a/connectivity/drivers/cellular/QUECTEL/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/CMakeLists.txt index bcce2a5f113..22b2479ef49 100644 --- a/connectivity/drivers/cellular/QUECTEL/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/CMakeLists.txt @@ -1,8 +1,23 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(BC95) -add_subdirectory(BG96) -add_subdirectory(EC2X) -add_subdirectory(M26) -add_subdirectory(UG96) +if("COMPONENT_QUECTEL_EC2X=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(COMPONENT_QUECTEL_EC2X) +endif() + +if("COMPONENT_QUECTEL_BG96=1" IN_LIST MBED_TARGET_DEFINITIONS OR ("COMPONENT_STMOD_CELLULAR=1" IN_LIST MBED_TARGET_DEFINITIONS AND "MBED_CONF_STMOD_CELLULAR_TYPE=STMOD_BG96")) + add_subdirectory(COMPONENT_QUECTEL_BG96) +endif() + +if("COMPONENT_QUECTEL_UG96=1" IN_LIST MBED_TARGET_DEFINITIONS OR ("COMPONENT_STMOD_CELLULAR=1" IN_LIST MBED_TARGET_DEFINITIONS AND "MBED_CONF_STMOD_CELLULAR_TYPE=STMOD_UG96")) + add_subdirectory(COMPONENT_QUECTEL_UG96) +endif() + +if("COMPONENT_QUECTEL_BC95=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(COMPONENT_QUECTEL_BC95) +endif() + +if("COMPONENT_QUECTEL_M26=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(COMPONENT_QUECTEL_M26) +endif() + diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/CMakeLists.txt similarity index 79% rename from connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/CMakeLists.txt index d4b43f26a69..316d1cea107 100644 --- a/connectivity/drivers/cellular/QUECTEL/BC95/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/CMakeLists.txt @@ -14,3 +14,7 @@ target_sources(mbed-cellular QUECTEL_BC95_CellularNetwork.cpp QUECTEL_BC95_CellularStack.cpp ) + +if("TARGET_ADV_WISE_1570" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_ADV_WISE_1570) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95.h diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularContext.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularContext.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularContext.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularContext.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularContext.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularContext.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularContext.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularContext.h diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularInformation.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularInformation.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularInformation.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularInformation.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularInformation.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularInformation.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularInformation.h diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularNetwork.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularNetwork.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularNetwork.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularNetwork.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularNetwork.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularNetwork.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularNetwork.h diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularStack.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularStack.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularStack.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularStack.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularStack.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularStack.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/QUECTEL_BC95_CellularStack.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/QUECTEL_BC95_CellularStack.h diff --git a/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/TARGET_ADV_WISE_1570/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/TARGET_ADV_WISE_1570/CMakeLists.txt new file mode 100644 index 00000000000..071a2d0463c --- /dev/null +++ b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/TARGET_ADV_WISE_1570/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2024 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + PUBLIC + . +) + +target_sources(mbed-cellular + PRIVATE + ONBOARD_QUECTEL_BC95.cpp +) \ No newline at end of file diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TARGET_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/TARGET_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.cpp similarity index 100% rename from targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TARGET_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/TARGET_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.cpp diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TARGET_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/TARGET_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.h similarity index 100% rename from targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TARGET_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/TARGET_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.h diff --git a/connectivity/drivers/cellular/QUECTEL/BC95/mbed_lib.json b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BC95/mbed_lib.json rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BC95/mbed_lib.json diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/CMakeLists.txt similarity index 82% rename from connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/CMakeLists.txt index d73ac1b2714..121ec7602f2 100644 --- a/connectivity/drivers/cellular/QUECTEL/BG96/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/CMakeLists.txt @@ -15,3 +15,7 @@ target_sources(mbed-cellular QUECTEL_BG96_CellularStack.cpp QUECTEL_BG96_ControlPlane_netif.cpp ) + +if("TARGET_WIO_BG96" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_WIO_BG96) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96.h diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularContext.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularContext.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularContext.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularContext.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularContext.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularContext.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularContext.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularContext.h diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularInformation.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularInformation.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularInformation.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularInformation.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularInformation.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularInformation.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularInformation.h diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularNetwork.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularNetwork.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularNetwork.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularNetwork.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularNetwork.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularNetwork.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularNetwork.h diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularStack.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularStack.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularStack.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularStack.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularStack.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularStack.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_CellularStack.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_CellularStack.h diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_ControlPlane_netif.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_ControlPlane_netif.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_ControlPlane_netif.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_ControlPlane_netif.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_ControlPlane_netif.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_ControlPlane_netif.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/QUECTEL_BG96_ControlPlane_netif.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/QUECTEL_BG96_ControlPlane_netif.h diff --git a/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/TARGET_WIO_BG96/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/TARGET_WIO_BG96/CMakeLists.txt new file mode 100644 index 00000000000..1fc7d5c67df --- /dev/null +++ b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/TARGET_WIO_BG96/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2024 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + PUBLIC + . +) + +target_sources(mbed-cellular + PRIVATE + ONBOARD_QUECTEL_BG96.cpp +) \ No newline at end of file diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.cpp similarity index 100% rename from targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.cpp diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.h similarity index 100% rename from targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/TARGET_WIO_BG96/ONBOARD_QUECTEL_BG96.h diff --git a/connectivity/drivers/cellular/QUECTEL/BG96/mbed_lib.json b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/BG96/mbed_lib.json rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_BG96/mbed_lib.json diff --git a/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/CMakeLists.txt similarity index 67% rename from connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/CMakeLists.txt index 4c92c6a690f..c6d436a92c7 100644 --- a/connectivity/drivers/cellular/QUECTEL/EC2X/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/CMakeLists.txt @@ -10,3 +10,7 @@ target_sources(mbed-cellular PRIVATE QUECTEL_EC2X.cpp ) + +if("MTS_DRAGONFLY_L496VG" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MTS_DRAGONFLY_L496VG) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/QUECTEL/EC2X/QUECTEL_EC2X.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/QUECTEL_EC2X.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/EC2X/QUECTEL_EC2X.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/QUECTEL_EC2X.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/EC2X/QUECTEL_EC2X.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/QUECTEL_EC2X.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/EC2X/QUECTEL_EC2X.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/QUECTEL_EC2X.h diff --git a/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/TARGET_MTS_DRAGONFLY_L496VG/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/TARGET_MTS_DRAGONFLY_L496VG/CMakeLists.txt new file mode 100644 index 00000000000..8560c14e262 --- /dev/null +++ b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/TARGET_MTS_DRAGONFLY_L496VG/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2024 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + PUBLIC + . +) + +target_sources(mbed-cellular + PRIVATE + ONBOARD_QUECTEL_EG25.cpp +) \ No newline at end of file diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.cpp similarity index 95% rename from targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.cpp index 2f34b34e2a7..7e965ddccdc 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.cpp +++ b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.cpp @@ -127,11 +127,11 @@ void ONBOARD_QUECTEL_EG25::onboard_modem_power_up() { // NET_STATUS = input. InterruptIn make LS LED follow. // LS_LED = output. Follow NET_STATUS. - net_status->rise(callback(this,&ONBOARD_QUECTEL_EG25::link_status)); - net_status->fall(callback(this,&ONBOARD_QUECTEL_EG25::link_status)); + net_status->rise(callback(this, &ONBOARD_QUECTEL_EG25::link_status)); + net_status->fall(callback(this, &ONBOARD_QUECTEL_EG25::link_status)); // Make sure the radio is initialized so it can be powered on. - if (!initialized){ + if (!initialized) { onboard_modem_init(); } @@ -152,7 +152,7 @@ void ONBOARD_QUECTEL_EG25::onboard_modem_power_up() do { thread_sleep_for(1000); radio_off = gpio_read(&status); - if(!timeout--){ + if (!timeout--) { press_power_button(550000); timeout = 10; } @@ -186,7 +186,7 @@ void ONBOARD_QUECTEL_EG25::onboard_modem_power_down() } // Make sure the I/O are properly initialized. - if (!initialized){ + if (!initialized) { onboard_modem_init(); } @@ -202,12 +202,10 @@ void ONBOARD_QUECTEL_EG25::onboard_modem_power_down() if (radio_off) { break; - } - else { + } else { onboard_modem_reset(); } - } - while (!radio_off); + } while (!radio_off); } void ONBOARD_QUECTEL_EG25::onboard_modem_reset() diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.h similarity index 96% rename from targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.h index 7084bb9fdd2..a1557dd3e40 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.h +++ b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.h @@ -33,8 +33,8 @@ class ONBOARD_QUECTEL_EG25 : public QUECTEL_EC2X { private: uint8_t initialized; - DigitalOut* ls; - InterruptIn* net_status; + DigitalOut *ls; + InterruptIn *net_status; void link_status(); void press_power_button(int time_ms); void onboard_modem_init(); diff --git a/connectivity/drivers/cellular/QUECTEL/EC2X/mbed_lib.json b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/EC2X/mbed_lib.json rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_EC2X/mbed_lib.json diff --git a/connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/CMakeLists.txt similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/M26/CMakeLists.txt rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/CMakeLists.txt diff --git a/connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26.h diff --git a/connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularContext.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularContext.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularContext.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularContext.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularContext.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularContext.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularContext.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularContext.h diff --git a/connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularInformation.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularInformation.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularInformation.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularInformation.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularInformation.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularInformation.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularInformation.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularInformation.h diff --git a/connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularStack.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularStack.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularStack.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularStack.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularStack.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularStack.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/M26/QUECTEL_M26_CellularStack.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/QUECTEL_M26_CellularStack.h diff --git a/connectivity/drivers/cellular/QUECTEL/M26/mbed_lib.json b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/M26/mbed_lib.json rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_M26/mbed_lib.json diff --git a/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/CMakeLists.txt similarity index 75% rename from connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/CMakeLists.txt index 5351df856dd..5513d8cf282 100644 --- a/connectivity/drivers/cellular/QUECTEL/UG96/CMakeLists.txt +++ b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/CMakeLists.txt @@ -11,3 +11,7 @@ target_sources(mbed-cellular QUECTEL_UG96.cpp QUECTEL_UG96_CellularContext.cpp ) + +if("TARGET_WIO_3G" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_WIO_3G) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/QUECTEL/UG96/QUECTEL_UG96.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/QUECTEL_UG96.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/UG96/QUECTEL_UG96.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/QUECTEL_UG96.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/UG96/QUECTEL_UG96.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/QUECTEL_UG96.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/UG96/QUECTEL_UG96.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/QUECTEL_UG96.h diff --git a/connectivity/drivers/cellular/QUECTEL/UG96/QUECTEL_UG96_CellularContext.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/QUECTEL_UG96_CellularContext.cpp similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/UG96/QUECTEL_UG96_CellularContext.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/QUECTEL_UG96_CellularContext.cpp diff --git a/connectivity/drivers/cellular/QUECTEL/UG96/QUECTEL_UG96_CellularContext.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/QUECTEL_UG96_CellularContext.h similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/UG96/QUECTEL_UG96_CellularContext.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/QUECTEL_UG96_CellularContext.h diff --git a/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/TARGET_WIO_3G/CMakeLists.txt b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/TARGET_WIO_3G/CMakeLists.txt new file mode 100644 index 00000000000..9b35c6b5556 --- /dev/null +++ b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/TARGET_WIO_3G/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2024 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + PUBLIC + . +) + +target_sources(mbed-cellular + PRIVATE + ONBOARD_QUECTEL_UG96.cpp +) \ No newline at end of file diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.cpp b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.cpp similarity index 100% rename from targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.cpp rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.cpp diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.h b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.h similarity index 100% rename from targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.h rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/TARGET_WIO_3G/ONBOARD_QUECTEL_UG96.h diff --git a/connectivity/drivers/cellular/QUECTEL/UG96/mbed_lib.json b/connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/QUECTEL/UG96/mbed_lib.json rename to connectivity/drivers/cellular/QUECTEL/COMPONENT_QUECTEL_UG96/mbed_lib.json diff --git a/connectivity/drivers/cellular/RiotMicro/CMakeLists.txt b/connectivity/drivers/cellular/RiotMicro/CMakeLists.txt index a76e816789d..dd805705a5a 100644 --- a/connectivity/drivers/cellular/RiotMicro/CMakeLists.txt +++ b/connectivity/drivers/cellular/RiotMicro/CMakeLists.txt @@ -1,4 +1,8 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(AT) +# Note that the RM1000 chip appears to be unbuyable and the RIOT_MICRO_MODULE target that used it was +# already removed from Mbed in Mbed 6.0.0. This would make it a candidate for removal. +if("COMPONENT_RIOTMICRO_RM1000=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(COMPONENT_RIOTMICRO_RM1000) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt b/connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/CMakeLists.txt similarity index 100% rename from connectivity/drivers/cellular/RiotMicro/AT/CMakeLists.txt rename to connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/CMakeLists.txt diff --git a/connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT.cpp b/connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT.cpp similarity index 100% rename from connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT.cpp rename to connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT.cpp diff --git a/connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT.h b/connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT.h similarity index 100% rename from connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT.h rename to connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT.h diff --git a/connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularContext.cpp b/connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularContext.cpp similarity index 100% rename from connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularContext.cpp rename to connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularContext.cpp diff --git a/connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularContext.h b/connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularContext.h similarity index 100% rename from connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularContext.h rename to connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularContext.h diff --git a/connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularNetwork.cpp b/connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularNetwork.cpp similarity index 100% rename from connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularNetwork.cpp rename to connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularNetwork.h b/connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularNetwork.h similarity index 100% rename from connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularNetwork.h rename to connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularNetwork.h diff --git a/connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularStack.cpp b/connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularStack.cpp similarity index 100% rename from connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularStack.cpp rename to connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularStack.cpp diff --git a/connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularStack.h b/connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularStack.h similarity index 100% rename from connectivity/drivers/cellular/RiotMicro/AT/RM1000_AT_CellularStack.h rename to connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/RM1000_AT_CellularStack.h diff --git a/connectivity/drivers/cellular/RiotMicro/AT/mbed_lib.json b/connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/RiotMicro/AT/mbed_lib.json rename to connectivity/drivers/cellular/RiotMicro/COMPONENT_RIOTMICRO_RM1000/mbed_lib.json diff --git a/connectivity/drivers/cellular/TELIT/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/CMakeLists.txt index 0950d12d0b0..c598831939e 100644 --- a/connectivity/drivers/cellular/TELIT/CMakeLists.txt +++ b/connectivity/drivers/cellular/TELIT/CMakeLists.txt @@ -1,6 +1,14 @@ # Copyright (c) 2020 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -add_subdirectory(HE910) -add_subdirectory(ME310) -add_subdirectory(ME910) +if("COMPONENT_TELIT_HE910=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(COMPONENT_TELIT_HE910) +endif() + +if("COMPONENT_TELIT_ME310=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(COMPONENT_TELIT_ME310) +endif() + +if("COMPONENT_TELIT_ME910=1" IN_LIST MBED_TARGET_DEFINITIONS) + add_subdirectory(COMPONENT_TELIT_ME910) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/CMakeLists.txt new file mode 100644 index 00000000000..b73c108aa6b --- /dev/null +++ b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (c) 2024 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + PUBLIC + . +) + +target_sources(mbed-cellular + PRIVATE + TELIT_HE910.cpp +) + +if("TARGET_MTS_DRAGONFLY_F411RE" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MTS_DRAGONFLY_F411RE) +endif() + +if("TARGET_MTS_DRAGONFLY_F413RH" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_MTS_DRAGONFLY_F413RH) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F411RE/CMakeLists.txt similarity index 62% rename from connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F411RE/CMakeLists.txt index 52182dbf2f2..a3cd02869ad 100644 --- a/connectivity/drivers/cellular/UBLOX/PPP/CMakeLists.txt +++ b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F411RE/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. +# Copyright (c) 2024 ARM Limited. All rights reserved. # SPDX-License-Identifier: Apache-2.0 target_include_directories(mbed-cellular @@ -8,5 +8,5 @@ target_include_directories(mbed-cellular target_sources(mbed-cellular PRIVATE - UBLOX_PPP.cpp -) + ONBOARD_TELIT_HE910.cpp +) \ No newline at end of file diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_MTS_DRAGONFLY_F411RE/ONBOARD_TELIT_HE910.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F411RE/ONBOARD_TELIT_HE910.cpp similarity index 100% rename from targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_MTS_DRAGONFLY_F411RE/ONBOARD_TELIT_HE910.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F411RE/ONBOARD_TELIT_HE910.cpp diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_MTS_DRAGONFLY_F411RE/ONBOARD_TELIT_HE910.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F411RE/ONBOARD_TELIT_HE910.h similarity index 100% rename from targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_MTS_DRAGONFLY_F411RE/ONBOARD_TELIT_HE910.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F411RE/ONBOARD_TELIT_HE910.h diff --git a/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F413RH/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F413RH/CMakeLists.txt new file mode 100644 index 00000000000..a3cd02869ad --- /dev/null +++ b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F413RH/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2024 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + PUBLIC + . +) + +target_sources(mbed-cellular + PRIVATE + ONBOARD_TELIT_HE910.cpp +) \ No newline at end of file diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp similarity index 98% rename from targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp index 7ffefc2d3e7..a346775a06e 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp +++ b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.cpp @@ -81,8 +81,7 @@ void ONBOARD_TELIT_HE910::power_up() // Do nothing if it's already powered. if (gpio_read(&radioOn)) { return; - } - else { + } else { // power it up. release_power_button(); } @@ -107,12 +106,11 @@ void ONBOARD_TELIT_HE910::power_down() // Do nothing if it's already off. if (!gpio_read(&radioOn)) { return; - } - else { + } else { // power down. press_power_button(); } - + // wait a max of 60s for 1.8v to go low. volatile int v1_8 = 1; uint8_t timeout = 60; diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.h similarity index 100% rename from targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TARGET_MTS_DRAGONFLY_F413RH/ONBOARD_TELIT_HE910.h diff --git a/connectivity/drivers/cellular/TELIT/HE910/TELIT_HE910.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TELIT_HE910.cpp similarity index 100% rename from connectivity/drivers/cellular/TELIT/HE910/TELIT_HE910.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TELIT_HE910.cpp diff --git a/connectivity/drivers/cellular/TELIT/HE910/TELIT_HE910.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TELIT_HE910.h similarity index 100% rename from connectivity/drivers/cellular/TELIT/HE910/TELIT_HE910.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/TELIT_HE910.h diff --git a/connectivity/drivers/cellular/TELIT/HE910/mbed_lib.json b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/TELIT/HE910/mbed_lib.json rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_HE910/mbed_lib.json diff --git a/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/CMakeLists.txt similarity index 78% rename from connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/CMakeLists.txt index 095086d442f..f28b7fb7b3c 100644 --- a/connectivity/drivers/cellular/TELIT/ME310/CMakeLists.txt +++ b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/CMakeLists.txt @@ -13,3 +13,7 @@ target_sources(mbed-cellular TELIT_ME310_CellularNetwork.cpp TELIT_ME310_CellularStack.cpp ) + +if("TARGET_EP_ATLAS" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_EP_ATLAS) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TARGET_EP_ATLAS/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TARGET_EP_ATLAS/CMakeLists.txt new file mode 100644 index 00000000000..564eda2844d --- /dev/null +++ b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TARGET_EP_ATLAS/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2024 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + PUBLIC + . +) + +target_sources(mbed-cellular + PRIVATE + ONBOARD_TELIT_ME310.cpp +) \ No newline at end of file diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.cpp similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.cpp diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.h diff --git a/connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310.cpp similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310.cpp diff --git a/connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310.h similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310.h diff --git a/connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularContext.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularContext.cpp similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularContext.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularContext.cpp diff --git a/connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularContext.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularContext.h similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularContext.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularContext.h diff --git a/connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularNetwork.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularNetwork.cpp similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularNetwork.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularNetwork.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularNetwork.h similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularNetwork.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularNetwork.h diff --git a/connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularStack.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularStack.cpp similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularStack.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularStack.cpp diff --git a/connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularStack.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularStack.h similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME310/TELIT_ME310_CellularStack.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/TELIT_ME310_CellularStack.h diff --git a/connectivity/drivers/cellular/TELIT/ME310/mbed_lib.json b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME310/mbed_lib.json rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME310/mbed_lib.json diff --git a/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/CMakeLists.txt similarity index 76% rename from connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/CMakeLists.txt index 437be9f7b3d..c7f3678e328 100644 --- a/connectivity/drivers/cellular/TELIT/ME910/CMakeLists.txt +++ b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/CMakeLists.txt @@ -12,3 +12,7 @@ target_sources(mbed-cellular TELIT_ME910_CellularContext.cpp TELIT_ME910_CellularNetwork.cpp ) + +if("TARGET_EP_AGORA" IN_LIST MBED_TARGET_LABELS) + add_subdirectory(TARGET_EP_AGORA) +endif() \ No newline at end of file diff --git a/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TARGET_EP_AGORA/CMakeLists.txt b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TARGET_EP_AGORA/CMakeLists.txt new file mode 100644 index 00000000000..2ca55298769 --- /dev/null +++ b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TARGET_EP_AGORA/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2024 ARM Limited. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +target_include_directories(mbed-cellular + PUBLIC + . +) + +target_sources(mbed-cellular + PRIVATE + ONBOARD_TELIT_ME910.cpp +) \ No newline at end of file diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_AGORA/ONBOARD_TELIT_ME910.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TARGET_EP_AGORA/ONBOARD_TELIT_ME910.cpp similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_AGORA/ONBOARD_TELIT_ME910.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TARGET_EP_AGORA/ONBOARD_TELIT_ME910.cpp diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_AGORA/ONBOARD_TELIT_ME910.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TARGET_EP_AGORA/ONBOARD_TELIT_ME910.h similarity index 100% rename from targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/TARGET_EP_AGORA/ONBOARD_TELIT_ME910.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TARGET_EP_AGORA/ONBOARD_TELIT_ME910.h diff --git a/connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910.cpp similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910.cpp diff --git a/connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910.h similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910.h diff --git a/connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910_CellularContext.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910_CellularContext.cpp similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910_CellularContext.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910_CellularContext.cpp diff --git a/connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910_CellularContext.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910_CellularContext.h similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910_CellularContext.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910_CellularContext.h diff --git a/connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910_CellularNetwork.cpp b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910_CellularNetwork.cpp similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910_CellularNetwork.cpp rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910_CellularNetwork.cpp diff --git a/connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910_CellularNetwork.h b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910_CellularNetwork.h similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME910/TELIT_ME910_CellularNetwork.h rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/TELIT_ME910_CellularNetwork.h diff --git a/connectivity/drivers/cellular/TELIT/ME910/mbed_lib.json b/connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/mbed_lib.json similarity index 100% rename from connectivity/drivers/cellular/TELIT/ME910/mbed_lib.json rename to connectivity/drivers/cellular/TELIT/COMPONENT_TELIT_ME910/mbed_lib.json diff --git a/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt deleted file mode 100644 index 44077b734d4..00000000000 --- a/connectivity/drivers/cellular/UBLOX/AT/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -target_include_directories(mbed-cellular - PUBLIC - . -) - -target_sources(mbed-cellular - PRIVATE - UBLOX_AT.cpp - UBLOX_AT_CellularContext.cpp - UBLOX_AT_CellularNetwork.cpp - UBLOX_AT_CellularStack.cpp -) diff --git a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT.cpp b/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT.cpp deleted file mode 100644 index afae597fd08..00000000000 --- a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT.cpp +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "UBLOX_AT.h" - -using namespace mbed; -using namespace events; - -#ifdef UBX_MDM_SARA_R41XM -static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = { - AT_CellularNetwork::RegistrationModeDisable,// C_EREG - AT_CellularNetwork::RegistrationModeLAC, // C_GREG - AT_CellularNetwork::RegistrationModeLAC, // C_REG - 0, // AT_CGSN_WITH_TYPE - 0, // AT_CGDATA - 0, // AT_CGAUTH - 1, // AT_CNMI - 1, // AT_CSMP - 1, // AT_CMGF - 0, // AT_CSDH - 1, // PROPERTY_IPV4_STACK - 0, // PROPERTY_IPV6_STACK - 0, // PROPERTY_IPV4V6_STACK - 0, // PROPERTY_NON_IP_PDP_TYPE - 1, // PROPERTY_AT_CGEREP - 1, // PROPERTY_AT_COPS_FALLBACK_AUTO - 7, // PROPERTY_SOCKET_COUNT - 1, // PROPERTY_IP_TCP - 1, // PROPERTY_IP_UDP - 0, // PROPERTY_AT_SEND_DELAY -}; -#elif defined(UBX_MDM_SARA_U2XX) || defined(UBX_MDM_SARA_G3XX) -static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = { - AT_CellularNetwork::RegistrationModeDisable,// C_EREG - AT_CellularNetwork::RegistrationModeLAC, // C_GREG - AT_CellularNetwork::RegistrationModeLAC, // C_REG -#ifdef UBX_MDM_SARA_G3XX - 0, // AT_CGSN_WITH_TYPE -#else - 1, // AT_CGSN_WITH_TYPE -#endif - 1, // AT_CGDATA - 0, // AT_CGAUTH - 1, // AT_CNMI - 1, // AT_CSMP - 1, // AT_CMGF - 1, // AT_CSDH - 1, // PROPERTY_IPV4_STACK - 0, // PROPERTY_IPV6_STACK - 0, // PROPERTY_IPV4V6_STACK - 0, // PROPERTY_NON_IP_PDP_TYPE - 1, // PROPERTY_AT_CGEREP - 1, // PROPERTY_AT_COPS_FALLBACK_AUTO - 7, // PROPERTY_SOCKET_COUNT - 1, // PROPERTY_IP_TCP - 1, // PROPERTY_IP_UDP - 0, // PROPERTY_AT_SEND_DELAY -}; -#else -static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = { - 0, // C_EREG - 0, // C_GREG - 0, // C_REG - 0, // AT_CGSN_WITH_TYPE - 0, // AT_CGDATA - 0, // AT_CGAUTH - 0, // AT_CNMI - 0, // AT_CSMP - 0, // AT_CMGF - 0, // AT_CSDH - 0, // PROPERTY_IPV4_STACK - 0, // PROPERTY_IPV6_STACK - 0, // PROPERTY_IPV4V6_STACK - 0, // PROPERTY_NON_IP_PDP_TYPE - 0, // PROPERTY_AT_CGEREP - 0, // PROPERTY_AT_COPS_FALLBACK_AUTO - 0, // PROPERTY_SOCKET_COUNT - 0, // PROPERTY_IP_TCP - 0, // PROPERTY_IP_UDP - 0, // PROPERTY_AT_SEND_DELAY -}; -#endif - -UBLOX_AT::UBLOX_AT(FileHandle *fh) : AT_CellularDevice(fh), ubx_context(0) -{ - set_cellular_properties(cellular_properties); -} - -AT_CellularNetwork *UBLOX_AT::open_network_impl(ATHandler &at) -{ - return new UBLOX_AT_CellularNetwork(at, *this); -} - -AT_CellularContext *UBLOX_AT::create_context_impl(ATHandler &at, const char *apn, bool cp_req, bool nonip_req) -{ - ubx_context = new UBLOX_AT_CellularContext(at, this, apn, cp_req, nonip_req); - return ubx_context; -} - -#if MBED_CONF_UBLOX_AT_PROVIDE_DEFAULT -#include "drivers/BufferedSerial.h" -CellularDevice *CellularDevice::get_default_instance() -{ - static BufferedSerial serial(MBED_CONF_UBLOX_AT_TX, MBED_CONF_UBLOX_AT_RX, MBED_CONF_UBLOX_AT_BAUDRATE); -#if defined (MBED_CONF_UBLOX_AT_RTS) && defined(MBED_CONF_UBLOX_AT_CTS) - tr_debug("UBLOX_AT flow control: RTS %d CTS %d", MBED_CONF_UBLOX_AT_RTS, MBED_CONF_UBLOX_AT_CTS); - serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_UBLOX_AT_RTS, MBED_CONF_UBLOX_AT_CTS); -#endif - static UBLOX_AT device(&serial); - return &device; -} -#endif - -nsapi_error_t UBLOX_AT::init() -{ - setup_at_handler(); - _at.lock(); - _at.flush(); - _at.at_cmd_discard("", ""); - -#if defined(UBX_MDM_SARA_U2XX) || defined(UBX_MDM_SARA_G3XX) - nsapi_error_t err = _at.at_cmd_discard("E0", ""); // echo off - - if (err == NSAPI_ERROR_OK) { - _at.at_cmd_discard("+CMEE", "=1"); // verbose responses - err = _at.at_cmd_discard("+CFUN", "=1"); // set full functionality - } -#elif defined(UBX_MDM_SARA_R41XM) - nsapi_error_t err = _at.at_cmd_discard("+CFUN", "=", "%d", 4); - - if (err == NSAPI_ERROR_OK) { - _at.at_cmd_discard("E0", ""); // echo off - _at.at_cmd_discard("+CMEE", "=1"); // verbose responses - config_authentication_parameters(); - err = _at.at_cmd_discard("+CFUN", "=1"); // set full functionality - } -#else - _at.unlock(); - return NSAPI_ERROR_UNSUPPORTED; -#endif - - return _at.unlock_return_error(); -} - -nsapi_error_t UBLOX_AT::config_authentication_parameters() -{ - char *config = NULL; - nsapi_error_t err; - const char *apn; - const char *uname; - const char *pwd; - CellularContext::AuthenticationType auth = CellularContext::NOAUTH; - char imsi[MAX_IMSI_LENGTH + 1]; - - if (ubx_context->get_apn() == NULL) { - err = get_imsi(imsi); - if (err == NSAPI_ERROR_OK) { - config = (char *)apnconfig(imsi); - } - ubx_context->get_next_credentials(&config); - } - - apn = ubx_context->get_apn(); - pwd = ubx_context->get_pwd(); - uname = ubx_context->get_uname(); - - if (*uname && *pwd) { - auth = ubx_context->get_auth(); - } - err = set_authentication_parameters(apn, uname, pwd, auth); - - return err; -} - -nsapi_error_t UBLOX_AT::set_authentication_parameters(const char *apn, - const char *username, - const char *password, - CellularContext::AuthenticationType auth) -{ - int modem_security = ubx_context->nsapi_security_to_modem_security(auth); - - nsapi_error_t err = _at.at_cmd_discard("+CGDCONT", "=", "%d%s%s", 1, "IP", apn); - - if (err == NSAPI_ERROR_OK) { -#ifdef UBX_MDM_SARA_R41XM - if (modem_security == CellularContext::CHAP) { - err = _at.at_cmd_discard("+UAUTHREQ", "=", "%d%d%s%s", 1, modem_security, password, username); - } else if (modem_security == CellularContext::NOAUTH) { - err = _at.at_cmd_discard("+UAUTHREQ", "=", "%d%d", 1, modem_security); - } else { - err = _at.at_cmd_discard("+UAUTHREQ", "=", "%d%d%s%s", 1, modem_security, username, password); - } -#else - err = _at.at_cmd_discard("+UAUTHREQ", "=", "%d%d%s%s", 1, modem_security, username, password); -#endif - } - - return err; -} - -nsapi_error_t UBLOX_AT::get_imsi(char *imsi) -{ - //Special case: Command put in cmd_chr to make a 1 liner - return _at.at_cmd_str("", "+CIMI", imsi, MAX_IMSI_LENGTH + 1); -} diff --git a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT.h b/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT.h deleted file mode 100644 index 050f78f048c..00000000000 --- a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef UBLOX_AT_H_ -#define UBLOX_AT_H_ - -#ifdef TARGET_FF_ARDUINO -#ifndef MBED_CONF_UBLOX_AT_TX -#define MBED_CONF_UBLOX_AT_TX D1 -#endif -#ifndef MBED_CONF_UBLOX_AT_RX -#define MBED_CONF_UBLOX_AT_RX D0 -#endif -#endif /* TARGET_FF_ARDUINO */ - -#include "APN_db.h" -#include "AT_CellularDevice.h" -#include "AT_CellularContext.h" -#include "UBLOX_AT_CellularNetwork.h" -#include "UBLOX_AT_CellularContext.h" - -namespace mbed { - -class UBLOX_AT : public AT_CellularDevice { -public: - UBLOX_AT(FileHandle *fh); - -protected: // AT_CellularDevice - virtual AT_CellularNetwork *open_network_impl(ATHandler &at); - virtual AT_CellularContext *create_context_impl(ATHandler &at, const char *apn, bool cp_req = false, bool nonip_req = false); -public: // NetworkInterface - void handle_urc(FileHandle *fh); - - virtual nsapi_error_t init(); - -private: - - UBLOX_AT_CellularContext *ubx_context; - - /** Length of IMSI buffer. - */ - static const int MAX_IMSI_LENGTH = 15; - - nsapi_error_t config_authentication_parameters(); - - nsapi_error_t set_authentication_parameters(const char *apn, const char *username, const char *password, CellularContext::AuthenticationType auth); - - /** Read IMSI of modem. - */ - nsapi_error_t get_imsi(char *imsi); -}; - -} // namespace mbed - -#endif // UBLOX_AT_H_ diff --git a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularContext.cpp b/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularContext.cpp deleted file mode 100644 index f5a7dadce1e..00000000000 --- a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularContext.cpp +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "UBLOX_AT_CellularContext.h" -#include "UBLOX_AT_CellularStack.h" -#include "APN_db.h" -#include "CellularLog.h" -#include "rtos/ThisThread.h" - -using namespace std::chrono_literals; - -namespace mbed { - -UBLOX_AT_CellularContext::UBLOX_AT_CellularContext(ATHandler &at, CellularDevice *device, const char *apn, bool cp_req, bool nonip_req) : - AT_CellularContext(at, device, apn, cp_req, nonip_req) -{ - // The authentication to use - _auth = NOAUTH; -} - -UBLOX_AT_CellularContext::~UBLOX_AT_CellularContext() -{ -} - -NetworkStack *UBLOX_AT_CellularContext::get_stack() -{ - if (_pdp_type == NON_IP_PDP_TYPE || _cp_in_use) { - tr_error("Requesting stack for NON-IP context! Should request control plane netif: get_cp_netif()"); - return NULL; - } - if (!_stack) { - _stack = new UBLOX_AT_CellularStack(_at, _cid, (nsapi_ip_stack_t)_pdp_type, *get_device()); - } - - return _stack; -} - -void UBLOX_AT_CellularContext::do_connect() -{ - _at.lock(); - _cb_data.error = NSAPI_ERROR_NO_CONNECTION; - - // Attempt to establish a connection -#ifndef UBX_MDM_SARA_R41XM - _cb_data.error = define_context(); -#elif UBX_MDM_SARA_R410M - _at.cmd_start_stop("+CGACT", "?"); - _at.resp_start("+CGACT:"); - _cid = _at.read_int(); - _at.skip_param(1); - _at.resp_stop(); - - _is_connected = true; - _is_context_active = true; - _is_context_activated = true; - _cb_data.error = NSAPI_ERROR_OK; -#elif UBX_MDM_SARA_R412M - CellularNetwork::RadioAccessTechnology rat = read_radio_technology(); - if (rat == CellularNetwork::RadioAccessTechnology::RAT_EGPRS) { - if (!_is_context_active) { - _at.set_at_timeout(150s); - _at.at_cmd_discard("+CGACT", "=", "%d%d", 1, 1); - - _at.cmd_start_stop("+CGACT", "?"); - _at.resp_start("+CGACT:"); - _at.skip_param(1); - _is_context_activated = _at.read_int(); - _at.resp_stop(); - _at.restore_at_timeout(); - if (_is_context_activated == true) { - _cid = 1; - _is_connected = true; - _is_context_active = true; - _cb_data.error = NSAPI_ERROR_OK; - } - } - } else if (rat == CellularNetwork::RadioAccessTechnology::RAT_CATM1 || rat == CellularNetwork::RadioAccessTechnology::RAT_NB1) { - _at.cmd_start_stop("+CGACT", "?"); - _at.resp_start("+CGACT:"); - _cid = _at.read_int(); - _at.skip_param(1); - _at.resp_stop(); - - _is_connected = true; - _is_context_active = true; - _is_context_activated = true; - _cb_data.error = NSAPI_ERROR_OK; - } -#endif - if (_cb_data.error != NSAPI_ERROR_OK) { - // If new PSD context was created and failed to activate, delete it - if (_new_context_set) { - disconnect_modem_stack(); - } - _connect_status = NSAPI_STATUS_DISCONNECTED; - } else { - _connect_status = NSAPI_STATUS_GLOBAL_UP; - } - _at.unlock(); - - if (_status_cb) { - _status_cb(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, _connect_status); - } -} -#ifndef UBX_MDM_SARA_R41XM -void UBLOX_AT_CellularContext::do_disconnect() -{ - disconnect_modem_stack(); - AT_CellularContext::do_disconnect(); -} -#endif - -#ifndef UBX_MDM_SARA_R41XM -nsapi_error_t UBLOX_AT_CellularContext::define_context() -{ - bool success = false; - int active = 0; - char *config = NULL; - nsapi_error_t err = NSAPI_ERROR_NO_CONNECTION; - char imsi[MAX_IMSI_LENGTH + 1]; - - // do check for stack to validate that we have support for stack - _stack = get_stack(); - if (!_stack) { - return err; - } - - _at.lock(); - _at.cmd_start_stop("+UPSND", "=", "%d%d", PROFILE, 8); - _at.resp_start("+UPSND:"); - _at.skip_param(2); - active = _at.read_int(); - _at.resp_stop(); - _at.unlock(); - - if (active == 0) { - // If the caller hasn't entered an APN, try to find it - if (_apn == NULL) { - err = get_imsi(imsi); - if (err == NSAPI_ERROR_OK) { - config = (char *)apnconfig(imsi); - } - } - - // Attempt to connect - do { - get_next_credentials(&config); - if (_uname && _pwd) { - _auth = (*_uname && *_pwd) ? _authentication_type : NOAUTH; - } else { - _auth = NOAUTH; - } - success = activate_profile(_apn, _uname, _pwd, _auth); - } while (!success && config && *config); - } else { - // If the profile is already active, we're good - success = true; - } - - err = (_at.get_last_error() == NSAPI_ERROR_OK) ? NSAPI_ERROR_OK : NSAPI_ERROR_NO_CONNECTION; - - return err; -} - -bool UBLOX_AT_CellularContext::activate_profile(const char *apn, - const char *username, - const char *password, - AuthenticationType auth) -{ - bool activated = false; - bool success = false; - - // Set up the APN - if (apn) { - success = false; - if (_at.at_cmd_discard("+UPSD", "=", "%d%d%s", PROFILE, 1, apn) == NSAPI_ERROR_OK) { - success = true; - } - } - // Set up the UserName - if (success && username) { - success = false; - if (_at.at_cmd_discard("+UPSD", "=", "%d%d%s", PROFILE, 2, username) == NSAPI_ERROR_OK) { - success = true; - } - } - // Set up the Password - if (success && password) { - success = false; - if (_at.at_cmd_discard("+UPSD", "=", "%d%d%s", PROFILE, 3, password) == NSAPI_ERROR_OK) { - success = true; - } - } - - if (success) { - _at.at_cmd_discard("+UPSD", "=", "%d%d%s", PROFILE, 7, "0.0.0.0"); - - if (_at.at_cmd_discard("+UPSD", "=", "%d%d%d", PROFILE, 6, nsapi_security_to_modem_security(auth)) == NSAPI_ERROR_OK) { - // Activate, wait upto 30 seconds for the connection to be made - _at.set_at_timeout(30s); - - nsapi_error_t err = _at.at_cmd_discard("+UPSDA", "=", "%d%d", PROFILE, 3); - - _at.restore_at_timeout(); - - if (err == NSAPI_ERROR_OK) { - auto end_time = rtos::Kernel::Clock::now() + 3min; - do { - _at.lock(); - _at.cmd_start_stop("+UPSND", "=", "%d%d", PROFILE, 8); - _at.resp_start("+UPSND:"); - _at.skip_param(2); - _at.read_int() ? activated = true : activated = false; - _at.resp_stop(); - _at.unlock(); - - if (activated) { //If context is activated, exit while loop and return status - break; - } - rtos::ThisThread::sleep_for(5s); //Wait for 5 seconds and then try again - } while (rtos::Kernel::Clock::now() < end_time); - } - } - } - - return activated; -} -#endif - -// Convert nsapi_security_t to the modem security numbers -int UBLOX_AT_CellularContext::nsapi_security_to_modem_security(AuthenticationType nsapi_security) -{ - int modem_security = 3; - - switch (nsapi_security) { - case NOAUTH: - modem_security = 0; - break; - case PAP: - modem_security = 1; - break; - case CHAP: - modem_security = 2; - break; -#ifndef UBX_MDM_SARA_R41XM - case AUTOMATIC: - modem_security = 3; - break; - default: - modem_security = 3; - break; -#else - default: - modem_security = 0; - break; -#endif - } - - return modem_security; -} - -// Disconnect the on board IP stack of the modem. -bool UBLOX_AT_CellularContext::disconnect_modem_stack() -{ - SocketAddress addr; - if (get_ip_address(&addr) == NSAPI_ERROR_OK) { - if (_at.at_cmd_discard("+UPSDA", "=", "%d%d", PROFILE, 4) == NSAPI_ERROR_OK) { - return true; - } - } - - return false; -} - -nsapi_error_t UBLOX_AT_CellularContext::get_imsi(char *imsi) -{ - _at.lock(); - _at.cmd_start_stop("+CIMI", ""); - _at.resp_start(); - _at.read_string(imsi, MAX_IMSI_LENGTH + 1); - _at.resp_stop(); - - return _at.unlock_return_error(); -} - -// Get the next set of credentials, based on IMSI. -void UBLOX_AT_CellularContext::get_next_credentials(char **config) -{ - if (*config) { - _apn = _APN_GET(*config); - _uname = _APN_GET(*config); - _pwd = _APN_GET(*config); - } -} - -nsapi_error_t UBLOX_AT_CellularContext::get_gateway(SocketAddress *addr) -{ - return get_ip_address(addr); -} - -const char *UBLOX_AT_CellularContext::get_apn() -{ - return _apn; -} - -const char *UBLOX_AT_CellularContext::get_uname() -{ - return _uname; -} - -const char *UBLOX_AT_CellularContext::get_pwd() -{ - return _pwd; -} - -CellularContext::AuthenticationType UBLOX_AT_CellularContext::get_auth() -{ - return _authentication_type; -} - -#ifdef UBX_MDM_SARA_R412M -CellularNetwork::RadioAccessTechnology UBLOX_AT_CellularContext::read_radio_technology() -{ - int act; - CellularNetwork::RadioAccessTechnology rat; - - _at.at_cmd_int("+URAT", "?", act); - - switch (act) { - case 0: - rat = CellularNetwork::RadioAccessTechnology::RAT_GSM; - break; - case 1: - rat = CellularNetwork::RadioAccessTechnology::RAT_GSM; - break; - case 2: - rat = CellularNetwork::RadioAccessTechnology::RAT_UTRAN; - break; - case 7: - rat = CellularNetwork::RadioAccessTechnology::RAT_CATM1; - break; - case 8: - rat = CellularNetwork::RadioAccessTechnology::RAT_NB1; - break; - case 9: - rat = CellularNetwork::RadioAccessTechnology::RAT_EGPRS; - break; - default: - rat = CellularNetwork::RadioAccessTechnology::RAT_UNKNOWN; - break; - } - - return rat; -} -#endif // #ifdef UBX_MDM_SARA_R412M - -} /* namespace mbed */ diff --git a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularContext.h b/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularContext.h deleted file mode 100644 index 23d1131559e..00000000000 --- a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularContext.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef UBLOX_AT_CELLULARCONTEXT_H_ -#define UBLOX_AT_CELLULARCONTEXT_H_ - -#include "AT_CellularContext.h" -#include "UBLOX_AT_CellularNetwork.h" - -namespace mbed { - -class UBLOX_AT_CellularContext: public AT_CellularContext { -public: - UBLOX_AT_CellularContext(ATHandler &at, CellularDevice *device, const char *apn, bool cp_req = false, bool nonip_req = false); - virtual ~UBLOX_AT_CellularContext(); - - virtual void do_connect(); -#ifndef UBX_MDM_SARA_R41XM - virtual void do_disconnect(); -#endif - virtual nsapi_error_t get_gateway(SocketAddress *addr); - - const char *get_apn(void); - const char *get_uname(void); - const char *get_pwd(void); - CellularContext::AuthenticationType get_auth(void); - - /** Convert nsapi_security_t to the modem security numbers. - * - * @param nsapi_security Security protocol. - * @return Modem security numbers. - */ - int nsapi_security_to_modem_security(AuthenticationType nsapi_security); - - /** Get the next set of credentials from the database. - */ - void get_next_credentials(char **config); -#ifdef UBX_MDM_SARA_R412M - CellularNetwork::RadioAccessTechnology read_radio_technology(void); -#endif -protected: - virtual NetworkStack *get_stack(); - - /** Connect the on board IP stack of the modem. - * - * @return True if successful, otherwise false. - */ -#ifndef UBX_MDM_SARA_R41XM - nsapi_error_t define_context(); -#endif - -private: - - /** Length of IMSI buffer. - */ - static const int MAX_IMSI_LENGTH = 15; - - /** The type of authentication to use. - */ - AuthenticationType _auth; - - /** Activate one of the on-board modem's connection profiles. - * - * @param apn The APN to use. - * @param username The user name to use. - * @param password The password to use. - * @param auth The authentication method to use - * (NOAUTH, PAP, - * CHAP or AUTOMATIC). - * @return True if successful, otherwise false. - */ -#ifndef UBX_MDM_SARA_R41XM - bool activate_profile(const char *apn, const char *username, const char *password, AuthenticationType auth); -#endif - - /** Disconnect the on board IP stack of the modem. - * - * @return True if successful, otherwise false. - */ - bool disconnect_modem_stack(); - - /** Read IMSI of modem. - */ - nsapi_error_t get_imsi(char *imsi); -}; - -} /* namespace mbed */ - -#endif // UBLOX_AT_CELLULARCONTEXT_H_ diff --git a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularNetwork.cpp b/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularNetwork.cpp deleted file mode 100644 index aceaf242017..00000000000 --- a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularNetwork.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "UBLOX_AT_CellularNetwork.h" -#include "rtos/ThisThread.h" - -using namespace std::chrono_literals; -using namespace mbed; - -UBLOX_AT_CellularNetwork::UBLOX_AT_CellularNetwork(ATHandler &atHandler, AT_CellularDevice &device) : AT_CellularNetwork(atHandler, device) -{ - _op_act = RAT_UNKNOWN; -} - -UBLOX_AT_CellularNetwork::~UBLOX_AT_CellularNetwork() -{ - if (_connection_status_cb) { - _connection_status_cb(NSAPI_EVENT_CONNECTION_STATUS_CHANGE, NSAPI_ERROR_CONNECTION_LOST); - } -} - -nsapi_error_t UBLOX_AT_CellularNetwork::set_access_technology_impl(RadioAccessTechnology opRat) -{ - nsapi_error_t ret = NSAPI_ERROR_OK; - CellularNetwork::AttachStatus status; - - get_attach(status); - if (status == Attached) { - tr_debug("RAT should only be set in detached state"); - return NSAPI_ERROR_UNSUPPORTED; - } - - _at.lock(); - switch (opRat) { - case RAT_EGPRS: -#if defined (UBX_MDM_SARA_R412M) - _at.at_cmd_discard("+URAT", "=", "%d%d", 9, 8); - break; -#endif -#if defined(UBX_MDM_SARA_U201) - case RAT_GSM: - _at.at_cmd_discard("+URAT", "=", "%d%d", 0, 0); - break; - case RAT_UTRAN: - case RAT_HSDPA: - case RAT_HSUPA: - case RAT_HSDPA_HSUPA: - _at.at_cmd_discard("+URAT", "=", "%d%d", 2, 2); - break; -#elif defined(UBX_MDM_SARA_R41XM) - case RAT_CATM1: - _at.at_cmd_discard("+URAT", "=", "%d%d", 7, 8); - break; - case RAT_NB1: - _at.at_cmd_discard("+URAT", "=", "%d%d", 8, 7); - break; -#endif - default: - _op_act = RAT_UNKNOWN; - ret = NSAPI_ERROR_UNSUPPORTED; - break; - } - _at.unlock(); - ubx_reboot(); - - return (ret); -} - -nsapi_error_t UBLOX_AT_CellularNetwork::ubx_reboot() -{ - _at.lock(); - _at.at_cmd_discard("+CFUN", "=15"); - - nsapi_error_t err = NSAPI_ERROR_OK; - Timer t1; - t1.start(); - while (!(t1.elapsed_time() >= 30s)) { - err = _at.at_cmd_discard("E0", ""); - if (err == NSAPI_ERROR_OK) { - break; - } else { - //Don't clear err here so that we get some error in case of failure - _at.clear_error(); - rtos::ThisThread::sleep_for(1s); - } - } - t1.stop(); - _at.unlock(); - return err; -} diff --git a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularNetwork.h b/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularNetwork.h deleted file mode 100644 index ce7d67a6c6a..00000000000 --- a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularNetwork.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef UBLOX_AT_CELLULAR_NETWORK_H_ -#define UBLOX_AT_CELLULAR_NETWORK_H_ - -#include "CellularLog.h" -#include "drivers/Timer.h" -#include "mbed_wait_api.h" -#include "AT_CellularNetwork.h" -#include "AT_CellularContext.h" - -namespace mbed { - -class UBLOX_AT_CellularNetwork : public AT_CellularNetwork { -public: - UBLOX_AT_CellularNetwork(ATHandler &atHandler, AT_CellularDevice &device); - virtual ~UBLOX_AT_CellularNetwork(); - - nsapi_error_t ubx_reboot(); - -protected: - virtual nsapi_error_t set_access_technology_impl(RadioAccessTechnology opRat); -}; - -} // namespace mbed - -#endif // UBLOX_AT_CELLULAR_NETWORK_H_ diff --git a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularStack.cpp b/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularStack.cpp deleted file mode 100644 index 5056a517e27..00000000000 --- a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularStack.cpp +++ /dev/null @@ -1,480 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "UBLOX_AT_CellularStack.h" -#include "rtos/ThisThread.h" - -using namespace mbed; -using namespace mbed_cellular_util; -using namespace std::chrono_literals; - -constexpr seconds UBLOX_AT_CellularStack::SOCKET_TIMEOUT; - -UBLOX_AT_CellularStack::UBLOX_AT_CellularStack(ATHandler &atHandler, int cid, nsapi_ip_stack_t stack_type, AT_CellularDevice &device) : - AT_CellularStack(atHandler, cid, stack_type, device) -{ - // URC handlers for sockets - _at.set_urc_handler("+UUSORD:", callback(this, &UBLOX_AT_CellularStack::UUSORD_URC)); - _at.set_urc_handler("+UUSORF:", callback(this, &UBLOX_AT_CellularStack::UUSORF_URC)); - _at.set_urc_handler("+UUSOCL:", callback(this, &UBLOX_AT_CellularStack::UUSOCL_URC)); - _at.set_urc_handler("+UUPSDD:", callback(this, &UBLOX_AT_CellularStack::UUPSDD_URC)); -} - -UBLOX_AT_CellularStack::~UBLOX_AT_CellularStack() -{ -} - -nsapi_error_t UBLOX_AT_CellularStack::socket_listen(nsapi_socket_t handle, int backlog) -{ - return NSAPI_ERROR_UNSUPPORTED; -} - -nsapi_error_t UBLOX_AT_CellularStack::socket_accept(void *server, void **socket, SocketAddress *addr) -{ - return NSAPI_ERROR_UNSUPPORTED; -} - -// Callback for Socket Read URC. -void UBLOX_AT_CellularStack::UUSORD_URC() -{ - int a, b; - CellularSocket *socket; - - a = _at.read_int(); - b = _at.read_int(); - - socket = find_socket(a); - if (socket != NULL) { - socket->pending_bytes = b; - // No debug prints here as they can affect timing - // and cause data loss in BufferedSerial - if (socket->_cb != NULL) { - socket->_cb(socket->_data); - } - } -} - -// Callback for Socket Read From URC. -void UBLOX_AT_CellularStack::UUSORF_URC() -{ - int a, b; - CellularSocket *socket; - - a = _at.read_int(); - b = _at.read_int(); - - socket = find_socket(a); - if (socket != NULL) { - socket->pending_bytes = b; - // No debug prints here as they can affect timing - // and cause data loss in BufferedSerial - if (socket->_cb != NULL) { - socket->_cb(socket->_data); - } - } -} - -// Callback for Socket Close URC. -void UBLOX_AT_CellularStack::UUSOCL_URC() -{ - int a; - CellularSocket *socket; - - a = _at.read_int(); - socket = find_socket(a); - clear_socket(socket); -} - -// Callback for UUPSDD. -void UBLOX_AT_CellularStack::UUPSDD_URC() -{ - int a; - CellularSocket *socket; - - a = _at.read_int(); - socket = find_socket(a); - clear_socket(socket); -} - -nsapi_error_t UBLOX_AT_CellularStack::create_socket_impl(CellularSocket *socket) -{ - int sock_id = SOCKET_UNUSED; - - nsapi_error_t err = NSAPI_ERROR_OK; - if (socket->proto == NSAPI_UDP) { - err = _at.at_cmd_int("+USOCR", "=17", sock_id); - } else if (socket->proto == NSAPI_TCP) { - err = _at.at_cmd_int("+USOCR", "=6", sock_id); - } // Unsupported protocol is checked in socket_open() - - if ((err != NSAPI_ERROR_OK) || (sock_id == -1)) { - return NSAPI_ERROR_NO_SOCKET; - } - - // Check for duplicate socket id delivered by modem - for (int i = 0; i < _device.get_property(AT_CellularDevice::PROPERTY_SOCKET_COUNT); i++) { - CellularSocket *sock = _socket[i]; - if (sock && sock != socket && sock->id == sock_id) { - return NSAPI_ERROR_NO_SOCKET; - } - } - - socket->started = true; - socket->id = sock_id; - - return err; -} - -nsapi_error_t UBLOX_AT_CellularStack::socket_connect(nsapi_socket_t handle, const SocketAddress &addr) -{ - CellularSocket *socket = (CellularSocket *)handle; - - if (socket) { - if (socket->id == SOCKET_UNUSED) { - nsapi_error_t err = create_socket_impl(socket); - if (err != NSAPI_ERROR_OK) { - return err; - } - } - } else { - return NSAPI_ERROR_DEVICE_ERROR; - } - - nsapi_error_t err = _at.at_cmd_discard("+USOCO", "=", "%d%s%d", socket->id, addr.get_ip_address(), addr.get_port()); - - if (err == NSAPI_ERROR_OK) { - socket->remoteAddress = addr; - socket->connected = true; - return NSAPI_ERROR_OK; - } - - return NSAPI_ERROR_NO_CONNECTION; -} - -nsapi_size_or_error_t UBLOX_AT_CellularStack::socket_sendto_impl(CellularSocket *socket, const SocketAddress &address, - const void *data, nsapi_size_t size) -{ - MBED_ASSERT(socket->id != -1); - - int sent_len = 0; - - if (socket->proto == NSAPI_UDP) { - if (size > UBLOX_MAX_PACKET_SIZE) { - return NSAPI_ERROR_PARAMETER; - } - _at.cmd_start_stop("+USOST", "=", "%d%s%d%d", socket->id, address.get_ip_address(), address.get_port(), size); - _at.resp_start("@", true); - rtos::ThisThread::sleep_for(50ms); - - _at.write_bytes((uint8_t *)data, size); - - _at.resp_start("+USOST:"); - _at.skip_param(); // skip socket id - sent_len = _at.read_int(); - _at.resp_stop(); - - if ((_at.get_last_error() == NSAPI_ERROR_OK)) { - return sent_len; - } - } else if (socket->proto == NSAPI_TCP) { - bool success = true; - const char *buf = (const char *) data; - nsapi_size_t blk = UBLOX_MAX_PACKET_SIZE; - nsapi_size_t count = size; - - while ((count > 0) && success) { - if (count < blk) { - blk = count; - } - _at.cmd_start_stop("+USOWR", "=", "%d%d", socket->id, blk); - _at.resp_start("@", true); - rtos::ThisThread::sleep_for(50ms); - - _at.write_bytes((uint8_t *)buf, blk); - - _at.resp_start("+USOWR:"); - _at.skip_param(); // skip socket id - sent_len = _at.read_int(); - _at.resp_stop(); - - if ((sent_len >= (int) blk) && - (_at.get_last_error() == NSAPI_ERROR_OK)) { - } else { - success = false; - } - - buf += blk; - count -= blk; - } - - if (success && _at.get_last_error() == NSAPI_ERROR_OK) { - return size - count; - } - } - - return _at.get_last_error(); -} - -nsapi_size_or_error_t UBLOX_AT_CellularStack::socket_recvfrom_impl(CellularSocket *socket, SocketAddress *address, - void *buffer, nsapi_size_t size) -{ - MBED_ASSERT(socket->id != -1); - - nsapi_size_or_error_t nsapi_error_size = NSAPI_ERROR_DEVICE_ERROR; - bool success = true; - nsapi_size_t read_blk; - nsapi_size_t count = 0; - nsapi_size_t usorf_sz; - char ipAddress[NSAPI_IP_SIZE]; - uint8_t ch = 0; - int port = 0; - Timer timer; - - if (socket->pending_bytes == 0) { - _at.process_oob(); - if (socket->pending_bytes == 0) { - return NSAPI_ERROR_WOULD_BLOCK; - } - } - - timer.start(); - if (socket->proto == NSAPI_UDP) { - bool packet_received = false; - while (success && (size > 0 && !packet_received)) { - read_blk = UBLOX_MAX_PACKET_SIZE; - if (read_blk > size) { - read_blk = size; - } - if (socket->pending_bytes > 0) { - _at.cmd_start_stop("+USORF", "=", "%d%d", socket->id, read_blk); - - _at.resp_start("+USORF:"); - _at.skip_param(); // receiving socket id - _at.read_string(ipAddress, sizeof(ipAddress)); - port = _at.read_int(); - usorf_sz = _at.read_int(); - if (usorf_sz > size) { - usorf_sz = size; - } else { - packet_received = true; - } - _at.read_bytes(&ch, 1); - _at.read_bytes((uint8_t *)buffer + count, usorf_sz); - _at.resp_stop(); - - // Must use what +USORF returns here as it may be less or more than we asked for - if (usorf_sz > socket->pending_bytes) { - socket->pending_bytes = 0; - } else { - socket->pending_bytes -= usorf_sz; - } - - if (usorf_sz > 0) { - count += usorf_sz; - size -= usorf_sz; - } else { - // read() should not fail - success = false; - } - } else if (timer.elapsed_time() < SOCKET_TIMEOUT) { - // Wait for URCs - _at.process_oob(); - } else { - if (count == 0) { - // Timeout with nothing received - success = false; - } - break; - } - } - } else if (socket->proto == NSAPI_TCP) { - while (success && (size > 0)) { - read_blk = UBLOX_MAX_PACKET_SIZE; - if (read_blk > size) { - read_blk = size; - } - if (socket->pending_bytes > 0) { - _at.cmd_start_stop("+USORD", "=", "%d%d", socket->id, read_blk); - - _at.resp_start("+USORD:"); - _at.skip_param(); // receiving socket id - usorf_sz = _at.read_int(); - if (usorf_sz > size) { - usorf_sz = size; - } - _at.read_bytes(&ch, 1); - _at.read_bytes((uint8_t *)buffer + count, usorf_sz); - _at.resp_stop(); - - // Must use what +USORD returns here as it may be less or more than we asked for - if (usorf_sz > socket->pending_bytes) { - socket->pending_bytes = 0; - } else { - socket->pending_bytes -= usorf_sz; - } - - if (usorf_sz > 0) { - count += usorf_sz; - size -= usorf_sz; - } else { - success = false; - } - } else if (timer.elapsed_time() < SOCKET_TIMEOUT) { - // Wait for URCs - _at.process_oob(); - } else { - if (count == 0) { - // Timeout with nothing received - success = false; - } - break; - } - } - } - timer.stop(); - - socket->pending_bytes = 0; - if (!count || (_at.get_last_error() != NSAPI_ERROR_OK)) { - return NSAPI_ERROR_WOULD_BLOCK; - } else { - nsapi_error_size = count; - } - - if (success && socket->proto == NSAPI_UDP && address) { - address->set_ip_address(ipAddress); - address->get_ip_address(); - address->set_port(port); - } - - return nsapi_error_size; -} - -nsapi_error_t UBLOX_AT_CellularStack::socket_close_impl(int sock_id) -{ - return _at.at_cmd_discard("+USOCL", "=", "%d", sock_id); -} - -// Find or create a socket from the list. -UBLOX_AT_CellularStack::CellularSocket *UBLOX_AT_CellularStack::find_socket(int id) -{ - CellularSocket *socket = NULL; - - for (ptrdiff_t x = 0; (socket == NULL) && (x < _device.get_property(AT_CellularDevice::PROPERTY_SOCKET_COUNT)); x++) { - if (_socket) { - if (_socket[x]->id == id) { - socket = (_socket[x]); - } - } - } - - return socket; -} - - -// Clear out the storage for a socket -void UBLOX_AT_CellularStack::clear_socket(CellularSocket *socket) -{ - if (socket != NULL) { - socket->id = SOCKET_UNUSED; - socket->started = false; - socket->pending_bytes = 0; - socket->closed = true; - if (socket->_cb) { - socket->_cb(socket->_data); - } - } -} - -#ifndef UBX_MDM_SARA_R41XM -nsapi_error_t UBLOX_AT_CellularStack::get_ip_address(SocketAddress *address) -{ - if (!address) { - return NSAPI_ERROR_PARAMETER; - } - _at.lock(); - - bool ipv4 = false, ipv6 = false; - - _at.cmd_start_stop("+UPSND", "=", "%d%d", PROFILE, 0); - _at.resp_start("+UPSND:"); - - if (_at.info_resp()) { - _at.skip_param(2); - - if (_at.read_string(_ip, PDP_IPV6_SIZE) != -1) { - convert_ipv6(_ip); - address->set_ip_address(_ip); - - ipv4 = (address->get_ip_version() == NSAPI_IPv4); - ipv6 = (address->get_ip_version() == NSAPI_IPv6); - - // Try to look for second address ONLY if modem has support for dual stack(can handle both IPv4 and IPv6 simultaneously). - // Otherwise assumption is that second address is not reliable, even if network provides one. - if ((_device.get_property(AT_CellularDevice::PROPERTY_IPV4V6_PDP_TYPE) && (_at.read_string(_ip, PDP_IPV6_SIZE) != -1))) { - convert_ipv6(_ip); - address->set_ip_address(_ip); - ipv6 = (address->get_ip_version() == NSAPI_IPv6); - } - } - } - _at.resp_stop(); - _at.unlock(); - - if (ipv4 && ipv6) { - _stack_type = IPV4V6_STACK; - } else if (ipv4) { - _stack_type = IPV4_STACK; - } else if (ipv6) { - _stack_type = IPV6_STACK; - } - - return (ipv4 || ipv6) ? NSAPI_ERROR_OK : NSAPI_ERROR_NO_ADDRESS; -} -#endif - -nsapi_error_t UBLOX_AT_CellularStack::gethostbyname(const char *host, SocketAddress *address, nsapi_version_t version, const char *interface_name) -{ - char ipAddress[NSAPI_IP_SIZE]; - nsapi_error_t err = NSAPI_ERROR_DNS_FAILURE; - - _at.lock(); - if (address->set_ip_address(host)) { - err = NSAPI_ERROR_OK; - } else { -#ifdef UBX_MDM_SARA_R41XM - _at.set_at_timeout(70s); -#else - _at.set_at_timeout(120s); -#endif - // This interrogation can sometimes take longer than the usual 8 seconds - _at.cmd_start_stop("+UDNSRN", "=0,", "%s", host); - - _at.resp_start("+UDNSRN:"); - if (_at.info_resp()) { - _at.read_string(ipAddress, sizeof(ipAddress)); - - if (address->set_ip_address(ipAddress)) { - err = NSAPI_ERROR_OK; - } - } - _at.resp_stop(); - _at.restore_at_timeout(); - } - _at.unlock(); - - return err; -} diff --git a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularStack.h b/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularStack.h deleted file mode 100644 index d92734c981c..00000000000 --- a/connectivity/drivers/cellular/UBLOX/AT/UBLOX_AT_CellularStack.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2018, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef UBLOX_AT_CELLULARSTACK_H_ -#define UBLOX_AT_CELLULARSTACK_H_ - -#include - -#include "AT_CellularStack.h" -#include "CellularUtil.h" -#include "rtos/ThisThread.h" -#include "drivers/Timer.h" - -using namespace std::chrono; - -namespace mbed { - -class UBLOX_AT_CellularStack : public AT_CellularStack { -public: - UBLOX_AT_CellularStack(ATHandler &atHandler, int cid, nsapi_ip_stack_t stack_type, AT_CellularDevice &device); - virtual ~UBLOX_AT_CellularStack(); - -#ifndef UBX_MDM_SARA_R41XM - virtual nsapi_error_t get_ip_address(SocketAddress *address); -#endif - - virtual nsapi_error_t gethostbyname(const char *host, - SocketAddress *address, nsapi_version_t version = NSAPI_UNSPEC, const char *interface_name = NULL); - -protected: - virtual nsapi_error_t socket_listen(nsapi_socket_t handle, int backlog); - - virtual nsapi_error_t socket_accept(nsapi_socket_t server, - nsapi_socket_t *handle, SocketAddress *address = 0); - - /** The profile to use (on board the modem). - */ -#define PROFILE 0 - - /** Socket "unused" value. - */ - static const int SOCKET_UNUSED = -1; - - /** Socket timeout value in milliseconds. - * Note: the sockets layer above will retry the - * call to the functions here when they return NSAPI_ERROR_WOULD_BLOCK - * and the user has set a larger timeout or full blocking. - */ - static constexpr seconds SOCKET_TIMEOUT = 1s; - - /** The maximum number of bytes in a packet that can be write/read from - * the AT interface in one go. - */ - static const int UBLOX_MAX_PACKET_SIZE = 1024; - - virtual nsapi_error_t create_socket_impl(CellularSocket *socket); - - virtual nsapi_error_t socket_connect(nsapi_socket_t handle, const SocketAddress &address); - - virtual nsapi_size_or_error_t socket_sendto_impl(CellularSocket *socket, const SocketAddress &address, - const void *data, nsapi_size_t size); - - virtual nsapi_size_or_error_t socket_recvfrom_impl(CellularSocket *socket, SocketAddress *address, - void *buffer, nsapi_size_t size); - - virtual nsapi_error_t socket_close_impl(int sock_id); - -private: - // URC handlers - void UUSORD_URC(); - void UUSORF_URC(); - void UUSOCL_URC(); - void UUPSDD_URC(); - - /** Find a socket from the list. - * - * @param id Socket ID. - * @return Socket if True, otherwise NULL. - */ - CellularSocket *find_socket(int id = SOCKET_UNUSED); - - /** Clear out the storage for a socket. - * - * @param id Cellular Socket. - * @return None - */ - void clear_socket(CellularSocket *socket); -}; -} // namespace mbed -#endif /* UBLOX_AT_CELLULARSTACK_H_ */ diff --git a/connectivity/drivers/cellular/UBLOX/AT/mbed_lib.json b/connectivity/drivers/cellular/UBLOX/AT/mbed_lib.json deleted file mode 100644 index 4db0d2f28e5..00000000000 --- a/connectivity/drivers/cellular/UBLOX/AT/mbed_lib.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "UBLOX_AT", - "config": { - "tx": { - "help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.", - "value": null - }, - "rx": { - "help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.", - "value": null - }, - "rts": { - "help": "RTS pin for serial connection", - "value": null - }, - "cts": { - "help": "CTS pin for serial connection", - "value": null - }, - "baudrate" : { - "help": "Serial connection baud rate", - "value": 115200 - }, - "provide-default": { - "help": "Provide as default CellularDevice [true/false]", - "value": false - } - } -} diff --git a/connectivity/drivers/cellular/UBLOX/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/CMakeLists.txt deleted file mode 100644 index 12753476255..00000000000 --- a/connectivity/drivers/cellular/UBLOX/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -add_subdirectory(AT) -add_subdirectory(N2XX) -add_subdirectory(PPP) diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt b/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt deleted file mode 100644 index e5957671c4b..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (c) 2020 ARM Limited. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -target_include_directories(mbed-cellular - PUBLIC - . -) - -target_sources(mbed-cellular - PRIVATE - UBLOX_N2XX.cpp - UBLOX_N2XX_CellularContext.cpp - UBLOX_N2XX_CellularNetwork.cpp - UBLOX_N2XX_CellularSMS.cpp - UBLOX_N2XX_CellularStack.cpp -) diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX.cpp b/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX.cpp deleted file mode 100644 index 24b4be82fe0..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (c) 2019, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "UBLOX_N2XX.h" - -using namespace mbed; -using namespace events; - -static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = { - AT_CellularNetwork::RegistrationModeLAC, // C_EREG - AT_CellularNetwork::RegistrationModeDisable, // C_GREG - AT_CellularNetwork::RegistrationModeDisable, // C_REG - 1, // AT_CGSN_WITH_TYPE - 0, // AT_CGDATA - 0, // AT_CGAUTH - 0, // AT_CNMI - 0, // AT_CSMP - 0, // AT_CMGF - 0, // AT_CSDH - 1, // PROPERTY_IPV4_STACK - 0, // PROPERTY_IPV6_STACK - 0, // PROPERTY_IPV4V6_STACK - 1, // PROPERTY_NON_IP_PDP_TYPE - 0, // PROPERTY_AT_CGEREP - 1, // PROPERTY_AT_COPS_FALLBACK_AUTO - 7, // PROPERTY_SOCKET_COUNT - 0, // PROPERTY_IP_TCP - 1, // PROPERTY_IP_UDP - 0, // PROPERTY_AT_SEND_DELAY -}; - -UBLOX_N2XX::UBLOX_N2XX(FileHandle *fh): AT_CellularDevice(fh) -{ - set_cellular_properties(cellular_properties); - memset(simstr, 0, sizeof(simstr)); -} - -void UBLOX_N2XX::set_at_urcs_impl() -{ - _at.set_urc_handler("+NPIN:", mbed::Callback(this, &UBLOX_N2XX::NPIN_URC)); -} - -UBLOX_N2XX::~UBLOX_N2XX() -{ - _at.set_urc_handler("+NPIN:", nullptr); -} - -// Callback for Sim Pin. -void UBLOX_N2XX::NPIN_URC() -{ - _at.read_string(simstr, sizeof(simstr)); -} - -AT_CellularNetwork *UBLOX_N2XX::open_network_impl(ATHandler &at) -{ - return new UBLOX_N2XX_CellularNetwork(at, *this); -} - -AT_CellularContext *UBLOX_N2XX::create_context_impl(ATHandler &at, const char *apn, bool cp_req, bool nonip_req) -{ - return new UBLOX_N2XX_CellularContext(at, this, apn, cp_req, nonip_req); -} - -#if MBED_CONF_CELLULAR_USE_SMS -AT_CellularSMS *UBLOX_N2XX::open_sms_impl(ATHandler &at) -{ - return new UBLOX_N2XX_CellularSMS(at, *this); -} -#endif // MBED_CONF_CELLULAR_USE_SMS - -nsapi_error_t UBLOX_N2XX::init() -{ - setup_at_handler(); - - _at.lock(); - _at.flush(); - _at.at_cmd_discard("", ""); - - _at.at_cmd_discard("+CMEE", "=1"); // verbose responses - -#ifdef MBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN - set_pin(MBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN); -#endif - return _at.unlock_return_error(); -} - -nsapi_error_t UBLOX_N2XX::get_sim_state(SimState &state) -{ - nsapi_error_t error = NSAPI_ERROR_DEVICE_ERROR; - - _at.lock(); - _at.flush(); - //Special case: Command put in cmd_chr to make a 1 liner - error = _at.at_cmd_str("", "+CFUN=1", simstr, sizeof(simstr)); - _at.unlock(); - - int len = strlen(simstr); - if (len > 0 || error == NSAPI_ERROR_OK) { - if (error == NSAPI_ERROR_OK) { - state = SimStateReady; - } else if (len >= 6 && memcmp(simstr, "ENTER PIN", 9) == 0) { - state = SimStatePinNeeded; - } else { - simstr[len] = '\0'; - tr_error("Unknown SIM state %s", simstr); - state = SimStateUnknown; - } - error = NSAPI_ERROR_OK; - } else { - tr_warn("SIM not readable."); - state = SimStateUnknown; // SIM may not be ready yet or pin command may not be supported - } - -#if MBED_CONF_MBED_TRACE_ENABLE - switch (state) { - case SimStatePinNeeded: - tr_info("SIM PIN required"); - break; - case SimStatePukNeeded: - tr_error("SIM PUK required"); - break; - case SimStateUnknown: - tr_warn("SIM state unknown"); - break; - default: - tr_info("SIM is ready"); - break; - } -#endif - return error; -} - -nsapi_error_t UBLOX_N2XX::set_pin(const char *sim_pin) -{ - // if SIM is already in ready state then settings the PIN - // will return error so let's check the state before settings the pin. - SimState state; - if (get_sim_state(state) == NSAPI_ERROR_OK && state == SimStateReady) { - return NSAPI_ERROR_OK; - } - - if (sim_pin == NULL) { - return NSAPI_ERROR_PARAMETER; - } - - return _at.at_cmd_discard("+NPIN", "=", "%d%s", 0, sim_pin); -} - -#if MBED_CONF_UBLOX_N2XX_PROVIDE_DEFAULT -#include "drivers/BufferedSerial.h" -CellularDevice *CellularDevice::get_default_instance() -{ - static BufferedSerial serial(MBED_CONF_UBLOX_N2XX_TX, MBED_CONF_UBLOX_N2XX_RX, MBED_CONF_UBLOX_N2XX_BAUDRATE); -#if defined (MBED_CONF_UBLOX_N2XX_RTS) && defined(MBED_CONF_UBLOX_N2XX_CTS) - tr_debug("UBLOX_N2XX flow control: RTS %d CTS %d", MBED_CONF_UBLOX_N2XX_RTS, MBED_CONF_UBLOX_N2XX_CTS); - serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_UBLOX_N2XX_RTS, MBED_CONF_UBLOX_N2XX_CTS); -#endif - static UBLOX_N2XX device(&serial); - return &device; -} -#endif diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX.h b/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX.h deleted file mode 100644 index 0a4cadc144b..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2019, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef UBLOX_N2XX_H_ -#define UBLOX_N2XX_H_ - -#ifdef TARGET_FF_ARDUINO -#ifndef MBED_CONF_UBLOX_N2XX_TX -#define MBED_CONF_UBLOX_N2XX_TX D1 -#endif -#ifndef MBED_CONF_UBLOX_N2XX_RX -#define MBED_CONF_UBLOX_N2XX_RX D0 -#endif -#endif /* TARGET_FF_ARDUINO */ - -#include "CellularLog.h" -#include "AT_CellularDevice.h" -#include "AT_CellularNetwork.h" -#include "UBLOX_N2XX_CellularSMS.h" -#include "UBLOX_N2XX_CellularContext.h" -#include "UBLOX_N2XX_CellularNetwork.h" - -namespace mbed { - -class UBLOX_N2XX : public AT_CellularDevice { - -public: - - UBLOX_N2XX(FileHandle *fh); - virtual ~UBLOX_N2XX(); - - virtual nsapi_error_t init(); - virtual nsapi_error_t get_sim_state(SimState &state); - virtual nsapi_error_t set_pin(const char *sim_pin); - - -protected: // AT_CellularDevice - - virtual AT_CellularNetwork *open_network_impl(ATHandler &at); - virtual AT_CellularContext *create_context_impl(ATHandler &at, const char *apn, bool cp_req = false, bool nonip_req = false); -#if MBED_CONF_CELLULAR_USE_SMS - virtual AT_CellularSMS *open_sms_impl(ATHandler &at); -#endif // MBED_CONF_CELLULAR_USE_SMS - virtual void set_at_urcs_impl(); - -public: // NetworkInterface - - void handle_urc(FileHandle *fh); - -private: - - static const int MAX_SIM_RESPONSE_LENGTH = 25; - - // URC handlers - void NPIN_URC(); - - char simstr[MAX_SIM_RESPONSE_LENGTH]; -}; - -} // namespace mbed - -#endif // UBLOX_N2XX_H_ diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularContext.cpp b/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularContext.cpp deleted file mode 100644 index 47abe290781..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularContext.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2019, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "UBLOX_N2XX_CellularContext.h" -#include "UBLOX_N2XX_CellularStack.h" -#include "CellularLog.h" -#include "APN_db.h" - -namespace mbed { - -UBLOX_N2XX_CellularContext::UBLOX_N2XX_CellularContext(ATHandler &at, CellularDevice *device, const char *apn, bool cp_req, bool nonip_req): - AT_CellularContext(at, device, apn, cp_req, nonip_req) -{ -} - -UBLOX_N2XX_CellularContext::~UBLOX_N2XX_CellularContext() -{ -} - -#if !NSAPI_PPP_AVAILABLE -NetworkStack *UBLOX_N2XX_CellularContext::get_stack() -{ - if (_pdp_type == NON_IP_PDP_TYPE || _cp_in_use) { - tr_error("Requesting stack for NON-IP context! Should request control plane netif: get_cp_netif()"); - return NULL; - } - if (!_stack) { - _stack = new UBLOX_N2XX_CellularStack(_at, _cid, (nsapi_ip_stack_t)_pdp_type, *get_device()); - } - return _stack; -} -#endif - -const char *UBLOX_N2XX_CellularContext::get_nonip_context_type_str() -{ - return "NONIP"; -} - -} /* namespace mbed */ diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularContext.h b/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularContext.h deleted file mode 100644 index 057d413a73a..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularContext.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2019, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef UBLOX_N2XX_CELLULARCONTEXT_H_ -#define UBLOX_N2XX_CELLULARCONTEXT_H_ - -#include "AT_CellularContext.h" - -namespace mbed { - -class UBLOX_N2XX_CellularContext: public AT_CellularContext { - -public: - - UBLOX_N2XX_CellularContext(ATHandler &at, CellularDevice *device, const char *apn, bool cp_req = false, bool nonip_req = false); - virtual ~UBLOX_N2XX_CellularContext(); - -protected: - -#if !NSAPI_PPP_AVAILABLE - virtual NetworkStack *get_stack(); -#endif - - virtual const char *get_nonip_context_type_str(); -}; - -} /* namespace mbed */ - -#endif // UBLOX_N2XX_CELLULARCONTEXT_H_ diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularNetwork.cpp b/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularNetwork.cpp deleted file mode 100644 index 90dbbbd0c62..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularNetwork.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2019, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "UBLOX_N2XX_CellularNetwork.h" - -using namespace mbed; - -UBLOX_N2XX_CellularNetwork::UBLOX_N2XX_CellularNetwork(ATHandler &atHandler, AT_CellularDevice &device) : AT_CellularNetwork(atHandler, device) -{ -} - -nsapi_error_t UBLOX_N2XX_CellularNetwork::clear() -{ - nsapi_error_t err = AT_CellularNetwork::clear(); -#if MBED_CONF_CELLULAR_CONTROL_PLANE_OPT - if (!err) { -#ifdef MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN - (void) _at.at_cmd_discard("+CGDCONT", "=", "%d%s%s", 1, "NONIP", MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN); -#endif - (void) _at.at_cmd_discard("+CIPCA", "=", "%d%d", 3, 1); // EPS Attach without PDN connection - _at.lock(); - _at.cmd_start("AT+NCONFIG=\"AUTOCONNECT\",\"FALSE\""); // disable auto connect to IP context - _at.cmd_stop_read_resp(); - _at.unlock(); - } -#endif - return err; -} - -nsapi_error_t UBLOX_N2XX_CellularNetwork::set_ciot_optimization_config(CIoT_Supported_Opt supported_opt, - CIoT_Preferred_UE_Opt preferred_opt, - Callback network_support_cb) -{ - _ciotopt_network_support_cb = network_support_cb; - nsapi_error_t err = _at.at_cmd_discard("+CRTDCP", "=", "%d", 1); - return err; -} diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularNetwork.h b/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularNetwork.h deleted file mode 100644 index 112db976d5b..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularNetwork.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2019, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef UBLOX_N2XX_CELLULAR_NETWORK_H_ -#define UBLOX_N2XX_CELLULAR_NETWORK_H_ - -#include "AT_CellularNetwork.h" - -namespace mbed { - -class UBLOX_N2XX_CellularNetwork : public AT_CellularNetwork { -public: - UBLOX_N2XX_CellularNetwork(ATHandler &atHandler, AT_CellularDevice &device); - virtual nsapi_error_t clear(); - virtual nsapi_error_t set_ciot_optimization_config(CIoT_Supported_Opt supported_opt, - CIoT_Preferred_UE_Opt preferred_opt, - Callback network_support_cb); -}; - -} // namespace mbed - -#endif // UBLOX_N2XX_CELLULAR_NETWORK_H_ diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularSMS.cpp b/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularSMS.cpp deleted file mode 100644 index 19dba889fef..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularSMS.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2019, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#if MBED_CONF_CELLULAR_USE_SMS - -#include "UBLOX_N2XX_CellularSMS.h" - -using namespace mbed; - -UBLOX_N2XX_CellularSMS::UBLOX_N2XX_CellularSMS(ATHandler &atHandler, AT_CellularDevice &device) : AT_CellularSMS(atHandler, device) -{ -} - -UBLOX_N2XX_CellularSMS::~UBLOX_N2XX_CellularSMS() -{ -} - -nsapi_error_t UBLOX_N2XX_CellularSMS::set_cpms(const char *memr, const char *memw, const char *mems) -{ - return NSAPI_ERROR_UNSUPPORTED; -} - -nsapi_size_or_error_t UBLOX_N2XX_CellularSMS::set_cscs(const char *chr_set) -{ - return NSAPI_ERROR_UNSUPPORTED; -} - -nsapi_size_or_error_t UBLOX_N2XX_CellularSMS::get_sms(char *buf, uint16_t len, char *phone_num, uint16_t phone_len, - char *time_stamp, uint16_t time_len, int *buf_size) -{ - return NSAPI_ERROR_UNSUPPORTED; -} - -nsapi_error_t UBLOX_N2XX_CellularSMS::delete_all_messages() -{ - return NSAPI_ERROR_UNSUPPORTED; -} - -#endif // MBED_CONF_CELLULAR_USE_SMS diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularSMS.h b/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularSMS.h deleted file mode 100644 index f46cfa4f979..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularSMS.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2019, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef UBLOX_N2XX_CELLULAR_SMS_H_ -#define UBLOX_N2XX_CELLULAR_SMS_H_ - -#include "AT_CellularSMS.h" - -#if MBED_CONF_CELLULAR_USE_SMS - -namespace mbed { - -class UBLOX_N2XX_CellularSMS : public AT_CellularSMS { - -public: - - UBLOX_N2XX_CellularSMS(ATHandler &atHandler, AT_CellularDevice &device); - virtual ~UBLOX_N2XX_CellularSMS(); - - virtual nsapi_error_t set_cpms(const char *memr, const char *memw, const char *mems); - - virtual nsapi_size_or_error_t set_cscs(const char *chr_set); - - virtual nsapi_size_or_error_t get_sms(char *buf, uint16_t buf_len, char *phone_num, uint16_t phone_len, - char *time_stamp, uint16_t time_len, int *buf_size); - - virtual nsapi_error_t delete_all_messages(); - -}; - -} // namespace mbed - -#endif // MBED_CONF_CELLULAR_USE_SMS - -#endif // UBLOX_N2XX_CELLULAR_SMS_H_ diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp b/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp deleted file mode 100644 index 1348532009e..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularStack.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (c) 2019, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "UBLOX_N2XX_CellularStack.h" -#include "CellularUtil.h" -#include - -using namespace mbed; -using namespace mbed_cellular_util; - -constexpr seconds UBLOX_N2XX_CellularStack::SOCKET_TIMEOUT; - -UBLOX_N2XX_CellularStack::UBLOX_N2XX_CellularStack(ATHandler &atHandler, int cid, nsapi_ip_stack_t stack_type, AT_CellularDevice &device): - AT_CellularStack(atHandler, cid, stack_type, device) -{ - // URC handlers for sockets - _at.set_urc_handler("+NSONMI:", callback(this, &UBLOX_N2XX_CellularStack::NSONMI_URC)); -} - -UBLOX_N2XX_CellularStack::~UBLOX_N2XX_CellularStack() -{ - _at.set_urc_handler("+NSONMI:", nullptr); -} - -nsapi_error_t UBLOX_N2XX_CellularStack::socket_listen(nsapi_socket_t handle, int backlog) -{ - return NSAPI_ERROR_UNSUPPORTED; -} - -nsapi_error_t UBLOX_N2XX_CellularStack::socket_accept(void *server, void **socket, SocketAddress *addr) -{ - return NSAPI_ERROR_UNSUPPORTED; -} - -// Callback for Socket Read URC. -void UBLOX_N2XX_CellularStack::NSONMI_URC() -{ - int a, b; - CellularSocket *socket; - - a = _at.read_int(); - b = _at.read_int(); - - socket = find_socket(a); - if (socket != NULL) { - socket->pending_bytes = b; - // No debug prints here as they can affect timing - // and cause data loss in BufferedSerial - if (socket->_cb != NULL) { - socket->_cb(socket->_data); - } - } -} - -nsapi_error_t UBLOX_N2XX_CellularStack::create_socket_impl(CellularSocket *socket) -{ - int sock_id = -1; - int localport = socket->localAddress.get_port(); - - if (localport == 5683 || localport < 0 || localport > 65535) { - return NSAPI_ERROR_NO_SOCKET; - } - - _at.lock(); - _at.cmd_start_stop("+NSOCR", "=", "%s%d%d%d", "DGRAM", 17, localport, 1); - - _at.resp_start(); - sock_id = _at.read_int(); - _at.resp_stop(); - - if ((_at.get_last_error() != NSAPI_ERROR_OK) || (sock_id == -1)) { - _at.unlock(); - return NSAPI_ERROR_NO_SOCKET; - } - _at.unlock(); - - // Check for duplicate socket id delivered by modem - for (int i = 0; i < _device.get_property(AT_CellularDevice::PROPERTY_SOCKET_COUNT); i++) { - CellularSocket *sock = _socket[i]; - if (sock && sock != socket && sock->id == sock_id) { - return NSAPI_ERROR_NO_SOCKET; - } - } - - socket->started = true; - socket->id = sock_id; - - return NSAPI_ERROR_OK; -} - -nsapi_size_or_error_t UBLOX_N2XX_CellularStack::socket_sendto_impl(CellularSocket *socket, const SocketAddress &address, - const void *data, nsapi_size_t size) -{ - MBED_ASSERT(socket->id != -1); - - if (size > N2XX_MAX_PACKET_SIZE) { - return NSAPI_ERROR_PARAMETER; - } - - int sent_len = 0; - char *dataStr = new char [(size * 2) + 1](); - if (!dataStr) { - return NSAPI_ERROR_NO_MEMORY; - } - char_str_to_hex_str((const char *)data, size, dataStr); - - _at.cmd_start_stop("+NSOST", "=", "%d%s%d%d%s", socket->id, address.get_ip_address(), - address.get_port(), size, dataStr); - - _at.resp_start(); - _at.skip_param(); // skip socket id - sent_len = _at.read_int(); - _at.resp_stop(); - - delete[] dataStr; - if ((_at.get_last_error() == NSAPI_ERROR_OK)) { - return sent_len; - } - - return _at.get_last_error(); -} - -nsapi_size_or_error_t UBLOX_N2XX_CellularStack::socket_recvfrom_impl(CellularSocket *socket, SocketAddress *address, - void *buffer, nsapi_size_t size) -{ - MBED_ASSERT(socket->id != -1); - - nsapi_size_or_error_t nsapi_error_size = NSAPI_ERROR_DEVICE_ERROR; - nsapi_size_t read_blk, usorf_sz, count = 0, length = size; - bool success = true; - char ipAddress[NSAPI_IP_SIZE]; - int port = 0; - Timer timer; - - if (socket->pending_bytes == 0) { - _at.process_oob(); - if (socket->pending_bytes == 0) { - return NSAPI_ERROR_WOULD_BLOCK; - } - } - - timer.start(); - while (success && (length > 0)) { - read_blk = N2XX_MAX_PACKET_SIZE; - if (read_blk > length) { - read_blk = length; - } - if (socket->pending_bytes > 0) { - _at.cmd_start_stop("+NSORF", "=", "%d%d", socket->id, read_blk); - - _at.resp_start(); - _at.skip_param(); // receiving socket id - _at.read_string(ipAddress, sizeof(ipAddress)); - port = _at.read_int(); - usorf_sz = _at.read_int(); - if (usorf_sz > length) { - usorf_sz = length; - } - _at.read_hex_string((char *)buffer + count, usorf_sz); - _at.resp_stop(); - - // Must use what +NSORF returns here as it may be less or more than we asked for - if (usorf_sz >= socket->pending_bytes) { - socket->pending_bytes = 0; - } else { - socket->pending_bytes -= usorf_sz; - } - - if (usorf_sz > 0) { - count += (usorf_sz); - length -= (usorf_sz); - } else { - // read() should not fail - success = false; - } - } else if (timer.elapsed_time() < SOCKET_TIMEOUT) { - // Wait for URCs - _at.process_oob(); - } else { - if (count == 0) { - // Timeout with nothing received - nsapi_error_size = NSAPI_ERROR_WOULD_BLOCK; - success = false; - } - length = 0; // This simply to cause an exit - } - } - timer.stop(); - - socket->pending_bytes = 0; - if (!count || (_at.get_last_error() != NSAPI_ERROR_OK)) { - return NSAPI_ERROR_WOULD_BLOCK; - } - - if (success && socket->proto == NSAPI_UDP && address) { - address->set_ip_address(ipAddress); - address->get_ip_address(); - address->set_port(port); - } - - return nsapi_error_size = count; -} - -nsapi_error_t UBLOX_N2XX_CellularStack::socket_close_impl(int sock_id) -{ - return _at.at_cmd_discard("+NSOCL", "=", "%d", sock_id); -} diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularStack.h b/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularStack.h deleted file mode 100644 index 4eaa392dc5f..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/UBLOX_N2XX_CellularStack.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2019, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef UBLOX_N2XX_CELLULARSTACK_H_ -#define UBLOX_N2XX_CELLULARSTACK_H_ - -#include - -#include "AT_CellularStack.h" -#include "CellularUtil.h" -#include "mbed_wait_api.h" -#include "drivers/Timer.h" - -using namespace std::chrono; - -namespace mbed { - -class UBLOX_N2XX_CellularStack : public AT_CellularStack { - -public: - - UBLOX_N2XX_CellularStack(ATHandler &atHandler, int cid, nsapi_ip_stack_t stack_type, AT_CellularDevice &device); - virtual ~UBLOX_N2XX_CellularStack(); - -protected: - - virtual nsapi_error_t socket_listen(nsapi_socket_t handle, int backlog); - - virtual nsapi_error_t socket_accept(nsapi_socket_t server, - nsapi_socket_t *handle, SocketAddress *address = 0); - -protected: - - /** Socket timeout value in milliseconds. - * Note: the sockets layer above will retry the - * call to the functions here when they return NSAPI_ERROR_WOULD_BLOCK - * and the user has set a larger timeout or full blocking. - */ - static constexpr seconds SOCKET_TIMEOUT = 1s; - - /** The maximum number of bytes in a packet that can be write/read from - * the AT interface in one go. - */ - static const int N2XX_MAX_PACKET_SIZE = 512; - - virtual nsapi_error_t create_socket_impl(CellularSocket *socket); - - virtual nsapi_size_or_error_t socket_sendto_impl(CellularSocket *socket, const SocketAddress &address, - const void *data, nsapi_size_t size); - - virtual nsapi_size_or_error_t socket_recvfrom_impl(CellularSocket *socket, SocketAddress *address, - void *buffer, nsapi_size_t size); - - virtual nsapi_error_t socket_close_impl(int sock_id); - -private: - - // URC handlers - void NSONMI_URC(); -}; - -} // namespace mbed - -#endif // UBLOX_N2XX_CELLULARSTACK_H_ diff --git a/connectivity/drivers/cellular/UBLOX/N2XX/mbed_lib.json b/connectivity/drivers/cellular/UBLOX/N2XX/mbed_lib.json deleted file mode 100644 index e4af2bade84..00000000000 --- a/connectivity/drivers/cellular/UBLOX/N2XX/mbed_lib.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "UBLOX_N2XX", - "config": { - "tx": { - "help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.", - "value": null - }, - "rx": { - "help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.", - "value": null - }, - "rts": { - "help": "RTS pin for serial connection", - "value": null - }, - "cts": { - "help": "CTS pin for serial connection", - "value": null - }, - "baudrate" : { - "help": "Serial connection baud rate", - "value": 9600 - }, - "provide-default": { - "help": "Provide as default CellularDevice [true/false]", - "value": false - } - } -} diff --git a/connectivity/drivers/cellular/UBLOX/PPP/UBLOX_PPP.cpp b/connectivity/drivers/cellular/UBLOX/PPP/UBLOX_PPP.cpp deleted file mode 100644 index de82b7cd362..00000000000 --- a/connectivity/drivers/cellular/UBLOX/PPP/UBLOX_PPP.cpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2017, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "UBLOX_PPP.h" -#include "AT_CellularNetwork.h" - -using namespace mbed; -using namespace events; - -#ifdef UBX_MDM_SARA_R41XM -static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = { - AT_CellularNetwork::RegistrationModeDisable,// C_EREG - AT_CellularNetwork::RegistrationModeLAC, // C_GREG - AT_CellularNetwork::RegistrationModeLAC, // C_REG - 0, // AT_CGSN_WITH_TYPE - 0, // AT_CGDATA - 0, // AT_CGAUTH - 1, // AT_CNMI - 1, // AT_CSMP - 1, // AT_CMGF - 0, // AT_CSDH - 1, // PROPERTY_IPV4_STACK - 0, // PROPERTY_IPV6_STACK - 0, // PROPERTY_IPV4V6_STACK - 0, // PROPERTY_NON_IP_PDP_TYPE - 1, // PROPERTY_AT_CGEREP - 1, // PROPERTY_AT_COPS_FALLBACK_AUTO - 0, // PROPERTY_SOCKET_COUNT - 0, // PROPERTY_IP_TCP - 0, // PROPERTY_IP_UDP - 0, // PROPERTY_AT_SEND_DELAY -}; -#elif defined(UBX_MDM_SARA_U2XX) || defined(UBX_MDM_SARA_G3XX) -static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = { - AT_CellularNetwork::RegistrationModeDisable,// C_EREG - AT_CellularNetwork::RegistrationModeLAC, // C_GREG - AT_CellularNetwork::RegistrationModeLAC, // C_REG -#ifdef UBX_MDM_SARA_G3XX - 0, // AT_CGSN_WITH_TYPE -#else - 1, // AT_CGSN_WITH_TYPE -#endif - 1, // AT_CGDATA - 0, // AT_CGAUTH - 1, // AT_CNMI - 1, // AT_CSMP - 1, // AT_CMGF - 1, // AT_CSDH - 1, // PROPERTY_IPV4_STACK - 0, // PROPERTY_IPV6_STACK - 0, // PROPERTY_IPV4V6_STACK - 0, // PROPERTY_NON_IP_PDP_TYPE - 1, // PROPERTY_AT_CGEREP - 1, // PROPERTY_AT_COPS_FALLBACK_AUTO - 0, // PROPERTY_SOCKET_COUNT - 0, // PROPERTY_IP_TCP - 0, // PROPERTY_IP_UDP - 0, // PROPERTY_AT_SEND_DELAY -}; -#else -static const intptr_t cellular_properties[AT_CellularDevice::PROPERTY_MAX] = { - 0, // C_EREG - 0, // C_GREG - 0, // C_REG - 0, // AT_CGSN_WITH_TYPE - 0, // AT_CGDATA - 0, // AT_CGAUTH - 0, // AT_CNMI - 0, // AT_CSMP - 0, // AT_CMGF - 0, // AT_CSDH - 0, // PROPERTY_IPV4_STACK - 0, // PROPERTY_IPV6_STACK - 0, // PROPERTY_IPV4V6_STACK - 0, // PROPERTY_NON_IP_PDP_TYPE - 0, // PROPERTY_AT_CGEREP - 0, // PROPERTY_AT_COPS_FALLBACK_AUTO - 0, // PROPERTY_SOCKET_COUNT - 0, // PROPERTY_IP_TCP - 0, // PROPERTY_IP_UDP - 0, // PROPERTY_AT_SEND_DELAY -}; -#endif - -UBLOX_PPP::UBLOX_PPP(FileHandle *fh) : AT_CellularDevice(fh) -{ - set_cellular_properties(cellular_properties); -} - -#if MBED_CONF_UBLOX_PPP_PROVIDE_DEFAULT - -#if !NSAPI_PPP_AVAILABLE -#error Must define lwip.ppp-enabled -#endif - -#include "drivers/BufferedSerial.h" -CellularDevice *CellularDevice::get_default_instance() -{ - static BufferedSerial serial(MBED_CONF_UBLOX_PPP_TX, MBED_CONF_UBLOX_PPP_RX, MBED_CONF_UBLOX_PPP_BAUDRATE); -#if defined (MBED_CONF_UBLOX_PPP_RTS) && defined(MBED_CONF_UBLOX_PPP_CTS) - tr_debug("UBLOX_PPP flow control: RTS %d CTS %d", MBED_CONF_UBLOX_PPP_RTS, MBED_CONF_UBLOX_PPP_CTS); - serial.set_flow_control(SerialBase::RTSCTS, MBED_CONF_UBLOX_PPP_RTS, MBED_CONF_UBLOX_PPP_CTS); -#endif - static UBLOX_PPP device(&serial); - return &device; -} -#endif diff --git a/connectivity/drivers/cellular/UBLOX/PPP/UBLOX_PPP.h b/connectivity/drivers/cellular/UBLOX/PPP/UBLOX_PPP.h deleted file mode 100644 index 882d3066ab0..00000000000 --- a/connectivity/drivers/cellular/UBLOX/PPP/UBLOX_PPP.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017, Arm Limited and affiliates. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef UBLOX_PPP_H_ -#define UBLOX_PPP_H_ - -#ifdef TARGET_FF_ARDUINO -#ifndef MBED_CONF_UBLOX_PPP_TX -#define MBED_CONF_UBLOX_PPP_TX D1 -#endif -#ifndef MBED_CONF_UBLOX_PPP_RX -#define MBED_CONF_UBLOX_PPP_RX D0 -#endif -#endif /* TARGET_FF_ARDUINO */ - -#include "AT_CellularDevice.h" - -namespace mbed { - -class UBLOX_PPP : public AT_CellularDevice { -public: - UBLOX_PPP(FileHandle *fh); -}; - -} // namespace mbed - -#endif // UBLOX_PPP_H_ diff --git a/connectivity/drivers/cellular/UBLOX/PPP/mbed_lib.json b/connectivity/drivers/cellular/UBLOX/PPP/mbed_lib.json deleted file mode 100644 index 7c8bae14386..00000000000 --- a/connectivity/drivers/cellular/UBLOX/PPP/mbed_lib.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "UBLOX_PPP", - "config": { - "tx": { - "help": "TX pin for serial connection. D1 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.", - "value": null - }, - "rx": { - "help": "RX pin for serial connection. D0 assumed if Arduino Form Factor, needs to be set/overwritten otherwise.", - "value": null - }, - "rts": { - "help": "RTS pin for serial connection", - "value": null - }, - "cts": { - "help": "CTS pin for serial connection", - "value": null - }, - "baudrate" : { - "help": "Serial connection baud rate", - "value": 115200 - }, - "provide-default": { - "help": "Provide as default CellularDevice [true/false]", - "value": false - } - } -} diff --git a/connectivity/drivers/cellular/UBLOX/README.md b/connectivity/drivers/cellular/UBLOX/README.md deleted file mode 100644 index 7a7a5d8e182..00000000000 --- a/connectivity/drivers/cellular/UBLOX/README.md +++ /dev/null @@ -1,27 +0,0 @@ -## Configuring Ublox Cellular Modems for custom targets - -In order to use cellular APIs with custom targets, user needs to define ublox modem macros in `mbed_app.json` configuration file: -``` -"target_overrides": { - "*": { - "mbed-trace.enable": true, - "platform.stdio-convert-newlines": true, - "platform.stdio-baud-rate": 115200, - "platform.default-serial-baud-rate": 115200 - }, - "K64F": { - "target.macros_add": ["UBX_MDM_SARA_R41XM", "UBX_MDM_SARA_R412M"] - } -} -``` - - -List of supported ublox modems and their respective macros are as follow: - -| Ublox mbed board | Modem Name | Family Macro | Modem Macro | -| ----------- | :-----------: | :-------------: | :-------------: | -| UBLOX_C027 | SARA-G350 | `UBX_MDM_SARA_G3XX` | `UBX_MDM_SARA_G350` | -| UBLOX_C030_N211 | SARA-N211 | `UBX_MDM_SARA_N2XX` | `UBX_MDM_SARA_N211` | -| UBLOX_C030_U201 | SARA-U201 | `UBX_MDM_SARA_U2XX` | `UBX_MDM_SARA_U201` | -| UBLOX_C030_R410M | SARA-R410M | `UBX_MDM_SARA_R41XM` | `UBX_MDM_SARA_R410M` | -| UBLOX_C030_R412M | SARA-R412M | `UBX_MDM_SARA_R41XM` | `UBX_MDM_SARA_R412M` | diff --git a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/rza1_eth.c b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/rza1_eth.c index dd1d058f613..2d032a962ba 100644 --- a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/rza1_eth.c +++ b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/rza1_eth.c @@ -22,7 +22,7 @@ #include "iodefine.h" #include "rza1_eth_ext.h" -#if DEVICE_ETHERNET +#if DEVICE_EMAC /* Descriptor info */ #define NUM_OF_TX_DESCRIPTOR (16) @@ -821,4 +821,4 @@ static void wait_100us(int32_t wait_cnt) /* Do Nothing */ } } -#endif /* DEVICE_ETHERNET */ +#endif /* DEVICE_EMAC */ diff --git a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/rza1_eth.h b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/rza1_eth.h index 35538790baf..248f01b763b 100644 --- a/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/rza1_eth.h +++ b/connectivity/drivers/emac/TARGET_RENESAS_EMAC/TARGET_RZ_A1XX/rza1_eth.h @@ -19,7 +19,7 @@ #include "device.h" #include "platform/mbed_toolchain.h" -#if DEVICE_ETHERNET +#if DEVICE_EMAC #ifdef __cplusplus extern "C" { diff --git a/doxyfile_options b/doxyfile_options index 9efa5c196a1..645a8342cb5 100644 --- a/doxyfile_options +++ b/doxyfile_options @@ -2305,7 +2305,6 @@ PREDEFINED = DOXYGEN_ONLY \ DEVICE_ANALOGOUT \ DEVICE_CAN \ DEVICE_CRC \ - DEVICE_ETHERNET \ DEVICE_EMAC \ DEVICE_FLASH \ DEVICE_I2C \ diff --git a/doxygen_options.json b/doxygen_options.json index 62d6f8189f8..75a869a4c7f 100644 --- a/doxygen_options.json +++ b/doxygen_options.json @@ -6,7 +6,7 @@ "SEARCH_INCLUDES": "YES", "INCLUDE_PATH": "", "INCLUDE_FILE_PATTERNS": "", - "PREDEFINED": "DOXYGEN_ONLY DEVICE_ANALOGIN DEVICE_ANALOGOUT DEVICE_CAN DEVICE_CRC DEVICE_ETHERNET DEVICE_EMAC DEVICE_FLASH DEVICE_I2C DEVICE_I2CSLAVE DEVICE_I2C_ASYNCH DEVICE_INTERRUPTIN DEVICE_ITM DEVICE_LPTICKER DEVICE_MPU DEVICE_PORTIN DEVICE_PORTINOUT DEVICE_PORTOUT DEVICE_PWMOUT DEVICE_RTC DEVICE_TRNG DEVICE_SERIAL DEVICE_SERIAL_ASYNCH DEVICE_SERIAL_FC DEVICE_SLEEP DEVICE_SPI DEVICE_SPI_ASYNCH DEVICE_SPISLAVE DEVICE_QSPI DEVICE_STORAGE DEVICE_WATCHDOG DEVICE_RESET_REASON \"TFM_LVL=1\" \"MBED_DEPRECATED_SINCE(f, g)=\" \"MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, M)=\" \"MBED_DEPRECATED(s)=\" \"BLE_ROLE_OBSERVER=1\" \"BLE_ROLE_BROADCASTER=1\" \"BLE_ROLE_PERIPHERAL=1\" \"BLE_ROLE_CENTRAL=1\" \"BLE_FEATURE_GATT_CLIENT=1\" \"BLE_FEATURE_GATT_SERVER=1\" \"BLE_FEATURE_SECURITY=1\" \"BLE_FEATURE_SECURE_CONNECTIONS=1\" \"BLE_FEATURE_SIGNING=1\" \"BLE_FEATURE_PHY_MANAGEMENT=1\" \"BLE_FEATURE_WHITELIST=1\" \"BLE_FEATURE_PRIVACY=1\" \"BLE_FEATURE_PERIODIC_ADVERTISING=1\" \"BLE_FEATURE_EXTENDED_ADVERTISING=1\"", + "PREDEFINED": "DOXYGEN_ONLY DEVICE_ANALOGIN DEVICE_ANALOGOUT DEVICE_CAN DEVICE_CRC DEVICE_EMAC DEVICE_FLASH DEVICE_I2C DEVICE_I2CSLAVE DEVICE_I2C_ASYNCH DEVICE_INTERRUPTIN DEVICE_ITM DEVICE_LPTICKER DEVICE_MPU DEVICE_PORTIN DEVICE_PORTINOUT DEVICE_PORTOUT DEVICE_PWMOUT DEVICE_RTC DEVICE_TRNG DEVICE_SERIAL DEVICE_SERIAL_ASYNCH DEVICE_SERIAL_FC DEVICE_SLEEP DEVICE_SPI DEVICE_SPI_ASYNCH DEVICE_SPISLAVE DEVICE_QSPI DEVICE_STORAGE DEVICE_WATCHDOG DEVICE_RESET_REASON \"TFM_LVL=1\" \"MBED_DEPRECATED_SINCE(f, g)=\" \"MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, M)=\" \"MBED_DEPRECATED(s)=\" \"BLE_ROLE_OBSERVER=1\" \"BLE_ROLE_BROADCASTER=1\" \"BLE_ROLE_PERIPHERAL=1\" \"BLE_ROLE_CENTRAL=1\" \"BLE_FEATURE_GATT_CLIENT=1\" \"BLE_FEATURE_GATT_SERVER=1\" \"BLE_FEATURE_SECURITY=1\" \"BLE_FEATURE_SECURE_CONNECTIONS=1\" \"BLE_FEATURE_SIGNING=1\" \"BLE_FEATURE_PHY_MANAGEMENT=1\" \"BLE_FEATURE_WHITELIST=1\" \"BLE_FEATURE_PRIVACY=1\" \"BLE_FEATURE_PERIODIC_ADVERTISING=1\" \"BLE_FEATURE_EXTENDED_ADVERTISING=1\"", "EXPAND_AS_DEFINED": "", "SKIP_FUNCTION_MACROS": "NO", "STRIP_CODE_COMMENTS": "NO", diff --git a/hal/tests/TESTS/mbed_hal_fpga_ci_test_shield/pwm/pwm_fpga_test.h b/hal/tests/TESTS/mbed_hal_fpga_ci_test_shield/pwm/pwm_fpga_test.h index 26b57089b8e..d6df7ad187c 100644 --- a/hal/tests/TESTS/mbed_hal_fpga_ci_test_shield/pwm/pwm_fpga_test.h +++ b/hal/tests/TESTS/mbed_hal_fpga_ci_test_shield/pwm/pwm_fpga_test.h @@ -21,7 +21,7 @@ #ifndef MBED_FPGA_PWM_TEST_H #define MBED_FPGA_PWM_TEST_H -#if DEVICE_PWM +#if DEVICE_PWMOUT #ifdef __cplusplus extern "C" { diff --git a/platform/include/platform/LocalFileSystem.h b/platform/include/platform/LocalFileSystem.h index 6d0870aad95..3382c9dcd8d 100644 --- a/platform/include/platform/LocalFileSystem.h +++ b/platform/include/platform/LocalFileSystem.h @@ -19,7 +19,7 @@ #include "platform/platform.h" -#if DEVICE_LOCALFILESYSTEM +#if DOXYGEN_ONLY || (COMPONENT_LOCALFILESYSTEM && MBED_CONF_TARGET_SEMIHOSTING_ENABLED) #include "platform/FileSystemLike.h" #include "rtos/Mutex.h" diff --git a/platform/include/platform/mbed_debug.h b/platform/include/platform/mbed_debug.h index ed5e60d532b..1aa9c8ae323 100644 --- a/platform/include/platform/mbed_debug.h +++ b/platform/include/platform/mbed_debug.h @@ -16,10 +16,8 @@ */ #ifndef MBED_DEBUG_H #define MBED_DEBUG_H -#if DEVICE_STDIO_MESSAGES #include #include -#endif #include "platform/mbed_toolchain.h" #ifdef __cplusplus @@ -43,7 +41,7 @@ static inline void debug_if(int condition, const char *format, ...) MBED_PRINTF( */ static inline void debug(const char *format, ...) { -#if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) +#if !defined(NDEBUG) va_list args; va_start(args, format); vfprintf(stderr, format, args); @@ -62,7 +60,7 @@ static inline void debug(const char *format, ...) */ static inline void debug_if(int condition, const char *format, ...) { -#if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) +#if !defined(NDEBUG) if (condition) { va_list args; va_start(args, format); diff --git a/platform/include/platform/mbed_semihost_api.h b/platform/include/platform/mbed_semihost_api.h index 020e21a20e8..c6c36d96bd2 100644 --- a/platform/include/platform/mbed_semihost_api.h +++ b/platform/include/platform/mbed_semihost_api.h @@ -24,7 +24,7 @@ extern "C" { #endif -#if DEVICE_SEMIHOST +#if MBED_CONF_TARGET_SEMIHOSTING_ENABLED #if !defined(__ARMCC_VERSION) @@ -64,7 +64,6 @@ static inline int __semihost(int reason, const void *arg) #endif #endif -#if DEVICE_LOCALFILESYSTEM FILEHANDLE semihost_open(const char *name, int openmode); int semihost_close(FILEHANDLE fh); int semihost_read(FILEHANDLE fh, unsigned char *buffer, unsigned int length, int mode); @@ -76,7 +75,6 @@ int semihost_istty(FILEHANDLE fh); int semihost_remove(const char *name); int semihost_rename(const char *old_name, const char *new_name); -#endif int semihost_uid(char *uid); int semihost_reset(void); diff --git a/platform/source/CMakeLists.txt b/platform/source/CMakeLists.txt index 1f21b2052a1..77e0c9a69f7 100644 --- a/platform/source/CMakeLists.txt +++ b/platform/source/CMakeLists.txt @@ -22,7 +22,6 @@ target_sources(mbed-core-sources FileHandle.cpp FilePath.cpp FileSystemHandle.cpp - LocalFileSystem.cpp SingletonPtr.cpp Stream.cpp SysTimer.cpp @@ -57,7 +56,15 @@ if(MBED_TOOLCHAIN STREQUAL "GCC_ARM" AND MBED_C_LIB STREQUAL "small") ) endif() +if("MBED_CONF_TARGET_SEMIHOSTING_ENABLED=1" IN_LIST MBED_CONFIG_DEFINITIONS AND "COMPONENT_LOCALFILESYSTEM=1" IN_LIST MBED_TARGET_DEFINITIONS) + target_sources(mbed-core-sources + INTERFACE + LocalFileSystem.cpp + ) +endif() + + if("MBED_CONF_TARGET_CONSOLE_USB=1" IN_LIST MBED_CONFIG_DEFINITIONS) # If the stdio console uses USB, we need to link mbed-usb into the default OS build target_link_libraries(mbed-core-flags INTERFACE mbed-usb) -endif() +endif() \ No newline at end of file diff --git a/platform/source/LocalFileSystem.cpp b/platform/source/LocalFileSystem.cpp index 0f48c6ccf5c..4239a78c08b 100644 --- a/platform/source/LocalFileSystem.cpp +++ b/platform/source/LocalFileSystem.cpp @@ -20,8 +20,6 @@ #include "platform/LocalFileSystem.h" -#if DEVICE_LOCALFILESYSTEM - #include "platform/mbed_semihost_api.h" #include #include @@ -304,4 +302,3 @@ int LocalFileSystem::open(DirHandle **dir, const char *name) } // namespace mbed -#endif diff --git a/platform/source/mbed_error.c b/platform/source/mbed_error.c index 24508d31dfc..50c476f6b0e 100644 --- a/platform/source/mbed_error.c +++ b/platform/source/mbed_error.c @@ -34,9 +34,6 @@ #include "rtx_os.h" #endif -#if DEVICE_STDIO_MESSAGES -#include -#endif #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif diff --git a/platform/source/mbed_retarget.cpp b/platform/source/mbed_retarget.cpp index aa274d2634c..1fcfc731c4d 100644 --- a/platform/source/mbed_retarget.cpp +++ b/platform/source/mbed_retarget.cpp @@ -1563,14 +1563,12 @@ extern "C" void exit(int return_code) { #endif -#if DEVICE_STDIO_MESSAGES #if MBED_CONF_PLATFORM_STDIO_FLUSH_AT_EXIT fflush(stdout); fflush(stderr); fsync(STDOUT_FILENO); fsync(STDERR_FILENO); #endif -#endif #if DEVICE_SEMIHOST if (mbed_interface_connected()) { diff --git a/platform/source/mbed_semihost_api.c b/platform/source/mbed_semihost_api.c index 7e059b44d6d..ff2a0321e5c 100644 --- a/platform/source/mbed_semihost_api.c +++ b/platform/source/mbed_semihost_api.c @@ -24,7 +24,7 @@ #include #include -#if DEVICE_SEMIHOST +#if MBED_CONF_TARGET_SEMIHOSTING_ENABLED // ARM Semihosting Commands #define SYS_OPEN (0x1) @@ -48,7 +48,6 @@ #define USR_POWERDOWN (RESERVED_FOR_USER_APPLICATIONS + 4) #define USR_DISABLEDEBUG (RESERVED_FOR_USER_APPLICATIONS + 5) -#if DEVICE_LOCALFILESYSTEM FILEHANDLE semihost_open(const char *name, int openmode) { uint32_t args[3]; @@ -125,7 +124,6 @@ int semihost_rename(const char *old_name, const char *new_name) args[3] = (uint32_t)strlen(new_name); return __semihost(SYS_RENAME, args); } -#endif int semihost_exit(void) { diff --git a/targets/TARGET_ARM_SSG/TARGET_MPS2/SDK/mps2_ethernet_api.h b/targets/TARGET_ARM_SSG/TARGET_MPS2/SDK/mps2_ethernet_api.h index 59da020825f..46fe08aaa9f 100644 --- a/targets/TARGET_ARM_SSG/TARGET_MPS2/SDK/mps2_ethernet_api.h +++ b/targets/TARGET_ARM_SSG/TARGET_MPS2/SDK/mps2_ethernet_api.h @@ -20,7 +20,7 @@ #include "device.h" -#if DEVICE_ETHERNET +#if DEVICE_EMAC #ifdef __cplusplus extern "C" { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/CMakeLists.txt b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/CMakeLists.txt index b222de04fa1..cab37f5e835 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/CMakeLists.txt +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/CMakeLists.txt @@ -15,10 +15,6 @@ target_include_directories(mbed-ep-agora INTERFACE TARGET_EP_AGORA ) -target_sources(mbed-ep-agora - INTERFACE - TARGET_EP_AGORA/ONBOARD_TELIT_ME910.cpp -) target_include_directories(mbed-ep-atlas INTERFACE @@ -27,7 +23,6 @@ target_include_directories(mbed-ep-atlas target_sources(mbed-ep-atlas INTERFACE - TARGET_EP_ATLAS/ONBOARD_TELIT_ME310.cpp TARGET_EP_ATLAS/usb_stdio.cpp TARGET_EP_ATLAS/atlas_init.c ) diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_MTS_DRAGONFLY_F411RE/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_MTS_DRAGONFLY_F411RE/CMakeLists.txt index defc1d8425a..caec798c4e0 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_MTS_DRAGONFLY_F411RE/CMakeLists.txt +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_MTS_DRAGONFLY_F411RE/CMakeLists.txt @@ -5,7 +5,6 @@ add_library(mbed-mts-dragonfly-f411re INTERFACE) target_sources(mbed-mts-dragonfly-f411re INTERFACE - ONBOARD_TELIT_HE910.cpp PeripheralPins.c ) diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/CMakeLists.txt index b7babe1e83d..b65e7b8ae43 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/CMakeLists.txt +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/TARGET_MTS_DRAGONFLY_F413RH/CMakeLists.txt @@ -6,7 +6,6 @@ add_library(mbed-mts-dragonfly-f413rh INTERFACE) target_sources(mbed-mts-dragonfly-f413rh INTERFACE PeripheralPins.c - ONBOARD_TELIT_HE910.cpp ) target_include_directories(mbed-mts-dragonfly-f413rh diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/CMakeLists.txt index f8990e2b4fd..f516c0eb11b 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/CMakeLists.txt +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/CMakeLists.txt @@ -6,7 +6,6 @@ add_library(mbed-wio-3g INTERFACE) target_sources(mbed-wio-3g INTERFACE PeripheralPins.c - ONBOARD_QUECTEL_UG96.cpp ) target_include_directories(mbed-wio-3g diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG/TARGET_MTS_DRAGONFLY_L471QG/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG/TARGET_MTS_DRAGONFLY_L471QG/CMakeLists.txt index 0179089191f..f28640e3412 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG/TARGET_MTS_DRAGONFLY_L471QG/CMakeLists.txt +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L471xG/TARGET_MTS_DRAGONFLY_L471QG/CMakeLists.txt @@ -6,7 +6,6 @@ add_library(mbed-mts-dragonfly-l471qg INTERFACE) target_sources(mbed-mts-dragonfly-l471qg INTERFACE mtqn_low_power.c - ONBOARD_SARA4_PPP.cpp ublox_low_level_api.c PeripheralPins.c ) diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TARGET_ADV_WISE_1570/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TARGET_ADV_WISE_1570/CMakeLists.txt index cd01c74a636..be687fa75aa 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TARGET_ADV_WISE_1570/CMakeLists.txt +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TARGET_ADV_WISE_1570/CMakeLists.txt @@ -5,7 +5,6 @@ add_library(mbed-adv-wise-1570 INTERFACE) target_sources(mbed-adv-wise-1570 INTERFACE - ONBOARD_QUECTEL_BC95.cpp PeripheralPins.c system_clock.c ) diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/CMakeLists.txt b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/CMakeLists.txt index 1b0d6f30f2d..ca57b058d90 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/CMakeLists.txt +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/CMakeLists.txt @@ -5,7 +5,6 @@ add_library(mbed-mts-dragonfly-l496vg INTERFACE) target_sources(mbed-mts-dragonfly-l496vg INTERFACE - ONBOARD_QUECTEL_EG25.cpp PeripheralPins.c TargetInit.c ) diff --git a/targets/features.json5 b/targets/features.json5 new file mode 100644 index 00000000000..4d90759273c --- /dev/null +++ b/targets/features.json5 @@ -0,0 +1,392 @@ +// This JSON5 file contains a list of all the features used in Mbed. +// There are three types of features: +// Peripherals - Represents a peripheral present on this target and supported by Mbed CE. +// Peripherals have names starting with DEVICE. +// Feature - A larger Mbed OS optional feature supported for this target. +// Component - An external component present on a given board. This is commonly +// used to mark a given eval board as having flash support, etc. +// Each feature is defined here before it can be used in targets.json5. +// The contents of this file are not used during the build, but are used +// when generating documentation. + +{ + "Component": { + +// WiFI and WiFi/BT modules ----------------------------------------------------------- + "COMPONENT_43012": { + "description": "Infineon/Cypress AIROC Wifi/BT module", + "friendly_name": "Infineon CYW43012" + }, + "COMPONENT_43438": { + "description": "Infineon/Cypress AIROC Wifi/BT module", + "friendly_name": "Infineon CYW43438" + }, + "COMPONENT_4343W": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_4343W_FS": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_CYW43XXX": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_EMW3080B": { + "description": "", + "friendly_name": "" + }, + +// Bluetooth only modules ----------------------------------------------------------- + "COMPONENT_BlueNRG_2": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_BlueNRG_MS": { + "description": "", + "friendly_name": "" + }, + +// Cellular modules ----------------------------------------------------------------- + "COMPONENT_ALTAIR_ALT1250": { + "description": "Cellular module from Altair", + "friendly_name": "Altair ALT1250" + }, + "COMPONENT_STMOD_CELLULAR": { + "description": "STMicro cellular module boards (Quectel UG96 and BG96, selectable via json option)", + "friendly_name": "STMod Cellular Modules" + }, + "COMPONENT_GEMALTO_CINTERION": { + "description": "Gemalto Cinterion family of cellular modules (ELS61, BGS2, EMS31, and EHS5-E are supported)", + "friendly_name": "Gemalto Cinterion" + }, + "COMPONENT_GENERIC_AT3GPP": { + "description": "Generic cellular module supporting 3GPP AT command set", + "friendly_name": "Generic 3GPP Cellular" + }, + "COMPONENT_MULTITECH_DRAGONFLY_NANO_CELLULAR": { + "description": "Cellular module from this Multitech board. I have been unable to figure out its exact part number from the available docs...", + "friendly_name": "Multitech Dragonfly Nano Cellular" + }, + "COMPONENT_QUECTEL_EC2X": { + "description": "EC2X and EG25 families of cellular modules", + "friendly_name": "Quectel EC2X" + }, + "COMPONENT_QUECTEL_BG96": { + "description": "LTE module", + "friendly_name": "Quectel BG96" + }, + "COMPONENT_QUECTEL_UG96": { + "description": "3G cellular module", + "friendly_name": "Quectel UG96" + }, + "COMPONENT_QUECTEL_BC95": { + "description": "Narrowband Internet of Things (NB-IoT) cellular module", + "friendly_name": "Quectel BC95" + }, + "COMPONENT_QUECTEL_M26": { + "description": "GSM GPRS cellular module", + "friendly_name": "Quectel M26" + }, + "COMPONENT_RIOTMICRO_RM1000": { + "description": "LTE + NB-IoT cellular module", + "friendly_name": "Riot Micro RM1000" + }, + "COMPONENT_TELIT_HE910": { + "description": "3G module", + "friendly_name": "Telit HE910" + }, + "COMPONENT_TELIT_ME310": { + "description": "LTE + GSM + GNSS module", + "friendly_name": "Telit ME310" + }, + "COMPONENT_TELIT_ME910": { + "description": "LTE + GSM + GNSS module", + "friendly_name": "Telit ME910" + }, + +// 802.15.4 modules ----------------------------------------------------------------- + "COMPONENT_MICROCHIP_AT86RF": { + "description": "AT86RF233 and AT86RF212B 802.15.4 modules", + "friendly_name": "Microchip/Atmel AT86RF" + }, + "COMPONENT_NXP_MCR20A": { + "description": "802.15.4 module", + "friendly_name": "NXP/Freescale MCR20A" + }, + "COMPONENT_STM_S2_LP": { + "description": "802.15.4 module, present on X-Nucleo-S2868A1 board", + "friendly_name": "NXP/Freescale MCR20A" + }, + +// Other ---------------------------------------------------------------------------- + + "COMPONENT_CM0P_SECURE": { + "description": "Used on Cypress PSoC6 dual core processors. When enabled, this activates the Cortex-M0 coprocessor in sleep mode.", + "friendly_name": "PSoC CM0 in Sleep Mode" + }, + "COMPONENT_CM0P_SLEEP": { + "description": "Used on Cypress PSoC 64 dual core processors with secure boot. When enabled, activates the Cortex-M0 coprocessor as a security coprocessor.", + "friendly_name": "PSoC CM0 in Sleep Mode" + }, + + + "COMPONENT_FLASHIAP": { + "description": "", + "friendly_name": "" + }, + + "COMPONENT_LAN91C111": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_LOCALFILESYSTEM": { + "description": "Mbed interface chip on the board can store a local filesystem and make it available on the USB drive", + "friendly_name": "LocalFileSystem" + }, + "COMPONENT_OSPIF": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_QSPIF": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_RTX": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_SCL": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_SD": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_SMSC9220": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_SOFTFP": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_SPIF": { + "description": "", + "friendly_name": "" + }, + + "COMPONENT_SX1276": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_TFM_S_FW": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_WHD": { + "description": "", + "friendly_name": "" + }, + "COMPONENT_hm01b0": { + "description": "320x320 monochrome camera module", + "friendly_name": "Himax HM01B0" + }, + "COMPONENT_lis2dh12": { + "description": "Low power 3-axis accelerometer", + "friendly_name": "STMicro LIS2DH12" + } + }, + "Feature": { + "FEATURE_BLE": { + "description": "", + "friendly_name": "" + }, + "FEATURE_CRYPTOCELL310": { + "description": "", + "friendly_name": "" + }, + "FEATURE_EXPERIMENTAL_API": { + "description": "", + "friendly_name": "" + }, + "FEATURE_PSA": { + "description": "", + "friendly_name": "" + }, + "FEATURE_STORAGE": { + "description": "", + "friendly_name": "" + } + }, + "Peripheral": { + "DEVICE_802_15_4_PHY": { + "description": "802.15.4 radio peripheral, used to implement mesh networking (Wi-SUN, Thread, LoWPAN)", + "friendly_name": "802.15.4 Radio" + }, + // Mystery ARM feature, used only on ARM FPGA reference designs + "DEVICE_AACI": { + "description": "", + "friendly_name": "", + "hidden_from_docs": true + }, + "DEVICE_ANALOGIN": { + "description": "Analog input (ADC) peripheral", + "friendly_name": "Analog Inputs" + }, + "DEVICE_ANALOGOUT": { + "description": "Analog output (DAC) peripheral", + "friendly_name": "Analog Outputs" + }, + "DEVICE_CAN": { + "description": "Controller Area Network (CAN) peripheral", + "friendly_name": "CAN" + }, + // mystery ARM feature, used only on reference designs (SPI related?) + "DEVICE_CLCD": { + "description": "", + "friendly_name": "ARM CLCD", + "hidden_from_docs": true + }, + "DEVICE_CRC": { + "description": "CRC Acclerator peripheral, used to accelerate certain CRC computations.", + "friendly_name": "Hardware CRC" + }, + "DEVICE_DEBUG_AWARENESS": { + "description": "Target supports awareness of whether semihost is attached", + "friendly_name": "Semihost Debug Aware" + }, + "DEVICE_EMAC": { + "description": "Ethernet MAC peripheral. Combine with a PHY chip to connect to Ethernet networks.", + "friendly_name": "Ethernet MAC" + }, + "DEVICE_FLASH": { + "description": "Driver allowing In-Application Programming (IAP) of the MCU flash memory.", + "friendly_name": "Flash IAP" + }, + "DEVICE_I2C": { + "description": "I2C in controller/master mode", + "friendly_name": "I2C Controller/Master" + }, + "DEVICE_I2CSLAVE": { + "description": "I2C in peripheral/slave mode", + "friendly_name": "I2C Peripheral/Slave" + }, + "DEVICE_I2C_ASYNCH": { + "description": "Allows use of I2C controller mode in the background via interrupts and/or DMA.", + "friendly_name": "Async I2C Controller/Master" + }, + "DEVICE_INTERRUPTIN": { + "description": "GPIO input pin interrupt support", + "friendly_name": "GPIO Interrupts" + }, + "DEVICE_ITM": { + "description": "Support for ARM Instrumentation Trace Macrocell (ITM). Basically a fast serial port designed for application logging and tracing that runs over the SWO pin.", + "friendly_name": "ITM" + }, + "DEVICE_LPTICKER": { + "description": "Also known as the Low-Power Ticker, this peripheral keeps time at a low-frequency clock (usually 32kHz) and generates events for the application. Usually it is used to implement low power sleep.", + "friendly_name": "Low-Precision Ticker" + }, + "DEVICE_MPU": { + "description": "Mbed supports configuring the MPU on this device to disable writing to ROM and executing from RAM.", + "friendly_name": "Mempoy Protection Unit" + }, + "DEVICE_OSPI": { + "description": "Octal SPI peripheral, usually used to communicate with flash memory chips. Has 8 bidirectional data lines and one clock line, plus optionally a CS line and a DQS line.", + "friendly_name": "Octal SPI" + }, + "DEVICE_PORTIN": { + "description": "Support for reading from an entire GPIO port at a time", + "friendly_name": "GPIO Port Input" + }, + "DEVICE_PORTINOUT": { + "description": "Support for using an entire GPIO port as a bidirectional I/O port.", + "friendly_name": "GPIO Port I/O" + }, + "DEVICE_PORTOUT": { + "description": "Support for writing to an entire GPIO port at a time", + "friendly_name": "GPIO Port Output" + }, + "DEVICE_PWMOUT": { + "description": "Pulse Width Modulation (PWM) generator peripheral", + "friendly_name": "PWM Out" + }, + "DEVICE_QSPI": { + "description": "Quad SPI peripheral, usually used to communicate with flash memory chips. Has 4 bidirectional data lines and one clock line, plus optionally a CS line.", + "friendly_name": "Quad SPI" + }, + "DEVICE_RESET_REASON": { + "description": "Support for determining the cause of the most recent MCU reset.", + "friendly_name": "Reset Reason" + }, + "DEVICE_RTC": { + "description": "Real-Time Clock. Clock which keeps track of real world time, usually using a low frequency, accurate clock.", + "friendly_name": "RTC" + }, + "DEVICE_SERIAL": { + "description": "Support for buffered and unbuffered serial (UART) ports", + "friendly_name": "Serial (UART)" + }, + // Based on git history, it looks like DEVICE_SERIAL_ASYNC was added first, + // before BufferedSerial existed. Unlike BufferedSerial, it requires + // that you use different API functions than standard serial read and write. + // In the current Mbed version, the functionality only exists in SerialBase, so + // you would have to extend SerialBase yourself to even access it. + // Unfortunately, this API supports DMA but BufferedSerial does not... oops. + "DEVICE_SERIAL_ASYNCH": { + "description": "Legacy asynchronous serial API via SerialBase", + "friendly_name": "Legacy Async Serial (UART)" + }, + "DEVICE_SERIAL_FC": { + "description": "Serial (UART) peripheral supports using RTS and/or CTS pins for hardware flow control.", + "friendly_name": "Serial RTS/CTS Flow Control" + }, + "DEVICE_SLEEP": { + "description": "Support for sending the processor to sleep when no threads/ISRs are executing.", + "friendly_name": "Sleep" + }, + "DEVICE_SPI": { + "description": "Serial Peripheral Interface (SPI) controller/master mode", + "friendly_name": "SPI Controller/Master" + }, + "DEVICE_SPISLAVE": { + "description": "Serial Peripheral Interface (SPI) device/slave mode", + "friendly_name": "SPI Peripheral/Slave" + }, + // Only used for testing, hide for now + "DEVICE_SPI_32BIT_WORDS": { + "description": "", + "friendly_name": "SPI supports 32 Bit Words", + "hidden_from_docs": true + }, + "DEVICE_SPI_ASYNCH": { + "description": "Allows use of SPI controller mode in the background via interrupts and/or DMA.", + "friendly_name": "Async SPI" + }, + "DEVICE_TRNG": { + "description": "Cryptographic-grade True Random Number Generator (TRNG). This is required to implement SSL communications securely unless you provision devices with an entropy seed stored in nonvolatile storage.", + "friendly_name": "True Random Number Generator" + }, + // Mystery ARM feature, used only on ARM FPGA reference designs + "DEVICE_TSC": { + "description": "", + "friendly_name": "", + "hidden_from_docs": true + }, + "DEVICE_USBDEVICE": { + "description": "USB Device peripheral. Allows the Mbed target to act as a USB device when connected to a host computer.", + "friendly_name": "USB Device" + }, + "DEVICE_USTICKER": { + "description": "Clock peripheral with at least microsecond resolution that Mbed uses to implement Timer and Ticker.", + "friendly_name": "μs Ticker" + }, + "DEVICE_WATCHDOG": { + "description": "Peripheral which resets the chip if software doesn't service it within a configurable amount of time. Used to guard against software hangs.", + "friendly_name": "Watchdog" + } + } +} \ No newline at end of file diff --git a/targets/targets.json5 b/targets/targets.json5 index 23a170447bc..59d378807fb 100644 --- a/targets/targets.json5 +++ b/targets/targets.json5 @@ -96,6 +96,10 @@ "internal-flash-uniform-sectors": { "help": "Target's internal flash has uniform sector sizes", "value": true + }, + "semihosting-enabled": { + "help": "Enable ARM Semihosting protocol. This uses a magic breakpoint instruction to enable the MCU to print data to and access files on a host machine. However, it can interfere with debuggers that are not semihost aware.", + "value": false } } }, @@ -257,7 +261,6 @@ "SLEEP", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "USTICKER" ], "overrides": { @@ -309,28 +312,27 @@ "CAN", "DEBUG_AWARENESS", "EMAC", - "ETHERNET", "I2C", "I2CSLAVE", "INTERRUPTIN", - "LOCALFILESYSTEM", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", - "SEMIHOST", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "FLASH", "MPU", "USBDEVICE", "WATCHDOG", "RESET_REASON" ], + "components_add": [ + "LOCALFILESYSTEM" + ], "release_versions": [ "5" ], @@ -343,7 +345,8 @@ } }, "overrides": { - "network-default-interface-type": "ETHERNET" + "network-default-interface-type": "ETHERNET", + "semihosting-enabled": true // needed for LOCALFILESYSTEM }, "supported_c_libs": { "arm": [ @@ -398,7 +401,6 @@ "CAN", "DEBUG_AWARENESS", "EMAC", - "ETHERNET", "I2C", "I2CSLAVE", "INTERRUPTIN", @@ -411,7 +413,6 @@ "SLEEP", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "FLASH", "MPU", "USBDEVICE", @@ -458,12 +459,10 @@ "PORTINOUT", "PORTOUT", "PWMOUT", - "SEMIHOST", "SERIAL", "SLEEP", "SPI", - "SPISLAVE", - "STDIO_MESSAGES" + "SPISLAVE" ], "release_versions": [ "5" @@ -514,12 +513,10 @@ "PORTINOUT", "PORTOUT", "PWMOUT", - "SEMIHOST", "SERIAL", "SLEEP", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "FLASH" ], "release_versions": [ @@ -589,7 +586,6 @@ "SLEEP", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "TRNG", "USBDEVICE", "FLASH" @@ -667,12 +663,10 @@ "PORTINOUT", "PORTOUT", "PWMOUT", - "SEMIHOST", "SERIAL", "SLEEP", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "USBDEVICE", "FLASH" ], @@ -739,7 +733,6 @@ "SPI", "SPISLAVE", "TRNG", - "STDIO_MESSAGES", "FLASH", "802_15_4_PHY" ], @@ -810,7 +803,6 @@ "SPI", "SPI_ASYNCH", "SPISLAVE", - "STDIO_MESSAGES", "TRNG", "FLASH", "USBDEVICE", @@ -886,7 +878,6 @@ "USTICKER", "RTC", "SERIAL", - "STDIO_MESSAGES", "TRNG", "SLEEP", "INTERRUPTIN", @@ -939,7 +930,6 @@ "USTICKER", "RTC", "SERIAL", - "STDIO_MESSAGES", "TRNG", "SLEEP", "INTERRUPTIN", @@ -1018,7 +1008,6 @@ "SPI", "SPI_ASYNCH", "SPISLAVE", - "STDIO_MESSAGES", "TRNG", "FLASH", "WATCHDOG" @@ -1081,7 +1070,6 @@ "SLEEP", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "TRNG", "FLASH" ], @@ -1157,7 +1145,6 @@ "SLEEP", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "TRNG", "FLASH", "USBDEVICE", @@ -1275,7 +1262,6 @@ "SPI", "SPISLAVE", "SPI_ASYNCH", - "STDIO_MESSAGES", "WATCHDOG", "RESET_REASON" ] @@ -1523,8 +1509,7 @@ "CRC", "USBDEVICE", "ANALOGOUT", - "SD", - "PWM" + "PWMOUT" ] }, "MCU_STM32F103xG": { @@ -1904,6 +1889,9 @@ "device_name": "STM32F411RETx", "detect_code": [ "0454" + ], + "components_add": [ + "TELIT_HE910" ] }, "MTS_MDOT_F411RE": { @@ -2063,7 +2051,8 @@ "SERIAL_FC" ], "components_add": [ - "SPIF" + "SPIF", + "TELIT_HE910" ], "device_name": "STM32F413RHTx" }, @@ -2196,6 +2185,8 @@ "TRNG" ] }, + // Note: It seems like Seeed no longer sells this board. + // That would make this target a candidate for removal. "WIO_3G": { "inherits": [ "MCU_STM32F439xI" @@ -2214,8 +2205,14 @@ "detect_code": [ "9014" ], + "components_add": [ + "QUECTEL_UG96" + ], "device_name": "STM32F439VITx" }, + + // Note: It seems like Seeed no longer sells any WIO boards with BG96 cellular modules. + // That would make this target a candidate for removal. "WIO_BG96": { "inherits": [ "MCU_STM32F439xI" @@ -2239,7 +2236,8 @@ ], "device_name": "STM32F439VITx", "components_add": [ - "SD" + "SD", + "QUECTEL_BG96" ] }, "NUCLEO_F439ZI": { @@ -2595,9 +2593,6 @@ "device_has_remove": [ "SERIAL_FC" ], - "features": [ - "LWIP" - ], "device_name": "STM32F767VITx" }, "NUCLEO_F767ZI": { @@ -4287,7 +4282,7 @@ "MBED_SPLIT_HEAP" ] }, - "MTS_DRAGONFLY_L471QG": { + "MTS_DRAGONFLY_L471QG": { // Also known as "Dragonfly Nano" "inherits": [ "MCU_STM32L471xG" ], @@ -4297,6 +4292,9 @@ "detect_code": [ "0312" ], + "components_add": [ + "MULTITECH_DRAGONFLY_NANO_CELLULAR", + ], "device_name": "STM32L471QGIx" }, "MCU_STM32L475xG": { @@ -4443,6 +4441,8 @@ ], "device_name": "STM32L486RGTx" }, + // AKA Advantech WISE-1570 + // This board is EOL from the manufacturer so it is a candidate for removal. "ADV_WISE_1570": { "inherits": [ "MCU_STM32L486xG" @@ -4457,7 +4457,10 @@ "WISE_1570" ], "device_name": "STM32L486RGTx", - "OUTPUT_EXT": "hex" + "OUTPUT_EXT": "hex", + "components_add": [ + "QUECTEL_BC95" + ] }, "MCU_STM32L496xG": { "inherits": [ @@ -4524,6 +4527,11 @@ "0828" ] }, + + // Note: I have not been able to find any record of a board with this target ID ever being + // sold by Multitech. It was added by this PR: https://github.com/ARMmbed/mbed-os/pull/15012 + // If you cannot actually buy the board that this target is for, that would make it a candidate for removal. + // I have emailed multitech about it, we will see if they get back to me... "MTS_DRAGONFLY_L496VG": { "inherits": [ "MCU_STM32L496xG" @@ -4532,7 +4540,8 @@ "ARDUINO_UNO" ], "components_add": [ - "QSPIF" + "QSPIF", + "QUECTEL_EC2X" ], "device_has_add": [ "USBDEVICE", @@ -5193,7 +5202,6 @@ "EMAC", "I2C", "I2CSLAVE", - "ERROR_RED", "INTERRUPTIN", "PORTIN", "PORTINOUT", @@ -5202,15 +5210,11 @@ "SERIAL", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "TRNG", "WATCHDOG", "USBDEVICE", "LPTICKER" ], - "features": [ - "LWIP" - ], "device_name": "MIMXRT1052", "overrides": { "deep-sleep-latency": 10 @@ -5410,7 +5414,6 @@ "SLEEP", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "FLASH", "MPU" ], @@ -5473,7 +5476,6 @@ "SLEEP", "SPI", "SPISLAVE", - "STDIO_MESSAGES", "FLASH", "TRNG", "QSPI", @@ -5543,7 +5545,7 @@ "AACI", "ANALOGIN", "CLCD", - "ETHERNET", + "EMAC", "I2C", "INTERRUPTIN", "PORTIN", @@ -5589,7 +5591,6 @@ "AACI", "ANALOGIN", "CLCD", - "ETHERNET", "I2C", "INTERRUPTIN", "PORTIN", @@ -5627,7 +5628,6 @@ "AACI", "ANALOGIN", "CLCD", - "ETHERNET", "I2C", "INTERRUPTIN", "PORTIN", @@ -5665,7 +5665,6 @@ "AACI", "ANALOGIN", "CLCD", - "ETHERNET", "I2C", "INTERRUPTIN", "PORTIN", @@ -5704,7 +5703,6 @@ "AACI", "ANALOGIN", "CLCD", - "ETHERNET", "I2C", "INTERRUPTIN", "PORTIN", @@ -5743,7 +5741,6 @@ "AACI", "ANALOGIN", "CLCD", - "ETHERNET", "I2C", "INTERRUPTIN", "PORTIN", @@ -5771,7 +5768,6 @@ "AACI", "ANALOGIN", "CLCD", - "ETHERNET", "I2C", "INTERRUPTIN", "PORTIN", @@ -5965,7 +5961,7 @@ "RTC", "ANALOGIN", "CAN", - "ETHERNET", + "EMAC", "I2C", "I2CSLAVE", "I2C_ASYNCH", @@ -5979,8 +5975,7 @@ "SERIAL_FC", "SPI", "SPISLAVE", - "SPI_ASYNCH", - "STDIO_MESSAGES" + "SPI_ASYNCH" ], "program_cycle_s": 2, "overrides": { @@ -6059,7 +6054,7 @@ "LPTICKER" ], "device_has_remove": [ - "ETHERNET" + "EMAC" ], "release_versions": [ "5" @@ -6093,7 +6088,7 @@ "RTC", "ANALOGIN", "CAN", - "ETHERNET", + "EMAC", "I2C", "I2CSLAVE", "I2C_ASYNCH", @@ -6108,7 +6103,6 @@ "SPI", "SPISLAVE", "SPI_ASYNCH", - "STDIO_MESSAGES", "USBDEVICE" ], "program_cycle_s": 2, @@ -6174,7 +6168,6 @@ "SERIAL_FC", "SLEEP", "SPI", - "STDIO_MESSAGES", "USTICKER" ], "detect_code": [ @@ -6230,7 +6223,6 @@ "SERIAL_FC", "SLEEP", "SPI", - "STDIO_MESSAGES", "USTICKER" ], "release_versions": [ @@ -6279,7 +6271,6 @@ "SERIAL_FC", "SLEEP", "SPI", - "STDIO_MESSAGES", "USTICKER" ], "device_name": "MAX32625", @@ -6368,11 +6359,9 @@ "PORTINOUT", "PORTOUT", "PWMOUT", - "SD", "SERIAL", "SERIAL_FC", "SPI", - "STDIO_MESSAGES", "USTICKER", "MPU", "SLEEP", @@ -6418,7 +6407,6 @@ "device_has": [ "SERIAL", "SERIAL_FC", - "STDIO_MESSAGES", "PORTIN", "PORTINOUT", "PORTOUT", @@ -6496,7 +6484,6 @@ "device_has": [ "SERIAL", "SERIAL_FC", - "STDIO_MESSAGES", "PORTIN", "PORTINOUT", "PORTOUT", @@ -6636,7 +6623,6 @@ "SPI", "SPISLAVE", "SPI_ASYNCH", - "STDIO_MESSAGES", "USTICKER", "FLASH", "ITM", @@ -6749,7 +6735,6 @@ "SPI", "SPISLAVE", "SPI_ASYNCH", - "STDIO_MESSAGES", "USTICKER", "TRNG", "FLASH", @@ -6861,7 +6846,6 @@ "SPI", "SPISLAVE", "SPI_ASYNCH", - "STDIO_MESSAGES", "USTICKER", "TRNG", "FLASH", @@ -6931,7 +6915,8 @@ "CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\"", "MBED_TICKLESS", "MBED_MPU_CUSTOM", - "SWI_DISABLE0" + "SWI_DISABLE0", + "SYSTICK_CLK_OFF_DURING_SLEEP" // see mbed_sleep() in mbed_power_mgmt.h ], "features": [ "BLE" @@ -6955,7 +6940,6 @@ "SLEEP", "SPI", "SPI_ASYNCH", - "SYSTICK_CLK_OFF_DURING_SLEEP", "TRNG", "USTICKER" ], @@ -7086,7 +7070,8 @@ "WSF_MAX_HANDLERS=10", "MBED_MPU_CUSTOM", "SWI_DISABLE0", - "NRF52_PAN_20" + "NRF52_PAN_20", + "SYSTICK_CLK_OFF_DURING_SLEEP" // see mbed_sleep() in mbed_power_mgmt.h ], "features": [ "CRYPTOCELL310", @@ -7111,7 +7096,6 @@ "SLEEP", "SPI", "SPI_ASYNCH", - "SYSTICK_CLK_OFF_DURING_SLEEP", "TRNG", "USTICKER", "QSPI", @@ -7182,7 +7166,10 @@ "std", "small" ] - } + }, + + // This is the target for all boards using NRF52840 chips + "is_mcu_family_target": true }, "NRF52840_DK": { "supported_form_factors": [ @@ -7322,7 +7309,6 @@ "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", - "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", @@ -7440,7 +7426,6 @@ "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", - "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", @@ -7567,7 +7552,6 @@ "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", - "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", @@ -7721,7 +7705,6 @@ "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", - "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", @@ -7897,7 +7880,6 @@ "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", - "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", @@ -8016,7 +7998,6 @@ "I2C", "I2CSLAVE", "I2C_ASYNCH", - "STDIO_MESSAGES", "TRNG", "FLASH", "SLEEP" @@ -8255,7 +8236,6 @@ "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", - "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", @@ -8413,7 +8393,6 @@ "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", - "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", @@ -8497,7 +8476,6 @@ "I2CSLAVE", "I2C_ASYNCH", "RTC", - "STDIO_MESSAGES", "FLASH", "SLEEP", "USTICKER", @@ -8532,7 +8510,16 @@ "MBEDTLS_CONFIG_HW_SUPPORT", "LPTICKER_DELAY_TICKS=3", "CYBT_WAKE_ACTIVE_LOW=0", - "CYBT_WAKE_ACTIVE_HIGH=1" + "CYBT_WAKE_ACTIVE_HIGH=1", + + // These are named like Mbed components, but actually seem to be a definitions + // used by the Cypress IDE-generated BSP. We just want to define them all the time. + "COMPONENT_PSOC6=1", + "COMPONENT_PSOC6HAL=1", + "COMPONENT_SOFTFP=1", + "COMPONENT_RTX=1", + "COMPONENT_CAT1=1", + "COMPONENT_CAT1A=1", ], "default_toolchain": "GCC_ARM", "supported_toolchains": [ @@ -8564,7 +8551,6 @@ "SPI", "SPI_ASYNCH", "SPISLAVE", - "STDIO_MESSAGES", "TRNG", "USBDEVICE", "USTICKER", @@ -8578,10 +8564,6 @@ "PSOC6", "MXCRYPTO" ], - "components_add": [ - "SOFTFP", - "RTX" - ], "public": false, "forced_reset_timeout": 5, "overrides": { @@ -8593,16 +8575,19 @@ "MCU_PSOC6" ], "components_add": [ - "CM4", "FLASHIAP", "QSPIF", - "BSP_DESIGN_MODUS", "CM0P_SLEEP" ], "macros_add": [ "MCU_PSOC6_M4", "CY_USING_HAL", - "MBED_TICKLESS" + "MBED_TICKLESS", + + // These are named like Mbed components, but actually seem to be a definitions + // used by the Cypress IDE-generated BSP. We just want to define them all the time. + "COMPONENT_BSP_DESIGN_MODUS=1", + "COMPONENT_CM4=1", ], "public": false, "supported_application_profiles": [ @@ -8626,10 +8611,6 @@ "BLE" ], "components_add": [ - "CAT1A", - "CAT1", - "PSOC6HAL", - "PSOC6", "WHD", "4343W", "CYW43XXX" @@ -8671,10 +8652,6 @@ "BLE" ], "components_add": [ - "CAT1A", - "CAT1", - "PSOC6HAL", - "PSOC6", "WHD", "43012", "CYW43XXX" @@ -8713,10 +8690,6 @@ "BLE" ], "components_add": [ - "CAT1A", - "CAT1", - "PSOC6HAL", - "PSOC6", "WHD", "4343W", "CYW43XXX" @@ -8751,14 +8724,9 @@ "BLE" ], "components_add": [ - "CAT1A", - "CAT1", - "PSOC6HAL", - "PSOC6", "WHD", "4343W", "CYW43XXX", - "UDB_SDIO_P2" ], "supported_form_factors": [ "ARDUINO" @@ -8771,6 +8739,7 @@ "macros_add": [ "CY8C6247BZI_D54", "CYHAL_UDB_SDIO", + "COMPONENT_UDB_SDIO_P2=1", "CYBSP_WIFI_CAPABLE" ], "device_name": "CY8C6247BZI-D54", @@ -8808,12 +8777,6 @@ "macros_add": [ "CY8C6347BZI_BLD53" ], - "components_add": [ - "CAT1A", - "CAT1", - "PSOC6HAL", - "PSOC6" - ], "device_name": "CY8C6347BZI-BLD53", "mbed_ram_start": "0x08002000", "mbed_ram_size": "0x00045800", @@ -8839,14 +8802,9 @@ "ARDUINO" ], "components_add": [ - "CAT1A", - "CAT1", - "PSOC6HAL", - "PSOC6", "WHD", "43438", "CYW43XXX", - "UDB_SDIO_P2" ], "extra_labels_add": [ "PSOC6_01", @@ -8856,6 +8814,7 @@ "macros_add": [ "CY8C6247BZI_D54", "CYHAL_UDB_SDIO", + "COMPONENT_UDB_SDIO_P2=1", "CYBSP_WIFI_CAPABLE" ], "device_name": "CY8C6247BZI-D54", @@ -8887,14 +8846,9 @@ "ARDUINO" ], "components_add": [ - "CAT1A", - "CAT1", - "PSOC6HAL", - "PSOC6", "WHD", "43012", "CYW43XXX", - "UDB_SDIO_P12" ], "device_has_remove": [ "ANALOGOUT" @@ -8907,6 +8861,7 @@ "macros_add": [ "CY8C6247FDI_D52", "CYHAL_UDB_SDIO", + "COMPONENT_UDB_SDIO_P12=1", "CYBSP_WIFI_CAPABLE" ], "device_name": "CY8C6247FDI-D52", @@ -8930,10 +8885,6 @@ "BLE" ], "components_add": [ - "CAT1A", - "CAT1", - "PSOC6HAL", - "PSOC6", "WHD", "4343W", "CYW43XXX", @@ -8988,10 +8939,6 @@ "PSA" ], "components_add": [ - "CAT1A", - "CAT1", - "PSOC6HAL", - "PSOC6", "WHD", "4343W", "CYW43XXX", @@ -9051,10 +8998,6 @@ "MCU_PSOC6_M4" ], "components_add": [ - "CAT1A", - "CAT1", - "PSOC6HAL", - "PSOC6", "SCL", "43012", "CYW43XXX" @@ -9236,7 +9179,7 @@ "network-default-interface-type": "ETHERNET" } }, - "EP_AGORA": { + "EP_AGORA": { // AKA Embedded Planet Agora (w/ dev kit for flashing and debugging) https://www.embeddedplanet.com/agora/ "inherits": [ "MCU_NRF52840" ], @@ -9252,7 +9195,10 @@ "help": "Enable inclusion of objects_extensions.h", "value": false } - } + }, + "components_add": [ + "TELIT_ME910" + ] }, "MCU_M261": { "core": "Cortex-M23", @@ -9345,7 +9291,6 @@ "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", - "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", @@ -9438,7 +9383,7 @@ "3701" ] }, - "EP_ATLAS": { + "EP_ATLAS": { // AKA Embedded Planet Atlas board. https://www.embeddedplanet.com/chronos/#atlas "inherits": ["MCU_NRF52840"], "device_name": "nRF52840_xxAA", "supported_form_factors": [], @@ -9454,7 +9399,7 @@ "macro_name": "MODEM_ON_BOARD_UART" } }, - "components_add": ["SPIF"], + "components_add": ["SPIF", "TELIT_ME310"], "components_remove": ["QSPIF"], "release_versions": ["5"], "macros_add": [ @@ -9520,7 +9465,6 @@ "SERIAL", "INTERRUPTIN", "LPTICKER", - "STDIO_MESSAGES", "FLASH", "SPI", "I2C", @@ -9591,14 +9535,14 @@ "macros": ["__TMPM4KN__"], "supported_toolchains": ["GCC_ARM"], "device_has": [ - "ANALOGIN", + "ANALOGIN", "INTERRUPTIN", "CRC", "I2C", "I2CSLAVE", "PORTIN", - "PORTINOUT", - "PORTOUT", + "PORTINOUT", + "PORTOUT", "PWMOUT", "RESET_REASON", "SERIAL", @@ -9606,8 +9550,7 @@ "SPI", "SPISLAVE", "USTICKER", - "STDIO_MESSAGES", - "MPU", + "MPU", "FLASH" ], "device_name": "TMPM4KNFYAFG", @@ -9657,7 +9600,6 @@ "I2CSLAVE", "I2C_ASYNCH", "RTC", - "STDIO_MESSAGES", "FLASH", "SLEEP", "USTICKER", @@ -9716,7 +9658,6 @@ "I2CSLAVE", "I2C_ASYNCH", "RTC", - "STDIO_MESSAGES", "FLASH", "SLEEP", "USTICKER", @@ -9763,8 +9704,6 @@ "I2C", "I2CSLAVE", "INTERRUPTIN", - "PORT_IN", - "PORT_OUT", "PWMOUT", "SERIAL", "SERIAL_FC",