├── .codespellrc ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── dependabot.yml ├── stale.yml └── workflows │ ├── auto-github-actions.yml │ ├── check-arduino.yml │ ├── report-size-deltas.yml │ └── spell-check.yml ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── Packages_Patches ├── Fab_SAM_Arduino │ └── hardware │ │ ├── hardware │ │ └── 1.6.18-alpha2 │ │ │ └── boards.txt │ │ └── samd │ │ ├── 1.6.18-alpha2 │ │ └── boards.txt │ │ ├── 1.7.0 │ │ └── boards.txt │ │ ├── 1.8.0 │ │ └── boards.txt │ │ └── 1.9.0 │ │ └── boards.txt ├── Maixduino │ └── hardware │ │ └── k210 │ │ ├── 0.3.10 │ │ └── cores │ │ │ └── arduino │ │ │ └── Stream.h │ │ └── 0.3.11 │ │ └── cores │ │ └── arduino │ │ └── Stream.h ├── STM32 │ └── hardware │ │ └── stm32 │ │ ├── 1.9.0 │ │ ├── system │ │ │ ├── STM32F4xx │ │ │ │ └── stm32f4xx_hal_conf_default.h │ │ │ └── STM32F7xx │ │ │ │ └── stm32f7xx_hal_conf_default.h │ │ └── variants │ │ │ ├── NUCLEO_F767ZI │ │ │ └── variant.h │ │ │ └── NUCLEO_L053R8 │ │ │ └── variant.h │ │ ├── 2.0.0 │ │ ├── system │ │ │ ├── STM32F4xx │ │ │ │ └── stm32f4xx_hal_conf_default.h │ │ │ └── STM32F7xx │ │ │ │ └── stm32f7xx_hal_conf_default.h │ │ └── variants │ │ │ ├── F765Z(G-I)T_F767Z(G-I)T_F777ZIT │ │ │ └── variant_NUCLEO_F767ZI.h │ │ │ ├── L052R(6-8)H_L053R(6-8)H │ │ │ └── variant_generic.h │ │ │ ├── STM32F7xx │ │ │ └── F765Z(G-I)T_F767Z(G-I)T_F777ZIT │ │ │ │ └── variant_NUCLEO_F767ZI.h │ │ │ └── STM32L0xx │ │ │ └── L052R(6-8)T_L053R(6-8)T_L063R8T │ │ │ └── variant_generic.h │ │ ├── 2.1.0 │ │ ├── system │ │ │ ├── STM32F4xx │ │ │ │ └── stm32f4xx_hal_conf_default.h │ │ │ └── STM32F7xx │ │ │ │ └── stm32f7xx_hal_conf_default.h │ │ └── variants │ │ │ ├── STM32F7xx │ │ │ └── F765Z(G-I)T_F767Z(G-I)T_F777ZIT │ │ │ │ └── variant_NUCLEO_F767ZI.h │ │ │ └── STM32L0xx │ │ │ └── L052R(6-8)T_L053R(6-8)T_L063R8T │ │ │ └── variant_generic.h │ │ ├── 2.2.0 │ │ ├── system │ │ │ ├── STM32F4xx │ │ │ │ └── stm32f4xx_hal_conf_default.h │ │ │ └── STM32F7xx │ │ │ │ └── stm32f7xx_hal_conf_default.h │ │ └── variants │ │ │ ├── STM32F7xx │ │ │ └── F765Z(G-I)T_F767Z(G-I)T_F777ZIT │ │ │ │ └── variant_NUCLEO_F767ZI.h │ │ │ └── STM32L0xx │ │ │ └── L052R(6-8)T_L053R(6-8)T_L063R8T │ │ │ └── variant_generic.h │ │ └── 2.3.0 │ │ ├── system │ │ ├── STM32F4xx │ │ │ └── stm32f4xx_hal_conf_default.h │ │ └── STM32F7xx │ │ │ └── stm32f7xx_hal_conf_default.h │ │ └── variants │ │ ├── STM32F7xx │ │ └── F765Z(G-I)T_F767Z(G-I)T_F777ZIT │ │ │ └── variant_NUCLEO_F767ZI.h │ │ └── STM32L0xx │ │ └── L052R(6-8)T_L053R(6-8)T_L063R8T │ │ └── variant_generic.h ├── Seeeduino │ └── hardware │ │ ├── nrf52 │ │ └── 1.0.0 │ │ │ ├── cores │ │ │ └── nRF5 │ │ │ │ ├── Print.cpp │ │ │ │ ├── Print.h │ │ │ │ └── Udp.h │ │ │ └── platform.txt │ │ ├── rp2040 │ │ ├── 1.9.3 │ │ │ └── variants │ │ │ │ └── rpipico │ │ │ │ └── pins_arduino.h │ │ └── 2.7.2 │ │ │ ├── boards.txt │ │ │ └── variants │ │ │ └── Seeed_XIAO_RP2040 │ │ │ └── pins_arduino.h │ │ └── samd │ │ ├── 1.7.0 │ │ └── boards.txt │ │ ├── 1.7.7 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Arduino.h │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.8 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Arduino.h │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.9 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Arduino.h │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.8.1 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Arduino.h │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.8.2 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Arduino.h │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ └── 1.8.3 │ │ ├── cores │ │ └── arduino │ │ │ ├── Arduino.h │ │ │ ├── Print.cpp │ │ │ └── Print.h │ │ └── platform.txt ├── SparkFun │ └── hardware │ │ └── samd │ │ └── 1.8.3 │ │ └── cores │ │ ├── arduino │ │ ├── Print.cpp │ │ └── Print.h │ │ └── arduino51 │ │ ├── Print.cpp │ │ └── Print.h ├── adafruit │ └── hardware │ │ ├── nrf52 │ │ ├── 0.19.0 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ ├── 0.20.1 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ ├── 0.20.5 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ ├── 0.21.0 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ ├── 0.22.0 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ ├── 0.22.1 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ ├── 0.23.0 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ ├── 0.24.0 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ ├── 1.0.0 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ ├── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── sparkfun_nrf52840_mini │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ ├── 1.1.0 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ ├── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── sparkfun_nrf52840_mini │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ ├── 1.2.0 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ │ └── nRF5 │ │ │ │ │ ├── Print.cpp │ │ │ │ │ ├── Print.h │ │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ │ ├── NINA_B112_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ ├── NINA_B302_ublox │ │ │ │ ├── pins_arduino.h │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ │ │ └── sparkfun_nrf52840_mini │ │ │ │ ├── variant.cpp │ │ │ │ └── variant.h │ │ └── 1.3.0 │ │ │ ├── boards.txt │ │ │ ├── cores │ │ │ └── nRF5 │ │ │ │ ├── Print.cpp │ │ │ │ ├── Print.h │ │ │ │ └── Udp.h │ │ │ ├── platform.txt │ │ │ └── variants │ │ │ ├── NINA_B112_ublox │ │ │ ├── pins_arduino.h │ │ │ ├── variant.cpp │ │ │ └── variant.h │ │ │ ├── NINA_B302_ublox │ │ │ ├── pins_arduino.h │ │ │ ├── variant.cpp │ │ │ └── variant.h │ │ │ └── sparkfun_nrf52840_mini │ │ │ ├── variant.cpp │ │ │ └── variant.h │ │ └── samd │ │ ├── 1.5.14 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.6.0 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.6.3 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.6.4 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.6.5 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.6.6 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.6.7 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.6.8 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.0 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.1 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.10 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.11 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.2 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.3 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.4 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.5 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.6 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.7 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ ├── 1.7.8 │ │ ├── cores │ │ │ └── arduino │ │ │ │ ├── Print.cpp │ │ │ │ └── Print.h │ │ └── platform.txt │ │ └── 1.7.9 │ │ ├── cores │ │ └── arduino │ │ │ ├── Print.cpp │ │ │ └── Print.h │ │ └── platform.txt ├── arduino │ └── hardware │ │ ├── mbed_portenta │ │ ├── 2.4.1 │ │ │ ├── cores │ │ │ │ └── arduino │ │ │ │ │ └── mbed │ │ │ │ │ └── connectivity │ │ │ │ │ └── lwipstack │ │ │ │ │ └── include │ │ │ │ │ └── lwipstack │ │ │ │ │ └── lwipopts.h │ │ │ ├── libraries │ │ │ │ └── SocketWrapper │ │ │ │ │ └── src │ │ │ │ │ ├── MbedUdp.cpp │ │ │ │ │ └── MbedUdp.h │ │ │ └── portenta_post_install.sh │ │ ├── 2.5.2 │ │ │ ├── cores │ │ │ │ └── arduino │ │ │ │ │ └── mbed │ │ │ │ │ └── connectivity │ │ │ │ │ └── lwipstack │ │ │ │ │ └── include │ │ │ │ │ └── lwipstack │ │ │ │ │ └── lwipopts.h │ │ │ ├── libraries │ │ │ │ └── SocketWrapper │ │ │ │ │ └── src │ │ │ │ │ ├── MbedUdp.cpp │ │ │ │ │ └── MbedUdp.h │ │ │ └── portenta_post_install.sh │ │ ├── 2.6.1 │ │ │ ├── cores │ │ │ │ └── arduino │ │ │ │ │ └── mbed │ │ │ │ │ └── connectivity │ │ │ │ │ └── lwipstack │ │ │ │ │ └── include │ │ │ │ │ └── lwipstack │ │ │ │ │ └── lwipopts.h │ │ │ ├── libraries │ │ │ │ └── SocketWrapper │ │ │ │ │ └── src │ │ │ │ │ ├── MbedUdp.cpp │ │ │ │ │ └── MbedUdp.h │ │ │ └── portenta_post_install.sh │ │ ├── 2.7.2 │ │ │ ├── cores │ │ │ │ └── arduino │ │ │ │ │ └── mbed │ │ │ │ │ └── connectivity │ │ │ │ │ └── lwipstack │ │ │ │ │ └── include │ │ │ │ │ └── lwipstack │ │ │ │ │ └── lwipopts.h │ │ │ └── portenta_post_install.sh │ │ ├── 2.8.0 │ │ │ ├── cores │ │ │ │ └── arduino │ │ │ │ │ └── mbed │ │ │ │ │ └── connectivity │ │ │ │ │ └── lwipstack │ │ │ │ │ └── include │ │ │ │ │ └── lwipstack │ │ │ │ │ └── lwipopts.h │ │ │ └── portenta_post_install.sh │ │ ├── 3.0.0 │ │ │ ├── cores │ │ │ │ └── arduino │ │ │ │ │ └── mbed │ │ │ │ │ └── connectivity │ │ │ │ │ └── lwipstack │ │ │ │ │ └── include │ │ │ │ │ └── lwipstack │ │ │ │ │ └── lwipopts.h │ │ │ └── portenta_post_install.sh │ │ ├── 3.0.1 │ │ │ ├── cores │ │ │ │ └── arduino │ │ │ │ │ └── mbed │ │ │ │ │ └── connectivity │ │ │ │ │ └── lwipstack │ │ │ │ │ └── include │ │ │ │ │ └── lwipstack │ │ │ │ │ └── lwipopts.h │ │ │ └── portenta_post_install.sh │ │ ├── 3.1.1 │ │ │ ├── cores │ │ │ │ └── arduino │ │ │ │ │ └── mbed │ │ │ │ │ └── connectivity │ │ │ │ │ └── lwipstack │ │ │ │ │ └── include │ │ │ │ │ └── lwipstack │ │ │ │ │ └── lwipopts.h │ │ │ └── portenta_post_install.sh │ │ ├── 3.3.0 │ │ │ └── portenta_post_install.sh │ │ └── 3.4.1 │ │ │ └── portenta_post_install.sh │ │ ├── sam │ │ └── 1.6.12 │ │ │ └── platform.txt │ │ └── samd │ │ ├── 1.8.10 │ │ └── platform.txt │ │ ├── 1.8.11 │ │ └── platform.txt │ │ ├── 1.8.12 │ │ └── platform.txt │ │ ├── 1.8.13 │ │ └── platform.txt │ │ ├── 1.8.6 │ │ ├── cores │ │ │ └── arduino │ │ │ │ └── Arduino.h │ │ └── platform.txt │ │ ├── 1.8.7 │ │ ├── cores │ │ │ └── arduino │ │ │ │ └── Arduino.h │ │ └── platform.txt │ │ ├── 1.8.8 │ │ ├── cores │ │ │ ├── Arduino.h │ │ │ └── arduino │ │ │ │ └── Arduino.h │ │ └── platform.txt │ │ └── 1.8.9 │ │ ├── cores │ │ └── arduino │ │ │ └── Arduino.h │ │ └── platform.txt ├── hardware │ └── teensy │ │ └── avr │ │ ├── boards.txt │ │ └── cores │ │ ├── teensy │ │ ├── Stream.cpp │ │ └── Stream.h │ │ ├── teensy3 │ │ ├── Stream.cpp │ │ └── Stream.h │ │ └── teensy4 │ │ ├── Stream.cpp │ │ └── Stream.h ├── industrialshields │ └── hardware │ │ └── avr │ │ ├── 1.1.36 │ │ └── cores │ │ │ └── industrialshields │ │ │ └── Udp.h │ │ └── 1.1.37 │ │ └── cores │ │ └── industrialshields │ │ └── Udp.h ├── realtek │ └── hardware │ │ └── AmebaD │ │ ├── 3.0.10 │ │ └── cores │ │ │ └── arduino │ │ │ └── avr │ │ │ └── pgmspace.h │ │ ├── 3.0.8 │ │ └── cores │ │ │ └── arduino │ │ │ └── avr │ │ │ └── pgmspace.h │ │ ├── 3.1.0 │ │ └── cores │ │ │ └── arduino │ │ │ └── avr │ │ │ └── pgmspace.h │ │ ├── 3.1.1 │ │ └── cores │ │ │ └── arduino │ │ │ └── avr │ │ │ └── pgmspace.h │ │ ├── 3.1.2 │ │ └── cores │ │ │ └── arduino │ │ │ └── avr │ │ │ └── pgmspace.h │ │ ├── 3.1.3 │ │ └── cores │ │ │ └── ambd │ │ │ └── avr │ │ │ └── pgmspace.h │ │ └── 3.1.4 │ │ └── cores │ │ └── ambd │ │ └── avr │ │ └── pgmspace.h └── rp2040 │ └── hardware │ └── rp2040 │ ├── 1.2.1 │ └── platform.txt │ ├── 1.2.2 │ └── platform.txt │ ├── 1.3.0 │ └── platform.txt │ ├── 1.3.1 │ ├── cores │ │ └── rp2040 │ │ │ └── Arduino.h │ └── platform.txt │ └── 1.4.0 │ ├── cores │ └── rp2040 │ │ └── Arduino.h │ └── platform.txt ├── README.md ├── changelog.md ├── examples ├── AP_SimpleWebServer │ ├── AP_SimpleWebServer.ino │ └── defines.h ├── AdvancedWebServer │ ├── AdvancedWebServer.ino │ └── defines.h ├── HTTPClient │ ├── BasicAuthGet │ │ ├── BasicAuthGet.ino │ │ └── defines.h │ ├── CustomHeader │ │ ├── CustomHeader.ino │ │ └── defines.h │ ├── DweetGet │ │ ├── DweetGet.ino │ │ └── defines.h │ ├── DweetPost │ │ ├── DweetPost.ino │ │ └── defines.h │ ├── HueBlink │ │ ├── HueBlink.ino │ │ └── defines.h │ ├── PostWithHeaders │ │ ├── PostWithHeaders.ino │ │ └── defines.h │ ├── SimpleDelete │ │ ├── SimpleDelete.ino │ │ └── defines.h │ ├── SimpleGet │ │ ├── SimpleGet.ino │ │ └── defines.h │ ├── SimpleHTTPExample │ │ ├── SimpleHTTPExample.ino │ │ └── defines.h │ ├── SimplePost │ │ ├── SimplePost.ino │ │ └── defines.h │ ├── SimplePut │ │ ├── SimplePut.ino │ │ └── defines.h │ ├── SimpleWebSocket │ │ ├── SimpleWebSocket.ino │ │ └── defines.h │ └── node_test_server │ │ ├── getPostPutDelete.js │ │ └── package.json ├── HelloServer │ ├── HelloServer.ino │ └── defines.h ├── HelloServer2 │ ├── HelloServer2.ino │ └── defines.h ├── HttpBasicAuth │ ├── HttpBasicAuth.ino │ └── defines.h ├── MQTTClient_Auth │ ├── MQTTClient_Auth.ino │ └── defines.h ├── MQTTClient_Basic │ ├── MQTTClient_Basic.ino │ └── defines.h ├── MQTT_ThingStream │ ├── MQTT_ThingStream.ino │ └── defines.h ├── PostServer │ ├── PostServer.ino │ └── defines.h ├── ScanNetworks │ ├── ScanNetworks.ino │ └── defines.h ├── SimpleAuthentication │ ├── SimpleAuthentication.ino │ └── defines.h ├── UdpNTPClient │ ├── UdpNTPClient.ino │ └── defines.h ├── UdpSendReceive │ ├── UdpSendReceive.ino │ └── defines.h ├── WebClient │ ├── WebClient.ino │ └── defines.h ├── WebClientRepeating │ ├── WebClientRepeating.ino │ └── defines.h ├── WebServer │ ├── WebServer.ino │ └── defines.h ├── WiFiMulti │ ├── AdvancedWebServer_WiFiMulti │ │ ├── AdvancedWebServer_WiFiMulti.ino │ │ └── defines.h │ ├── MQTTClient_Auth_WiFiMulti │ │ ├── MQTTClient_Auth_WiFiMulti.ino │ │ └── defines.h │ ├── MQTTClient_Basic_WiFiMulti │ │ ├── MQTTClient_Basic_WiFiMulti.ino │ │ └── defines.h │ ├── MQTT_ThingStream_WiFiMulti │ │ ├── MQTT_ThingStream_WiFiMulti.ino │ │ └── defines.h │ ├── WebClientRepeating_WiFiMulti │ │ ├── WebClientRepeating_WiFiMulti.ino │ │ └── defines.h │ ├── WebClient_WiFiMulti │ │ ├── WebClient_WiFiMulti.ino │ │ └── defines.h │ ├── WebServer_WiFiMulti │ │ ├── WebServer_WiFiMulti.ino │ │ └── defines.h │ └── WiFiUdpNtpClient_WiFiMulti │ │ ├── WiFiUdpNtpClient_WiFiMulti.ino │ │ └── defines.h ├── WiFiUdpNtpClient │ ├── WiFiUdpNtpClient.ino │ └── defines.h └── multiFileProject │ ├── defines.h │ ├── multiFileProject.cpp │ ├── multiFileProject.h │ └── multiFileProject.ino ├── keywords.txt ├── library.json ├── library.properties ├── pics ├── AdvancedWebServer.png ├── AdvancedWebServer_ESP32_C3.png ├── AdvancedWebServer_ESP32_S3.png ├── AdvancedWebServer_NanoRP2040Connect.png ├── AdvancedWebServer_Portenta_H7.png ├── AdvancedWebServer_WiFiMulti_NanoRP2040Connect.png ├── AdvancedWebServer_WiFiMulti_RP2040W.png └── AdvancedWebServer_v1.0.6.png ├── platformio └── platformio.ini ├── src ├── Parsing-impl.h ├── Uri.h ├── WiFiHttpClient.h ├── WiFiWebServer-impl.h ├── WiFiWebServer.h ├── WiFiWebServer.hpp ├── WiFi_HTTPClient │ ├── WiFi_HttpClient.cpp │ ├── WiFi_HttpClient.h │ ├── WiFi_URLEncoder.cpp │ ├── WiFi_URLEncoder.h │ ├── WiFi_WebSocketClient.cpp │ └── WiFi_WebSocketClient.h ├── libb64 │ ├── base64.cpp │ ├── base64.h │ ├── cdecode.c │ ├── cdecode.h │ ├── cencode.c │ └── cencode.h └── utility │ ├── ESP_RequestHandlersImpl.h │ ├── RequestHandler.h │ ├── RequestHandlersImpl.h │ ├── RingBuffer.cpp │ ├── RingBuffer.h │ ├── WiFiDebug.h │ ├── esp_detail │ ├── mimetable.cpp │ └── mimetable.h │ └── mimetable.h └── utils ├── astyle_library.conf └── restyle.sh /.codespellrc: -------------------------------------------------------------------------------- 1 | # See: https://github.com/codespell-project/codespell#using-a-config-file 2 | [codespell] 3 | # In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: 4 | ignore-words-list = , 5 | check-filenames = 6 | check-hidden = 7 | skip = ./.git,./src,./examples,./Packages_Patches,./LibraryPatches 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Describe the bug 11 | 12 | A clear and concise description of what the bug is. 13 | 14 | ### Steps to Reproduce 15 | 16 | Steps to reproduce the behavior. Including the [MRE](https://stackoverflow.com/help/minimal-reproducible-example) sketches 17 | 18 | ### Expected behavior 19 | 20 | A clear and concise description of what you expected to happen. 21 | 22 | ### Actual behavior 23 | 24 | A clear and concise description of what you expected to happen. 25 | 26 | ### Debug and AT-command log (if applicable) 27 | 28 | A clear and concise description of what you expected to happen. 29 | 30 | ### Screenshots 31 | 32 | If applicable, add screenshots to help explain your problem. 33 | 34 | ### Information 35 | 36 | Please ensure to specify the following: 37 | 38 | * Arduino IDE version (e.g. 1.8.19) or Platform.io version 39 | * Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v3.0.2, ArduinoCore-mbed v3.4.1, etc.) 40 | * Contextual information (e.g. what you were trying to achieve) 41 | * Simplest possible steps to reproduce 42 | * Anything that might be relevant in your opinion, such as: 43 | * Operating system (Windows, Ubuntu, etc.) and the output of `uname -a` 44 | * Network configuration 45 | 46 | 47 | ### Example 48 | 49 | ``` 50 | Arduino IDE version: 1.8.19 51 | RASPBERRY_PI_PICO board 52 | ArduinoCore-mbed v3.4.1 53 | OS: Ubuntu 20.04 LTS 54 | Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux 55 | 56 | Context: 57 | I encountered a crash while using this library 58 | Steps to reproduce: 59 | 1. ... 60 | 2. ... 61 | 3. ... 62 | 4. ... 63 | ``` 64 | 65 | ### Additional context 66 | 67 | Add any other context about the problem here. 68 | 69 | --- 70 | 71 | ### Sending Feature Requests 72 | 73 | Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful. 74 | 75 | There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/WiFiWebServer/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them. 76 | 77 | --- 78 | 79 | ### Sending Pull Requests 80 | 81 | Pull Requests with changes and fixes are also welcome! 82 | 83 | Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux) 84 | 85 | 1. Change directory to the library GitHub 86 | 87 | ``` 88 | xy@xy-Inspiron-3593:~$ cd Arduino/xy/WiFiWebServer_GitHub/ 89 | xy@xy-Inspiron-3593:~/Arduino/xy/WiFiWebServer_GitHub$ 90 | ``` 91 | 92 | 2. Issue astyle command 93 | 94 | ``` 95 | xy@xy-Inspiron-3593:~/Arduino/xy/WiFiWebServer_GitHub$ bash utils/restyle.sh 96 | ``` 97 | 98 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file 2 | version: 2 3 | 4 | updates: 5 | # Configure check for outdated GitHub Actions actions in workflows. 6 | # See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot 7 | - package-ecosystem: github-actions 8 | directory: / # Check the repository's workflows under /.github/workflows/ 9 | schedule: 10 | interval: daily 11 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-stale - https://github.com/probot/stale 2 | 3 | daysUntilStale: 60 4 | daysUntilClose: 14 5 | limitPerRun: 30 6 | staleLabel: stale 7 | exemptLabels: 8 | - pinned 9 | - security 10 | - "to be implemented" 11 | - "for reference" 12 | - "move to PR" 13 | - "enhancement" 14 | 15 | only: issues 16 | onlyLabels: [] 17 | exemptProjects: false 18 | exemptMilestones: false 19 | exemptAssignees: false 20 | 21 | markComment: > 22 | [STALE_SET] This issue has been automatically marked as stale because it has not had 23 | recent activity. It will be closed in 14 days if no further activity occurs. Thank you 24 | for your contributions. 25 | 26 | unmarkComment: > 27 | [STALE_CLR] This issue has been removed from the stale queue. Please ensure activity to keep it opening the future. 28 | 29 | closeComment: > 30 | [STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions. 31 | 32 | -------------------------------------------------------------------------------- /.github/workflows/auto-github-actions.yml: -------------------------------------------------------------------------------- 1 | name: auto-github-actions 2 | on: [push] 3 | jobs: 4 | check-bats-version: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - uses: actions/checkout@v3 8 | - uses: actions/setup-node@v3 9 | with: 10 | node-version: '14' 11 | - run: npm install -g bats 12 | - run: bats -v 13 | -------------------------------------------------------------------------------- /.github/workflows/check-arduino.yml: -------------------------------------------------------------------------------- 1 | name: Check Arduino 2 | 3 | # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows 4 | on: 5 | push: 6 | pull_request: 7 | schedule: 8 | # Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint. 9 | - cron: "0 8 * * TUE" 10 | workflow_dispatch: 11 | repository_dispatch: 12 | 13 | jobs: 14 | lint: 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: Checkout repository 19 | uses: actions/checkout@v3 20 | 21 | - name: Arduino Lint 22 | uses: arduino/arduino-lint-action@v1 23 | with: 24 | compliance: specification 25 | library-manager: update 26 | # Always use this setting for official repositories. Remove for 3rd party projects. 27 | official: true 28 | project-type: library 29 | -------------------------------------------------------------------------------- /.github/workflows/report-size-deltas.yml: -------------------------------------------------------------------------------- 1 | name: Report Size Deltas 2 | 3 | on: 4 | schedule: 5 | - cron: '*/5 * * * *' 6 | 7 | jobs: 8 | report: 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - name: Comment size deltas reports to PRs 13 | uses: arduino/report-size-deltas@v1 14 | with: 15 | # The name of the workflow artifact created by the "Compile Examples" workflow 16 | sketches-reports-source: sketches-reports 17 | -------------------------------------------------------------------------------- /.github/workflows/spell-check.yml: -------------------------------------------------------------------------------- 1 | name: Spell Check 2 | 3 | on: 4 | pull_request: 5 | push: 6 | schedule: 7 | # run every Tuesday at 3 AM UTC 8 | - cron: "0 3 * * 2" 9 | workflow_dispatch: 10 | repository_dispatch: 11 | 12 | jobs: 13 | spellcheck: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v3 19 | 20 | # See: https://github.com/codespell-project/actions-codespell/blob/master/README.md 21 | - name: Spell check 22 | uses: codespell-project/actions-codespell@master 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to WiFiWebServer 2 | 3 | ### Reporting Bugs 4 | 5 | Please report bugs in [WiFiWebServer](https://github.com/khoih-prog/WiFiWebServer/issues/new) if you find them. 6 | 7 | However, before reporting a bug please check through the following: 8 | 9 | * [Existing Open Issues](https://github.com/khoih-prog/WiFiWebServer/issues) - someone might have already encountered this. 10 | 11 | If you don't find anything, please [open a new issue](https://github.com/khoih-prog/WiFiWebServer/issues/new). 12 | 13 | ### How to submit a bug report 14 | 15 | Please ensure to specify the following: 16 | 17 | * Arduino IDE version (e.g. 1.8.19) or Platform.io version 18 | * Board Core Version (e.g. Arduino SAMDUE core v1.6.12, ESP8266 core v3.0.2, ArduinoCore-mbed v3.4.1, etc.) 19 | * Contextual information (e.g. what you were trying to achieve) 20 | * Simplest possible steps to reproduce 21 | * Anything that might be relevant in your opinion, such as: 22 | * Operating system (Windows, Ubuntu, etc.) and the output of `uname -a` 23 | * Network configuration 24 | 25 | 26 | ### Example 27 | 28 | ``` 29 | Arduino IDE version: 1.8.19 30 | RASPBERRY_PI_PICO board 31 | ArduinoCore-mbed v3.4.1 32 | OS: Ubuntu 20.04 LTS 33 | Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux 34 | 35 | Context: 36 | I encountered a crash while using this library 37 | Steps to reproduce: 38 | 1. ... 39 | 2. ... 40 | 3. ... 41 | 4. ... 42 | ``` 43 | 44 | ### Additional context 45 | 46 | Add any other context about the problem here. 47 | 48 | --- 49 | 50 | ### Sending Feature Requests 51 | 52 | Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful. 53 | 54 | There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/WiFiWebServer/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them. 55 | 56 | --- 57 | 58 | ### Sending Pull Requests 59 | 60 | Pull Requests with changes and fixes are also welcome! 61 | 62 | Please use the `astyle` to reformat the updated library code as follows (demo for Ubuntu Linux) 63 | 64 | 1. Change directory to the library GitHub 65 | 66 | ``` 67 | xy@xy-Inspiron-3593:~$ cd Arduino/xy/WiFiWebServer_GitHub/ 68 | xy@xy-Inspiron-3593:~/Arduino/xy/WiFiWebServer_GitHub$ 69 | ``` 70 | 71 | 2. Issue astyle command 72 | 73 | ``` 74 | xy@xy-Inspiron-3593:~/Arduino/xy/WiFiWebServer_GitHub$ bash utils/restyle.sh 75 | ``` 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Khoi Hoang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages_Patches/Seeeduino/hardware/nrf52/1.0.0/cores/nRF5/Print.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include // for size_t 23 | 24 | #include "WString.h" 25 | #include "Printable.h" 26 | 27 | #define DEC 10 28 | #define HEX 16 29 | #define OCT 8 30 | #define BIN 2 31 | 32 | class Print 33 | { 34 | private: 35 | int write_error; 36 | size_t printNumber(unsigned long, uint8_t); 37 | size_t printULLNumber(unsigned long long, uint8_t); 38 | size_t printFloat(double, int); 39 | protected: 40 | void setWriteError(int err = 1) 41 | { 42 | write_error = err; 43 | } 44 | public: 45 | Print() : write_error(0) {} 46 | 47 | int getWriteError() 48 | { 49 | return write_error; 50 | } 51 | void clearWriteError() 52 | { 53 | setWriteError(0); 54 | } 55 | 56 | virtual size_t write(uint8_t) = 0; 57 | size_t write(const char *str) 58 | { 59 | if (str == NULL) 60 | return 0; 61 | 62 | return write((const uint8_t *)str, strlen(str)); 63 | } 64 | virtual size_t write(const uint8_t *buffer, size_t size); 65 | size_t write(const char *buffer, size_t size) 66 | { 67 | return write((const uint8_t *)buffer, size); 68 | } 69 | 70 | // default to zero, meaning "a single write may block" 71 | // should be overridden by subclasses with buffering 72 | virtual int availableForWrite() 73 | { 74 | return 0; 75 | } 76 | 77 | size_t print(const __FlashStringHelper *); 78 | size_t print(const String &); 79 | size_t print(const char[]); 80 | size_t print(char); 81 | size_t print(unsigned char, int = DEC); 82 | size_t print(int, int = DEC); 83 | size_t print(unsigned int, int = DEC); 84 | size_t print(long, int = DEC); 85 | size_t print(unsigned long, int = DEC); 86 | size_t print(long long, int = DEC); 87 | size_t print(unsigned long long, int = DEC); 88 | size_t print(double, int = 2); 89 | size_t print(const Printable&); 90 | 91 | size_t println(const __FlashStringHelper *); 92 | size_t println(const String &s); 93 | size_t println(const char[]); 94 | size_t println(char); 95 | size_t println(unsigned char, int = DEC); 96 | size_t println(int, int = DEC); 97 | size_t println(unsigned int, int = DEC); 98 | size_t println(long, int = DEC); 99 | size_t println(unsigned long, int = DEC); 100 | size_t println(long long, int = DEC); 101 | size_t println(unsigned long long, int = DEC); 102 | size_t println(double, int = 2); 103 | size_t println(const Printable&); 104 | size_t println(void); 105 | 106 | size_t printf(const char * format, ...); 107 | 108 | size_t printBuffer(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 109 | size_t printBuffer(char const buffer[], int size, char delim = ' ', int byteline = 0) 110 | { 111 | return printBuffer((uint8_t const*) buffer, size, delim, byteline); 112 | } 113 | 114 | size_t printBufferReverse(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 115 | size_t printBufferReverse(char const buffer[], int size, char delim = ' ', int byteline = 0) 116 | { 117 | return printBufferReverse((uint8_t const*) buffer, size, delim, byteline); 118 | } 119 | 120 | virtual void flush() { /* Empty implementation for backward compatibility */ } 121 | }; 122 | 123 | 124 | -------------------------------------------------------------------------------- /Packages_Patches/Seeeduino/hardware/rp2040/1.9.3/variants/rpipico/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Pin definitions taken from: 4 | // https://datasheets.raspberrypi.org/pico/pico-datasheet.pdf 5 | 6 | //KH 7 | // Pin count 8 | // ---- 9 | #define PINS_COUNT (30u) 10 | #define NUM_DIGITAL_PINS (30u) 11 | #define NUM_ANALOG_INPUTS (4u) 12 | #define NUM_ANALOG_OUTPUTS (0u) 13 | ////// 14 | 15 | // LEDs 16 | #define PIN_LED (25u) 17 | #define PIN_LED_0 (16u) 18 | #define PIN_LED_1 (17u) 19 | #define PIN_LED_2 (18u) 20 | // Serial 21 | #define PIN_SERIAL1_TX (0u) 22 | #define PIN_SERIAL1_RX (1u) 23 | 24 | #define PIN_SERIAL2_TX (31u) 25 | #define PIN_SERIAL2_RX (31u) 26 | 27 | 28 | // SPI 29 | #define PIN_SPI0_MISO (4u) 30 | #define PIN_SPI0_MOSI (3u) 31 | #define PIN_SPI0_SCK (2u) 32 | #define PIN_SPI0_SS (5u) 33 | 34 | // static const int SS = PIN_SPI0_SS; // SPI Slave SS not used. Set here only for reference. 35 | // static const int MOSI = PIN_SPI0_MOSI; 36 | // static const int MISO = PIN_SPI0_MISO; 37 | // static const int SCK = PIN_SPI0_SCK; 38 | 39 | #define PIN_SPI1_MISO (12u) 40 | #define PIN_SPI1_MOSI (31u) 41 | #define PIN_SPI1_SCK (31u) 42 | #define PIN_SPI1_SS (31u) 43 | // static const int MISO_1 = PIN_SPI1_MISO; 44 | 45 | #define PIN_A0 (26u) 46 | #define PIN_A1 (27u) 47 | #define PIN_A2 (28u) 48 | #define PIN_A3 (29u) 49 | 50 | static const int A0 = PIN_A0; 51 | static const int A1 = PIN_A1; 52 | static const int A2 = PIN_A2; 53 | static const int A3 = PIN_A3; 54 | 55 | // D0 - D10 56 | #define D26 (26u) 57 | #define D1 (27u) 58 | #define D2 (28u) 59 | #define D3 (29u) 60 | #define D4 (6u) 61 | #define D5 (7u) 62 | #define D0 (0u) 63 | #define D7 (1u) 64 | #define D8 (2u) 65 | #define D9 (4u) 66 | #define D10 (3u) 67 | 68 | // static const int 0 = D0; 69 | 70 | // Wire 71 | #define PIN_WIRE0_SDA (6u) 72 | #define PIN_WIRE0_SCL (7u) 73 | 74 | #define PIN_WIRE1_SDA (26u) 75 | #define PIN_WIRE1_SCL (27u) 76 | 77 | // #define SERIAL_HOWMANY (3u) 78 | // #define SPI_HOWMANY (2u) 79 | // #define WIRE_HOWMANY (2u) 80 | 81 | // #include "../generic/common.h" 82 | -------------------------------------------------------------------------------- /Packages_Patches/Seeeduino/hardware/rp2040/2.7.2/variants/Seeed_XIAO_RP2040/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #ifndef __PINS_ARDUINO__ 6 | #define __PINS_ARDUINO__ 7 | 8 | #ifdef __cplusplus 9 | extern "C" unsigned int PINCOUNT_fn(); 10 | #endif 11 | 12 | // Pin count 13 | // ---- 14 | #define PINS_COUNT (PINCOUNT_fn()) 15 | #define NUM_DIGITAL_PINS (30u) 16 | #define NUM_ANALOG_INPUTS (4u) 17 | #define NUM_ANALOG_OUTPUTS (0u) 18 | 19 | extern PinName digitalPinToPinName(pin_size_t P); 20 | 21 | // LEDs 22 | // ---- 23 | #define PIN_LED (25u) 24 | #define LED_BUILTIN PIN_LED 25 | 26 | // Digital pins 27 | // ---- 28 | #define PIN_D0 (26u) 29 | #define PIN_D1 (27u) 30 | #define PIN_D2 (28u) 31 | #define PIN_D3 (29u) 32 | #define PIN_D4 (6u) 33 | #define PIN_D5 (7u) 34 | #define PIN_D6 (0u) 35 | #define PIN_D7 (1u) 36 | #define PIN_D8 (2u) 37 | #define PIN_D9 (4u) 38 | #define PIN_D10 (3u) 39 | 40 | static const uint8_t D0 = PIN_D0; 41 | static const uint8_t D1 = PIN_D1; 42 | static const uint8_t D2 = PIN_D2; 43 | static const uint8_t D3 = PIN_D3; 44 | static const uint8_t D4 = PIN_D4; 45 | static const uint8_t D5 = PIN_D5; 46 | static const uint8_t D6 = PIN_D6; 47 | static const uint8_t D7 = PIN_D7; 48 | static const uint8_t D8 = PIN_D8; 49 | static const uint8_t D9 = PIN_D9; 50 | static const uint8_t D10 = PIN_D10; 51 | 52 | 53 | // Analog pins 54 | // ----------- 55 | #define PIN_A0 (26u) 56 | #define PIN_A1 (27u) 57 | #define PIN_A2 (28u) 58 | #define PIN_A3 (29u) 59 | 60 | static const uint8_t A0 = PIN_A0; 61 | static const uint8_t A1 = PIN_A1; 62 | static const uint8_t A2 = PIN_A2; 63 | static const uint8_t A3 = PIN_A3; 64 | 65 | #define ADC_RESOLUTION 12 66 | 67 | // Serial 68 | #define PIN_SERIAL_TX (0ul) 69 | #define PIN_SERIAL_RX (1ul) 70 | 71 | // SPI 72 | //#define PIN_SPI_MISO (16u) 73 | //#define PIN_SPI_MOSI (19u) 74 | //#define PIN_SPI_SCK (18u) 75 | //#define PIN_SPI_SS (17u) 76 | // KH fix wrong pin 77 | #define PIN_SPI_MISO (D9) 78 | #define PIN_SPI_MOSI (D10) 79 | #define PIN_SPI_SCK (D8) 80 | #define PIN_SPI_SS (D7) 81 | ////// 82 | 83 | static const uint8_t SS = PIN_SPI_SS; // SPI Slave SS not used. Set here only for reference. 84 | static const uint8_t MOSI = PIN_SPI_MOSI; 85 | static const uint8_t MISO = PIN_SPI_MISO; 86 | static const uint8_t SCK = PIN_SPI_SCK; 87 | 88 | // Wire 89 | #define SDA (6u) 90 | #define SCL (7u) 91 | 92 | #define SERIAL_HOWMANY 1 93 | #define SERIAL1_TX (digitalPinToPinName(PIN_SERIAL_TX)) 94 | #define SERIAL1_RX (digitalPinToPinName(PIN_SERIAL_RX)) 95 | 96 | #define SERIAL_CDC 1 97 | #define HAS_UNIQUE_ISERIAL_DESCRIPTOR 98 | #define BOARD_VENDORID 0x2886 99 | #define BOARD_PRODUCTID 0x8042 100 | #define BOARD_NAME "RaspberryPi Pico" 101 | 102 | uint8_t getUniqueSerialNumber(uint8_t* name); 103 | void _ontouch1200bps_(); 104 | 105 | #define SPI_HOWMANY (1) 106 | #define SPI_MISO (digitalPinToPinName(PIN_SPI_MISO)) 107 | #define SPI_MOSI (digitalPinToPinName(PIN_SPI_MOSI)) 108 | #define SPI_SCK (digitalPinToPinName(PIN_SPI_SCK)) 109 | 110 | #define WIRE_HOWMANY (1) 111 | #define I2C_SDA (digitalPinToPinName(SDA)) 112 | #define I2C_SCL (digitalPinToPinName(SCL)) 113 | 114 | #define digitalPinToPort(P) (digitalPinToPinName(P)/32) 115 | 116 | #define SERIAL_PORT_USBVIRTUAL SerialUSB 117 | #define SERIAL_PORT_MONITOR SerialUSB 118 | #define SERIAL_PORT_HARDWARE Serial1 119 | #define SERIAL_PORT_HARDWARE_OPEN Serial1 120 | 121 | #define USB_MAX_POWER (500) 122 | 123 | #endif //__PINS_ARDUINO__ 124 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.19.0/cores/nRF5/Print.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include // for size_t 23 | 24 | #include "WString.h" 25 | #include "Printable.h" 26 | 27 | #define DEC 10 28 | #define HEX 16 29 | #define OCT 8 30 | #define BIN 2 31 | 32 | class Print 33 | { 34 | private: 35 | int write_error; 36 | size_t printNumber(unsigned long, uint8_t); 37 | size_t printULLNumber(unsigned long long, uint8_t); 38 | size_t printFloat(double, int); 39 | protected: 40 | void setWriteError(int err = 1) 41 | { 42 | write_error = err; 43 | } 44 | public: 45 | Print() : write_error(0) {} 46 | 47 | int getWriteError() 48 | { 49 | return write_error; 50 | } 51 | void clearWriteError() 52 | { 53 | setWriteError(0); 54 | } 55 | 56 | virtual size_t write(uint8_t) = 0; 57 | size_t write(const char *str) 58 | { 59 | if (str == NULL) 60 | return 0; 61 | 62 | return write((const uint8_t *)str, strlen(str)); 63 | } 64 | virtual size_t write(const uint8_t *buffer, size_t size); 65 | size_t write(const char *buffer, size_t size) 66 | { 67 | return write((const uint8_t *)buffer, size); 68 | } 69 | 70 | // default to zero, meaning "a single write may block" 71 | // should be overridden by subclasses with buffering 72 | virtual int availableForWrite() 73 | { 74 | return 0; 75 | } 76 | 77 | size_t print(const __FlashStringHelper *); 78 | size_t print(const String &); 79 | size_t print(const char[]); 80 | size_t print(char); 81 | size_t print(unsigned char, int = DEC); 82 | size_t print(int, int = DEC); 83 | size_t print(unsigned int, int = DEC); 84 | size_t print(long, int = DEC); 85 | size_t print(unsigned long, int = DEC); 86 | size_t print(long long, int = DEC); 87 | size_t print(unsigned long long, int = DEC); 88 | size_t print(double, int = 2); 89 | size_t print(const Printable&); 90 | 91 | size_t println(const __FlashStringHelper *); 92 | size_t println(const String &s); 93 | size_t println(const char[]); 94 | size_t println(char); 95 | size_t println(unsigned char, int = DEC); 96 | size_t println(int, int = DEC); 97 | size_t println(unsigned int, int = DEC); 98 | size_t println(long, int = DEC); 99 | size_t println(unsigned long, int = DEC); 100 | size_t println(long long, int = DEC); 101 | size_t println(unsigned long long, int = DEC); 102 | size_t println(double, int = 2); 103 | size_t println(const Printable&); 104 | size_t println(void); 105 | 106 | size_t printf(const char * format, ...); 107 | 108 | size_t printBuffer(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 109 | size_t printBuffer(char const buffer[], int size, char delim = ' ', int byteline = 0) 110 | { 111 | return printBuffer((uint8_t const*) buffer, size, delim, byteline); 112 | } 113 | 114 | size_t printBufferReverse(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 115 | size_t printBufferReverse(char const buffer[], int size, char delim = ' ', int byteline = 0) 116 | { 117 | return printBufferReverse((uint8_t const*) buffer, size, delim, byteline); 118 | } 119 | 120 | virtual void flush() { /* Empty implementation for backward compatibility */ } 121 | }; 122 | 123 | 124 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.19.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.19.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.19.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.19.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.1/cores/nRF5/Print.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include // for size_t 23 | 24 | #include "WString.h" 25 | #include "Printable.h" 26 | 27 | #define DEC 10 28 | #define HEX 16 29 | #define OCT 8 30 | #define BIN 2 31 | 32 | class Print 33 | { 34 | private: 35 | int write_error; 36 | size_t printNumber(unsigned long, uint8_t); 37 | size_t printULLNumber(unsigned long long, uint8_t); 38 | size_t printFloat(double, int); 39 | protected: 40 | void setWriteError(int err = 1) 41 | { 42 | write_error = err; 43 | } 44 | public: 45 | Print() : write_error(0) {} 46 | 47 | int getWriteError() 48 | { 49 | return write_error; 50 | } 51 | void clearWriteError() 52 | { 53 | setWriteError(0); 54 | } 55 | 56 | virtual size_t write(uint8_t) = 0; 57 | size_t write(const char *str) 58 | { 59 | if (str == NULL) 60 | return 0; 61 | 62 | return write((const uint8_t *)str, strlen(str)); 63 | } 64 | virtual size_t write(const uint8_t *buffer, size_t size); 65 | size_t write(const char *buffer, size_t size) 66 | { 67 | return write((const uint8_t *)buffer, size); 68 | } 69 | 70 | // default to zero, meaning "a single write may block" 71 | // should be overridden by subclasses with buffering 72 | virtual int availableForWrite() 73 | { 74 | return 0; 75 | } 76 | 77 | size_t print(const __FlashStringHelper *); 78 | size_t print(const String &); 79 | size_t print(const char[]); 80 | size_t print(char); 81 | size_t print(unsigned char, int = DEC); 82 | size_t print(int, int = DEC); 83 | size_t print(unsigned int, int = DEC); 84 | size_t print(long, int = DEC); 85 | size_t print(unsigned long, int = DEC); 86 | size_t print(long long, int = DEC); 87 | size_t print(unsigned long long, int = DEC); 88 | size_t print(double, int = 2); 89 | size_t print(const Printable&); 90 | 91 | size_t println(const __FlashStringHelper *); 92 | size_t println(const String &s); 93 | size_t println(const char[]); 94 | size_t println(char); 95 | size_t println(unsigned char, int = DEC); 96 | size_t println(int, int = DEC); 97 | size_t println(unsigned int, int = DEC); 98 | size_t println(long, int = DEC); 99 | size_t println(unsigned long, int = DEC); 100 | size_t println(long long, int = DEC); 101 | size_t println(unsigned long long, int = DEC); 102 | size_t println(double, int = 2); 103 | size_t println(const Printable&); 104 | size_t println(void); 105 | 106 | size_t printf(const char * format, ...); 107 | 108 | size_t printBuffer(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 109 | size_t printBuffer(char const buffer[], int size, char delim = ' ', int byteline = 0) 110 | { 111 | return printBuffer((uint8_t const*) buffer, size, delim, byteline); 112 | } 113 | 114 | size_t printBufferReverse(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 115 | size_t printBufferReverse(char const buffer[], int size, char delim = ' ', int byteline = 0) 116 | { 117 | return printBufferReverse((uint8_t const*) buffer, size, delim, byteline); 118 | } 119 | 120 | virtual void flush() { /* Empty implementation for backward compatibility */ } 121 | }; 122 | 123 | 124 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.1/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.1/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.1/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.1/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.5/cores/nRF5/Print.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include // for size_t 23 | 24 | #include "WString.h" 25 | #include "Printable.h" 26 | 27 | #define DEC 10 28 | #define HEX 16 29 | #define OCT 8 30 | #define BIN 2 31 | 32 | class Print 33 | { 34 | private: 35 | int write_error; 36 | size_t printNumber(unsigned long, uint8_t); 37 | size_t printULLNumber(unsigned long long, uint8_t); 38 | size_t printFloat(double, int); 39 | protected: 40 | void setWriteError(int err = 1) 41 | { 42 | write_error = err; 43 | } 44 | public: 45 | Print() : write_error(0) {} 46 | 47 | int getWriteError() 48 | { 49 | return write_error; 50 | } 51 | void clearWriteError() 52 | { 53 | setWriteError(0); 54 | } 55 | 56 | virtual size_t write(uint8_t) = 0; 57 | size_t write(const char *str) 58 | { 59 | if (str == NULL) 60 | return 0; 61 | 62 | return write((const uint8_t *)str, strlen(str)); 63 | } 64 | virtual size_t write(const uint8_t *buffer, size_t size); 65 | size_t write(const char *buffer, size_t size) 66 | { 67 | return write((const uint8_t *)buffer, size); 68 | } 69 | 70 | // default to zero, meaning "a single write may block" 71 | // should be overridden by subclasses with buffering 72 | virtual int availableForWrite() 73 | { 74 | return 0; 75 | } 76 | 77 | size_t print(const __FlashStringHelper *); 78 | size_t print(const String &); 79 | size_t print(const char[]); 80 | size_t print(char); 81 | size_t print(unsigned char, int = DEC); 82 | size_t print(int, int = DEC); 83 | size_t print(unsigned int, int = DEC); 84 | size_t print(long, int = DEC); 85 | size_t print(unsigned long, int = DEC); 86 | size_t print(long long, int = DEC); 87 | size_t print(unsigned long long, int = DEC); 88 | size_t print(double, int = 2); 89 | size_t print(const Printable&); 90 | 91 | size_t println(const __FlashStringHelper *); 92 | size_t println(const String &s); 93 | size_t println(const char[]); 94 | size_t println(char); 95 | size_t println(unsigned char, int = DEC); 96 | size_t println(int, int = DEC); 97 | size_t println(unsigned int, int = DEC); 98 | size_t println(long, int = DEC); 99 | size_t println(unsigned long, int = DEC); 100 | size_t println(long long, int = DEC); 101 | size_t println(unsigned long long, int = DEC); 102 | size_t println(double, int = 2); 103 | size_t println(const Printable&); 104 | size_t println(void); 105 | 106 | size_t printf(const char * format, ...); 107 | 108 | size_t printBuffer(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 109 | size_t printBuffer(char const buffer[], int size, char delim = ' ', int byteline = 0) 110 | { 111 | return printBuffer((uint8_t const*) buffer, size, delim, byteline); 112 | } 113 | 114 | size_t printBufferReverse(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 115 | size_t printBufferReverse(char const buffer[], int size, char delim = ' ', int byteline = 0) 116 | { 117 | return printBufferReverse((uint8_t const*) buffer, size, delim, byteline); 118 | } 119 | 120 | virtual void flush() { /* Empty implementation for backward compatibility */ } 121 | }; 122 | 123 | 124 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.5/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.5/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.5/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.20.5/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.21.0/cores/nRF5/Print.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include // for size_t 23 | 24 | #include "WString.h" 25 | #include "Printable.h" 26 | 27 | #define DEC 10 28 | #define HEX 16 29 | #define OCT 8 30 | #define BIN 2 31 | 32 | class Print 33 | { 34 | private: 35 | int write_error; 36 | size_t printNumber(unsigned long, uint8_t); 37 | size_t printULLNumber(unsigned long long, uint8_t); 38 | size_t printFloat(double, int); 39 | protected: 40 | void setWriteError(int err = 1) 41 | { 42 | write_error = err; 43 | } 44 | public: 45 | Print() : write_error(0) {} 46 | 47 | int getWriteError() 48 | { 49 | return write_error; 50 | } 51 | void clearWriteError() 52 | { 53 | setWriteError(0); 54 | } 55 | 56 | virtual size_t write(uint8_t) = 0; 57 | size_t write(const char *str) 58 | { 59 | if (str == NULL) 60 | return 0; 61 | 62 | return write((const uint8_t *)str, strlen(str)); 63 | } 64 | virtual size_t write(const uint8_t *buffer, size_t size); 65 | size_t write(const char *buffer, size_t size) 66 | { 67 | return write((const uint8_t *)buffer, size); 68 | } 69 | 70 | // default to zero, meaning "a single write may block" 71 | // should be overridden by subclasses with buffering 72 | virtual int availableForWrite() 73 | { 74 | return 0; 75 | } 76 | 77 | size_t print(const __FlashStringHelper *); 78 | size_t print(const String &); 79 | size_t print(const char[]); 80 | size_t print(char); 81 | size_t print(unsigned char, int = DEC); 82 | size_t print(int, int = DEC); 83 | size_t print(unsigned int, int = DEC); 84 | size_t print(long, int = DEC); 85 | size_t print(unsigned long, int = DEC); 86 | size_t print(long long, int = DEC); 87 | size_t print(unsigned long long, int = DEC); 88 | size_t print(double, int = 2); 89 | size_t print(const Printable&); 90 | 91 | size_t println(const __FlashStringHelper *); 92 | size_t println(const String &s); 93 | size_t println(const char[]); 94 | size_t println(char); 95 | size_t println(unsigned char, int = DEC); 96 | size_t println(int, int = DEC); 97 | size_t println(unsigned int, int = DEC); 98 | size_t println(long, int = DEC); 99 | size_t println(unsigned long, int = DEC); 100 | size_t println(long long, int = DEC); 101 | size_t println(unsigned long long, int = DEC); 102 | size_t println(double, int = 2); 103 | size_t println(const Printable&); 104 | size_t println(void); 105 | 106 | size_t printf(const char * format, ...); 107 | 108 | size_t printBuffer(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 109 | size_t printBuffer(char const buffer[], int size, char delim = ' ', int byteline = 0) 110 | { 111 | return printBuffer((uint8_t const*) buffer, size, delim, byteline); 112 | } 113 | 114 | size_t printBufferReverse(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 115 | size_t printBufferReverse(char const buffer[], int size, char delim = ' ', int byteline = 0) 116 | { 117 | return printBufferReverse((uint8_t const*) buffer, size, delim, byteline); 118 | } 119 | 120 | virtual void flush() { /* Empty implementation for backward compatibility */ } 121 | }; 122 | 123 | 124 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.21.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.21.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.21.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.21.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.0/cores/nRF5/Print.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include // for size_t 23 | 24 | #include "WString.h" 25 | #include "Printable.h" 26 | 27 | #define DEC 10 28 | #define HEX 16 29 | #define OCT 8 30 | #define BIN 2 31 | 32 | class Print 33 | { 34 | private: 35 | int write_error; 36 | size_t printNumber(unsigned long, uint8_t); 37 | size_t printULLNumber(unsigned long long, uint8_t); 38 | size_t printFloat(double, int); 39 | protected: 40 | void setWriteError(int err = 1) 41 | { 42 | write_error = err; 43 | } 44 | public: 45 | Print() : write_error(0) {} 46 | 47 | int getWriteError() 48 | { 49 | return write_error; 50 | } 51 | void clearWriteError() 52 | { 53 | setWriteError(0); 54 | } 55 | 56 | virtual size_t write(uint8_t) = 0; 57 | size_t write(const char *str) 58 | { 59 | if (str == NULL) 60 | return 0; 61 | 62 | return write((const uint8_t *)str, strlen(str)); 63 | } 64 | virtual size_t write(const uint8_t *buffer, size_t size); 65 | size_t write(const char *buffer, size_t size) 66 | { 67 | return write((const uint8_t *)buffer, size); 68 | } 69 | 70 | // default to zero, meaning "a single write may block" 71 | // should be overridden by subclasses with buffering 72 | virtual int availableForWrite() 73 | { 74 | return 0; 75 | } 76 | 77 | size_t print(const __FlashStringHelper *); 78 | size_t print(const String &); 79 | size_t print(const char[]); 80 | size_t print(char); 81 | size_t print(unsigned char, int = DEC); 82 | size_t print(int, int = DEC); 83 | size_t print(unsigned int, int = DEC); 84 | size_t print(long, int = DEC); 85 | size_t print(unsigned long, int = DEC); 86 | size_t print(long long, int = DEC); 87 | size_t print(unsigned long long, int = DEC); 88 | size_t print(double, int = 2); 89 | size_t print(const Printable&); 90 | 91 | size_t println(const __FlashStringHelper *); 92 | size_t println(const String &s); 93 | size_t println(const char[]); 94 | size_t println(char); 95 | size_t println(unsigned char, int = DEC); 96 | size_t println(int, int = DEC); 97 | size_t println(unsigned int, int = DEC); 98 | size_t println(long, int = DEC); 99 | size_t println(unsigned long, int = DEC); 100 | size_t println(long long, int = DEC); 101 | size_t println(unsigned long long, int = DEC); 102 | size_t println(double, int = 2); 103 | size_t println(const Printable&); 104 | size_t println(void); 105 | 106 | size_t printf(const char * format, ...); 107 | 108 | size_t printBuffer(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 109 | size_t printBuffer(char const buffer[], int size, char delim = ' ', int byteline = 0) 110 | { 111 | return printBuffer((uint8_t const*) buffer, size, delim, byteline); 112 | } 113 | 114 | size_t printBufferReverse(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 115 | size_t printBufferReverse(char const buffer[], int size, char delim = ' ', int byteline = 0) 116 | { 117 | return printBufferReverse((uint8_t const*) buffer, size, delim, byteline); 118 | } 119 | 120 | virtual void flush() { /* Empty implementation for backward compatibility */ } 121 | }; 122 | 123 | 124 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.1/cores/nRF5/Print.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include // for size_t 23 | 24 | #include "WString.h" 25 | #include "Printable.h" 26 | 27 | #define DEC 10 28 | #define HEX 16 29 | #define OCT 8 30 | #define BIN 2 31 | 32 | class Print 33 | { 34 | private: 35 | int write_error; 36 | size_t printNumber(unsigned long, uint8_t); 37 | size_t printULLNumber(unsigned long long, uint8_t); 38 | size_t printFloat(double, int); 39 | protected: 40 | void setWriteError(int err = 1) 41 | { 42 | write_error = err; 43 | } 44 | public: 45 | Print() : write_error(0) {} 46 | 47 | int getWriteError() 48 | { 49 | return write_error; 50 | } 51 | void clearWriteError() 52 | { 53 | setWriteError(0); 54 | } 55 | 56 | virtual size_t write(uint8_t) = 0; 57 | size_t write(const char *str) 58 | { 59 | if (str == NULL) 60 | return 0; 61 | 62 | return write((const uint8_t *)str, strlen(str)); 63 | } 64 | virtual size_t write(const uint8_t *buffer, size_t size); 65 | size_t write(const char *buffer, size_t size) 66 | { 67 | return write((const uint8_t *)buffer, size); 68 | } 69 | 70 | // default to zero, meaning "a single write may block" 71 | // should be overridden by subclasses with buffering 72 | virtual int availableForWrite() 73 | { 74 | return 0; 75 | } 76 | 77 | size_t print(const __FlashStringHelper *); 78 | size_t print(const String &); 79 | size_t print(const char[]); 80 | size_t print(char); 81 | size_t print(unsigned char, int = DEC); 82 | size_t print(int, int = DEC); 83 | size_t print(unsigned int, int = DEC); 84 | size_t print(long, int = DEC); 85 | size_t print(unsigned long, int = DEC); 86 | size_t print(long long, int = DEC); 87 | size_t print(unsigned long long, int = DEC); 88 | size_t print(double, int = 2); 89 | size_t print(const Printable&); 90 | 91 | size_t println(const __FlashStringHelper *); 92 | size_t println(const String &s); 93 | size_t println(const char[]); 94 | size_t println(char); 95 | size_t println(unsigned char, int = DEC); 96 | size_t println(int, int = DEC); 97 | size_t println(unsigned int, int = DEC); 98 | size_t println(long, int = DEC); 99 | size_t println(unsigned long, int = DEC); 100 | size_t println(long long, int = DEC); 101 | size_t println(unsigned long long, int = DEC); 102 | size_t println(double, int = 2); 103 | size_t println(const Printable&); 104 | size_t println(void); 105 | 106 | size_t printf(const char * format, ...); 107 | 108 | size_t printBuffer(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 109 | size_t printBuffer(char const buffer[], int size, char delim = ' ', int byteline = 0) 110 | { 111 | return printBuffer((uint8_t const*) buffer, size, delim, byteline); 112 | } 113 | 114 | size_t printBufferReverse(uint8_t const buffer[], int len, char delim = ' ', int byteline = 0); 115 | size_t printBufferReverse(char const buffer[], int size, char delim = ' ', int byteline = 0) 116 | { 117 | return printBufferReverse((uint8_t const*) buffer, size, delim, byteline); 118 | } 119 | 120 | virtual void flush() { /* Empty implementation for backward compatibility */ } 121 | }; 122 | 123 | 124 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.1/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.1/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.1/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.22.1/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.23.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.23.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.23.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.23.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.24.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.24.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.24.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/0.24.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.0.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.0.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.0.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.0.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.0.0/variants/sparkfun_nrf52840_mini/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | #include "wiring_constants.h" 23 | #include "wiring_digital.h" 24 | #include "nrf.h" 25 | 26 | const uint32_t g_ADigitalPinMap[] = 27 | { 28 | // P0 29 | 0, 1, 2, 3, 4, 5, 6, 7, 30 | 8, 9, 10, 11, 12, 13, 14, 15, 31 | 16, 17, 18, 19, 20, 21, 22, 23, 32 | 24, 25, 26, 27, 28, 29, 30, 31, 33 | 34 | // P1 35 | 32, 33, 34, 35, 36, 37, 38, 39, 36 | 40, 41, 42, 43, 44, 45, 46, 47, 37 | 48, 49, 50, 51, 52, 53, 54, 55, 38 | 56, 57, 58, 59, 60, 61, 62, 63 39 | }; 40 | void initVariant() 41 | { 42 | // LED1 & LED2 43 | pinMode(PIN_LED1, OUTPUT); 44 | ledOff(PIN_LED1); 45 | 46 | pinMode(PIN_LED2, OUTPUT); 47 | ledOff(PIN_LED2); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.1.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.1.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.1.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.1.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.1.0/variants/sparkfun_nrf52840_mini/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | #include "wiring_constants.h" 23 | #include "wiring_digital.h" 24 | #include "nrf.h" 25 | 26 | const uint32_t g_ADigitalPinMap[] = 27 | { 28 | // P0 29 | 0, 1, 2, 3, 4, 5, 6, 7, 30 | 8, 9, 10, 11, 12, 13, 14, 15, 31 | 16, 17, 18, 19, 20, 21, 22, 23, 32 | 24, 25, 26, 27, 28, 29, 30, 31, 33 | 34 | // P1 35 | 32, 33, 34, 35, 36, 37, 38, 39, 36 | 40, 41, 42, 43, 44, 45, 46, 47, 37 | 48, 49, 50, 51, 52, 53, 54, 55, 38 | 56, 57, 58, 59, 60, 61, 62, 63 39 | }; 40 | void initVariant() 41 | { 42 | // LED1 & LED2 43 | pinMode(PIN_LED1, OUTPUT); 44 | ledOff(PIN_LED1); 45 | 46 | pinMode(PIN_LED2, OUTPUT); 47 | ledOff(PIN_LED2); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.2.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.2.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.2.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.2.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.2.0/variants/sparkfun_nrf52840_mini/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | #include "wiring_constants.h" 23 | #include "wiring_digital.h" 24 | #include "nrf.h" 25 | 26 | const uint32_t g_ADigitalPinMap[] = 27 | { 28 | // P0 29 | 0, 1, 2, 3, 4, 5, 6, 7, 30 | 8, 9, 10, 11, 12, 13, 14, 15, 31 | 16, 17, 18, 19, 20, 21, 22, 23, 32 | 24, 25, 26, 27, 28, 29, 30, 31, 33 | 34 | // P1 35 | 32, 33, 34, 35, 36, 37, 38, 39, 36 | 40, 41, 42, 43, 44, 45, 46, 47, 37 | 48, 49, 50, 51, 52, 53, 54, 55, 38 | 56, 57, 58, 59, 60, 61, 62, 63 39 | }; 40 | void initVariant() 41 | { 42 | // LED1 & LED2 43 | pinMode(PIN_LED1, OUTPUT); 44 | ledOff(PIN_LED1); 45 | 46 | pinMode(PIN_LED2, OUTPUT); 47 | ledOff(PIN_LED2); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.3.0/variants/NINA_B112_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.3.0/variants/NINA_B112_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | 23 | #include "wiring_constants.h" 24 | #include "wiring_digital.h" 25 | #include "nrf.h" 26 | 27 | //https://www.u-blox.com/sites/default/files/NINA-B1_DataSheet_UBX-15019243.pdf 28 | //https://www.u-blox.com/sites/default/files/EVK-NINA-B1_UserGuide_%28UBX-15028120%29_C1-Public.pdf 29 | 30 | const uint32_t g_ADigitalPinMap[] = 31 | { 32 | // D0 .. D13 33 | 5, // D0 is P0.05 (UART RX) 34 | 6, // D1 is P0.06 (UART TX) 35 | 7, // D2 is P0.07 36 | 31, // D3 is P0.31 37 | 18, // D4 is P0.18 (LED Blue) 38 | 99, // D5 (NC) 39 | 9, // D6 is P0.09 NFC1 40 | 10, // D7 is P0.10 (Button) NFC2 41 | 99, // D8 (NC) 42 | 8, // D9 is P0.08 43 | 11, // D10 is P0.11 CS 44 | 13, // D11 is P0.13 MOSI 45 | 12, // D12 is P0.12 MISO 46 | 14, // D13 is P0.14 SCK 47 | //I2C 48 | 2, // D14 is P0.2 (SDA) 49 | 3, // D15 is P0.3 (SCL) 50 | // D16 .. D21 (aka A0 .. A5) 51 | 3, // D16 is P0.03 (A0) 52 | 2, // D17 is P0.02 (A1) 53 | 4, // D18 is P0.04 (A2) 54 | 30, // D19 is P0.30 (A3) SW2 55 | 29, // D20 is P0.29 (A4) 56 | 28, // D21 is P0.28 (A5) 57 | 9, // P0.09 NFC 58 | 10, // P0.10 NFC 59 | 16, // SW1 (LED Green) 60 | }; -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.3.0/variants/NINA_B302_ublox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | This library is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU Lesser General Public 5 | License as published by the Free Software Foundation; either 6 | version 2.1 of the License, or (at your option) any later version. 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 10 | See the GNU Lesser General Public License for more details. 11 | You should have received a copy of the GNU Lesser General Public 12 | License along with this library; if not, write to the Free Software 13 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 14 | */ 15 | 16 | // API compatibility 17 | #include "variant.h" 18 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.3.0/variants/NINA_B302_ublox/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | // Thanks to great work of [Miguel Alexandre Wisintainer](https://github.com/tcpipchip). 21 | // See [u-blox nina b](https://github.com/khoih-prog/WiFiNINA_Generic/issues/1) 22 | 23 | #include "variant.h" 24 | #include "wiring_constants.h" 25 | #include "wiring_digital.h" 26 | #include "nrf.h" 27 | 28 | const uint32_t g_ADigitalPinMap[] = 29 | { 30 | // D0 .. D13 31 | 29, // D0 is P0.29 (UART RX) 32 | 45, // D1 is P1.13 (UART TX) 33 | 44, // D2 is P1.12 (NFC2) 34 | 31, // D3 is P0.31 (LED1) 35 | 13, // D4 is P0.13 (LED2) 36 | 11, // D5 is P0.11 37 | 9, // D6 is P0.09 38 | 10, // D7 is P0.10 (Button) 39 | 41, // D8 is P1.09 40 | 12, // D9 is P0.12 41 | 14, // D10 is P0.14 42 | 15, // D11 is P0.15 43 | 32, // D12 is P1.00 44 | 7, // D13 is P0.07 45 | 46 | // D14 .. D21 (aka A0 .. A5) 47 | 4, // D14 is P0.04 (A0) 48 | 30, // D15 is P0.30 (A1) 49 | 5, // D16 is P0.05 (A2) 50 | 2, // D17 is P0.02 (A3) 51 | 28, // D18 is P0.28 (A4) 52 | 3, // D19 is P0.03 (A5) 53 | 54 | // D20 .. D21 (aka I2C pins) 55 | 16, // D20 is P0.16 (SDA) 56 | 24, // D21 is P0.24 (SCL) 57 | 58 | // QSPI pins (not exposed via any header / test point) 59 | 19, // D22 is P0.19 (QSPI CLK) 60 | 17, // D23 is P0.17 (QSPI CS) 61 | 20, // D24 is P0.20 (QSPI Data 0) 62 | 21, // D25 is P0.21 (QSPI Data 1) 63 | 22, // D26 is P0.22 (QSPI Data 2) 64 | 26, // D27 is P0.23 (QSPI Data 3) 65 | 66 | 40, // D28 is P1.08 - IO34 67 | 41, // D29 is P1.01 - IO35 68 | 44, // D30 is P1.02 - IO36 69 | 45, // D31 is P1.03 - IO37 70 | 42, // D32 is P1.10 - IO38 71 | 43, // D33 is P1.11 - IO39 72 | 47, // D34 is P1.15 - IO40 73 | 46, // D35 is P1.14 - IO41 74 | 26, // D36 is P0.26 - IO42 75 | 6, // D37 is P0.6 - IO43 76 | 27, // D38 is P0.27 - IO44 77 | }; 78 | 79 | void initVariant() 80 | { 81 | // LED1 & LED2 82 | pinMode(PIN_LED1, OUTPUT); 83 | ledOff(PIN_LED1); 84 | 85 | pinMode(PIN_LED2, OUTPUT); 86 | ledOff(PIN_LED2); 87 | } 88 | -------------------------------------------------------------------------------- /Packages_Patches/adafruit/hardware/nrf52/1.3.0/variants/sparkfun_nrf52840_mini/variant.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2016 Sandeep Mistry All right reserved. 4 | Copyright (c) 2018, Adafruit Industries (adafruit.com) 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | See the GNU Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "variant.h" 22 | #include "wiring_constants.h" 23 | #include "wiring_digital.h" 24 | #include "nrf.h" 25 | 26 | const uint32_t g_ADigitalPinMap[] = 27 | { 28 | // P0 29 | 0, 1, 2, 3, 4, 5, 6, 7, 30 | 8, 9, 10, 11, 12, 13, 14, 15, 31 | 16, 17, 18, 19, 20, 21, 22, 23, 32 | 24, 25, 26, 27, 28, 29, 30, 31, 33 | 34 | // P1 35 | 32, 33, 34, 35, 36, 37, 38, 39, 36 | 40, 41, 42, 43, 44, 45, 46, 47, 37 | 48, 49, 50, 51, 52, 53, 54, 55, 38 | 56, 57, 58, 59, 60, 61, 62, 63 39 | }; 40 | void initVariant() 41 | { 42 | // LED1 & LED2 43 | pinMode(PIN_LED1, OUTPUT); 44 | ledOff(PIN_LED1); 45 | 46 | pinMode(PIN_LED2, OUTPUT); 47 | ledOff(PIN_LED2); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/2.4.1/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/2.5.2/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/2.6.1/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/2.7.2/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/2.8.0/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/3.0.0/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/3.0.1/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/3.1.1/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/3.3.0/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/arduino/hardware/mbed_portenta/3.4.1/portenta_post_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | portenta_h7_rules () { 4 | echo "" 5 | echo "# Portenta H7 bootloader mode UDEV rules" 6 | echo "" 7 | cat < /etc/udev/rules.d/49-portenta_h7.rules 18 | 19 | # reload udev rules 20 | echo "Reload rules..." 21 | udevadm trigger 22 | udevadm control --reload-rules 23 | -------------------------------------------------------------------------------- /Packages_Patches/rp2040/hardware/rp2040/1.3.1/cores/rp2040/Arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Arduino header for the Raspberry Pi Pico RP2040 3 | 4 | Copyright (c) 2021 Earle F. Philhower, III 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef Arduino_h 22 | #define Arduino_h 23 | 24 | #include 25 | #include 26 | #include 27 | // Wacky deprecated AVR compatibilty functions 28 | #include "stdlib_noniso.h" 29 | 30 | #include "api/ArduinoAPI.h" 31 | #include 32 | 33 | 34 | // Required for the port*Register macros 35 | #include "hardware/gpio.h" 36 | 37 | #include "debug_internal.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif // __cplusplus 42 | 43 | // For compatibility to many platforms and libraries 44 | #define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) 45 | #define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) 46 | #define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() ) 47 | 48 | // Disable/reenable all interrupts. Safely handles nested disables 49 | void interrupts(); 50 | void noInterrupts(); 51 | 52 | // GPIO change/value interrupts 53 | void attachInterrupt(pin_size_t pin, voidFuncPtr callback, PinStatus mode); 54 | void detachInterrupt(pin_size_t pin); 55 | 56 | // AVR compatibilty macros...naughty and accesses the HW directly 57 | #define digitalPinToPort(pin) (0) 58 | #define digitalPinToBitMask(pin) (1UL << (pin)) 59 | #define digitalPinToTimer(pin) (0) 60 | #define digitalPinToInterrupt(pin) (pin) 61 | #define NOT_AN_INTERRUPT (-1) 62 | #define portOutputRegister(port) ((volatile uint32_t*) sio_hw->gpio_out) 63 | #define portInputRegister(port) ((volatile uint32_t*) sio_hw->gpio_in) 64 | #define portModeRegister(port) ((volatile uint32_t*) sio_hw->gpio_oe) 65 | 66 | // IO config 67 | void pinMode(pin_size_t pinNumber, PinMode pinMode); 68 | 69 | // SIO (GPIO) 70 | void digitalWrite(pin_size_t pinNumber, PinStatus status); 71 | PinStatus digitalRead(pin_size_t pinNumber); 72 | 73 | // ADC 74 | int analogRead(pin_size_t pinNumber); 75 | float analogReadTemp(); // Returns core temp in Centigrade 76 | 77 | // PWM 78 | void analogWrite(pin_size_t pinNumber, int value); 79 | void analogWriteFreq(uint32_t freq); 80 | void analogWriteRange(uint32_t range); 81 | void analogWriteResolution(int res); 82 | 83 | // Timing 84 | void delay(unsigned long); 85 | void delayMicroseconds(unsigned int us); 86 | unsigned long millis(); 87 | 88 | #ifdef __cplusplus 89 | } // extern "C" 90 | #endif 91 | 92 | // Ancient AVR defines 93 | #define HAVE_HWSERIAL0 94 | #define HAVE_HWSERIAL1 95 | #define HAVE_HWSERIAL2 96 | 97 | #ifdef __cplusplus 98 | #include "SerialUSB.h" 99 | #include "SerialUART.h" 100 | #include "RP2040.h" 101 | #include "Bootsel.h" 102 | 103 | // Template which will evaluate at *compile time* to a single 32b number 104 | // with the specified bits set. 105 | template 106 | constexpr uint32_t __bitset(const int (&a)[N], size_t i = 0U) 107 | { 108 | return i < N ? (1L << a[i]) | __bitset(a, i + 1) : 0; 109 | } 110 | #endif 111 | 112 | 113 | // ARM toolchain doesn't provide itoa etc, provide them 114 | #include "api/itoa.h" 115 | 116 | #endif // Arduino_h 117 | -------------------------------------------------------------------------------- /Packages_Patches/rp2040/hardware/rp2040/1.4.0/cores/rp2040/Arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Arduino header for the Raspberry Pi Pico RP2040 3 | 4 | Copyright (c) 2021 Earle F. Philhower, III 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef Arduino_h 22 | #define Arduino_h 23 | 24 | #include 25 | #include 26 | #include 27 | // Wacky deprecated AVR compatibilty functions 28 | #include "stdlib_noniso.h" 29 | 30 | #include "api/ArduinoAPI.h" 31 | #include 32 | 33 | 34 | // Required for the port*Register macros 35 | #include "hardware/gpio.h" 36 | 37 | #include "debug_internal.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif // __cplusplus 42 | 43 | // For compatibility to many platforms and libraries 44 | #define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) 45 | #define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) 46 | #define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() ) 47 | 48 | // Disable/reenable all interrupts. Safely handles nested disables 49 | void interrupts(); 50 | void noInterrupts(); 51 | 52 | // GPIO change/value interrupts 53 | void attachInterrupt(pin_size_t pin, voidFuncPtr callback, PinStatus mode); 54 | void detachInterrupt(pin_size_t pin); 55 | 56 | // AVR compatibilty macros...naughty and accesses the HW directly 57 | #define digitalPinToPort(pin) (0) 58 | #define digitalPinToBitMask(pin) (1UL << (pin)) 59 | #define digitalPinToTimer(pin) (0) 60 | #define digitalPinToInterrupt(pin) (pin) 61 | #define NOT_AN_INTERRUPT (-1) 62 | #define portOutputRegister(port) ((volatile uint32_t*) sio_hw->gpio_out) 63 | #define portInputRegister(port) ((volatile uint32_t*) sio_hw->gpio_in) 64 | #define portModeRegister(port) ((volatile uint32_t*) sio_hw->gpio_oe) 65 | 66 | // IO config 67 | void pinMode(pin_size_t pinNumber, PinMode pinMode); 68 | 69 | // SIO (GPIO) 70 | void digitalWrite(pin_size_t pinNumber, PinStatus status); 71 | PinStatus digitalRead(pin_size_t pinNumber); 72 | 73 | // ADC 74 | int analogRead(pin_size_t pinNumber); 75 | float analogReadTemp(); // Returns core temp in Centigrade 76 | 77 | // PWM 78 | void analogWrite(pin_size_t pinNumber, int value); 79 | void analogWriteFreq(uint32_t freq); 80 | void analogWriteRange(uint32_t range); 81 | void analogWriteResolution(int res); 82 | 83 | // Timing 84 | void delay(unsigned long); 85 | void delayMicroseconds(unsigned int us); 86 | unsigned long millis(); 87 | 88 | #ifdef __cplusplus 89 | } // extern "C" 90 | #endif 91 | 92 | // Ancient AVR defines 93 | #define HAVE_HWSERIAL0 94 | #define HAVE_HWSERIAL1 95 | #define HAVE_HWSERIAL2 96 | 97 | #ifdef __cplusplus 98 | #include "SerialUSB.h" 99 | #include "SerialUART.h" 100 | #include "RP2040.h" 101 | #include "Bootsel.h" 102 | 103 | // Template which will evaluate at *compile time* to a single 32b number 104 | // with the specified bits set. 105 | template 106 | constexpr uint32_t __bitset(const int (&a)[N], size_t i = 0U) 107 | { 108 | return i < N ? (1L << a[i]) | __bitset(a, i + 1) : 0; 109 | } 110 | #endif 111 | 112 | 113 | // ARM toolchain doesn't provide itoa etc, provide them 114 | #include "api/itoa.h" 115 | 116 | #endif // Arduino_h 117 | -------------------------------------------------------------------------------- /examples/HTTPClient/SimpleDelete/SimpleDelete.ino: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | SimpleDelete.ino - Simple Arduino web server sample for WiFi shield 3 | 4 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 5 | 6 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 7 | Based on and modified from ESP8266 https://github.com/esp8266/Arduino/releases 8 | Based on and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 9 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 10 | Licensed under MIT license 11 | 12 | Simple DELETE client for HttpClient 13 | Connects to server once every five seconds, sends a DELETE request 14 | and a request body 15 | 16 | created 14 Feb 2016 17 | modified 22 Jan 2019 18 | by Tom Igoe 19 | *****************************************************************************************************************************/ 20 | 21 | #include "defines.h" 22 | 23 | char serverAddress[] = "192.168.2.112"; // server address 24 | int port = 8080; 25 | 26 | WiFiClient client; 27 | WiFiHttpClient httpClient(client, serverAddress, port); 28 | 29 | int status = WL_IDLE_STATUS; // the Wifi radio's status 30 | 31 | void printWifiStatus() 32 | { 33 | // print the SSID of the network you're attached to: 34 | // you're connected now, so print out the data 35 | Serial.print(F("You're connected to the network, IP = ")); 36 | Serial.println(WiFi.localIP()); 37 | 38 | Serial.print(F("SSID: ")); 39 | Serial.print(WiFi.SSID()); 40 | 41 | // print the received signal strength: 42 | int32_t rssi = WiFi.RSSI(); 43 | Serial.print(F(", Signal strength (RSSI):")); 44 | Serial.print(rssi); 45 | Serial.println(F(" dBm")); 46 | } 47 | 48 | void setup() 49 | { 50 | Serial.begin(115200); 51 | 52 | while (!Serial && millis() < 5000); 53 | 54 | Serial.print(F("\nStarting SimpleDelete on ")); 55 | Serial.print(BOARD_NAME); 56 | Serial.print(F(" with ")); 57 | Serial.println(SHIELD_TYPE); 58 | Serial.println(WIFI_WEBSERVER_VERSION); 59 | 60 | #if WIFI_USING_ESP_AT 61 | 62 | // initialize serial for ESP module 63 | EspSerial.begin(115200); 64 | // initialize ESP module 65 | WiFi.init(&EspSerial); 66 | 67 | Serial.println(F("WiFi shield init done")); 68 | 69 | #endif 70 | 71 | #if !(ESP32 || ESP8266) 72 | 73 | // check for the presence of the shield 74 | #if USE_WIFI_NINA 75 | 76 | if (WiFi.status() == WL_NO_MODULE) 77 | #else 78 | if (WiFi.status() == WL_NO_SHIELD) 79 | #endif 80 | { 81 | Serial.println(F("WiFi shield not present")); 82 | 83 | // don't continue 84 | while (true); 85 | } 86 | 87 | #if USE_WIFI_NINA 88 | String fv = WiFi.firmwareVersion(); 89 | 90 | if (fv < WIFI_FIRMWARE_LATEST_VERSION) 91 | { 92 | Serial.println(F("Please upgrade the firmware")); 93 | } 94 | 95 | #endif 96 | 97 | #endif 98 | 99 | Serial.print(F("Connecting to SSID: ")); 100 | Serial.println(ssid); 101 | 102 | status = WiFi.begin(ssid, pass); 103 | 104 | delay(1000); 105 | 106 | // attempt to connect to WiFi network 107 | while ( status != WL_CONNECTED) 108 | { 109 | delay(500); 110 | 111 | // Connect to WPA/WPA2 network 112 | status = WiFi.status(); 113 | } 114 | 115 | // you're connected now, so print out the data 116 | printWifiStatus(); 117 | } 118 | 119 | void loop() 120 | { 121 | Serial.println("making DELETE request"); 122 | String contentType = "application/x-www-form-urlencoded"; 123 | String delData = "name=light&age=46"; 124 | 125 | httpClient.del("/", contentType, delData); 126 | 127 | // read the status code and body of the response 128 | int statusCode = httpClient.responseStatusCode(); 129 | String response = httpClient.responseBody(); 130 | 131 | Serial.print("Status code: "); 132 | Serial.println(statusCode); 133 | Serial.print("Response: "); 134 | Serial.println(response); 135 | 136 | Serial.println("Wait five seconds"); 137 | delay(5000); 138 | } 139 | -------------------------------------------------------------------------------- /examples/HTTPClient/SimpleGet/SimpleGet.ino: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | SimpleGet.ino - Simple Arduino web server sample for WiFi shield 3 | 4 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 5 | 6 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 7 | Based on and modified from ESP8266 https://github.com/esp8266/Arduino/releases 8 | Based on and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 9 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 10 | Licensed under MIT license 11 | 12 | Simple GET client for HttpClient 13 | Connects to server once every five seconds, sends a GET request 14 | 15 | created 14 Feb 2016 16 | modified 22 Jan 2019 17 | by Tom Igoe 18 | *****************************************************************************************************************************/ 19 | 20 | #include "defines.h" 21 | 22 | char serverAddress[] = "192.168.2.112"; // server address 23 | int port = 8080; 24 | 25 | WiFiClient client; 26 | WiFiHttpClient httpClient(client, serverAddress, port); 27 | 28 | int status = WL_IDLE_STATUS; // the Wifi radio's status 29 | 30 | void printWifiStatus() 31 | { 32 | // print the SSID of the network you're attached to: 33 | // you're connected now, so print out the data 34 | Serial.print(F("You're connected to the network, IP = ")); 35 | Serial.println(WiFi.localIP()); 36 | 37 | Serial.print(F("SSID: ")); 38 | Serial.print(WiFi.SSID()); 39 | 40 | // print the received signal strength: 41 | int32_t rssi = WiFi.RSSI(); 42 | Serial.print(F(", Signal strength (RSSI):")); 43 | Serial.print(rssi); 44 | Serial.println(F(" dBm")); 45 | } 46 | 47 | void setup() 48 | { 49 | Serial.begin(115200); 50 | 51 | while (!Serial && millis() < 5000); 52 | 53 | Serial.print(F("\nStarting SimpleGet on ")); 54 | Serial.print(BOARD_NAME); 55 | Serial.print(F(" with ")); 56 | Serial.println(SHIELD_TYPE); 57 | Serial.println(WIFI_WEBSERVER_VERSION); 58 | 59 | #if WIFI_USING_ESP_AT 60 | 61 | // initialize serial for ESP module 62 | EspSerial.begin(115200); 63 | // initialize ESP module 64 | WiFi.init(&EspSerial); 65 | 66 | Serial.println(F("WiFi shield init done")); 67 | 68 | #endif 69 | 70 | #if !(ESP32 || ESP8266) 71 | 72 | // check for the presence of the shield 73 | #if USE_WIFI_NINA 74 | 75 | if (WiFi.status() == WL_NO_MODULE) 76 | #else 77 | if (WiFi.status() == WL_NO_SHIELD) 78 | #endif 79 | { 80 | Serial.println(F("WiFi shield not present")); 81 | 82 | // don't continue 83 | while (true); 84 | } 85 | 86 | #if USE_WIFI_NINA 87 | String fv = WiFi.firmwareVersion(); 88 | 89 | if (fv < WIFI_FIRMWARE_LATEST_VERSION) 90 | { 91 | Serial.println(F("Please upgrade the firmware")); 92 | } 93 | 94 | #endif 95 | 96 | #endif 97 | 98 | Serial.print(F("Connecting to SSID: ")); 99 | Serial.println(ssid); 100 | 101 | status = WiFi.begin(ssid, pass); 102 | 103 | delay(1000); 104 | 105 | // attempt to connect to WiFi network 106 | while ( status != WL_CONNECTED) 107 | { 108 | delay(500); 109 | 110 | // Connect to WPA/WPA2 network 111 | status = WiFi.status(); 112 | } 113 | 114 | // you're connected now, so print out the data 115 | printWifiStatus(); 116 | } 117 | 118 | void loop() 119 | { 120 | Serial.println("making GET request"); 121 | httpClient.get("/"); 122 | 123 | // read the status code and body of the response 124 | int statusCode = httpClient.responseStatusCode(); 125 | String response = httpClient.responseBody(); 126 | 127 | Serial.print("Status code: "); 128 | Serial.println(statusCode); 129 | Serial.print("Response: "); 130 | Serial.println(response); 131 | Serial.println("Wait five seconds"); 132 | delay(5000); 133 | } 134 | -------------------------------------------------------------------------------- /examples/HTTPClient/SimplePost/SimplePost.ino: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | SimplePost.ino - Simple Arduino web server sample for WiFi shield 3 | 4 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 5 | 6 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 7 | Based on and modified from ESP8266 https://github.com/esp8266/Arduino/releases 8 | Based on and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 9 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 10 | Licensed under MIT license 11 | 12 | Simple POST client for HttpClient 13 | Connects to server once every five seconds, sends a POST request 14 | and a request body 15 | 16 | created 14 Feb 2016 17 | modified 22 Jan 2019 18 | by Tom Igoe 19 | *****************************************************************************************************************************/ 20 | 21 | #include "defines.h" 22 | 23 | char serverAddress[] = "192.168.2.112"; // server address 24 | int port = 8080; 25 | 26 | WiFiClient client; 27 | WiFiHttpClient httpClient(client, serverAddress, port); 28 | 29 | int status = WL_IDLE_STATUS; // the Wifi radio's status 30 | 31 | void printWifiStatus() 32 | { 33 | // print the SSID of the network you're attached to: 34 | // you're connected now, so print out the data 35 | Serial.print(F("You're connected to the network, IP = ")); 36 | Serial.println(WiFi.localIP()); 37 | 38 | Serial.print(F("SSID: ")); 39 | Serial.print(WiFi.SSID()); 40 | 41 | // print the received signal strength: 42 | int32_t rssi = WiFi.RSSI(); 43 | Serial.print(F(", Signal strength (RSSI):")); 44 | Serial.print(rssi); 45 | Serial.println(F(" dBm")); 46 | } 47 | 48 | void setup() 49 | { 50 | Serial.begin(115200); 51 | 52 | while (!Serial && millis() < 5000); 53 | 54 | Serial.print(F("\nStarting SimplePost on ")); 55 | Serial.print(BOARD_NAME); 56 | Serial.print(F(" with ")); 57 | Serial.println(SHIELD_TYPE); 58 | Serial.println(WIFI_WEBSERVER_VERSION); 59 | 60 | #if WIFI_USING_ESP_AT 61 | 62 | // initialize serial for ESP module 63 | EspSerial.begin(115200); 64 | // initialize ESP module 65 | WiFi.init(&EspSerial); 66 | 67 | Serial.println(F("WiFi shield init done")); 68 | 69 | #endif 70 | 71 | #if !(ESP32 || ESP8266) 72 | 73 | // check for the presence of the shield 74 | #if USE_WIFI_NINA 75 | 76 | if (WiFi.status() == WL_NO_MODULE) 77 | #else 78 | if (WiFi.status() == WL_NO_SHIELD) 79 | #endif 80 | { 81 | Serial.println(F("WiFi shield not present")); 82 | 83 | // don't continue 84 | while (true); 85 | } 86 | 87 | #if USE_WIFI_NINA 88 | String fv = WiFi.firmwareVersion(); 89 | 90 | if (fv < WIFI_FIRMWARE_LATEST_VERSION) 91 | { 92 | Serial.println(F("Please upgrade the firmware")); 93 | } 94 | 95 | #endif 96 | 97 | #endif 98 | 99 | Serial.print(F("Connecting to SSID: ")); 100 | Serial.println(ssid); 101 | 102 | status = WiFi.begin(ssid, pass); 103 | 104 | delay(1000); 105 | 106 | // attempt to connect to WiFi network 107 | while ( status != WL_CONNECTED) 108 | { 109 | delay(500); 110 | 111 | // Connect to WPA/WPA2 network 112 | status = WiFi.status(); 113 | } 114 | 115 | // you're connected now, so print out the data 116 | printWifiStatus(); 117 | } 118 | 119 | void loop() 120 | { 121 | Serial.println("making POST request"); 122 | String contentType = "application/x-www-form-urlencoded"; 123 | String postData = "name=Alice&age=12"; 124 | 125 | httpClient.post("/", contentType, postData); 126 | 127 | // read the status code and body of the response 128 | int statusCode = httpClient.responseStatusCode(); 129 | String response = httpClient.responseBody(); 130 | 131 | Serial.print("Status code: "); 132 | Serial.println(statusCode); 133 | Serial.print("Response: "); 134 | Serial.println(response); 135 | 136 | Serial.println("Wait five seconds"); 137 | delay(5000); 138 | } 139 | -------------------------------------------------------------------------------- /examples/HTTPClient/SimplePut/SimplePut.ino: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | SimplePut.ino - Simple Arduino web server sample for WiFi shield 3 | 4 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 5 | 6 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 7 | Based on and modified from ESP8266 https://github.com/esp8266/Arduino/releases 8 | Based on and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 9 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 10 | Licensed under MIT license 11 | 12 | Simple PUT client for HttpClient 13 | Connects to server once every five seconds, sends a PUT request 14 | and a request body 15 | 16 | created 14 Feb 2016 17 | modified 22 Jan 2019 18 | by Tom Igoe 19 | *****************************************************************************************************************************/ 20 | 21 | #include "defines.h" 22 | 23 | char serverAddress[] = "192.168.2.112"; // server address 24 | int port = 8080; 25 | 26 | WiFiClient client; 27 | WiFiHttpClient httpClient(client, serverAddress, port); 28 | 29 | int status = WL_IDLE_STATUS; // the Wifi radio's status 30 | 31 | void printWifiStatus() 32 | { 33 | // print the SSID of the network you're attached to: 34 | // you're connected now, so print out the data 35 | Serial.print(F("You're connected to the network, IP = ")); 36 | Serial.println(WiFi.localIP()); 37 | 38 | Serial.print(F("SSID: ")); 39 | Serial.print(WiFi.SSID()); 40 | 41 | // print the received signal strength: 42 | int32_t rssi = WiFi.RSSI(); 43 | Serial.print(F(", Signal strength (RSSI):")); 44 | Serial.print(rssi); 45 | Serial.println(F(" dBm")); 46 | } 47 | 48 | void setup() 49 | { 50 | Serial.begin(115200); 51 | 52 | while (!Serial && millis() < 5000); 53 | 54 | Serial.print(F("\nStarting SimplePut on ")); 55 | Serial.print(BOARD_NAME); 56 | Serial.print(F(" with ")); 57 | Serial.println(SHIELD_TYPE); 58 | Serial.println(WIFI_WEBSERVER_VERSION); 59 | 60 | #if WIFI_USING_ESP_AT 61 | 62 | // initialize serial for ESP module 63 | EspSerial.begin(115200); 64 | // initialize ESP module 65 | WiFi.init(&EspSerial); 66 | 67 | Serial.println(F("WiFi shield init done")); 68 | 69 | #endif 70 | 71 | #if !(ESP32 || ESP8266) 72 | 73 | // check for the presence of the shield 74 | #if USE_WIFI_NINA 75 | 76 | if (WiFi.status() == WL_NO_MODULE) 77 | #else 78 | if (WiFi.status() == WL_NO_SHIELD) 79 | #endif 80 | { 81 | Serial.println(F("WiFi shield not present")); 82 | 83 | // don't continue 84 | while (true); 85 | } 86 | 87 | #if USE_WIFI_NINA 88 | String fv = WiFi.firmwareVersion(); 89 | 90 | if (fv < WIFI_FIRMWARE_LATEST_VERSION) 91 | { 92 | Serial.println(F("Please upgrade the firmware")); 93 | } 94 | 95 | #endif 96 | 97 | #endif 98 | 99 | Serial.print(F("Connecting to SSID: ")); 100 | Serial.println(ssid); 101 | 102 | status = WiFi.begin(ssid, pass); 103 | 104 | delay(1000); 105 | 106 | // attempt to connect to WiFi network 107 | while ( status != WL_CONNECTED) 108 | { 109 | delay(500); 110 | 111 | // Connect to WPA/WPA2 network 112 | status = WiFi.status(); 113 | } 114 | 115 | // you're connected now, so print out the data 116 | printWifiStatus(); 117 | } 118 | 119 | void loop() 120 | { 121 | Serial.println("making PUT request"); 122 | String contentType = "application/x-www-form-urlencoded"; 123 | String putData = "name=light&age=46"; 124 | 125 | httpClient.put("/", contentType, putData); 126 | 127 | // read the status code and body of the response 128 | int statusCode = httpClient.responseStatusCode(); 129 | String response = httpClient.responseBody(); 130 | 131 | Serial.print("Status code: "); 132 | Serial.println(statusCode); 133 | Serial.print("Response: "); 134 | Serial.println(response); 135 | 136 | Serial.println("Wait five seconds"); 137 | delay(5000); 138 | } 139 | -------------------------------------------------------------------------------- /examples/HTTPClient/node_test_server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node_test_server", 3 | "version": "0.0.1", 4 | "author": { 5 | "name": "Tom Igoe" 6 | }, 7 | "dependencies": { 8 | "body-parser": ">=1.11.0", 9 | "express": ">=4.0.0", 10 | "multer": "*", 11 | "ws": ">=5.2.3" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/HttpBasicAuth/HttpBasicAuth.ino: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | HTTPBasicAuth.h - Simple Arduino web server sample for SAMD21 running WiFiNINA shield 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Based on and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Based on and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 8 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 9 | Licensed under MIT license 10 | ***************************************************************************************************************************************/ 11 | 12 | #include "defines.h" 13 | 14 | int status = WL_IDLE_STATUS; // the Wifi radio's status 15 | int reqCount = 0; // number of requests received 16 | 17 | WiFiWebServer server(80); 18 | 19 | const char* www_username = "admin"; 20 | const char* www_password = "http_auth"; 21 | 22 | void setup() 23 | { 24 | Serial.begin(115200); 25 | 26 | while (!Serial && millis() < 5000); 27 | 28 | Serial.print(F("\nStarting HTTPBasicAuth on ")); 29 | Serial.print(BOARD_NAME); 30 | Serial.print(F(" with ")); 31 | Serial.println(SHIELD_TYPE); 32 | Serial.println(WIFI_WEBSERVER_VERSION); 33 | 34 | #if WIFI_USING_ESP_AT 35 | 36 | // initialize serial for ESP module 37 | EspSerial.begin(115200); 38 | // initialize ESP module 39 | WiFi.init(&EspSerial); 40 | 41 | Serial.println(F("WiFi shield init done")); 42 | 43 | #endif 44 | 45 | #if !(ESP32 || ESP8266) 46 | 47 | // check for the presence of the shield 48 | #if USE_WIFI_NINA 49 | 50 | if (WiFi.status() == WL_NO_MODULE) 51 | #else 52 | if (WiFi.status() == WL_NO_SHIELD) 53 | #endif 54 | { 55 | Serial.println(F("WiFi shield not present")); 56 | 57 | // don't continue 58 | while (true); 59 | } 60 | 61 | #if USE_WIFI_NINA 62 | String fv = WiFi.firmwareVersion(); 63 | 64 | if (fv < WIFI_FIRMWARE_LATEST_VERSION) 65 | { 66 | Serial.println(F("Please upgrade the firmware")); 67 | } 68 | 69 | #endif 70 | 71 | #endif 72 | 73 | Serial.print(F("Connecting to SSID: ")); 74 | Serial.println(ssid); 75 | 76 | status = WiFi.begin(ssid, pass); 77 | 78 | delay(1000); 79 | 80 | // attempt to connect to WiFi network 81 | while ( status != WL_CONNECTED) 82 | { 83 | delay(500); 84 | 85 | // Connect to WPA/WPA2 network 86 | status = WiFi.status(); 87 | } 88 | 89 | server.on(F("/"), []() 90 | { 91 | if (!server.authenticate(www_username, www_password)) 92 | { 93 | return server.requestAuthentication(); 94 | } 95 | 96 | server.send(200, F("text/plain"), F("Login OK")); 97 | }); 98 | 99 | server.begin(); 100 | 101 | Serial.print(F("Open http://")); 102 | Serial.print(WiFi.localIP()); 103 | Serial.println(F("/ in your browser to see it working")); 104 | 105 | Serial.print(F("To login, use Username = ")); 106 | Serial.print(www_username); 107 | Serial.print(F(", Password = ")); 108 | Serial.println(www_password); 109 | } 110 | 111 | void loop() 112 | { 113 | server.handleClient(); 114 | } 115 | -------------------------------------------------------------------------------- /examples/multiFileProject/multiFileProject.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | multiFileProject.cpp 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Based on and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 8 | Licensed under MIT license 9 | *****************************************************************************************************************************/ 10 | 11 | // To demo how to include files in multi-file Projects 12 | 13 | #include "multiFileProject.h" 14 | -------------------------------------------------------------------------------- /examples/multiFileProject/multiFileProject.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | multiFileProject.h 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Based on and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 8 | Licensed under MIT license 9 | *****************************************************************************************************************************/ 10 | 11 | // To demo how to include files in multi-file Projects 12 | 13 | #pragma once 14 | 15 | #include "defines.h" 16 | 17 | // Can be included as many times as necessary, without `Multiple Definitions` Linker Error 18 | #include // https://github.com/khoih-prog/WiFiWebServer 19 | 20 | #include // https://github.com/khoih-prog/WiFiWebServer 21 | -------------------------------------------------------------------------------- /examples/multiFileProject/multiFileProject.ino: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | multiFileProject.ino 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Based on and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 8 | Licensed under MIT license 9 | *****************************************************************************************************************************/ 10 | 11 | // To demo how to include files in multi-file Projects 12 | 13 | #define WIFI_WEBSERVER_VERSION_MIN_TARGET "WiFiWebServer v1.9.3" 14 | #define WIFI_WEBSERVER_VERSION_MIN 1009003 15 | 16 | #include "multiFileProject.h" 17 | 18 | // To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error 19 | #include // https://github.com/khoih-prog/WiFiWebServer 20 | 21 | void setup() 22 | { 23 | Serial.begin(115200); 24 | 25 | while (!Serial && millis() < 5000); 26 | 27 | delay(500); 28 | 29 | Serial.println("\nStart multiFileProject"); 30 | Serial.println(WIFI_WEBSERVER_VERSION); 31 | 32 | #if defined(WIFI_WEBSERVER_VERSION_MIN) 33 | 34 | if (WIFI_WEBSERVER_VERSION_INT < WIFI_WEBSERVER_VERSION_MIN) 35 | { 36 | Serial.print("Warning. Must use this example on Version equal or later than : "); 37 | Serial.println(WIFI_WEBSERVER_VERSION_MIN_TARGET); 38 | } 39 | 40 | #endif 41 | 42 | Serial.print("You're OK now"); 43 | } 44 | 45 | void loop() 46 | { 47 | // put your main code here, to run repeatedly: 48 | } 49 | -------------------------------------------------------------------------------- /library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "WiFiWebServer", 3 | "version": "1.10.1", 4 | "keywords": "wifi, wi-fi, WebServer, WiFiNINA, WiFi101, ESP32, Portenta-H7, SAM-DUE, SAMD, STM32, nRF52, rpi-pico, rp2040, HTTP-Client, WebSocket-Client, server, client, websocket, wifi-multi, mega-avr", 5 | "description": "Simple WiFiWebServer, HTTP Client and WebSocket Client library for AVR Mega, megaAVR, Portenta_H7, Teensy, SAM DUE, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, nRF52, RP2040-based (Nano-RP2040-Connect, RASPBERRY_PI_PICO, RASPBERRY_PI_PICO_W, ESP32/ESP8266, etc.) boards using WiFi, such as WiFiNINA, WiFi101, CYW43439, U-Blox W101, W102, ESP8266/ESP32-AT modules/shields, with functions similar to those of ESP8266/ESP32 WebServer libraries", 6 | "authors": 7 | { 8 | "name": "Khoi Hoang", 9 | "url": "https://github.com/khoih-prog", 10 | "maintainer": true 11 | }, 12 | "repository": 13 | { 14 | "type": "git", 15 | "url": "https://github.com/khoih-prog/WiFiWebServer" 16 | }, 17 | "homepage": "https://github.com/khoih-prog/WiFiWebServer", 18 | "export": { 19 | "exclude": [ 20 | "linux", 21 | "extras", 22 | "tests" 23 | ] 24 | }, 25 | "dependencies": 26 | [ 27 | { 28 | "owner": "khoih-prog", 29 | "name": "WiFiNINA_Generic", 30 | "version": ">=1.8.15-1", 31 | "platforms": ["*"] 32 | }, 33 | { 34 | "owner": "khoih-prog", 35 | "name": "WiFi101_Generic", 36 | "version": ">=1.0.0", 37 | "platforms": ["*"] 38 | }, 39 | { 40 | "owner": "khoih-prog", 41 | "name": "Functional-Vlpp", 42 | "version": ">=1.0.2", 43 | "platforms": ["*"] 44 | }, 45 | { 46 | "owner": "khoih-prog", 47 | "name": "WiFiMulti_Generic", 48 | "version": ">=1.2.2", 49 | "platforms": ["*"] 50 | }, 51 | { 52 | "owner": "khoih-prog", 53 | "name": "ESP_AT_Lib", 54 | "version": ">=1.4.1", 55 | "platforms": ["*"] 56 | }, 57 | { 58 | "owner": "jandrassy", 59 | "name": "WiFiEspAT", 60 | "version": ">=1.4.1", 61 | "platforms": ["*"] 62 | } 63 | ], 64 | "license": "MIT", 65 | "frameworks": "*", 66 | "platforms": "*", 67 | "examples": "examples/*/*/*.ino", 68 | "headers": ["WiFiWebServer.h", "WiFiWebServer.hpp", "WiFiHttpClient.h"] 69 | } 70 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=WiFiWebServer 2 | version=1.10.1 3 | author=Khoi Hoang 4 | license=MIT 5 | maintainer=Khoi Hoang 6 | sentence=Simple WiFiWebServer, HTTP Client and WebSocket Client library for AVR Mega, megaAVR, Portenta_H7, Teensy, SAM DUE, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, nRF52, RP2040-based (Nano-RP2040-Connect, RASPBERRY_PI_PICO, RASPBERRY_PI_PICO_W, ESP32/ESP8266, etc.) boards using WiFi, such as WiFiNINA, WiFi101, CYW43439, U-Blox W101, W102, ESP8266/ESP32-AT modules/shields, with functions similar to those of ESP8266/ESP32 WebServer libraries. 7 | paragraph=The WebServer supports HTTP GET and POST requests, provides argument parsing, handles one client at a time. It now provides HTTP Client and WebSocket Client. Now using WiFiMulti_Generic library 8 | category=Communication 9 | url=https://github.com/khoih-prog/WiFiWebServer 10 | architectures=* 11 | depends=Functional-Vlpp, WiFiNINA_Generic, WiFi101_Generic, ESP_AT_Lib, WiFiEspAT, WiFiMulti_Generic 12 | includes=WiFiWebServer.h, WiFiWebServer.hpp, WiFiHttpClient.h 13 | -------------------------------------------------------------------------------- /pics/AdvancedWebServer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WiFiWebServer/cf8a9734f23cd0e0fd64febf5aba888fab648190/pics/AdvancedWebServer.png -------------------------------------------------------------------------------- /pics/AdvancedWebServer_ESP32_C3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WiFiWebServer/cf8a9734f23cd0e0fd64febf5aba888fab648190/pics/AdvancedWebServer_ESP32_C3.png -------------------------------------------------------------------------------- /pics/AdvancedWebServer_ESP32_S3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WiFiWebServer/cf8a9734f23cd0e0fd64febf5aba888fab648190/pics/AdvancedWebServer_ESP32_S3.png -------------------------------------------------------------------------------- /pics/AdvancedWebServer_NanoRP2040Connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WiFiWebServer/cf8a9734f23cd0e0fd64febf5aba888fab648190/pics/AdvancedWebServer_NanoRP2040Connect.png -------------------------------------------------------------------------------- /pics/AdvancedWebServer_Portenta_H7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WiFiWebServer/cf8a9734f23cd0e0fd64febf5aba888fab648190/pics/AdvancedWebServer_Portenta_H7.png -------------------------------------------------------------------------------- /pics/AdvancedWebServer_WiFiMulti_NanoRP2040Connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WiFiWebServer/cf8a9734f23cd0e0fd64febf5aba888fab648190/pics/AdvancedWebServer_WiFiMulti_NanoRP2040Connect.png -------------------------------------------------------------------------------- /pics/AdvancedWebServer_WiFiMulti_RP2040W.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WiFiWebServer/cf8a9734f23cd0e0fd64febf5aba888fab648190/pics/AdvancedWebServer_WiFiMulti_RP2040W.png -------------------------------------------------------------------------------- /pics/AdvancedWebServer_v1.0.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/khoih-prog/WiFiWebServer/cf8a9734f23cd0e0fd64febf5aba888fab648190/pics/AdvancedWebServer_v1.0.6.png -------------------------------------------------------------------------------- /src/Uri.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | Uri.h - Dead simple HTTP WebClient. 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 8 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 9 | Licensed under MIT license 10 | 11 | Original author: 12 | @file Esp8266WebServer.h 13 | @author Ivan Grokhotkov 14 | 15 | Version: 1.10.1 16 | 17 | Version Modified By Date Comments 18 | ------- ----------- ---------- ----------- 19 | 1.0.0 K Hoang 12/02/2020 Initial coding for SAMD21, Nano 33 IoT, etc running WiFiNINA 20 | ... 21 | 1.6.0 K Hoang 13/02/2022 Add support to new ESP32-S3 and ESP32_C3 22 | 1.6.1 K Hoang 13/02/2022 Fix v1.6.0 issue 23 | 1.6.2 K Hoang 22/02/2022 Add support to megaAVR using Arduino megaAVR core 24 | 1.6.3 K Hoang 02/03/2022 Fix decoding error bug 25 | 1.7.0 K Hoang 05/04/2022 Fix issue with Portenta_H7 core v2.7.2+ 26 | 1.8.0 K Hoang 26/04/2022 Add WiFiMulti library support and examples 27 | 1.9.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 28 | 1.9.1 K Hoang 13/08/2022 Add WiFiMulti support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 29 | 1.9.2 K Hoang 16/08/2022 Workaround for RP2040W WiFi.status() bug 30 | 1.9.3 K Hoang 16/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway 31 | 1.9.4 K Hoang 06/09/2022 Restore support to ESP32 and ESP8266 32 | 1.9.5 K Hoang 10/09/2022 Restore support to Teensy, etc. Fix bug in examples 33 | 1.10.0 K Hoang 13/11/2022 Add new features, such as CORS. Update code and examples 34 | 1.10.1 K Hoang 24/11/2022 Using new WiFi101_Generic library to send larger data 35 | *****************************************************************************************************************************/ 36 | 37 | #ifndef URI_H 38 | #define URI_H 39 | 40 | #include 41 | #include 42 | 43 | //////////////////////////////////////// 44 | 45 | class Uri 46 | { 47 | protected: 48 | const String _uri; 49 | 50 | public: 51 | Uri(const char *uri) : _uri(uri) {} 52 | Uri(const String &uri) : _uri(uri) {} 53 | Uri(const __FlashStringHelper *uri) : _uri(String(uri)) {} 54 | virtual ~Uri() {} 55 | 56 | //////////////////////////////////////// 57 | 58 | virtual Uri* clone() const 59 | { 60 | return new Uri(_uri); 61 | }; 62 | 63 | //////////////////////////////////////// 64 | 65 | virtual void initPathArgs(__attribute__((unused)) std::vector &pathArgs) {} 66 | 67 | //////////////////////////////////////// 68 | 69 | virtual inline bool canHandle(const String &requestUri, __attribute__((unused)) std::vector &pathArgs) 70 | { 71 | return _uri == requestUri; 72 | } 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /src/WiFiHttpClient.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | WiFiHttpClient.h - Dead simple HTTP WebClient. 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 8 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 9 | Licensed under MIT license 10 | 11 | Original author: 12 | @file Esp8266WebServer.h 13 | @author Ivan Grokhotkov 14 | 15 | Version: 1.10.1 16 | 17 | Version Modified By Date Comments 18 | ------- ----------- ---------- ----------- 19 | 1.0.0 K Hoang 12/02/2020 Initial coding for SAMD21, Nano 33 IoT, etc running WiFiNINA 20 | ... 21 | 1.6.0 K Hoang 13/02/2022 Add support to new ESP32-S3 and ESP32_C3 22 | 1.6.1 K Hoang 13/02/2022 Fix v1.6.0 issue 23 | 1.6.2 K Hoang 22/02/2022 Add support to megaAVR using Arduino megaAVR core 24 | 1.6.3 K Hoang 02/03/2022 Fix decoding error bug 25 | 1.7.0 K Hoang 05/04/2022 Fix issue with Portenta_H7 core v2.7.2+ 26 | 1.8.0 K Hoang 26/04/2022 Add WiFiMulti library support and examples 27 | 1.9.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 28 | 1.9.1 K Hoang 13/08/2022 Add WiFiMulti support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 29 | 1.9.2 K Hoang 16/08/2022 Workaround for RP2040W WiFi.status() bug 30 | 1.9.3 K Hoang 16/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway 31 | 1.9.4 K Hoang 06/09/2022 Restore support to ESP32 and ESP8266 32 | 1.9.5 K Hoang 10/09/2022 Restore support to Teensy, etc. Fix bug in examples 33 | 1.10.0 K Hoang 13/11/2022 Add new features, such as CORS. Update code and examples 34 | 1.10.1 K Hoang 24/11/2022 Using new WiFi101_Generic library to send larger data 35 | *****************************************************************************************************************************/ 36 | 37 | // Library to simplify HTTP fetching on Arduino 38 | // (c) Copyright Arduino. 2016 39 | // Released under Apache License, version 2.0 40 | 41 | #pragma once 42 | 43 | #ifndef WiFiHttpClient_H 44 | #define WiFiHttpClient_H 45 | 46 | #include 47 | 48 | #include "utility/WiFiDebug.h" 49 | #include "WiFi_HTTPClient/WiFi_HttpClient.h" 50 | #include "WiFi_HTTPClient/WiFi_WebSocketClient.h" 51 | #include "WiFi_HTTPClient/WiFi_URLEncoder.h" 52 | 53 | #endif // WiFiHttpClient_H 54 | 55 | -------------------------------------------------------------------------------- /src/WiFiWebServer.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************************* 2 | WiFiWebServer.h - Dead simple web-server. 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 8 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 9 | Licensed under MIT license 10 | 11 | Original author: 12 | @file Esp8266WebServer.h 13 | @author Ivan Grokhotkov 14 | 15 | Version: 1.10.1 16 | 17 | Version Modified By Date Comments 18 | ------- ----------- ---------- ----------- 19 | 1.0.0 K Hoang 12/02/2020 Initial coding for SAMD21, Nano 33 IoT, etc running WiFiNINA 20 | ... 21 | 1.6.0 K Hoang 13/02/2022 Add support to new ESP32-S3 and ESP32_C3 22 | 1.6.1 K Hoang 13/02/2022 Fix v1.6.0 issue 23 | 1.6.2 K Hoang 22/02/2022 Add support to megaAVR using Arduino megaAVR core 24 | 1.6.3 K Hoang 02/03/2022 Fix decoding error bug 25 | 1.7.0 K Hoang 05/04/2022 Fix issue with Portenta_H7 core v2.7.2+ 26 | 1.8.0 K Hoang 26/04/2022 Add WiFiMulti library support and examples 27 | 1.9.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 28 | 1.9.1 K Hoang 13/08/2022 Add WiFiMulti support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 29 | 1.9.2 K Hoang 16/08/2022 Workaround for RP2040W WiFi.status() bug 30 | 1.9.3 K Hoang 16/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway 31 | 1.9.4 K Hoang 06/09/2022 Restore support to ESP32 and ESP8266 32 | 1.9.5 K Hoang 10/09/2022 Restore support to Teensy, etc. Fix bug in examples 33 | 1.10.0 K Hoang 13/11/2022 Add new features, such as CORS. Update code and examples 34 | 1.10.1 K Hoang 24/11/2022 Using new WiFi101_Generic library to send larger data 35 | **********************************************************************************************************************************/ 36 | 37 | #pragma once 38 | 39 | #ifndef WiFiWebServer_H 40 | #define WiFiWebServer_H 41 | 42 | #ifndef WIFI_WEBSERVER_VERSION 43 | #define WIFI_WEBSERVER_VERSION "WiFiWebServer v1.10.1" 44 | 45 | #define WIFI_WEBSERVER_VERSION_MAJOR 1 46 | #define WIFI_WEBSERVER_VERSION_MINOR 10 47 | #define WIFI_WEBSERVER_VERSION_PATCH 1 48 | 49 | #define WIFI_WEBSERVER_VERSION_INT 1010001 50 | #endif 51 | 52 | #include "WiFiWebServer.hpp" 53 | #include "WiFiWebServer-impl.h" 54 | #include "Parsing-impl.h" 55 | 56 | 57 | #endif // WiFiWebServer_H 58 | -------------------------------------------------------------------------------- /src/WiFi_HTTPClient/WiFi_URLEncoder.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | WiFi_URLEncoder.cpp - Dead simple HTTP WebClient. 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 8 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 9 | Licensed under MIT license 10 | 11 | Original author: 12 | @file Esp8266WebServer.h 13 | @author Ivan Grokhotkov 14 | 15 | Version: 1.10.1 16 | 17 | Version Modified By Date Comments 18 | ------- ----------- ---------- ----------- 19 | 1.0.0 K Hoang 12/02/2020 Initial coding for SAMD21, Nano 33 IoT, etc running WiFiNINA 20 | ... 21 | 1.6.0 K Hoang 13/02/2022 Add support to new ESP32-S3 and ESP32_C3 22 | 1.6.1 K Hoang 13/02/2022 Fix v1.6.0 issue 23 | 1.6.2 K Hoang 22/02/2022 Add support to megaAVR using Arduino megaAVR core 24 | 1.6.3 K Hoang 02/03/2022 Fix decoding error bug 25 | 1.7.0 K Hoang 05/04/2022 Fix issue with Portenta_H7 core v2.7.2+ 26 | 1.8.0 K Hoang 26/04/2022 Add WiFiMulti library support and examples 27 | 1.9.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 28 | 1.9.1 K Hoang 13/08/2022 Add WiFiMulti support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 29 | 1.9.2 K Hoang 16/08/2022 Workaround for RP2040W WiFi.status() bug 30 | 1.9.3 K Hoang 16/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway 31 | 1.9.4 K Hoang 06/09/2022 Restore support to ESP32 and ESP8266 32 | 1.9.5 K Hoang 10/09/2022 Restore support to Teensy, etc. Fix bug in examples 33 | 1.10.0 K Hoang 13/11/2022 Add new features, such as CORS. Update code and examples 34 | 1.10.1 K Hoang 24/11/2022 Using new WiFi101_Generic library to send larger data 35 | *****************************************************************************************************************************/ 36 | 37 | // Library to simplify HTTP fetching on Arduino 38 | // (c) Copyright Arduino. 2019 39 | // Released under Apache License, version 2.0 40 | 41 | #define _WIFI_LOGLEVEL_ 0 42 | 43 | #include "utility/WiFiDebug.h" 44 | #include "WiFi_HTTPClient/WiFi_URLEncoder.h" 45 | 46 | //////////////////////////////////////// 47 | 48 | WiFiURLEncoderClass::WiFiURLEncoderClass() 49 | { 50 | } 51 | 52 | //////////////////////////////////////// 53 | WiFiURLEncoderClass::~WiFiURLEncoderClass() 54 | { 55 | } 56 | 57 | //////////////////////////////////////// 58 | 59 | String WiFiURLEncoderClass::encode(const char* str) 60 | { 61 | return encode(str, strlen(str)); 62 | } 63 | 64 | //////////////////////////////////////// 65 | 66 | String WiFiURLEncoderClass::encode(const String& str) 67 | { 68 | return encode(str.c_str(), str.length()); 69 | } 70 | 71 | //////////////////////////////////////// 72 | 73 | String WiFiURLEncoderClass::encode(const char* str, int length) 74 | { 75 | String encoded; 76 | 77 | encoded.reserve(length); 78 | 79 | for (int i = 0; i < length; i++) 80 | { 81 | char c = str[i]; 82 | 83 | const char HEX_DIGIT_MAPPER[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; 84 | 85 | if (isAlphaNumeric(c) || (c == '-') || (c == '.') || (c == '_') || (c == '~')) 86 | { 87 | encoded += c; 88 | } 89 | else 90 | { 91 | char s[4]; 92 | 93 | s[0] = '%'; 94 | s[1] = HEX_DIGIT_MAPPER[(c >> 4) & 0xf]; 95 | s[2] = HEX_DIGIT_MAPPER[(c & 0x0f)]; 96 | s[3] = 0; 97 | 98 | encoded += s; 99 | } 100 | } 101 | 102 | return encoded; 103 | } 104 | 105 | //////////////////////////////////////// 106 | 107 | WiFiURLEncoderClass WiFiURLEncoder; 108 | -------------------------------------------------------------------------------- /src/WiFi_HTTPClient/WiFi_URLEncoder.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | WiFi_URLEncoder.h - Dead simple HTTP WebClient. 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 8 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 9 | Licensed under MIT license 10 | 11 | Original author: 12 | @file Esp8266WebServer.h 13 | @author Ivan Grokhotkov 14 | 15 | Version: 1.10.1 16 | 17 | Version Modified By Date Comments 18 | ------- ----------- ---------- ----------- 19 | 1.0.0 K Hoang 12/02/2020 Initial coding for SAMD21, Nano 33 IoT, etc running WiFiNINA 20 | ... 21 | 1.6.0 K Hoang 13/02/2022 Add support to new ESP32-S3 and ESP32_C3 22 | 1.6.1 K Hoang 13/02/2022 Fix v1.6.0 issue 23 | 1.6.2 K Hoang 22/02/2022 Add support to megaAVR using Arduino megaAVR core 24 | 1.6.3 K Hoang 02/03/2022 Fix decoding error bug 25 | 1.7.0 K Hoang 05/04/2022 Fix issue with Portenta_H7 core v2.7.2+ 26 | 1.8.0 K Hoang 26/04/2022 Add WiFiMulti library support and examples 27 | 1.9.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 28 | 1.9.1 K Hoang 13/08/2022 Add WiFiMulti support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 29 | 1.9.2 K Hoang 16/08/2022 Workaround for RP2040W WiFi.status() bug 30 | 1.9.3 K Hoang 16/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway 31 | 1.9.4 K Hoang 06/09/2022 Restore support to ESP32 and ESP8266 32 | 1.9.5 K Hoang 10/09/2022 Restore support to Teensy, etc. Fix bug in examples 33 | 1.10.0 K Hoang 13/11/2022 Add new features, such as CORS. Update code and examples 34 | 1.10.1 K Hoang 24/11/2022 Using new WiFi101_Generic library to send larger data 35 | *****************************************************************************************************************************/ 36 | 37 | // Library to simplify HTTP fetching on Arduino 38 | // (c) Copyright Arduino. 2019 39 | // Released under Apache License, version 2.0 40 | 41 | #pragma once 42 | 43 | #ifndef WiFi_URLEncoder_H 44 | #define WiFi_URLEncoder_H 45 | 46 | #include 47 | 48 | #include "utility/WiFiDebug.h" 49 | 50 | //////////////////////////////////////// 51 | 52 | class WiFiURLEncoderClass 53 | { 54 | public: 55 | WiFiURLEncoderClass(); 56 | virtual ~WiFiURLEncoderClass(); 57 | 58 | static String encode(const char* str); 59 | static String encode(const String& str); 60 | 61 | private: 62 | static String encode(const char* str, int length); 63 | }; 64 | 65 | //////////////////////////////////////// 66 | 67 | extern WiFiURLEncoderClass WiFiURLEncoder; 68 | 69 | #endif // WiFi_URLEncoder_H 70 | -------------------------------------------------------------------------------- /src/libb64/base64.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | base64.cpp - cpp source to a base64 encoding algorithm implementation 3 | 4 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 5 | 6 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 7 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 8 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 9 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 10 | Licensed under MIT license 11 | 12 | Original author: 13 | @file Esp8266WebServer.h 14 | @author Ivan Grokhotkov 15 | *****************************************************************************************************************************/ 16 | 17 | #include "base64.h" 18 | 19 | /* Simple test program 20 | #include 21 | void main() 22 | { 23 | char* in = "amcewen"; 24 | char out[22]; 25 | 26 | b64_encode(in, 15, out, 22); 27 | out[21] = '\0'; 28 | 29 | printf(out); 30 | } 31 | */ 32 | 33 | int base64_encode(const unsigned char* aInput, int aInputLen, unsigned char* aOutput, int aOutputLen) 34 | { 35 | // Work out if we've got enough space to encode the input 36 | // Every 6 bits of input becomes a byte of output 37 | if (aOutputLen < (aInputLen * 8) / 6) 38 | { 39 | // FIXME Should we return an error here, or just the length 40 | return (aInputLen * 8) / 6; 41 | } 42 | 43 | // If we get here we've got enough space to do the encoding 44 | 45 | const char* b64_dictionary = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 46 | 47 | if (aInputLen == 3) 48 | { 49 | aOutput[0] = b64_dictionary[aInput[0] >> 2]; 50 | aOutput[1] = b64_dictionary[(aInput[0] & 0x3) << 4 | (aInput[1] >> 4)]; 51 | aOutput[2] = b64_dictionary[(aInput[1] & 0x0F) << 2 | (aInput[2] >> 6)]; 52 | aOutput[3] = b64_dictionary[aInput[2] & 0x3F]; 53 | } 54 | else if (aInputLen == 2) 55 | { 56 | aOutput[0] = b64_dictionary[aInput[0] >> 2]; 57 | aOutput[1] = b64_dictionary[(aInput[0] & 0x3) << 4 | (aInput[1] >> 4)]; 58 | aOutput[2] = b64_dictionary[(aInput[1] & 0x0F) << 2]; 59 | aOutput[3] = '='; 60 | } 61 | else if (aInputLen == 1) 62 | { 63 | aOutput[0] = b64_dictionary[aInput[0] >> 2]; 64 | aOutput[1] = b64_dictionary[(aInput[0] & 0x3) << 4]; 65 | aOutput[2] = '='; 66 | aOutput[3] = '='; 67 | } 68 | else 69 | { 70 | // Break the input into 3-byte chunks and process each of them 71 | int i; 72 | 73 | for (i = 0; i < aInputLen / 3; i++) 74 | { 75 | base64_encode(&aInput[i * 3], 3, &aOutput[i * 4], 4); 76 | } 77 | 78 | if (aInputLen % 3 > 0) 79 | { 80 | // It doesn't fit neatly into a 3-byte chunk, so process what's left 81 | base64_encode(&aInput[i * 3], aInputLen % 3, &aOutput[i * 4], aOutputLen - (i * 4)); 82 | } 83 | } 84 | 85 | return ((aInputLen + 2) / 3) * 4; 86 | } 87 | 88 | -------------------------------------------------------------------------------- /src/libb64/base64.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | base64.h - c source to a base64 encoding algorithm implementation 3 | 4 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 5 | 6 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 7 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 8 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 9 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 10 | Licensed under MIT license 11 | 12 | Original author: 13 | @file Esp8266WebServer.h 14 | @author Ivan Grokhotkov 15 | *****************************************************************************************************************************/ 16 | 17 | #pragma once 18 | 19 | // Reintroduce to prevent duplication compile error if other lib/core already has LIB64 20 | // pragma once can't prevent that 21 | #ifndef base64_h 22 | #define base64_h 23 | 24 | int base64_encode(const unsigned char* aInput, int aInputLen, unsigned char* aOutput, int aOutputLen); 25 | 26 | 27 | #endif // base64_h 28 | 29 | -------------------------------------------------------------------------------- /src/libb64/cdecode.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | cdecoder.h - c source to a base64 decoding algorithm implementation 3 | 4 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 5 | 6 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 7 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 8 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 9 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 10 | Licensed under MIT license 11 | 12 | Original author: 13 | @file Esp8266WebServer.h 14 | @author Ivan Grokhotkov 15 | *****************************************************************************************************************************/ 16 | 17 | #pragma once 18 | 19 | // Reintroduce to prevent duplication compile error if other lib/core already has LIB64 20 | // pragma once can't prevent that 21 | #ifndef BASE64_CDECODE_H 22 | #define BASE64_CDECODE_H 23 | 24 | #define base64_decode_expected_len(n) ((n * 3) / 4) 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef enum 31 | { 32 | step_a, step_b, step_c, step_d 33 | } base64_decodestep; 34 | 35 | typedef struct 36 | { 37 | base64_decodestep step; 38 | char plainchar; 39 | } base64_decodestate; 40 | 41 | void base64_init_decodestate(base64_decodestate* state_in); 42 | 43 | int base64_decode_value(int value_in); 44 | 45 | int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in); 46 | 47 | int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out); 48 | 49 | #ifdef __cplusplus 50 | } // extern "C" 51 | #endif 52 | 53 | #endif /* BASE64_CDECODE_H */ 54 | 55 | -------------------------------------------------------------------------------- /src/libb64/cencode.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | cencoder.h - c source to a base64 decoding algorithm implementation 3 | 4 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 5 | 6 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 7 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 8 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 9 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 10 | Licensed under MIT license 11 | 12 | Original author: 13 | @file Esp8266WebServer.h 14 | @author Ivan Grokhotkov 15 | *****************************************************************************************************************************/ 16 | 17 | #pragma once 18 | 19 | // Reintroduce to prevent duplication compile error if other lib/core already has LIB64 20 | // pragma once can't prevent that 21 | #ifndef BASE64_CENCODE_H 22 | #define BASE64_CENCODE_H 23 | 24 | #define base64_encode_expected_len(n) ((((4 * n) / 3) + 3) & ~3) 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef enum 31 | { 32 | step_A, step_B, step_C 33 | } base64_encodestep; 34 | 35 | typedef struct 36 | { 37 | base64_encodestep step; 38 | char result; 39 | int stepcount; 40 | } base64_encodestate; 41 | 42 | void base64_init_encodestate(base64_encodestate* state_in); 43 | 44 | char base64_encode_value(char value_in); 45 | 46 | int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in); 47 | 48 | int base64_encode_blockend(char* code_out, base64_encodestate* state_in); 49 | 50 | int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out); 51 | 52 | #ifdef __cplusplus 53 | } // extern "C" 54 | #endif 55 | 56 | #endif /* BASE64_CENCODE_H */ 57 | 58 | -------------------------------------------------------------------------------- /src/utility/RingBuffer.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | RingBuffer.h - Dead simple web-server. 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 8 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 9 | Licensed under MIT license 10 | 11 | Original author: 12 | @file Esp8266WebServer.h 13 | @author Ivan Grokhotkov 14 | 15 | Version: 1.10.1 16 | 17 | Version Modified By Date Comments 18 | ------- ----------- ---------- ----------- 19 | 1.0.0 K Hoang 12/02/2020 Initial coding for SAMD21, Nano 33 IoT, etc running WiFiNINA 20 | ... 21 | 1.6.0 K Hoang 13/02/2022 Add support to new ESP32-S3 and ESP32_C3 22 | 1.6.1 K Hoang 13/02/2022 Fix v1.6.0 issue 23 | 1.6.2 K Hoang 22/02/2022 Add support to megaAVR using Arduino megaAVR core 24 | 1.6.3 K Hoang 02/03/2022 Fix decoding error bug 25 | 1.7.0 K Hoang 05/04/2022 Fix issue with Portenta_H7 core v2.7.2+ 26 | 1.8.0 K Hoang 26/04/2022 Add WiFiMulti library support and examples 27 | 1.9.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 28 | 1.9.1 K Hoang 13/08/2022 Add WiFiMulti support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 29 | 1.9.2 K Hoang 16/08/2022 Workaround for RP2040W WiFi.status() bug 30 | 1.9.3 K Hoang 16/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway 31 | 1.9.4 K Hoang 06/09/2022 Restore support to ESP32 and ESP8266 32 | 1.9.5 K Hoang 10/09/2022 Restore support to Teensy, etc. Fix bug in examples 33 | 1.10.0 K Hoang 13/11/2022 Add new features, such as CORS. Update code and examples 34 | 1.10.1 K Hoang 24/11/2022 Using new WiFi101_Generic library to send larger data 35 | *****************************************************************************************************************************/ 36 | 37 | #pragma once 38 | 39 | #ifndef RingBuffer_H 40 | #define RingBuffer_H 41 | 42 | //////////////////////////////////////// 43 | 44 | class WiFi_RingBuffer 45 | { 46 | public: 47 | WiFi_RingBuffer(unsigned int size); 48 | ~WiFi_RingBuffer(); 49 | 50 | void reset(); 51 | void init(); 52 | void push(char c); 53 | int getPos(); 54 | bool endsWith(const char* str); 55 | void getStr(char * destination, unsigned int skipChars); 56 | void getStrN(char * destination, unsigned int skipChars, unsigned int num); 57 | 58 | private: 59 | 60 | unsigned int _size; 61 | char* ringBuf; 62 | char* ringBufEnd; 63 | char* ringBufP; 64 | }; 65 | 66 | //////////////////////////////////////// 67 | 68 | #endif // RingBuffer_H 69 | -------------------------------------------------------------------------------- /src/utility/esp_detail/mimetable.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | mimetable.h - Dead simple web-server. 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 8 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 9 | Licensed under MIT license 10 | 11 | Original author: 12 | @file Esp8266WebServer.h 13 | @author Ivan Grokhotkov 14 | 15 | Version: 1.10.1 16 | 17 | Version Modified By Date Comments 18 | ------- ----------- ---------- ----------- 19 | 1.0.0 K Hoang 12/02/2020 Initial coding for SAMD21, Nano 33 IoT, etc running WiFiNINA 20 | ... 21 | 1.6.0 K Hoang 13/02/2022 Add support to new ESP32-S3 and ESP32_C3 22 | 1.6.1 K Hoang 13/02/2022 Fix v1.6.0 issue 23 | 1.6.2 K Hoang 22/02/2022 Add support to megaAVR using Arduino megaAVR core 24 | 1.6.3 K Hoang 02/03/2022 Fix decoding error bug 25 | 1.7.0 K Hoang 05/04/2022 Fix issue with Portenta_H7 core v2.7.2+ 26 | 1.8.0 K Hoang 26/04/2022 Add WiFiMulti library support and examples 27 | 1.9.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 28 | 1.9.1 K Hoang 13/08/2022 Add WiFiMulti support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 29 | 1.9.2 K Hoang 16/08/2022 Workaround for RP2040W WiFi.status() bug 30 | 1.9.3 K Hoang 16/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway 31 | 1.9.4 K Hoang 06/09/2022 Restore support to ESP32 and ESP8266 32 | 1.9.5 K Hoang 10/09/2022 Restore support to Teensy, etc. Fix bug in examples 33 | 1.10.0 K Hoang 13/11/2022 Add new features, such as CORS. Update code and examples 34 | 1.10.1 K Hoang 24/11/2022 Using new WiFi101_Generic library to send larger data 35 | *****************************************************************************************************************************/ 36 | 37 | #pragma once 38 | 39 | #ifndef __ESP_MIMETABLE_H__ 40 | #define __ESP_MIMETABLE_H__ 41 | 42 | #if (ESP32 || ESP8266) 43 | 44 | #include "WString.h" 45 | 46 | //////////////////////////////////////// 47 | 48 | namespace mime_esp 49 | { 50 | 51 | enum type 52 | { 53 | html, 54 | htm, 55 | css, 56 | txt, 57 | js, 58 | json, 59 | png, 60 | gif, 61 | jpg, 62 | ico, 63 | svg, 64 | ttf, 65 | otf, 66 | woff, 67 | woff2, 68 | eot, 69 | sfnt, 70 | xml, 71 | pdf, 72 | zip, 73 | gz, 74 | appcache, 75 | none, 76 | maxType 77 | }; 78 | 79 | //////////////////////////////////////// 80 | 81 | struct Entry 82 | { 83 | const char * endsWith; 84 | const char * mimeType; 85 | }; 86 | 87 | //////////////////////////////////////// 88 | 89 | extern const Entry mimeTable[maxType]; 90 | 91 | String getContentType(const String& path); 92 | } 93 | 94 | #endif // #if (ESP32 || ESP8266) 95 | #endif // #ifndef __ESP_MIMETABLE_H__ 96 | -------------------------------------------------------------------------------- /src/utility/mimetable.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************************************************************** 2 | mimetable.h - Dead simple web-server. 3 | For any WiFi shields, such as WiFiNINA W101, W102, W13x, or custom, such as ESP8266/ESP32-AT, Ethernet, etc 4 | 5 | WiFiWebServer is a library for the ESP32-based WiFi shields to run WebServer 6 | Forked and modified from ESP8266 https://github.com/esp8266/Arduino/releases 7 | Forked and modified from Arduino WiFiNINA library https://www.arduino.cc/en/Reference/WiFiNINA 8 | Built by Khoi Hoang https://github.com/khoih-prog/WiFiWebServer 9 | Licensed under MIT license 10 | 11 | Original author: 12 | @file Esp8266WebServer.h 13 | @author Ivan Grokhotkov 14 | 15 | Version: 1.10.1 16 | 17 | Version Modified By Date Comments 18 | ------- ----------- ---------- ----------- 19 | 1.0.0 K Hoang 12/02/2020 Initial coding for SAMD21, Nano 33 IoT, etc running WiFiNINA 20 | ... 21 | 1.6.0 K Hoang 13/02/2022 Add support to new ESP32-S3 and ESP32_C3 22 | 1.6.1 K Hoang 13/02/2022 Fix v1.6.0 issue 23 | 1.6.2 K Hoang 22/02/2022 Add support to megaAVR using Arduino megaAVR core 24 | 1.6.3 K Hoang 02/03/2022 Fix decoding error bug 25 | 1.7.0 K Hoang 05/04/2022 Fix issue with Portenta_H7 core v2.7.2+ 26 | 1.8.0 K Hoang 26/04/2022 Add WiFiMulti library support and examples 27 | 1.9.0 K Hoang 12/08/2022 Add support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 28 | 1.9.1 K Hoang 13/08/2022 Add WiFiMulti support to RASPBERRY_PI_PICO_W using CYW4343 WiFi 29 | 1.9.2 K Hoang 16/08/2022 Workaround for RP2040W WiFi.status() bug 30 | 1.9.3 K Hoang 16/08/2022 Better workaround for RP2040W WiFi.status() bug using ping() to local gateway 31 | 1.9.4 K Hoang 06/09/2022 Restore support to ESP32 and ESP8266 32 | 1.9.5 K Hoang 10/09/2022 Restore support to Teensy, etc. Fix bug in examples 33 | 1.10.0 K Hoang 13/11/2022 Add new features, such as CORS. Update code and examples 34 | 1.10.1 K Hoang 24/11/2022 Using new WiFi101_Generic library to send larger data 35 | *****************************************************************************************************************************/ 36 | 37 | #pragma once 38 | 39 | #ifndef __MIMETABLE_H__ 40 | #define __MIMETABLE_H__ 41 | 42 | namespace mime 43 | { 44 | 45 | enum type 46 | { 47 | html, 48 | htm, 49 | css, 50 | txt, 51 | js, 52 | json, 53 | png, 54 | gif, 55 | jpg, 56 | ico, 57 | svg, 58 | ttf, 59 | otf, 60 | woff, 61 | woff2, 62 | eot, 63 | sfnt, 64 | xml, 65 | pdf, 66 | zip, 67 | gz, 68 | appcache, 69 | none, 70 | maxType 71 | }; 72 | 73 | struct Entry 74 | { 75 | const char endsWith[16]; 76 | const char mimeType[32]; 77 | }; 78 | 79 | // Table of extension->MIME strings stored in PROGMEM, needs to be global due to GCC section typing rules 80 | const Entry mimeTable[maxType] = 81 | { 82 | { ".html", "text/html" }, 83 | { ".htm", "text/html" }, 84 | { ".css", "text/css" }, 85 | { ".txt", "text/plain" }, 86 | { ".js", "application/javascript" }, 87 | { ".json", "application/json" }, 88 | { ".png", "image/png" }, 89 | { ".gif", "image/gif" }, 90 | { ".jpg", "image/jpeg" }, 91 | { ".ico", "image/x-icon" }, 92 | { ".svg", "image/svg+xml" }, 93 | { ".ttf", "application/x-font-ttf" }, 94 | { ".otf", "application/x-font-opentype" }, 95 | { ".woff", "application/font-woff" }, 96 | { ".woff2", "application/font-woff2" }, 97 | { ".eot", "application/vnd.ms-fontobject" }, 98 | { ".sfnt", "application/font-sfnt" }, 99 | { ".xml", "text/xml" }, 100 | { ".pdf", "application/pdf" }, 101 | { ".zip", "application/zip" }, 102 | { ".gz", "application/x-gzip" }, 103 | { ".appcache", "text/cache-manifest" }, 104 | { "", "application/octet-stream" } 105 | }; 106 | //extern const Entry mimeTable[maxType]; 107 | } 108 | 109 | 110 | #endif // __MIMETABLE_H__ 111 | -------------------------------------------------------------------------------- /utils/astyle_library.conf: -------------------------------------------------------------------------------- 1 | # Code formatting rules for Arduino libraries, modified from for KH libraries: 2 | # 3 | # https://github.com/arduino/Arduino/blob/master/build/shared/examples_formatter.conf 4 | # 5 | 6 | # astyle --style=allman -s2 -t2 -C -S -xW -Y -M120 -f -p -xg -H -xb -c --xC120 -xL *.h *.cpp *.ino 7 | 8 | --mode=c 9 | --lineend=linux 10 | --style=allman 11 | 12 | # -r or -R 13 | #--recursive 14 | 15 | # -c => Converts tabs into spaces 16 | convert-tabs 17 | 18 | # -s2 => 2 spaces indentation 19 | --indent=spaces=2 20 | 21 | # -t2 => tab =2 spaces 22 | #--indent=tab=2 23 | 24 | # -C 25 | --indent-classes 26 | 27 | # -S 28 | --indent-switches 29 | 30 | # -xW 31 | --indent-preproc-block 32 | 33 | # -Y => indent classes, switches (and cases), comments starting at column 1 34 | --indent-col1-comments 35 | 36 | # -M120 => maximum of 120 spaces to indent a continuation line 37 | --max-continuation-indent=120 38 | 39 | # -xC120 => max‑code‑length will break a line if the code exceeds # characters 40 | --max-code-length=120 41 | 42 | # -f => 43 | --break-blocks 44 | 45 | # -p => put a space around operators 46 | --pad-oper 47 | 48 | # -xg => Insert space padding after commas 49 | --pad-comma 50 | 51 | # -H => put a space after if/for/while 52 | pad-header 53 | 54 | # -xb => Break one line headers (e.g. if/for/while) 55 | --break-one-line-headers 56 | 57 | # -c => Converts tabs into spaces 58 | #--convert-tabs 59 | 60 | # if you like one-liners, keep them 61 | #keep-one-line-statements 62 | 63 | # -xV 64 | --attach-closing-while 65 | 66 | #unpad-paren 67 | 68 | # -xp 69 | remove-comment-prefix 70 | 71 | -------------------------------------------------------------------------------- /utils/restyle.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for dir in . ; do 4 | find $dir -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.ino" \) -exec astyle --suffix=none --options=./utils/astyle_library.conf \{\} \; 5 | done 6 | 7 | --------------------------------------------------------------------------------