├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.md └── workflows │ └── githubci.yml ├── .gitignore ├── .gitmodules ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── boards.txt ├── bootloader ├── circuitplayground_nrf52840 │ ├── circuitplayground_nrf52840_bootloader-0.9.1_s140_6.1.1.hex │ ├── circuitplayground_nrf52840_bootloader-0.9.1_s140_6.1.1.zip │ └── update-circuitplayground_nrf52840_bootloader-0.9.1_nosd.uf2 ├── clue_nrf52840 │ ├── clue_nrf52840_bootloader-0.9.1_s140_6.1.1.hex │ ├── clue_nrf52840_bootloader-0.9.1_s140_6.1.1.zip │ └── update-clue_nrf52840_bootloader-0.9.1_nosd.uf2 ├── feather_nrf52832 │ ├── feather_nrf52832_bootloader-0.9.1_s132_6.1.1.hex │ └── feather_nrf52832_bootloader-0.9.1_s132_6.1.1.zip ├── feather_nrf52833_express │ ├── feather_nrf52833_express_bootloader-0.9.1_s140_7.3.0.hex │ ├── feather_nrf52833_express_bootloader-0.9.1_s140_7.3.0.zip │ └── update-feather_nrf52833_express_bootloader-0.9.1_nosd.uf2 ├── feather_nrf52840_express │ ├── feather_nrf52840_express_bootloader-0.9.1_s140_6.1.1.hex │ ├── feather_nrf52840_express_bootloader-0.9.1_s140_6.1.1.zip │ └── update-feather_nrf52840_express_bootloader-0.9.1_nosd.uf2 ├── feather_nrf52840_sense │ ├── feather_nrf52840_sense_bootloader-0.9.1_s140_6.1.1.hex │ ├── feather_nrf52840_sense_bootloader-0.9.1_s140_6.1.1.zip │ └── update-feather_nrf52840_sense_bootloader-0.9.1_nosd.uf2 ├── feather_nrf52840_sense_tft │ ├── feather_nrf52840_sense_tft_bootloader-0.9.1_s140_6.1.1.hex │ ├── feather_nrf52840_sense_tft_bootloader-0.9.1_s140_6.1.1.zip │ └── update-feather_nrf52840_sense_tft_bootloader-0.9.1_nosd.uf2 ├── itsybitsy_nrf52840_express │ ├── itsybitsy_nrf52840_express_bootloader-0.9.1_s140_6.1.1.hex │ ├── itsybitsy_nrf52840_express_bootloader-0.9.1_s140_6.1.1.zip │ └── update-itsybitsy_nrf52840_express_bootloader-0.9.1_nosd.uf2 ├── ledglasses_nrf52840 │ ├── ledglasses_nrf52840_bootloader-0.9.1_s140_6.1.1.hex │ ├── ledglasses_nrf52840_bootloader-0.9.1_s140_6.1.1.zip │ └── update-ledglasses_nrf52840_bootloader-0.9.1_nosd.uf2 ├── metro_nrf52840_express │ ├── metro_nrf52840_express_bootloader-0.9.1_s140_6.1.1.hex │ ├── metro_nrf52840_express_bootloader-0.9.1_s140_6.1.1.zip │ └── update-metro_nrf52840_express_bootloader-0.9.1_nosd.uf2 ├── particle_xenon │ ├── particle_xenon_bootloader-0.9.1_s140_6.1.1.hex │ ├── particle_xenon_bootloader-0.9.1_s140_6.1.1.zip │ └── update-particle_xenon_bootloader-0.9.1_nosd.uf2 ├── pca10056 │ ├── pca10056_bootloader-0.9.1_s140_6.1.1.hex │ ├── pca10056_bootloader-0.9.1_s140_6.1.1.zip │ └── update-pca10056_bootloader-0.9.1_nosd.uf2 ├── pca10100 │ ├── pca10100_bootloader-0.9.1_s140_7.3.0.hex │ ├── pca10100_bootloader-0.9.1_s140_7.3.0.zip │ └── update-pca10100_bootloader-0.9.1_nosd.uf2 └── raytac_mdbt50q_rx │ ├── raytac_mdbt50q_rx_bootloader-0.9.1_s140_6.1.1.hex │ ├── raytac_mdbt50q_rx_bootloader-0.9.1_s140_6.1.1.zip │ └── update-raytac_mdbt50q_rx_bootloader-0.9.1_nosd.uf2 ├── changelog.md ├── cores └── nRF5 │ ├── Arduino.h │ ├── Client.h │ ├── HardwarePWM.cpp │ ├── HardwarePWM.h │ ├── HardwareSerial.h │ ├── IPAddress.cpp │ ├── IPAddress.h │ ├── Print.cpp │ ├── Print.h │ ├── Printable.h │ ├── RingBuffer.cpp │ ├── RingBuffer.h │ ├── Server.h │ ├── Stream.cpp │ ├── Stream.h │ ├── Tone.cpp │ ├── Tone.h │ ├── Uart.cpp │ ├── Uart.h │ ├── Udp.h │ ├── WCharacter.h │ ├── WInterrupts.c │ ├── WInterrupts.h │ ├── WMath.cpp │ ├── WMath.h │ ├── WString.cpp │ ├── WString.h │ ├── WVariant.h │ ├── abi.cpp │ ├── avr │ ├── dtostrf.c │ ├── dtostrf.h │ ├── interrupt.h │ └── pgmspace.h │ ├── binary.h │ ├── common_func.h │ ├── common_inc.h │ ├── delay.c │ ├── delay.h │ ├── freertos │ ├── License │ │ └── license.txt │ ├── Source │ │ ├── croutine.c │ │ ├── event_groups.c │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── StackMacros.h │ │ │ ├── croutine.h │ │ │ ├── deprecated_definitions.h │ │ │ ├── event_groups.h │ │ │ ├── list.h │ │ │ ├── message_buffer.h │ │ │ ├── mpu_prototypes.h │ │ │ ├── mpu_wrappers.h │ │ │ ├── portable.h │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ ├── stack_macros.h │ │ │ ├── stdint.readme │ │ │ ├── stream_buffer.h │ │ │ ├── task.h │ │ │ └── timers.h │ │ ├── list.c │ │ ├── portable │ │ │ ├── MemMang │ │ │ │ └── heap_3.c │ │ │ └── readme.txt │ │ ├── queue.c │ │ ├── readme.txt │ │ ├── stream_buffer.c │ │ ├── tasks.c │ │ └── timers.c │ ├── config │ │ └── FreeRTOSConfig.h │ ├── portable │ │ ├── CMSIS │ │ │ └── nrf52 │ │ │ │ ├── port_cmsis.c │ │ │ │ ├── port_cmsis_systick.c │ │ │ │ └── portmacro_cmsis.h │ │ └── GCC │ │ │ └── nrf52 │ │ │ ├── port.c │ │ │ └── portmacro.h │ └── readme.txt │ ├── hooks.c │ ├── itoa.c │ ├── itoa.h │ ├── linker │ ├── gcc_startup_nrf52.S │ ├── gcc_startup_nrf52833.S │ ├── gcc_startup_nrf52840.S │ ├── nrf52832_s132_v6.ld │ ├── nrf52833_s140_v7.ld │ ├── nrf52840_s140_v6.ld │ └── nrf52_common.ld │ ├── main.cpp │ ├── new.cpp │ ├── nordic │ ├── nrfx │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── drivers │ │ │ ├── include │ │ │ │ ├── nrf_bitmask.h │ │ │ │ ├── nrfx_adc.h │ │ │ │ ├── nrfx_clock.h │ │ │ │ ├── nrfx_comp.h │ │ │ │ ├── nrfx_dppi.h │ │ │ │ ├── nrfx_egu.h │ │ │ │ ├── nrfx_gpiote.h │ │ │ │ ├── nrfx_i2s.h │ │ │ │ ├── nrfx_ipc.h │ │ │ │ ├── nrfx_lpcomp.h │ │ │ │ ├── nrfx_nfct.h │ │ │ │ ├── nrfx_nvmc.h │ │ │ │ ├── nrfx_pdm.h │ │ │ │ ├── nrfx_power.h │ │ │ │ ├── nrfx_power_clock.h │ │ │ │ ├── nrfx_power_compat.h │ │ │ │ ├── nrfx_ppi.h │ │ │ │ ├── nrfx_pwm.h │ │ │ │ ├── nrfx_qdec.h │ │ │ │ ├── nrfx_qspi.h │ │ │ │ ├── nrfx_rng.h │ │ │ │ ├── nrfx_rtc.h │ │ │ │ ├── nrfx_saadc.h │ │ │ │ ├── nrfx_spi.h │ │ │ │ ├── nrfx_spim.h │ │ │ │ ├── nrfx_spis.h │ │ │ │ ├── nrfx_systick.h │ │ │ │ ├── nrfx_temp.h │ │ │ │ ├── nrfx_timer.h │ │ │ │ ├── nrfx_twi.h │ │ │ │ ├── nrfx_twi_twim.h │ │ │ │ ├── nrfx_twim.h │ │ │ │ ├── nrfx_twis.h │ │ │ │ ├── nrfx_uart.h │ │ │ │ ├── nrfx_uarte.h │ │ │ │ ├── nrfx_usbd.h │ │ │ │ ├── nrfx_usbreg.h │ │ │ │ └── nrfx_wdt.h │ │ │ ├── nrfx_common.h │ │ │ ├── nrfx_errors.h │ │ │ └── src │ │ │ │ ├── nrfx_gpiote.c │ │ │ │ ├── nrfx_power.c │ │ │ │ ├── nrfx_pwm.c │ │ │ │ ├── nrfx_qspi.c │ │ │ │ ├── nrfx_spim.c │ │ │ │ ├── nrfx_spis.c │ │ │ │ ├── nrfx_temp.c │ │ │ │ ├── nrfx_timer.c │ │ │ │ ├── nrfx_usbd_errata.h │ │ │ │ └── prs │ │ │ │ └── nrfx_prs.h │ │ ├── hal │ │ │ ├── nrf_aar.h │ │ │ ├── nrf_acl.h │ │ │ ├── nrf_adc.h │ │ │ ├── nrf_bprot.h │ │ │ ├── nrf_cache.h │ │ │ ├── nrf_ccm.h │ │ │ ├── nrf_clock.h │ │ │ ├── nrf_comp.h │ │ │ ├── nrf_dcnf.h │ │ │ ├── nrf_dppi.h │ │ │ ├── nrf_ecb.h │ │ │ ├── nrf_egu.h │ │ │ ├── nrf_ficr.h │ │ │ ├── nrf_fpu.h │ │ │ ├── nrf_gpio.h │ │ │ ├── nrf_gpiote.h │ │ │ ├── nrf_i2s.h │ │ │ ├── nrf_ipc.h │ │ │ ├── nrf_kmu.h │ │ │ ├── nrf_lpcomp.h │ │ │ ├── nrf_mpu.h │ │ │ ├── nrf_mutex.h │ │ │ ├── nrf_mwu.h │ │ │ ├── nrf_nfct.h │ │ │ ├── nrf_nvmc.h │ │ │ ├── nrf_oscillators.h │ │ │ ├── nrf_pdm.h │ │ │ ├── nrf_power.h │ │ │ ├── nrf_ppi.h │ │ │ ├── nrf_pwm.h │ │ │ ├── nrf_qdec.h │ │ │ ├── nrf_qspi.h │ │ │ ├── nrf_radio.h │ │ │ ├── nrf_regulators.h │ │ │ ├── nrf_reset.h │ │ │ ├── nrf_rng.h │ │ │ ├── nrf_rtc.h │ │ │ ├── nrf_saadc.h │ │ │ ├── nrf_spi.h │ │ │ ├── nrf_spim.h │ │ │ ├── nrf_spis.h │ │ │ ├── nrf_spu.h │ │ │ ├── nrf_systick.h │ │ │ ├── nrf_temp.h │ │ │ ├── nrf_timer.h │ │ │ ├── nrf_twi.h │ │ │ ├── nrf_twim.h │ │ │ ├── nrf_twis.h │ │ │ ├── nrf_uart.h │ │ │ ├── nrf_uarte.h │ │ │ ├── nrf_usbd.h │ │ │ ├── nrf_usbreg.h │ │ │ ├── nrf_vmc.h │ │ │ ├── nrf_vreqctrl.h │ │ │ └── nrf_wdt.h │ │ ├── helpers │ │ │ └── nrfx_gppi.h │ │ ├── mdk │ │ │ ├── compiler_abstraction.h │ │ │ ├── nrf.h │ │ │ ├── nrf51.h │ │ │ ├── nrf51422_peripherals.h │ │ │ ├── nrf51801_peripherals.h │ │ │ ├── nrf51802_peripherals.h │ │ │ ├── nrf51822_peripherals.h │ │ │ ├── nrf51824_peripherals.h │ │ │ ├── nrf51_bitfields.h │ │ │ ├── nrf51_deprecated.h │ │ │ ├── nrf51_erratas.h │ │ │ ├── nrf51_peripherals.h │ │ │ ├── nrf51_to_nrf52.h │ │ │ ├── nrf51_to_nrf52810.h │ │ │ ├── nrf51_to_nrf52840.h │ │ │ ├── nrf52.h │ │ │ ├── nrf52805.h │ │ │ ├── nrf52805_bitfields.h │ │ │ ├── nrf52805_peripherals.h │ │ │ ├── nrf52810.h │ │ │ ├── nrf52810_bitfields.h │ │ │ ├── nrf52810_name_change.h │ │ │ ├── nrf52810_peripherals.h │ │ │ ├── nrf52810_to_nrf52811.h │ │ │ ├── nrf52811.h │ │ │ ├── nrf52811_bitfields.h │ │ │ ├── nrf52811_peripherals.h │ │ │ ├── nrf52832_peripherals.h │ │ │ ├── nrf52833.h │ │ │ ├── nrf52833_bitfields.h │ │ │ ├── nrf52833_peripherals.h │ │ │ ├── nrf52840.h │ │ │ ├── nrf52840_bitfields.h │ │ │ ├── nrf52840_peripherals.h │ │ │ ├── nrf52_bitfields.h │ │ │ ├── nrf52_erratas.h │ │ │ ├── nrf52_name_change.h │ │ │ ├── nrf52_to_nrf52810.h │ │ │ ├── nrf52_to_nrf52833.h │ │ │ ├── nrf52_to_nrf52840.h │ │ │ ├── nrf53_erratas.h │ │ │ ├── nrf91_erratas.h │ │ │ ├── nrf_erratas.h │ │ │ ├── nrf_peripherals.h │ │ │ ├── system_nrf.h │ │ │ ├── system_nrf52.c │ │ │ ├── system_nrf52.h │ │ │ ├── system_nrf52833.c │ │ │ ├── system_nrf52833.h │ │ │ ├── system_nrf52840.c │ │ │ └── system_nrf52840.h │ │ ├── nrfx.h │ │ └── soc │ │ │ ├── nrfx_coredep.h │ │ │ ├── nrfx_irqs.h │ │ │ ├── nrfx_irqs_nrf51.h │ │ │ ├── nrfx_irqs_nrf52810.h │ │ │ ├── nrfx_irqs_nrf52811.h │ │ │ ├── nrfx_irqs_nrf52832.h │ │ │ ├── nrfx_irqs_nrf52833.h │ │ │ └── nrfx_irqs_nrf52840.h │ ├── nrfx_config.h │ ├── nrfx_glue.h │ ├── nrfx_log.h │ └── softdevice │ │ ├── s132_nrf52_6.1.1_API │ │ └── include │ │ │ ├── ble.h │ │ │ ├── ble_err.h │ │ │ ├── ble_gap.h │ │ │ ├── ble_gatt.h │ │ │ ├── ble_gattc.h │ │ │ ├── ble_gatts.h │ │ │ ├── ble_hci.h │ │ │ ├── ble_l2cap.h │ │ │ ├── ble_ranges.h │ │ │ ├── ble_types.h │ │ │ ├── nrf52 │ │ │ └── nrf_mbr.h │ │ │ ├── nrf_error.h │ │ │ ├── nrf_error_sdm.h │ │ │ ├── nrf_error_soc.h │ │ │ ├── nrf_nvic.h │ │ │ ├── nrf_sdm.h │ │ │ ├── nrf_soc.h │ │ │ └── nrf_svc.h │ │ ├── s140_nrf52_6.1.1_API │ │ └── include │ │ │ ├── ble.h │ │ │ ├── ble_err.h │ │ │ ├── ble_gap.h │ │ │ ├── ble_gatt.h │ │ │ ├── ble_gattc.h │ │ │ ├── ble_gatts.h │ │ │ ├── ble_hci.h │ │ │ ├── ble_l2cap.h │ │ │ ├── ble_ranges.h │ │ │ ├── ble_types.h │ │ │ ├── nrf52 │ │ │ └── nrf_mbr.h │ │ │ ├── nrf_error.h │ │ │ ├── nrf_error_sdm.h │ │ │ ├── nrf_error_soc.h │ │ │ ├── nrf_nvic.h │ │ │ ├── nrf_sdm.h │ │ │ ├── nrf_soc.h │ │ │ └── nrf_svc.h │ │ └── s140_nrf52_7.3.0_API │ │ └── include │ │ ├── ble.h │ │ ├── ble_err.h │ │ ├── ble_gap.h │ │ ├── ble_gatt.h │ │ ├── ble_gattc.h │ │ ├── ble_gatts.h │ │ ├── ble_hci.h │ │ ├── ble_l2cap.h │ │ ├── ble_ranges.h │ │ ├── ble_types.h │ │ ├── nrf52 │ │ └── nrf_mbr.h │ │ ├── nrf_error.h │ │ ├── nrf_error_sdm.h │ │ ├── nrf_error_soc.h │ │ ├── nrf_nvic.h │ │ ├── nrf_sdm.h │ │ ├── nrf_soc.h │ │ └── nrf_svc.h │ ├── pins_arduino.h │ ├── pulse.c │ ├── pulse.h │ ├── pulse_asm.S │ ├── rtos.cpp │ ├── rtos.h │ ├── sysview │ ├── Config │ │ ├── Global.h │ │ ├── SEGGER_RTT_Conf.h │ │ ├── SEGGER_SYSVIEW_Conf.h │ │ └── SEGGER_SYSVIEW_Config_FreeRTOS.c │ ├── SEGGER │ │ ├── SEGGER.h │ │ ├── SEGGER_RTT.c │ │ ├── SEGGER_RTT.h │ │ ├── SEGGER_RTT_ASM_ARMv7M.S │ │ ├── SEGGER_RTT_printf.c │ │ ├── SEGGER_SYSVIEW.c │ │ ├── SEGGER_SYSVIEW.h │ │ ├── SEGGER_SYSVIEW_ConfDefaults.h │ │ └── SEGGER_SYSVIEW_Int.h │ ├── SEGGER_SYSVIEW_FreeRTOS.c │ └── SEGGER_SYSVIEW_FreeRTOS.h │ ├── utility │ ├── AdaCallback.c │ ├── AdaCallback.h │ ├── SoftwareTimer.cpp │ ├── SoftwareTimer.h │ ├── TimeoutTimer.h │ ├── adafruit_fifo.cpp │ ├── adafruit_fifo.h │ ├── debug.cpp │ ├── debug.h │ ├── utilities.c │ └── utilities.h │ ├── verify.h │ ├── wiring.c │ ├── wiring.h │ ├── wiring_analog.cpp │ ├── wiring_analog.h │ ├── wiring_analog_nRF52.c │ ├── wiring_constants.h │ ├── wiring_digital.c │ ├── wiring_digital.h │ ├── wiring_private.c │ ├── wiring_private.h │ ├── wiring_shift.c │ └── wiring_shift.h ├── keywords.txt ├── libraries ├── Adafruit_LittleFS │ ├── library.properties │ └── src │ │ ├── Adafruit_LittleFS.cpp │ │ ├── Adafruit_LittleFS.h │ │ ├── Adafruit_LittleFS_File.cpp │ │ ├── Adafruit_LittleFS_File.h │ │ └── littlefs │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── lfs.c │ │ ├── lfs.h │ │ ├── lfs_util.c │ │ └── lfs_util.h ├── BLEAdafruitService │ ├── library.properties │ └── src │ │ ├── BLEAdafruitService.h │ │ └── services │ │ ├── BLEAdafruitAccel.cpp │ │ ├── BLEAdafruitAccel.h │ │ ├── BLEAdafruitAddressablePixel.cpp │ │ ├── BLEAdafruitAddressablePixel.h │ │ ├── BLEAdafruitBaro.cpp │ │ ├── BLEAdafruitBaro.h │ │ ├── BLEAdafruitButton.cpp │ │ ├── BLEAdafruitButton.h │ │ ├── BLEAdafruitColor.cpp │ │ ├── BLEAdafruitColor.h │ │ ├── BLEAdafruitGesture.cpp │ │ ├── BLEAdafruitGesture.h │ │ ├── BLEAdafruitGyro.cpp │ │ ├── BLEAdafruitGyro.h │ │ ├── BLEAdafruitHumid.cpp │ │ ├── BLEAdafruitHumid.h │ │ ├── BLEAdafruitLightSensor.cpp │ │ ├── BLEAdafruitLightSensor.h │ │ ├── BLEAdafruitMagnetic.cpp │ │ ├── BLEAdafruitMagnetic.h │ │ ├── BLEAdafruitProximity.cpp │ │ ├── BLEAdafruitProximity.h │ │ ├── BLEAdafruitQuaternion.cpp │ │ ├── BLEAdafruitQuaternion.h │ │ ├── BLEAdafruitSensor.cpp │ │ ├── BLEAdafruitSensor.h │ │ ├── BLEAdafruitSound.cpp │ │ ├── BLEAdafruitSound.h │ │ ├── BLEAdafruitTemperature.cpp │ │ ├── BLEAdafruitTemperature.h │ │ ├── BLEAdafruitTone.cpp │ │ └── BLEAdafruitTone.h ├── BLEHomekit │ ├── README.md │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── BLEHomekit.cpp │ │ ├── BLEHomekit.h │ │ ├── HAPCharacteristic.cpp │ │ ├── HAPCharacteristic.h │ │ ├── HAPProcedure.cpp │ │ ├── HAPProcedure.h │ │ ├── HAPService.cpp │ │ ├── HAPService.h │ │ ├── HAPUuid.h │ │ ├── crypto │ │ ├── crypto.c │ │ ├── crypto.h │ │ ├── random.c │ │ ├── random.h │ │ ├── srp │ │ │ ├── bignum.c │ │ │ ├── bignum.h │ │ │ ├── bn_mul.h │ │ │ ├── check_config.h │ │ │ ├── config.h │ │ │ ├── memory_buffer_alloc.c │ │ │ ├── memory_buffer_alloc.h │ │ │ ├── platform.c │ │ │ ├── platform.h │ │ │ ├── srp.c │ │ │ └── srp.h │ │ └── tweetnacl-modified │ │ │ ├── tweetnacl.c │ │ │ └── tweetnacl.h │ │ └── service │ │ ├── HAPAccessoryInfo.cpp │ │ ├── HAPAccessoryInfo.h │ │ ├── HAPLightBulb.cpp │ │ ├── HAPLightBulb.h │ │ ├── HAPPairing.cpp │ │ ├── HAPPairing.h │ │ ├── HAPProtocol.cpp │ │ └── HAPProtocol.h ├── Bluefruit52Lib │ ├── LICENSE │ ├── README.md │ ├── examples │ │ ├── Central │ │ │ ├── central_bleuart │ │ │ │ └── central_bleuart.ino │ │ │ ├── central_bleuart_multi │ │ │ │ └── central_bleuart_multi.ino │ │ │ ├── central_custom_hrm │ │ │ │ └── central_custom_hrm.ino │ │ │ ├── central_hid │ │ │ │ └── central_hid.ino │ │ │ ├── central_pairing │ │ │ │ └── central_pairing.ino │ │ │ ├── central_scan │ │ │ │ └── central_scan.ino │ │ │ ├── central_scan_advanced │ │ │ │ └── central_scan_advanced.ino │ │ │ ├── central_throughput │ │ │ │ └── central_throughput.ino │ │ │ └── central_ti_sensortag_optical │ │ │ │ └── central_ti_sensortag_optical.ino │ │ ├── DualRoles │ │ │ └── dual_bleuart │ │ │ │ └── dual_bleuart.ino │ │ ├── Hardware │ │ │ ├── Fading │ │ │ │ └── Fading.ino │ │ │ ├── Serial1_test │ │ │ │ ├── .feather52832.test.skip │ │ │ │ └── Serial1_test.ino │ │ │ ├── SerialEcho │ │ │ │ └── SerialEcho.ino │ │ │ ├── adc │ │ │ │ └── adc.ino │ │ │ ├── adc_vbat │ │ │ │ ├── .cluenrf52840.test.skip │ │ │ │ ├── .itsybitsy52840.test.skip │ │ │ │ └── adc_vbat.ino │ │ │ ├── blink_sleep │ │ │ │ └── blink_sleep.ino │ │ │ ├── blinky │ │ │ │ └── blinky.ino │ │ │ ├── dfu_ota │ │ │ │ └── dfu_ota.ino │ │ │ ├── dfu_serial │ │ │ │ └── dfu_serial.ino │ │ │ ├── digital_interrupt_deferred │ │ │ │ └── digital_interrupt_deferred.ino │ │ │ ├── fwinfo │ │ │ │ └── fwinfo.ino │ │ │ ├── gpstest_swuart │ │ │ │ └── gpstest_swuart.ino │ │ │ ├── hw_systick │ │ │ │ └── hw_systick.ino │ │ │ ├── hwinfo │ │ │ │ └── hwinfo.ino │ │ │ ├── hwpwm │ │ │ │ └── hwpwm.ino │ │ │ ├── meminfo │ │ │ │ └── meminfo.ino │ │ │ ├── nfc_to_gpio │ │ │ │ └── nfc_to_gpio.ino │ │ │ ├── rtos_scheduler │ │ │ │ └── rtos_scheduler.ino │ │ │ ├── software_timer │ │ │ │ └── software_timer.ino │ │ │ ├── temp_measure_blocking │ │ │ │ └── temp_measure_blocking.ino │ │ │ ├── temp_measure_non_blocking │ │ │ │ └── temp_measure_non_blocking.ino │ │ │ └── tone_happy_birthday │ │ │ │ └── tone_happy_birthday.ino │ │ ├── Peripheral │ │ │ ├── StandardFirmataBLE │ │ │ │ ├── LICENSE.txt │ │ │ │ └── StandardFirmataBLE.ino │ │ │ ├── adv_AdafruitColor │ │ │ │ └── adv_AdafruitColor.ino │ │ │ ├── adv_advanced │ │ │ │ └── adv_advanced.ino │ │ │ ├── ancs │ │ │ │ └── ancs.ino │ │ │ ├── ancs_arcada │ │ │ │ ├── .cluenrf52840.test.only │ │ │ │ ├── .cplaynrf52840.test.only │ │ │ │ └── ancs_arcada.ino │ │ │ ├── ancs_oled │ │ │ │ └── ancs_oled.ino │ │ │ ├── arduino_science_journal │ │ │ │ ├── .cluenrf52840.test.only │ │ │ │ ├── .cplaynrf52840.test.only │ │ │ │ ├── .feather52840sense.test.only │ │ │ │ └── arduino_science_journal.ino │ │ │ ├── beacon │ │ │ │ └── beacon.ino │ │ │ ├── blehid_camerashutter │ │ │ │ └── blehid_camerashutter.ino │ │ │ ├── blehid_gamepad │ │ │ │ └── blehid_gamepad.ino │ │ │ ├── blehid_keyboard │ │ │ │ └── blehid_keyboard.ino │ │ │ ├── blehid_keyscan │ │ │ │ └── blehid_keyscan.ino │ │ │ ├── blehid_mouse │ │ │ │ └── blehid_mouse.ino │ │ │ ├── blemidi │ │ │ │ └── blemidi.ino │ │ │ ├── bleuart │ │ │ │ └── bleuart.ino │ │ │ ├── bleuart_multi │ │ │ │ └── bleuart_multi.ino │ │ │ ├── blinky_ota │ │ │ │ └── blinky_ota.ino │ │ │ ├── bluefruit_playground │ │ │ │ ├── .cluenrf52840.test.only │ │ │ │ ├── .cplaynrf52840.test.only │ │ │ │ ├── .feather52840sense.test.only │ │ │ │ └── bluefruit_playground.ino │ │ │ ├── clearbonds │ │ │ │ └── clearbonds.ino │ │ │ ├── client_cts │ │ │ │ └── client_cts.ino │ │ │ ├── client_cts_oled │ │ │ │ └── client_cts_oled.ino │ │ │ ├── controller │ │ │ │ ├── controller.ino │ │ │ │ └── packetParser.cpp │ │ │ ├── custom_hrm │ │ │ │ └── custom_hrm.ino │ │ │ ├── custom_htm │ │ │ │ ├── IEEE11073float.cpp │ │ │ │ ├── IEEE11073float.h │ │ │ │ └── custom_htm.ino │ │ │ ├── eddystone_url │ │ │ │ └── eddystone_url.ino │ │ │ ├── image_eink_transfer │ │ │ │ └── image_eink_transfer.ino │ │ │ ├── image_transfer │ │ │ │ └── image_transfer.ino │ │ │ ├── neomatrix │ │ │ │ └── neomatrix.ino │ │ │ ├── neopixel │ │ │ │ └── neopixel.ino │ │ │ ├── nrf_blinky │ │ │ │ └── nrf_blinky.ino │ │ │ ├── pairing_passkey │ │ │ │ └── pairing_passkey.ino │ │ │ ├── pairing_passkey_arcada │ │ │ │ ├── .cluenrf52840.test.only │ │ │ │ ├── .cplaynrf52840.test.only │ │ │ │ └── pairing_passkey_arcada.ino │ │ │ ├── pairing_pin │ │ │ │ └── pairing_pin.ino │ │ │ ├── rssi_callback │ │ │ │ └── rssi_callback.ino │ │ │ ├── rssi_poll │ │ │ │ └── rssi_poll.ino │ │ │ ├── tf4micro-motion-kit │ │ │ │ ├── .none-cluenrf52840.test.only │ │ │ │ ├── .none-feather52840sense.test.only │ │ │ │ ├── ble_file_transfer.cpp │ │ │ │ ├── ble_file_transfer.h │ │ │ │ ├── data_provider.cpp │ │ │ │ ├── data_provider.h │ │ │ │ ├── model_tester.cpp │ │ │ │ ├── model_tester.h │ │ │ │ └── tf4micro-motion-kit.ino │ │ │ └── throughput │ │ │ │ └── throughput.ino │ │ └── Projects │ │ │ ├── homekit │ │ │ └── homekit_lightbulb │ │ │ │ ├── .all.test.skip │ │ │ │ └── homekit_lightbulb.ino │ │ │ └── rssi_proximity │ │ │ ├── README.md │ │ │ ├── rssi_proximity_central │ │ │ └── rssi_proximity_central.ino │ │ │ └── rssi_proximity_peripheral │ │ │ └── rssi_proximity_peripheral.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── BLEAdvertising.cpp │ │ ├── BLEAdvertising.h │ │ ├── BLECentral.cpp │ │ ├── BLECentral.h │ │ ├── BLECharacteristic.cpp │ │ ├── BLECharacteristic.h │ │ ├── BLEClientCharacteristic.cpp │ │ ├── BLEClientCharacteristic.h │ │ ├── BLEClientService.cpp │ │ ├── BLEClientService.h │ │ ├── BLEConnection.cpp │ │ ├── BLEConnection.h │ │ ├── BLEDiscovery.cpp │ │ ├── BLEDiscovery.h │ │ ├── BLEGatt.cpp │ │ ├── BLEGatt.h │ │ ├── BLEPeriph.cpp │ │ ├── BLEPeriph.h │ │ ├── BLEScanner.cpp │ │ ├── BLEScanner.h │ │ ├── BLESecurity.cpp │ │ ├── BLESecurity.h │ │ ├── BLEService.cpp │ │ ├── BLEService.h │ │ ├── BLEUuid.cpp │ │ ├── BLEUuid.h │ │ ├── bluefruit.cpp │ │ ├── bluefruit.h │ │ ├── bluefruit_common.h │ │ ├── clients │ │ ├── BLEAncs.cpp │ │ ├── BLEAncs.h │ │ ├── BLEClientBas.cpp │ │ ├── BLEClientBas.h │ │ ├── BLEClientCts.cpp │ │ ├── BLEClientCts.h │ │ ├── BLEClientDis.cpp │ │ ├── BLEClientDis.h │ │ ├── BLEClientHidAdafruit.cpp │ │ ├── BLEClientHidAdafruit.h │ │ ├── BLEClientIas.cpp │ │ ├── BLEClientIas.h │ │ ├── BLEClientUart.cpp │ │ └── BLEClientUart.h │ │ ├── services │ │ ├── BLEBas.cpp │ │ ├── BLEBas.h │ │ ├── BLEBeacon.cpp │ │ ├── BLEBeacon.h │ │ ├── BLEDfu.cpp │ │ ├── BLEDfu.h │ │ ├── BLEDis.cpp │ │ ├── BLEDis.h │ │ ├── BLEHidAdafruit.cpp │ │ ├── BLEHidAdafruit.h │ │ ├── BLEHidGamepad.cpp │ │ ├── BLEHidGamepad.h │ │ ├── BLEHidGeneric.cpp │ │ ├── BLEHidGeneric.h │ │ ├── BLEIas.cpp │ │ ├── BLEIas.h │ │ ├── BLEMidi.cpp │ │ ├── BLEMidi.h │ │ ├── BLEUart.cpp │ │ ├── BLEUart.h │ │ ├── EddyStone.cpp │ │ └── EddyStone.h │ │ └── utility │ │ ├── AdaMsg.cpp │ │ ├── AdaMsg.h │ │ ├── bonding.cpp │ │ ├── bonding.h │ │ └── bootloader_util.c ├── InternalFileSytem │ ├── examples │ │ ├── Internal_Format │ │ │ └── Internal_Format.ino │ │ ├── Internal_ListFiles │ │ │ └── Internal_ListFiles.ino │ │ ├── Internal_ReadWrite │ │ │ └── Internal_ReadWrite.ino │ │ └── Internal_StressTest │ │ │ └── Internal_StressTest.ino │ ├── library.properties │ └── src │ │ ├── InternalFileSystem.cpp │ │ ├── InternalFileSystem.h │ │ └── flash │ │ ├── flash_cache.c │ │ ├── flash_cache.h │ │ ├── flash_nrf5x.c │ │ └── flash_nrf5x.h ├── PDM │ ├── examples │ │ └── PDMSerialPlotter │ │ │ └── PDMSerialPlotter.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── PDM.cpp │ │ ├── PDM.h │ │ └── utility │ │ ├── PDMDoubleBuffer.cpp │ │ └── PDMDoubleBuffer.h ├── RotaryEncoder │ ├── LICENSE │ ├── RotaryEncoder.cpp │ ├── RotaryEncoder.h │ ├── SwRotaryEncoder.cpp │ ├── SwRotaryEncoder.h │ ├── examples │ │ ├── HwEncoderCallback │ │ │ └── HwEncoderCallback.ino │ │ ├── HwEncoderPoll │ │ │ └── HwEncoderPoll.ino │ │ ├── SwEncoderCallback │ │ │ └── SwEncoderCallback.ino │ │ └── SwEncoderPoll │ │ │ └── SwEncoderPoll.ino │ ├── keywords.txt │ └── library.properties ├── SPI │ ├── SPI.cpp │ ├── SPI.h │ ├── SPI_nrf52832.cpp │ ├── examples │ │ ├── BarometricPressureSensor │ │ │ └── BarometricPressureSensor.ino │ │ └── DigitalPotControl │ │ │ └── DigitalPotControl.ino │ ├── keywords.txt │ └── library.properties ├── Servo │ ├── README.adoc │ ├── examples │ │ ├── Knob │ │ │ └── Knob.ino │ │ └── Sweep │ │ │ └── Sweep.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── Servo.h │ │ └── nrf52 │ │ ├── Servo.cpp │ │ └── ServoTimers.h ├── SoftwareSerial │ ├── SoftwareSerial.cpp │ ├── SoftwareSerial.h │ ├── examples │ │ ├── SoftwareSerialExample │ │ │ └── SoftwareSerialExample.ino │ │ └── TwoPortReceive │ │ │ └── TwoPortReceive.ino │ ├── keywords.txt │ └── library.properties └── Wire │ ├── Wire.h │ ├── Wire_nRF52.cpp │ ├── examples │ ├── SFRRanger_reader │ │ └── SFRRanger_reader.ino │ ├── digital_potentiometer │ │ └── digital_potentiometer.ino │ ├── main_reader │ │ └── main_reader.ino │ ├── main_scan │ │ └── main_scan.ino │ ├── main_writer │ │ └── main_writer.ino │ ├── secondary_receiver │ │ └── secondary_receiver.ino │ └── secondary_sender │ │ └── secondary_sender.ino │ ├── keywords.txt │ └── library.properties ├── platform.txt ├── programmers.txt ├── scripts ├── jlink │ └── debug_custom.json └── openocd │ ├── daplink_nrf52.cfg │ └── jlink_nrf52.cfg ├── tools ├── adafruit-nrfutil │ ├── macos │ │ └── adafruit-nrfutil │ └── win32 │ │ └── adafruit-nrfutil.exe ├── build_all.py ├── makeboards.py ├── midi_tests │ ├── README.md │ ├── package.json │ ├── rx.js │ ├── rx_arduino │ │ └── rx_arduino.ino │ ├── tx.js │ └── tx_arduino │ │ └── tx_arduino.ino ├── pynrfbintool │ ├── nrfbintool.c │ ├── pynrfbintool.py │ └── readme.md ├── uf2conv │ ├── LICENSE.txt │ └── uf2conv.py └── update_bootloader.py └── variants ├── circuitplayground_nrf52840 ├── variant.cpp └── variant.h ├── clue_nrf52840 ├── variant.cpp └── variant.h ├── feather_nrf52832 ├── variant.cpp └── variant.h ├── feather_nrf52833_express ├── variant.cpp └── variant.h ├── feather_nrf52840_express ├── variant.cpp └── variant.h ├── feather_nrf52840_sense ├── variant.cpp └── variant.h ├── feather_nrf52840_sense_tft ├── variant.cpp └── variant.h ├── itsybitsy_nrf52840_express ├── variant.cpp └── variant.h ├── ledglasses_nrf52840 ├── variant.cpp └── variant.h ├── metro_nrf52840_express ├── variant.cpp └── variant.h ├── particle_xenon ├── variant.cpp └── variant.h ├── pca10056 ├── variant.cpp └── variant.h ├── pca10100 ├── variant.cpp └── variant.h └── raytac_mdbt50q_rx ├── variant.cpp └── variant.h /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Adafruit Support Forum 4 | url: https://forums.adafruit.com 5 | about: If you have other questions or need help, post it here. 6 | - name: Discussion 7 | url: https://github.com/adafruit/Adafruit_nRF52_Arduino/discussions 8 | about: If you have other questions or need help, post it here. 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: Feature 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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.o 3 | *.obj 4 | 5 | # Visual Studio Code 6 | .vscode/ 7 | .idea/ 8 | .pio/ 9 | .piopm 10 | /libraries/*/.development 11 | 12 | # Executables 13 | *.out 14 | *.app 15 | 16 | *.pyc 17 | /tools/.idea/ 18 | /tools/midi_tests/node_modules 19 | 20 | .DS_Store 21 | *.swp 22 | /Output 23 | 24 | # Ignore local overrides of platform.txt and boards.txt, 25 | /boards.local.txt 26 | /platform.local.txt 27 | 28 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libraries/Adafruit_nRFCrypto"] 2 | path = libraries/Adafruit_nRFCrypto 3 | url = https://github.com/adafruit/Adafruit_nRFCrypto.git 4 | [submodule "libraries/Adafruit_TinyUSB_Arduino"] 5 | path = libraries/Adafruit_TinyUSB_Arduino 6 | url = https://github.com/adafruit/Adafruit_TinyUSB_Arduino.git 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Arduino LLC. All right reserved. 2 | Copyright (c) 2016 Sandeep Mistry All right reserved. 3 | Copyright (c) 2017 Adafruit Industries. All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 | See the GNU Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | -------------------------------------------------------------------------------- /bootloader/circuitplayground_nrf52840/circuitplayground_nrf52840_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/circuitplayground_nrf52840/circuitplayground_nrf52840_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/circuitplayground_nrf52840/update-circuitplayground_nrf52840_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/circuitplayground_nrf52840/update-circuitplayground_nrf52840_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/clue_nrf52840/clue_nrf52840_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/clue_nrf52840/clue_nrf52840_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/clue_nrf52840/update-clue_nrf52840_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/clue_nrf52840/update-clue_nrf52840_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/feather_nrf52832/feather_nrf52832_bootloader-0.9.1_s132_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/feather_nrf52832/feather_nrf52832_bootloader-0.9.1_s132_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/feather_nrf52833_express/feather_nrf52833_express_bootloader-0.9.1_s140_7.3.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/feather_nrf52833_express/feather_nrf52833_express_bootloader-0.9.1_s140_7.3.0.zip -------------------------------------------------------------------------------- /bootloader/feather_nrf52833_express/update-feather_nrf52833_express_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/feather_nrf52833_express/update-feather_nrf52833_express_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/feather_nrf52840_express/feather_nrf52840_express_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/feather_nrf52840_express/feather_nrf52840_express_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/feather_nrf52840_express/update-feather_nrf52840_express_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/feather_nrf52840_express/update-feather_nrf52840_express_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/feather_nrf52840_sense/feather_nrf52840_sense_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/feather_nrf52840_sense/feather_nrf52840_sense_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/feather_nrf52840_sense/update-feather_nrf52840_sense_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/feather_nrf52840_sense/update-feather_nrf52840_sense_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/feather_nrf52840_sense_tft/feather_nrf52840_sense_tft_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/feather_nrf52840_sense_tft/feather_nrf52840_sense_tft_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/feather_nrf52840_sense_tft/update-feather_nrf52840_sense_tft_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/feather_nrf52840_sense_tft/update-feather_nrf52840_sense_tft_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/itsybitsy_nrf52840_express/itsybitsy_nrf52840_express_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/itsybitsy_nrf52840_express/itsybitsy_nrf52840_express_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/itsybitsy_nrf52840_express/update-itsybitsy_nrf52840_express_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/itsybitsy_nrf52840_express/update-itsybitsy_nrf52840_express_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/ledglasses_nrf52840/ledglasses_nrf52840_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/ledglasses_nrf52840/ledglasses_nrf52840_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/ledglasses_nrf52840/update-ledglasses_nrf52840_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/ledglasses_nrf52840/update-ledglasses_nrf52840_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/metro_nrf52840_express/metro_nrf52840_express_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/metro_nrf52840_express/metro_nrf52840_express_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/metro_nrf52840_express/update-metro_nrf52840_express_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/metro_nrf52840_express/update-metro_nrf52840_express_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/particle_xenon/particle_xenon_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/particle_xenon/particle_xenon_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/particle_xenon/update-particle_xenon_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/particle_xenon/update-particle_xenon_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/pca10056/pca10056_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/pca10056/pca10056_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/pca10056/update-pca10056_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/pca10056/update-pca10056_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/pca10100/pca10100_bootloader-0.9.1_s140_7.3.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/pca10100/pca10100_bootloader-0.9.1_s140_7.3.0.zip -------------------------------------------------------------------------------- /bootloader/pca10100/update-pca10100_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/pca10100/update-pca10100_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /bootloader/raytac_mdbt50q_rx/raytac_mdbt50q_rx_bootloader-0.9.1_s140_6.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/raytac_mdbt50q_rx/raytac_mdbt50q_rx_bootloader-0.9.1_s140_6.1.1.zip -------------------------------------------------------------------------------- /bootloader/raytac_mdbt50q_rx/update-raytac_mdbt50q_rx_bootloader-0.9.1_nosd.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/bootloader/raytac_mdbt50q_rx/update-raytac_mdbt50q_rx_bootloader-0.9.1_nosd.uf2 -------------------------------------------------------------------------------- /cores/nRF5/Client.h: -------------------------------------------------------------------------------- 1 | /* 2 | Client.h - Base class that provides Client 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef client_h 21 | #define client_h 22 | #include "Print.h" 23 | #include "Stream.h" 24 | #include "IPAddress.h" 25 | 26 | class Client : public Stream { 27 | 28 | public: 29 | virtual int connect(IPAddress ip, uint16_t port) =0; 30 | virtual int connect(const char *host, uint16_t port) =0; 31 | virtual size_t write(uint8_t) =0; 32 | virtual size_t write(const uint8_t *buf, size_t size) =0; 33 | virtual int available() = 0; 34 | virtual int read() = 0; 35 | virtual int read(uint8_t *buf, size_t size) = 0; 36 | virtual int peek() = 0; 37 | virtual void flush() = 0; 38 | virtual void stop() = 0; 39 | virtual uint8_t connected() = 0; 40 | virtual operator bool() = 0; 41 | protected: 42 | uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); }; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /cores/nRF5/Printable.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #ifndef Printable_h 20 | #define Printable_h 21 | 22 | #include 23 | 24 | class Print; 25 | 26 | /** The Printable class provides a way for new classes to allow themselves to be printed. 27 | By deriving from Printable and implementing the printTo method, it will then be possible 28 | for users to print out instances of this class by passing them into the usual 29 | Print::print and Print::println methods. 30 | */ 31 | 32 | class Printable 33 | { 34 | public: 35 | virtual size_t printTo(Print& p) const = 0; 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /cores/nRF5/RingBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #ifndef _RING_BUFFER_ 20 | #define _RING_BUFFER_ 21 | 22 | #include 23 | 24 | // Define constants and variables for buffering incoming serial data. We're 25 | // using a ring buffer (I think), in which head is the index of the location 26 | // to which to write the next incoming character and tail is the index of the 27 | // location from which to read. 28 | #ifndef SERIAL_BUFFER_SIZE 29 | #define SERIAL_BUFFER_SIZE 64 30 | #endif 31 | 32 | class RingBuffer 33 | { 34 | public: 35 | uint8_t _aucBuffer[SERIAL_BUFFER_SIZE] ; 36 | int _iHead ; 37 | int _iTail ; 38 | 39 | public: 40 | RingBuffer( void ) ; 41 | void store_char( uint8_t c ) ; 42 | void clear(); 43 | int read_char(); 44 | int available(); 45 | int availableForStore(); 46 | int peek(); 47 | bool isFull(); 48 | 49 | private: 50 | int nextIndex(int index); 51 | } ; 52 | 53 | #endif /* _RING_BUFFER_ */ 54 | -------------------------------------------------------------------------------- /cores/nRF5/Server.h: -------------------------------------------------------------------------------- 1 | /* 2 | Server.h - Base class that provides Server 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef server_h 21 | #define server_h 22 | 23 | #include "Print.h" 24 | 25 | class Server : public Print { 26 | public: 27 | virtual void begin() =0; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /cores/nRF5/WInterrupts.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 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 | #ifndef _WIRING_INTERRUPTS_ 20 | #define _WIRING_INTERRUPTS_ 21 | 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | // LOW 0 29 | // HIGH 1 30 | #define CHANGE 2 31 | #define FALLING 3 32 | #define RISING 4 33 | 34 | #define ISR_DEFERRED 0x0100 35 | 36 | //#define DEFAULT 1 37 | #define EXTERNAL 0 38 | 39 | typedef void (*voidFuncPtr)(void); 40 | 41 | /* 42 | * \brief Specifies a named Interrupt Service Routine (ISR) to call when an interrupt occurs. 43 | * Replaces any previous function that was attached to the interrupt. 44 | * 45 | * \return Interrupt Mask 46 | */ 47 | int attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode); 48 | 49 | /* 50 | * \brief Turns off the given interrupt. 51 | */ 52 | void detachInterrupt(uint32_t pin); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /cores/nRF5/WMath.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | extern "C" { 20 | #include "stdlib.h" 21 | #include "stdint.h" 22 | } 23 | #include "WMath.h" 24 | 25 | extern void randomSeed( uint32_t dwSeed ) 26 | { 27 | if ( dwSeed != 0 ) 28 | { 29 | srand( dwSeed ) ; 30 | } 31 | } 32 | 33 | extern long random( long howbig ) 34 | { 35 | if ( howbig == 0 ) 36 | { 37 | return 0 ; 38 | } 39 | 40 | return rand() % howbig; 41 | } 42 | 43 | extern long random( long howsmall, long howbig ) 44 | { 45 | if (howsmall >= howbig) 46 | { 47 | return howsmall; 48 | } 49 | 50 | long diff = howbig - howsmall; 51 | 52 | return random(diff) + howsmall; 53 | } 54 | 55 | extern long map(long x, long in_min, long in_max, long out_min, long out_max) 56 | { 57 | return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; 58 | } 59 | 60 | extern uint16_t makeWord( uint16_t w ) 61 | { 62 | return w ; 63 | } 64 | 65 | extern uint16_t makeWord( uint8_t h, uint8_t l ) 66 | { 67 | return (h << 8) | l ; 68 | } 69 | -------------------------------------------------------------------------------- /cores/nRF5/WMath.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #ifndef _WIRING_MATH_ 20 | #define _WIRING_MATH_ 21 | 22 | extern long random( long ) ; 23 | extern long random( long, long ) ; 24 | extern void randomSeed( uint32_t dwSeed ) ; 25 | extern long map( long, long, long, long, long ) ; 26 | 27 | extern uint16_t makeWord( uint16_t w ) ; 28 | extern uint16_t makeWord( uint8_t h, uint8_t l ) ; 29 | 30 | #define word(...) makeWord(__VA_ARGS__) 31 | 32 | 33 | #endif /* _WIRING_MATH_ */ 34 | -------------------------------------------------------------------------------- /cores/nRF5/WVariant.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 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 23 | #include "nrf.h" 24 | #include "nrf_soc.h" 25 | #include "nrf_sdm.h" 26 | #include "nrf_gpio.h" 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | extern const uint32_t g_ADigitalPinMap[] ; 33 | 34 | #ifdef __cplusplus 35 | } // extern "C" 36 | #endif 37 | -------------------------------------------------------------------------------- /cores/nRF5/abi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 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 | #include 20 | 21 | extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); 22 | extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); 23 | 24 | void __cxa_pure_virtual(void) { 25 | // We might want to write some diagnostics to uart in this case 26 | //std::terminate(); 27 | while (1) 28 | ; 29 | } 30 | 31 | void __cxa_deleted_virtual(void) { 32 | // We might want to write some diagnostics to uart in this case 33 | //std::terminate(); 34 | while (1) 35 | ; 36 | } 37 | -------------------------------------------------------------------------------- /cores/nRF5/avr/dtostrf.c: -------------------------------------------------------------------------------- 1 | /* 2 | dtostrf - Emulation for dtostrf function from avr-libc 3 | Copyright (c) 2015 Arduino LLC. All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include 21 | 22 | char *dtostrf (double val, signed char width, unsigned char prec, char *sout) { 23 | asm(".global _printf_float"); 24 | 25 | char fmt[20]; 26 | sprintf(fmt, "%%%d.%df", width, prec); 27 | sprintf(sout, fmt, val); 28 | return sout; 29 | } 30 | -------------------------------------------------------------------------------- /cores/nRF5/avr/dtostrf.h: -------------------------------------------------------------------------------- 1 | /* 2 | dtostrf - Emulation for dtostrf function from avr-libc 3 | Copyright (c) 2015 Arduino LLC. All rights reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | char *dtostrf(double val, signed char width, unsigned char prec, char *sout); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /cores/nRF5/avr/interrupt.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LCC. 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 | /* 20 | Empty file. 21 | This file is here to allow compatibility with sketches (made for AVR) 22 | that includes 23 | */ 24 | -------------------------------------------------------------------------------- /cores/nRF5/delay.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 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 | #include "nrf.h" 20 | 21 | #include "delay.h" 22 | #include "Arduino.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | uint32_t millis( void ) 29 | { 30 | return tick2ms(xTaskGetTickCount()); 31 | } 32 | 33 | void delay( uint32_t ms ) 34 | { 35 | uint32_t ticks = ms2tick(ms); 36 | 37 | #ifdef USE_TINYUSB 38 | // Take chance to flush usb cdc 39 | uint32_t flush_tick = xTaskGetTickCount(); 40 | TinyUSB_Device_FlushCDC(); 41 | 42 | flush_tick = xTaskGetTickCount()-flush_tick; 43 | if (flush_tick >= ticks) return; 44 | 45 | ticks -= flush_tick; 46 | #endif 47 | 48 | vTaskDelay(ticks); 49 | } 50 | 51 | void dwt_enable(void) 52 | { 53 | CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; /* Global Enable for DWT */ 54 | DWT->CYCCNT = 0; /* Reset the counter */ 55 | DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; /* Enable cycle counter */ 56 | } 57 | 58 | void dwt_disable(void) 59 | { 60 | DWT->CTRL &= ~DWT_CTRL_CYCCNTENA_Msk; 61 | CoreDebug->DEMCR &= ~CoreDebug_DEMCR_TRCENA_Msk; 62 | } 63 | 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /cores/nRF5/freertos/License/license.txt: -------------------------------------------------------------------------------- 1 | The FreeRTOS kernel is released under the MIT open source license, the text of 2 | which is provided below. 3 | 4 | This license covers the FreeRTOS kernel source files, which are located in the 5 | /FreeRTOS/Source directory of the official FreeRTOS kernel download. It also 6 | covers most of the source files in the demo application projects, which are 7 | located in the /FreeRTOS/Demo directory of the official FreeRTOS download. The 8 | demo projects may also include third party software that is not part of FreeRTOS 9 | and is licensed separately to FreeRTOS. Examples of third party software 10 | includes header files provided by chip or tools vendors, linker scripts, 11 | peripheral drivers, etc. All the software in subdirectories of the /FreeRTOS 12 | directory is either open source or distributed with permission, and is free for 13 | use. For the avoidance of doubt, refer to the comments at the top of each 14 | source file. 15 | 16 | 17 | License text: 18 | ------------- 19 | 20 | Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 21 | Permission is hereby granted, free of charge, to any person obtaining a copy of 22 | this software and associated documentation files (the "Software"), to deal in 23 | the Software without restriction, including without limitation the rights to 24 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 25 | the Software, and to permit persons to whom the Software is furnished to do so, 26 | subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in all 29 | copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 33 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 34 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 35 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 36 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | 38 | -------------------------------------------------------------------------------- /cores/nRF5/freertos/Source/include/stdint.readme: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FREERTOS_STDINT 3 | #define FREERTOS_STDINT 4 | 5 | /******************************************************************************* 6 | * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions 7 | * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be 8 | * built using compilers that do not provide their own stdint.h definition. 9 | * 10 | * To use this file: 11 | * 12 | * 1) Copy this file into the directory that contains your FreeRTOSConfig.h 13 | * header file, as that directory will already be in the compilers include 14 | * path. 15 | * 16 | * 2) Rename the copied file stdint.h. 17 | * 18 | */ 19 | 20 | typedef signed char int8_t; 21 | typedef unsigned char uint8_t; 22 | typedef short int16_t; 23 | typedef unsigned short uint16_t; 24 | typedef long int32_t; 25 | typedef unsigned long uint32_t; 26 | 27 | #endif /* FREERTOS_STDINT */ 28 | -------------------------------------------------------------------------------- /cores/nRF5/freertos/Source/portable/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and/or compiler. 4 | 5 | 6 | + The FreeRTOS/Source/Portable/MemMang directory contains the three sample 7 | memory allocators as described on the http://www.FreeRTOS.org WEB site. 8 | 9 | + The other directories each contain files specific to a particular 10 | microcontroller or compiler. 11 | 12 | 13 | 14 | For example, if you are interested in the GCC port for the ATMega323 15 | microcontroller then the port specific files are contained in 16 | FreeRTOS/Source/Portable/GCC/ATMega323 directory. If this is the only 17 | port you are interested in then all the other directories can be 18 | ignored. 19 | 20 | -------------------------------------------------------------------------------- /cores/nRF5/freertos/Source/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these 7 | three files. croutine.c implements the optional co-routine functionality - which 8 | is normally only used on very memory limited systems. 9 | 10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 11 | a particular microcontroller and or compiler. 12 | 13 | + The FreeRTOS/Source/include directory contains the real time kernel header 14 | files. 15 | 16 | See the readme file in the FreeRTOS/Source/Portable directory for more 17 | information. -------------------------------------------------------------------------------- /cores/nRF5/freertos/portable/GCC/nrf52/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.0.0 3 | * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * 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. If you wish to use our Amazon 14 | * FreeRTOS name, please do so in a fair use way that does not cause confusion. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | * http://www.FreeRTOS.org 24 | * http://aws.amazon.com/freertos 25 | * 26 | * 1 tab == 4 spaces! 27 | */ 28 | 29 | 30 | #ifndef PORTMACRO_H 31 | #define PORTMACRO_H 32 | 33 | #include "portmacro_cmsis.h" 34 | 35 | #endif /* PORTMACRO_H */ 36 | 37 | -------------------------------------------------------------------------------- /cores/nRF5/freertos/readme.txt: -------------------------------------------------------------------------------- 1 | Implementations detail. 2 | 3 | No changes to original FreeRTOS code was made. 4 | Directories was reorganized to move all changed or optional items outside the original, copied code. 5 | That way just copying new version of FreeRTOS should give functional code. 6 | 7 | Folders: 8 | - source: Original Source directory from FreeRTOS. Deleted all port files from portable subdirectory. 9 | In portable subdirectory only MemMang was left. 10 | - license: Original License directory from FreeRTOS. 11 | - config: Base (clean) FreeRTOS configuration file. 12 | - portable: Port files created for nrf5x microcontroller. 13 | -------------------------------------------------------------------------------- /cores/nRF5/hooks.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 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 | /** 20 | * Empty yield() hook. 21 | * 22 | * This function is intended to be used by library writers to build 23 | * libraries or sketches that supports cooperative threads. 24 | * 25 | * Its defined as a weak symbol and it can be redefined to implement a 26 | * real cooperative scheduler. 27 | */ 28 | static void __empty() { 29 | // Empty 30 | } 31 | void yield(void) __attribute__ ((weak, alias("__empty"))); 32 | 33 | void vApplicationIdleHook( void ) __attribute__ ((weak, alias("__empty"))); 34 | 35 | /** 36 | * SysTick hook 37 | * 38 | * This function is called from SysTick handler, before the default 39 | * handler provided by Arduino. 40 | */ 41 | static int __false() { 42 | // Return false 43 | return 0; 44 | } 45 | int sysTickHook(void) __attribute__ ((weak, alias("__false"))); 46 | 47 | /** 48 | * SVC hook 49 | * PendSV hook 50 | * 51 | * These functions are called from SVC handler, and PensSV handler. 52 | * Default action is halting. 53 | */ 54 | static void __halt() { 55 | // Halts 56 | while (1) 57 | ; 58 | } 59 | void svcHook(void) __attribute__ ((weak, alias("__halt"))); 60 | void pendSVHook(void) __attribute__ ((weak, alias("__halt"))); 61 | -------------------------------------------------------------------------------- /cores/nRF5/itoa.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 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 | #ifdef __cplusplus 22 | extern "C"{ 23 | #endif 24 | 25 | //extern void itoa( int n, char s[] ) ; 26 | 27 | extern char* itoa( int value, char *string, int radix ) ; 28 | extern char* ltoa( long value, char *string, int radix ) ; 29 | extern char* utoa( unsigned int value, char *string, int radix ) ; 30 | extern char* ultoa( unsigned long value, char *string, int radix ) ; 31 | 32 | #ifdef __cplusplus 33 | } // extern "C" 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /cores/nRF5/linker/nrf52832_s132_v6.ld: -------------------------------------------------------------------------------- 1 | /* Linker script to configure memory regions. */ 2 | 3 | SEARCH_DIR(.) 4 | GROUP(-lgcc -lc -lnosys) 5 | 6 | MEMORY 7 | { 8 | FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x6D000 - 0x26000 9 | 10 | /* SRAM required by S132 depend on 11 | * - Attribute Table Size 12 | * - Vendor UUID count 13 | * - Max ATT MTU 14 | * - Concurrent connection peripheral + central + secure links 15 | * - Event Len, HVN queue, Write CMD queue 16 | */ 17 | RAM (rwx) : ORIGIN = 0x20003600, LENGTH = 0x20010000 - 0x20003600 18 | } 19 | 20 | SECTIONS 21 | { 22 | . = ALIGN(4); 23 | .svc_data : 24 | { 25 | PROVIDE(__start_svc_data = .); 26 | KEEP(*(.svc_data)) 27 | PROVIDE(__stop_svc_data = .); 28 | } > RAM 29 | 30 | .fs_data : 31 | { 32 | PROVIDE(__start_fs_data = .); 33 | KEEP(*(.fs_data)) 34 | PROVIDE(__stop_fs_data = .); 35 | } > RAM 36 | } INSERT AFTER .data; 37 | 38 | INCLUDE "nrf52_common.ld" 39 | -------------------------------------------------------------------------------- /cores/nRF5/linker/nrf52833_s140_v7.ld: -------------------------------------------------------------------------------- 1 | /* Linker script to configure memory regions. */ 2 | 3 | SEARCH_DIR(.) 4 | GROUP(-lgcc -lc -lnosys) 5 | 6 | MEMORY 7 | { 8 | FLASH (rx) : ORIGIN = 0x27000, LENGTH = 0x6D000 - 0x27000 9 | 10 | /* SRAM required by Softdevice depend on 11 | * - Attribute Table Size (Number of Services and Characteristics) 12 | * - Vendor UUID count 13 | * - Max ATT MTU 14 | * - Concurrent connection peripheral + central + secure links 15 | * - Event Len, HVN queue, Write CMD queue 16 | */ 17 | RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20020000 - 0x20006000 18 | } 19 | 20 | SECTIONS 21 | { 22 | . = ALIGN(4); 23 | .svc_data : 24 | { 25 | PROVIDE(__start_svc_data = .); 26 | KEEP(*(.svc_data)) 27 | PROVIDE(__stop_svc_data = .); 28 | } > RAM 29 | 30 | .fs_data : 31 | { 32 | PROVIDE(__start_fs_data = .); 33 | KEEP(*(.fs_data)) 34 | PROVIDE(__stop_fs_data = .); 35 | } > RAM 36 | } INSERT AFTER .data; 37 | 38 | INCLUDE "nrf52_common.ld" 39 | -------------------------------------------------------------------------------- /cores/nRF5/linker/nrf52840_s140_v6.ld: -------------------------------------------------------------------------------- 1 | /* Linker script to configure memory regions. */ 2 | 3 | SEARCH_DIR(.) 4 | GROUP(-lgcc -lc -lnosys) 5 | 6 | MEMORY 7 | { 8 | FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0xED000 - 0x26000 9 | 10 | /* SRAM required by Softdevice depend on 11 | * - Attribute Table Size (Number of Services and Characteristics) 12 | * - Vendor UUID count 13 | * - Max ATT MTU 14 | * - Concurrent connection peripheral + central + secure links 15 | * - Event Len, HVN queue, Write CMD queue 16 | */ 17 | RAM (rwx) : ORIGIN = 0x20006000, LENGTH = 0x20040000 - 0x20006000 18 | } 19 | 20 | SECTIONS 21 | { 22 | . = ALIGN(4); 23 | .svc_data : 24 | { 25 | PROVIDE(__start_svc_data = .); 26 | KEEP(*(.svc_data)) 27 | PROVIDE(__stop_svc_data = .); 28 | } > RAM 29 | 30 | .fs_data : 31 | { 32 | PROVIDE(__start_fs_data = .); 33 | KEEP(*(.fs_data)) 34 | PROVIDE(__stop_fs_data = .); 35 | } > RAM 36 | } INSERT AFTER .data; 37 | 38 | INCLUDE "nrf52_common.ld" 39 | -------------------------------------------------------------------------------- /cores/nRF5/new.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #include 20 | #include "rtos.h" 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | __attribute__((weak)) 27 | void *operator new(size_t size) { 28 | return rtos_malloc(size); 29 | } 30 | 31 | __attribute__((weak)) 32 | void *operator new[](size_t size) { 33 | return rtos_malloc(size); 34 | } 35 | 36 | __attribute__((weak)) 37 | void operator delete(void * ptr) { 38 | rtos_free(ptr); 39 | } 40 | 41 | __attribute__((weak)) 42 | void operator delete[](void * ptr) { 43 | rtos_free(ptr); 44 | } 45 | 46 | __attribute__((weak)) 47 | void operator delete(void * ptr, unsigned int) { 48 | rtos_free(ptr); 49 | } 50 | 51 | __attribute__((weak)) 52 | void operator delete[](void * ptr, unsigned int) { 53 | rtos_free(ptr); 54 | } 55 | 56 | 57 | extern "C" 58 | { 59 | 60 | // defined in linker script 61 | extern unsigned char __HeapBase[]; 62 | extern unsigned char __HeapLimit[]; 63 | 64 | static unsigned char *sbrk_heap_top = __HeapBase; 65 | 66 | __attribute__((used)) 67 | caddr_t _sbrk( int incr ) 68 | { 69 | unsigned char *prev_heap; 70 | 71 | if ( sbrk_heap_top + incr > __HeapLimit ) 72 | { 73 | /* Out of dynamic memory heap space */ 74 | errno = ENOMEM; 75 | return (caddr_t) -1; 76 | } 77 | 78 | prev_heap = sbrk_heap_top; 79 | 80 | sbrk_heap_top += incr; 81 | 82 | return (caddr_t) prev_heap; 83 | } 84 | 85 | } 86 | -------------------------------------------------------------------------------- /cores/nRF5/nordic/nrfx/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017 - 2020, Nordic Semiconductor ASA 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of the copyright holder nor the names of its 15 | contributors may be used to endorse or promote products derived from this 16 | software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | POSSIBILITY OF SUCH DAMAGE. 29 | 30 | -------------------------------------------------------------------------------- /cores/nRF5/nordic/nrfx/README.md: -------------------------------------------------------------------------------- 1 | # nrfx 2 | 3 | ## Overview 4 | 5 | nrfx is a standalone set of drivers for peripherals present in Nordic 6 | Semiconductor's SoCs. It originated as an extract from the nRF5 SDK. 7 | The intention was to provide drivers that can be used in various environments 8 | without the necessity to integrate other parts of the SDK into them. 9 | For the user's convenience, the drivers come with the MDK package. This package 10 | contains definitions of register structures and bitfields for all supported 11 | SoCs, as well as startup and initialization files for them. 12 | 13 | ## Supported SoCs 14 | 15 | * nRF51 Series 16 | * nRF52810 17 | * nRF52811 18 | * nRF52832 19 | * nRF52833 20 | * nRF52840 21 | * nRF5340 22 | * nRF9160 23 | 24 | ## Directories 25 | 26 | ``` 27 | . 28 | ├── doc # Project documentation files 29 | ├── drivers # nrfx driver files 30 | │ └── include # nrfx driver headers 31 | │ └── src # nrfx driver sources 32 | ├── hal # Hardware Access Layer files 33 | ├── helpers # nrfx driver helper files 34 | ├── mdk # nRF MDK files 35 | ├── soc # SoC specific files 36 | └── templates # Templates of nrfx integration files 37 | ``` 38 | 39 | ## Generating documentation 40 | 41 | nrfx documentation is available in the `doc\html` folder of the release package. 42 | 43 | You can also generate documentation yourself from the source code. To do it, install doxygen 44 | and run one of the scripts: `generate_html_doc.bat` or `generate_html_doc.sh`. Generated 45 | documentation will be stored in the `doc\html` directory. Use `index.html` to open it. 46 | -------------------------------------------------------------------------------- /cores/nRF5/nordic/nrfx/drivers/include/nrfx_twi_twim.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 - 2020, Nordic Semiconductor ASA 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, this 9 | * list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * 3. Neither the name of the copyright holder nor the names of its 16 | * contributors may be used to endorse or promote products derived from this 17 | * software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef NRFX_TWI_TWIM_H 33 | #define NRFX_TWI_TWIM_H 34 | 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | nrfx_err_t nrfx_twi_twim_bus_recover(uint32_t scl_pin, uint32_t sda_pin); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif // NRFX_TWI_TWIM_H 48 | -------------------------------------------------------------------------------- /cores/nRF5/nordic/nrfx/mdk/nrf_erratas.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2010 - 2018, Nordic Semiconductor ASA All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of Nordic Semiconductor ASA nor the names of its 16 | contributors may be used to endorse or promote products derived from this 17 | software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef NRF_ERRATAS_H 34 | #define NRF_ERRATAS_H 35 | 36 | #include "nrf.h" 37 | 38 | /*lint ++flb "Enter library region */ 39 | 40 | #include "nrf51_erratas.h" 41 | #include "nrf52_erratas.h" 42 | #include "nrf53_erratas.h" 43 | #include "nrf91_erratas.h" 44 | 45 | /*lint --flb "Leave library region" */ 46 | 47 | #endif // NRF_ERRATAS_H 48 | -------------------------------------------------------------------------------- /cores/nRF5/nordic/nrfx/mdk/system_nrf.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2009-2018 ARM Limited. All rights reserved. 4 | 5 | SPDX-License-Identifier: Apache-2.0 6 | 7 | Licensed under the Apache License, Version 2.0 (the License); you may 8 | not use this file except in compliance with the License. 9 | You may obtain a copy of the License at 10 | 11 | www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an AS IS BASIS, WITHOUT 15 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. 18 | 19 | NOTICE: This file has been modified by Nordic Semiconductor ASA. 20 | 21 | */ 22 | 23 | #ifndef SYSTEM_NRF_H 24 | #define SYSTEM_NRF_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #include 31 | 32 | 33 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 34 | 35 | /** 36 | * Initialize the system 37 | * 38 | * @param none 39 | * @return none 40 | * 41 | * @brief Setup the microcontroller system. 42 | * Initialize the System and update the SystemCoreClock variable. 43 | */ 44 | extern void SystemInit (void); 45 | 46 | /** 47 | * Update SystemCoreClock variable 48 | * 49 | * @param none 50 | * @return none 51 | * 52 | * @brief Updates the SystemCoreClock with current core Clock 53 | * retrieved from cpu registers. 54 | */ 55 | extern void SystemCoreClockUpdate (void); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* SYSTEM_NRF_H */ 62 | -------------------------------------------------------------------------------- /cores/nRF5/nordic/nrfx/mdk/system_nrf52.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2010 - 2018, Nordic Semiconductor ASA All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of Nordic Semiconductor ASA nor the names of its 16 | contributors may be used to endorse or promote products derived from this 17 | software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef SYSTEM_NRF52_H 34 | #define SYSTEM_NRF52_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | #include "system_nrf.h" 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* SYSTEM_NRF52_H */ 47 | -------------------------------------------------------------------------------- /cores/nRF5/nordic/nrfx/mdk/system_nrf52833.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2010 - 2018, Nordic Semiconductor ASA All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of Nordic Semiconductor ASA nor the names of its 16 | contributors may be used to endorse or promote products derived from this 17 | software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef SYSTEM_NRF52833_H 34 | #define SYSTEM_NRF52833_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | #include "system_nrf.h" 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* SYSTEM_NRF52833_H */ 47 | -------------------------------------------------------------------------------- /cores/nRF5/nordic/nrfx/mdk/system_nrf52840.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (c) 2010 - 2018, Nordic Semiconductor ASA All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | 3. Neither the name of Nordic Semiconductor ASA nor the names of its 16 | contributors may be used to endorse or promote products derived from this 17 | software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | */ 32 | 33 | #ifndef SYSTEM_NRF52840_H 34 | #define SYSTEM_NRF52840_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | #include "system_nrf.h" 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* SYSTEM_NRF52840_H */ 47 | -------------------------------------------------------------------------------- /cores/nRF5/nordic/nrfx/nrfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 - 2020, Nordic Semiconductor ASA 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, this 9 | * list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * 3. Neither the name of the copyright holder nor the names of its 16 | * contributors may be used to endorse or promote products derived from this 17 | * software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef NRFX_H__ 33 | #define NRFX_H__ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #endif // NRFX_H__ 41 | -------------------------------------------------------------------------------- /cores/nRF5/nordic/nrfx_config.h: -------------------------------------------------------------------------------- 1 | #ifndef NRFX_CONFIG_H__ 2 | #define NRFX_CONFIG_H__ 3 | 4 | #define NRFX_POWER_ENABLED 1 5 | #define NRFX_POWER_DEFAULT_CONFIG_IRQ_PRIORITY 7 6 | 7 | #define NRFX_CLOCK_ENABLED 0 8 | 9 | #define NRFX_SPIM_ENABLED 1 10 | #define NRFX_SPIM_MISO_PULL_CFG 1 // pulldown 11 | #define NRFX_SPIM_EXTENDED_ENABLED 0 12 | 13 | #define NRFX_SPIM0_ENABLED 0 // used as I2C 14 | #define NRFX_SPIM1_ENABLED 0 // used as I2C 15 | #define NRFX_SPIM2_ENABLED 1 16 | 17 | #define NRFX_SPIS_ENABLED 0 18 | #define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 7 19 | #define NRFX_SPIS_CONFIG_LOG_ENABLED 0 20 | #define NRFX_SPIS_CONFIG_LOG_LEVEL 3 21 | #define NRFX_SPIS_CONFIG_INFO_COLOR 0 22 | #define NRFX_SPIS_CONFIG_DEBUG_COLOR 0 23 | 24 | #define NRFX_SPIS0_ENABLED 0 25 | #define NRFX_SPIS1_ENABLED 0 26 | #define NRFX_SPIS2_ENABLED 0 27 | 28 | #define NRFX_PWM_ENABLED 0 29 | #define NRFX_PWM0_ENABLED 0 30 | #define NRFX_PWM1_ENABLED 0 31 | #define NRFX_PWM2_ENABLED 0 32 | #define NRFX_PWM3_ENABLED 0 33 | 34 | #define NRFX_TIMER_ENABLED 0 35 | #define NRFX_TIMER0_ENABLED 0 36 | #define NRFX_TIMER1_ENABLED 0 37 | #define NRFX_TIMER2_ENABLED 0 38 | #define NRFX_TIMER3_ENABLED 0 39 | 40 | #if defined(NRF52840_XXAA) 41 | #define NRFX_QSPI_ENABLED 1 42 | #define NRFX_SPIM3_ENABLED 1 43 | #elif defined(NRF52833_XXAA) 44 | #define NRFX_QSPI_ENABLED 0 45 | #define NRFX_SPIM3_ENABLED 1 46 | #else 47 | #define NRFX_QSPI_ENABLED 0 48 | #define NRFX_SPIM3_ENABLED 0 49 | #endif 50 | 51 | // NRFX temp 52 | #define NRFX_TEMP_ENABLED 1 53 | #define NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY 7 54 | 55 | #endif // NRFX_CONFIG_H__ 56 | -------------------------------------------------------------------------------- /cores/nRF5/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 | -------------------------------------------------------------------------------- /cores/nRF5/pulse.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 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 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* 26 | * \brief Measures the length (in microseconds) of a pulse on the pin; state is HIGH 27 | * or LOW, the type of pulse to measure. Works on pulses from 2-3 microseconds 28 | * to 3 minutes in length, but must be called at least a few dozen microseconds 29 | * before the start of the pulse. 30 | */ 31 | uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout); 32 | 33 | #ifdef __cplusplus 34 | // Provides a version of pulseIn with a default argument (C++ only) 35 | uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout = 1000000L); 36 | 37 | } // extern "C" 38 | #endif 39 | -------------------------------------------------------------------------------- /cores/nRF5/wiring.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 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 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* Bootloader version. Assigned by init(). 26 | * - value of 0x000500 is version 0.5.0 27 | */ 28 | extern uint32_t bootloaderVersion; 29 | 30 | extern void init(void); 31 | 32 | uint32_t readResetReason(void); 33 | 34 | void enterSerialDfu(void); 35 | void enterOTADfu(void); 36 | void enterUf2Dfu(void); 37 | 38 | void waitForEvent(void); 39 | void systemOff(uint32_t pin, uint8_t wake_logic); 40 | 41 | // Test if in interrupt mode 42 | static inline bool isInISR(void) 43 | { 44 | return (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) != 0 ; 45 | } 46 | 47 | /* 48 | * \brief Reads the on-chip temperature sensor, returning the temperature in degrees C 49 | * with a resolution of 0.25 degrees. 50 | */ 51 | float readCPUTemperature( void ); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | -------------------------------------------------------------------------------- /cores/nRF5/wiring_private.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 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 | #include "Arduino.h" 20 | #include "wiring_private.h" 21 | -------------------------------------------------------------------------------- /cores/nRF5/wiring_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 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 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | 30 | #include "wiring_constants.h" 31 | 32 | 33 | #ifdef __cplusplus 34 | } // extern "C" 35 | 36 | #include "HardwareSerial.h" 37 | 38 | #endif -------------------------------------------------------------------------------- /cores/nRF5/wiring_shift.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #include 20 | #include "wiring_shift.h" 21 | #include "wiring_digital.h" 22 | #include "wiring_private.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C"{ 26 | #endif 27 | 28 | uint32_t shiftIn( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder ) 29 | { 30 | uint8_t value = 0 ; 31 | uint8_t i ; 32 | 33 | for ( i=0 ; i < 8 ; ++i ) 34 | { 35 | digitalWrite( ulClockPin, HIGH ) ; 36 | 37 | if ( ulBitOrder == LSBFIRST ) 38 | { 39 | value |= digitalRead( ulDataPin ) << i ; 40 | } 41 | else 42 | { 43 | value |= digitalRead( ulDataPin ) << (7 - i) ; 44 | } 45 | 46 | digitalWrite( ulClockPin, LOW ) ; 47 | } 48 | 49 | return value ; 50 | } 51 | 52 | void shiftOut( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder, uint32_t ulVal ) 53 | { 54 | uint8_t i ; 55 | 56 | for ( i=0 ; i < 8 ; i++ ) 57 | { 58 | if ( ulBitOrder == LSBFIRST ) 59 | { 60 | digitalWrite( ulDataPin, !!(ulVal & (1 << i)) ) ; 61 | } 62 | else 63 | { 64 | digitalWrite( ulDataPin, !!(ulVal & (1 << (7 - i))) ) ; 65 | } 66 | 67 | digitalWrite( ulClockPin, HIGH ) ; 68 | digitalWrite( ulClockPin, LOW ) ; 69 | } 70 | } 71 | 72 | #ifdef __cplusplus 73 | } // extern "C" 74 | #endif 75 | -------------------------------------------------------------------------------- /cores/nRF5/wiring_shift.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. 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 | #ifndef _WIRING_SHIFT_ 20 | #define _WIRING_SHIFT_ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | /* 27 | * \brief 28 | */ 29 | extern uint32_t shiftIn( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder ) ; 30 | 31 | 32 | /* 33 | * \brief 34 | */ 35 | extern void shiftOut( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder, uint32_t ulVal ) ; 36 | 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _WIRING_SHIFT_ */ 43 | -------------------------------------------------------------------------------- /libraries/Adafruit_LittleFS/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit Little File System Libraries 2 | version=0.11.0 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Arduino library for ARM Little File System 6 | paragraph=Arduino library for ARM Little File System 7 | category=Data Storage 8 | url=https://github.com/adafruit/Adafruit_nRF52_Arduino 9 | architectures=* 10 | includes=Adafruit_LittleFS.h 11 | -------------------------------------------------------------------------------- /libraries/Adafruit_LittleFS/src/littlefs/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017, Arm Limited. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, 4 | are permitted provided that the following conditions are met: 5 | 6 | - Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | - Redistributions in binary form must reproduce the above copyright notice, this 9 | list of conditions and the following disclaimer in the documentation and/or 10 | other materials provided with the distribution. 11 | - Neither the name of ARM nor the names of its contributors may be used to 12 | endorse or promote products derived from this software without specific prior 13 | written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 22 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /libraries/Adafruit_LittleFS/src/littlefs/lfs_util.c: -------------------------------------------------------------------------------- 1 | /* 2 | * lfs util functions 3 | * 4 | * Copyright (c) 2017, Arm Limited. All rights reserved. 5 | * SPDX-License-Identifier: BSD-3-Clause 6 | */ 7 | #include "lfs_util.h" 8 | 9 | // Only compile if user does not provide custom config 10 | #ifndef LFS_CONFIG 11 | 12 | 13 | // Software CRC implementation with small lookup table 14 | void lfs_crc(uint32_t *restrict crc, const void *buffer, size_t size) { 15 | static const uint32_t rtable[16] = { 16 | 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 17 | 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c, 18 | 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, 19 | 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c, 20 | }; 21 | 22 | const uint8_t *data = buffer; 23 | 24 | for (size_t i = 0; i < size; i++) { 25 | *crc = (*crc >> 4) ^ rtable[(*crc ^ (data[i] >> 0)) & 0xf]; 26 | *crc = (*crc >> 4) ^ rtable[(*crc ^ (data[i] >> 4)) & 0xf]; 27 | } 28 | } 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit BLE Services 2 | version=1.0 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Arduino library for nRF52-based Adafruit Bluefruit LE modules 6 | paragraph=Arduino library for nRF52-based Adafruit Bluefruit LE modules 7 | category=Communication 8 | url=https://github.com/adafruit/Adafruit_nRF52_Arduino 9 | architectures=* 10 | includes=BLEAdafruitService.h 11 | depends=Adafruit NeoPixel, Adafruit Unified Sensor, Adafruit AHRS, Adafruit Sensor Calibration 12 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/BLEAdafruitService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUITSERVICE_H_ 26 | #define BLEADAFRUITSERVICE_H_ 27 | 28 | #include "bluefruit_common.h" 29 | #include "BLECharacteristic.h" 30 | #include "BLEService.h" 31 | #include "services/BLEAdafruitSensor.h" 32 | 33 | #include "services/BLEAdafruitAccel.h" 34 | #include "services/BLEAdafruitAddressablePixel.h" 35 | #include "services/BLEAdafruitBaro.h" 36 | #include "services/BLEAdafruitButton.h" 37 | #include "services/BLEAdafruitColor.h" 38 | #include "services/BLEAdafruitGesture.h" 39 | #include "services/BLEAdafruitGyro.h" 40 | #include "services/BLEAdafruitHumid.h" 41 | #include "services/BLEAdafruitLightSensor.h" 42 | #include "services/BLEAdafruitMagnetic.h" 43 | #include "services/BLEAdafruitProximity.h" 44 | #include "services/BLEAdafruitQuaternion.h" 45 | #include "services/BLEAdafruitSound.h" 46 | #include "services/BLEAdafruitTemperature.h" 47 | #include "services/BLEAdafruitTone.h" 48 | 49 | #endif /* BLEADAFRUITSERVICE_H_ */ 50 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitAccel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_ACCEL_H_ 26 | #define BLEADAFRUIT_ACCEL_H_ 27 | 28 | class BLEAdafruitAccel : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitAccel(void); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_ACCEL_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitBaro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_BARO_H_ 26 | #define BLEADAFRUIT_BARO_H_ 27 | 28 | class BLEAdafruitBaro : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitBaro(void); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_BARO_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitButton.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_BUTTON_H_ 26 | #define BLEADAFRUIT_BUTTON_H_ 27 | 28 | class BLEAdafruitButton : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitButton(void); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_BUTTON_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitColor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_COLOR_H_ 26 | #define BLEADAFRUIT_COLOR_H_ 27 | 28 | class BLEAdafruitColor : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitColor(void); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_COLOR_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitGesture.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_GESTURE_H_ 26 | #define BLEADAFRUIT_GESTURE_H_ 27 | 28 | class BLEAdafruitGesture : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitGesture(void); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_GESTURE_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitGyro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_GYRO_H_ 26 | #define BLEADAFRUIT_GYRO_H_ 27 | 28 | class BLEAdafruitGyro : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitGyro(void); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_GYRO_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitHumid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_HUMID_H_ 26 | #define BLEADAFRUIT_HUMID_H_ 27 | 28 | class BLEAdafruitHumid : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitHumid(void); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_HUMID_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitLightSensor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_LIGHT_SENSOR_H_ 26 | #define BLEADAFRUIT_LIGHT_SENSOR_H_ 27 | 28 | class BLEAdafruitLightSensor : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitLightSensor(void); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_LIGHT_SENSOR_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitMagnetic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_MAGNETIC_H_ 26 | #define BLEADAFRUIT_MAGNETIC_H_ 27 | 28 | class BLEAdafruitMagnetic : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitMagnetic(void); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_MAGNETIC_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitProximity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_PROXIMITY_H_ 26 | #define BLEADAFRUIT_PROXIMITY_H_ 27 | 28 | class BLEAdafruitProximity : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitProximity(void); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_PROXIMITY_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitSound.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_SOUND_H_ 26 | #define BLEADAFRUIT_SOUND_H_ 27 | 28 | class BLEAdafruitSound : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | static const uint8_t UUID128_CHR_CHANNEL_COUNT[16]; 34 | 35 | BLEAdafruitSound(void); 36 | 37 | err_t begin(uint8_t channel_count, measure_callback_t fp, int32_t ms = DEFAULT_PERIOD); 38 | 39 | private: 40 | BLECharacteristic _channel_count; 41 | }; 42 | 43 | #endif /* BLEADAFRUIT_SOUND_H_ */ 44 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitTemperature.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_TEMPERATURE_H_ 26 | #define BLEADAFRUIT_TEMPERATURE_H_ 27 | 28 | class BLEAdafruitTemperature : public BLEAdafruitSensor 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_DATA[16]; 33 | 34 | BLEAdafruitTemperature(); 35 | 36 | using BLEAdafruitSensor::begin; 37 | }; 38 | 39 | #endif /* BLEADAFRUIT_TEMPERATURE_H_ */ 40 | -------------------------------------------------------------------------------- /libraries/BLEAdafruitService/src/services/BLEAdafruitTone.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach (tinyusb.org) for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef BLEADAFRUIT_TONE_H_ 26 | #define BLEADAFRUIT_TONE_H_ 27 | 28 | class BLEAdafruitTone : public BLEService 29 | { 30 | public: 31 | static const uint8_t UUID128_SERVICE[16]; 32 | static const uint8_t UUID128_CHR_TONE[16]; 33 | 34 | BLEAdafruitTone(void); 35 | virtual err_t begin(int pin); 36 | 37 | private: 38 | int _pin; 39 | BLECharacteristic _tone; 40 | 41 | static void tone_write_cb(uint16_t conn_hdl, BLECharacteristic* chr, uint8_t* data, uint16_t len); 42 | }; 43 | 44 | #endif /* BLEADAFRUIT_TONE_H_ */ 45 | -------------------------------------------------------------------------------- /libraries/BLEHomekit/README.md: -------------------------------------------------------------------------------- 1 | # Thanks 2 | 3 | I want to thank a number of projects which made this possible: 4 | 5 | 1. https://github.com/aanon4/HomeKit - which provides reference implementation of homekit security on nrf5x 6 | 2. http://tweetnacl.cr.yp.to - which provides the compact eliptical curve implementations, as well as the sha512 hash. 7 | 3. https://github.com/ARMmbed/mbedtls - which provides the core multi-precission math routines used in the SRP implementation. 8 | 4. http://munacl.cryptojedi.org/ - which provides the ARM Cortex-M0 optimized Curve25519 implementation and fast multiply routines. 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /libraries/BLEHomekit/keywords.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/BLEHomekit/keywords.txt -------------------------------------------------------------------------------- /libraries/BLEHomekit/library.properties: -------------------------------------------------------------------------------- 1 | name=Apple Homekit Libraries for Bluefruit52 2 | version=0.9.0 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Arduino library for nRF52-based Adafruit Bluefruit LE modules 6 | paragraph=Arduino library for nRF52-based Adafruit Bluefruit LE modules 7 | category=Communication 8 | url=https://github.com/adafruit/Adafruit_nRF52_Arduino 9 | architectures=* 10 | includes=BLEHomekit.h 11 | -------------------------------------------------------------------------------- /libraries/BLEHomekit/src/crypto/crypto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * crypto.h 3 | * 4 | * Created on: Jun 25, 2015 5 | * Author: tim 6 | */ 7 | 8 | #ifndef HOMEKIT_CRYPTO_H_ 9 | #define HOMEKIT_CRYPTO_H_ 10 | 11 | //#define USE_UNACL_SCALARMULT 1 12 | #define USE_TWEETNACL_SCALARMULT 1 13 | 14 | #if defined(USE_UNACL_SCALARMULT) 15 | #include "uNaCl/api.h" 16 | #endif 17 | #include "tweetnacl-modified/tweetnacl.h" 18 | #include "srp/srp.h" 19 | #include "random.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" 23 | { 24 | #endif 25 | 26 | typedef struct 27 | { 28 | struct 29 | { 30 | // Public key is the last 32-bytes of the secret key 31 | union 32 | { 33 | uint8_t secret[64]; 34 | struct 35 | { 36 | uint8_t __ignore__[32]; 37 | uint8_t pub[32]; 38 | }; 39 | }; 40 | } sign; 41 | 42 | // Client we are paired with 43 | struct 44 | { 45 | uint8_t name[36]; 46 | uint8_t ltpk[32]; 47 | } client; 48 | } crypto_keys_t; 49 | 50 | extern crypto_keys_t crypto_keys; 51 | 52 | 53 | extern void crypto_init(void); 54 | extern void crypto_scheduleStoreKeys(void); 55 | extern void crypto_storeKeys(void); 56 | extern uint8_t crypto_verifyAndDecrypt(const uint8_t* key, uint8_t* nonce, uint8_t* encrypted, uint8_t length, uint8_t* output_buf, uint8_t* mac); 57 | extern void crypto_encryptAndSeal(const uint8_t* key, uint8_t* nonce, uint8_t* plain, uint16_t length, uint8_t* output_buf, uint8_t* output_mac); 58 | extern void crypto_sha512hmac(uint8_t* hash, uint8_t* salt, uint8_t salt_length, uint8_t* data, uint8_t data_length); 59 | extern void crypto_hkdf(uint8_t* target, uint8_t* salt, uint8_t salt_length, uint8_t* info, uint8_t info_length, uint8_t* ikm, uint8_t ikm_length); 60 | extern void crypto_transportEncrypt(uint8_t* key, uint8_t* nonce, uint8_t* plaintext, uint16_t plength, uint8_t* ciphertext, uint16_t* clength); 61 | extern uint8_t crypto_transportDecrypt(uint8_t* key, uint8_t* nonce, uint8_t* ciphertext, uint16_t clength, uint8_t* plaintext, uint16_t* plength); 62 | extern uint8_t crypto_advertise(void); 63 | 64 | void crypto_printkey(void); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* HOMEKIT_CRYPTO_H_ */ 71 | -------------------------------------------------------------------------------- /libraries/BLEHomekit/src/crypto/random.c: -------------------------------------------------------------------------------- 1 | /* 2 | * random.c 3 | * 4 | * Created on: Jun 10, 2015 5 | * Author: tim 6 | */ 7 | 8 | //#include 9 | 10 | #include "nrf_soc.h" 11 | #include "random.h" 12 | 13 | #define APP_ERROR_CHECK(_err) if (_err != NRF_SUCCESS) return 14 | 15 | void random_create(uint8_t* p_result, uint8_t length) 16 | { 17 | uint32_t err_code; 18 | 19 | while (length) 20 | { 21 | uint8_t available = 0; 22 | err_code = sd_rand_application_bytes_available_get(&available); 23 | APP_ERROR_CHECK(err_code); 24 | if (available) 25 | { 26 | available = available < length ? available : length; 27 | err_code = sd_rand_application_vector_get(p_result, available); 28 | APP_ERROR_CHECK(err_code); 29 | p_result += available; 30 | length -= available; 31 | } 32 | } 33 | } 34 | 35 | void randombytes(uint8_t* p_result, uint64_t length) 36 | { 37 | random_create(p_result, (uint8_t)length); 38 | } 39 | -------------------------------------------------------------------------------- /libraries/BLEHomekit/src/crypto/random.h: -------------------------------------------------------------------------------- 1 | /* 2 | * random.h 3 | * 4 | * Created on: Jun 10, 2015 5 | * Author: tim 6 | */ 7 | 8 | #ifndef HOMEKIT_RANDOM_H_ 9 | #define HOMEKIT_RANDOM_H_ 10 | 11 | extern void random_create(uint8_t* p_result, uint8_t length); 12 | extern void randombytes(uint8_t* p_result, uint64_t length); 13 | 14 | #endif /* HOMEKIT_RANDOM_H_ */ 15 | -------------------------------------------------------------------------------- /libraries/BLEHomekit/src/crypto/srp/srp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * srp.h 3 | * 4 | * Created on: Jun 10, 2015 5 | * Author: tim 6 | */ 7 | 8 | #ifndef HOMEKIT_SRP_SRP_H_ 9 | #define HOMEKIT_SRP_SRP_H_ 10 | 11 | #define BIGNUM_BYTES 384 12 | #define BIGNUM_WORDS (BIGNUM_BYTES / 4) 13 | 14 | #define DEBUG_SRP 0 15 | #define TEST_APPLE 0 16 | 17 | typedef struct 18 | { 19 | uint8_t b[32]; 20 | uint8_t salt[16]; 21 | uint8_t v[384]; 22 | uint8_t B[384]; 23 | 24 | uint8_t K[64]; 25 | uint8_t M1[64]; 26 | uint8_t M2[64]; 27 | 28 | uint8_t clientM1:1; 29 | uint8_t serverM1:1; 30 | } srp_keys_t; 31 | 32 | #ifdef __cplusplus 33 | extern "C" 34 | { 35 | #endif 36 | 37 | extern srp_keys_t srp; 38 | 39 | typedef void (*moretime_t)(uint16_t); 40 | 41 | extern void srp_init(void); 42 | extern void srp_start(void); 43 | extern uint8_t srp_setA(uint8_t* a, uint16_t length, moretime_t moretime, uint16_t conn_hdl); 44 | extern uint8_t srp_checkM1(uint8_t* m1, uint16_t length); 45 | extern uint8_t* srp_getSalt(void); 46 | extern uint8_t* srp_getB(void); 47 | extern uint8_t* srp_getM2(void); 48 | extern uint8_t* srp_getK(void); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* HOMEKIT_SRP_SRP_H_ */ 55 | -------------------------------------------------------------------------------- /libraries/BLEHomekit/src/crypto/tweetnacl-modified/tweetnacl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tweetnacl.h 3 | * 4 | * Created on: Jun 21, 2015 5 | * Author: tim 6 | */ 7 | 8 | #ifndef HOMEKIT_TWEETNACL_TWEETNACL_H_ 9 | #define HOMEKIT_TWEETNACL_TWEETNACL_H_ 10 | 11 | #define crypto_sign_keypair crypto_sign_ed25519_keypair 12 | #define crypto_sign_open crypto_sign_ed25519_open 13 | #define crypto_sign crypto_sign_ed25519 14 | #define crypto_scalarmult_base crypto_scalarmult_curve25519_base 15 | #define crypto_scalarmult crypto_scalarmult_curve25519 16 | 17 | #ifdef __cplusplus 18 | extern "C" 19 | { 20 | #endif 21 | 22 | extern int crypto_hashblocks_sha512(unsigned char *,const unsigned char *,unsigned long long); 23 | extern int crypto_hash_sha512(unsigned char *,const unsigned char *,unsigned long long); 24 | 25 | extern int crypto_onetimeauth_poly1305(unsigned char *,const unsigned char *,unsigned long,const unsigned char *); 26 | extern int crypto_onetimeauth_poly1305_verify(const unsigned char *,const unsigned char *,unsigned long,const unsigned char *); 27 | 28 | extern int crypto_sign_ed25519(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *); 29 | extern int crypto_sign_ed25519_open(unsigned char *,unsigned long long *,const unsigned char *,unsigned long long,const unsigned char *); 30 | extern int crypto_sign_ed25519_keypair(unsigned char *,unsigned char *); 31 | 32 | extern int crypto_stream_chacha20_xor(unsigned char *,const unsigned char *,unsigned long long,const unsigned char *,const unsigned char *,const unsigned char); 33 | 34 | extern int crypto_verify_16(const unsigned char *,const unsigned char *); 35 | extern int crypto_verify_32(const unsigned char *,const unsigned char *); 36 | 37 | #if defined(USE_TWEETNACL_SCALARMULT) 38 | extern int crypto_scalarmult_curve25519(unsigned char *,const unsigned char *,const unsigned char *); 39 | extern int crypto_scalarmult_curve25519_base(unsigned char *,const unsigned char *); 40 | #endif 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif /* HOMEKIT_TWEETNACL_TWEETNACL_H_ */ 47 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Adafruit Industries 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 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/README.md: -------------------------------------------------------------------------------- 1 | # Adafruit Feather nRF52 Bluefruit Libraries 2 | 3 | Peripherals & Central library -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/Fading/Fading.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Fading 3 | 4 | This example shows how to fade an LED using the analogWrite() function. 5 | 6 | The circuit: 7 | * LED attached from digital pin 9 to ground. 8 | 9 | Created 1 Nov 2008 10 | By David A. Mellis 11 | modified 30 Aug 2011 12 | By Tom Igoe 13 | 14 | http://www.arduino.cc/en/Tutorial/Fading 15 | 16 | This example code is in the public domain. 17 | 18 | */ 19 | 20 | #include 21 | #include // for Serial 22 | 23 | int ledPin = LED_RED; // LED connected to digital pin 9 24 | 25 | void setup() { 26 | // nothing happens in setup 27 | } 28 | 29 | void loop() { 30 | // fade in from min to max in increments of 5 points: 31 | for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) { 32 | // sets the value (range from 0 to 255): 33 | analogWrite(ledPin, fadeValue); 34 | // wait for 30 milliseconds to see the dimming effect 35 | delay(30); 36 | } 37 | 38 | // fade out from max to min in increments of 5 points: 39 | for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) { 40 | // sets the value (range from 0 to 255): 41 | analogWrite(ledPin, fadeValue); 42 | // wait for 30 milliseconds to see the dimming effect 43 | delay(30); 44 | } 45 | } 46 | 47 | 48 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/Serial1_test/.feather52832.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Hardware/Serial1_test/.feather52832.test.skip -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/Serial1_test/Serial1_test.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our Feather Bluefruit modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | /* 16 | * This sketch demonstrate how to use Hardware Serial1 along with 17 | * native USB Serial on Bluefruit nRF52840. 18 | * Note: Bluefruit nRF52832 does not support Serial1 19 | */ 20 | 21 | #include 22 | #include // for Serial 23 | 24 | void setup() 25 | { 26 | // Open serial communications and wait for port to open: 27 | Serial.begin(115200); 28 | while ( !Serial ) delay(10); // for nrf52840 with native usb 29 | 30 | Serial.println("Goodnight moon!"); 31 | 32 | // set the data rate for the SoftwareSerial port 33 | //mySerial.begin(9600); 34 | //mySerial.println("Hello, world?"); 35 | 36 | Serial1.begin(115200); 37 | Serial1.println("Hello, world?"); 38 | } 39 | 40 | void loop() // run over and over// 41 | { 42 | if (Serial1.available()) 43 | Serial.write(Serial1.read()); 44 | 45 | if (Serial.available()) 46 | Serial1.write(Serial.read()); 47 | } 48 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/SerialEcho/SerialEcho.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our Feather Bluefruit modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | #include 16 | #include // for Serial 17 | 18 | const int baudrate = 115200; 19 | 20 | /**************************************************************************/ 21 | /*! 22 | @brief The setup function runs once when reset the board 23 | */ 24 | /**************************************************************************/ 25 | void setup() 26 | { 27 | Serial.begin (baudrate); 28 | while ( !Serial ) delay(10); // for nrf52840 with native usb 29 | 30 | Serial.println("Serial Echo demo"); 31 | Serial.print("Badurate : "); 32 | Serial.println(baudrate); 33 | } 34 | 35 | /**************************************************************************/ 36 | /*! 37 | @brief The loop function runs over and over again forever 38 | */ 39 | /**************************************************************************/ 40 | void loop() 41 | { 42 | // From Serial monitor to All 43 | if ( Serial.available() ) 44 | { 45 | Serial.write( Serial.read() ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/adc/adc.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include // for Serial 3 | 4 | int adcin = A5; 5 | int adcvalue = 0; 6 | float mv_per_lsb = 3600.0F/1024.0F; // 10-bit ADC with 3.6V input range 7 | 8 | void setup() { 9 | Serial.begin(115200); 10 | while ( !Serial ) delay(10); // for nrf52840 with native usb 11 | } 12 | 13 | void loop() { 14 | // Get a fresh ADC value 15 | adcvalue = analogRead(adcin); 16 | 17 | // Display the results 18 | Serial.print(adcvalue); 19 | Serial.print(" ["); 20 | Serial.print((float)adcvalue * mv_per_lsb); 21 | Serial.println(" mV]"); 22 | 23 | delay(100); 24 | } 25 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/.cluenrf52840.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/.cluenrf52840.test.skip -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/.itsybitsy52840.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Hardware/adc_vbat/.itsybitsy52840.test.skip -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/blinky/blinky.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Blink 3 | Turns on an LED on for one second, then off for one second, repeatedly. 4 | 5 | Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO 6 | it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN takes care 7 | of use the correct LED pin whatever is the board used. 8 | If you want to know what pin the on-board LED is conn 9 | ected to on your Arduino model, check 10 | the Technical Specs of your board at https://www.arduino.cc/en/Main/Products 11 | 12 | This example code is in the public domain. 13 | 14 | modified 8 May 2014 15 | by Scott Fitzgerald 16 | 17 | modified 2 Sep 2016 18 | by Arturo Guadalupi 19 | */ 20 | 21 | #include 22 | 23 | #if defined(USE_TINYUSB) 24 | #include // for Serial 25 | #endif 26 | 27 | // the setup function runs once when you press reset or power the board 28 | void setup() { 29 | // initialize digital pin LED_BUILTIN as an output. 30 | pinMode(LED_BUILTIN, OUTPUT); 31 | } 32 | 33 | // the loop function runs over and over again forever 34 | void loop() { 35 | digitalToggle(LED_BUILTIN); // turn the LED on (HIGH is the voltage level) 36 | delay(1000); // wait for a second 37 | } 38 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/dfu_ota/dfu_ota.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | /* This sketch invoke API to enter OTA dfu mode */ 16 | 17 | #include 18 | #include // for Serial 19 | 20 | void setup() 21 | { 22 | enterOTADfu(); 23 | } 24 | 25 | 26 | void loop() 27 | { 28 | } 29 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/dfu_serial/dfu_serial.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | #include 16 | #include // for Serial 17 | 18 | /* 19 | * This sketch will reset the board into Serial DFU mode 20 | */ 21 | 22 | void setup() 23 | { 24 | enterSerialDfu(); 25 | } 26 | 27 | 28 | void loop() 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/digital_interrupt_deferred/digital_interrupt_deferred.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our Feather Bluefruit modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | /* 16 | * This sketch demonstrate how to pass ISR_DEFFERED as additional parameter 17 | * to defer callback from ISR context with attachInterrupt 18 | */ 19 | #include 20 | #include // for Serial 21 | 22 | int interruptPin = A0; 23 | 24 | void setup() 25 | { 26 | Serial.begin(115200); 27 | while ( !Serial ) delay(10); // for nrf52840 with native usb 28 | 29 | pinMode(interruptPin, INPUT_PULLUP); 30 | 31 | // ISR_DEFERRED flag cause the callback to be deferred from ISR context 32 | // and invoked within a callback thread. 33 | // It is required to use ISR_DEFERRED if callback function take long time 34 | // to run e.g Serial.print() or using any of Bluefruit API() which will 35 | // potentially call rtos API 36 | attachInterrupt(interruptPin, digital_callback, ISR_DEFERRED | CHANGE); 37 | } 38 | 39 | void loop() 40 | { 41 | // nothing to do 42 | } 43 | 44 | void digital_callback(void) 45 | { 46 | Serial.print("Pin value: "); 47 | Serial.println(digitalRead(interruptPin)); 48 | } 49 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/fwinfo/fwinfo.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | #include 16 | #include // for Serial 17 | 18 | void setup() 19 | { 20 | Serial.begin(115200); 21 | while ( !Serial ) delay(10); // for nrf52840 with native usb 22 | 23 | Serial.println("Bluefruit52 Firmware Info Example"); 24 | Serial.println("---------------------------------\n"); 25 | } 26 | 27 | 28 | void loop() 29 | { 30 | dbgPrintVersion(); 31 | digitalToggle(LED_RED); 32 | delay(5000); // wait for a second 33 | } 34 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/gpstest_swuart/gpstest_swuart.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | /* This example show how to use Software Serial on Bluefruit nRF52 16 | * to interact with GPS FeatherWing https://www.adafruit.com/product/3133 17 | * 18 | * Hardware Set up 19 | * - Connect 3V and GND to GPS wing 20 | * - 21 | */ 22 | 23 | #include 24 | #include // for Serial 25 | #include 26 | 27 | #define SW_RXD A0 28 | #define SW_TXD A1 29 | 30 | // Declare an Software Serial instance 31 | SoftwareSerial mySerial(SW_RXD, SW_TXD); 32 | 33 | void setup() { 34 | 35 | // Init hardware UART <-> Serial Monitor 36 | Serial.begin(115200); 37 | while ( !Serial ) delay(10); // for nrf52840 with native usb 38 | 39 | Serial.println("GPS echo test"); 40 | 41 | // Init Software Uart <-> GPS FeatherWing 42 | mySerial.begin(9600); // default NMEA GPS baud 43 | } 44 | 45 | 46 | void loop() { 47 | 48 | // Pass data from Serial (HW uart) to GPS Wing (SW Uart) 49 | if (Serial.available()) { 50 | char c = Serial.read(); 51 | mySerial.write(c); 52 | } 53 | 54 | // Pass data from GPS Wing (SW Uart) to Serial (HW uart) 55 | if (mySerial.available()) { 56 | char c = mySerial.read(); 57 | Serial.write(c); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/hw_systick/hw_systick.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | #include 15 | #include // for Serial 16 | 17 | // Interval between systick event 18 | #define TICK_INTERVAL_MS 50 19 | 20 | // Note: Extern "C" is required since all the IRQ hardware handler is 21 | // declared as "C function" within the startup (assembly) file. 22 | // Without it, our SysTick_Handler will be declared as "C++ function" 23 | // which is not the same as the "C function" in startup even it has 24 | // the same name. 25 | extern "C" 26 | { 27 | 28 | /* This is hardware interupt service function exectuing in non-RTOS thread 29 | * Function implementation should be quick and short if possible. 30 | * 31 | * WARNING: This function MUST NOT call any blocking FreeRTOS API 32 | * such as delay(), xSemaphoreTake() etc ... for more information 33 | * http://www.freertos.org/a00016.html 34 | */ 35 | void SysTick_Handler(void) 36 | { 37 | digitalToggle(LED_RED); 38 | } 39 | 40 | } // extern C 41 | 42 | void setup() 43 | { 44 | /* Input parameter is number of ticks between interrupts handler i.e SysTick_Handler 45 | * 1000 ms --> F_CPU ticks 46 | * T ms --> (F_CPU/1000)*T ticks 47 | * 48 | * Note: Since systick is 24-bit timer, the max tick value is 0xFFFFFF, F_CPU = 64 Mhz 49 | * --> our Tmax = 0xFFFFFF/64000 ~ 262 ms 50 | */ 51 | 52 | SysTick_Config( (F_CPU/1000)*TICK_INTERVAL_MS ); 53 | } 54 | 55 | void loop() 56 | { 57 | // do nothing here 58 | } 59 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/hwinfo/hwinfo.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include // for Serial 3 | 4 | typedef volatile uint32_t REG32; 5 | #define pREG32 (REG32 *) 6 | 7 | #define DEVICE_ID_HIGH (*(pREG32 (0x10000060))) 8 | #define DEVICE_ID_LOW (*(pREG32 (0x10000064))) 9 | #define MAC_ADDRESS_HIGH (*(pREG32 (0x100000a8))) 10 | #define MAC_ADDRESS_LOW (*(pREG32 (0x100000a4))) 11 | 12 | void setup() { 13 | Serial.begin(115200); 14 | while ( !Serial ) delay(10); // for nrf52840 with native usb 15 | 16 | Serial.println("Bluefruit 52 HW Info"); 17 | Serial.println(""); 18 | 19 | // MAC Address 20 | uint32_t addr_high = ((MAC_ADDRESS_HIGH) & 0x0000ffff) | 0x0000c000; 21 | uint32_t addr_low = MAC_ADDRESS_LOW; 22 | Serial.print("MAC Address: "); 23 | Serial.print((addr_high >> 8) & 0xFF, HEX); Serial.print(":"); 24 | Serial.print((addr_high) & 0xFF, HEX); Serial.print(":"); 25 | Serial.print((addr_low >> 24) & 0xFF, HEX); Serial.print(":"); 26 | Serial.print((addr_low >> 16) & 0xFF, HEX); Serial.print(":"); 27 | Serial.print((addr_low >> 8) & 0xFF, HEX); Serial.print(":"); 28 | Serial.print((addr_low) & 0xFF, HEX); Serial.println(""); 29 | 30 | // Unique Device ID 31 | Serial.print("Device ID : "); 32 | Serial.print(DEVICE_ID_HIGH, HEX); 33 | Serial.println(DEVICE_ID_LOW, HEX); 34 | 35 | // MCU Variant; 36 | Serial.printf("MCU Variant: nRF%X 0x%08X\n",NRF_FICR->INFO.PART, NRF_FICR->INFO.VARIANT); 37 | Serial.printf("Memory : Flash = %d KB, RAM = %d KB\n", NRF_FICR->INFO.FLASH, NRF_FICR->INFO.RAM); 38 | } 39 | 40 | void loop() { 41 | // put your main code here, to run repeatedly: 42 | 43 | } 44 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/meminfo/meminfo.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | #include 16 | #include // for Serial 17 | 18 | 19 | void setup() 20 | { 21 | Serial.begin(115200); 22 | while ( !Serial ) delay(10); // for nrf52840 with native usb 23 | 24 | Serial.println("Bluefruit52 Memory Info Example"); 25 | Serial.println("-------------------------------\n"); 26 | } 27 | 28 | 29 | void loop() 30 | { 31 | dbgMemInfo(); 32 | digitalToggle(LED_RED); 33 | delay(5000); // wait for a second 34 | } 35 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/nfc_to_gpio/nfc_to_gpio.ino: -------------------------------------------------------------------------------- 1 | // This sketch will check if the NFC pins are configured for NFC mode, 2 | // and if so it will switch them to operate in GPIO mode. A system 3 | // reset is required before this change takes effect since the CONFIG 4 | // memory is only read on power up. 5 | 6 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 7 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 8 | // !!!!! IMPORTANT NOTE ... READ BEFORE RUNNING THIS SKETCH !!!!! 9 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 10 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 11 | 12 | // UICR customer registers are meant to be stored with values 13 | // that are supposed to stay there during the life time of the softdevice. 14 | // You cannot erase them without erasing everything on chip, so setting the 15 | // NFC pins to GPIO mode is a ONE WAY OPERATION and you will need a debugger 16 | // like a Segger J-Link to set them back to NFC mode! 17 | 18 | #include 19 | #include // for Serial 20 | 21 | void setup() { 22 | Serial.begin(115200); 23 | while ( !Serial ) delay(10); // for nrf52840 with native usb 24 | 25 | Serial.println("Bluefruit52 NFC to GPIO Pin Config"); 26 | Serial.println("----------------------------------\n"); 27 | if ((NRF_UICR->NFCPINS & UICR_NFCPINS_PROTECT_Msk) == (UICR_NFCPINS_PROTECT_NFC << UICR_NFCPINS_PROTECT_Pos)){ 28 | Serial.println("Fix NFC pins"); 29 | NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos; 30 | while (NRF_NVMC->READY == NVMC_READY_READY_Busy); 31 | NRF_UICR->NFCPINS &= ~UICR_NFCPINS_PROTECT_Msk; 32 | while (NRF_NVMC->READY == NVMC_READY_READY_Busy); 33 | NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos; 34 | while (NRF_NVMC->READY == NVMC_READY_READY_Busy); 35 | Serial.println("Done"); 36 | delay(500); 37 | NVIC_SystemReset(); 38 | } 39 | 40 | } 41 | void loop() { 42 | // put your main code here, to run repeatedly: 43 | } 44 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/rtos_scheduler/rtos_scheduler.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | #include 16 | #include // for Serial 17 | 18 | /* 19 | * Sketch demonstate mutli-task using Scheduler. Demo create loop2() that 20 | * run in 'parallel' with loop(). 21 | * - loop() toggle LED_RED every 1 second 22 | * - loop2() toggle LED_BLUE every half of second 23 | */ 24 | 25 | void setup() 26 | { 27 | // LED_RED & LED_BLUE pin already initialized as an output. 28 | 29 | // Create loop2() using Scheduler to run in 'parallel' with loop() 30 | Scheduler.startLoop(loop2); 31 | } 32 | 33 | /** 34 | * Toggle led1 every 1 second 35 | */ 36 | void loop() 37 | { 38 | digitalToggle(LED_RED); // Toggle LED 39 | delay(1000); // wait for a second 40 | } 41 | 42 | /** 43 | * Toggle led1 every 0.5 second 44 | */ 45 | void loop2() 46 | { 47 | digitalToggle(LED_BLUE); // Toggle LED 48 | delay(500); // wait for a half second 49 | } 50 | 51 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/software_timer/software_timer.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | #include 15 | #include // for Serial 16 | 17 | /* SoftwareTimer is a helper class that uses FreeRTOS software timer 18 | * to invoke callback. Its periodic timing is flexible as opposed to 19 | * hardware timer and cannot be faster than rtos's tick which is configured 20 | * at ~1 ms interval. 21 | * 22 | * If you need an strict interval timing, or faster frequency, check out 23 | * the hw_systick sketch example that use hardware systick timer. 24 | * 25 | * http://www.freertos.org/RTOS-software-timer.html 26 | */ 27 | SoftwareTimer blinkTimer; 28 | 29 | 30 | void setup() 31 | { 32 | // Configure the timer with 1000 ms interval, with our callback 33 | blinkTimer.begin(1000, blink_timer_callback); 34 | 35 | // Start the timer 36 | blinkTimer.start(); 37 | } 38 | 39 | void loop() 40 | { 41 | // do nothing here 42 | } 43 | 44 | 45 | /** 46 | * Software Timer callback is invoked via a built-in FreeRTOS thread with 47 | * minimal stack size. Therefore it should be as simple as possible. If 48 | * a periodically heavy task is needed, please use Scheduler.startLoop() to 49 | * create a dedicated task for it. 50 | * 51 | * More information http://www.freertos.org/RTOS-software-timer.html 52 | */ 53 | void blink_timer_callback(TimerHandle_t xTimerID) 54 | { 55 | // freeRTOS timer ID, ignored if not used 56 | (void) xTimerID; 57 | 58 | digitalToggle(LED_RED); 59 | } 60 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/temp_measure_blocking/temp_measure_blocking.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This is example usage of the nrfx_temp driver 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | nrfx_temp_config_t config = NRFX_TEMP_DEFAULT_CONFIG; 9 | 10 | void setup() { 11 | Serial.begin(9600); 12 | // setting the handler to NULL will initialize the driver in blocking mode 13 | nrfx_temp_init(&config, NULL); 14 | } 15 | 16 | void loop() { 17 | nrfx_temp_measure(); // In blocking mode: this function waits until the measurement is finished. 18 | int32_t raw_temp = nrfx_temp_result_get(); 19 | float temp_c = raw_temp / 4.0; 20 | 21 | Serial.print(temp_c); 22 | Serial.println(" C"); 23 | 24 | delay(1000); 25 | } 26 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Hardware/temp_measure_non_blocking/temp_measure_non_blocking.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This is example usage of the nrfx_temp driver 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | nrfx_temp_config_t config = NRFX_TEMP_DEFAULT_CONFIG; 9 | 10 | // this function is called when the temperature measurement is ready 11 | void temp_handler(int32_t raw_temp) { 12 | float temp_c = raw_temp / 4.0; 13 | Serial.print(temp_c); 14 | Serial.println(" C"); 15 | } 16 | 17 | void setup() { 18 | Serial.begin(9600); 19 | nrfx_temp_init(&config, &temp_handler); 20 | } 21 | 22 | void loop() { 23 | nrfx_temp_measure(); 24 | 25 | delay(1000); 26 | } 27 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/ancs_arcada/.cluenrf52840.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/ancs_arcada/.cluenrf52840.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/ancs_arcada/.cplaynrf52840.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/ancs_arcada/.cplaynrf52840.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/arduino_science_journal/.cluenrf52840.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/arduino_science_journal/.cluenrf52840.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/arduino_science_journal/.cplaynrf52840.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/arduino_science_journal/.cplaynrf52840.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/arduino_science_journal/.feather52840sense.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/arduino_science_journal/.feather52840sense.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/.cluenrf52840.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/.cluenrf52840.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/.cplaynrf52840.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/.cplaynrf52840.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/.feather52840sense.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/bluefruit_playground/.feather52840sense.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/clearbonds/clearbonds.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | /* This sketch remove the folder that contains the bonding information 16 | * used by Bluefruit which is "/adafruit/bond" 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | void setup() 23 | { 24 | Serial.begin(115200); 25 | 26 | #if CFG_DEBUG 27 | // Blocking wait for connection when debug mode is enabled via IDE 28 | while ( !Serial ) yield(); 29 | #endif 30 | 31 | Serial.println("Bluefruit52 Clear Bonds Example"); 32 | Serial.println("-------------------------------\n"); 33 | 34 | Bluefruit.begin(); 35 | 36 | Serial.println(); 37 | Serial.println("----- Before -----\n"); 38 | bond_print_list(BLE_GAP_ROLE_PERIPH); 39 | bond_print_list(BLE_GAP_ROLE_CENTRAL); 40 | 41 | Bluefruit.Periph.clearBonds(); 42 | Bluefruit.Central.clearBonds(); 43 | 44 | Serial.println(); 45 | Serial.println("----- After -----\n"); 46 | 47 | bond_print_list(BLE_GAP_ROLE_PERIPH); 48 | bond_print_list(BLE_GAP_ROLE_CENTRAL); 49 | } 50 | 51 | void loop() 52 | { 53 | // Toggle both LEDs every 1 second 54 | digitalToggle(LED_RED); 55 | 56 | delay(1000); 57 | } 58 | 59 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/pairing_passkey_arcada/.cluenrf52840.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/pairing_passkey_arcada/.cluenrf52840.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/pairing_passkey_arcada/.cplaynrf52840.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/pairing_passkey_arcada/.cplaynrf52840.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/tf4micro-motion-kit/.none-cluenrf52840.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/tf4micro-motion-kit/.none-cluenrf52840.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/tf4micro-motion-kit/.none-feather52840sense.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Peripheral/tf4micro-motion-kit/.none-feather52840sense.test.only -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/tf4micro-motion-kit/ble_file_transfer.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 Google LLC 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef BLE_FILE_TRANSFER_CPP 17 | #define BLE_FILE_TRANSFER_CPP 18 | 19 | //#include 20 | #include 21 | 22 | // Forward declare the function that will be called when data has been delivered to us. 23 | void onBLEFileReceived(uint8_t* file_data, int file_length); 24 | 25 | namespace ble_file_transfer{ 26 | void updateBLEFileTransfer(); 27 | bool isTransfering(); 28 | void setupBLEFileTransfer(BLEService service); 29 | } 30 | 31 | #endif // BLE_FILE_TRANSFER_CPP 32 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/tf4micro-motion-kit/data_provider.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 Google LLC 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef DATA_PROVIDER_CPP 17 | #define DATA_PROVIDER_CPP 18 | 19 | // Forward declare the function that will be called when data has been delivered to us. 20 | void data_provider_calibrationComplete(); 21 | 22 | namespace data_provider { 23 | bool setup(); 24 | void update(float* buffer, bool useMagnetometer); 25 | void calibrate(); 26 | bool dataAvailable(); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Peripheral/tf4micro-motion-kit/model_tester.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 Google LLC 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef MODEL_TESTER_CPP 17 | #define MODEL_TESTER_CPP 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | // Forward declare the function that will be called when data has been delivered to us. 27 | void model_tester_onInference(unsigned char classIndex, unsigned char score, unsigned char velocity); 28 | 29 | namespace model_tester { 30 | void loadModel(unsigned char model[]); 31 | void update(float buffer[]); 32 | extern bool isModelLoaded; 33 | 34 | // Setters 35 | void setCaptureDelay(int val); 36 | void setNumSamples(int val); 37 | void setThreshold(float val); 38 | void setNumClasses(unsigned char val); 39 | void setDisableMagnetometer(bool val); 40 | void runTest(float *testData, int len); 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Projects/homekit/homekit_lightbulb/.all.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/libraries/Bluefruit52Lib/examples/Projects/homekit/homekit_lightbulb/.all.test.skip -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/examples/Projects/rssi_proximity/README.md: -------------------------------------------------------------------------------- 1 | # RSSI Proximity Project 2 | 3 | This project demonstrates how you can use a single Bluefruit nRF52 device 4 | running in Central mode to listen for a specific signature in the advertising 5 | packets of nearby Bluefruit nRF52 devices running in peripheral mode. 6 | 7 | The Central mode device will sort those devices with the matching signature by 8 | proximity based on their RSSI (relative signal strength) value. 9 | 10 | Most of the Central mode advertising API is used in this demo, making it an 11 | excellent place to start if you want to create your own custom Central based 12 | project(s). 13 | 14 | ## Project Files 15 | 16 | This project consists of two parts: 17 | 18 | - `rssi_proximity_central`: This project should be run on one Bluefruit nRF52 19 | board and will configure the board as a Central device, actively scanning 20 | for any peripheral devices in listening range. 21 | - `rssi_proximity_peripheral`: This project should be run on one or more 22 | Bluefruit nRF52 boards and will configure the boards as peripheral devices, 23 | sending out a specifically formatted advertising packet at a regular 24 | interval. 25 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit Bluefruit nRF52 Libraries 2 | version=0.21.0 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Arduino library for nRF52-based Adafruit Bluefruit LE modules 6 | paragraph=Arduino library for nRF52-based Adafruit Bluefruit LE modules 7 | category=Communication 8 | url=https://github.com/adafruit/Adafruit_nRF52_Arduino 9 | architectures=* 10 | includes=bluefruit.h 11 | depends=Adafruit nRFCrypto, Adafruit TinyUSB Library 12 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/src/clients/BLEClientIas.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Charlie Bershatsky on 4/19/23. 3 | // 4 | 5 | #include "BLEClientIas.h" 6 | #include "bluefruit.h" 7 | 8 | BLEClientIas::BLEClientIas() : 9 | BLEClientService(UUID16_SVC_IMMEDIATE_ALERT), _alert(UUID16_SVC_IMMEDIATE_ALERT) { 10 | 11 | } 12 | 13 | bool BLEClientIas::begin(void) { 14 | // invoke superclass begin() 15 | BLEClientService::begin(); 16 | 17 | _alert.begin(this); 18 | 19 | return true; 20 | } 21 | 22 | bool BLEClientIas::discover(uint16_t conn_handle) { 23 | VERIFY(BLEClientService::discover(conn_handle)); 24 | _conn_hdl = conn_handle; 25 | return true; 26 | } 27 | 28 | uint16_t BLEClientIas::getAlertLevel() { 29 | 30 | uint8_t level = 0; 31 | ble_gattc_handle_range_t bck_range = Bluefruit.Discovery.getHandleRange(); 32 | 33 | _alert.begin(this); 34 | 35 | if (Bluefruit.Discovery.discoverCharacteristic(_conn_hdl, _alert)) { 36 | level = _alert.read8(); 37 | } 38 | 39 | Bluefruit.Discovery.setHandleRange(bck_range); 40 | 41 | return level; 42 | } -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/src/clients/BLEClientIas.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Charlie Bershatsky on 4/19/23. 3 | // 4 | 5 | #ifndef ADAFRUIT_NRF52_ARDUINO_BLECLIENTIAS_H 6 | #define ADAFRUIT_NRF52_ARDUINO_BLECLIENTIAS_H 7 | 8 | #include "bluefruit_common.h" 9 | #include "BLEClientCharacteristic.h" 10 | #include "BLEClientService.h" 11 | 12 | class BLEClientIas : public BLEClientService { 13 | 14 | public: 15 | BLEClientIas(void); 16 | 17 | virtual bool begin(void); 18 | virtual bool discover(uint16_t conn_handle); 19 | 20 | uint16_t getAlertLevel (void); 21 | 22 | private: 23 | BLEClientCharacteristic _alert; 24 | 25 | }; 26 | 27 | 28 | #endif //ADAFRUIT_NRF52_ARDUINO_BLECLIENTIAS_H 29 | -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/src/services/BLEIas.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Charlie Bershatsky on 4/19/23. 3 | // 4 | 5 | #include "BLEIas.h" 6 | #include "bluefruit.h" 7 | #include "utility/utilities.h" 8 | #include "BLEService.h" 9 | 10 | BLEIas::BLEIas(void) : 11 | BLEService(UUID16_SVC_IMMEDIATE_ALERT), _alert(UUID16_SVC_IMMEDIATE_ALERT) { 12 | 13 | } 14 | 15 | void BLEIas::write(uint8_t alert_level) { 16 | _alert.write8(alert_level); 17 | } 18 | 19 | err_t BLEIas::begin(void) { 20 | 21 | // Invoke the superclass begin() 22 | VERIFY_STATUS(BLEService::begin()); 23 | 24 | _alert.setProperties(CHR_PROPS_READ); 25 | _alert.setPermission(SECMODE_OPEN, SECMODE_NO_ACCESS); 26 | _alert.setFixedLen(1); 27 | 28 | VERIFY_STATUS( _alert.begin() ); 29 | 30 | return ERROR_NONE; 31 | 32 | } -------------------------------------------------------------------------------- /libraries/Bluefruit52Lib/src/services/BLEIas.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Charlie Bershatsky on 4/19/23. 3 | // 4 | 5 | #ifndef ADAFRUIT_NRF52_ARDUINO_BLEIAS_H 6 | #define ADAFRUIT_NRF52_ARDUINO_BLEIAS_H 7 | 8 | #include "bluefruit_common.h" 9 | 10 | #include "BLEService.h" 11 | #include "BLECharacteristic.h" 12 | 13 | 14 | class BLEIas : public BLEService { 15 | 16 | protected: 17 | BLECharacteristic _alert; 18 | 19 | public: 20 | BLEIas(void); 21 | 22 | void write(uint8_t level); 23 | 24 | virtual err_t begin(void); 25 | 26 | }; 27 | 28 | 29 | #endif //ADAFRUIT_NRF52_ARDUINO_BLEIAS_H 30 | -------------------------------------------------------------------------------- /libraries/InternalFileSytem/examples/Internal_Format/Internal_Format.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | #include 16 | #include 17 | #include // for Serial 18 | 19 | using namespace Adafruit_LittleFS_Namespace; 20 | 21 | // the setup function runs once when you press reset or power the board 22 | void setup() 23 | { 24 | Serial.begin(115200); 25 | while ( !Serial ) delay(10); // for nrf52840 with native usb 26 | 27 | Serial.println("InternalFS Format Example"); 28 | Serial.println(); 29 | 30 | // Wait for user input to run. 31 | Serial.println("This sketch will destroy all of your data in External Flash!"); 32 | Serial.print("Enter any keys to continue:"); 33 | while ( !Serial.available() ) delay(1); 34 | Serial.println(); 35 | Serial.println(); 36 | 37 | // Initialize Internal File System 38 | InternalFS.begin(); 39 | 40 | Serial.print("Formating ... "); 41 | delay(1); // for message appear on monitor 42 | 43 | // Format 44 | InternalFS.format(); 45 | 46 | Serial.println("Done"); 47 | } 48 | 49 | // the loop function runs over and over again forever 50 | void loop() 51 | { 52 | // nothing to do 53 | } 54 | -------------------------------------------------------------------------------- /libraries/InternalFileSytem/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit Internal File System on Bluefruit nRF52 2 | version=0.11.0 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Adafruit Internal File System on Bluefruit nRF52 6 | paragraph=Adafruit Internal File System on Bluefruit nRF52 7 | category=Data Storage 8 | url=https://github.com/adafruit/Adafruit_nRF52_Arduino 9 | architectures=* 10 | includes=InternalFileSystem.h 11 | -------------------------------------------------------------------------------- /libraries/InternalFileSytem/src/InternalFileSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 hathach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef INTERNALFILESYSTEM_H_ 26 | #define INTERNALFILESYSTEM_H_ 27 | 28 | #include "Adafruit_LittleFS.h" 29 | 30 | class InternalFileSystem : public Adafruit_LittleFS 31 | { 32 | public: 33 | InternalFileSystem(void); 34 | 35 | // overwrite to also perform low level format (sector erase of whole flash region) 36 | bool begin(void); 37 | }; 38 | 39 | extern InternalFileSystem InternalFS; 40 | 41 | #endif /* INTERNALFILESYSTEM_H_ */ 42 | -------------------------------------------------------------------------------- /libraries/InternalFileSytem/src/flash/flash_cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2019 Ha Thach for Adafruit Industries 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | */ 24 | 25 | #ifndef FLASH_CACHE_H_ 26 | #define FLASH_CACHE_H_ 27 | 28 | #include 29 | #include 30 | 31 | #define FLASH_CACHE_SIZE 4096 // must be a erasable page size 32 | #define FLASH_CACHE_INVALID_ADDR 0xffffffff 33 | 34 | typedef struct 35 | { 36 | bool (*erase) (uint32_t addr); 37 | uint32_t (*program) (uint32_t dst, void const * src, uint32_t len); 38 | uint32_t (*read) (void* dst, uint32_t src, uint32_t len); 39 | bool (*verify) (uint32_t addr, void const * buf, uint32_t len); 40 | 41 | uint32_t cache_addr; 42 | uint8_t* cache_buf; 43 | } flash_cache_t; 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | int flash_cache_write (flash_cache_t* fc, uint32_t dst, void const *src, uint32_t count); 50 | void flash_cache_flush (flash_cache_t* fc); 51 | int flash_cache_read (flash_cache_t* fc, void* dst, uint32_t addr, uint32_t count); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* FLASH_CACHE_H_ */ 58 | -------------------------------------------------------------------------------- /libraries/PDM/examples/PDMSerialPlotter/PDMSerialPlotter.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This example reads audio data from the on-board PDM microphones, and prints 3 | out the samples to the Serial console. The Serial Plotter built into the 4 | Arduino IDE can be used to plot the audio data (Tools -> Serial Plotter) 5 | 6 | Please try with the Circuit Playground Bluefruit 7 | 8 | This example code is in the public domain. 9 | */ 10 | 11 | #include 12 | 13 | // buffer to read samples into, each sample is 16-bits 14 | short sampleBuffer[256]; 15 | 16 | // number of samples read 17 | volatile int samplesRead; 18 | 19 | void setup() { 20 | Serial.begin(9600); 21 | while (!Serial) yield(); 22 | 23 | // configure the data receive callback 24 | PDM.onReceive(onPDMdata); 25 | 26 | // optionally set the gain, defaults to 20 27 | // PDM.setGain(30); 28 | 29 | // initialize PDM with: 30 | // - one channel (mono mode) 31 | // - a 16 kHz sample rate 32 | if (!PDM.begin(1, 16000)) { 33 | Serial.println("Failed to start PDM!"); 34 | while (1) yield(); 35 | } 36 | } 37 | 38 | void loop() { 39 | // wait for samples to be read 40 | if (samplesRead) { 41 | // print samples to the serial monitor or plotter 42 | for (int i = 0; i < samplesRead; i++) { 43 | Serial.println(sampleBuffer[i]); 44 | } 45 | // clear the read count 46 | samplesRead = 0; 47 | } 48 | } 49 | 50 | void onPDMdata() { 51 | // query the number of bytes available 52 | int bytesAvailable = PDM.available(); 53 | 54 | // read into the sample buffer 55 | PDM.read(sampleBuffer, bytesAvailable); 56 | 57 | // 16-bit, 2 bytes per sample 58 | samplesRead = bytesAvailable / 2; 59 | } 60 | 61 | -------------------------------------------------------------------------------- /libraries/PDM/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map PDM 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | PDM KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | end KEYWORD2 16 | 17 | available KEYWORD2 18 | read KEYWORD2 19 | 20 | onReceive KEYWORD2 21 | 22 | setGain KEYWORD2 23 | setBufferSize KEYWORD2 24 | 25 | ####################################### 26 | # Constants (LITERAL1) 27 | ####################################### 28 | -------------------------------------------------------------------------------- /libraries/PDM/library.properties: -------------------------------------------------------------------------------- 1 | name=nRF52840 PDM - Adafruit Fork 2 | version=1.0 3 | author=Arduino 4 | maintainer=Adafruit 5 | sentence=Enables the communication with devices that use the PDM Bus. Specific implementation for nRF52. 6 | paragraph= 7 | category=Communication 8 | url= 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/PDM/src/PDM.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2019 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 | #ifndef _PDM_H_INCLUDED 20 | #define _PDM_H_INCLUDED 21 | 22 | #if !defined(ARDUINO_NRF52_ADAFRUIT) 23 | #error "This library targets only Adafruit NRF52840 boards" 24 | #endif 25 | 26 | #include 27 | #include // for Serial 28 | #include "utility/PDMDoubleBuffer.h" 29 | 30 | class PDMClass 31 | { 32 | public: 33 | PDMClass(int dataPin, int clkPin, int pwrPin); 34 | virtual ~PDMClass(); 35 | 36 | void setPins(int dataPin, int clkPin, int pwrPin); 37 | int begin(int channels, long sampleRate); 38 | void end(); 39 | 40 | virtual int available(); 41 | virtual int read(void* buffer, size_t size); 42 | 43 | void onReceive(void(*)(void)); 44 | 45 | void setGain(int gain); 46 | void setBufferSize(int bufferSize); 47 | 48 | // private: 49 | void IrqHandler(); 50 | 51 | private: 52 | int _dinPin; 53 | int _clkPin; 54 | int _pwrPin; 55 | 56 | int _channels; 57 | 58 | PDMDoubleBuffer _doubleBuffer; 59 | 60 | void (*_onReceive)(void); 61 | }; 62 | 63 | extern PDMClass PDM; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /libraries/PDM/src/utility/PDMDoubleBuffer.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 | #ifndef _PDM_DOUBLE_BUFFER_H_INCLUDED 20 | #define _PDM_DOUBLE_BUFFER_H_INCLUDED 21 | 22 | #include 23 | #include 24 | 25 | #define DEFAULT_PDM_BUFFER_SIZE 512 26 | 27 | class PDMDoubleBuffer 28 | { 29 | public: 30 | PDMDoubleBuffer(); 31 | virtual ~PDMDoubleBuffer(); 32 | 33 | void setSize(int size); 34 | 35 | void reset(); 36 | 37 | size_t availableForWrite(); 38 | size_t write(const void *buffer, size_t size); 39 | size_t read(void *buffer, size_t size); 40 | size_t peek(void *buffer, size_t size); 41 | void* data(); 42 | size_t available(); 43 | void swap(int length = 0); 44 | 45 | private: 46 | uint8_t* _buffer[2]; 47 | int _size; 48 | volatile int _length[2]; 49 | volatile int _readOffset[2]; 50 | volatile int _index; 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /libraries/RotaryEncoder/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Adafruit Industries 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 | -------------------------------------------------------------------------------- /libraries/RotaryEncoder/examples/HwEncoderCallback/HwEncoderCallback.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | #include 16 | #include // for Serial 17 | #include "RotaryEncoder.h" 18 | 19 | #define PIN_A A0 20 | #define PIN_B A1 21 | 22 | void setup() 23 | { 24 | Serial.begin(115200); 25 | while ( !Serial ) delay(10); // for nrf52840 with native usb 26 | 27 | Serial.println("Bluefruit52 HW Rotary Encoder Callback Example"); 28 | Serial.println("----------------------------------------------\n"); 29 | 30 | // Initialize Encoder 31 | RotaryEncoder.begin(PIN_A, PIN_B); 32 | 33 | // Set callback 34 | RotaryEncoder.setCallback(encoder_callback); 35 | 36 | // Start encoder 37 | RotaryEncoder.start(); 38 | } 39 | 40 | void loop() 41 | { 42 | // do nothing 43 | } 44 | 45 | void encoder_callback(int step) 46 | { 47 | if ( step > 0 ) 48 | { 49 | Serial.println("Right"); 50 | }else 51 | { 52 | Serial.println("Left"); 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /libraries/RotaryEncoder/examples/HwEncoderPoll/HwEncoderPoll.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | #include 16 | #include // for Serial 17 | #include "RotaryEncoder.h" 18 | 19 | #define PIN_A A0 20 | #define PIN_B A1 21 | 22 | void setup() 23 | { 24 | Serial.begin(115200); 25 | while ( !Serial ) delay(10); // for nrf52840 with native usb 26 | 27 | Serial.println("Bluefruit52 HW Rotary Encoder Polling Example"); 28 | Serial.println("---------------------------------------------\n"); 29 | 30 | // Initialize Encoder 31 | RotaryEncoder.begin(PIN_A, PIN_B); 32 | 33 | // Start encoder 34 | RotaryEncoder.start(); 35 | } 36 | 37 | void loop() 38 | { 39 | int value = RotaryEncoder.read(); 40 | 41 | if (value) 42 | { 43 | if ( value > 0 ) 44 | { 45 | Serial.println("Right"); 46 | }else 47 | { 48 | Serial.println("Left"); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /libraries/RotaryEncoder/examples/SwEncoderCallback/SwEncoderCallback.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | #include 16 | #include // for Serial 17 | #include "RotaryEncoder.h" 18 | 19 | #define PIN_A A0 20 | #define PIN_B A1 21 | 22 | SwRotaryEncoder swEncoder; 23 | 24 | void setup() 25 | { 26 | Serial.begin(115200); 27 | while ( !Serial ) delay(10); // for nrf52840 with native usb 28 | 29 | Serial.println("Bluefruit52 SW Rotary Encoder Callback Example"); 30 | Serial.println("----------------------------------------------\n"); 31 | 32 | // Initialize Encoder 33 | swEncoder.begin(PIN_A, PIN_B); 34 | swEncoder.setCallback(encoder_callback); 35 | } 36 | 37 | void loop() 38 | { 39 | // do nothing 40 | } 41 | 42 | void encoder_callback(int step) 43 | { 44 | if ( step > 0 ) 45 | { 46 | Serial.println("Right"); 47 | }else 48 | { 49 | Serial.println("Left"); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /libraries/RotaryEncoder/examples/SwEncoderPoll/SwEncoderPoll.ino: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | This is an example for our nRF52 based Bluefruit LE modules 3 | 4 | Pick one up today in the adafruit shop! 5 | 6 | Adafruit invests time and resources providing this open source code, 7 | please support Adafruit and open-source hardware by purchasing 8 | products from Adafruit! 9 | 10 | MIT license, check LICENSE for more information 11 | All text above, and the splash screen below must be included in 12 | any redistribution 13 | *********************************************************************/ 14 | 15 | #include 16 | #include // for Serial 17 | #include "RotaryEncoder.h" 18 | 19 | #define PIN_A A0 20 | #define PIN_B A1 21 | 22 | SwRotaryEncoder swEncoder; 23 | 24 | void setup() 25 | { 26 | Serial.begin(115200); 27 | while ( !Serial ) delay(10); // for nrf52840 with native usb 28 | 29 | Serial.println("Bluefruit52 SW Rotary Encoder Polling Example"); 30 | Serial.println("---------------------------------------------\n"); 31 | 32 | // Initialize Encoder 33 | swEncoder.begin(PIN_A, PIN_B); 34 | } 35 | 36 | void loop() 37 | { 38 | int value = swEncoder.read(); 39 | 40 | if (value) 41 | { 42 | if ( value > 0 ) 43 | { 44 | Serial.println("Right"); 45 | }else 46 | { 47 | Serial.println("Left"); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /libraries/RotaryEncoder/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Datatypes (KEYWORD1) 3 | ####################################### 4 | 5 | HwRotaryEncoder KEYWORD1 6 | SwRotaryEncoder KEYWORD1 7 | 8 | ####################################### 9 | # Methods (KEYWORD2) 10 | ####################################### 11 | 12 | setSampler KEYWORD2 13 | setDebounce KEYWORD2 14 | setReporter KEYWORD2 15 | setCallback KEYWORD2 16 | read KEYWORD2 17 | readAbs KEYWORD2 18 | writeAbs KEYWORD2 19 | clearAbs KEYWORD2 20 | -------------------------------------------------------------------------------- /libraries/RotaryEncoder/library.properties: -------------------------------------------------------------------------------- 1 | name=Rotary Encoder 2 | version=0.8.0 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Arduino library for nRF52-based Adafruit Bluefruit LE modules 6 | paragraph=Arduino library for nRF52-based Adafruit Bluefruit LE modules 7 | category=Communication 8 | url=https://github.com/adafruit/Adafruit_nRF52_Arduino 9 | architectures=* 10 | includes=RotaryEncoder.h 11 | -------------------------------------------------------------------------------- /libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Digital Pot Control 3 | 4 | This example controls an Analog Devices AD5206 digital potentiometer. 5 | The AD5206 has 6 potentiometer channels. Each channel's pins are labeled 6 | A - connect this to voltage 7 | W - this is the pot's wiper, which changes when you set it 8 | B - connect this to ground. 9 | 10 | The AD5206 is SPI-compatible,and to command it, you send two bytes, 11 | one with the channel number (0 - 5) and one with the resistance value for the 12 | channel (0 - 255). 13 | 14 | The circuit: 15 | * All A pins of AD5206 connected to +5V 16 | * All B pins of AD5206 connected to ground 17 | * An LED and a 220-ohm resisor in series connected from each W pin to ground 18 | * CS - to digital pin 10 (SS pin) 19 | * SDI - to digital pin 11 (MOSI pin) 20 | * CLK - to digital pin 13 (SCK pin) 21 | 22 | created 10 Aug 2010 23 | by Tom Igoe 24 | 25 | Thanks to Heather Dewey-Hagborg for the original tutorial, 2005 26 | 27 | */ 28 | 29 | 30 | // inslude the SPI library: 31 | #include 32 | 33 | 34 | // set pin 10 as the slave select for the digital pot: 35 | const int slaveSelectPin = 10; 36 | 37 | void setup() { 38 | // set the slaveSelectPin as an output: 39 | pinMode (slaveSelectPin, OUTPUT); 40 | // initialize SPI: 41 | SPI.begin(); 42 | } 43 | 44 | void loop() { 45 | // go through the six channels of the digital pot: 46 | for (int channel = 0; channel < 6; channel++) { 47 | // change the resistance on this channel from min to max: 48 | for (int level = 0; level < 255; level++) { 49 | digitalPotWrite(channel, level); 50 | delay(10); 51 | } 52 | // wait a second at the top: 53 | delay(100); 54 | // change the resistance on this channel from max to min: 55 | for (int level = 0; level < 255; level++) { 56 | digitalPotWrite(channel, 255 - level); 57 | delay(10); 58 | } 59 | } 60 | 61 | } 62 | 63 | void digitalPotWrite(int address, int value) { 64 | // take the SS pin low to select the chip: 65 | digitalWrite(slaveSelectPin, LOW); 66 | // send in the address and value via SPI: 67 | SPI.transfer(address); 68 | SPI.transfer(value); 69 | // take the SS pin high to de-select the chip: 70 | digitalWrite(slaveSelectPin, HIGH); 71 | } 72 | -------------------------------------------------------------------------------- /libraries/SPI/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SPI 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SPI KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | end KEYWORD2 16 | transfer KEYWORD2 17 | #setBitOrder KEYWORD2 18 | setDataMode KEYWORD2 19 | setClockDivider KEYWORD2 20 | 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | SPI_MODE0 LITERAL1 26 | SPI_MODE1 LITERAL1 27 | SPI_MODE2 LITERAL1 28 | SPI_MODE3 LITERAL1 29 | 30 | SPI_CONTINUE LITERAL1 31 | SPI_LAST LITERAL1 32 | -------------------------------------------------------------------------------- /libraries/SPI/library.properties: -------------------------------------------------------------------------------- 1 | name=SPI 2 | version=1.0 3 | author= 4 | maintainer= 5 | sentence=Enables the communication with devices that use the Serial Peripheral Interface (SPI) Bus. Specific implementation for nRF52. 6 | paragraph= 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/SPI 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/Servo/README.adoc: -------------------------------------------------------------------------------- 1 | = Servo Library for Arduino = 2 | 3 | This library allows an Arduino board to control RC (hobby) servo motors. 4 | 5 | For more information about this library please visit us at 6 | http://www.arduino.cc/en/Reference/Servo 7 | 8 | == License == 9 | 10 | Copyright (c) 2013 Arduino LLC. All right reserved. 11 | Copyright (c) 2009 Michael Margolis. All right reserved. 12 | 13 | This library is free software; you can redistribute it and/or 14 | modify it under the terms of the GNU Lesser General Public 15 | License as published by the Free Software Foundation; either 16 | version 2.1 of the License, or (at your option) any later version. 17 | 18 | This library is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | Lesser General Public License for more details. 22 | 23 | You should have received a copy of the GNU Lesser General Public 24 | License along with this library; if not, write to the Free Software 25 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 26 | -------------------------------------------------------------------------------- /libraries/Servo/examples/Knob/Knob.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Controlling a servo position using a potentiometer (variable resistor) 3 | by Michal Rinott 4 | 5 | modified on 8 Nov 2013 6 | by Scott Fitzgerald 7 | http://www.arduino.cc/en/Tutorial/Knob 8 | */ 9 | 10 | #include 11 | #include // for Serial 12 | #include 13 | 14 | Servo myservo; // create servo object to control a servo 15 | 16 | int potpin = A0; // analog pin used to connect the potentiometer 17 | int val; // variable to read the value from the analog pin 18 | 19 | void setup() { 20 | myservo.attach(A1); // attaches the servo on pin 9 to the servo object 21 | } 22 | 23 | void loop() { 24 | val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023) 25 | val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180) 26 | myservo.write(val); // sets the servo position according to the scaled value 27 | delay(15); // waits for the servo to get there 28 | } 29 | 30 | -------------------------------------------------------------------------------- /libraries/Servo/examples/Sweep/Sweep.ino: -------------------------------------------------------------------------------- 1 | /* Sweep 2 | by BARRAGAN 3 | This example code is in the public domain. 4 | 5 | modified 8 Nov 2013 6 | by Scott Fitzgerald 7 | http://www.arduino.cc/en/Tutorial/Sweep 8 | */ 9 | 10 | #include 11 | #include // for Serial 12 | #include 13 | 14 | Servo myservo; // create servo object to control a servo 15 | // twelve servo objects can be created on most boards 16 | 17 | int pos = 0; // variable to store the servo position 18 | 19 | void setup() { 20 | myservo.attach(A0); // attaches the servo on pin 9 to the servo object 21 | } 22 | 23 | void loop() { 24 | for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees 25 | // in steps of 1 degree 26 | myservo.write(pos); // tell servo to go to position in variable 'pos' 27 | delay(15); // waits 15ms for the servo to reach the position 28 | } 29 | for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees 30 | myservo.write(pos); // tell servo to go to position in variable 'pos' 31 | delay(15); // waits 15ms for the servo to reach the position 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /libraries/Servo/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map Servo 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | Servo KEYWORD1 Servo 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | attach KEYWORD2 15 | detach KEYWORD2 16 | write KEYWORD2 17 | read KEYWORD2 18 | attached KEYWORD2 19 | writeMicroseconds KEYWORD2 20 | readMicroseconds KEYWORD2 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | -------------------------------------------------------------------------------- /libraries/Servo/library.properties: -------------------------------------------------------------------------------- 1 | name=Servo 2 | version=1.1.2 3 | author=Michael Margolis, Arduino 4 | maintainer=Arduino 5 | sentence=Allows Arduino/Genuino boards to control a variety of servo motors. 6 | paragraph=This library can control a great number of servos.
It makes careful use of timers: the library can control 12 servos using only 1 timer.
On the Arduino Due you can control up to 60 servos.
7 | category=Device Control 8 | url=http://www.arduino.cc/en/Reference/Servo 9 | architectures=nrf52 10 | -------------------------------------------------------------------------------- /libraries/Servo/src/nrf52/ServoTimers.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Arduino. 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. See the GNU 12 | 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 | /* 20 | * NRF52 doesn't use timer, but pwm. This file include definitions to keep 21 | * compatibility with the Servo library standards. 22 | */ 23 | 24 | #ifndef __SERVO_TIMERS_H__ 25 | #define __SERVO_TIMERS_H__ 26 | 27 | /** 28 | * NRF52 Only definitions 29 | * --------------------- 30 | */ 31 | //PWM_PRESCALER_PRESCALER_DIV_128 -> NRF_PWM_CLK_125kHz -> resolution 8µs 32 | //MaxValue = 2500 -> PWM period = 20ms 33 | //20ms - 50Hz 34 | #define DUTY_CYCLE_RESOLUTION 8 35 | #define MAXVALUE 2500 36 | #define CLOCKDIV PWM_PRESCALER_PRESCALER_DIV_128 37 | 38 | // define one timer in order to have MAX_SERVOS = 12 39 | typedef enum { _timer1, _Nbr_16timers } timer16_Sequence_t; 40 | 41 | #endif // __SERVO_TIMERS_H__ 42 | -------------------------------------------------------------------------------- /libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Software serial multiple serial test 3 | 4 | Receives from the hardware serial, sends to software serial. 5 | Receives from software serial, sends to hardware serial. 6 | 7 | The circuit: 8 | * RX is digital pin A0 (connect to TX of other device) 9 | * TX is digital pin A1 (connect to RX of other device) 10 | 11 | This example code is in the public domain. 12 | 13 | Software Serial will not work when Bluetooth Radio is active because the softdevice 14 | interrupts the library. 15 | 16 | */ 17 | 18 | #include 19 | #include // for Serial 20 | #include 21 | 22 | SoftwareSerial mySerial(A0, A1); // RX, TX 23 | 24 | 25 | void setup() 26 | { 27 | // Open serial communications and wait for port to open: 28 | Serial.begin(9600); 29 | while ( !Serial ) delay(10); // for nrf52840 with native usb 30 | 31 | Serial.println("Goodnight moon!"); 32 | 33 | // set the data rate for the SoftwareSerial port 34 | mySerial.begin(9600); 35 | mySerial.println("Hello, world?"); 36 | } 37 | 38 | void loop() // run over and over// 39 | { 40 | if (mySerial.available()) 41 | Serial.write(mySerial.read()); 42 | 43 | if (Serial.available()) 44 | mySerial.write(Serial.read()); 45 | } 46 | -------------------------------------------------------------------------------- /libraries/SoftwareSerial/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map for SoftwareSerial 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SoftwareSerial KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | end KEYWORD2 17 | read KEYWORD2 18 | write KEYWORD2 19 | available KEYWORD2 20 | isListening KEYWORD2 21 | overflow KEYWORD2 22 | flush KEYWORD2 23 | listen KEYWORD2 24 | peek KEYWORD2 25 | 26 | ####################################### 27 | # Constants (LITERAL1) 28 | ####################################### 29 | 30 | -------------------------------------------------------------------------------- /libraries/SoftwareSerial/library.properties: -------------------------------------------------------------------------------- 1 | name=SoftwareSerial 2 | version=1.0.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Enables serial communication on digital pins. 6 | paragraph=The SoftwareSerial library has been developed to allow serial communication on any digital pin of the board, using software to replicate the functionality of the hardware UART. It is possible to have multiple software serial ports with speeds up to 115200 bps. 7 | category=Communication 8 | url=http://arduino.cc/en/Reference/SoftwareSerial 9 | architectures=nrf52 10 | -------------------------------------------------------------------------------- /libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino: -------------------------------------------------------------------------------- 1 | // I2C Digital Potentiometer 2 | // by Nicholas Zambetti 3 | // and Shawn Bonkowski 4 | 5 | // Demonstrates use of the Wire library 6 | // Controls AD5171 digital potentiometer via I2C/TWI 7 | 8 | // Created 31 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | // This example code is in the public domain. 13 | 14 | 15 | #include 16 | 17 | void setup() 18 | { 19 | Wire.begin(); // join i2c bus (address optional for main) 20 | } 21 | 22 | byte val = 0; 23 | 24 | void loop() 25 | { 26 | Wire.beginTransmission(44); // transmit to device #44 (0x2c) 27 | // device address is specified in datasheet 28 | Wire.write(byte(0x00)); // sends instruction byte 29 | Wire.write(val); // sends potentiometer value byte 30 | Wire.endTransmission(); // stop transmitting 31 | 32 | val++; // increment value 33 | if(val == 64) // if reached 64th position (max) 34 | { 35 | val = 0; // start over from lowest value 36 | } 37 | delay(500); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /libraries/Wire/examples/main_reader/main_reader.ino: -------------------------------------------------------------------------------- 1 | // Wire Main Reader 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Reads data from an I2C/TWI secondary device 6 | // Refer to the "Wire Secondary Sender" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(); // join i2c bus (address optional for main) 18 | Serial.begin(9600); // start serial for output 19 | while ( !Serial ) delay(10); // for nrf52840 with native usb 20 | } 21 | 22 | void loop() 23 | { 24 | Wire.requestFrom(2, 6); // request 6 bytes from secondary device #2 25 | 26 | while(Wire.available()) // secondary may send less than requested 27 | { 28 | char c = Wire.read(); // receive a byte as character 29 | Serial.print(c); // print the character 30 | } 31 | 32 | delay(500); 33 | } 34 | -------------------------------------------------------------------------------- /libraries/Wire/examples/main_scan/main_scan.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | TwoWire *wi = &Wire; 4 | //TwoWire *wi = &Wire1; 5 | 6 | void setup() 7 | { 8 | Serial.begin(115200); // start serial for output 9 | while ( !Serial ) delay(10); // for nrf52840 with native usb 10 | wi->begin(); // join i2c bus (address optional for main) 11 | } 12 | 13 | void loop() 14 | { 15 | Serial.println("Scanning address from 0 to 127"); 16 | for (int addr = 1; addr < 128; addr++) 17 | { 18 | wi->beginTransmission(addr); 19 | if ( 0 == wi->endTransmission() ) 20 | { 21 | Serial.print("Found: 0x"); 22 | Serial.print(addr, HEX); 23 | Serial.println(); 24 | } 25 | } 26 | 27 | delay(5000); 28 | } 29 | -------------------------------------------------------------------------------- /libraries/Wire/examples/main_writer/main_writer.ino: -------------------------------------------------------------------------------- 1 | // Wire Main Writer 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Writes data to an I2C/TWI secondary device 6 | // Refer to the "Wire Secondary Receiver" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(); // join i2c bus (address optional for main) 18 | } 19 | 20 | byte x = 0; 21 | 22 | void loop() 23 | { 24 | Wire.beginTransmission(4); // transmit to device #4 25 | Wire.write("x is "); // sends five bytes 26 | Wire.write(x); // sends one byte 27 | Wire.endTransmission(); // stop transmitting 28 | 29 | x++; 30 | delay(500); 31 | } 32 | -------------------------------------------------------------------------------- /libraries/Wire/examples/secondary_receiver/secondary_receiver.ino: -------------------------------------------------------------------------------- 1 | // Wire Secondary Receiver 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Receives data as an I2C/TWI secondary device 6 | // Refer to the "Wire Main Writer" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(4); // join i2c bus with address #4 18 | Wire.onReceive(receiveEvent); // register event 19 | Serial.begin(9600); // start serial for output 20 | while ( !Serial ) delay(10); // for nrf52840 with native usb 21 | } 22 | 23 | void loop() 24 | { 25 | delay(100); 26 | } 27 | 28 | // function that executes whenever data is received from main 29 | // this function is registered as an event, see setup() 30 | void receiveEvent(int howMany) 31 | { 32 | while(1 < Wire.available()) // loop through all but the last 33 | { 34 | char c = Wire.read(); // receive byte as a character 35 | Serial.print(c); // print the character 36 | } 37 | int x = Wire.read(); // receive byte as an integer 38 | Serial.println(x); // print the integer 39 | } 40 | -------------------------------------------------------------------------------- /libraries/Wire/examples/secondary_sender/secondary_sender.ino: -------------------------------------------------------------------------------- 1 | // Wire Secondary Sender 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Sends data as an I2C/TWI secondary device 6 | // Refer to the "Wire Main Reader" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(2); // join i2c bus with address #2 18 | Wire.onRequest(requestEvent); // register event 19 | } 20 | 21 | void loop() 22 | { 23 | delay(100); 24 | } 25 | 26 | // function that executes whenever data is requested by main 27 | // this function is registered as an event, see setup() 28 | void requestEvent() 29 | { 30 | Wire.write("hello "); // respond with message of 6 bytes 31 | // as expected by main 32 | } 33 | -------------------------------------------------------------------------------- /libraries/Wire/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Wire 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ####################################### 10 | # Methods and Functions (KEYWORD2) 11 | ####################################### 12 | 13 | begin KEYWORD2 14 | beginTransmission KEYWORD2 15 | endTransmission KEYWORD2 16 | requestFrom KEYWORD2 17 | onReceive KEYWORD2 18 | onRequest KEYWORD2 19 | 20 | ####################################### 21 | # Instances (KEYWORD2) 22 | ####################################### 23 | 24 | Wire KEYWORD2 25 | Wire1 KEYWORD2 26 | 27 | ####################################### 28 | # Constants (LITERAL1) 29 | ####################################### 30 | 31 | -------------------------------------------------------------------------------- /libraries/Wire/library.properties: -------------------------------------------------------------------------------- 1 | name=Wire 2 | version=1.0 3 | author= 4 | maintainer= 5 | sentence=Allows the communication between devices or sensors connected via Two Wire Interface Bus. Specific implementation for nRF52. 6 | paragraph= 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/Wire 9 | architectures=* 10 | -------------------------------------------------------------------------------- /programmers.txt: -------------------------------------------------------------------------------- 1 | #********************************************** 2 | # Jlink with nrfjprog 3 | #********************************************** 4 | nrfjprog.name=J-Link for Bluefruit nRF52 5 | nrfjprog.program.tool=bootburn 6 | nrfjprog.program.cmd={runtime.tools.nrfjprog.path}/nrfjprog 7 | nrfjprog.program.cmd.windows={runtime.tools.nrfjprog.path}/nrfjprog.exe 8 | 9 | # Use nrfjprog in PATH 10 | #nrfjprog.program.cmd=nrfjprog 11 | #nrfjprog.program.cmd.windows=nrfjprog.exe 12 | 13 | # Burn bootloader pattern 14 | nrfjprog.program.burn_pattern="{program.cmd}" --program "{bootloader.file}.hex" -f nrf52 --chiperase --reset 15 | 16 | # Jlink to upload sketch 17 | nrfjprog.program.params.quiet= 18 | nrfjprog.program.params.verbose= 19 | nrfjprog.program.pattern="{program.cmd}" --reset --program "{build.path}/{build.project_name}.hex" --sectorerase -f nrf52 20 | 21 | # nrfjprog --erasepage {upload.BOOT_SETTING_ADDR} -f nrf52 && nrfjprog --memwr {upload.BOOT_SETTING_ADDR} --val 0x00000001 -f nrf52 && nrfjprog --reset -f nrf52 22 | # tools.nrfutil.upload.BOOT_SETTING_ADDR=0xFF000 23 | 24 | #********************************************** 25 | # adafruit-nrfutil 26 | #********************************************** 27 | nrfutil_boot.name=Bootloader DFU for Bluefruit nRF52 28 | nrfutil_boot.program.tool=bootburn 29 | nrfutil_boot.program.cmd=adafruit-nrfutil 30 | nrfutil_boot.program.cmd.windows={runtime.platform.path}/tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe 31 | nrfutil_boot.program.cmd.macosx={runtime.platform.path}/tools/adafruit-nrfutil/macos/adafruit-nrfutil 32 | 33 | # Burn bootloader pattern 34 | nrfutil_boot.program.burn_pattern="{program.cmd}" --verbose dfu serial -pkg "{bootloader.file}.zip" -p {serial.port} -b 115200 --touch 1200 35 | 36 | # Remind user to select Jlink when used to upload sketch 37 | nrfutil_boot.program.params.quiet= 38 | nrfutil_boot.program.params.verbose= 39 | nrfutil_boot.program.pattern=echo Please select as programmer 40 | -------------------------------------------------------------------------------- /scripts/jlink/debug_custom.json: -------------------------------------------------------------------------------- 1 | { 2 | "servertype": "jlink", 3 | "device": "nrf52840_xxaa", 4 | "interface": "SWD", 5 | "serverpath": "JLinkGDBServer" 6 | } 7 | -------------------------------------------------------------------------------- /scripts/openocd/daplink_nrf52.cfg: -------------------------------------------------------------------------------- 1 | source [find interface/cmsis-dap.cfg] 2 | transport select swd 3 | source [find target/nrf52.cfg] 4 | -------------------------------------------------------------------------------- /scripts/openocd/jlink_nrf52.cfg: -------------------------------------------------------------------------------- 1 | source [find interface/jlink.cfg] 2 | transport select swd 3 | source [find target/nrf52.cfg] 4 | -------------------------------------------------------------------------------- /tools/adafruit-nrfutil/macos/adafruit-nrfutil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/tools/adafruit-nrfutil/macos/adafruit-nrfutil -------------------------------------------------------------------------------- /tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adafruit/Adafruit_nRF52_Arduino/ba4ad90d7e90c2ad5d4c98c10539f1f77fafa6ab/tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe -------------------------------------------------------------------------------- /tools/midi_tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "midi-test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "async": "^2.0.0-rc.2", 13 | "inquirer": "^3.0.5", 14 | "midi": "^0.9.4", 15 | "multi-progress": "^2.0.0" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tools/midi_tests/rx.js: -------------------------------------------------------------------------------- 1 | var midi = require('midi'), 2 | async = require('async'), 3 | inquirer = require('inquirer'), 4 | progress = require('multi-progress')(process.stdout), 5 | output = new midi.output(), 6 | speed = 100, 7 | portNames = []; 8 | 9 | for(var i=0; i < output.getPortCount(); i++) { 10 | portNames.push(output.getPortName(i)); 11 | } 12 | 13 | if(! portNames.length) { 14 | console.error('no MIDI ports available'); 15 | process.exit(1); 16 | } 17 | 18 | inquirer.prompt([ 19 | { 20 | type: 'input', 21 | name: 'speed', 22 | message: 'Send interval (ms)', 23 | default: speed 24 | }, 25 | { 26 | type: 'list', 27 | name: 'port', 28 | message: 'Select port', 29 | choices: portNames 30 | } 31 | ]).then(answers => { 32 | output.openPort(portNames.indexOf(answers.port)); 33 | speed = parseInt(answers.speed); 34 | startTest(); 35 | }); 36 | 37 | function startTest() { 38 | 39 | var on_bar = progress.newBar('note on [:bar] :current/:total', { 40 | incomplete: ' ', 41 | total: 128 42 | }); 43 | 44 | var off_bar = progress.newBar('note off [:bar] :current/:total', { 45 | incomplete: ' ', 46 | total: 128 47 | }); 48 | 49 | async.timesSeries(128, function(n, next){ 50 | 51 | setTimeout(function() { 52 | on_bar.tick(); 53 | output.sendMessage([0x90, n, 0x7F]); 54 | next(); 55 | }, speed); 56 | 57 | }, function() {}); 58 | 59 | async.timesSeries(128, function(n, next){ 60 | 61 | setTimeout(function() { 62 | off_bar.tick(); 63 | output.sendMessage([0x90, n, 0x00]); 64 | next(); 65 | }, speed); 66 | 67 | }, function() {}); 68 | 69 | } 70 | -------------------------------------------------------------------------------- /tools/midi_tests/tx.js: -------------------------------------------------------------------------------- 1 | var midi = require('midi'), 2 | async = require('async'), 3 | inquirer = require('inquirer'), 4 | progress = require('multi-progress'), 5 | input = new midi.input(), 6 | multi = new progress(), 7 | portNames = []; 8 | 9 | for(var i=0; i < input.getPortCount(); i++) { 10 | portNames.push(input.getPortName(i)); 11 | } 12 | 13 | inquirer.prompt([ 14 | { 15 | type: 'list', 16 | name: 'port', 17 | message: 'Select port', 18 | choices: portNames 19 | } 20 | ]).then((answers) => { 21 | input.openPort(portNames.indexOf(answers.port)); 22 | startTest(); 23 | }); 24 | 25 | function startTest() { 26 | 27 | var on_bar = multi.newBar('note on [:bar] :current/:total', { 28 | incomplete: ' ', 29 | total: 128 30 | }); 31 | 32 | var off_bar = multi.newBar('note off [:bar] :current/:total', { 33 | incomplete: ' ', 34 | total: 128, 35 | callback: function() { 36 | input.closePort(); 37 | process.exit(); 38 | } 39 | }); 40 | 41 | input.on('message', function(deltaTime, message) { 42 | if(message[0] != 144 && message[0] != 128) return; 43 | if(message[2] == 0) off_bar.tick(); 44 | if(message[2] == 100) on_bar.tick(); 45 | }); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /tools/uf2conv/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Microsoft UF2 2 | 3 | The MIT License (MIT) 4 | 5 | Copyright (c) Microsoft Corporation 6 | 7 | All rights reserved. 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in all 17 | copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 | SOFTWARE. 26 | -------------------------------------------------------------------------------- /tools/update_bootloader.py: -------------------------------------------------------------------------------- 1 | import os 2 | import urllib.request 3 | from multiprocessing import Pool 4 | 5 | 6 | # Detect version in platform.txt 7 | version = '' 8 | with open('platform.txt') as pf: 9 | platform_txt = pf.read() 10 | e = '{build.variant}_bootloader-' 11 | v1 = platform_txt.index(e) + len(e) 12 | v2 = platform_txt.index('_', v1) 13 | version = platform_txt[v1:v2] 14 | 15 | print(f'version {version}') 16 | 17 | 18 | def get_sd(name): 19 | if '52832' in name: 20 | return 's132_6.1.1' 21 | elif '52833' in name or name == 'pca10100': 22 | return 's140_7.3.0' 23 | else: 24 | # most of the board is 52840 25 | return 's140_6.1.1' 26 | 27 | 28 | # Download a variant's bootloader 29 | def download_variant(variant): 30 | sd = get_sd(variant) 31 | 32 | # Download from bootloader release 33 | f_zip = f'{variant}_bootloader-{version}_{sd}.zip' 34 | f_hex = f'{variant}_bootloader-{version}_{sd}.hex' 35 | f_uf2 = f'update-{variant}_bootloader-{version}_nosd.uf2' 36 | url_prefix = f'https://github.com/adafruit/Adafruit_nRF52_Bootloader/releases/download/{version}/' 37 | 38 | # remove existing bootloader files 39 | if os.path.exists(f'bootloader/{variant}'): 40 | for item in os.listdir(f'bootloader/{variant}'): 41 | os.remove(os.path.join(f'bootloader/{variant}', item)) 42 | else: 43 | os.makedirs(f'bootloader/{variant}') 44 | 45 | print(f"Downloading {f_zip}") 46 | urllib.request.urlretrieve(url_prefix + f_zip, f'bootloader/{variant}/{f_zip}') 47 | 48 | print(f"Downloading {f_hex}") 49 | urllib.request.urlretrieve(url_prefix + f_hex, f'bootloader/{variant}/{f_hex}') 50 | 51 | if 's132' not in sd: 52 | print(f"Downloading {f_uf2}") 53 | urllib.request.urlretrieve(url_prefix + f_uf2, f'bootloader/{variant}/{f_uf2}') 54 | 55 | 56 | if __name__ == "__main__": 57 | # Get all variants 58 | all_variant = [] 59 | for entry in os.scandir("variants"): 60 | if entry.is_dir(): 61 | all_variant.append(entry.name) 62 | all_variant.sort() 63 | 64 | with Pool() as p: 65 | p.map(download_variant, all_variant) 66 | -------------------------------------------------------------------------------- /variants/feather_nrf52832/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 | const uint32_t g_ADigitalPinMap[] = { 28 | // D0 - D7 29 | 0, // xtal 1 30 | 1, // xtal 2 31 | 2, // a0 32 | 3, // a1 33 | 4, // a2 34 | 5, // a3 35 | 6, // TXD 36 | 7, // GPIO #7 37 | 38 | // D8 - D13 39 | 8, // RXD 40 | 41 | 9, // NFC1 42 | 10, // NFC2 43 | 44 | 11, // GPIO11 45 | 46 | 12, // SCK 47 | 13, // MOSI 48 | 14, // MISO 49 | 50 | 15, // GPIO #15 51 | 16, // GPIO #16 52 | 53 | // function set pins 54 | 17, // LED #1 (red) 55 | 18, // SWO 56 | 19, // LED #2 (blue) 57 | 20, // DFU 58 | 21, // Reset 59 | 22, // Factory Reset 60 | 23, // N/A 61 | 24, // N/A 62 | 63 | 25, // SDA 64 | 26, // SCL 65 | 27, // GPIO #27 66 | 28, // A4 67 | 29, // A5 68 | 30, // A6 69 | 31, // A7 70 | }; 71 | 72 | void initVariant() 73 | { 74 | // LED1 & LED2 75 | pinMode(PIN_LED1, OUTPUT); 76 | ledOff(PIN_LED1); 77 | 78 | pinMode(PIN_LED2, OUTPUT); 79 | ledOff(PIN_LED2); 80 | } 81 | 82 | -------------------------------------------------------------------------------- /variants/pca10056/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 | }; 38 | 39 | 40 | void initVariant() 41 | { 42 | // init all 4 onboard LEDs 43 | pinMode(PIN_LED1, OUTPUT); 44 | ledOff(PIN_LED1); 45 | 46 | pinMode(PIN_LED2, OUTPUT); 47 | ledOff(PIN_LED2); 48 | 49 | pinMode(PIN_LED3, OUTPUT); 50 | ledOff(PIN_LED3); 51 | 52 | pinMode(PIN_LED4, OUTPUT); 53 | ledOff(PIN_LED4); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /variants/pca10100/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 | }; 38 | 39 | 40 | void initVariant() 41 | { 42 | // init all 4 onboard LEDs 43 | pinMode(PIN_LED1, OUTPUT); 44 | ledOff(PIN_LED1); 45 | 46 | pinMode(PIN_LED2, OUTPUT); 47 | ledOff(PIN_LED2); 48 | 49 | pinMode(PIN_LED3, OUTPUT); 50 | ledOff(PIN_LED3); 51 | 52 | pinMode(PIN_LED4, OUTPUT); 53 | ledOff(PIN_LED4); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /variants/raytac_mdbt50q_rx/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 | const uint32_t g_ADigitalPinMap[] = 28 | { 29 | // D0 .. D13 30 | 45, // D0 is P1.13 (LED1) 31 | 43, // D1 is P1.11 (LED2) 32 | 15, // D2 is P0.15 (Button) 33 | }; 34 | 35 | void initVariant() 36 | { 37 | // LED1 & LED2 38 | pinMode(PIN_LED1, OUTPUT); 39 | ledOff(PIN_LED1); 40 | 41 | pinMode(PIN_LED2, OUTPUT); 42 | ledOff(PIN_LED2); 43 | } 44 | 45 | --------------------------------------------------------------------------------