├── .gitignore ├── .gitmodules ├── .vscode ├── c_cpp_properties.json └── settings.json ├── CHANGELOG.md ├── CMakeLists.txt ├── LICENSE ├── README.md ├── SECURITY.md ├── cmake ├── binutils-arm-none-eabi.cmake ├── gdb-helper.cmake ├── launch.json.in ├── openocd-run.gdb.in ├── samr34.cmake ├── stlink-run.gdb.in ├── stm32l0.cmake ├── stm32l1.cmake ├── stm32l4.cmake └── toolchain-arm-none-eabi.cmake ├── doc ├── ATECC608A-TNGLORA.md ├── NAMote72-platform.md ├── NucleoLxxx-platform.md ├── SAMR34-platform.md ├── SKiM88xx-platform.md ├── SX1276-Wing-Board-(03-91016-RA).pdf ├── development-environment.md └── images │ ├── vscode-cmake-build.png │ └── vscode-cmake-configure.png └── src ├── CMakeLists.txt ├── apps ├── LoRaMac │ ├── CMakeLists.txt │ ├── common │ │ ├── CayenneLpp.c │ │ ├── CayenneLpp.h │ │ ├── Commissioning.h │ │ ├── LmHandler │ │ │ ├── LmHandler.c │ │ │ ├── LmHandler.h │ │ │ ├── LmHandlerTypes.h │ │ │ └── packages │ │ │ │ ├── FragDecoder.c │ │ │ │ ├── FragDecoder.h │ │ │ │ ├── LmhPackage.h │ │ │ │ ├── LmhpClockSync.c │ │ │ │ ├── LmhpClockSync.h │ │ │ │ ├── LmhpCompliance.c │ │ │ │ ├── LmhpCompliance.h │ │ │ │ ├── LmhpFragmentation.c │ │ │ │ ├── LmhpFragmentation.h │ │ │ │ ├── LmhpRemoteMcastSetup.c │ │ │ │ └── LmhpRemoteMcastSetup.h │ │ ├── LmHandlerMsgDisplay.c │ │ ├── LmHandlerMsgDisplay.h │ │ ├── NvmDataMgmt.c │ │ ├── NvmDataMgmt.h │ │ ├── cli.c │ │ ├── cli.h │ │ └── githubVersion.h │ ├── fuota-test-01 │ │ ├── B-L072Z-LRWAN1 │ │ │ └── main.c │ │ ├── NAMote72 │ │ │ └── main.c │ │ ├── NucleoL073 │ │ │ └── main.c │ │ ├── NucleoL152 │ │ │ └── main.c │ │ ├── NucleoL476 │ │ │ └── main.c │ │ ├── SAMR34 │ │ │ └── main.c │ │ ├── SKiM880B │ │ │ └── main.c │ │ ├── SKiM881AXL │ │ │ └── main.c │ │ ├── SKiM980A │ │ │ └── main.c │ │ ├── firmwareVersion.h │ │ └── readme.md │ └── periodic-uplink-lpp │ │ ├── B-L072Z-LRWAN1 │ │ └── main.c │ │ ├── NAMote72 │ │ └── main.c │ │ ├── NucleoL073 │ │ └── main.c │ │ ├── NucleoL152 │ │ └── main.c │ │ ├── NucleoL476 │ │ └── main.c │ │ ├── SAMR34 │ │ └── main.c │ │ ├── SKiM880B │ │ └── main.c │ │ ├── SKiM881AXL │ │ └── main.c │ │ ├── SKiM980A │ │ └── main.c │ │ └── firmwareVersion.h ├── ping-pong │ ├── B-L072Z-LRWAN1 │ │ └── main.c │ ├── CMakeLists.txt │ ├── NAMote72 │ │ └── main.c │ ├── NucleoL073 │ │ └── main.c │ ├── NucleoL152 │ │ └── main.c │ ├── NucleoL476 │ │ └── main.c │ ├── SAMR34 │ │ └── main.c │ ├── SKiM880B │ │ └── main.c │ ├── SKiM881AXL │ │ └── main.c │ └── SKiM980A │ │ └── main.c ├── rx-sensi │ ├── B-L072Z-LRWAN1 │ │ └── main.c │ ├── CMakeLists.txt │ ├── NAMote72 │ │ └── main.c │ ├── NucleoL073 │ │ └── main.c │ ├── NucleoL152 │ │ └── main.c │ ├── NucleoL476 │ │ └── main.c │ ├── SAMR34 │ │ └── main.c │ ├── SKiM880B │ │ └── main.c │ ├── SKiM881AXL │ │ └── main.c │ └── SKiM980A │ │ └── main.c └── tx-cw │ ├── B-L072Z-LRWAN1 │ └── main.c │ ├── CMakeLists.txt │ ├── NAMote72 │ └── main.c │ ├── NucleoL073 │ └── main.c │ ├── NucleoL152 │ └── main.c │ ├── NucleoL476 │ └── main.c │ ├── SAMR34 │ └── main.c │ ├── SKiM880B │ └── main.c │ ├── SKiM881AXL │ └── main.c │ └── SKiM980A │ └── main.c ├── boards ├── B-L072Z-LRWAN1 │ ├── CMakeLists.txt │ ├── adc-board.c │ ├── board-config.h │ ├── board.c │ ├── cmsis │ │ ├── arm-gcc │ │ │ ├── startup_stm32l072xx.s │ │ │ └── stm32l072xx_flash.ld │ │ ├── arm-std │ │ │ └── startup_stm32l072xx.s │ │ ├── mxconstants.h │ │ ├── stm32l072xx.h │ │ ├── stm32l0xx.h │ │ ├── stm32l0xx_hal_conf.h │ │ ├── system_stm32l0xx.c │ │ └── system_stm32l0xx.h │ ├── delay-board.c │ ├── eeprom-board.c │ ├── gpio-board.c │ ├── i2c-board.c │ ├── lpm-board.c │ ├── rtc-board.c │ ├── spi-board.c │ ├── sx1276-board.c │ ├── sysIrqHandlers.c │ ├── sysIrqHandlers.h │ └── uart-board.c ├── CMakeLists.txt ├── NAMote72 │ ├── CMakeLists.txt │ ├── adc-board.c │ ├── board-config.h │ ├── board.c │ ├── cmsis │ │ ├── arm-gcc │ │ │ ├── startup_stm32l152xc.s │ │ │ └── stm32l152xc_flash.ld │ │ ├── arm-std │ │ │ └── startup_stm32l152xc.s │ │ ├── mxconstants.h │ │ ├── stm32l152xc.h │ │ ├── stm32l1xx.h │ │ ├── stm32l1xx_hal_conf.h │ │ ├── system_stm32l1xx.c │ │ └── system_stm32l1xx.h │ ├── delay-board.c │ ├── eeprom-board.c │ ├── gpio-board.c │ ├── gps-board.c │ ├── i2c-board.c │ ├── lpm-board.c │ ├── rtc-board.c │ ├── spi-board.c │ ├── sx1272-board.c │ ├── sysIrqHandlers.c │ ├── sysIrqHandlers.h │ └── uart-board.c ├── NucleoL073 │ ├── CMakeLists.txt │ ├── adc-board.c │ ├── board-config.h │ ├── board.c │ ├── cmsis │ │ ├── arm-gcc │ │ │ ├── startup_stm32l073xx.s │ │ │ └── stm32l073xx_flash.ld │ │ ├── arm-std │ │ │ └── startup_stm32l073xx.s │ │ ├── mxconstants.h │ │ ├── stm32l073xx.h │ │ ├── stm32l0xx.h │ │ ├── stm32l0xx_hal_conf.h │ │ ├── system_stm32l0xx.c │ │ └── system_stm32l0xx.h │ ├── delay-board.c │ ├── eeprom-board.c │ ├── gpio-board.c │ ├── i2c-board.c │ ├── lpm-board.c │ ├── lr1110mb1xxs-board.c │ ├── rtc-board.c │ ├── spi-board.c │ ├── sx1261mbxbas-board.c │ ├── sx1262mbxcas-board.c │ ├── sx1262mbxdas-board.c │ ├── sx1272mb2das-board.c │ ├── sx1276mb1las-board.c │ ├── sx1276mb1mas-board.c │ ├── sysIrqHandlers.c │ ├── sysIrqHandlers.h │ └── uart-board.c ├── NucleoL152 │ ├── CMakeLists.txt │ ├── adc-board.c │ ├── board-config.h │ ├── board.c │ ├── cmsis │ │ ├── arm-gcc │ │ │ ├── startup_stm32l152xe.s │ │ │ └── stm32l152xe_flash.ld │ │ ├── arm-std │ │ │ └── startup_stm32l152xe.s │ │ ├── mxconstants.h │ │ ├── stm32l152xe.h │ │ ├── stm32l1xx.h │ │ ├── stm32l1xx_hal_conf.h │ │ ├── system_stm32l1xx.c │ │ └── system_stm32l1xx.h │ ├── delay-board.c │ ├── eeprom-board.c │ ├── gpio-board.c │ ├── i2c-board.c │ ├── lpm-board.c │ ├── lr1110mb1xxs-board.c │ ├── rtc-board.c │ ├── spi-board.c │ ├── sx1261mbxbas-board.c │ ├── sx1262mbxcas-board.c │ ├── sx1262mbxdas-board.c │ ├── sx1272mb2das-board.c │ ├── sx1276mb1las-board.c │ ├── sx1276mb1mas-board.c │ ├── sysIrqHandlers.c │ ├── sysIrqHandlers.h │ └── uart-board.c ├── NucleoL476 │ ├── CMakeLists.txt │ ├── adc-board.c │ ├── board-config.h │ ├── board.c │ ├── cmsis │ │ ├── arm-gcc │ │ │ ├── startup_stm32l476xx.s │ │ │ └── stm32l476rgtx_flash.ld │ │ ├── arm-std │ │ │ └── startup_stm32l476xx.s │ │ ├── mxconstants.h │ │ ├── stm32l476xx.h │ │ ├── stm32l4xx.h │ │ ├── stm32l4xx_hal_conf.h │ │ ├── system_stm32l4xx.c │ │ └── system_stm32l4xx.h │ ├── delay-board.c │ ├── eeprom-board.c │ ├── eeprom_emul_conf.h │ ├── gpio-board.c │ ├── i2c-board.c │ ├── lpm-board.c │ ├── lr1110mb1xxs-board.c │ ├── rtc-board.c │ ├── spi-board.c │ ├── sx1261mbxbas-board.c │ ├── sx1262mbxcas-board.c │ ├── sx1262mbxdas-board.c │ ├── sx1272mb2das-board.c │ ├── sx1276mb1las-board.c │ ├── sx1276mb1mas-board.c │ ├── sysIrqHandlers.c │ ├── sysIrqHandlers.h │ └── uart-board.c ├── SAMR34 │ ├── CMakeLists.txt │ ├── board-config.h │ ├── board.c │ ├── delay-board.c │ ├── eeprom-board.c │ ├── gpio-board.c │ ├── i2c-board.c │ ├── rtc-board.c │ ├── spi-board.c │ ├── sx1276-board.c │ └── uart-board.c ├── SKiM880B │ ├── CMakeLists.txt │ ├── adc-board.c │ ├── board-config.h │ ├── board.c │ ├── cmsis │ │ ├── arm-gcc │ │ │ ├── startup_stm32l151xba.s │ │ │ └── stm32l151xba_flash.ld │ │ ├── arm-std │ │ │ └── startup_stm32l151xba.s │ │ ├── mxconstants.h │ │ ├── stm32l151xba.h │ │ ├── stm32l1xx.h │ │ ├── stm32l1xx_hal_conf.h │ │ ├── system_stm32l1xx.c │ │ └── system_stm32l1xx.h │ ├── delay-board.c │ ├── eeprom-board.c │ ├── gpio-board.c │ ├── lpm-board.c │ ├── rtc-board.c │ ├── spi-board.c │ ├── sx1272-board.c │ ├── sysIrqHandlers.c │ ├── sysIrqHandlers.h │ └── uart-board.c ├── SKiM881AXL │ ├── CMakeLists.txt │ ├── adc-board.c │ ├── board-config.h │ ├── board.c │ ├── cmsis │ │ ├── arm-gcc │ │ │ ├── startup_stm32l081xx.s │ │ │ └── stm32l081xx_flash.ld │ │ ├── arm-std │ │ │ └── startup_stm32l081xx.s │ │ ├── mxconstants.h │ │ ├── stm32l081xx.h │ │ ├── stm32l0xx.h │ │ ├── stm32l0xx_hal_conf.h │ │ ├── system_stm32l0xx.c │ │ └── system_stm32l0xx.h │ ├── delay-board.c │ ├── eeprom-board.c │ ├── gpio-board.c │ ├── lpm-board.c │ ├── rtc-board.c │ ├── spi-board.c │ ├── sx1272-board.c │ ├── sysIrqHandlers.c │ ├── sysIrqHandlers.h │ └── uart-board.c ├── SKiM980A │ ├── CMakeLists.txt │ ├── adc-board.c │ ├── board-config.h │ ├── board.c │ ├── cmsis │ │ ├── arm-gcc │ │ │ ├── startup_stm32l151xba.s │ │ │ └── stm32l151xba_flash.ld │ │ ├── arm-std │ │ │ └── startup_stm32l151xba.s │ │ ├── mxconstants.h │ │ ├── stm32l151xba.h │ │ ├── stm32l1xx.h │ │ ├── stm32l1xx_hal_conf.h │ │ ├── system_stm32l1xx.c │ │ └── system_stm32l1xx.h │ ├── delay-board.c │ ├── eeprom-board.c │ ├── gpio-board.c │ ├── lpm-board.c │ ├── rtc-board.c │ ├── spi-board.c │ ├── sx1272-board.c │ ├── sysIrqHandlers.c │ ├── sysIrqHandlers.h │ └── uart-board.c ├── adc-board.h ├── board.h ├── delay-board.h ├── display-board.h ├── eeprom-board.h ├── gpio-board.h ├── gps-board.h ├── i2c-board.h ├── lpm-board.h ├── lr1110-board.h ├── mcu │ ├── saml21 │ │ ├── cmsis │ │ │ ├── arm_common_tables.h │ │ │ ├── arm_const_structs.h │ │ │ ├── arm_math.h │ │ │ ├── core_cm0.h │ │ │ ├── core_cm0plus.h │ │ │ ├── core_cm3.h │ │ │ ├── core_cm4.h │ │ │ ├── core_cm7.h │ │ │ ├── core_cmFunc.h │ │ │ ├── core_cmInstr.h │ │ │ ├── core_cmSimd.h │ │ │ ├── core_sc000.h │ │ │ └── core_sc300.h │ │ ├── config │ │ │ ├── RTE_Components.h │ │ │ ├── hpl_dmac_config.h │ │ │ ├── hpl_eic_config.h │ │ │ ├── hpl_gclk_config.h │ │ │ ├── hpl_mclk_config.h │ │ │ ├── hpl_osc32kctrl_config.h │ │ │ ├── hpl_oscctrl_config.h │ │ │ ├── hpl_rtc_config.h │ │ │ ├── hpl_sercom_config.h │ │ │ ├── hpl_systick_config.h │ │ │ └── peripheral_clk_config.h │ │ ├── hal │ │ │ ├── documentation │ │ │ │ ├── ext_irq.rst │ │ │ │ ├── spi_master_sync.rst │ │ │ │ ├── timer.rst │ │ │ │ └── usart_sync.rst │ │ │ ├── include │ │ │ │ ├── hal_atomic.h │ │ │ │ ├── hal_delay.h │ │ │ │ ├── hal_ext_irq.h │ │ │ │ ├── hal_gpio.h │ │ │ │ ├── hal_i2c_m_sync.h │ │ │ │ ├── hal_init.h │ │ │ │ ├── hal_io.h │ │ │ │ ├── hal_sleep.h │ │ │ │ ├── hal_spi_m_sync.h │ │ │ │ ├── hal_timer.h │ │ │ │ ├── hal_usart_sync.h │ │ │ │ ├── hpl_calendar.h │ │ │ │ ├── hpl_core.h │ │ │ │ ├── hpl_delay.h │ │ │ │ ├── hpl_dma.h │ │ │ │ ├── hpl_ext_irq.h │ │ │ │ ├── hpl_gpio.h │ │ │ │ ├── hpl_i2c_m_async.h │ │ │ │ ├── hpl_i2c_m_sync.h │ │ │ │ ├── hpl_i2c_s_async.h │ │ │ │ ├── hpl_i2c_s_sync.h │ │ │ │ ├── hpl_init.h │ │ │ │ ├── hpl_irq.h │ │ │ │ ├── hpl_missing_features.h │ │ │ │ ├── hpl_reset.h │ │ │ │ ├── hpl_sleep.h │ │ │ │ ├── hpl_spi.h │ │ │ │ ├── hpl_spi_async.h │ │ │ │ ├── hpl_spi_dma.h │ │ │ │ ├── hpl_spi_m_async.h │ │ │ │ ├── hpl_spi_m_dma.h │ │ │ │ ├── hpl_spi_m_sync.h │ │ │ │ ├── hpl_spi_s_async.h │ │ │ │ ├── hpl_spi_s_sync.h │ │ │ │ ├── hpl_spi_sync.h │ │ │ │ ├── hpl_time_measure.h │ │ │ │ ├── hpl_timer.h │ │ │ │ ├── hpl_usart.h │ │ │ │ ├── hpl_usart_async.h │ │ │ │ └── hpl_usart_sync.h │ │ │ ├── src │ │ │ │ ├── hal_atomic.c │ │ │ │ ├── hal_delay.c │ │ │ │ ├── hal_ext_irq.c │ │ │ │ ├── hal_gpio.c │ │ │ │ ├── hal_i2c_m_sync.c │ │ │ │ ├── hal_init.c │ │ │ │ ├── hal_io.c │ │ │ │ ├── hal_sleep.c │ │ │ │ ├── hal_spi_m_sync.c │ │ │ │ ├── hal_timer.c │ │ │ │ └── hal_usart_sync.c │ │ │ └── utils │ │ │ │ ├── include │ │ │ │ ├── compiler.h │ │ │ │ ├── err_codes.h │ │ │ │ ├── events.h │ │ │ │ ├── parts.h │ │ │ │ ├── utils.h │ │ │ │ ├── utils_assert.h │ │ │ │ ├── utils_decrement_macro.h │ │ │ │ ├── utils_event.h │ │ │ │ ├── utils_increment_macro.h │ │ │ │ ├── utils_list.h │ │ │ │ ├── utils_recursion_macro.h │ │ │ │ └── utils_repeat_macro.h │ │ │ │ └── src │ │ │ │ ├── utils_assert.c │ │ │ │ ├── utils_event.c │ │ │ │ ├── utils_list.c │ │ │ │ └── utils_syscalls.c │ │ ├── hpl │ │ │ ├── core │ │ │ │ ├── hpl_core_m0plus_base.c │ │ │ │ ├── hpl_core_port.h │ │ │ │ └── hpl_init.c │ │ │ ├── dmac │ │ │ │ └── hpl_dmac.c │ │ │ ├── eic │ │ │ │ └── hpl_eic.c │ │ │ ├── gclk │ │ │ │ ├── hpl_gclk.c │ │ │ │ └── hpl_gclk_base.h │ │ │ ├── mclk │ │ │ │ └── hpl_mclk.c │ │ │ ├── osc32kctrl │ │ │ │ └── hpl_osc32kctrl.c │ │ │ ├── oscctrl │ │ │ │ └── hpl_oscctrl.c │ │ │ ├── pm │ │ │ │ ├── hpl_pm.c │ │ │ │ └── hpl_pm_base.h │ │ │ ├── port │ │ │ │ └── hpl_gpio_base.h │ │ │ ├── rtc │ │ │ │ ├── hpl_rtc.c │ │ │ │ └── hpl_rtc_base.h │ │ │ ├── sercom │ │ │ │ └── hpl_sercom.c │ │ │ └── systick │ │ │ │ └── hpl_systick.c │ │ ├── hri │ │ │ ├── hri_ac_l21.h │ │ │ ├── hri_adc_l21.h │ │ │ ├── hri_aes_l21.h │ │ │ ├── hri_ccl_l21.h │ │ │ ├── hri_dac_l21.h │ │ │ ├── hri_dmac_l21.h │ │ │ ├── hri_dsu_l21.h │ │ │ ├── hri_eic_l21.h │ │ │ ├── hri_evsys_l21.h │ │ │ ├── hri_gclk_l21.h │ │ │ ├── hri_l21b.h │ │ │ ├── hri_mclk_l21.h │ │ │ ├── hri_mtb_l21.h │ │ │ ├── hri_nvic_l21.h │ │ │ ├── hri_nvmctrl_l21.h │ │ │ ├── hri_opamp_l21.h │ │ │ ├── hri_osc32kctrl_l21.h │ │ │ ├── hri_oscctrl_l21.h │ │ │ ├── hri_pac_l21.h │ │ │ ├── hri_pm_l21.h │ │ │ ├── hri_port_l21.h │ │ │ ├── hri_rstc_l21.h │ │ │ ├── hri_rtc_l21.h │ │ │ ├── hri_sercom_l21.h │ │ │ ├── hri_supc_l21.h │ │ │ ├── hri_systemcontrol_l21.h │ │ │ ├── hri_systick_l21.h │ │ │ ├── hri_tal_l21.h │ │ │ ├── hri_tc_l21.h │ │ │ ├── hri_tcc_l21.h │ │ │ ├── hri_trng_l21.h │ │ │ ├── hri_usb_l21.h │ │ │ └── hri_wdt_l21.h │ │ ├── hw_timer.c │ │ ├── hw_timer.h │ │ └── saml21b │ │ │ ├── gcc │ │ │ ├── gcc │ │ │ │ ├── saml21e15b_flash.ld │ │ │ │ ├── saml21e15b_sram.ld │ │ │ │ ├── saml21e16b_flash.ld │ │ │ │ ├── saml21e16b_sram.ld │ │ │ │ ├── saml21e17b_flash.ld │ │ │ │ ├── saml21e17b_sram.ld │ │ │ │ ├── saml21e18b_flash.ld │ │ │ │ ├── saml21e18b_sram.ld │ │ │ │ ├── saml21g16b_flash.ld │ │ │ │ ├── saml21g16b_sram.ld │ │ │ │ ├── saml21g17b_flash.ld │ │ │ │ ├── saml21g17b_sram.ld │ │ │ │ ├── saml21g18b_flash.ld │ │ │ │ ├── saml21g18b_sram.ld │ │ │ │ ├── saml21j16b_flash.ld │ │ │ │ ├── saml21j16b_sram.ld │ │ │ │ ├── saml21j17b_flash.ld │ │ │ │ ├── saml21j17b_sram.ld │ │ │ │ ├── saml21j18b_flash.ld │ │ │ │ ├── saml21j18b_sram.ld │ │ │ │ ├── saml21j18bu_flash.ld │ │ │ │ ├── saml21j18bu_sram.ld │ │ │ │ └── startup_saml21.c │ │ │ └── system_saml21.c │ │ │ └── include │ │ │ ├── component-version.h │ │ │ ├── component │ │ │ ├── ac.h │ │ │ ├── adc.h │ │ │ ├── aes.h │ │ │ ├── ccl.h │ │ │ ├── dac.h │ │ │ ├── dmac.h │ │ │ ├── dsu.h │ │ │ ├── eic.h │ │ │ ├── evsys.h │ │ │ ├── gclk.h │ │ │ ├── mclk.h │ │ │ ├── mtb.h │ │ │ ├── nvmctrl.h │ │ │ ├── opamp.h │ │ │ ├── osc32kctrl.h │ │ │ ├── oscctrl.h │ │ │ ├── pac.h │ │ │ ├── pm.h │ │ │ ├── port.h │ │ │ ├── rstc.h │ │ │ ├── rtc.h │ │ │ ├── sercom.h │ │ │ ├── supc.h │ │ │ ├── tal.h │ │ │ ├── tc.h │ │ │ ├── tcc.h │ │ │ ├── trng.h │ │ │ ├── usb.h │ │ │ └── wdt.h │ │ │ ├── instance │ │ │ ├── ac.h │ │ │ ├── adc.h │ │ │ ├── aes.h │ │ │ ├── ccl.h │ │ │ ├── dac.h │ │ │ ├── dmac.h │ │ │ ├── dsu.h │ │ │ ├── eic.h │ │ │ ├── evsys.h │ │ │ ├── gclk.h │ │ │ ├── mclk.h │ │ │ ├── mtb.h │ │ │ ├── nvmctrl.h │ │ │ ├── opamp.h │ │ │ ├── osc32kctrl.h │ │ │ ├── oscctrl.h │ │ │ ├── pac.h │ │ │ ├── pm.h │ │ │ ├── port.h │ │ │ ├── rstc.h │ │ │ ├── rtc.h │ │ │ ├── sercom0.h │ │ │ ├── sercom1.h │ │ │ ├── sercom2.h │ │ │ ├── sercom3.h │ │ │ ├── sercom4.h │ │ │ ├── sercom5.h │ │ │ ├── supc.h │ │ │ ├── tal.h │ │ │ ├── tc0.h │ │ │ ├── tc1.h │ │ │ ├── tc2.h │ │ │ ├── tc3.h │ │ │ ├── tc4.h │ │ │ ├── tcc0.h │ │ │ ├── tcc1.h │ │ │ ├── tcc2.h │ │ │ ├── trng.h │ │ │ ├── usb.h │ │ │ └── wdt.h │ │ │ ├── pio │ │ │ ├── saml21e15b.h │ │ │ ├── saml21e16b.h │ │ │ ├── saml21e17b.h │ │ │ ├── saml21e18b.h │ │ │ ├── saml21g16b.h │ │ │ ├── saml21g17b.h │ │ │ ├── saml21g18b.h │ │ │ ├── saml21j16b.h │ │ │ ├── saml21j17b.h │ │ │ ├── saml21j18b.h │ │ │ └── saml21j18bu.h │ │ │ ├── sam.h │ │ │ ├── saml21.h │ │ │ ├── saml21e15b.h │ │ │ ├── saml21e16b.h │ │ │ ├── saml21e17b.h │ │ │ ├── saml21e18b.h │ │ │ ├── saml21g16b.h │ │ │ ├── saml21g17b.h │ │ │ ├── saml21g18b.h │ │ │ ├── saml21j16b.h │ │ │ ├── saml21j17b.h │ │ │ ├── saml21j18b.h │ │ │ ├── saml21j18bu.h │ │ │ └── system_saml21.h │ ├── stm32 │ │ ├── EEPROM_Emul │ │ │ ├── Core │ │ │ │ ├── eeprom_emul.c │ │ │ │ ├── eeprom_emul.h │ │ │ │ ├── eeprom_emul_conf_template.h │ │ │ │ └── eeprom_emul_types.h │ │ │ └── Porting │ │ │ │ └── STM32L4 │ │ │ │ ├── flash_interface.c │ │ │ │ └── flash_interface.h │ │ ├── RTE_Components.h │ │ ├── STM32L0xx_HAL_Driver │ │ │ ├── Inc │ │ │ │ ├── Legacy │ │ │ │ │ └── stm32_hal_legacy.h │ │ │ │ ├── stm32_assert_template.h │ │ │ │ ├── stm32l0xx_hal.h │ │ │ │ ├── stm32l0xx_hal_adc.h │ │ │ │ ├── stm32l0xx_hal_adc_ex.h │ │ │ │ ├── stm32l0xx_hal_comp.h │ │ │ │ ├── stm32l0xx_hal_comp_ex.h │ │ │ │ ├── stm32l0xx_hal_conf_template.h │ │ │ │ ├── stm32l0xx_hal_cortex.h │ │ │ │ ├── stm32l0xx_hal_crc.h │ │ │ │ ├── stm32l0xx_hal_crc_ex.h │ │ │ │ ├── stm32l0xx_hal_cryp.h │ │ │ │ ├── stm32l0xx_hal_cryp_ex.h │ │ │ │ ├── stm32l0xx_hal_dac.h │ │ │ │ ├── stm32l0xx_hal_dac_ex.h │ │ │ │ ├── stm32l0xx_hal_def.h │ │ │ │ ├── stm32l0xx_hal_dma.h │ │ │ │ ├── stm32l0xx_hal_firewall.h │ │ │ │ ├── stm32l0xx_hal_flash.h │ │ │ │ ├── stm32l0xx_hal_flash_ex.h │ │ │ │ ├── stm32l0xx_hal_flash_ramfunc.h │ │ │ │ ├── stm32l0xx_hal_gpio.h │ │ │ │ ├── stm32l0xx_hal_gpio_ex.h │ │ │ │ ├── stm32l0xx_hal_i2c.h │ │ │ │ ├── stm32l0xx_hal_i2c_ex.h │ │ │ │ ├── stm32l0xx_hal_i2s.h │ │ │ │ ├── stm32l0xx_hal_irda.h │ │ │ │ ├── stm32l0xx_hal_irda_ex.h │ │ │ │ ├── stm32l0xx_hal_iwdg.h │ │ │ │ ├── stm32l0xx_hal_lcd.h │ │ │ │ ├── stm32l0xx_hal_lptim.h │ │ │ │ ├── stm32l0xx_hal_lptim_ex.h │ │ │ │ ├── stm32l0xx_hal_pcd.h │ │ │ │ ├── stm32l0xx_hal_pcd_ex.h │ │ │ │ ├── stm32l0xx_hal_pwr.h │ │ │ │ ├── stm32l0xx_hal_pwr_ex.h │ │ │ │ ├── stm32l0xx_hal_rcc.h │ │ │ │ ├── stm32l0xx_hal_rcc_ex.h │ │ │ │ ├── stm32l0xx_hal_rng.h │ │ │ │ ├── stm32l0xx_hal_rtc.h │ │ │ │ ├── stm32l0xx_hal_rtc_ex.h │ │ │ │ ├── stm32l0xx_hal_smartcard.h │ │ │ │ ├── stm32l0xx_hal_smartcard_ex.h │ │ │ │ ├── stm32l0xx_hal_smbus.h │ │ │ │ ├── stm32l0xx_hal_spi.h │ │ │ │ ├── stm32l0xx_hal_tim.h │ │ │ │ ├── stm32l0xx_hal_tim_ex.h │ │ │ │ ├── stm32l0xx_hal_tsc.h │ │ │ │ ├── stm32l0xx_hal_uart.h │ │ │ │ ├── stm32l0xx_hal_uart_ex.h │ │ │ │ ├── stm32l0xx_hal_usart.h │ │ │ │ ├── stm32l0xx_hal_usart_ex.h │ │ │ │ ├── stm32l0xx_hal_wwdg.h │ │ │ │ ├── stm32l0xx_ll_adc.h │ │ │ │ ├── stm32l0xx_ll_bus.h │ │ │ │ ├── stm32l0xx_ll_comp.h │ │ │ │ ├── stm32l0xx_ll_cortex.h │ │ │ │ ├── stm32l0xx_ll_crc.h │ │ │ │ ├── stm32l0xx_ll_crs.h │ │ │ │ ├── stm32l0xx_ll_dac.h │ │ │ │ ├── stm32l0xx_ll_dma.h │ │ │ │ ├── stm32l0xx_ll_exti.h │ │ │ │ ├── stm32l0xx_ll_gpio.h │ │ │ │ ├── stm32l0xx_ll_i2c.h │ │ │ │ ├── stm32l0xx_ll_iwdg.h │ │ │ │ ├── stm32l0xx_ll_lptim.h │ │ │ │ ├── stm32l0xx_ll_lpuart.h │ │ │ │ ├── stm32l0xx_ll_pwr.h │ │ │ │ ├── stm32l0xx_ll_rcc.h │ │ │ │ ├── stm32l0xx_ll_rng.h │ │ │ │ ├── stm32l0xx_ll_rtc.h │ │ │ │ ├── stm32l0xx_ll_spi.h │ │ │ │ ├── stm32l0xx_ll_system.h │ │ │ │ ├── stm32l0xx_ll_tim.h │ │ │ │ ├── stm32l0xx_ll_usart.h │ │ │ │ ├── stm32l0xx_ll_utils.h │ │ │ │ └── stm32l0xx_ll_wwdg.h │ │ │ └── Src │ │ │ │ ├── stm32l0xx_hal.c │ │ │ │ ├── stm32l0xx_hal_adc.c │ │ │ │ ├── stm32l0xx_hal_adc_ex.c │ │ │ │ ├── stm32l0xx_hal_comp.c │ │ │ │ ├── stm32l0xx_hal_comp_ex.c │ │ │ │ ├── stm32l0xx_hal_cortex.c │ │ │ │ ├── stm32l0xx_hal_crc.c │ │ │ │ ├── stm32l0xx_hal_crc_ex.c │ │ │ │ ├── stm32l0xx_hal_cryp.c │ │ │ │ ├── stm32l0xx_hal_cryp_ex.c │ │ │ │ ├── stm32l0xx_hal_dac.c │ │ │ │ ├── stm32l0xx_hal_dac_ex.c │ │ │ │ ├── stm32l0xx_hal_dma.c │ │ │ │ ├── stm32l0xx_hal_firewall.c │ │ │ │ ├── stm32l0xx_hal_flash.c │ │ │ │ ├── stm32l0xx_hal_flash_ex.c │ │ │ │ ├── stm32l0xx_hal_flash_ramfunc.c │ │ │ │ ├── stm32l0xx_hal_gpio.c │ │ │ │ ├── stm32l0xx_hal_i2c.c │ │ │ │ ├── stm32l0xx_hal_i2c_ex.c │ │ │ │ ├── stm32l0xx_hal_i2s.c │ │ │ │ ├── stm32l0xx_hal_irda.c │ │ │ │ ├── stm32l0xx_hal_iwdg.c │ │ │ │ ├── stm32l0xx_hal_lcd.c │ │ │ │ ├── stm32l0xx_hal_lptim.c │ │ │ │ ├── stm32l0xx_hal_msp_template.c │ │ │ │ ├── stm32l0xx_hal_pcd.c │ │ │ │ ├── stm32l0xx_hal_pcd_ex.c │ │ │ │ ├── stm32l0xx_hal_pwr.c │ │ │ │ ├── stm32l0xx_hal_pwr_ex.c │ │ │ │ ├── stm32l0xx_hal_rcc.c │ │ │ │ ├── stm32l0xx_hal_rcc_ex.c │ │ │ │ ├── stm32l0xx_hal_rng.c │ │ │ │ ├── stm32l0xx_hal_rtc.c │ │ │ │ ├── stm32l0xx_hal_rtc_ex.c │ │ │ │ ├── stm32l0xx_hal_smartcard.c │ │ │ │ ├── stm32l0xx_hal_smartcard_ex.c │ │ │ │ ├── stm32l0xx_hal_smbus.c │ │ │ │ ├── stm32l0xx_hal_spi.c │ │ │ │ ├── stm32l0xx_hal_tim.c │ │ │ │ ├── stm32l0xx_hal_tim_ex.c │ │ │ │ ├── stm32l0xx_hal_tsc.c │ │ │ │ ├── stm32l0xx_hal_uart.c │ │ │ │ ├── stm32l0xx_hal_uart_ex.c │ │ │ │ ├── stm32l0xx_hal_usart.c │ │ │ │ ├── stm32l0xx_hal_wwdg.c │ │ │ │ ├── stm32l0xx_ll_adc.c │ │ │ │ ├── stm32l0xx_ll_comp.c │ │ │ │ ├── stm32l0xx_ll_crc.c │ │ │ │ ├── stm32l0xx_ll_crs.c │ │ │ │ ├── stm32l0xx_ll_dac.c │ │ │ │ ├── stm32l0xx_ll_dma.c │ │ │ │ ├── stm32l0xx_ll_exti.c │ │ │ │ ├── stm32l0xx_ll_gpio.c │ │ │ │ ├── stm32l0xx_ll_i2c.c │ │ │ │ ├── stm32l0xx_ll_lptim.c │ │ │ │ ├── stm32l0xx_ll_lpuart.c │ │ │ │ ├── stm32l0xx_ll_pwr.c │ │ │ │ ├── stm32l0xx_ll_rcc.c │ │ │ │ ├── stm32l0xx_ll_rng.c │ │ │ │ ├── stm32l0xx_ll_rtc.c │ │ │ │ ├── stm32l0xx_ll_spi.c │ │ │ │ ├── stm32l0xx_ll_tim.c │ │ │ │ ├── stm32l0xx_ll_usart.c │ │ │ │ └── stm32l0xx_ll_utils.c │ │ ├── STM32L1xx_HAL_Driver │ │ │ ├── Inc │ │ │ │ ├── Legacy │ │ │ │ │ └── stm32_hal_legacy.h │ │ │ │ ├── stm32_assert_template.h │ │ │ │ ├── stm32l1xx_hal.h │ │ │ │ ├── stm32l1xx_hal_adc.h │ │ │ │ ├── stm32l1xx_hal_adc_ex.h │ │ │ │ ├── stm32l1xx_hal_comp.h │ │ │ │ ├── stm32l1xx_hal_comp_ex.h │ │ │ │ ├── stm32l1xx_hal_conf_template.h │ │ │ │ ├── stm32l1xx_hal_cortex.h │ │ │ │ ├── stm32l1xx_hal_crc.h │ │ │ │ ├── stm32l1xx_hal_cryp.h │ │ │ │ ├── stm32l1xx_hal_cryp_ex.h │ │ │ │ ├── stm32l1xx_hal_dac.h │ │ │ │ ├── stm32l1xx_hal_dac_ex.h │ │ │ │ ├── stm32l1xx_hal_def.h │ │ │ │ ├── stm32l1xx_hal_dma.h │ │ │ │ ├── stm32l1xx_hal_flash.h │ │ │ │ ├── stm32l1xx_hal_flash_ex.h │ │ │ │ ├── stm32l1xx_hal_flash_ramfunc.h │ │ │ │ ├── stm32l1xx_hal_gpio.h │ │ │ │ ├── stm32l1xx_hal_gpio_ex.h │ │ │ │ ├── stm32l1xx_hal_i2c.h │ │ │ │ ├── stm32l1xx_hal_i2s.h │ │ │ │ ├── stm32l1xx_hal_irda.h │ │ │ │ ├── stm32l1xx_hal_iwdg.h │ │ │ │ ├── stm32l1xx_hal_lcd.h │ │ │ │ ├── stm32l1xx_hal_nor.h │ │ │ │ ├── stm32l1xx_hal_opamp.h │ │ │ │ ├── stm32l1xx_hal_opamp_ex.h │ │ │ │ ├── stm32l1xx_hal_pcd.h │ │ │ │ ├── stm32l1xx_hal_pcd_ex.h │ │ │ │ ├── stm32l1xx_hal_pwr.h │ │ │ │ ├── stm32l1xx_hal_pwr_ex.h │ │ │ │ ├── stm32l1xx_hal_rcc.h │ │ │ │ ├── stm32l1xx_hal_rcc_ex.h │ │ │ │ ├── stm32l1xx_hal_rtc.h │ │ │ │ ├── stm32l1xx_hal_rtc_ex.h │ │ │ │ ├── stm32l1xx_hal_sd.h │ │ │ │ ├── stm32l1xx_hal_smartcard.h │ │ │ │ ├── stm32l1xx_hal_spi.h │ │ │ │ ├── stm32l1xx_hal_spi_ex.h │ │ │ │ ├── stm32l1xx_hal_sram.h │ │ │ │ ├── stm32l1xx_hal_tim.h │ │ │ │ ├── stm32l1xx_hal_tim_ex.h │ │ │ │ ├── stm32l1xx_hal_uart.h │ │ │ │ ├── stm32l1xx_hal_usart.h │ │ │ │ ├── stm32l1xx_hal_wwdg.h │ │ │ │ ├── stm32l1xx_ll_adc.h │ │ │ │ ├── stm32l1xx_ll_bus.h │ │ │ │ ├── stm32l1xx_ll_comp.h │ │ │ │ ├── stm32l1xx_ll_cortex.h │ │ │ │ ├── stm32l1xx_ll_crc.h │ │ │ │ ├── stm32l1xx_ll_dac.h │ │ │ │ ├── stm32l1xx_ll_dma.h │ │ │ │ ├── stm32l1xx_ll_exti.h │ │ │ │ ├── stm32l1xx_ll_fsmc.h │ │ │ │ ├── stm32l1xx_ll_gpio.h │ │ │ │ ├── stm32l1xx_ll_i2c.h │ │ │ │ ├── stm32l1xx_ll_iwdg.h │ │ │ │ ├── stm32l1xx_ll_opamp.h │ │ │ │ ├── stm32l1xx_ll_pwr.h │ │ │ │ ├── stm32l1xx_ll_rcc.h │ │ │ │ ├── stm32l1xx_ll_rtc.h │ │ │ │ ├── stm32l1xx_ll_sdmmc.h │ │ │ │ ├── stm32l1xx_ll_spi.h │ │ │ │ ├── stm32l1xx_ll_system.h │ │ │ │ ├── stm32l1xx_ll_tim.h │ │ │ │ ├── stm32l1xx_ll_usart.h │ │ │ │ ├── stm32l1xx_ll_utils.h │ │ │ │ └── stm32l1xx_ll_wwdg.h │ │ │ └── Src │ │ │ │ ├── stm32l1xx_hal.c │ │ │ │ ├── stm32l1xx_hal_adc.c │ │ │ │ ├── stm32l1xx_hal_adc_ex.c │ │ │ │ ├── stm32l1xx_hal_comp.c │ │ │ │ ├── stm32l1xx_hal_cortex.c │ │ │ │ ├── stm32l1xx_hal_crc.c │ │ │ │ ├── stm32l1xx_hal_cryp.c │ │ │ │ ├── stm32l1xx_hal_cryp_ex.c │ │ │ │ ├── stm32l1xx_hal_dac.c │ │ │ │ ├── stm32l1xx_hal_dac_ex.c │ │ │ │ ├── stm32l1xx_hal_dma.c │ │ │ │ ├── stm32l1xx_hal_flash.c │ │ │ │ ├── stm32l1xx_hal_flash_ex.c │ │ │ │ ├── stm32l1xx_hal_flash_ramfunc.c │ │ │ │ ├── stm32l1xx_hal_gpio.c │ │ │ │ ├── stm32l1xx_hal_i2c.c │ │ │ │ ├── stm32l1xx_hal_i2s.c │ │ │ │ ├── stm32l1xx_hal_irda.c │ │ │ │ ├── stm32l1xx_hal_iwdg.c │ │ │ │ ├── stm32l1xx_hal_lcd.c │ │ │ │ ├── stm32l1xx_hal_msp_template.c │ │ │ │ ├── stm32l1xx_hal_nor.c │ │ │ │ ├── stm32l1xx_hal_opamp.c │ │ │ │ ├── stm32l1xx_hal_opamp_ex.c │ │ │ │ ├── stm32l1xx_hal_pcd.c │ │ │ │ ├── stm32l1xx_hal_pcd_ex.c │ │ │ │ ├── stm32l1xx_hal_pwr.c │ │ │ │ ├── stm32l1xx_hal_pwr_ex.c │ │ │ │ ├── stm32l1xx_hal_rcc.c │ │ │ │ ├── stm32l1xx_hal_rcc_ex.c │ │ │ │ ├── stm32l1xx_hal_rtc.c │ │ │ │ ├── stm32l1xx_hal_rtc_ex.c │ │ │ │ ├── stm32l1xx_hal_sd.c │ │ │ │ ├── stm32l1xx_hal_smartcard.c │ │ │ │ ├── stm32l1xx_hal_spi.c │ │ │ │ ├── stm32l1xx_hal_spi_ex.c │ │ │ │ ├── stm32l1xx_hal_sram.c │ │ │ │ ├── stm32l1xx_hal_tim.c │ │ │ │ ├── stm32l1xx_hal_tim_ex.c │ │ │ │ ├── stm32l1xx_hal_uart.c │ │ │ │ ├── stm32l1xx_hal_usart.c │ │ │ │ ├── stm32l1xx_hal_wwdg.c │ │ │ │ ├── stm32l1xx_ll_adc.c │ │ │ │ ├── stm32l1xx_ll_comp.c │ │ │ │ ├── stm32l1xx_ll_crc.c │ │ │ │ ├── stm32l1xx_ll_dac.c │ │ │ │ ├── stm32l1xx_ll_dma.c │ │ │ │ ├── stm32l1xx_ll_exti.c │ │ │ │ ├── stm32l1xx_ll_fsmc.c │ │ │ │ ├── stm32l1xx_ll_gpio.c │ │ │ │ ├── stm32l1xx_ll_i2c.c │ │ │ │ ├── stm32l1xx_ll_opamp.c │ │ │ │ ├── stm32l1xx_ll_pwr.c │ │ │ │ ├── stm32l1xx_ll_rcc.c │ │ │ │ ├── stm32l1xx_ll_rtc.c │ │ │ │ ├── stm32l1xx_ll_sdmmc.c │ │ │ │ ├── stm32l1xx_ll_spi.c │ │ │ │ ├── stm32l1xx_ll_tim.c │ │ │ │ ├── stm32l1xx_ll_usart.c │ │ │ │ └── stm32l1xx_ll_utils.c │ │ ├── STM32L4xx_HAL_Driver │ │ │ ├── Inc │ │ │ │ ├── Legacy │ │ │ │ │ ├── stm32_hal_legacy.h │ │ │ │ │ └── stm32l4xx_hal_can_legacy.h │ │ │ │ ├── stm32_assert_template.h │ │ │ │ ├── stm32l4xx_hal.h │ │ │ │ ├── stm32l4xx_hal_adc.h │ │ │ │ ├── stm32l4xx_hal_adc_ex.h │ │ │ │ ├── stm32l4xx_hal_can.h │ │ │ │ ├── stm32l4xx_hal_comp.h │ │ │ │ ├── stm32l4xx_hal_conf_template.h │ │ │ │ ├── stm32l4xx_hal_cortex.h │ │ │ │ ├── stm32l4xx_hal_crc.h │ │ │ │ ├── stm32l4xx_hal_crc_ex.h │ │ │ │ ├── stm32l4xx_hal_cryp.h │ │ │ │ ├── stm32l4xx_hal_cryp_ex.h │ │ │ │ ├── stm32l4xx_hal_dac.h │ │ │ │ ├── stm32l4xx_hal_dac_ex.h │ │ │ │ ├── stm32l4xx_hal_dcmi.h │ │ │ │ ├── stm32l4xx_hal_def.h │ │ │ │ ├── stm32l4xx_hal_dfsdm.h │ │ │ │ ├── stm32l4xx_hal_dfsdm_ex.h │ │ │ │ ├── stm32l4xx_hal_dma.h │ │ │ │ ├── stm32l4xx_hal_dma2d.h │ │ │ │ ├── stm32l4xx_hal_dma_ex.h │ │ │ │ ├── stm32l4xx_hal_dsi.h │ │ │ │ ├── stm32l4xx_hal_exti.h │ │ │ │ ├── stm32l4xx_hal_firewall.h │ │ │ │ ├── stm32l4xx_hal_flash.h │ │ │ │ ├── stm32l4xx_hal_flash_ex.h │ │ │ │ ├── stm32l4xx_hal_flash_ramfunc.h │ │ │ │ ├── stm32l4xx_hal_gfxmmu.h │ │ │ │ ├── stm32l4xx_hal_gpio.h │ │ │ │ ├── stm32l4xx_hal_gpio_ex.h │ │ │ │ ├── stm32l4xx_hal_hash.h │ │ │ │ ├── stm32l4xx_hal_hash_ex.h │ │ │ │ ├── stm32l4xx_hal_hcd.h │ │ │ │ ├── stm32l4xx_hal_i2c.h │ │ │ │ ├── stm32l4xx_hal_i2c_ex.h │ │ │ │ ├── stm32l4xx_hal_irda.h │ │ │ │ ├── stm32l4xx_hal_irda_ex.h │ │ │ │ ├── stm32l4xx_hal_iwdg.h │ │ │ │ ├── stm32l4xx_hal_lcd.h │ │ │ │ ├── stm32l4xx_hal_lptim.h │ │ │ │ ├── stm32l4xx_hal_ltdc.h │ │ │ │ ├── stm32l4xx_hal_ltdc_ex.h │ │ │ │ ├── stm32l4xx_hal_nand.h │ │ │ │ ├── stm32l4xx_hal_nor.h │ │ │ │ ├── stm32l4xx_hal_opamp.h │ │ │ │ ├── stm32l4xx_hal_opamp_ex.h │ │ │ │ ├── stm32l4xx_hal_ospi.h │ │ │ │ ├── stm32l4xx_hal_pcd.h │ │ │ │ ├── stm32l4xx_hal_pcd_ex.h │ │ │ │ ├── stm32l4xx_hal_pwr.h │ │ │ │ ├── stm32l4xx_hal_pwr_ex.h │ │ │ │ ├── stm32l4xx_hal_qspi.h │ │ │ │ ├── stm32l4xx_hal_rcc.h │ │ │ │ ├── stm32l4xx_hal_rcc_ex.h │ │ │ │ ├── stm32l4xx_hal_rng.h │ │ │ │ ├── stm32l4xx_hal_rtc.h │ │ │ │ ├── stm32l4xx_hal_rtc_ex.h │ │ │ │ ├── stm32l4xx_hal_sai.h │ │ │ │ ├── stm32l4xx_hal_sai_ex.h │ │ │ │ ├── stm32l4xx_hal_sd.h │ │ │ │ ├── stm32l4xx_hal_sd_ex.h │ │ │ │ ├── stm32l4xx_hal_smartcard.h │ │ │ │ ├── stm32l4xx_hal_smartcard_ex.h │ │ │ │ ├── stm32l4xx_hal_smbus.h │ │ │ │ ├── stm32l4xx_hal_spi.h │ │ │ │ ├── stm32l4xx_hal_spi_ex.h │ │ │ │ ├── stm32l4xx_hal_sram.h │ │ │ │ ├── stm32l4xx_hal_swpmi.h │ │ │ │ ├── stm32l4xx_hal_tim.h │ │ │ │ ├── stm32l4xx_hal_tim_ex.h │ │ │ │ ├── stm32l4xx_hal_tsc.h │ │ │ │ ├── stm32l4xx_hal_uart.h │ │ │ │ ├── stm32l4xx_hal_uart_ex.h │ │ │ │ ├── stm32l4xx_hal_usart.h │ │ │ │ ├── stm32l4xx_hal_usart_ex.h │ │ │ │ ├── stm32l4xx_hal_wwdg.h │ │ │ │ ├── stm32l4xx_ll_adc.h │ │ │ │ ├── stm32l4xx_ll_bus.h │ │ │ │ ├── stm32l4xx_ll_comp.h │ │ │ │ ├── stm32l4xx_ll_cortex.h │ │ │ │ ├── stm32l4xx_ll_crc.h │ │ │ │ ├── stm32l4xx_ll_crs.h │ │ │ │ ├── stm32l4xx_ll_dac.h │ │ │ │ ├── stm32l4xx_ll_dma.h │ │ │ │ ├── stm32l4xx_ll_dma2d.h │ │ │ │ ├── stm32l4xx_ll_dmamux.h │ │ │ │ ├── stm32l4xx_ll_exti.h │ │ │ │ ├── stm32l4xx_ll_fmc.h │ │ │ │ ├── stm32l4xx_ll_gpio.h │ │ │ │ ├── stm32l4xx_ll_i2c.h │ │ │ │ ├── stm32l4xx_ll_iwdg.h │ │ │ │ ├── stm32l4xx_ll_lptim.h │ │ │ │ ├── stm32l4xx_ll_lpuart.h │ │ │ │ ├── stm32l4xx_ll_opamp.h │ │ │ │ ├── stm32l4xx_ll_pwr.h │ │ │ │ ├── stm32l4xx_ll_rcc.h │ │ │ │ ├── stm32l4xx_ll_rng.h │ │ │ │ ├── stm32l4xx_ll_rtc.h │ │ │ │ ├── stm32l4xx_ll_sdmmc.h │ │ │ │ ├── stm32l4xx_ll_spi.h │ │ │ │ ├── stm32l4xx_ll_swpmi.h │ │ │ │ ├── stm32l4xx_ll_system.h │ │ │ │ ├── stm32l4xx_ll_tim.h │ │ │ │ ├── stm32l4xx_ll_usart.h │ │ │ │ ├── stm32l4xx_ll_usb.h │ │ │ │ ├── stm32l4xx_ll_utils.h │ │ │ │ └── stm32l4xx_ll_wwdg.h │ │ │ └── Src │ │ │ │ ├── stm32l4xx_hal.c │ │ │ │ ├── stm32l4xx_hal_adc.c │ │ │ │ ├── stm32l4xx_hal_adc_ex.c │ │ │ │ ├── stm32l4xx_hal_can.c │ │ │ │ ├── stm32l4xx_hal_comp.c │ │ │ │ ├── stm32l4xx_hal_cortex.c │ │ │ │ ├── stm32l4xx_hal_crc.c │ │ │ │ ├── stm32l4xx_hal_crc_ex.c │ │ │ │ ├── stm32l4xx_hal_cryp.c │ │ │ │ ├── stm32l4xx_hal_cryp_ex.c │ │ │ │ ├── stm32l4xx_hal_dac.c │ │ │ │ ├── stm32l4xx_hal_dac_ex.c │ │ │ │ ├── stm32l4xx_hal_dcmi.c │ │ │ │ ├── stm32l4xx_hal_dfsdm.c │ │ │ │ ├── stm32l4xx_hal_dfsdm_ex.c │ │ │ │ ├── stm32l4xx_hal_dma.c │ │ │ │ ├── stm32l4xx_hal_dma2d.c │ │ │ │ ├── stm32l4xx_hal_dma_ex.c │ │ │ │ ├── stm32l4xx_hal_dsi.c │ │ │ │ ├── stm32l4xx_hal_exti.c │ │ │ │ ├── stm32l4xx_hal_firewall.c │ │ │ │ ├── stm32l4xx_hal_flash.c │ │ │ │ ├── stm32l4xx_hal_flash_ex.c │ │ │ │ ├── stm32l4xx_hal_flash_ramfunc.c │ │ │ │ ├── stm32l4xx_hal_gfxmmu.c │ │ │ │ ├── stm32l4xx_hal_gpio.c │ │ │ │ ├── stm32l4xx_hal_hash.c │ │ │ │ ├── stm32l4xx_hal_hash_ex.c │ │ │ │ ├── stm32l4xx_hal_hcd.c │ │ │ │ ├── stm32l4xx_hal_i2c.c │ │ │ │ ├── stm32l4xx_hal_i2c_ex.c │ │ │ │ ├── stm32l4xx_hal_irda.c │ │ │ │ ├── stm32l4xx_hal_iwdg.c │ │ │ │ ├── stm32l4xx_hal_lcd.c │ │ │ │ ├── stm32l4xx_hal_lptim.c │ │ │ │ ├── stm32l4xx_hal_ltdc.c │ │ │ │ ├── stm32l4xx_hal_ltdc_ex.c │ │ │ │ ├── stm32l4xx_hal_msp_template.c │ │ │ │ ├── stm32l4xx_hal_nand.c │ │ │ │ ├── stm32l4xx_hal_nor.c │ │ │ │ ├── stm32l4xx_hal_opamp.c │ │ │ │ ├── stm32l4xx_hal_opamp_ex.c │ │ │ │ ├── stm32l4xx_hal_ospi.c │ │ │ │ ├── stm32l4xx_hal_pcd.c │ │ │ │ ├── stm32l4xx_hal_pcd_ex.c │ │ │ │ ├── stm32l4xx_hal_pwr.c │ │ │ │ ├── stm32l4xx_hal_pwr_ex.c │ │ │ │ ├── stm32l4xx_hal_qspi.c │ │ │ │ ├── stm32l4xx_hal_rcc.c │ │ │ │ ├── stm32l4xx_hal_rcc_ex.c │ │ │ │ ├── stm32l4xx_hal_rng.c │ │ │ │ ├── stm32l4xx_hal_rtc.c │ │ │ │ ├── stm32l4xx_hal_rtc_ex.c │ │ │ │ ├── stm32l4xx_hal_sai.c │ │ │ │ ├── stm32l4xx_hal_sai_ex.c │ │ │ │ ├── stm32l4xx_hal_sd.c │ │ │ │ ├── stm32l4xx_hal_sd_ex.c │ │ │ │ ├── stm32l4xx_hal_smartcard.c │ │ │ │ ├── stm32l4xx_hal_smartcard_ex.c │ │ │ │ ├── stm32l4xx_hal_smbus.c │ │ │ │ ├── stm32l4xx_hal_spi.c │ │ │ │ ├── stm32l4xx_hal_spi_ex.c │ │ │ │ ├── stm32l4xx_hal_sram.c │ │ │ │ ├── stm32l4xx_hal_swpmi.c │ │ │ │ ├── stm32l4xx_hal_tim.c │ │ │ │ ├── stm32l4xx_hal_tim_ex.c │ │ │ │ ├── stm32l4xx_hal_timebase_tim_template.c │ │ │ │ ├── stm32l4xx_hal_tsc.c │ │ │ │ ├── stm32l4xx_hal_uart.c │ │ │ │ ├── stm32l4xx_hal_uart_ex.c │ │ │ │ ├── stm32l4xx_hal_usart.c │ │ │ │ ├── stm32l4xx_hal_usart_ex.c │ │ │ │ ├── stm32l4xx_hal_wwdg.c │ │ │ │ ├── stm32l4xx_ll_adc.c │ │ │ │ ├── stm32l4xx_ll_comp.c │ │ │ │ ├── stm32l4xx_ll_crc.c │ │ │ │ ├── stm32l4xx_ll_crs.c │ │ │ │ ├── stm32l4xx_ll_dac.c │ │ │ │ ├── stm32l4xx_ll_dma.c │ │ │ │ ├── stm32l4xx_ll_dma2d.c │ │ │ │ ├── stm32l4xx_ll_exti.c │ │ │ │ ├── stm32l4xx_ll_fmc.c │ │ │ │ ├── stm32l4xx_ll_gpio.c │ │ │ │ ├── stm32l4xx_ll_i2c.c │ │ │ │ ├── stm32l4xx_ll_lptim.c │ │ │ │ ├── stm32l4xx_ll_lpuart.c │ │ │ │ ├── stm32l4xx_ll_opamp.c │ │ │ │ ├── stm32l4xx_ll_pwr.c │ │ │ │ ├── stm32l4xx_ll_rcc.c │ │ │ │ ├── stm32l4xx_ll_rng.c │ │ │ │ ├── stm32l4xx_ll_rtc.c │ │ │ │ ├── stm32l4xx_ll_sdmmc.c │ │ │ │ ├── stm32l4xx_ll_spi.c │ │ │ │ ├── stm32l4xx_ll_swpmi.c │ │ │ │ ├── stm32l4xx_ll_tim.c │ │ │ │ ├── stm32l4xx_ll_usart.c │ │ │ │ ├── stm32l4xx_ll_usb.c │ │ │ │ └── stm32l4xx_ll_utils.c │ │ ├── STM32_USB_Device_Library │ │ │ ├── Class │ │ │ │ ├── CDC │ │ │ │ │ ├── Inc │ │ │ │ │ │ └── usbd_cdc.h │ │ │ │ │ └── Src │ │ │ │ │ │ └── usbd_cdc.c │ │ │ │ └── DFU │ │ │ │ │ ├── Inc │ │ │ │ │ └── usbd_dfu.h │ │ │ │ │ └── Src │ │ │ │ │ └── usbd_dfu.c │ │ │ └── Core │ │ │ │ ├── Inc │ │ │ │ ├── usbd_core.h │ │ │ │ ├── usbd_ctlreq.h │ │ │ │ ├── usbd_def.h │ │ │ │ └── usbd_ioreq.h │ │ │ │ └── Src │ │ │ │ ├── usbd_core.c │ │ │ │ ├── usbd_ctlreq.c │ │ │ │ └── usbd_ioreq.c │ │ └── cmsis │ │ │ ├── arm_common_tables.h │ │ │ ├── arm_const_structs.h │ │ │ ├── arm_math.h │ │ │ ├── cmsis_armcc.h │ │ │ ├── cmsis_armcc_V6.h │ │ │ ├── cmsis_gcc.h │ │ │ ├── core_cm0.h │ │ │ ├── core_cm0plus.h │ │ │ ├── core_cm3.h │ │ │ ├── core_cm4.h │ │ │ ├── core_cm7.h │ │ │ ├── core_cmFunc.h │ │ │ ├── core_cmInstr.h │ │ │ ├── core_cmSimd.h │ │ │ ├── core_sc000.h │ │ │ └── core_sc300.h │ └── utilities.c ├── pinName-board.h ├── pinName-ioe.h ├── rtc-board.h ├── spi-board.h ├── sx126x-board.h ├── sx1272-board.h ├── sx1276-board.h ├── uart-board.h ├── uart-usb-board.h └── utilities.h ├── mac ├── CMakeLists.txt ├── LoRaMac.c ├── LoRaMac.h ├── LoRaMacAdr.c ├── LoRaMacAdr.h ├── LoRaMacClassB.c ├── LoRaMacClassB.h ├── LoRaMacClassBConfig.h ├── LoRaMacClassBNvm.h ├── LoRaMacCommands.c ├── LoRaMacCommands.h ├── LoRaMacConfirmQueue.c ├── LoRaMacConfirmQueue.h ├── LoRaMacCrypto.c ├── LoRaMacCrypto.h ├── LoRaMacCryptoNvm.h ├── LoRaMacHeaderTypes.h ├── LoRaMacMessageTypes.h ├── LoRaMacParser.c ├── LoRaMacParser.h ├── LoRaMacSerializer.c ├── LoRaMacSerializer.h ├── LoRaMacTest.h ├── LoRaMacTypes.h ├── region │ ├── Region.c │ ├── Region.h │ ├── RegionAS923.c │ ├── RegionAS923.h │ ├── RegionAU915.c │ ├── RegionAU915.h │ ├── RegionBaseUS.c │ ├── RegionBaseUS.h │ ├── RegionCN470.c │ ├── RegionCN470.h │ ├── RegionCN470A20.c │ ├── RegionCN470A20.h │ ├── RegionCN470A26.c │ ├── RegionCN470A26.h │ ├── RegionCN470B20.c │ ├── RegionCN470B20.h │ ├── RegionCN470B26.c │ ├── RegionCN470B26.h │ ├── RegionCN779.c │ ├── RegionCN779.h │ ├── RegionCommon.c │ ├── RegionCommon.h │ ├── RegionEU433.c │ ├── RegionEU433.h │ ├── RegionEU868.c │ ├── RegionEU868.h │ ├── RegionIN865.c │ ├── RegionIN865.h │ ├── RegionKR920.c │ ├── RegionKR920.h │ ├── RegionNvm.h │ ├── RegionRU864.c │ ├── RegionRU864.h │ ├── RegionUS915.c │ └── RegionUS915.h ├── secure-element-nvm.h └── secure-element.h ├── peripherals ├── CMakeLists.txt ├── atecc608a-tnglora-se │ ├── atca_config.h │ ├── atecc608a-tnglora-se-hal.c │ ├── atecc608a-tnglora-se-hal.h │ ├── atecc608a-tnglora-se.c │ └── se-identity.h ├── gpio-ioe.c ├── gpio-ioe.h ├── lr1110-se │ ├── lr1110-se-hal.c │ ├── lr1110-se-hal.h │ ├── lr1110-se.c │ └── se-identity.h ├── mag3110.c ├── mag3110.h ├── mma8451.c ├── mma8451.h ├── mpl3115.c ├── mpl3115.h ├── pam7q.c ├── pam7q.h ├── soft-se │ ├── aes.c │ ├── aes.h │ ├── cmac.c │ ├── cmac.h │ ├── se-identity.h │ ├── soft-se-hal.c │ ├── soft-se-hal.h │ └── soft-se.c ├── sx1509.c ├── sx1509.h ├── sx9500.c └── sx9500.h ├── radio ├── CMakeLists.txt ├── lr1110 │ ├── lr1110.h │ └── radio.c ├── radio.h ├── sx126x │ ├── radio.c │ ├── sx126x.c │ └── sx126x.h ├── sx1272 │ ├── sx1272.c │ ├── sx1272.h │ ├── sx1272Regs-Fsk.h │ └── sx1272Regs-LoRa.h └── sx1276 │ ├── sx1276.c │ ├── sx1276.h │ ├── sx1276Regs-Fsk.h │ └── sx1276Regs-LoRa.h └── system ├── CMakeLists.txt ├── adc.c ├── adc.h ├── delay.c ├── delay.h ├── fifo.c ├── fifo.h ├── gpio.c ├── gpio.h ├── gps.c ├── gps.h ├── i2c.c ├── i2c.h ├── nvmm.c ├── nvmm.h ├── serial.h ├── spi.h ├── systime.c ├── systime.h ├── timer.c ├── timer.h ├── uart.c └── uart.h /.gitignore: -------------------------------------------------------------------------------- 1 | lst/ 2 | obj/ 3 | bin/ 4 | build/ 5 | tmp/ 6 | *.bin 7 | .kdev4 8 | *.log 9 | *.dep 10 | *.uvgui.* 11 | *.uvgui_*.bak 12 | *.uvguix.* 13 | *.uvguix_*.bak 14 | *_uvopt.bak 15 | *_uvoptx.bak 16 | *_uvproj.bak 17 | *_uvprojx.bak 18 | *.ctx 19 | *.dbi 20 | *.xdb 21 | *.svn 22 | *.pbxproj 23 | *.cogui 24 | *.comarker 25 | .directory 26 | .vscode/launch.json 27 | .cmaketools.json 28 | ipch/ 29 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/radio/lr1110/lr1110_driver"] 2 | path = src/radio/lr1110/lr1110_driver 3 | url = https://github.com/Lora-net/lr1110_driver.git 4 | [submodule "src/peripherals/atecc608a-tnglora-se/cryptoauthlib"] 5 | path = src/peripherals/atecc608a-tnglora-se/cryptoauthlib 6 | url = https://github.com/MicrochipTech/cryptoauthlib 7 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "ARM", 5 | "compileCommands": "${workspaceRoot}/build/compile_commands.json", 6 | "intelliSenseMode": "clang-x64", 7 | "browse": { 8 | "path": [ 9 | "${workspaceFolder}" 10 | ] 11 | }, 12 | "cStandard": "c11", 13 | "cppStandard": "c++17", 14 | "configurationProvider": "ms-vscode.cmake-tools" 15 | } 16 | ], 17 | "version": 4 18 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/CHANGELOG.md -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## ______ _ 3 | ## / _____) _ | | 4 | ## ( (____ _____ ____ _| |_ _____ ____| |__ 5 | ## \____ \| ___ | (_ _) ___ |/ ___) _ \ 6 | ## _____) ) ____| | | || |_| ____( (___| | | | 7 | ## (______/|_____)_|_|_| \__)_____)\____)_| |_| 8 | ## (C)2013-2017 Semtech 9 | ## ___ _____ _ ___ _ _____ ___ ___ ___ ___ 10 | ## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 11 | ## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 12 | ## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 13 | ## embedded.connectivity.solutions.============== 14 | ## 15 | ## License: Revised BSD License, see LICENSE.TXT file included in the project 16 | ## Authors: Johannes Bruder (STACKFORCE), Miguel Luis (Semtech) 17 | ## 18 | project(loramac-node) 19 | cmake_minimum_required(VERSION 3.6) 20 | 21 | add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src) 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Revised BSD License 2 | Copyright Semtech Corporation 2013. 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 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the Semtech corporation nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY DIRECT, 19 | 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 22 | ON 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. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/README.md -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Vulnerability fixes will always be applied on [master](https://github.com/Lora-net/LoRaMac-node/tree/master) branch and included in next release. 6 | We may consider to hotfix the most recent release depending on the circumstances. Older releases will not be hotfixed. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | [master](https://github.com/Lora-net/LoRaMac-node/tree/master) | :white_check_mark: | 11 | | [latest release](https://github.com/Lora-net/LoRaMac-node/releases/latest) | :question: | 12 | | older releases | :x: | 13 | 14 | ## Reporting a Vulnerability 15 | 16 | Please report security concerns, perceived or implemented vulnerabilities in the source code of this project to: [LoRa-Net@semtech.com](mailto:LoRa-Net@semtech.com) 17 | -------------------------------------------------------------------------------- /cmake/binutils-arm-none-eabi.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | ## ______ _ 3 | ## / _____) _ | | 4 | ## ( (____ _____ ____ _| |_ _____ ____| |__ 5 | ## \____ \| ___ | (_ _) ___ |/ ___) _ \ 6 | ## _____) ) ____| | | || |_| ____( (___| | | | 7 | ## (______/|_____)_|_|_| \__)_____)\____)_| |_| 8 | ## (C)2013-2017 Semtech 9 | ## ___ _____ _ ___ _ _____ ___ ___ ___ ___ 10 | ## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 11 | ## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 12 | ## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 13 | ## embedded.connectivity.solutions.============== 14 | ## 15 | ## License: Revised BSD License, see LICENSE.TXT file included in the project 16 | ## Authors: Johannes Bruder ( STACKFORCE ), Miguel Luis ( Semtech ) 17 | ## 18 | ## 19 | ## CMake arm-none-eabi binutils integration and helper functions 20 | ## 21 | 22 | 23 | #--------------------------------------------------------------------------------------- 24 | # Set tools 25 | #--------------------------------------------------------------------------------------- 26 | set(CMAKE_OBJCOPY ${TOOLCHAIN_BIN_DIR}/${TOOLCHAIN}-objcopy${TOOLCHAIN_EXT}) 27 | set(CMAKE_OBJDUMP ${TOOLCHAIN_BIN_DIR}/${TOOLCHAIN}-objdump${TOOLCHAIN_EXT}) 28 | set(CMAKE_SIZE ${TOOLCHAIN_BIN_DIR}/${TOOLCHAIN}-size${TOOLCHAIN_EXT}) 29 | 30 | 31 | #--------------------------------------------------------------------------------------- 32 | # Prints the section sizes 33 | #--------------------------------------------------------------------------------------- 34 | function(print_section_sizes TARGET) 35 | add_custom_command(TARGET ${TARGET} POST_BUILD COMMAND ${CMAKE_SIZE} ${TARGET}) 36 | endfunction() 37 | 38 | #--------------------------------------------------------------------------------------- 39 | # Creates output in hex format 40 | #--------------------------------------------------------------------------------------- 41 | function(create_hex_output TARGET) 42 | add_custom_target(${TARGET}.hex ALL DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Oihex ${TARGET} ${TARGET}.hex) 43 | endfunction() 44 | 45 | #--------------------------------------------------------------------------------------- 46 | # Creates output in binary format 47 | #--------------------------------------------------------------------------------------- 48 | function(create_bin_output TARGET) 49 | add_custom_target(${TARGET}.bin ALL DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Obinary ${TARGET} ${TARGET}.bin) 50 | endfunction() 51 | -------------------------------------------------------------------------------- /cmake/launch.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Debug-@TARGET_NAME@", 6 | "type": "cppdbg", 7 | "request": "launch", 8 | "program": "${workspaceRoot}/build/src/apps/@APPLICATION@/@TARGET_NAME@", 9 | "args": [], 10 | "stopAtEntry": true, 11 | "cwd": "${workspaceRoot}", 12 | "environment": [], 13 | "externalConsole": false, 14 | "debugServerArgs": "-f interface/@OPENOCD_INTERFACE@ -f target/@OPENOCD_TARGET@", 15 | "serverLaunchTimeout": 20000, 16 | "filterStderr": true, 17 | "filterStdout": false, 18 | "serverStarted": "Info\\ :\\ [\\w\\d\\.]*:\\ hardware", 19 | "setupCommands": [ 20 | { "text": "cd ${workspaceRoot}/build" }, 21 | { "text": "file src/apps/@APPLICATION@/@TARGET_NAME@", "description": "load file", "ignoreFailures": false}, 22 | { "text": "target extended-remote localhost:3333", "description": "connect to target", "ignoreFailures": false }, 23 | { "text": "monitor reset halt", "description": "perform a reset and halt the target", "ignoreFailures": false }, 24 | { "text": "load", "description": "flash target", "ignoreFailures": false }, 25 | { "text": "monitor reset init", "description": "perform a reset and init the target", "ignoreFailures": false }, 26 | { "text": "set output-radix 16", "description": "set the default numeric base to 16", "ignoreFailures": false } 27 | ], 28 | "logging": { 29 | "moduleLoad": true, 30 | "trace": true, 31 | "engineLogging": true, 32 | "programOutput": true, 33 | "exceptions": true 34 | }, 35 | "MIMode": "gdb", 36 | "miDebuggerPath": "@GDB_BIN@", 37 | "debugServerPath": "@OPENOCD_BIN@" 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /cmake/openocd-run.gdb.in: -------------------------------------------------------------------------------- 1 | file @TARGET_NAME@ 2 | target extended-remote localhost:3333 3 | monitor reset halt 4 | load 5 | thbreak main 6 | -------------------------------------------------------------------------------- /cmake/samr34.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | ## ______ _ 3 | ## / _____) _ | | 4 | ## ( (____ _____ ____ _| |_ _____ ____| |__ 5 | ## \____ \| ___ | (_ _) ___ |/ ___) _ \ 6 | ## _____) ) ____| | | || |_| ____( (___| | | | 7 | ## (______/|_____)_|_|_| \__)_____)\____)_| |_| 8 | ## (C)2013-2017 Semtech 9 | ## ___ _____ _ ___ _ _____ ___ ___ ___ ___ 10 | ## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 11 | ## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 12 | ## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 13 | ## embedded.connectivity.solutions.============== 14 | ## 15 | ## License: Revised BSD License, see LICENSE.TXT file included in the project 16 | ## Authors: Johannes Bruder ( STACKFORCE ), Miguel Luis ( Semtech ), 17 | ## Marten Lootsma(TWTG) on behalf of Microchip/Atmel (c)2017 18 | ## 19 | ## 20 | ## SAMR34 target specific CMake file 21 | ## 22 | 23 | if(NOT DEFINED LINKER_SCRIPT) 24 | message(FATAL_ERROR "No linker script defined") 25 | endif(NOT DEFINED LINKER_SCRIPT) 26 | message("Linker script: ${LINKER_SCRIPT}") 27 | 28 | 29 | #--------------------------------------------------------------------------------------- 30 | # Set compiler/linker flags 31 | #--------------------------------------------------------------------------------------- 32 | 33 | # Object build options 34 | set(OBJECT_GEN_FLAGS "-Og -g -mthumb -g2 -fno-builtin -mcpu=cortex-m0plus -Wall -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize -mlong-calls") 35 | 36 | set(CMAKE_C_FLAGS "${OBJECT_GEN_FLAGS} -std=gnu99 " CACHE INTERNAL "C Compiler options") 37 | set(CMAKE_CXX_FLAGS "${OBJECT_GEN_FLAGS} -std=c++11 " CACHE INTERNAL "C++ Compiler options") 38 | set(CMAKE_ASM_FLAGS "${OBJECT_GEN_FLAGS} -x assembler-with-cpp " CACHE INTERNAL "ASM Compiler options") 39 | 40 | # Linker flags 41 | set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections --specs=nano.specs --specs=nosys.specs -mthumb -g2 -mcpu=cortex-m0plus -mabi=aapcs -T${LINKER_SCRIPT} -Wl,-Map=${CMAKE_PROJECT_NAME}.map" CACHE INTERNAL "Linker options") 42 | -------------------------------------------------------------------------------- /cmake/stlink-run.gdb.in: -------------------------------------------------------------------------------- 1 | file @TARGET_NAME@ 2 | target extended localhost:4242 3 | monitor reset halt 4 | shell sleep 1 5 | load 6 | thbreak main 7 | -------------------------------------------------------------------------------- /cmake/stm32l0.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | ## ______ _ 3 | ## / _____) _ | | 4 | ## ( (____ _____ ____ _| |_ _____ ____| |__ 5 | ## \____ \| ___ | (_ _) ___ |/ ___) _ \ 6 | ## _____) ) ____| | | || |_| ____( (___| | | | 7 | ## (______/|_____)_|_|_| \__)_____)\____)_| |_| 8 | ## (C)2013-2017 Semtech 9 | ## ___ _____ _ ___ _ _____ ___ ___ ___ ___ 10 | ## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 11 | ## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 12 | ## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 13 | ## embedded.connectivity.solutions.============== 14 | ## 15 | ## License: Revised BSD License, see LICENSE.TXT file included in the project 16 | ## Authors: Johannes Bruder ( STACKFORCE ), Miguel Luis ( Semtech ) 17 | ## 18 | ## 19 | ## STM32L0 target specific CMake file 20 | ## 21 | 22 | if(NOT DEFINED LINKER_SCRIPT) 23 | message(FATAL_ERROR "No linker script defined") 24 | endif(NOT DEFINED LINKER_SCRIPT) 25 | message("Linker script: ${LINKER_SCRIPT}") 26 | 27 | 28 | #--------------------------------------------------------------------------------------- 29 | # Set compiler/linker flags 30 | #--------------------------------------------------------------------------------------- 31 | 32 | # Object build options 33 | set(OBJECT_GEN_FLAGS "-Og -g -mthumb -g2 -fno-builtin -mcpu=cortex-m0plus -Wall -Wextra -pedantic -Wno-unused-parameter -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize") 34 | 35 | set(CMAKE_C_FLAGS "${OBJECT_GEN_FLAGS} -std=gnu99 " CACHE INTERNAL "C Compiler options") 36 | set(CMAKE_CXX_FLAGS "${OBJECT_GEN_FLAGS} -std=c++11 " CACHE INTERNAL "C++ Compiler options") 37 | set(CMAKE_ASM_FLAGS "${OBJECT_GEN_FLAGS} -x assembler-with-cpp " CACHE INTERNAL "ASM Compiler options") 38 | 39 | # Linker flags 40 | set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections --specs=nano.specs --specs=nosys.specs -mthumb -g2 -mcpu=cortex-m0plus -mabi=aapcs -T${LINKER_SCRIPT} -Wl,-Map=${CMAKE_PROJECT_NAME}.map" CACHE INTERNAL "Linker options") 41 | -------------------------------------------------------------------------------- /cmake/stm32l1.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | ## ______ _ 3 | ## / _____) _ | | 4 | ## ( (____ _____ ____ _| |_ _____ ____| |__ 5 | ## \____ \| ___ | (_ _) ___ |/ ___) _ \ 6 | ## _____) ) ____| | | || |_| ____( (___| | | | 7 | ## (______/|_____)_|_|_| \__)_____)\____)_| |_| 8 | ## (C)2013-2017 Semtech 9 | ## ___ _____ _ ___ _ _____ ___ ___ ___ ___ 10 | ## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 11 | ## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 12 | ## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 13 | ## embedded.connectivity.solutions.============== 14 | ## 15 | ## License: Revised BSD License, see LICENSE.TXT file included in the project 16 | ## Authors: Johannes Bruder ( STACKFORCE ), Miguel Luis ( Semtech ) 17 | ## 18 | ## 19 | ## STM32L1 target specific CMake file 20 | ## 21 | 22 | if(NOT DEFINED LINKER_SCRIPT) 23 | message(FATAL_ERROR "No linker script defined") 24 | endif(NOT DEFINED LINKER_SCRIPT) 25 | message("Linker script: ${LINKER_SCRIPT}") 26 | 27 | 28 | #--------------------------------------------------------------------------------------- 29 | # Set compiler/linker flags 30 | #--------------------------------------------------------------------------------------- 31 | 32 | # Object build options 33 | set(OBJECT_GEN_FLAGS "-Og -g -mthumb -g2 -fno-builtin -mcpu=cortex-m3 -Wall -Wextra -pedantic -Wno-unused-parameter -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize") 34 | 35 | set(CMAKE_C_FLAGS "${OBJECT_GEN_FLAGS} -std=gnu99 " CACHE INTERNAL "C Compiler options") 36 | set(CMAKE_CXX_FLAGS "${OBJECT_GEN_FLAGS} -std=c++11 " CACHE INTERNAL "C++ Compiler options") 37 | set(CMAKE_ASM_FLAGS "${OBJECT_GEN_FLAGS} -x assembler-with-cpp " CACHE INTERNAL "ASM Compiler options") 38 | 39 | # Linker flags 40 | set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections --specs=nano.specs --specs=nosys.specs -mthumb -g2 -mcpu=cortex-m3 -mabi=aapcs -T${LINKER_SCRIPT} -Wl,-Map=${CMAKE_PROJECT_NAME}.map" CACHE INTERNAL "Linker options") 41 | -------------------------------------------------------------------------------- /cmake/stm32l4.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | ## ______ _ 3 | ## / _____) _ | | 4 | ## ( (____ _____ ____ _| |_ _____ ____| |__ 5 | ## \____ \| ___ | (_ _) ___ |/ ___) _ \ 6 | ## _____) ) ____| | | || |_| ____( (___| | | | 7 | ## (______/|_____)_|_|_| \__)_____)\____)_| |_| 8 | ## (C)2013-2018 Semtech 9 | ## ___ _____ _ ___ _ _____ ___ ___ ___ ___ 10 | ## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 11 | ## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 12 | ## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 13 | ## embedded.connectivity.solutions.============== 14 | ## 15 | ## License: Revised BSD License, see LICENSE.TXT file included in the project 16 | ## Authors: Johannes Bruder ( STACKFORCE ), Miguel Luis ( Semtech ) 17 | ## 18 | ## 19 | ## STM32L4 target specific CMake file 20 | ## 21 | 22 | if(NOT DEFINED LINKER_SCRIPT) 23 | message(FATAL_ERROR "No linker script defined") 24 | endif(NOT DEFINED LINKER_SCRIPT) 25 | message("Linker script: ${LINKER_SCRIPT}") 26 | 27 | 28 | #--------------------------------------------------------------------------------------- 29 | # Set compiler/linker flags 30 | #--------------------------------------------------------------------------------------- 31 | 32 | # Object build options 33 | set(OBJECT_GEN_FLAGS "-Og -g -mthumb -g2 -fno-builtin -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -Wall -Wextra -pedantic -Wno-unused-parameter -ffunction-sections -fdata-sections -fomit-frame-pointer -mabi=aapcs -fno-unroll-loops -ffast-math -ftree-vectorize") 34 | 35 | set(CMAKE_C_FLAGS "${OBJECT_GEN_FLAGS} -std=gnu99 " CACHE INTERNAL "C Compiler options") 36 | set(CMAKE_CXX_FLAGS "${OBJECT_GEN_FLAGS} -std=c++11 " CACHE INTERNAL "C++ Compiler options") 37 | set(CMAKE_ASM_FLAGS "${OBJECT_GEN_FLAGS} -x assembler-with-cpp " CACHE INTERNAL "ASM Compiler options") 38 | 39 | # Linker flags 40 | set(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections --specs=nano.specs --specs=nosys.specs -mthumb -g2 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mabi=aapcs -T${LINKER_SCRIPT} -Wl,-Map=${CMAKE_PROJECT_NAME}.map" CACHE INTERNAL "Linker options") 41 | -------------------------------------------------------------------------------- /doc/ATECC608A-TNGLORA.md: -------------------------------------------------------------------------------- 1 | # ATECC608A-TNGLORA secure element module support documents 2 | 3 | [ATECC608A-TNGLORA](https://www.microchip.com/wwwproducts/en/ATECC608A-TNGLORA) acts as a HW secure element, see [The Things Industries reference repository](https://github.com/TheThingsIndustries/lorawan-example-atecc608a-tnglora) for further documentation and examples. 4 | -------------------------------------------------------------------------------- /doc/NAMote72-platform.md: -------------------------------------------------------------------------------- 1 | # NAMote72 platform support documents 2 | 3 | * [NAMote72](https://os.mbed.com/platforms/NAMote-72/) 4 | -------------------------------------------------------------------------------- /doc/NucleoLxxx-platform.md: -------------------------------------------------------------------------------- 1 | # NucleoLxxx platforms support documents 2 | 3 | * [NucleoL073RZ](https://os.mbed.com/platforms/ST-Nucleo-L073RZ/) 4 | * [NucleoL152RE](https://os.mbed.com/platforms/ST-Nucleo-L152RE/) 5 | * [NucleoL476RG](https://os.mbed.com/platforms/ST-Nucleo-L476RG/) 6 | 7 | The following mbed shields may be used with NucleoLxxx platforms: 8 | 9 | * [SX1272MB2DAS](https://os.mbed.com/components/SX1272MB2xAS/) 10 | * [SX1276MB1LAS](https://os.mbed.com/components/SX1276MB1xAS/) 11 | * [SX1276MB1MAS](https://os.mbed.com/components/SX1276MB1xAS/) 12 | * [SX1261MB2BAS](https://os.mbed.com/components/SX126xMB2xAS/) 13 | * [SX1262MB2CAS](https://os.mbed.com/components/SX126xMB2xAS/) 14 | * [LR1110MB1DIS]() 15 | * [LR1110MB1DJS]() 16 | * [LR1110MB1GIS]() 17 | * [LR1110MB1GJS]() 18 | 19 | Development kit: 20 | 21 | * [SX126xDVK1xAS](https://os.mbed.com/components/SX126xDVK1xAS/) 22 | * SX1261DVK1BAS uses a SX1261MB1BAS shield 23 | * SX1262DVK1CAS uses a SX1262MB1CAS shield 24 | * SX1262DVK1DAS uses a SX1262MB1DAS shield 25 | * Other variants can also be used but require some adjustments 26 | 27 | _**Note**_: The MBX abbreviation used by the shield name variables(i.e: SX1261MBXBAS) on this project means that the shields named SX126xMB1xAS (SX126xDVK1xAS development kit only) and SX126xMB2xAS (standalone shields) are supported. 28 | 29 | 30 | * [LR1110DVK1TXKS]() 31 | * LR1110DVK1TBKS uses a LR1110MB1DIS or LR1110MB1DJS shield 32 | * LR1110DVK1TCKS uses a LR1110MB1DIS or LR1110MB1DJS shield 33 | * LR1110DVK1TGKS uses a LR1110MB1GJS or LR1110MB1GJS shield 34 | 35 | # Discovery kit platform support documents 36 | 37 | * [B-L072Z-LRWAN1](https://os.mbed.com/platforms/ST-Discovery-LRWAN1/) 38 | -------------------------------------------------------------------------------- /doc/SAMR34-platform.md: -------------------------------------------------------------------------------- 1 | # SAMR34 platform support documents 2 | 3 | The supported SAMR34 platform can be evaluated via SAMR34-XPRO evaluation kit [User Guide](http://ww1.microchip.com/downloads/en/DeviceDoc/SAM-R34-Xplained-Pro-User-Guide-DS50002803C.pdf) 4 | 5 | The SAM R34 family data sheet can be found at [SAM R34 Family Data Sheet](http://ww1.microchip.com/downloads/en/DeviceDoc/SAMR34-R35-Low-Power-LoRa-Sub-GHz-SiP-Data-Sheet-DS70005356B.pdf) 6 | -------------------------------------------------------------------------------- /doc/SKiM88xx-platform.md: -------------------------------------------------------------------------------- 1 | # SKiM88xx platforms support documents 2 | 3 | The supported SKiM88xx platforms are: 4 | 1. [SK-iM880B - Long Range Radio Starter Kit](https://wireless-solutions.de/products/starterkits/sk-im880b.html) 5 | 2. [SK-iM980A - Long Range Radio Starter Kit](https://wireless-solutions.de/products/long-range-radio/im980a.html) 6 | 3. [SK-iM881A-XL - Long Range Radio Starter Kit](https://wireless-solutions.de/products/long-range-radio/im881a-xl.html) 7 | -------------------------------------------------------------------------------- /doc/SX1276-Wing-Board-(03-91016-RA).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/doc/SX1276-Wing-Board-(03-91016-RA).pdf -------------------------------------------------------------------------------- /doc/images/vscode-cmake-build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/doc/images/vscode-cmake-build.png -------------------------------------------------------------------------------- /doc/images/vscode-cmake-configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/doc/images/vscode-cmake-configure.png -------------------------------------------------------------------------------- /src/apps/LoRaMac/common/Commissioning.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file Commissioning.h 3 | * 4 | * \brief End-device commissioning parameters 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #ifndef __COMMISSIONING_H__ 20 | #define __COMMISSIONING_H__ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | /*! 27 | ****************************************************************************** 28 | ********************************** WARNING *********************************** 29 | ****************************************************************************** 30 | 31 | The LoRaWAN AES128 keys are stored and provisionned on secure-elements. 32 | 33 | This project providdes a software emulated secure-element. 34 | The LoRaWAN AES128 keys SHALL be updated under 35 | src/peripherals/-se\se-identity.h file. 36 | 37 | ****************************************************************************** 38 | ****************************************************************************** 39 | ****************************************************************************** 40 | */ 41 | #include "se-identity.h" 42 | 43 | /*! 44 | * When set to 1 the application uses the Over-the-Air activation procedure 45 | * When set to 0 the application uses the Personalization activation procedure 46 | */ 47 | #define OVER_THE_AIR_ACTIVATION 1 48 | 49 | /*! 50 | * When using ABP activation the MAC layer must know in advance to which server 51 | * version it will be connected. 52 | */ 53 | #define ABP_ACTIVATION_LRWAN_VERSION_V10x 0x01000400 // 1.0.4.0 54 | #define ABP_ACTIVATION_LRWAN_VERSION_V11x 0x01010100 // 1.1.1.0 55 | 56 | #define ABP_ACTIVATION_LRWAN_VERSION ABP_ACTIVATION_LRWAN_VERSION_V11x 57 | 58 | /*! 59 | * Indicates if the end-device is to be connected to a private or public network 60 | */ 61 | #define LORAWAN_PUBLIC_NETWORK true 62 | 63 | /*! 64 | * Current network ID 65 | */ 66 | #define LORAWAN_NETWORK_ID ( uint32_t )0 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif // __COMMISSIONING_H__ 73 | -------------------------------------------------------------------------------- /src/apps/LoRaMac/common/LmHandler/packages/LmhpClockSync.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file LmhpClockSync.h 3 | * 4 | * \brief Implements the LoRa-Alliance clock synchronization package 5 | * Specification: https://lora-alliance.org/sites/default/files/2018-09/application_layer_clock_synchronization_v1.0.0.pdf 6 | * 7 | * \copyright Revised BSD License, see section \ref LICENSE. 8 | * 9 | * \code 10 | * ______ _ 11 | * / _____) _ | | 12 | * ( (____ _____ ____ _| |_ _____ ____| |__ 13 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 14 | * _____) ) ____| | | || |_| ____( (___| | | | 15 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 16 | * (C)2013-2018 Semtech 17 | * 18 | * \endcode 19 | * 20 | * \author Miguel Luis ( Semtech ) 21 | */ 22 | #ifndef __LMHP_CLOCK_SYNC_H__ 23 | #define __LMHP_CLOCK_SYNC_H__ 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "LoRaMac.h" 30 | #include "LmHandlerTypes.h" 31 | #include "LmhPackage.h" 32 | 33 | /*! 34 | * Clock sync package identifier. 35 | * 36 | * \remark This value must be unique amongst the packages 37 | */ 38 | #define PACKAGE_ID_CLOCK_SYNC 1 39 | 40 | /*! 41 | * Clock sync package parameters 42 | * 43 | * This package doesn't require parameters 44 | */ 45 | //typedef struct LmphClockSyncParams_s 46 | //{ 47 | //}LmphClockSyncParams_t; 48 | 49 | LmhPackage_t *LmphClockSyncPackageFactory( void ); 50 | 51 | LmHandlerErrorStatus_t LmhpClockSyncAppTimeReq( void ); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif // __LMHP_CLOCK_SYNC_H__ 58 | -------------------------------------------------------------------------------- /src/apps/LoRaMac/common/LmHandler/packages/LmhpCompliance.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file LmhpCompliance.h 3 | * 4 | * \brief Implements the LoRa-Alliance certification protocol handling 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2018 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | */ 21 | #ifndef __LMHP_COMPLIANCE__ 22 | #define __LMHP_COMPLIANCE__ 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | #include "LoRaMac.h" 29 | #include "LmHandlerTypes.h" 30 | #include "LmhPackage.h" 31 | 32 | /*! 33 | * Compliance package identifier. 34 | * 35 | * \remark This value must be unique amongst the packages 36 | */ 37 | #define PACKAGE_ID_COMPLIANCE 0 38 | 39 | /*! 40 | * Compliance test protocol handler parameters 41 | */ 42 | typedef struct LmhpComplianceParams_s 43 | { 44 | /*! 45 | * Current firmware version 46 | */ 47 | Version_t FwVersion; 48 | /*! 49 | * 50 | */ 51 | void ( *OnTxPeriodicityChanged )( uint32_t periodicity ); 52 | /*! 53 | * 54 | */ 55 | void ( *OnTxFrameCtrlChanged )( LmHandlerMsgTypes_t isTxConfirmed ); 56 | /*! 57 | * 58 | */ 59 | void ( *OnPingSlotPeriodicityChanged )( uint8_t pingSlotPeriodicity ); 60 | }LmhpComplianceParams_t; 61 | 62 | LmhPackage_t *LmphCompliancePackageFactory( void ); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif // __LMHP_COMPLIANCE__ 69 | -------------------------------------------------------------------------------- /src/apps/LoRaMac/common/LmHandler/packages/LmhpRemoteMcastSetup.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file LmhpRemoteMcastSetup.h 3 | * 4 | * \brief Implements the LoRa-Alliance remote multicast setup package 5 | * Specification: https://lora-alliance.org/sites/default/files/2018-09/remote_multicast_setup_v1.0.0.pdf 6 | * 7 | * \copyright Revised BSD License, see section \ref LICENSE. 8 | * 9 | * \code 10 | * ______ _ 11 | * / _____) _ | | 12 | * ( (____ _____ ____ _| |_ _____ ____| |__ 13 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 14 | * _____) ) ____| | | || |_| ____( (___| | | | 15 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 16 | * (C)2013-2018 Semtech 17 | * 18 | * \endcode 19 | * 20 | * \author Miguel Luis ( Semtech ) 21 | */ 22 | #ifndef __LMHP_REMOTE_MCAST_SETUP_H__ 23 | #define __LMHP_REMOTE_MCAST_SETUP_H__ 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #include "LoRaMac.h" 30 | #include "LmHandlerTypes.h" 31 | #include "LmhPackage.h" 32 | 33 | /*! 34 | * Remote multicast setup package identifier. 35 | * 36 | * \remark This value must be unique amongst the packages 37 | */ 38 | #define PACKAGE_ID_REMOTE_MCAST_SETUP 2 39 | 40 | /*! 41 | * Remote multicast setup package parameters 42 | * 43 | * This package doesn't require parameters 44 | */ 45 | //typedef struct LmhpRemoteMcastSetupParams_s 46 | //{ 47 | //}LmhpRemoteMcastSetupParams_t; 48 | 49 | LmhPackage_t *LmhpRemoteMcastSetupPackageFactory( void ); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif // __LMHP_REMOTE_MCAST_SETUP_H__ 56 | -------------------------------------------------------------------------------- /src/apps/LoRaMac/common/NvmDataMgmt.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file NvmDataMgmt.h 3 | * 4 | * \brief NVM context management implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * ___ _____ _ ___ _ _____ ___ ___ ___ ___ 18 | * / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 19 | * \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 20 | * |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 21 | * embedded.connectivity.solutions=============== 22 | * 23 | * \endcode 24 | * 25 | * \author Miguel Luis ( Semtech ) 26 | * 27 | * \author Gregory Cristian ( Semtech ) 28 | * 29 | * \author Daniel Jaeckle ( STACKFORCE ) 30 | * 31 | * \author Johannes Bruder ( STACKFORCE ) 32 | * 33 | * \defgroup NVMDATAMGMT NVM context management implementation 34 | * This module implements the NVM context handling 35 | * \{ 36 | */ 37 | #ifndef __NVMDATAMGMT_H__ 38 | #define __NVMDATAMGMT_H__ 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /*! 45 | * \brief NVM Management event. 46 | * 47 | * \param [IN] notifyFlags Bitmap which contains the information about modules that 48 | * changed. 49 | */ 50 | void NvmDataMgmtEvent( uint16_t notifyFlags ); 51 | 52 | /*! 53 | * \brief Function which stores the MAC data into NVM, if required. 54 | * 55 | * \retval Number of bytes which were stored. 56 | */ 57 | uint16_t NvmDataMgmtStore( void ); 58 | 59 | /*! 60 | * \brief Function which restores the MAC data from NVM, if required. 61 | * 62 | * \retval Number of bytes which were restored. 63 | */ 64 | uint16_t NvmDataMgmtRestore(void ); 65 | 66 | /*! 67 | * \brief Resets the NVM data. 68 | * 69 | * \retval Returns true, if successful. 70 | */ 71 | bool NvmDataMgmtFactoryReset( void ); 72 | 73 | /* \} */ 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif // __NVMDATAMGMT_H__ 80 | -------------------------------------------------------------------------------- /src/apps/LoRaMac/common/cli.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file cli.h 3 | * 4 | * \brief Command Line Interface handling implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #include 20 | #include 21 | #include 22 | #include "NvmDataMgmt.h" 23 | #include "cli.h" 24 | 25 | void CliProcess( Uart_t* uart ) 26 | { 27 | uint8_t data = 0; 28 | 29 | if( UartGetChar( uart, &data ) == 0 ) 30 | { 31 | if( data == '\x1B' ) 32 | { // Escape character has been received 33 | printf( "ESC + " ); 34 | while( UartGetChar( uart, &data ) != 0 ) 35 | { 36 | } 37 | printf( "%c\n", data ); 38 | if( data == 'N' ) 39 | { // N character has been received 40 | data = 0; 41 | // Reset NVM 42 | if( NvmDataMgmtFactoryReset( ) == true ) 43 | { 44 | printf( "\n\nNVM factory reset succeed\n" ); 45 | } 46 | else 47 | { 48 | printf( "\n\nNVM factory reset failed\n" ); 49 | } 50 | 51 | printf( "\n\nPLEASE RESET THE END-DEVICE\n\n" ); 52 | while( 1 ); 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /src/apps/LoRaMac/common/cli.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file cli.h 3 | * 4 | * \brief Command Line Interface handling definition 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #ifndef CLI_H 20 | #define CLI_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #include "uart.h" 27 | 28 | /*! 29 | * Process characters received on the serial interface 30 | * \remark Characters sequence 'ESC' + 'N' execute a NVM factory reset 31 | * All other sequences are ignored 32 | * 33 | * \param [IN] uart UART interface object used by the command line interface 34 | */ 35 | void CliProcess( Uart_t* uart ); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif // CLI_H 42 | -------------------------------------------------------------------------------- /src/apps/LoRaMac/common/githubVersion.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file githubVersion.h 3 | * 4 | * \brief GitHub version definition 5 | * 6 | * \copyright Revised BSD License, see file LICENSE.txt 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2019-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | 20 | #ifndef __GITHUB_VERSION_H__ 21 | #define __GITHUB_VERSION_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #define GITHUB_VERSION 0x04070000 // 4.7.0.0 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif // __GITHUB_VERSION_H__ 34 | -------------------------------------------------------------------------------- /src/apps/LoRaMac/fuota-test-01/firmwareVersion.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file firmwareVersion.h 3 | * 4 | * \brief Firmware version definition 5 | * 6 | * \copyright Revised BSD License, see file LICENSE.txt 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2019-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | 20 | #ifndef __FIRMWARE_VERSION_H__ 21 | #define __FIRMWARE_VERSION_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #define FIRMWARE_VERSION 0x01030000 // 1.3.0.0 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif // __FIRMWARE_VERSION_H__ 34 | -------------------------------------------------------------------------------- /src/apps/LoRaMac/periodic-uplink-lpp/firmwareVersion.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file firmwareVersion.h 3 | * 4 | * \brief Firmware version definition 5 | * 6 | * \copyright Revised BSD License, see file LICENSE.txt 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2019-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | 20 | #ifndef __FIRMWARE_VERSION_H__ 21 | #define __FIRMWARE_VERSION_H__ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #define FIRMWARE_VERSION 0x01030000 // 1.3.0.0 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif // __FIRMWARE_VERSION_H__ 34 | -------------------------------------------------------------------------------- /src/boards/B-L072Z-LRWAN1/delay-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay-board.c 3 | * 4 | * \brief Target board delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | * 23 | * \author Johannes Bruder ( STACKFORCE ) 24 | */ 25 | #include "stm32l0xx.h" 26 | #include "delay-board.h" 27 | 28 | void DelayMsMcu( uint32_t ms ) 29 | { 30 | HAL_Delay( ms ); 31 | } 32 | -------------------------------------------------------------------------------- /src/boards/B-L072Z-LRWAN1/eeprom-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file eeprom-board.c 3 | * 4 | * \brief Target board EEPROM driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "stm32l0xx.h" 24 | #include "utilities.h" 25 | #include "eeprom-board.h" 26 | 27 | LmnStatus_t EepromMcuWriteBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 28 | { 29 | LmnStatus_t status = LMN_STATUS_ERROR; 30 | 31 | assert_param( ( DATA_EEPROM_BASE + addr ) >= DATA_EEPROM_BASE ); 32 | assert_param( buffer != NULL ); 33 | assert_param( size < ( DATA_EEPROM_BANK2_END - DATA_EEPROM_BASE ) ); 34 | 35 | if( HAL_FLASHEx_DATAEEPROM_Unlock( ) == HAL_OK ) 36 | { 37 | CRITICAL_SECTION_BEGIN( ); 38 | for( uint16_t i = 0; i < size; i++ ) 39 | { 40 | if( HAL_FLASHEx_DATAEEPROM_Program( FLASH_TYPEPROGRAMDATA_BYTE, 41 | ( DATA_EEPROM_BASE + addr + i ), 42 | buffer[i] ) != HAL_OK ) 43 | { 44 | // Failed to write EEPROM 45 | break; 46 | } 47 | } 48 | CRITICAL_SECTION_END( ); 49 | status = LMN_STATUS_OK; 50 | } 51 | 52 | HAL_FLASHEx_DATAEEPROM_Lock( ); 53 | return status; 54 | } 55 | 56 | LmnStatus_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 57 | { 58 | assert_param( ( DATA_EEPROM_BASE + addr ) >= DATA_EEPROM_BASE ); 59 | assert_param( buffer != NULL ); 60 | assert_param( size < ( DATA_EEPROM_BANK2_END - DATA_EEPROM_BASE ) ); 61 | 62 | memcpy1( buffer, ( uint8_t* )( DATA_EEPROM_BASE + addr ), size ); 63 | return LMN_STATUS_OK; 64 | } 65 | 66 | void EepromMcuSetDeviceAddr( uint8_t addr ) 67 | { 68 | assert_param( LMN_STATUS_ERROR ); 69 | } 70 | 71 | LmnStatus_t EepromMcuGetDeviceAddr( void ) 72 | { 73 | assert_param( LMN_STATUS_ERROR ); 74 | return 0; 75 | } 76 | -------------------------------------------------------------------------------- /src/boards/B-L072Z-LRWAN1/sysIrqHandlers.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file sysIrqHandlers.h 3 | * 4 | * \brief Default IRQ handlers 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #ifndef SYS_IRQ_HANDLERS_H 20 | #define SYS_IRQ_HANDLERS_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void NMI_Handler( void ); 27 | 28 | void HardFault_Handler( void ); 29 | 30 | void MemManage_Handler( void ); 31 | 32 | void BusFault_Handler( void ); 33 | 34 | void UsageFault_Handler( void ); 35 | 36 | void DebugMon_Handler( void ); 37 | 38 | void SysTick_Handler( void ); 39 | 40 | void EXTI0_1_IRQHandler( void ); 41 | 42 | void EXTI2_3_IRQHandler( void ); 43 | 44 | void EXTI4_15_IRQHandler( void ); 45 | 46 | void RTC_IRQHandler( void ); 47 | 48 | void USART2_IRQHandler( void ); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif // SYS_IRQ_HANDLERS_H 55 | -------------------------------------------------------------------------------- /src/boards/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## ______ _ 3 | ## / _____) _ | | 4 | ## ( (____ _____ ____ _| |_ _____ ____| |__ 5 | ## \____ \| ___ | (_ _) ___ |/ ___) _ \ 6 | ## _____) ) ____| | | || |_| ____( (___| | | | 7 | ## (______/|_____)_|_|_| \__)_____)\____)_| |_| 8 | ## (C)2013-2017 Semtech 9 | ## ___ _____ _ ___ _ _____ ___ ___ ___ ___ 10 | ## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 11 | ## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 12 | ## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 13 | ## embedded.connectivity.solutions.============== 14 | ## 15 | ## License: Revised BSD License, see LICENSE.TXT file included in the project 16 | ## Authors: Johannes Bruder (STACKFORCE), Miguel Luis (Semtech) 17 | ## 18 | cmake_minimum_required(VERSION 3.6) 19 | 20 | project(board) 21 | 22 | #--------------------------------------------------------------------------------------- 23 | # Target 24 | #--------------------------------------------------------------------------------------- 25 | add_library(${PROJECT_NAME} INTERFACE) 26 | 27 | target_include_directories(${PROJECT_NAME} INTERFACE 28 | $ 29 | ) 30 | -------------------------------------------------------------------------------- /src/boards/NAMote72/cmsis/mxconstants.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : mxconstants.h 4 | * Description : This file contains the common defines of the application 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2016 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | /* Define to prevent recursive inclusion -------------------------------------*/ 34 | #ifndef __MXCONSTANT_H 35 | #define __MXCONSTANT_H 36 | /* Includes ------------------------------------------------------------------*/ 37 | 38 | /* USER CODE BEGIN Includes */ 39 | 40 | /* USER CODE END Includes */ 41 | 42 | /* Private define ------------------------------------------------------------*/ 43 | 44 | /* USER CODE BEGIN Private defines */ 45 | 46 | /* USER CODE END Private defines */ 47 | 48 | /** 49 | * @} 50 | */ 51 | 52 | /** 53 | * @} 54 | */ 55 | 56 | #endif /* __MXCONSTANT_H */ 57 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 58 | -------------------------------------------------------------------------------- /src/boards/NAMote72/cmsis/stm32l152xc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/NAMote72/cmsis/stm32l152xc.h -------------------------------------------------------------------------------- /src/boards/NAMote72/cmsis/stm32l1xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/NAMote72/cmsis/stm32l1xx.h -------------------------------------------------------------------------------- /src/boards/NAMote72/delay-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay-board.c 3 | * 4 | * \brief Target board delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | * 23 | * \author Johannes Bruder ( STACKFORCE ) 24 | */ 25 | #include "stm32l1xx.h" 26 | #include "delay-board.h" 27 | 28 | void DelayMsMcu( uint32_t ms ) 29 | { 30 | HAL_Delay( ms ); 31 | } 32 | -------------------------------------------------------------------------------- /src/boards/NAMote72/eeprom-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file eeprom-board.c 3 | * 4 | * \brief Target board EEPROM driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "stm32l1xx.h" 24 | #include "utilities.h" 25 | #include "eeprom-board.h" 26 | 27 | LmnStatus_t EepromMcuWriteBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 28 | { 29 | LmnStatus_t status = LMN_STATUS_ERROR; 30 | 31 | assert_param( ( FLASH_EEPROM_BASE + addr ) >= FLASH_EEPROM_BASE ); 32 | assert_param( buffer != NULL ); 33 | assert_param( size < ( FLASH_EEPROM_END - FLASH_EEPROM_BASE ) ); 34 | 35 | if( HAL_FLASHEx_DATAEEPROM_Unlock( ) == HAL_OK ) 36 | { 37 | CRITICAL_SECTION_BEGIN( ); 38 | for( uint16_t i = 0; i < size; i++ ) 39 | { 40 | if( HAL_FLASHEx_DATAEEPROM_Program( FLASH_TYPEPROGRAMDATA_BYTE, 41 | ( FLASH_EEPROM_BASE + addr + i ), 42 | buffer[i] ) != HAL_OK ) 43 | { 44 | // Failed to write EEPROM 45 | break; 46 | } 47 | } 48 | CRITICAL_SECTION_END( ); 49 | status = LMN_STATUS_OK; 50 | } 51 | 52 | HAL_FLASHEx_DATAEEPROM_Lock( ); 53 | return status; 54 | } 55 | 56 | LmnStatus_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 57 | { 58 | assert_param( ( FLASH_EEPROM_BASE + addr ) >= FLASH_EEPROM_BASE ); 59 | assert_param( buffer != NULL ); 60 | assert_param( size < ( FLASH_EEPROM_END - FLASH_EEPROM_BASE ) ); 61 | 62 | memcpy1( buffer, ( uint8_t* )( FLASH_EEPROM_BASE + addr ), size ); 63 | return LMN_STATUS_OK; 64 | } 65 | 66 | void EepromMcuSetDeviceAddr( uint8_t addr ) 67 | { 68 | assert_param( LMN_STATUS_ERROR ); 69 | } 70 | 71 | LmnStatus_t EepromMcuGetDeviceAddr( void ) 72 | { 73 | assert_param( LMN_STATUS_ERROR ); 74 | return 0; 75 | } 76 | -------------------------------------------------------------------------------- /src/boards/NAMote72/sysIrqHandlers.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file sysIrqHandlers.h 3 | * 4 | * \brief Default IRQ handlers 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #ifndef SYS_IRQ_HANDLERS_H 20 | #define SYS_IRQ_HANDLERS_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void NMI_Handler( void ); 27 | 28 | void HardFault_Handler( void ); 29 | 30 | void MemManage_Handler( void ); 31 | 32 | void BusFault_Handler( void ); 33 | 34 | void UsageFault_Handler( void ); 35 | 36 | void DebugMon_Handler( void ); 37 | 38 | void SysTick_Handler( void ); 39 | 40 | void EXTI0_IRQHandler( void ); 41 | 42 | void EXTI1_IRQHandler( void ); 43 | 44 | void EXTI2_IRQHandler( void ); 45 | 46 | void EXTI3_IRQHandler( void ); 47 | 48 | void EXTI4_IRQHandler( void ); 49 | 50 | void EXTI9_5_IRQHandler( void ); 51 | 52 | void EXTI15_10_IRQHandler( void ); 53 | 54 | void RTC_Alarm_IRQHandler( void ); 55 | 56 | void USART1_IRQHandler( void ); 57 | 58 | void USART2_IRQHandler( void ); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif // SYS_IRQ_HANDLERS_H 65 | -------------------------------------------------------------------------------- /src/boards/NucleoL073/cmsis/mxconstants.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : mxconstants.h 4 | * Description : This file contains the common defines of the application 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2016 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | /* Define to prevent recursive inclusion -------------------------------------*/ 34 | #ifndef __MXCONSTANT_H 35 | #define __MXCONSTANT_H 36 | /* Includes ------------------------------------------------------------------*/ 37 | 38 | /* USER CODE BEGIN Includes */ 39 | 40 | /* USER CODE END Includes */ 41 | 42 | /* Private define ------------------------------------------------------------*/ 43 | 44 | /* USER CODE BEGIN Private defines */ 45 | 46 | /* USER CODE END Private defines */ 47 | 48 | /** 49 | * @} 50 | */ 51 | 52 | /** 53 | * @} 54 | */ 55 | 56 | #endif /* __MXCONSTANT_H */ 57 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 58 | -------------------------------------------------------------------------------- /src/boards/NucleoL073/delay-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay-board.c 3 | * 4 | * \brief Target board delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | * 23 | * \author Johannes Bruder ( STACKFORCE ) 24 | */ 25 | #include "stm32l0xx.h" 26 | #include "delay-board.h" 27 | 28 | void DelayMsMcu( uint32_t ms ) 29 | { 30 | HAL_Delay( ms ); 31 | } 32 | -------------------------------------------------------------------------------- /src/boards/NucleoL073/eeprom-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file eeprom-board.c 3 | * 4 | * \brief Target board EEPROM driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "stm32l0xx.h" 24 | #include "utilities.h" 25 | #include "eeprom-board.h" 26 | 27 | LmnStatus_t EepromMcuWriteBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 28 | { 29 | LmnStatus_t status = LMN_STATUS_ERROR; 30 | 31 | assert_param( ( DATA_EEPROM_BASE + addr ) >= DATA_EEPROM_BASE ); 32 | assert_param( buffer != NULL ); 33 | assert_param( size < ( DATA_EEPROM_BANK2_END - DATA_EEPROM_BASE ) ); 34 | 35 | if( HAL_FLASHEx_DATAEEPROM_Unlock( ) == HAL_OK ) 36 | { 37 | CRITICAL_SECTION_BEGIN( ); 38 | for( uint16_t i = 0; i < size; i++ ) 39 | { 40 | if( HAL_FLASHEx_DATAEEPROM_Program( FLASH_TYPEPROGRAMDATA_BYTE, 41 | ( DATA_EEPROM_BASE + addr + i ), 42 | buffer[i] ) != HAL_OK ) 43 | { 44 | // Failed to write EEPROM 45 | break; 46 | } 47 | } 48 | CRITICAL_SECTION_END( ); 49 | status = LMN_STATUS_OK; 50 | } 51 | 52 | HAL_FLASHEx_DATAEEPROM_Lock( ); 53 | return status; 54 | } 55 | 56 | LmnStatus_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 57 | { 58 | assert_param( ( DATA_EEPROM_BASE + addr ) >= DATA_EEPROM_BASE ); 59 | assert_param( buffer != NULL ); 60 | assert_param( size < ( DATA_EEPROM_BANK2_END - DATA_EEPROM_BASE ) ); 61 | 62 | memcpy1( buffer, ( uint8_t* )( DATA_EEPROM_BASE + addr ), size ); 63 | return LMN_STATUS_OK; 64 | } 65 | 66 | void EepromMcuSetDeviceAddr( uint8_t addr ) 67 | { 68 | assert_param( LMN_STATUS_ERROR ); 69 | } 70 | 71 | LmnStatus_t EepromMcuGetDeviceAddr( void ) 72 | { 73 | assert_param( LMN_STATUS_ERROR ); 74 | return 0; 75 | } 76 | -------------------------------------------------------------------------------- /src/boards/NucleoL073/sysIrqHandlers.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file sysIrqHandlers.h 3 | * 4 | * \brief Default IRQ handlers 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #ifndef SYS_IRQ_HANDLERS_H 20 | #define SYS_IRQ_HANDLERS_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void NMI_Handler( void ); 27 | 28 | void HardFault_Handler( void ); 29 | 30 | void MemManage_Handler( void ); 31 | 32 | void BusFault_Handler( void ); 33 | 34 | void UsageFault_Handler( void ); 35 | 36 | void DebugMon_Handler( void ); 37 | 38 | void SysTick_Handler( void ); 39 | 40 | void EXTI0_1_IRQHandler( void ); 41 | 42 | void EXTI2_3_IRQHandler( void ); 43 | 44 | void EXTI4_15_IRQHandler( void ); 45 | 46 | void RTC_IRQHandler( void ); 47 | 48 | void USART2_IRQHandler( void ); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif // SYS_IRQ_HANDLERS_H 55 | -------------------------------------------------------------------------------- /src/boards/NucleoL152/cmsis/mxconstants.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : mxconstants.h 4 | * Description : This file contains the common defines of the application 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2016 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | /* Define to prevent recursive inclusion -------------------------------------*/ 34 | #ifndef __MXCONSTANT_H 35 | #define __MXCONSTANT_H 36 | /* Includes ------------------------------------------------------------------*/ 37 | 38 | /* USER CODE BEGIN Includes */ 39 | 40 | /* USER CODE END Includes */ 41 | 42 | /* Private define ------------------------------------------------------------*/ 43 | 44 | /* USER CODE BEGIN Private defines */ 45 | 46 | /* USER CODE END Private defines */ 47 | 48 | /** 49 | * @} 50 | */ 51 | 52 | /** 53 | * @} 54 | */ 55 | 56 | #endif /* __MXCONSTANT_H */ 57 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 58 | -------------------------------------------------------------------------------- /src/boards/NucleoL152/cmsis/stm32l152xe.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/NucleoL152/cmsis/stm32l152xe.h -------------------------------------------------------------------------------- /src/boards/NucleoL152/cmsis/stm32l1xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/NucleoL152/cmsis/stm32l1xx.h -------------------------------------------------------------------------------- /src/boards/NucleoL152/delay-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay-board.c 3 | * 4 | * \brief Target board delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | * 23 | * \author Johannes Bruder ( STACKFORCE ) 24 | */ 25 | #include "stm32l1xx.h" 26 | #include "delay-board.h" 27 | 28 | void DelayMsMcu( uint32_t ms ) 29 | { 30 | HAL_Delay( ms ); 31 | } 32 | -------------------------------------------------------------------------------- /src/boards/NucleoL152/eeprom-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file eeprom-board.c 3 | * 4 | * \brief Target board EEPROM driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "stm32l1xx.h" 24 | #include "utilities.h" 25 | #include "eeprom-board.h" 26 | 27 | LmnStatus_t EepromMcuWriteBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 28 | { 29 | LmnStatus_t status = LMN_STATUS_ERROR; 30 | 31 | assert_param( ( FLASH_EEPROM_BASE + addr ) >= FLASH_EEPROM_BASE ); 32 | assert_param( buffer != NULL ); 33 | assert_param( size < ( FLASH_EEPROM_END - FLASH_EEPROM_BASE ) ); 34 | 35 | if( HAL_FLASHEx_DATAEEPROM_Unlock( ) == HAL_OK ) 36 | { 37 | CRITICAL_SECTION_BEGIN( ); 38 | for( uint16_t i = 0; i < size; i++ ) 39 | { 40 | if( HAL_FLASHEx_DATAEEPROM_Program( FLASH_TYPEPROGRAMDATA_BYTE, 41 | ( FLASH_EEPROM_BASE + addr + i ), 42 | buffer[i] ) != HAL_OK ) 43 | { 44 | // Failed to write EEPROM 45 | break; 46 | } 47 | } 48 | CRITICAL_SECTION_END( ); 49 | status = LMN_STATUS_OK; 50 | } 51 | 52 | HAL_FLASHEx_DATAEEPROM_Lock( ); 53 | return status; 54 | } 55 | 56 | LmnStatus_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 57 | { 58 | assert_param( ( FLASH_EEPROM_BASE + addr ) >= FLASH_EEPROM_BASE ); 59 | assert_param( buffer != NULL ); 60 | assert_param( size < ( FLASH_EEPROM_END - FLASH_EEPROM_BASE ) ); 61 | 62 | memcpy1( buffer, ( uint8_t* )( FLASH_EEPROM_BASE + addr ), size ); 63 | return LMN_STATUS_OK; 64 | } 65 | 66 | void EepromMcuSetDeviceAddr( uint8_t addr ) 67 | { 68 | assert_param( LMN_STATUS_ERROR ); 69 | } 70 | 71 | LmnStatus_t EepromMcuGetDeviceAddr( void ) 72 | { 73 | assert_param( LMN_STATUS_ERROR ); 74 | return 0; 75 | } 76 | -------------------------------------------------------------------------------- /src/boards/NucleoL152/sysIrqHandlers.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file sysIrqHandlers.h 3 | * 4 | * \brief Default IRQ handlers 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #ifndef SYS_IRQ_HANDLERS_H 20 | #define SYS_IRQ_HANDLERS_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void NMI_Handler( void ); 27 | 28 | void HardFault_Handler( void ); 29 | 30 | void MemManage_Handler( void ); 31 | 32 | void BusFault_Handler( void ); 33 | 34 | void UsageFault_Handler( void ); 35 | 36 | void DebugMon_Handler( void ); 37 | 38 | void SysTick_Handler( void ); 39 | 40 | void EXTI0_IRQHandler( void ); 41 | 42 | void EXTI1_IRQHandler( void ); 43 | 44 | void EXTI2_IRQHandler( void ); 45 | 46 | void EXTI3_IRQHandler( void ); 47 | 48 | void EXTI4_IRQHandler( void ); 49 | 50 | void EXTI9_5_IRQHandler( void ); 51 | 52 | void EXTI15_10_IRQHandler( void ); 53 | 54 | void RTC_Alarm_IRQHandler( void ); 55 | 56 | void USART2_IRQHandler( void ); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif // SYS_IRQ_HANDLERS_H 63 | -------------------------------------------------------------------------------- /src/boards/NucleoL476/cmsis/mxconstants.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : mxconstants.h 4 | * Description : This file contains the common defines of the application 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2016 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | /* Define to prevent recursive inclusion -------------------------------------*/ 34 | #ifndef __MXCONSTANT_H 35 | #define __MXCONSTANT_H 36 | /* Includes ------------------------------------------------------------------*/ 37 | 38 | /* USER CODE BEGIN Includes */ 39 | 40 | /* USER CODE END Includes */ 41 | 42 | /* Private define ------------------------------------------------------------*/ 43 | 44 | /* USER CODE BEGIN Private defines */ 45 | 46 | /* USER CODE END Private defines */ 47 | 48 | /** 49 | * @} 50 | */ 51 | 52 | /** 53 | * @} 54 | */ 55 | 56 | #endif /* __MXCONSTANT_H */ 57 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 58 | -------------------------------------------------------------------------------- /src/boards/NucleoL476/cmsis/stm32l476xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/NucleoL476/cmsis/stm32l476xx.h -------------------------------------------------------------------------------- /src/boards/NucleoL476/cmsis/stm32l4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/NucleoL476/cmsis/stm32l4xx.h -------------------------------------------------------------------------------- /src/boards/NucleoL476/delay-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay-board.c 3 | * 4 | * \brief Target board delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | * 23 | * \author Johannes Bruder ( STACKFORCE ) 24 | */ 25 | #include "stm32l4xx.h" 26 | #include "delay-board.h" 27 | 28 | void DelayMsMcu( uint32_t ms ) 29 | { 30 | HAL_Delay( ms ); 31 | } 32 | -------------------------------------------------------------------------------- /src/boards/NucleoL476/sysIrqHandlers.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file sysIrqHandlers.h 3 | * 4 | * \brief Default IRQ handlers 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #ifndef SYS_IRQ_HANDLERS_H 20 | #define SYS_IRQ_HANDLERS_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void NMI_Handler( void ); 27 | 28 | void HardFault_Handler( void ); 29 | 30 | void MemManage_Handler( void ); 31 | 32 | void BusFault_Handler( void ); 33 | 34 | void UsageFault_Handler( void ); 35 | 36 | void DebugMon_Handler( void ); 37 | 38 | void FLASH_IRQHandler( void ); 39 | 40 | void PVD_PVM_IRQHandler( void ); 41 | 42 | void SysTick_Handler( void ); 43 | 44 | void EXTI0_IRQHandler( void ); 45 | 46 | void EXTI1_IRQHandler( void ); 47 | 48 | void EXTI2_IRQHandler( void ); 49 | 50 | void EXTI3_IRQHandler( void ); 51 | 52 | void EXTI4_IRQHandler( void ); 53 | 54 | void EXTI9_5_IRQHandler( void ); 55 | 56 | void EXTI15_10_IRQHandler( void ); 57 | 58 | void RTC_Alarm_IRQHandler( void ); 59 | 60 | void USART2_IRQHandler( void ); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif // SYS_IRQ_HANDLERS_H 67 | -------------------------------------------------------------------------------- /src/boards/SAMR34/delay-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay-board.c 3 | * 4 | * \brief Target board delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | * 23 | * \author Johannes Bruder ( STACKFORCE ) 24 | * 25 | * \author Marten Lootsma(TWTG) on behalf of Microchip/Atmel (c)2017 26 | */ 27 | #include 28 | #include "delay-board.h" 29 | 30 | void DelayMsMcu( uint32_t ms ) 31 | { 32 | delay_ms( ms ); 33 | } 34 | -------------------------------------------------------------------------------- /src/boards/SAMR34/eeprom-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file eeprom-board.c 3 | * 4 | * \brief Target board EEPROM driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "utilities.h" 24 | #include "eeprom-board.h" 25 | 26 | LmnStatus_t EepromMcuWriteBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 27 | { 28 | LmnStatus_t status = LMN_STATUS_ERROR; 29 | 30 | return status; 31 | } 32 | 33 | LmnStatus_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 34 | { 35 | return LMN_STATUS_ERROR; 36 | } 37 | 38 | void EepromMcuSetDeviceAddr( uint8_t addr ) 39 | { 40 | while( 1 ) 41 | { 42 | } 43 | } 44 | 45 | LmnStatus_t EepromMcuGetDeviceAddr( void ) 46 | { 47 | while( 1 ) 48 | { 49 | } 50 | // return 0; 51 | } 52 | -------------------------------------------------------------------------------- /src/boards/SKiM880B/cmsis/mxconstants.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : mxconstants.h 4 | * Description : This file contains the common defines of the application 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2016 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | /* Define to prevent recursive inclusion -------------------------------------*/ 34 | #ifndef __MXCONSTANT_H 35 | #define __MXCONSTANT_H 36 | /* Includes ------------------------------------------------------------------*/ 37 | 38 | /* USER CODE BEGIN Includes */ 39 | 40 | /* USER CODE END Includes */ 41 | 42 | /* Private define ------------------------------------------------------------*/ 43 | 44 | /* USER CODE BEGIN Private defines */ 45 | 46 | /* USER CODE END Private defines */ 47 | 48 | /** 49 | * @} 50 | */ 51 | 52 | /** 53 | * @} 54 | */ 55 | 56 | #endif /* __MXCONSTANT_H */ 57 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 58 | -------------------------------------------------------------------------------- /src/boards/SKiM880B/cmsis/stm32l151xba.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/SKiM880B/cmsis/stm32l151xba.h -------------------------------------------------------------------------------- /src/boards/SKiM880B/cmsis/stm32l1xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/SKiM880B/cmsis/stm32l1xx.h -------------------------------------------------------------------------------- /src/boards/SKiM880B/delay-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay-board.c 3 | * 4 | * \brief Target board delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | * 23 | * \author Johannes Bruder ( STACKFORCE ) 24 | */ 25 | #include "stm32l1xx.h" 26 | #include "delay-board.h" 27 | 28 | void DelayMsMcu( uint32_t ms ) 29 | { 30 | HAL_Delay( ms ); 31 | } 32 | -------------------------------------------------------------------------------- /src/boards/SKiM880B/eeprom-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file eeprom-board.c 3 | * 4 | * \brief Target board EEPROM driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "stm32l1xx.h" 24 | #include "utilities.h" 25 | #include "eeprom-board.h" 26 | 27 | LmnStatus_t EepromMcuWriteBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 28 | { 29 | LmnStatus_t status = LMN_STATUS_ERROR; 30 | 31 | assert_param( ( FLASH_EEPROM_BASE + addr ) >= FLASH_EEPROM_BASE ); 32 | assert_param( buffer != NULL ); 33 | assert_param( size < ( FLASH_EEPROM_END - FLASH_EEPROM_BASE ) ); 34 | 35 | if( HAL_FLASHEx_DATAEEPROM_Unlock( ) == HAL_OK ) 36 | { 37 | CRITICAL_SECTION_BEGIN( ); 38 | for( uint16_t i = 0; i < size; i++ ) 39 | { 40 | if( HAL_FLASHEx_DATAEEPROM_Program( FLASH_TYPEPROGRAMDATA_BYTE, 41 | ( FLASH_EEPROM_BASE + addr + i ), 42 | buffer[i] ) != HAL_OK ) 43 | { 44 | // Failed to write EEPROM 45 | break; 46 | } 47 | } 48 | CRITICAL_SECTION_END( ); 49 | status = LMN_STATUS_OK; 50 | } 51 | 52 | HAL_FLASHEx_DATAEEPROM_Lock( ); 53 | return status; 54 | } 55 | 56 | LmnStatus_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 57 | { 58 | assert_param( ( FLASH_EEPROM_BASE + addr ) >= FLASH_EEPROM_BASE ); 59 | assert_param( buffer != NULL ); 60 | assert_param( size < ( FLASH_EEPROM_END - FLASH_EEPROM_BASE ) ); 61 | 62 | memcpy1( buffer, ( uint8_t* )( FLASH_EEPROM_BASE + addr ), size ); 63 | return LMN_STATUS_OK; 64 | } 65 | 66 | void EepromMcuSetDeviceAddr( uint8_t addr ) 67 | { 68 | assert_param( LMN_STATUS_ERROR ); 69 | } 70 | 71 | LmnStatus_t EepromMcuGetDeviceAddr( void ) 72 | { 73 | assert_param( LMN_STATUS_ERROR ); 74 | return 0; 75 | } 76 | -------------------------------------------------------------------------------- /src/boards/SKiM880B/sysIrqHandlers.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file sysIrqHandlers.h 3 | * 4 | * \brief Default IRQ handlers 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #ifndef SYS_IRQ_HANDLERS_H 20 | #define SYS_IRQ_HANDLERS_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void NMI_Handler( void ); 27 | 28 | void HardFault_Handler( void ); 29 | 30 | void MemManage_Handler( void ); 31 | 32 | void BusFault_Handler( void ); 33 | 34 | void UsageFault_Handler( void ); 35 | 36 | void DebugMon_Handler( void ); 37 | 38 | void SysTick_Handler( void ); 39 | 40 | void EXTI0_IRQHandler( void ); 41 | 42 | void EXTI1_IRQHandler( void ); 43 | 44 | void EXTI2_IRQHandler( void ); 45 | 46 | void EXTI3_IRQHandler( void ); 47 | 48 | void EXTI4_IRQHandler( void ); 49 | 50 | void EXTI9_5_IRQHandler( void ); 51 | 52 | void EXTI15_10_IRQHandler( void ); 53 | 54 | void RTC_Alarm_IRQHandler( void ); 55 | 56 | void USART1_IRQHandler( void ); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif // SYS_IRQ_HANDLERS_H 63 | -------------------------------------------------------------------------------- /src/boards/SKiM881AXL/cmsis/mxconstants.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : mxconstants.h 4 | * Description : This file contains the common defines of the application 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2016 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | /* Define to prevent recursive inclusion -------------------------------------*/ 34 | #ifndef __MXCONSTANT_H 35 | #define __MXCONSTANT_H 36 | /* Includes ------------------------------------------------------------------*/ 37 | 38 | /* USER CODE BEGIN Includes */ 39 | 40 | /* USER CODE END Includes */ 41 | 42 | /* Private define ------------------------------------------------------------*/ 43 | 44 | /* USER CODE BEGIN Private defines */ 45 | 46 | /* USER CODE END Private defines */ 47 | 48 | /** 49 | * @} 50 | */ 51 | 52 | /** 53 | * @} 54 | */ 55 | 56 | #endif /* __MXCONSTANT_H */ 57 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 58 | -------------------------------------------------------------------------------- /src/boards/SKiM881AXL/delay-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay-board.c 3 | * 4 | * \brief Target board delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | * 23 | * \author Johannes Bruder ( STACKFORCE ) 24 | */ 25 | #include "stm32l0xx.h" 26 | #include "delay-board.h" 27 | 28 | void DelayMsMcu( uint32_t ms ) 29 | { 30 | HAL_Delay( ms ); 31 | } 32 | -------------------------------------------------------------------------------- /src/boards/SKiM881AXL/eeprom-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file eeprom-board.c 3 | * 4 | * \brief Target board EEPROM driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "stm32l0xx.h" 24 | #include "utilities.h" 25 | #include "eeprom-board.h" 26 | 27 | LmnStatus_t EepromMcuWriteBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 28 | { 29 | LmnStatus_t status = LMN_STATUS_ERROR; 30 | 31 | assert_param( ( DATA_EEPROM_BASE + addr ) >= DATA_EEPROM_BASE ); 32 | assert_param( buffer != NULL ); 33 | assert_param( size < ( DATA_EEPROM_BANK2_END - DATA_EEPROM_BASE ) ); 34 | 35 | if( HAL_FLASHEx_DATAEEPROM_Unlock( ) == HAL_OK ) 36 | { 37 | CRITICAL_SECTION_BEGIN( ); 38 | for( uint16_t i = 0; i < size; i++ ) 39 | { 40 | if( HAL_FLASHEx_DATAEEPROM_Program( FLASH_TYPEPROGRAMDATA_BYTE, 41 | ( DATA_EEPROM_BASE + addr + i ), 42 | buffer[i] ) != HAL_OK ) 43 | { 44 | // Failed to write EEPROM 45 | break; 46 | } 47 | } 48 | CRITICAL_SECTION_END( ); 49 | status = LMN_STATUS_OK; 50 | } 51 | 52 | HAL_FLASHEx_DATAEEPROM_Lock( ); 53 | return status; 54 | } 55 | 56 | LmnStatus_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 57 | { 58 | assert_param( ( DATA_EEPROM_BASE + addr ) >= DATA_EEPROM_BASE ); 59 | assert_param( buffer != NULL ); 60 | assert_param( size < ( DATA_EEPROM_BANK2_END - DATA_EEPROM_BASE ) ); 61 | 62 | memcpy1( buffer, ( uint8_t* )( DATA_EEPROM_BASE + addr ), size ); 63 | return LMN_STATUS_OK; 64 | } 65 | 66 | void EepromMcuSetDeviceAddr( uint8_t addr ) 67 | { 68 | assert_param( LMN_STATUS_ERROR ); 69 | } 70 | 71 | LmnStatus_t EepromMcuGetDeviceAddr( void ) 72 | { 73 | assert_param( LMN_STATUS_ERROR ); 74 | return 0; 75 | } 76 | -------------------------------------------------------------------------------- /src/boards/SKiM881AXL/sysIrqHandlers.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file sysIrqHandlers.h 3 | * 4 | * \brief Default IRQ handlers 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #ifndef SYS_IRQ_HANDLERS_H 20 | #define SYS_IRQ_HANDLERS_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void NMI_Handler( void ); 27 | 28 | void HardFault_Handler( void ); 29 | 30 | void MemManage_Handler( void ); 31 | 32 | void BusFault_Handler( void ); 33 | 34 | void UsageFault_Handler( void ); 35 | 36 | void DebugMon_Handler( void ); 37 | 38 | void SysTick_Handler( void ); 39 | 40 | void EXTI0_1_IRQHandler( void ); 41 | 42 | void EXTI2_3_IRQHandler( void ); 43 | 44 | void EXTI4_15_IRQHandler( void ); 45 | 46 | void RTC_IRQHandler( void ); 47 | 48 | void USART1_IRQHandler( void ); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif // SYS_IRQ_HANDLERS_H 55 | -------------------------------------------------------------------------------- /src/boards/SKiM980A/cmsis/stm32l151xba.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/SKiM980A/cmsis/stm32l151xba.h -------------------------------------------------------------------------------- /src/boards/SKiM980A/cmsis/stm32l1xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/SKiM980A/cmsis/stm32l1xx.h -------------------------------------------------------------------------------- /src/boards/SKiM980A/delay-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay-board.c 3 | * 4 | * \brief Target board delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | * 23 | * \author Johannes Bruder ( STACKFORCE ) 24 | */ 25 | #include "stm32l1xx.h" 26 | #include "delay-board.h" 27 | 28 | void DelayMsMcu( uint32_t ms ) 29 | { 30 | HAL_Delay( ms ); 31 | } 32 | -------------------------------------------------------------------------------- /src/boards/SKiM980A/eeprom-board.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file eeprom-board.c 3 | * 4 | * \brief Target board EEPROM driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "stm32l1xx.h" 24 | #include "utilities.h" 25 | #include "eeprom-board.h" 26 | 27 | LmnStatus_t EepromMcuWriteBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 28 | { 29 | LmnStatus_t status = LMN_STATUS_ERROR; 30 | 31 | assert_param( ( FLASH_EEPROM_BASE + addr ) >= FLASH_EEPROM_BASE ); 32 | assert_param( buffer != NULL ); 33 | assert_param( size < ( FLASH_EEPROM_END - FLASH_EEPROM_BASE ) ); 34 | 35 | if( HAL_FLASHEx_DATAEEPROM_Unlock( ) == HAL_OK ) 36 | { 37 | CRITICAL_SECTION_BEGIN( ); 38 | for( uint16_t i = 0; i < size; i++ ) 39 | { 40 | if( HAL_FLASHEx_DATAEEPROM_Program( FLASH_TYPEPROGRAMDATA_BYTE, 41 | ( FLASH_EEPROM_BASE + addr + i ), 42 | buffer[i] ) != HAL_OK ) 43 | { 44 | // Failed to write EEPROM 45 | break; 46 | } 47 | 48 | } 49 | CRITICAL_SECTION_END( ); 50 | status = LMN_STATUS_OK; 51 | } 52 | 53 | HAL_FLASHEx_DATAEEPROM_Lock( ); 54 | return status; 55 | } 56 | 57 | LmnStatus_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ) 58 | { 59 | assert_param( ( FLASH_EEPROM_BASE + addr ) >= FLASH_EEPROM_BASE ); 60 | assert_param( buffer != NULL ); 61 | assert_param( size < ( FLASH_EEPROM_END - FLASH_EEPROM_BASE ) ); 62 | 63 | memcpy1( buffer, ( uint8_t* )( FLASH_EEPROM_BASE + addr ), size ); 64 | return LMN_STATUS_OK; 65 | } 66 | 67 | void EepromMcuSetDeviceAddr( uint8_t addr ) 68 | { 69 | assert_param( LMN_STATUS_ERROR ); 70 | } 71 | 72 | LmnStatus_t EepromMcuGetDeviceAddr( void ) 73 | { 74 | assert_param( LMN_STATUS_ERROR ); 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /src/boards/SKiM980A/sysIrqHandlers.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file sysIrqHandlers.h 3 | * 4 | * \brief Default IRQ handlers 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2020 Semtech 16 | * 17 | * \endcode 18 | */ 19 | #ifndef SYS_IRQ_HANDLERS_H 20 | #define SYS_IRQ_HANDLERS_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void NMI_Handler( void ); 27 | 28 | void HardFault_Handler( void ); 29 | 30 | void MemManage_Handler( void ); 31 | 32 | void BusFault_Handler( void ); 33 | 34 | void UsageFault_Handler( void ); 35 | 36 | void DebugMon_Handler( void ); 37 | 38 | void SysTick_Handler( void ); 39 | 40 | void EXTI0_IRQHandler( void ); 41 | 42 | void EXTI1_IRQHandler( void ); 43 | 44 | void EXTI2_IRQHandler( void ); 45 | 46 | void EXTI3_IRQHandler( void ); 47 | 48 | void EXTI4_IRQHandler( void ); 49 | 50 | void EXTI9_5_IRQHandler( void ); 51 | 52 | void EXTI15_10_IRQHandler( void ); 53 | 54 | void RTC_Alarm_IRQHandler( void ); 55 | 56 | void USART1_IRQHandler( void ); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif // SYS_IRQ_HANDLERS_H 63 | -------------------------------------------------------------------------------- /src/boards/adc-board.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file adc-board.h 3 | * 4 | * \brief Target board ADC driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __ADC_BOARD_H__ 24 | #define __ADC_BOARD_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #include "adc.h" 32 | 33 | /*! 34 | * \brief Initializes the ADC object and MCU peripheral 35 | * 36 | * \param [IN] obj ADC object 37 | * \param [IN] adcInput ADC input pin 38 | */ 39 | void AdcMcuInit( Adc_t *obj, PinNames adcInput ); 40 | 41 | /*! 42 | * \brief Initializes the ADC internal parameters 43 | */ 44 | void AdcMcuConfig( void ); 45 | 46 | /*! 47 | * \brief Reads the value of the given channel 48 | * 49 | * \param [IN] obj ADC object 50 | * \param [IN] channel ADC input channel 51 | */ 52 | uint16_t AdcMcuReadChannel( Adc_t *obj, uint32_t channel ); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif // __ADC_BOARD_H__ 59 | -------------------------------------------------------------------------------- /src/boards/delay-board.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay-board.h 3 | * 4 | * \brief Target board delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | * 23 | * \author Johannes Bruder ( STACKFORCE ) 24 | */ 25 | #ifndef __DELAY_BOARD_H__ 26 | #define __DELAY_BOARD_H__ 27 | 28 | #ifdef __cplusplus 29 | extern "C" 30 | { 31 | #endif 32 | 33 | #include 34 | 35 | /*! 36 | * \brief Blocking delay of "ms" milliseconds 37 | * 38 | * \param [IN] ms delay in milliseconds 39 | */ 40 | void DelayMsMcu( uint32_t ms ); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif // __DELAY_BOARD_H__ 47 | -------------------------------------------------------------------------------- /src/boards/eeprom-board.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file eeprom-board.h 3 | * 4 | * \brief Target board EEPROM driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __EEPROM_BOARD_H__ 24 | #define __EEPROM_BOARD_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #include 32 | #include "utilities.h" 33 | 34 | /*! 35 | * Writes the given buffer to the EEPROM at the specified address. 36 | * 37 | * \param[IN] addr EEPROM address to write to 38 | * \param[IN] buffer Pointer to the buffer to be written. 39 | * \param[IN] size Size of the buffer to be written. 40 | * \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR] 41 | */ 42 | LmnStatus_t EepromMcuWriteBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ); 43 | 44 | /*! 45 | * Reads the EEPROM at the specified address to the given buffer. 46 | * 47 | * \param[IN] addr EEPROM address to read from 48 | * \param[OUT] buffer Pointer to the buffer to be written with read data. 49 | * \param[IN] size Size of the buffer to be read. 50 | * \retval status [LMN_STATUS_OK, LMN_STATUS_ERROR] 51 | */ 52 | LmnStatus_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size ); 53 | 54 | /*! 55 | * Sets the device address. 56 | * 57 | * \remark Useful for I2C external EEPROMS 58 | * 59 | * \param[IN] addr External EEPROM address 60 | */ 61 | void EepromMcuSetDeviceAddr( uint8_t addr ); 62 | 63 | /*! 64 | * Gets the current device address. 65 | * 66 | * \remark Useful for I2C external EEPROMS 67 | * 68 | * \retval addr External EEPROM address 69 | */ 70 | LmnStatus_t EepromMcuGetDeviceAddr( void ); 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif // __EEPROM_BOARD_H__ 77 | -------------------------------------------------------------------------------- /src/boards/gps-board.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file gps-board.h 3 | * 4 | * \brief Target board GPS driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __GPS_BOARD_H__ 24 | #define __GPS_BOARD_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #include "uart.h" 32 | 33 | /*! 34 | * Select the edge of the PPS signal which is used to start the 35 | * reception of data on the UART. Depending of the GPS, the PPS 36 | * signal may go low or high to indicate the presence of data 37 | */ 38 | typedef enum PpsTrigger_s 39 | { 40 | PpsTriggerIsRising = 0, 41 | PpsTriggerIsFalling, 42 | }PpsTrigger_t; 43 | 44 | /*! 45 | * \brief Low level handling of the PPS signal from the GPS receiver 46 | */ 47 | void GpsMcuOnPpsSignal( void* context ); 48 | 49 | /*! 50 | * \brief Invert the IRQ trigger edge on the PPS signal 51 | */ 52 | void GpsMcuInvertPpsTrigger( void ); 53 | 54 | /*! 55 | * \brief Low level Initialization of the UART and IRQ for the GPS 56 | */ 57 | void GpsMcuInit( void ); 58 | 59 | /*! 60 | * \brief Switch ON the GPS 61 | */ 62 | void GpsMcuStart( void ); 63 | 64 | /*! 65 | * \brief Switch OFF the GPS 66 | */ 67 | void GpsMcuStop( void ); 68 | 69 | /*! 70 | * Updates the GPS status 71 | */ 72 | void GpsMcuProcess( void ); 73 | 74 | /*! 75 | * \brief IRQ handler for the UART receiver 76 | */ 77 | void GpsMcuIrqNotify( UartNotifyId_t id ); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif // __GPS_BOARD_H__ 84 | -------------------------------------------------------------------------------- /src/boards/lr1110-board.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file lr1110-board.h 3 | * 4 | * \brief Target board LR1110 driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __LR1110_BOARD_H__ 24 | #define __LR1110_BOARD_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #include 31 | #include 32 | #include "lr1110.h" 33 | 34 | /*! 35 | * \brief Initializes the radio I/Os pins interface 36 | */ 37 | void lr1110_board_init_io( const void* context ); 38 | 39 | /*! 40 | * \brief De-initializes the radio I/Os pins interface. 41 | * 42 | * \remark Useful when going in MCU low power modes 43 | */ 44 | void lr1110_board_deinit_io( const void* context ); 45 | 46 | /*! 47 | * \brief Initializes the radio debug pins. 48 | */ 49 | void lr1110_board_init_dbg_io( const void* context ); 50 | 51 | /*! 52 | * \brief Sets the radio output power. 53 | * 54 | * \param [IN] power Sets the RF output power 55 | */ 56 | void lr1110_board_set_rf_tx_power( const void* context, int8_t power ); 57 | 58 | /*! 59 | * \brief Gets the Defines the time required for the TCXO to wakeup [ms]. 60 | * 61 | * \retval time Board TCXO wakeup time in ms. 62 | */ 63 | uint32_t lr1110_board_get_tcxo_wakeup_time( const void* context ); 64 | 65 | /*! 66 | * \brief Gets current state of DIO1 pin state. 67 | * 68 | * \retval state DIO1 pin current state. 69 | */ 70 | uint32_t lr1110_get_dio_1_pin_state( const void* context ); 71 | 72 | /*! 73 | * \brief Initializes the radio driver 74 | */ 75 | void lr1110_board_init( const void* context, lr1110_dio_irq_handler dio_irq ); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif // __LR1110_BOARD_H__ 82 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/config/RTE_Components.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Autogenerated API include file for the Atmel Configuration Management Engine (ACME) 5 | * 6 | * Copyright (c) 2012 Atmel Corporation. All rights reserved. 7 | * 8 | * \acme_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \acme_license_stop 41 | * 42 | * Project: ATSAML21_SX1276 43 | * Target: ATSAML21J18B 44 | * 45 | **/ 46 | // REVIEW MLO: For what this was added? 47 | 48 | #ifndef RTE_COMPONENTS_H 49 | #define RTE_COMPONENTS_H 50 | 51 | 52 | #define ATMEL_START 53 | 54 | #endif /* RTE_COMPONENTS_H */ 55 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/config/hpl_systick_config.h: -------------------------------------------------------------------------------- 1 | /* Auto-generated config file hpl_systick_config.h */ 2 | #ifndef HPL_SYSTICK_CONFIG_H 3 | #define HPL_SYSTICK_CONFIG_H 4 | 5 | // <<< Use Configuration Wizard in Context Menu >>> 6 | 7 | // Advanced settings 8 | // SysTick exception request 9 | // Indicates whether the generation of SysTick exception is enabled or not 10 | // systick_arch_tickint 11 | #ifndef CONF_SYSTICK_TICKINT 12 | #define CONF_SYSTICK_TICKINT 0 13 | #endif 14 | // 15 | 16 | // <<< end of configuration section >>> 17 | 18 | #endif // HPL_SYSTICK_CONFIG_H 19 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/documentation/ext_irq.rst: -------------------------------------------------------------------------------- 1 | ============== 2 | EXT IRQ driver 3 | ============== 4 | 5 | The External Interrupt driver allows external pins to be 6 | configured as interrupt lines. Each interrupt line can be 7 | individually masked and can generate an interrupt on rising, 8 | falling or both edges, or on high or low levels. Some of 9 | external pin can also be configured to wake up the device 10 | from sleep modes where all clocks have been disabled. 11 | External pins can also generate an event. 12 | 13 | Features 14 | -------- 15 | * Initialization and de-initialization 16 | * Enabling and disabling 17 | * Detect external pins interrupt 18 | 19 | Applications 20 | ------------ 21 | * Generate an interrupt on rising, falling or both edges, 22 | or on high or low levels. 23 | 24 | Dependencies 25 | ------------ 26 | * GPIO hardware 27 | 28 | Concurrency 29 | ----------- 30 | N/A 31 | 32 | Limitations 33 | ----------- 34 | N/A 35 | 36 | Knows issues and workarounds 37 | ---------------------------- 38 | N/A 39 | 40 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/documentation/spi_master_sync.rst: -------------------------------------------------------------------------------- 1 | The SPI Master Synchronous Driver 2 | ================================= 3 | 4 | The serial peripheral interface (SPI) is a synchronous serial communication 5 | interface. 6 | 7 | SPI devices communicate in full duplex mode using a master-slave 8 | architecture with a single master. The master device originates the frame for 9 | reading and writing. Multiple slave devices are supported through selection 10 | with individual slave select (SS) lines. 11 | 12 | Features 13 | -------- 14 | 15 | * Initialization/de-initialization 16 | * Enabling/disabling 17 | * Control of the following settings: 18 | 19 | * Baudrate 20 | * SPI mode 21 | * Character size 22 | * Data order 23 | * Data transfer: transmission, reception and full-duplex 24 | 25 | Applications 26 | ------------ 27 | 28 | Send/receive/exchange data with a SPI slave device. E.g., serial flash, SD card, 29 | LCD controller, etc. 30 | 31 | Dependencies 32 | ------------ 33 | 34 | SPI master capable hardware 35 | 36 | Concurrency 37 | ----------- 38 | 39 | N/A 40 | 41 | Limitations 42 | ----------- 43 | 44 | The slave select (SS) is not automatically inserted during read/write/transfer, 45 | user must use I/O to control the devices' SS. 46 | 47 | Known issues and workarounds 48 | ---------------------------- 49 | 50 | N/A 51 | 52 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/documentation/usart_sync.rst: -------------------------------------------------------------------------------- 1 | The USART Synchronous Driver 2 | ============================ 3 | 4 | The universal synchronous and asynchronous receiver and transmitter 5 | (USART) is usually used to transfer data from one device to the other. 6 | 7 | User can set action for flow control pins by function usart_set_flow_control, 8 | if the flow control is enabled. All the available states are defined in union 9 | usart_flow_control_state. 10 | 11 | Note that user can set state of flow control pins only if automatic support of 12 | the flow control is not supported by the hardware. 13 | 14 | Features 15 | -------- 16 | 17 | * Initialization/de-initialization 18 | * Enabling/disabling 19 | * Control of the following settings: 20 | 21 | * Baudrate 22 | * UART or USRT communication mode 23 | * Character size 24 | * Data order 25 | * Flow control 26 | * Data transfer: transmission, reception 27 | 28 | Applications 29 | ------------ 30 | 31 | They are commonly used in a terminal application or low-speed communication 32 | between devices. 33 | 34 | Dependencies 35 | ------------ 36 | 37 | USART capable hardware. 38 | 39 | Concurrency 40 | ----------- 41 | 42 | Write buffer should not be changed while data is being sent. 43 | 44 | 45 | Limitations 46 | ----------- 47 | 48 | * The driver does not support 9-bit character size. 49 | * The "USART with ISO7816" mode can be only used in ISO7816 capable devices. 50 | And the SCK pin can't be set directly. Application can use a GCLK output PIN 51 | to generate SCK. For example to communicate with a SMARTCARD with ISO7816 52 | (F = 372 ; D = 1), and baudrate=9600, the SCK pin output frequency should be 53 | config as 372*9600=3571200Hz. More information can be refer to ISO7816 Specification. 54 | 55 | Known issues and workarounds 56 | ---------------------------- 57 | 58 | N/A 59 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/include/hal_init.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief HAL initialization related functionality declaration. 5 | * 6 | * Copyright (C) 2014 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #ifndef _HAL_INIT_H_INCLUDED 45 | #define _HAL_INIT_H_INCLUDED 46 | 47 | #include 48 | 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /** 54 | * \addtogroup doc_driver_hal_helper_init Init Driver 55 | * 56 | *@{ 57 | */ 58 | 59 | /** 60 | * \brief Initialize the hardware abstraction layer 61 | * 62 | * This function calls the various initialization functions. 63 | * Currently the following initialization functions are supported: 64 | * - System clock initialization 65 | */ 66 | static inline void init_mcu(void) 67 | { 68 | _init_chip(); 69 | } 70 | 71 | /** 72 | * \brief Retrieve the current driver version 73 | * 74 | * \return Current driver version. 75 | */ 76 | uint32_t init_get_version(void); 77 | 78 | /**@}*/ 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | #endif /* _HAL_INIT_H_INCLUDED */ 83 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/include/hpl_core.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief CPU core related functionality declaration. 5 | * 6 | * Copyright (C) 2015 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #ifndef _HPL_CORE_H_INCLUDED 45 | #define _HPL_CORE_H_INCLUDED 46 | 47 | /** 48 | * \addtogroup HPL Core 49 | * 50 | * \section hpl_core_rev Revision History 51 | * - v1.0.0 Initial Release 52 | * 53 | *@{ 54 | */ 55 | 56 | #include "hpl_core_port.h" 57 | 58 | #ifdef __cplusplus 59 | extern "C" { 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | /**@}*/ 66 | #endif /* _HPL_CORE_H_INCLUDED */ 67 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/include/hpl_delay.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Delay related functionality declaration. 5 | * 6 | * Copyright (C) 2014 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 16 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 17 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 18 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 19 | * POSSIBILITY OF SUCH DAMAGE. 20 | * 21 | * \asf_license_stop 22 | * 23 | */ 24 | 25 | #ifndef _HPL_DELAY_H_INCLUDED 26 | #define _HPL_DELAY_H_INCLUDED 27 | 28 | /** 29 | * \addtogroup HPL Delay 30 | * 31 | * \section hpl_delay_rev Revision History 32 | * - v1.0.0 Initial Release 33 | * 34 | *@{ 35 | */ 36 | 37 | #ifndef _UNIT_TEST_ 38 | #include 39 | #endif 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \name HPL functions 47 | */ 48 | //@{ 49 | 50 | /** 51 | * \brief Initialize delay functionality 52 | * 53 | * \param[in] hw The pointer to hardware instance 54 | */ 55 | void _delay_init(void *const hw); 56 | 57 | /** 58 | * \brief Retrieve the amount of cycles to delay for the given amount of us 59 | * 60 | * \param[in] us The amount of us to delay for 61 | * 62 | * \return The amount of cycles 63 | */ 64 | uint32_t _get_cycles_for_us(const uint16_t us); 65 | 66 | /** 67 | * \brief Retrieve the amount of cycles to delay for the given amount of ms 68 | * 69 | * \param[in] ms The amount of ms to delay for 70 | * 71 | * \return The amount of cycles 72 | */ 73 | uint32_t _get_cycles_for_ms(const uint16_t ms); 74 | 75 | /** 76 | * \brief Delay loop to delay n number of cycles 77 | * 78 | * \param[in] hw The pointer to hardware instance 79 | * \param[in] cycles The amount of cycles to delay for 80 | */ 81 | void _delay_cycles(void *const hw, uint32_t cycles); 82 | //@} 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | /**@}*/ 88 | #endif /* _HPL_DELAY_H_INCLUDED */ 89 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/include/hpl_missing_features.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Family-dependent missing features expected by HAL 5 | * 6 | * Copyright (C) 2016 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #ifndef _HPL_MISSING_FEATURES 45 | #define _HPL_MISSING_FEATURES 46 | 47 | #endif /* _HPL_MISSING_FEATURES */ 48 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/include/hpl_spi_sync.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Common SPI related functionality declaration. 5 | * 6 | * Copyright (C) 2015 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #ifndef _HPL_SPI_SYNC_H_INCLUDED 45 | #define _HPL_SPI_SYNC_H_INCLUDED 46 | 47 | #include 48 | #include 49 | 50 | #include 51 | 52 | /** 53 | * \addtogroup hpl_spi HPL SPI 54 | * 55 | * \section hpl_spi_rev Revision History 56 | * - v1.0.0 Initial Release 57 | * 58 | *@{ 59 | */ 60 | 61 | #ifdef __cplusplus 62 | extern "C" { 63 | #endif 64 | 65 | /** SPI driver to support sync HAL */ 66 | struct _spi_sync_dev { 67 | /** Pointer to the hardware base or private data for special device. */ 68 | void *prvt; 69 | /** Data size, number of bytes for each character */ 70 | uint8_t char_size; 71 | /** Dummy byte used in master mode when reading the slave */ 72 | uint16_t dummy_byte; 73 | }; 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | /**@}*/ 80 | #endif /* ifndef _HPL_SPI_SYNC_H_INCLUDED */ 81 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/src/hal_atomic.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Critical sections related functionality implementation. 5 | * 6 | * Copyright (C) 2014 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #include "hal_atomic.h" 45 | 46 | /** 47 | * \brief Driver version 48 | */ 49 | #define DRIVER_VERSION 0x00000001u 50 | 51 | /** 52 | * \brief Disable interrupts, enter critical section 53 | */ 54 | void atomic_enter_critical(hal_atomic_t volatile *atomic) 55 | { 56 | *atomic = __get_PRIMASK(); 57 | __disable_irq(); 58 | __DMB(); 59 | } 60 | 61 | /** 62 | * \brief Exit atomic section 63 | */ 64 | void atomic_leave_critical(hal_atomic_t volatile *atomic) 65 | { 66 | __DMB(); 67 | __set_PRIMASK(*atomic); 68 | } 69 | 70 | /** 71 | * \brief Retrieve the current driver version 72 | */ 73 | uint32_t atomic_get_version(void) 74 | { 75 | return DRIVER_VERSION; 76 | } 77 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/src/hal_gpio.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Port 5 | * 6 | * Copyright (C) 2014 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #include "hal_gpio.h" 45 | 46 | /** 47 | * \brief Driver version 48 | */ 49 | #define DRIVER_VERSION 0x00000001u 50 | 51 | uint32_t gpio_get_version(void) 52 | { 53 | return DRIVER_VERSION; 54 | } 55 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/src/hal_init.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief HAL initialization related functionality implementation. 5 | * 6 | * Copyright (C) 2014-2015 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #include "hal_init.h" 45 | 46 | /** 47 | * \brief Driver version 48 | */ 49 | #define HAL_INIT_VERSION 0x00000001u 50 | 51 | /** 52 | * \brief Retrieve the current driver version 53 | */ 54 | uint32_t init_get_version(void) 55 | { 56 | return HAL_INIT_VERSION; 57 | } 58 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/src/hal_io.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief I/O functionality implementation. 5 | * 6 | * Copyright (C) 2015 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #include 45 | #include 46 | 47 | /** 48 | * \brief Driver version 49 | */ 50 | #define DRIVER_VERSION 0x00000001u 51 | 52 | uint32_t io_get_version(void) 53 | { 54 | return DRIVER_VERSION; 55 | } 56 | 57 | /** 58 | * \brief I/O write interface 59 | */ 60 | int32_t io_write(struct io_descriptor *const io_descr, const uint8_t *const buf, const uint16_t length) 61 | { 62 | ASSERT(io_descr && buf); 63 | return io_descr->write(io_descr, buf, length); 64 | } 65 | 66 | /** 67 | * \brief I/O read interface 68 | */ 69 | int32_t io_read(struct io_descriptor *const io_descr, uint8_t *const buf, const uint16_t length) 70 | { 71 | ASSERT(io_descr && buf); 72 | return io_descr->read(io_descr, buf, length); 73 | } 74 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/utils/include/compiler.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * compiler.h 3 | * 4 | * Created: 05.05.2014 5 | * Author: N. Fomin 6 | ******************************************************************************/ 7 | 8 | #ifndef _COMPILER_H 9 | #define _COMPILER_H 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #ifndef _UNIT_TEST_ 20 | #include "parts.h" 21 | #endif 22 | #include "err_codes.h" 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | #endif /* _COMPILER_H */ 29 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/utils/include/events.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Events declaration. 5 | * 6 | * Copyright (C) 2015 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSEsD AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #ifndef _EVENTS_H_INCLUDED 45 | #define _EVENTS_H_INCLUDED 46 | 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | #include 52 | 53 | /** 54 | * \brief List of events. Must start with 0, be unique and follow numerical order. 55 | */ 56 | #define EVENT_IS_READY_TO_SLEEP_ID 0 57 | #define EVENT_PREPARE_TO_SLEEP_ID 1 58 | #define EVENT_WOKEN_UP_ID 2 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* _EVENTS_H_INCLUDED */ 65 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/utils/include/parts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Atmel part identification macros 5 | * 6 | * Copyright (C) 2015-2017 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #ifndef ATMEL_PARTS_H 45 | #define ATMEL_PARTS_H 46 | 47 | #include "saml21.h" 48 | 49 | #include "hri_l21b.h" 50 | 51 | #endif /* ATMEL_PARTS_H */ 52 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hal/utils/src/utils_assert.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Asserts related functionality. 5 | * 6 | * Copyright (C) 2014 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUFDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #include 45 | 46 | /** 47 | * \brief Assert function 48 | */ 49 | void assert(const bool condition, const char *const file, const int line) 50 | { 51 | if (!(condition)) { 52 | __asm("BKPT #0"); 53 | } 54 | (void)file; 55 | (void)line; 56 | } 57 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hpl/core/hpl_init.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief HPL initialization related functionality implementation. 5 | * 6 | * Copyright (C) 2014-2017 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #include 45 | #include 46 | #include 47 | 48 | #include 49 | #include 50 | 51 | /** 52 | * \brief Initialize the hardware abstraction layer 53 | */ 54 | void _init_chip(void) 55 | { 56 | hri_nvmctrl_set_CTRLB_RWS_bf(NVMCTRL, CONF_NVM_WAIT_STATE); 57 | 58 | _set_performance_level(2); 59 | 60 | _osc32kctrl_init_sources(); 61 | _oscctrl_init_sources(); 62 | _mclk_init(); 63 | _gclk_init_generators(); 64 | _oscctrl_init_referenced_generators(); 65 | 66 | #if CONF_DMAC_ENABLE 67 | hri_mclk_set_AHBMASK_DMAC_bit(MCLK); 68 | _dma_init(); 69 | #endif 70 | } 71 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hpl/mclk/hpl_mclk.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief SAM Main Clock. 5 | * 6 | * Copyright (C) 2015-2016 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | * 42 | */ 43 | 44 | #include 45 | #include 46 | 47 | /** 48 | * \brief Initialize master clock generator 49 | */ 50 | void _mclk_init(void) 51 | { 52 | void *hw = (void *)MCLK; 53 | hri_mclk_write_BUPDIV_reg(hw, MCLK_BUPDIV_BUPDIV(CONF_MCLK_BUPDIV)); 54 | hri_mclk_write_LPDIV_reg(hw, MCLK_LPDIV_LPDIV(CONF_MCLK_LPDIV)); 55 | hri_mclk_write_CPUDIV_reg(hw, MCLK_CPUDIV_CPUDIV(CONF_MCLK_CPUDIV)); 56 | } 57 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hpl/pm/hpl_pm.c: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * \file 4 | * 5 | * \brief SAM Power manager 6 | * 7 | * Copyright (C) 2014-2016 Atmel Corporation. All rights reserved. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 19 | * 2. Redistributions in binary form must reproduce the above copyright notice, 20 | * this list of conditions and the following disclaimer in the documentation 21 | * and/or other materials provided with the distribution. 22 | * 23 | * 3. The name of Atmel may not be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * 4. This software may only be redistributed and used in connection with an 27 | * Atmel microcontroller product. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 30 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 31 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 32 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 33 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 35 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 37 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * 41 | * \asf_license_stop 42 | * 43 | */ 44 | 45 | #include 46 | #include 47 | 48 | /** 49 | * \brief Set the sleep mode for the device 50 | */ 51 | int32_t _set_sleep_mode(const uint8_t mode) 52 | { 53 | switch (mode) { 54 | case 2: 55 | case 4: 56 | case 5: 57 | case 6: 58 | hri_pm_write_SLEEPCFG_SLEEPMODE_bf(PM, mode); 59 | break; 60 | default: 61 | return ERR_INVALID_ARG; 62 | } 63 | 64 | return ERR_NONE; 65 | } 66 | 67 | /** 68 | * \brief Set performance level 69 | */ 70 | void _set_performance_level(const uint8_t level) 71 | { 72 | hri_pm_clear_INTFLAG_reg(PM, 0xFF); 73 | if (hri_pm_get_PLCFG_PLSEL_bf(PM, PM_PLCFG_PLSEL_Msk) != level) { 74 | hri_pm_write_PLCFG_PLSEL_bf(PM, level); 75 | } 76 | while (!hri_pm_read_INTFLAG_reg(PM)) 77 | ; 78 | } 79 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hpl/pm/hpl_pm_base.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief SAM Power manager 5 | * 6 | * Copyright (C) 2014-2017 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distributionn. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | */ 42 | 43 | #ifndef _HPL_PM_BASE_H_INCLUDED 44 | #define _HPL_PM_BASE_H_INCLUDED 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | #include 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif /* _HPL_PM_BASE_H_INCLUDED */ 56 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/hpl/rtc/hpl_rtc_base.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief RTC 5 | * 6 | * Copyright (C) 2016 Atmel Corporation. All rights reserved. 7 | * 8 | * \asf_license_start 9 | * 10 | * \page License 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions are met: 14 | * 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distributionn. 21 | * 22 | * 3. The name of Atmel may not be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * 4. This software may only be redistributed and used in connection with an 26 | * Atmel microcontroller product. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * \asf_license_stop 41 | */ 42 | 43 | #ifndef _HPL_RTC2_V200_H_INCLUDED 44 | #define _HPL_RTC2_V200_H_INCLUDED 45 | 46 | #include 47 | 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | /** 53 | * \brief Retrieve timer helper functions 54 | * 55 | * \return A pointer to set of timer helper functions 56 | */ 57 | struct _timer_hpl_interface *_rtc_get_timer(void); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | #endif /* _HPL_RTC2_V200_H_INCLUDED */ 63 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/saml21b/gcc/system_saml21.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Low-level initialization functions called upon chip startup. 5 | * 6 | * Copyright (c) 2016 Atmel Corporation, 7 | * a wholly owned subsidiary of Microchip Technology Inc. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the Licence at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | * \asf_license_stop 26 | * 27 | */ 28 | 29 | #include "saml21.h" 30 | 31 | /** 32 | * Initial system clock frequency. The System RC Oscillator (RCSYS) provides 33 | * the source for the main clock at chip startup. 34 | */ 35 | #define __SYSTEM_CLOCK (4000000) 36 | 37 | uint32_t SystemCoreClock = __SYSTEM_CLOCK;/*!< System Clock Frequency (Core Clock)*/ 38 | 39 | /** 40 | * Initialize the system 41 | * 42 | * @brief Setup the microcontroller system. 43 | * Initialize the System and update the SystemCoreClock variable. 44 | */ 45 | void SystemInit(void) 46 | { 47 | // Keep the default device state after reset 48 | SystemCoreClock = __SYSTEM_CLOCK; 49 | return; 50 | } 51 | 52 | /** 53 | * Update SystemCoreClock variable 54 | * 55 | * @brief Updates the SystemCoreClock with current core Clock 56 | * retrieved from cpu registers. 57 | */ 58 | void SystemCoreClockUpdate(void) 59 | { 60 | // Not implemented 61 | SystemCoreClock = __SYSTEM_CLOCK; 62 | return; 63 | } 64 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/saml21b/include/component-version.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Component version header file 5 | * 6 | * Copyright (c) 2017 Atmel Corporation, a wholly owned subsidiary of Microchip Technology Inc. 7 | * 8 | * \license_start 9 | * 10 | * \page License 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | * 24 | * \license_stop 25 | * 26 | */ 27 | 28 | #ifndef _COMPONENT_VERSION_H_INCLUDED 29 | #define _COMPONENT_VERSION_H_INCLUDED 30 | 31 | #define COMPONENT_VERSION_MAJOR 1 32 | #define COMPONENT_VERSION_MINOR 1 33 | 34 | // 35 | // The COMPONENT_VERSION define is composed of the major and the minor version number. 36 | // 37 | // The last four digits of the COMPONENT_VERSION is the minor version with leading zeros. 38 | // The rest of the COMPONENT_VERSION is the major version, with leading zeros. The COMPONENT_VERSION 39 | // is at least 8 digits long. 40 | // 41 | #define COMPONENT_VERSION 00010001 42 | 43 | // 44 | // The build number does not refer to the component, but to the build number 45 | // of the device pack that provides the component. 46 | // 47 | #define BUILD_NUMBER 110 48 | 49 | // 50 | // The COMPONENT_VERSION_STRING is a string (enclosed in ") that can be used for logging or embedding. 51 | // 52 | #define COMPONENT_VERSION_STRING "1.1" 53 | 54 | // 55 | // The COMPONENT_DATE_STRING contains a timestamp of when the pack was generated. 56 | // 57 | // The COMPONENT_DATE_STRING is written out using the following strftime pattern. 58 | // 59 | // "%Y-%m-%d %H:%M:%S" 60 | // 61 | // 62 | #define COMPONENT_DATE_STRING "2017-02-07 08:45:03" 63 | 64 | #endif/* #ifndef _COMPONENT_VERSION_H_INCLUDED */ 65 | 66 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/saml21b/include/instance/opamp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Instance description for OPAMP 5 | * 6 | * Copyright (c) 2016 Atmel Corporation, 7 | * a wholly owned subsidiary of Microchip Technology Inc. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the Licence at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | * \asf_license_stop 26 | * 27 | */ 28 | 29 | #ifndef _SAML21_OPAMP_INSTANCE_ 30 | #define _SAML21_OPAMP_INSTANCE_ 31 | 32 | /* ========== Register definition for OPAMP peripheral ========== */ 33 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 34 | #define REG_OPAMP_CTRLA (0x43001800) /**< \brief (OPAMP) Control A */ 35 | #define REG_OPAMP_STATUS (0x43001802) /**< \brief (OPAMP) Status */ 36 | #define REG_OPAMP_OPAMPCTRL0 (0x43001804) /**< \brief (OPAMP) OPAMP 0 Control */ 37 | #define REG_OPAMP_OPAMPCTRL1 (0x43001808) /**< \brief (OPAMP) OPAMP 1 Control */ 38 | #define REG_OPAMP_OPAMPCTRL2 (0x4300180C) /**< \brief (OPAMP) OPAMP 2 Control */ 39 | #else 40 | #define REG_OPAMP_CTRLA (*(RwReg8 *)0x43001800UL) /**< \brief (OPAMP) Control A */ 41 | #define REG_OPAMP_STATUS (*(RoReg8 *)0x43001802UL) /**< \brief (OPAMP) Status */ 42 | #define REG_OPAMP_OPAMPCTRL0 (*(RwReg *)0x43001804UL) /**< \brief (OPAMP) OPAMP 0 Control */ 43 | #define REG_OPAMP_OPAMPCTRL1 (*(RwReg *)0x43001808UL) /**< \brief (OPAMP) OPAMP 1 Control */ 44 | #define REG_OPAMP_OPAMPCTRL2 (*(RwReg *)0x4300180CUL) /**< \brief (OPAMP) OPAMP 2 Control */ 45 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 46 | 47 | 48 | #endif /* _SAML21_OPAMP_INSTANCE_ */ 49 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/saml21b/include/instance/rstc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Instance description for RSTC 5 | * 6 | * Copyright (c) 2016 Atmel Corporation, 7 | * a wholly owned subsidiary of Microchip Technology Inc. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the Licence at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | * \asf_license_stop 26 | * 27 | */ 28 | 29 | #ifndef _SAML21_RSTC_INSTANCE_ 30 | #define _SAML21_RSTC_INSTANCE_ 31 | 32 | /* ========== Register definition for RSTC peripheral ========== */ 33 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 34 | #define REG_RSTC_RCAUSE (0x40000800) /**< \brief (RSTC) Reset Cause */ 35 | #define REG_RSTC_BKUPEXIT (0x40000802) /**< \brief (RSTC) Backup Exit Source */ 36 | #define REG_RSTC_WKDBCONF (0x40000804) /**< \brief (RSTC) Wakeup Debounce Configuration */ 37 | #define REG_RSTC_WKPOL (0x40000808) /**< \brief (RSTC) Wakeup Polarity */ 38 | #define REG_RSTC_WKEN (0x4000080C) /**< \brief (RSTC) Wakeup Enable */ 39 | #define REG_RSTC_WKCAUSE (0x40000810) /**< \brief (RSTC) Wakeup Cause */ 40 | #else 41 | #define REG_RSTC_RCAUSE (*(RoReg8 *)0x40000800UL) /**< \brief (RSTC) Reset Cause */ 42 | #define REG_RSTC_BKUPEXIT (*(RoReg8 *)0x40000802UL) /**< \brief (RSTC) Backup Exit Source */ 43 | #define REG_RSTC_WKDBCONF (*(RwReg8 *)0x40000804UL) /**< \brief (RSTC) Wakeup Debounce Configuration */ 44 | #define REG_RSTC_WKPOL (*(RwReg16*)0x40000808UL) /**< \brief (RSTC) Wakeup Polarity */ 45 | #define REG_RSTC_WKEN (*(RwReg16*)0x4000080CUL) /**< \brief (RSTC) Wakeup Enable */ 46 | #define REG_RSTC_WKCAUSE (*(RwReg16*)0x40000810UL) /**< \brief (RSTC) Wakeup Cause */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | /* ========== Instance parameters for RSTC peripheral ========== */ 50 | #define RSTC_NUMBER_OF_EXTWAKE 8 // number of external wakeup line 51 | 52 | #endif /* _SAML21_RSTC_INSTANCE_ */ 53 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/saml21b/include/instance/trng.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Instance description for TRNG 5 | * 6 | * Copyright (c) 2016 Atmel Corporation, 7 | * a wholly owned subsidiary of Microchip Technology Inc. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the Licence at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | * \asf_license_stop 26 | * 27 | */ 28 | 29 | #ifndef _SAML21_TRNG_INSTANCE_ 30 | #define _SAML21_TRNG_INSTANCE_ 31 | 32 | /* ========== Register definition for TRNG peripheral ========== */ 33 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) 34 | #define REG_TRNG_CTRLA (0x42003800) /**< \brief (TRNG) Control A */ 35 | #define REG_TRNG_EVCTRL (0x42003804) /**< \brief (TRNG) Event Control */ 36 | #define REG_TRNG_INTENCLR (0x42003808) /**< \brief (TRNG) Interrupt Enable Clear */ 37 | #define REG_TRNG_INTENSET (0x42003809) /**< \brief (TRNG) Interrupt Enable Set */ 38 | #define REG_TRNG_INTFLAG (0x4200380A) /**< \brief (TRNG) Interrupt Flag Status and Clear */ 39 | #define REG_TRNG_DATA (0x42003820) /**< \brief (TRNG) Output Data */ 40 | #else 41 | #define REG_TRNG_CTRLA (*(RwReg8 *)0x42003800UL) /**< \brief (TRNG) Control A */ 42 | #define REG_TRNG_EVCTRL (*(RwReg8 *)0x42003804UL) /**< \brief (TRNG) Event Control */ 43 | #define REG_TRNG_INTENCLR (*(RwReg8 *)0x42003808UL) /**< \brief (TRNG) Interrupt Enable Clear */ 44 | #define REG_TRNG_INTENSET (*(RwReg8 *)0x42003809UL) /**< \brief (TRNG) Interrupt Enable Set */ 45 | #define REG_TRNG_INTFLAG (*(RwReg8 *)0x4200380AUL) /**< \brief (TRNG) Interrupt Flag Status and Clear */ 46 | #define REG_TRNG_DATA (*(RoReg *)0x42003820UL) /**< \brief (TRNG) Output Data */ 47 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ 48 | 49 | 50 | #endif /* _SAML21_TRNG_INSTANCE_ */ 51 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/saml21b/include/sam.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Top level header file 5 | * 6 | * Copyright (c) 2017 Atmel Corporation, a wholly owned subsidiary of Microchip Technology Inc. 7 | * 8 | * \license_start 9 | * 10 | * \page License 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the "License"); 13 | * you may not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | * 24 | * \license_stop 25 | * 26 | */ 27 | 28 | #ifndef _SAM_ 29 | #define _SAM_ 30 | 31 | #if defined(__SAML21E15B__) || defined(__ATSAML21E15B__) 32 | #include "saml21e15b.h" 33 | #elif defined(__SAML21E16B__) || defined(__ATSAML21E16B__) 34 | #include "saml21e16b.h" 35 | #elif defined(__SAML21E17B__) || defined(__ATSAML21E17B__) 36 | #include "saml21e17b.h" 37 | #elif defined(__SAML21E18B__) || defined(__ATSAML21E18B__) 38 | #include "saml21e18b.h" 39 | #elif defined(__SAML21G16B__) || defined(__ATSAML21G16B__) 40 | #include "saml21g16b.h" 41 | #elif defined(__SAML21G17B__) || defined(__ATSAML21G17B__) 42 | #include "saml21g17b.h" 43 | #elif defined(__SAML21G18B__) || defined(__ATSAML21G18B__) 44 | #include "saml21g18b.h" 45 | #elif defined(__SAML21J16B__) || defined(__ATSAML21J16B__) 46 | #include "saml21j16b.h" 47 | #elif defined(__SAML21J17B__) || defined(__ATSAML21J17B__) 48 | #include "saml21j17b.h" 49 | #elif defined(__SAML21J18B__) || defined(__ATSAML21J18B__) 50 | #include "saml21j18b.h" 51 | #elif defined(__SAML21J18BU__) || defined(__ATSAML21J18BU__) 52 | #include "saml21j18bu.h" 53 | #else 54 | #error Library does not support the specified device 55 | #endif 56 | 57 | #endif /* _SAM_ */ 58 | 59 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/saml21b/include/saml21.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Top header file for SAML21 5 | * 6 | * Copyright (c) 2016 Atmel Corporation, 7 | * a wholly owned subsidiary of Microchip Technology Inc. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the Licence at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | * \asf_license_stop 26 | * 27 | */ 28 | 29 | #ifndef _SAML21_ 30 | #define _SAML21_ 31 | 32 | /** 33 | * \defgroup SAML21_definitions SAML21 Device Definitions 34 | * \brief SAML21 CMSIS Definitions. 35 | */ 36 | 37 | #if defined(__SAML21E15B__) || defined(__ATSAML21E15B__) 38 | #include "saml21e15b.h" 39 | #elif defined(__SAML21E16B__) || defined(__ATSAML21E16B__) 40 | #include "saml21e16b.h" 41 | #elif defined(__SAML21E17B__) || defined(__ATSAML21E17B__) 42 | #include "saml21e17b.h" 43 | #elif defined(__SAML21E18B__) || defined(__ATSAML21E18B__) 44 | #include "saml21e18b.h" 45 | #elif defined(__SAML21G16B__) || defined(__ATSAML21G16B__) 46 | #include "saml21g16b.h" 47 | #elif defined(__SAML21G17B__) || defined(__ATSAML21G17B__) 48 | #include "saml21g17b.h" 49 | #elif defined(__SAML21G18B__) || defined(__ATSAML21G18B__) 50 | #include "saml21g18b.h" 51 | #elif defined(__SAML21J16B__) || defined(__ATSAML21J16B__) 52 | #include "saml21j16b.h" 53 | #elif defined(__SAML21J17B__) || defined(__ATSAML21J17B__) 54 | #include "saml21j17b.h" 55 | #elif defined(__SAML21J18B__) || defined(__ATSAML21J18B__) 56 | #include "saml21j18b.h" 57 | #elif defined(__SAML21J18BU__) || defined(__ATSAML21J18BU__) 58 | #include "saml21j18bu.h" 59 | #else 60 | #error Library does not support the specified device. 61 | #endif 62 | 63 | #endif /* _SAML21_ */ 64 | -------------------------------------------------------------------------------- /src/boards/mcu/saml21/saml21b/include/system_saml21.h: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief Low-level initialization functions called upon chip startup 5 | * 6 | * Copyright (c) 2016 Atmel Corporation, 7 | * a wholly owned subsidiary of Microchip Technology Inc. 8 | * 9 | * \asf_license_start 10 | * 11 | * \page License 12 | * 13 | * Licensed under the Apache License, Version 2.0 (the "License"); 14 | * you may not use this file except in compliance with the License. 15 | * You may obtain a copy of the Licence at 16 | * 17 | * http://www.apache.org/licenses/LICENSE-2.0 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | * \asf_license_stop 26 | * 27 | */ 28 | 29 | #ifndef _SYSTEM_SAML21_H_INCLUDED_ 30 | #define _SYSTEM_SAML21_H_INCLUDED_ 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | #include 37 | 38 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 39 | 40 | void SystemInit(void); 41 | void SystemCoreClockUpdate(void); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif /* SYSTEM_SAML21_H_INCLUDED */ 48 | -------------------------------------------------------------------------------- /src/boards/mcu/stm32/EEPROM_Emul/Core/eeprom_emul.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/mcu/stm32/EEPROM_Emul/Core/eeprom_emul.c -------------------------------------------------------------------------------- /src/boards/mcu/stm32/RTE_Components.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Auto generated Run-Time-Environment Component Configuration File 4 | * *** Do not modify ! *** 5 | * 6 | * Project: 'LoRaWAN' 7 | * Target: 'LoRaWAN Configuration' 8 | */ 9 | 10 | #ifndef RTE_COMPONENTS_H 11 | #define RTE_COMPONENTS_H 12 | 13 | 14 | #endif /* RTE_COMPONENTS_H */ 15 | -------------------------------------------------------------------------------- /src/boards/mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cryp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cryp.c -------------------------------------------------------------------------------- /src/boards/mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_swpmi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_swpmi.c -------------------------------------------------------------------------------- /src/boards/mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_wwdg.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/boards/mcu/stm32/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_wwdg.c -------------------------------------------------------------------------------- /src/boards/pinName-board.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file pinName-board.h 3 | * 4 | * \brief Target board GPIO pins definitions 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __PIN_NAME_BOARD_H__ 24 | #define __PIN_NAME_BOARD_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | /*! 32 | * STM32 Pin Names 33 | */ 34 | #define MCU_PINS \ 35 | PA_0 = 0, PA_1, PA_2, PA_3, PA_4, PA_5, PA_6, PA_7, PA_8, PA_9, PA_10, PA_11, PA_12, PA_13, PA_14, PA_15, \ 36 | PB_0, PB_1, PB_2, PB_3, PB_4, PB_5, PB_6, PB_7, PB_8, PB_9, PB_10, PB_11, PB_12, PB_13, PB_14, PB_15, \ 37 | PC_0, PC_1, PC_2, PC_3, PC_4, PC_5, PC_6, PC_7, PC_8, PC_9, PC_10, PC_11, PC_12, PC_13, PC_14, PC_15, \ 38 | PD_0, PD_1, PD_2, PD_3, PD_4, PD_5, PD_6, PD_7, PD_8, PD_9, PD_10, PD_11, PD_12, PD_13, PD_14, PD_15, \ 39 | PE_0, PE_1, PE_2, PE_3, PE_4, PE_5, PE_6, PE_7, PE_8, PE_9, PE_10, PE_11, PE_12, PE_13, PE_14, PE_15, \ 40 | PF_0, PF_1, PF_2, PF_3, PF_4, PF_5, PF_6, PF_7, PF_8, PF_9, PF_10, PF_11, PF_12, PF_13, PF_14, PF_15, \ 41 | PH_0, PH_1, PH_2, PH_3, PH_4, PH_5, PH_6, PH_7, PH_8, PH_9, PH_10, PH_11, PH_12, PH_13, PH_14, PH_15 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif // __PIN_NAME_BOARD_H__ 48 | -------------------------------------------------------------------------------- /src/boards/pinName-ioe.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file pinName-ioe.h 3 | * 4 | * \brief Target board IO Expander pins definitions 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __PIN_NAME_IOE_H__ 24 | #define __PIN_NAME_IOE_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | // SX1509 Pin Names 32 | #define IOE_PINS \ 33 | IOE_0, IOE_1, IOE_2, IOE_3, IOE_4, IOE_5, IOE_6, IOE_7, \ 34 | IOE_8, IOE_9, IOE_10, IOE_11, IOE_12, IOE_13, IOE_14, IOE_15 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif // __PIN_NAME_IOE_H__ 41 | -------------------------------------------------------------------------------- /src/boards/spi-board.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file spi-board.h 3 | * 4 | * \brief Target board SPI driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __SPI_BOARD_H__ 24 | #define __SPI_BOARD_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #include "spi.h" 32 | 33 | // An Spi.c file has to be implmented under system directory. 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif // __SPI_BOARD_H__ 40 | -------------------------------------------------------------------------------- /src/mac/LoRaMacCrypto.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zephyrproject-rtos/loramac-node/99c2e5378dde37e3331bf3efdf9df8f77d4847ee/src/mac/LoRaMacCrypto.h -------------------------------------------------------------------------------- /src/mac/LoRaMacParser.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file LoRaMacParser.h 3 | * 4 | * \brief LoRa MAC layer message parser functionality implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013 Semtech 16 | * 17 | * ___ _____ _ ___ _ _____ ___ ___ ___ ___ 18 | * / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 19 | * \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 20 | * |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 21 | * embedded.connectivity.solutions=============== 22 | * 23 | * \endcode 24 | * 25 | * \author Miguel Luis ( Semtech ) 26 | * 27 | * \author Gregory Cristian ( Semtech ) 28 | * 29 | * \author Daniel Jaeckle ( STACKFORCE ) 30 | * 31 | * \author Johannes Bruder ( STACKFORCE ) 32 | * 33 | * addtogroup LORAMAC 34 | * \{ 35 | * 36 | */ 37 | #ifndef __LORAMAC_PARSER_H__ 38 | #define __LORAMAC_PARSER_H__ 39 | 40 | #ifdef __cplusplus 41 | extern "C" 42 | { 43 | #endif 44 | 45 | #include 46 | #include "LoRaMacMessageTypes.h" 47 | 48 | /*! 49 | * LoRaMac Parser Status 50 | */ 51 | typedef enum eLoRaMacParserStatus 52 | { 53 | /*! 54 | * No error occurred 55 | */ 56 | LORAMAC_PARSER_SUCCESS = 0, 57 | /*! 58 | * Failure during parsing occurred 59 | */ 60 | LORAMAC_PARSER_FAIL, 61 | /*! 62 | * Null pointer exception 63 | */ 64 | LORAMAC_PARSER_ERROR_NPE, 65 | /*! 66 | * Undefined Error occurred 67 | */ 68 | LORAMAC_PARSER_ERROR, 69 | }LoRaMacParserStatus_t; 70 | 71 | 72 | /*! 73 | * Parse a serialized join-accept message and fills the structured object. 74 | * 75 | * \param[IN/OUT] macMsg - Join-accept message object 76 | * \retval - Status of the operation 77 | */ 78 | LoRaMacParserStatus_t LoRaMacParserJoinAccept( LoRaMacMessageJoinAccept_t *macMsg ); 79 | 80 | /*! 81 | * Parse a serialized data message and fills the structured object. 82 | * 83 | * \param[IN/OUT] macMsg - Data message object 84 | * \retval - Status of the operation 85 | */ 86 | LoRaMacParserStatus_t LoRaMacParserData( LoRaMacMessageData_t *macMsg ); 87 | 88 | /*! \} addtogroup LORAMAC */ 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif // __LORAMAC_PARSER_H__ 95 | 96 | -------------------------------------------------------------------------------- /src/mac/LoRaMacTest.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file LoRaMacTest.h 3 | * 4 | * \brief LoRa MAC layer test function implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * ___ _____ _ ___ _ _____ ___ ___ ___ ___ 18 | * / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 19 | * \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 20 | * |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 21 | * embedded.connectivity.solutions=============== 22 | * 23 | * \endcode 24 | * 25 | * \author Miguel Luis ( Semtech ) 26 | * 27 | * \author Gregory Cristian ( Semtech ) 28 | * 29 | * \author Daniel Jaeckle ( STACKFORCE ) 30 | * 31 | * \defgroup LORAMACTEST LoRa MAC layer test function implementation 32 | * This module specifies the API implementation of test function of the LoRaMAC layer. 33 | * The functions in this file are only for testing purposes only. 34 | * \{ 35 | */ 36 | #ifndef __LORAMACTEST_H__ 37 | #define __LORAMACTEST_H__ 38 | 39 | #ifdef __cplusplus 40 | extern "C" 41 | { 42 | #endif 43 | 44 | /*! 45 | * \brief Enabled or disables the duty cycle 46 | * 47 | * \details This is a test function. It shall be used for testing purposes only. 48 | * Changing this attribute may lead to a non-conformance LoRaMac operation. 49 | * 50 | * \param [IN] enable - Enabled or disables the duty cycle 51 | */ 52 | void LoRaMacTestSetDutyCycleOn( bool enable ); 53 | 54 | /*! \} defgroup LORAMACTEST */ 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif // __LORAMACTEST_H__ 61 | -------------------------------------------------------------------------------- /src/peripherals/atecc608a-tnglora-se/atca_config.h: -------------------------------------------------------------------------------- 1 | /* Cryptoauthlib Configuration File */ 2 | #ifndef ATCA_CONFIG_H 3 | #define ATCA_CONFIG_H 4 | 5 | /* Include HALS */ 6 | #define ATCA_HAL_I2C 7 | 8 | /* Included device support */ 9 | #define ATCA_ATECC608A_SUPPORT 10 | 11 | /* ATECC608A I2C bus configuration */ 12 | #define ATCA_HAL_ATECC608A_I2C_FREQUENCY 100000U 13 | #define ATCA_HAL_ATECC608A_I2C_BUS_PINS 2U 14 | #define ATCA_HAL_ATECC608A_I2C_ADDRESS 0x59U 15 | #define ATCA_HAL_ATECC608A_I2C_RX_RETRIES 20 16 | #define ATCA_HAL_ATECC608A_I2C_WAKEUP_DELAY 1500U 17 | 18 | /* \brief How long to wait after an initial wake failure for the POST to 19 | * complete. 20 | * If Power-on self test (POST) is enabled, the self test will run on waking 21 | * from sleep or during power-on, which delays the wake reply. 22 | */ 23 | #ifndef ATCA_POST_DELAY_MSEC 24 | #define ATCA_POST_DELAY_MSEC 25 25 | #endif 26 | 27 | #endif -------------------------------------------------------------------------------- /src/peripherals/atecc608a-tnglora-se/atecc608a-tnglora-se-hal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file atecc608a-tnglora-se-hal.h 3 | * 4 | * @brief Secure Element hardware abstraction layer 5 | * 6 | * @remark Current implementation supports LoRaWAN 1.0.x and 1.1 7 | * 8 | * @copyright Copyright (c) 2020 The Things Industries B.V. 9 | * 10 | * Revised BSD License 11 | * Copyright The Things Industries B.V 2020. All rights reserved. 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions are met: 15 | * * Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * * Neither the name of the Things Industries B.V nor the 21 | * names of its contributors may be used to endorse or promote products 22 | * derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE THINGS INDUSTRIES B.V BE LIABLE FOR ANY 28 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | */ 35 | #ifndef __ATECC608A_TNGLORA_SE_HAL_H__ 36 | #define __ATECC608A_TNGLORA_SE_HAL_H__ 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | #include 43 | #include 44 | 45 | /*! 46 | * \brief Get a random number 47 | * 48 | * \remark The number SHALL NOT be generated using a pseudo random number 49 | * generator 50 | * \retval number 32 bit random value 51 | */ 52 | uint32_t ATECC608ASeHalGetRandomNumber( void ); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif // __ATECC608A_TNGLORA_SE_HAL_H__ 59 | -------------------------------------------------------------------------------- /src/peripherals/lr1110-se/lr1110-se-hal.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file soft-se-hal.h 3 | * 4 | * \brief Secure Element hardware abstraction layer implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2020 Semtech 16 | * 17 | * ___ _____ _ ___ _ _____ ___ ___ ___ ___ 18 | * / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 19 | * \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 20 | * |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 21 | * embedded.connectivity.solutions=============== 22 | * 23 | * \endcode 24 | * 25 | */ 26 | #include "board.h" 27 | #include "radio.h" 28 | 29 | #include "lr1110-se-hal.h" 30 | 31 | void LR1110SeHalGetUniqueId( uint8_t *id ) 32 | { 33 | BoardGetUniqueId( id ); 34 | } 35 | 36 | uint32_t LR1110SeHalGetRandomNumber( void ) 37 | { 38 | return Radio.Random( ); 39 | } 40 | -------------------------------------------------------------------------------- /src/peripherals/lr1110-se/lr1110-se-hal.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file lr1110-se-hal.h 3 | * 4 | * \brief Secure Element hardware abstraction layer 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2020 Semtech 16 | * 17 | * ___ _____ _ ___ _ _____ ___ ___ ___ ___ 18 | * / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 19 | * \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 20 | * |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 21 | * embedded.connectivity.solutions=============== 22 | * 23 | * \endcode 24 | * 25 | */ 26 | #ifndef __LR1110_SE_HAL_H__ 27 | #define __LR1110_SE_HAL_H__ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | #include 35 | 36 | /*! 37 | * \brief Get a 64 bits unique ID 38 | * 39 | * \param [IN] id Pointer to an array that will contain the Unique ID 40 | */ 41 | void LR1110SeHalGetUniqueId( uint8_t *id ); 42 | 43 | /*! 44 | * \brief Get a random number 45 | * 46 | * \remark The number SHALL NOT be generated using a pseudo random number 47 | * generator 48 | * \retval number 32 bit random value 49 | */ 50 | uint32_t LR1110SeHalGetRandomNumber( void ); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif // __LR1110_SE_HAL_H__ 57 | -------------------------------------------------------------------------------- /src/peripherals/mag3110.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file mag3110.c 3 | * 4 | * \brief MAG3110 Magnetometer driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include 24 | #include "utilities.h" 25 | #include "i2c.h" 26 | #include "mag3110.h" 27 | 28 | extern I2c_t I2c; 29 | 30 | static uint8_t I2cDeviceAddr = 0; 31 | static bool MAG3110Initialized = false; 32 | 33 | LmnStatus_t MAG3110Init( void ) 34 | { 35 | uint8_t regVal = 0; 36 | 37 | MAG3110SetDeviceAddr( MAG3110_I2C_ADDRESS ); 38 | 39 | if( MAG3110Initialized == false ) 40 | { 41 | MAG3110Initialized = true; 42 | 43 | MAG3110Read( MAG3110_ID, ®Val ); 44 | if( regVal != 0xC4 ) // Fixed Device ID Number = 0xC4 45 | { 46 | return LMN_STATUS_ERROR; 47 | } 48 | 49 | MAG3110Reset( ); 50 | } 51 | return LMN_STATUS_OK; 52 | } 53 | 54 | LmnStatus_t MAG3110Reset( void ) 55 | { 56 | if( MAG3110Write( 0x11, 0x10 ) == LMN_STATUS_OK ) // Reset the MAG3110 with CTRL_REG2 57 | { 58 | return LMN_STATUS_OK; 59 | } 60 | return LMN_STATUS_ERROR; 61 | } 62 | 63 | LmnStatus_t MAG3110Write( uint8_t addr, uint8_t data ) 64 | { 65 | return MAG3110WriteBuffer( addr, &data, 1 ); 66 | } 67 | 68 | LmnStatus_t MAG3110WriteBuffer( uint8_t addr, uint8_t *data, uint8_t size ) 69 | { 70 | return I2cWriteMemBuffer( &I2c, I2cDeviceAddr << 1, addr, data, size ); 71 | } 72 | 73 | LmnStatus_t MAG3110Read( uint8_t addr, uint8_t *data ) 74 | { 75 | return MAG3110ReadBuffer( addr, data, 1 ); 76 | } 77 | 78 | LmnStatus_t MAG3110ReadBuffer( uint8_t addr, uint8_t *data, uint8_t size ) 79 | { 80 | return I2cReadMemBuffer( &I2c, I2cDeviceAddr << 1, addr, data, size ); 81 | } 82 | 83 | void MAG3110SetDeviceAddr( uint8_t addr ) 84 | { 85 | I2cDeviceAddr = addr; 86 | } 87 | 88 | uint8_t MAG3110GetDeviceAddr( void ) 89 | { 90 | return I2cDeviceAddr; 91 | } 92 | -------------------------------------------------------------------------------- /src/peripherals/pam7q.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file pam7q.h 3 | * 4 | * \brief PAM7Q GPS receiver driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __PAM7Q_H__ 24 | #define __PAM7Q_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #include 32 | #include 33 | 34 | void PAM7QInit( void ); 35 | 36 | uint8_t PAM7QGetDeviceAddr( void ); 37 | 38 | void PAM7QSetDeviceAddr( uint8_t addr ); 39 | 40 | bool PAM7QGetGpsData( uint8_t *nmeaString, uint8_t *nmeaStringSize, uint16_t nmeaMaxStringSize ); 41 | 42 | uint8_t PAM7QWrite( uint8_t addr, uint8_t data ); 43 | 44 | uint8_t PAM7QWriteBuffer( uint8_t addr, uint8_t *data, uint8_t size ); 45 | 46 | uint8_t PAM7QRead( uint8_t addr, uint8_t *data ); 47 | 48 | uint8_t PAM7QReadBuffer( uint8_t addr, uint8_t *data, uint8_t size ); 49 | 50 | void GpsMcuOnPpsSignal( void ); 51 | 52 | /* 53 | * MPL3115A2 I2C address 54 | */ 55 | #define PAM7Q_I2C_ADDRESS 0x42 56 | 57 | #define MESSAGE_SIZE_1 0xFD 58 | #define MESSAGE_SIZE_2 0xFE 59 | 60 | #define PAYLOAD 0xFF 61 | 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif // __PAM7Q_H__ 68 | 69 | -------------------------------------------------------------------------------- /src/peripherals/soft-se/soft-se-hal.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file soft-se-hal.h 3 | * 4 | * \brief Secure Element hardware abstraction layer implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2020 Semtech 16 | * 17 | * ___ _____ _ ___ _ _____ ___ ___ ___ ___ 18 | * / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 19 | * \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 20 | * |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 21 | * embedded.connectivity.solutions=============== 22 | * 23 | * \endcode 24 | * 25 | */ 26 | #include "board.h" 27 | 28 | #include "soft-se-hal.h" 29 | 30 | void SoftSeHalGetUniqueId( uint8_t *id ) 31 | { 32 | BoardGetUniqueId( id ); 33 | } 34 | -------------------------------------------------------------------------------- /src/peripherals/soft-se/soft-se-hal.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file soft-se-hal.h 3 | * 4 | * \brief Secure Element hardware abstraction layer 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2020 Semtech 16 | * 17 | * ___ _____ _ ___ _ _____ ___ ___ ___ ___ 18 | * / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 19 | * \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 20 | * |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 21 | * embedded.connectivity.solutions=============== 22 | * 23 | * \endcode 24 | * 25 | */ 26 | #ifndef __SOFT_SE_HAL_H__ 27 | #define __SOFT_SE_HAL_H__ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | #include 35 | 36 | /*! 37 | * \brief Get a 64 bits unique ID 38 | * 39 | * \param [IN] id Pointer to an array that will contain the Unique ID 40 | */ 41 | void SoftSeHalGetUniqueId( uint8_t *id ); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif // __SOFT_SE_HAL_H__ 48 | -------------------------------------------------------------------------------- /src/peripherals/sx1509.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file sx1509.c 3 | * 4 | * \brief SX1509 IO expander driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include 24 | #include "utilities.h" 25 | #include "i2c.h" 26 | #include "sx1509.h" 27 | 28 | extern I2c_t I2c; 29 | 30 | static uint8_t I2cDeviceAddr = 0; 31 | 32 | static bool SX1509Initialized = false; 33 | 34 | void SX1509Init( void ) 35 | { 36 | if( SX1509Initialized == false ) 37 | { 38 | SX1509SetDeviceAddr( SX1509_I2C_ADDRESS ); 39 | SX1509Initialized = true; 40 | 41 | SX1509Reset( ); 42 | } 43 | } 44 | 45 | LmnStatus_t SX1509Reset( ) 46 | { 47 | if( SX1509Write( RegReset, 0x12 ) == LMN_STATUS_OK ) 48 | { 49 | if( SX1509Write( RegReset, 0x34 ) == LMN_STATUS_OK ) 50 | { 51 | return LMN_STATUS_OK; 52 | } 53 | } 54 | return LMN_STATUS_ERROR; 55 | } 56 | 57 | LmnStatus_t SX1509Write( uint8_t addr, uint8_t data ) 58 | { 59 | return SX1509WriteBuffer( addr, &data, 1 ); 60 | } 61 | 62 | LmnStatus_t SX1509WriteBuffer( uint8_t addr, uint8_t *data, uint8_t size ) 63 | { 64 | return I2cWriteMemBuffer( &I2c, I2cDeviceAddr << 1, addr, data, size ); 65 | } 66 | 67 | LmnStatus_t SX1509Read( uint8_t addr, uint8_t *data ) 68 | { 69 | return SX1509ReadBuffer( addr, data, 1 ); 70 | } 71 | 72 | LmnStatus_t SX1509ReadBuffer( uint8_t addr, uint8_t *data, uint8_t size ) 73 | { 74 | return I2cReadMemBuffer( &I2c, I2cDeviceAddr << 1, addr, data, size ); 75 | } 76 | 77 | void SX1509SetDeviceAddr( uint8_t addr ) 78 | { 79 | I2cDeviceAddr = addr; 80 | } 81 | 82 | uint8_t SX1509GetDeviceAddr( void ) 83 | { 84 | return I2cDeviceAddr; 85 | } 86 | -------------------------------------------------------------------------------- /src/system/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## 2 | ## ______ _ 3 | ## / _____) _ | | 4 | ## ( (____ _____ ____ _| |_ _____ ____| |__ 5 | ## \____ \| ___ | (_ _) ___ |/ ___) _ \ 6 | ## _____) ) ____| | | || |_| ____( (___| | | | 7 | ## (______/|_____)_|_|_| \__)_____)\____)_| |_| 8 | ## (C)2013-2017 Semtech 9 | ## ___ _____ _ ___ _ _____ ___ ___ ___ ___ 10 | ## / __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __| 11 | ## \__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _| 12 | ## |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___| 13 | ## embedded.connectivity.solutions.============== 14 | ## 15 | ## License: Revised BSD License, see LICENSE.TXT file included in the project 16 | ## Authors: Johannes Bruder (STACKFORCE), Miguel Luis (Semtech) 17 | ## 18 | project(system) 19 | cmake_minimum_required(VERSION 3.6) 20 | 21 | #--------------------------------------------------------------------------------------- 22 | # Target 23 | #--------------------------------------------------------------------------------------- 24 | 25 | file(GLOB ${PROJECT_NAME}_SOURCES 26 | "${CMAKE_CURRENT_SOURCE_DIR}/*.c" 27 | ) 28 | 29 | add_library(${PROJECT_NAME} OBJECT EXCLUDE_FROM_ALL ${${PROJECT_NAME}_SOURCES}) 30 | 31 | target_include_directories( ${PROJECT_NAME} PUBLIC 32 | ${CMAKE_CURRENT_SOURCE_DIR} 33 | $ 34 | $ 35 | ) 36 | -------------------------------------------------------------------------------- /src/system/adc.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file adc.c 3 | * 4 | * \brief Generic ADC driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include 24 | #include "adc-board.h" 25 | 26 | /*! 27 | * Flag to indicates if the ADC is initialized 28 | */ 29 | static bool AdcInitialized = false; 30 | 31 | void AdcInit( Adc_t *obj, PinNames adcInput ) 32 | { 33 | if( AdcInitialized == false ) 34 | { 35 | AdcInitialized = true; 36 | 37 | AdcMcuInit( obj, adcInput ); 38 | AdcMcuConfig( ); 39 | } 40 | } 41 | 42 | void AdcDeInit( Adc_t *obj ) 43 | { 44 | AdcInitialized = false; 45 | } 46 | 47 | uint16_t AdcReadChannel( Adc_t *obj, uint32_t channel ) 48 | { 49 | if( AdcInitialized == true ) 50 | { 51 | return AdcMcuReadChannel( obj, channel ); 52 | } 53 | else 54 | { 55 | return 0; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/system/adc.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file adc.h 3 | * 4 | * \brief Generic ADC driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __ADC_H__ 24 | #define __ADC_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #include 32 | #include "gpio.h" 33 | 34 | /*! 35 | * ADC object type definition 36 | */ 37 | typedef struct 38 | { 39 | Gpio_t AdcInput; 40 | }Adc_t; 41 | 42 | /*! 43 | * \brief Initializes the ADC input 44 | * 45 | * \param [IN] obj ADC object 46 | * \param [IN] scl ADC input pin name to be used 47 | */ 48 | void AdcInit( Adc_t *obj, PinNames adcInput ); 49 | 50 | /*! 51 | * \brief DeInitializes the ADC 52 | * 53 | * \param [IN] obj ADC object 54 | */ 55 | void AdcDeInit( Adc_t *obj ); 56 | 57 | /*! 58 | * \brief Read the analogue voltage value 59 | * 60 | * \param [IN] obj ADC object 61 | * \param [IN] channel ADC channel 62 | * \retval value Analogue pin value 63 | */ 64 | uint16_t AdcReadChannel( Adc_t *obj, uint32_t channel ); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif // __ADC_H__ 71 | -------------------------------------------------------------------------------- /src/system/delay.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay.c 3 | * 4 | * \brief Delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "delay-board.h" 24 | #include "delay.h" 25 | 26 | void Delay( float s ) 27 | { 28 | DelayMs( s * 1000.0f ); 29 | } 30 | 31 | void DelayMs( uint32_t ms ) 32 | { 33 | DelayMsMcu( ms ); 34 | } 35 | -------------------------------------------------------------------------------- /src/system/delay.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file delay.h 3 | * 4 | * \brief Delay implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __DELAY_H__ 24 | #define __DELAY_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #include 32 | 33 | /*! 34 | * Blocking delay of "s" seconds 35 | */ 36 | void Delay( float s ); 37 | 38 | /*! 39 | * Blocking delay of "ms" milliseconds 40 | */ 41 | void DelayMs( uint32_t ms ); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif // __DELAY_H__ 48 | 49 | -------------------------------------------------------------------------------- /src/system/fifo.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file fifo.h 3 | * 4 | * \brief FIFO buffer implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "fifo.h" 24 | 25 | static uint16_t FifoNext( Fifo_t *fifo, uint16_t index ) 26 | { 27 | return ( index + 1 ) % fifo->Size; 28 | } 29 | 30 | void FifoInit( Fifo_t *fifo, uint8_t *buffer, uint16_t size ) 31 | { 32 | fifo->Begin = 0; 33 | fifo->End = 0; 34 | fifo->Data = buffer; 35 | fifo->Size = size; 36 | } 37 | 38 | void FifoPush( Fifo_t *fifo, uint8_t data ) 39 | { 40 | fifo->End = FifoNext( fifo, fifo->End ); 41 | fifo->Data[fifo->End] = data; 42 | } 43 | 44 | uint8_t FifoPop( Fifo_t *fifo ) 45 | { 46 | uint8_t data = fifo->Data[FifoNext( fifo, fifo->Begin )]; 47 | 48 | fifo->Begin = FifoNext( fifo, fifo->Begin ); 49 | return data; 50 | } 51 | 52 | void FifoFlush( Fifo_t *fifo ) 53 | { 54 | fifo->Begin = 0; 55 | fifo->End = 0; 56 | } 57 | 58 | bool IsFifoEmpty( Fifo_t *fifo ) 59 | { 60 | return ( fifo->Begin == fifo->End ); 61 | } 62 | 63 | bool IsFifoFull( Fifo_t *fifo ) 64 | { 65 | return ( FifoNext( fifo, fifo->End ) == fifo->Begin ); 66 | } 67 | -------------------------------------------------------------------------------- /src/system/fifo.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file fifo.h 3 | * 4 | * \brief FIFO buffer implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __FIFO_H__ 24 | #define __FIFO_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #include 32 | #include 33 | 34 | /*! 35 | * FIFO structure 36 | */ 37 | typedef struct Fifo_s 38 | { 39 | uint16_t Begin; 40 | uint16_t End; 41 | uint8_t *Data; 42 | uint16_t Size; 43 | }Fifo_t; 44 | 45 | /*! 46 | * Initializes the FIFO structure 47 | * 48 | * \param [IN] fifo Pointer to the FIFO object 49 | * \param [IN] buffer Buffer to be used as FIFO 50 | * \param [IN] size Size of the buffer 51 | */ 52 | void FifoInit( Fifo_t *fifo, uint8_t *buffer, uint16_t size ); 53 | 54 | /*! 55 | * Pushes data to the FIFO 56 | * 57 | * \param [IN] fifo Pointer to the FIFO object 58 | * \param [IN] data Data to be pushed into the FIFO 59 | */ 60 | void FifoPush( Fifo_t *fifo, uint8_t data ); 61 | 62 | /*! 63 | * Pops data from the FIFO 64 | * 65 | * \param [IN] fifo Pointer to the FIFO object 66 | * \retval data Data popped from the FIFO 67 | */ 68 | uint8_t FifoPop( Fifo_t *fifo ); 69 | 70 | /*! 71 | * Flushes the FIFO 72 | * 73 | * \param [IN] fifo Pointer to the FIFO object 74 | */ 75 | void FifoFlush( Fifo_t *fifo ); 76 | 77 | /*! 78 | * Checks if the FIFO is empty 79 | * 80 | * \param [IN] fifo Pointer to the FIFO object 81 | * \retval isEmpty true: FIFO is empty, false FIFO is not empty 82 | */ 83 | bool IsFifoEmpty( Fifo_t *fifo ); 84 | 85 | /*! 86 | * Checks if the FIFO is full 87 | * 88 | * \param [IN] fifo Pointer to the FIFO object 89 | * \retval isFull true: FIFO is full, false FIFO is not full 90 | */ 91 | bool IsFifoFull( Fifo_t *fifo ); 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif // __FIFO_H__ 98 | -------------------------------------------------------------------------------- /src/system/gpio.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file gpio.c 3 | * 4 | * \brief GPIO driver implementation 5 | * 6 | * \remark: Relies on the specific board GPIO implementation as well as on 7 | * IO expander driver implementation if one is available on the target 8 | * board. 9 | * 10 | * \copyright Revised BSD License, see section \ref LICENSE. 11 | * 12 | * \code 13 | * ______ _ 14 | * / _____) _ | | 15 | * ( (____ _____ ____ _| |_ _____ ____| |__ 16 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 17 | * _____) ) ____| | | || |_| ____( (___| | | | 18 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 19 | * (C)2013-2017 Semtech 20 | * 21 | * \endcode 22 | * 23 | * \author Miguel Luis ( Semtech ) 24 | * 25 | * \author Gregory Cristian ( Semtech ) 26 | */ 27 | #include "gpio-board.h" 28 | 29 | void GpioInit( Gpio_t *obj, PinNames pin, PinModes mode, PinConfigs config, PinTypes type, uint32_t value ) 30 | { 31 | GpioMcuInit( obj, pin, mode, config, type, value ); 32 | } 33 | 34 | void GpioSetContext( Gpio_t *obj, void* context ) 35 | { 36 | GpioMcuSetContext( obj, context ); 37 | } 38 | 39 | void GpioSetInterrupt( Gpio_t *obj, IrqModes irqMode, IrqPriorities irqPriority, GpioIrqHandler *irqHandler ) 40 | { 41 | GpioMcuSetInterrupt( obj, irqMode, irqPriority, irqHandler ); 42 | } 43 | 44 | void GpioRemoveInterrupt( Gpio_t *obj ) 45 | { 46 | GpioMcuRemoveInterrupt( obj ); 47 | } 48 | 49 | void GpioWrite( Gpio_t *obj, uint32_t value ) 50 | { 51 | GpioMcuWrite( obj, value ); 52 | } 53 | 54 | void GpioToggle( Gpio_t *obj ) 55 | { 56 | GpioMcuToggle( obj ); 57 | } 58 | 59 | uint32_t GpioRead( Gpio_t *obj ) 60 | { 61 | return GpioMcuRead( obj ); 62 | } 63 | -------------------------------------------------------------------------------- /src/system/serial.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file uart.h 3 | * 4 | * \brief UART driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #ifndef __SERIAL_H__ 24 | #define __SERIAL_H__ 25 | 26 | #ifdef __cplusplus 27 | extern "C" 28 | { 29 | #endif 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif // __SERIAL_H__ 36 | -------------------------------------------------------------------------------- /src/system/uart.c: -------------------------------------------------------------------------------- 1 | /*! 2 | * \file uart.c 3 | * 4 | * \brief UART driver implementation 5 | * 6 | * \copyright Revised BSD License, see section \ref LICENSE. 7 | * 8 | * \code 9 | * ______ _ 10 | * / _____) _ | | 11 | * ( (____ _____ ____ _| |_ _____ ____| |__ 12 | * \____ \| ___ | (_ _) ___ |/ ___) _ \ 13 | * _____) ) ____| | | || |_| ____( (___| | | | 14 | * (______/|_____)_|_|_| \__)_____)\____)_| |_| 15 | * (C)2013-2017 Semtech 16 | * 17 | * \endcode 18 | * 19 | * \author Miguel Luis ( Semtech ) 20 | * 21 | * \author Gregory Cristian ( Semtech ) 22 | */ 23 | #include "uart-board.h" 24 | #include "uart.h" 25 | 26 | void UartInit( Uart_t *obj, UartId_t uartId, PinNames tx, PinNames rx ) 27 | { 28 | if( obj->IsInitialized == false ) 29 | { 30 | obj->IsInitialized = true; 31 | UartMcuInit( obj, uartId, tx, rx ); 32 | } 33 | } 34 | 35 | void UartConfig( Uart_t *obj, UartMode_t mode, uint32_t baudrate, WordLength_t wordLength, StopBits_t stopBits, Parity_t parity, FlowCtrl_t flowCtrl ) 36 | { 37 | UartMcuConfig( obj, mode, baudrate, wordLength, stopBits, parity, flowCtrl ); 38 | } 39 | 40 | void UartDeInit( Uart_t *obj ) 41 | { 42 | obj->IsInitialized = false; 43 | UartMcuDeInit( obj ); 44 | } 45 | 46 | uint8_t UartPutChar( Uart_t *obj, uint8_t data ) 47 | { 48 | return UartMcuPutChar( obj, data ); 49 | } 50 | 51 | uint8_t UartGetChar( Uart_t *obj, uint8_t *data ) 52 | { 53 | return UartMcuGetChar( obj, data ); 54 | } 55 | 56 | uint8_t UartPutBuffer( Uart_t *obj, uint8_t *buffer, uint16_t size ) 57 | { 58 | return UartMcuPutBuffer( obj, buffer, size ); 59 | } 60 | 61 | uint8_t UartGetBuffer( Uart_t *obj, uint8_t *buffer, uint16_t size, uint16_t *nbReadBytes ) 62 | { 63 | return UartMcuGetBuffer( obj, buffer, size, nbReadBytes ); 64 | } 65 | --------------------------------------------------------------------------------