From 550c2056dec32bb49275aeefdf85383822ab9a23 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Tue, 11 May 2021 16:53:13 -0700 Subject: [PATCH] [nrf528xx] move to openthread/ot-nrf528xx (#6585) --- CMakeLists.txt | 3 - configure.ac | 20 +- etc/cmake/functions.cmake | 8 +- examples/Makefile-nrf52811 | 309 - examples/Makefile-nrf52833 | 342 - examples/Makefile-nrf52840 | 376 - examples/platforms/Makefile.am | 6 +- examples/platforms/Makefile.platform.am | 12 - examples/platforms/nrf528xx/CMakeLists.txt | 103 - examples/platforms/nrf528xx/DIAG.md | 174 - examples/platforms/nrf528xx/Makefile.am | 44 - examples/platforms/nrf528xx/README.md | 17 - .../platforms/nrf528xx/nrf52811/Makefile.am | 175 - .../nrf528xx/nrf52811/Makefile.platform.am | 48 - .../platforms/nrf528xx/nrf52811/README.md | 367 +- .../nrf528xx/nrf52811/arm-none-eabi.cmake | 56 - .../nrf528xx/nrf52811/nrf52811.cmake | 173 - .../platforms/nrf528xx/nrf52811/nrf52811.ld | 168 - .../openthread-core-nrf52811-config-check.h | 36 - .../openthread-core-nrf52811-config.h | 268 - .../nrf528xx/nrf52811/platform-config.h | 216 - .../nrf528xx/nrf52811/transport-config.h | 260 - .../platforms/nrf528xx/nrf52833/Makefile.am | 205 - .../nrf528xx/nrf52833/Makefile.platform.am | 48 - .../platforms/nrf528xx/nrf52833/README.md | 408 +- .../nrf528xx/nrf52833/arm-none-eabi.cmake | 56 - .../nrf528xx/nrf52833/nrf52833.cmake | 214 - .../platforms/nrf528xx/nrf52833/nrf52833.ld | 168 - .../nrf52833/nrf52833_bootloader_ble.ld | 168 - .../nrf52833/nrf52833_bootloader_uart.ld | 168 - .../nrf52833/nrf52833_bootloader_usb.ld | 168 - .../openthread-core-nrf52833-config-check.h | 36 - .../openthread-core-nrf52833-config.h | 320 - .../nrf528xx/nrf52833/platform-config.h | 215 - .../nrf528xx/nrf52833/transport-config.h | 309 - .../platforms/nrf528xx/nrf52840/Makefile.am | 207 - .../nrf528xx/nrf52840/Makefile.platform.am | 61 - .../platforms/nrf528xx/nrf52840/README.md | 572 +- .../nrf528xx/nrf52840/arm-none-eabi.cmake | 56 - .../nrf528xx/nrf52840/nrf52840.cmake | 227 - .../platforms/nrf528xx/nrf52840/nrf52840.ld | 168 - .../nrf52840/nrf52840_bootloader_ble.ld | 168 - .../nrf52840/nrf52840_bootloader_uart.ld | 168 - .../nrf52840/nrf52840_bootloader_usb.ld | 168 - .../openthread-core-nrf52840-config-check.h | 36 - .../openthread-core-nrf52840-config.h | 320 - .../nrf528xx/nrf52840/platform-config.h | 215 - .../nrf528xx/nrf52840/transport-config.h | 309 - examples/platforms/nrf528xx/src/alarm.c | 699 - examples/platforms/nrf528xx/src/diag.c | 535 - examples/platforms/nrf528xx/src/entropy.c | 240 - examples/platforms/nrf528xx/src/fem.c | 208 - examples/platforms/nrf528xx/src/flash.c | 149 - examples/platforms/nrf528xx/src/flash_nosd.c | 51 - examples/platforms/nrf528xx/src/flash_sd.c | 265 - examples/platforms/nrf528xx/src/logging.c | 63 - examples/platforms/nrf528xx/src/misc.c | 134 - .../platforms/nrf528xx/src/platform-fem.h | 64 - .../nrf528xx/src/platform-nrf5-transport.h | 66 - .../platforms/nrf528xx/src/platform-nrf5.h | 208 - .../nrf528xx/src/platform-softdevice.h | 74 - examples/platforms/nrf528xx/src/radio.c | 1483 - examples/platforms/nrf528xx/src/softdevice.c | 104 - examples/platforms/nrf528xx/src/softdevice.h | 82 - examples/platforms/nrf528xx/src/system.c | 150 - examples/platforms/nrf528xx/src/temp.c | 129 - .../nrf528xx/src/transport/spi-slave.c | 217 - .../src/transport/transport-drivers.h | 79 - .../nrf528xx/src/transport/transport.c | 94 - .../platforms/nrf528xx/src/transport/uart.c | 361 - .../nrf528xx/src/transport/usb-cdc-uart.c | 372 - script/check-arm-build-autotools | 121 - script/check-arm-build-cmake | 28 - script/cmake-build | 90 +- third_party/CMakeLists.txt | 5 - third_party/Makefile.am | 38 +- .../NordicSemiconductor/CMakeLists.txt | 375 - third_party/NordicSemiconductor/Makefile.am | 541 - third_party/NordicSemiconductor/README.md | 15 - .../NordicSemiconductor/cmsis/arm_math.h | 7030 -- .../NordicSemiconductor/cmsis/cmsis_armcc.h | 734 - .../cmsis/cmsis_armcc_V6.h | 1800 - .../NordicSemiconductor/cmsis/cmsis_gcc.h | 1373 - .../NordicSemiconductor/cmsis/core_cm4.h | 1937 - .../NordicSemiconductor/cmsis/core_cmFunc.h | 86 - .../NordicSemiconductor/cmsis/core_cmInstr.h | 87 - .../NordicSemiconductor/cmsis/core_cmSimd.h | 96 - .../NordicSemiconductor/config/app_config.h | 258 - .../config/nrf52811/config/sdk_config.h | 10335 --- .../config/nrf52833/config/sdk_config.h | 11576 ---- .../config/nrf52840/config/sdk_config.h | 11698 ---- .../dependencies/app_util.h | 1326 - .../dependencies/app_util_platform.c | 129 - .../dependencies/app_util_platform.h | 281 - .../dependencies/legacy/apply_old_config.h | 1391 - .../dependencies/nordic_common.h | 215 - .../dependencies/nrf_assert.h | 122 - .../dependencies/nrf_error.h | 95 - .../dependencies/nrf_log.h | 291 - .../dependencies/nrf_log_ctrl.h | 252 - .../dependencies/nrf_log_ctrl_internal.h | 91 - .../dependencies/nrf_log_instance.h | 135 - .../dependencies/nrf_log_internal.h | 528 - .../dependencies/nrf_log_types.h | 97 - .../dependencies/nrf_section.h | 191 - .../dependencies/nrfx_config.h | 47 - .../dependencies/nrfx_glue.h | 338 - .../dependencies/nrfx_log.h | 152 - .../dependencies/sdk_common.h | 77 - .../dependencies/sdk_errors.h | 168 - .../dependencies/sdk_macros.h | 224 - .../NordicSemiconductor/dependencies/sdk_os.h | 76 - .../dependencies/sdk_resources.h | 86 - .../drivers/clock/nrf_drv_clock.c | 605 - .../drivers/clock/nrf_drv_clock.h | 297 - .../drivers/common/nrf_drv_common.h | 63 - .../drivers/power/nrf_drv_power.c | 417 - .../drivers/power/nrf_drv_power.h | 232 - .../drivers/radio/fal/nrf_802154_fal.c | 47 - .../drivers/radio/fal/nrf_802154_fal.h | 61 - .../drivers/radio/fem/none/nrf_fem_config.h | 61 - .../radio/fem/nrf_fem_control_config.h | 107 - .../drivers/radio/fem/nrf_fem_protocol_api.h | 303 - .../radio/fem/nrf_fem_protocol_legacy_api.h | 63 - .../radio/fem/simple_gpio/nrf_fem_config.h | 127 - .../fem/simple_gpio/nrf_fem_simple_gpio.c | 470 - .../radio/fem/three_pin_gpio/nrf_fem_config.h | 149 - .../three_pin_gpio/nrf_fem_three_pin_gpio.c | 575 - .../ack_generator/nrf_802154_ack_data.c | 742 - .../ack_generator/nrf_802154_ack_data.h | 140 - .../ack_generator/nrf_802154_ack_generator.c | 92 - .../ack_generator/nrf_802154_ack_generator.h | 54 - .../nrf_802154_enh_ack_generator.c | 379 - .../nrf_802154_enh_ack_generator.h | 58 - .../nrf_802154_imm_ack_generator.c | 72 - .../nrf_802154_imm_ack_generator.h | 58 - .../mac_features/nrf_802154_ack_timeout.c | 173 - .../mac_features/nrf_802154_ack_timeout.h | 107 - .../radio/mac_features/nrf_802154_csma_ca.c | 258 - .../radio/mac_features/nrf_802154_csma_ca.h | 109 - .../mac_features/nrf_802154_delayed_trx.c | 539 - .../mac_features/nrf_802154_delayed_trx.h | 147 - .../radio/mac_features/nrf_802154_filter.c | 476 - .../radio/mac_features/nrf_802154_filter.h | 77 - .../mac_features/nrf_802154_frame_parser.c | 682 - .../mac_features/nrf_802154_frame_parser.h | 317 - .../nrf_802154_precise_ack_timeout.c | 183 - .../drivers/radio/nrf_802154.c | 844 - .../drivers/radio/nrf_802154.h | 1248 - .../drivers/radio/nrf_802154_config.h | 425 - .../drivers/radio/nrf_802154_const.h | 177 - .../drivers/radio/nrf_802154_core.c | 3275 - .../drivers/radio/nrf_802154_core.h | 240 - .../drivers/radio/nrf_802154_core_hooks.c | 236 - .../drivers/radio/nrf_802154_core_hooks.h | 111 - .../radio/nrf_802154_critical_section.c | 285 - .../radio/nrf_802154_critical_section.h | 128 - .../drivers/radio/nrf_802154_debug.c | 169 - .../drivers/radio/nrf_802154_debug.h | 191 - .../drivers/radio/nrf_802154_debug_core.h | 160 - .../drivers/radio/nrf_802154_notification.h | 140 - .../radio/nrf_802154_notification_direct.c | 110 - .../radio/nrf_802154_notification_swi.c | 91 - .../drivers/radio/nrf_802154_peripherals.h | 506 - .../drivers/radio/nrf_802154_pib.c | 251 - .../drivers/radio/nrf_802154_pib.h | 193 - .../drivers/radio/nrf_802154_priority_drop.h | 76 - .../radio/nrf_802154_priority_drop_direct.c | 56 - .../radio/nrf_802154_priority_drop_swi.c | 55 - .../radio/nrf_802154_procedures_duration.h | 160 - .../drivers/radio/nrf_802154_request.h | 171 - .../drivers/radio/nrf_802154_request_direct.c | 124 - .../drivers/radio/nrf_802154_request_swi.c | 187 - .../drivers/radio/nrf_802154_rssi.c | 96 - .../drivers/radio/nrf_802154_rssi.h | 92 - .../drivers/radio/nrf_802154_rx_buffer.c | 68 - .../drivers/radio/nrf_802154_rx_buffer.h | 82 - .../drivers/radio/nrf_802154_swi.c | 868 - .../drivers/radio/nrf_802154_swi.h | 263 - .../drivers/radio/nrf_802154_timer_coord.c | 268 - .../drivers/radio/nrf_802154_timer_coord.h | 117 - .../drivers/radio/nrf_802154_types.h | 168 - .../drivers/radio/nrf_802154_utils.h | 172 - .../radio/platform/clock/nrf_802154_clock.h | 134 - .../platform/clock/nrf_802154_clock_nodrv.c | 127 - .../platform/clock/nrf_802154_clock_ot.c | 115 - .../platform/clock/nrf_802154_clock_sdk.c | 114 - .../platform/coex/nrf_802154_wifi_coex.h | 108 - .../platform/coex/nrf_802154_wifi_coex_none.c | 69 - .../platform/hp_timer/nrf_802154_hp_timer.c | 142 - .../platform/hp_timer/nrf_802154_hp_timer.h | 148 - .../platform/lp_timer/nrf_802154_lp_timer.h | 212 - .../lp_timer/nrf_802154_lp_timer_nodrv.c | 610 - .../lp_timer/nrf_802154_lp_timer_none.c | 62 - .../radio/platform/random/nrf_802154_random.h | 82 - .../random/nrf_802154_random_newlib.c | 82 - .../random/nrf_802154_random_stdlib.c | 82 - .../temperature/nrf_802154_temperature.h | 87 - .../temperature/nrf_802154_temperature_none.c | 59 - .../drivers/radio/rsch/nrf_802154_rsch.c | 561 - .../drivers/radio/rsch/nrf_802154_rsch.h | 246 - .../radio/rsch/nrf_802154_rsch_crit_sect.c | 154 - .../radio/rsch/nrf_802154_rsch_crit_sect.h | 71 - .../drivers/radio/rsch/raal/nrf_raal_api.h | 161 - .../drivers/radio/rsch/raal/nrf_raal_config.h | 70 - .../rsch/raal/simulator/nrf_802154_debug.h | 74 - .../rsch/raal/simulator/nrf_raal_simulator.c | 251 - .../radio/rsch/raal/single_phy/single_phy.c | 89 - .../rsch/raal/softdevice/nrf_802154_debug.h | 74 - .../raal/softdevice/nrf_raal_softdevice.c | 830 - .../raal/softdevice/nrf_raal_softdevice.h | 141 - .../timer_scheduler/nrf_802154_timer_sched.c | 475 - .../timer_scheduler/nrf_802154_timer_sched.h | 177 - .../drivers/systick/nrf_drv_systick.h | 80 - .../drivers/usbd/nrf_drv_usbd.h | 272 - .../drivers/usbd/nrf_drv_usbd_errata.h | 70 - .../libraries/app_error/app_error.c | 139 - .../libraries/app_error/app_error.h | 192 - .../libraries/app_error/app_error_weak.c | 60 - .../libraries/app_error/app_error_weak.h | 87 - .../libraries/atfifo/nrf_atfifo.c | 189 - .../libraries/atfifo/nrf_atfifo.h | 424 - .../libraries/atfifo/nrf_atfifo_internal.h | 577 - .../libraries/atomic/nrf_atomic.c | 449 - .../libraries/atomic/nrf_atomic.h | 274 - .../libraries/atomic/nrf_atomic_internal.h | 343 - .../libraries/block_dev/nrf_block_dev.h | 352 - .../libraries/delay/nrf_delay.h | 80 - .../nrf_security/config/nrf-config.h | 3761 -- .../nrf_security/include/mbedtls/aes.h | 675 - .../nrf_security/include/mbedtls/aesni.h | 138 - .../nrf_security/include/mbedtls/arc4.h | 146 - .../nrf_security/include/mbedtls/aria.h | 371 - .../nrf_security/include/mbedtls/asn1.h | 609 - .../nrf_security/include/mbedtls/asn1write.h | 372 - .../nrf_security/include/mbedtls/base64.h | 98 - .../nrf_security/include/mbedtls/bignum.h | 1019 - .../nrf_security/include/mbedtls/blowfish.h | 287 - .../nrf_security/include/mbedtls/bn_mul.h | 940 - .../nrf_security/include/mbedtls/camellia.h | 326 - .../nrf_security/include/mbedtls/ccm.h | 310 - .../nrf_security/include/mbedtls/ccm_alt.h | 45 - .../nrf_security/include/mbedtls/certs.h | 252 - .../nrf_security/include/mbedtls/chacha20.h | 227 - .../include/mbedtls/chacha20_alt.h | 58 - .../nrf_security/include/mbedtls/chachapoly.h | 359 - .../include/mbedtls/chachapoly_alt.h | 45 - .../include/mbedtls/check_config.h | 860 - .../nrf_security/include/mbedtls/cipher.h | 926 - .../include/mbedtls/cipher_internal.h | 152 - .../nrf_security/include/mbedtls/cmac.h | 213 - .../nrf_security/include/mbedtls/compat-1.3.h | 2531 - .../nrf_security/include/mbedtls/config.h | 3770 -- .../nrf_security/include/mbedtls/ctr_drbg.h | 562 - .../nrf_security/include/mbedtls/debug.h | 264 - .../nrf_security/include/mbedtls/des.h | 356 - .../nrf_security/include/mbedtls/dhm.h | 1094 - .../nrf_security/include/mbedtls/ecdh.h | 448 - .../nrf_security/include/mbedtls/ecdsa.h | 628 - .../nrf_security/include/mbedtls/ecjpake.h | 277 - .../nrf_security/include/mbedtls/ecp.h | 1188 - .../nrf_security/include/mbedtls/ecp_alt.h | 144 - .../include/mbedtls/ecp_internal.h | 299 - .../nrf_security/include/mbedtls/entropy.h | 289 - .../include/mbedtls/entropy_poll.h | 110 - .../nrf_security/include/mbedtls/error.h | 164 - .../nrf_security/include/mbedtls/gcm.h | 326 - .../nrf_security/include/mbedtls/havege.h | 82 - .../nrf_security/include/mbedtls/hkdf.h | 141 - .../nrf_security/include/mbedtls/hmac_drbg.h | 415 - .../nrf_security/include/mbedtls/md.h | 476 - .../nrf_security/include/mbedtls/md2.h | 306 - .../nrf_security/include/mbedtls/md4.h | 311 - .../nrf_security/include/mbedtls/md5.h | 311 - .../include/mbedtls/md_internal.h | 92 - .../include/mbedtls/memory_buffer_alloc.h | 151 - .../nrf_security/include/mbedtls/net.h | 37 - .../include/mbedtls/net_sockets.h | 278 - .../nrf_security/include/mbedtls/nist_kw.h | 184 - .../nrf_security/include/mbedtls/oid.h | 649 - .../nrf_security/include/mbedtls/padlock.h | 126 - .../nrf_security/include/mbedtls/pem.h | 146 - .../nrf_security/include/mbedtls/pk.h | 881 - .../include/mbedtls/pk_internal.h | 142 - .../nrf_security/include/mbedtls/pkcs11.h | 248 - .../nrf_security/include/mbedtls/pkcs12.h | 130 - .../nrf_security/include/mbedtls/pkcs5.h | 109 - .../nrf_security/include/mbedtls/platform.h | 419 - .../include/mbedtls/platform_alt.h | 65 - .../include/mbedtls/platform_time.h | 82 - .../include/mbedtls/platform_util.h | 196 - .../nrf_security/include/mbedtls/poly1305.h | 193 - .../include/mbedtls/poly1305_alt.h | 59 - .../nrf_security/include/mbedtls/psa_util.h | 422 - .../nrf_security/include/mbedtls/ripemd160.h | 237 - .../nrf_security/include/mbedtls/rsa.h | 1277 - .../include/mbedtls/rsa_internal.h | 226 - .../nrf_security/include/mbedtls/sha1.h | 352 - .../nrf_security/include/mbedtls/sha1_alt.h | 40 - .../nrf_security/include/mbedtls/sha256.h | 297 - .../nrf_security/include/mbedtls/sha256_alt.h | 40 - .../nrf_security/include/mbedtls/sha512.h | 316 - .../nrf_security/include/mbedtls/ssl.h | 4190 -- .../nrf_security/include/mbedtls/ssl_cache.h | 151 - .../include/mbedtls/ssl_ciphersuites.h | 558 - .../nrf_security/include/mbedtls/ssl_cookie.h | 115 - .../include/mbedtls/ssl_internal.h | 1232 - .../nrf_security/include/mbedtls/ssl_ticket.h | 142 - .../nrf_security/include/mbedtls/threading.h | 122 - .../include/mbedtls/threading_alt.h | 21 - .../nrf_security/include/mbedtls/timing.h | 153 - .../nrf_security/include/mbedtls/version.h | 112 - .../nrf_security/include/mbedtls/x509.h | 361 - .../nrf_security/include/mbedtls/x509_crl.h | 174 - .../nrf_security/include/mbedtls/x509_crt.h | 1084 - .../nrf_security/include/mbedtls/x509_csr.h | 307 - .../nrf_security/include/mbedtls/xtea.h | 139 - .../software-only-threading/threading_alt.h | 38 - .../nrf_security/lib/libmbedcrypto_cc3xx.a | Bin 438916 -> 0 bytes .../nrf_security/lib/libmbedcrypto_oberon.a | Bin 249424 -> 0 bytes .../nrf_security/lib/libmbedcrypto_shared.a | Bin 13300 -> 0 bytes .../lib/libmbedtls_base_vanilla.a | Bin 582422 -> 0 bytes .../nrf_security/lib/libmbedtls_tls_vanilla.a | Bin 429956 -> 0 bytes .../lib/libmbedtls_x509_vanilla.a | Bin 131950 -> 0 bytes .../lib/libnrf_cc310_platform_0.9.4.a | Bin 67176 -> 0 bytes .../nrf52811-mbedtls-config.h | 41 - .../nrf52833-mbedtls-config.h | 43 - .../nrf52840-mbedtls-config.h | 45 - .../include/nrf_cc310_platform.h | 38 - .../include/nrf_cc310_platform_abort.h | 23 - .../include/nrf_cc310_platform_defines.h | 36 - .../include/nrf_cc310_platform_entropy.h | 25 - .../include/nrf_cc310_platform_mutex.h | 45 - .../include/nrf_cc3xx_platform.h | 88 - .../include/nrf_cc3xx_platform_abort.h | 76 - .../include/nrf_cc3xx_platform_ctr_drbg.h | 232 - .../include/nrf_cc3xx_platform_defines.h | 57 - .../include/nrf_cc3xx_platform_entropy.h | 53 - .../include/nrf_cc3xx_platform_kmu.h | 149 - .../include/nrf_cc3xx_platform_mutex.h | 158 - .../src/nrf_cc3xx_platform_abort_freertos.c | 40 - .../src/nrf_cc3xx_platform_abort_zephyr.c | 42 - .../src/nrf_cc3xx_platform_mutex_freertos.c | 228 - .../src/nrf_cc3xx_platform_mutex_zephyr.c | 263 - .../libraries/usb/app_usbd.c | 1919 - .../libraries/usb/app_usbd.h | 816 - .../libraries/usb/app_usbd_class_base.h | 1103 - .../libraries/usb/app_usbd_core.c | 1251 - .../libraries/usb/app_usbd_core.h | 222 - .../libraries/usb/app_usbd_descriptor.h | 337 - .../libraries/usb/app_usbd_langid.h | 300 - .../libraries/usb/app_usbd_nrf_dfu_trigger.c | 374 - .../libraries/usb/app_usbd_nrf_dfu_trigger.h | 166 - .../usb/app_usbd_nrf_dfu_trigger_internal.h | 203 - .../usb/app_usbd_nrf_dfu_trigger_types.h | 145 - .../libraries/usb/app_usbd_request.h | 356 - .../libraries/usb/app_usbd_serial_num.c | 84 - .../libraries/usb/app_usbd_serial_num.h | 75 - .../libraries/usb/app_usbd_string_desc.c | 295 - .../libraries/usb/app_usbd_string_desc.h | 179 - .../libraries/usb/app_usbd_types.h | 279 - .../usb/class/cdc/acm/app_usbd_cdc_acm.c | 1199 - .../usb/class/cdc/acm/app_usbd_cdc_acm.h | 362 - .../class/cdc/acm/app_usbd_cdc_acm_internal.h | 287 - .../usb/class/cdc/app_usbd_cdc_desc.h | 208 - .../usb/class/cdc/app_usbd_cdc_types.h | 360 - .../usb/config/app_usbd_string_config.h | 130 - .../libraries/usb/nordic_cdc_acm.cat | Bin 7565 -> 0 bytes .../libraries/usb/nordic_cdc_acm_example.inf | 115 - .../libraries/usb/nrf_dfu_trigger_usb.c | 243 - .../libraries/usb/nrf_dfu_trigger_usb.h | 74 - .../libraries/utf_converter/LICENSE | 9 - .../libraries/utf_converter/utf.c | 350 - .../libraries/utf_converter/utf.h | 61 - .../NordicSemiconductor/nrfx/.gitignore | 2 - .../NordicSemiconductor/nrfx/CHANGELOG.md | 230 - third_party/NordicSemiconductor/nrfx/LICENSE | 29 - .../NordicSemiconductor/nrfx/README.md | 44 - .../nrfx/doc/buildfiles/extra_stylesheet.css | 506 - .../nrfx/doc/buildfiles/favicon.ico | Bin 26694 -> 0 bytes .../nrfx/doc/buildfiles/footer.html | 10 - .../nrfx/doc/buildfiles/header.html | 58 - .../nrfx/doc/buildfiles/layout.xml | 187 - .../nrfx/doc/buildfiles/nordic_small.png | Bin 4338 -> 0 bytes .../nrfx/doc/config_dox/nrfx_adc_dox_config.h | 82 - .../doc/config_dox/nrfx_clock_dox_config.h | 105 - .../doc/config_dox/nrfx_comp_dox_config.h | 158 - .../doc/config_dox/nrfx_gpiote_dox_config.h | 93 - .../nrfx/doc/config_dox/nrfx_i2s_dox_config.h | 225 - .../doc/config_dox/nrfx_lpcomp_dox_config.h | 146 - .../doc/config_dox/nrfx_nfct_dox_config.h | 88 - .../nrfx/doc/config_dox/nrfx_pdm_dox_config.h | 117 - .../doc/config_dox/nrfx_power_dox_config.h | 51 - .../nrfx/doc/config_dox/nrfx_ppi_dox_config.h | 70 - .../nrfx/doc/config_dox/nrfx_prs_dox_config.h | 110 - .../nrfx/doc/config_dox/nrfx_pwm_dox_config.h | 239 - .../doc/config_dox/nrfx_qdec_dox_config.h | 178 - .../doc/config_dox/nrfx_qspi_dox_config.h | 170 - .../nrfx/doc/config_dox/nrfx_rng_dox_config.h | 94 - .../nrfx/doc/config_dox/nrfx_rtc_dox_config.h | 134 - .../doc/config_dox/nrfx_saadc_dox_config.h | 123 - .../nrfx/doc/config_dox/nrfx_spi_dox_config.h | 121 - .../doc/config_dox/nrfx_spim_dox_config.h | 163 - .../doc/config_dox/nrfx_spis_dox_config.h | 143 - .../nrfx/doc/config_dox/nrfx_swi_dox_config.h | 126 - .../doc/config_dox/nrfx_systick_dox_config.h | 15 - .../doc/config_dox/nrfx_timer_dox_config.h | 166 - .../nrfx/doc/config_dox/nrfx_twi_dox_config.h | 121 - .../doc/config_dox/nrfx_twim_dox_config.h | 135 - .../doc/config_dox/nrfx_twis_dox_config.h | 158 - .../doc/config_dox/nrfx_uart_dox_config.h | 139 - .../doc/config_dox/nrfx_uarte_dox_config.h | 146 - .../doc/config_dox/nrfx_usbd_dox_config.h | 56 - .../nrfx/doc/config_dox/nrfx_wdt_dox_config.h | 117 - .../nrfx/doc/drv_supp_matrix.dox | 55 - .../nrfx/doc/generate_html_doc.bat | 2 - .../nrfx/doc/generate_html_doc.sh | 2 - .../nrfx/doc/main_page.dox | 89 - .../nrfx/doc/nrf51_series.dox | 56 - .../NordicSemiconductor/nrfx/doc/nrf52810.dox | 70 - .../NordicSemiconductor/nrfx/doc/nrf52832.dox | 78 - .../NordicSemiconductor/nrfx/doc/nrf52833.dox | 80 - .../NordicSemiconductor/nrfx/doc/nrf52840.dox | 82 - .../NordicSemiconductor/nrfx/doc/nrf9160.dox | 54 - .../nrfx/doc/nrfx.doxyfile | 2505 - .../NordicSemiconductor/nrfx/doc/nrfx_api.dox | 98 - .../nrfx/drivers/include/nrf_bitmask.h | 150 - .../nrfx/drivers/include/nrfx_adc.h | 280 - .../nrfx/drivers/include/nrfx_clock.h | 197 - .../nrfx/drivers/include/nrfx_comp.h | 239 - .../nrfx/drivers/include/nrfx_dppi.h | 176 - .../nrfx/drivers/include/nrfx_gpiote.h | 435 - .../nrfx/drivers/include/nrfx_i2s.h | 244 - .../nrfx/drivers/include/nrfx_lpcomp.h | 144 - .../nrfx/drivers/include/nrfx_nfct.h | 344 - .../nrfx/drivers/include/nrfx_nvmc.h | 286 - .../nrfx/drivers/include/nrfx_pdm.h | 198 - .../nrfx/drivers/include/nrfx_power.h | 371 - .../nrfx/drivers/include/nrfx_power_clock.h | 83 - .../nrfx/drivers/include/nrfx_ppi.h | 322 - .../nrfx/drivers/include/nrfx_pwm.h | 467 - .../nrfx/drivers/include/nrfx_qdec.h | 189 - .../nrfx/drivers/include/nrfx_qspi.h | 321 - .../nrfx/drivers/include/nrfx_rng.h | 111 - .../nrfx/drivers/include/nrfx_rtc.h | 369 - .../nrfx/drivers/include/nrfx_saadc.h | 307 - .../nrfx/drivers/include/nrfx_spi.h | 246 - .../nrfx/drivers/include/nrfx_spim.h | 376 - .../nrfx/drivers/include/nrfx_spis.h | 251 - .../nrfx/drivers/include/nrfx_swi.h | 236 - .../nrfx/drivers/include/nrfx_systick.h | 126 - .../nrfx/drivers/include/nrfx_temp.h | 153 - .../nrfx/drivers/include/nrfx_timer.h | 400 - .../nrfx/drivers/include/nrfx_twi.h | 397 - .../nrfx/drivers/include/nrfx_twi_twim.h | 47 - .../nrfx/drivers/include/nrfx_twim.h | 433 - .../nrfx/drivers/include/nrfx_twis.h | 394 - .../nrfx/drivers/include/nrfx_uart.h | 351 - .../nrfx/drivers/include/nrfx_uarte.h | 350 - .../nrfx/drivers/include/nrfx_usbd.h | 863 - .../nrfx/drivers/include/nrfx_wdt.h | 159 - .../nrfx/drivers/nrfx_common.h | 333 - .../nrfx/drivers/nrfx_errors.h | 76 - .../nrfx/drivers/src/nrfx_adc.c | 331 - .../nrfx/drivers/src/nrfx_clock.c | 380 - .../nrfx/drivers/src/nrfx_comp.c | 202 - .../nrfx/drivers/src/nrfx_dppi.c | 310 - .../nrfx/drivers/src/nrfx_gpiote.c | 820 - .../nrfx/drivers/src/nrfx_i2s.c | 436 - .../nrfx/drivers/src/nrfx_lpcomp.c | 165 - .../nrfx/drivers/src/nrfx_nfct.c | 831 - .../nrfx/drivers/src/nrfx_nvmc.c | 421 - .../nrfx/drivers/src/nrfx_pdm.c | 361 - .../nrfx/drivers/src/nrfx_power.c | 332 - .../nrfx/drivers/src/nrfx_ppi.c | 521 - .../nrfx/drivers/src/nrfx_pwm.c | 506 - .../nrfx/drivers/src/nrfx_qdec.c | 195 - .../nrfx/drivers/src/nrfx_qspi.c | 408 - .../nrfx/drivers/src/nrfx_rng.c | 113 - .../nrfx/drivers/src/nrfx_rtc.c | 339 - .../nrfx/drivers/src/nrfx_saadc.c | 630 - .../nrfx/drivers/src/nrfx_spi.c | 432 - .../nrfx/drivers/src/nrfx_spim.c | 693 - .../nrfx/drivers/src/nrfx_spis.c | 521 - .../nrfx/drivers/src/nrfx_swi.c | 430 - .../nrfx/drivers/src/nrfx_systick.c | 161 - .../nrfx/drivers/src/nrfx_temp.c | 146 - .../nrfx/drivers/src/nrfx_timer.c | 321 - .../nrfx/drivers/src/nrfx_twi.c | 728 - .../nrfx/drivers/src/nrfx_twi_twim.c | 81 - .../nrfx/drivers/src/nrfx_twim.c | 768 - .../nrfx/drivers/src/nrfx_twis.c | 848 - .../nrfx/drivers/src/nrfx_uart.c | 645 - .../nrfx/drivers/src/nrfx_uarte.c | 655 - .../nrfx/drivers/src/nrfx_usbd.c | 2359 - .../nrfx/drivers/src/nrfx_usbd_errata.h | 148 - .../nrfx/drivers/src/nrfx_wdt.c | 157 - .../nrfx/drivers/src/prs/nrfx_prs.c | 157 - .../nrfx/drivers/src/prs/nrfx_prs.h | 139 - .../NordicSemiconductor/nrfx/hal/nrf_aar.h | 376 - .../NordicSemiconductor/nrfx/hal/nrf_acl.h | 146 - .../NordicSemiconductor/nrfx/hal/nrf_adc.h | 327 - .../NordicSemiconductor/nrfx/hal/nrf_bprot.h | 125 - .../NordicSemiconductor/nrfx/hal/nrf_ccm.h | 479 - .../NordicSemiconductor/nrfx/hal/nrf_clock.h | 521 - .../NordicSemiconductor/nrfx/hal/nrf_comp.h | 442 - .../NordicSemiconductor/nrfx/hal/nrf_dppi.h | 332 - .../NordicSemiconductor/nrfx/hal/nrf_ecb.c | 82 - .../NordicSemiconductor/nrfx/hal/nrf_ecb.h | 278 - .../NordicSemiconductor/nrfx/hal/nrf_egu.h | 458 - .../NordicSemiconductor/nrfx/hal/nrf_ficr.h | 146 - .../NordicSemiconductor/nrfx/hal/nrf_gpio.h | 806 - .../NordicSemiconductor/nrfx/hal/nrf_gpiote.h | 573 - .../NordicSemiconductor/nrfx/hal/nrf_i2s.h | 612 - .../NordicSemiconductor/nrfx/hal/nrf_kmu.h | 269 - .../NordicSemiconductor/nrfx/hal/nrf_lpcomp.h | 402 - .../NordicSemiconductor/nrfx/hal/nrf_mpu.h | 176 - .../NordicSemiconductor/nrfx/hal/nrf_mwu.h | 416 - .../NordicSemiconductor/nrfx/hal/nrf_nfct.h | 1064 - .../NordicSemiconductor/nrfx/hal/nrf_nvmc.c | 124 - .../NordicSemiconductor/nrfx/hal/nrf_nvmc.h | 451 - .../NordicSemiconductor/nrfx/hal/nrf_pdm.h | 455 - .../NordicSemiconductor/nrfx/hal/nrf_power.h | 1094 - .../NordicSemiconductor/nrfx/hal/nrf_ppi.h | 515 - .../NordicSemiconductor/nrfx/hal/nrf_pwm.h | 742 - .../NordicSemiconductor/nrfx/hal/nrf_qdec.h | 549 - .../NordicSemiconductor/nrfx/hal/nrf_qspi.h | 794 - .../NordicSemiconductor/nrfx/hal/nrf_radio.h | 1395 - .../nrfx/hal/nrf_regulators.h | 95 - .../NordicSemiconductor/nrfx/hal/nrf_rng.h | 251 - .../NordicSemiconductor/nrfx/hal/nrf_rtc.h | 417 - .../NordicSemiconductor/nrfx/hal/nrf_saadc.h | 763 - .../NordicSemiconductor/nrfx/hal/nrf_spi.h | 362 - .../NordicSemiconductor/nrfx/hal/nrf_spim.h | 792 - .../NordicSemiconductor/nrfx/hal/nrf_spis.h | 665 - .../NordicSemiconductor/nrfx/hal/nrf_spu.h | 441 - .../nrfx/hal/nrf_systick.h | 180 - .../NordicSemiconductor/nrfx/hal/nrf_temp.h | 265 - .../NordicSemiconductor/nrfx/hal/nrf_timer.h | 705 - .../NordicSemiconductor/nrfx/hal/nrf_twi.h | 467 - .../NordicSemiconductor/nrfx/hal/nrf_twim.h | 596 - .../NordicSemiconductor/nrfx/hal/nrf_twis.h | 736 - .../NordicSemiconductor/nrfx/hal/nrf_uart.h | 502 - .../NordicSemiconductor/nrfx/hal/nrf_uarte.h | 628 - .../NordicSemiconductor/nrfx/hal/nrf_usbd.h | 1387 - .../NordicSemiconductor/nrfx/hal/nrf_vmc.h | 250 - .../NordicSemiconductor/nrfx/hal/nrf_wdt.h | 393 - .../nrfx/helpers/nrfx_gppi/nrfx_gppi.h | 577 - .../nrfx/mdk/arm_startup_nrf51.s | 261 - .../nrfx/mdk/arm_startup_nrf52.s | 371 - .../nrfx/mdk/arm_startup_nrf52805.s | 343 - .../nrfx/mdk/arm_startup_nrf52810.s | 374 - .../nrfx/mdk/arm_startup_nrf52811.s | 351 - .../nrfx/mdk/arm_startup_nrf52833.s | 379 - .../nrfx/mdk/arm_startup_nrf52840.s | 383 - .../nrfx/mdk/arm_startup_nrf9160.s | 492 - .../nrfx/mdk/compiler_abstraction.h | 170 - .../nrfx/mdk/gcc_startup_nrf51.S | 298 - .../nrfx/mdk/gcc_startup_nrf52.S | 404 - .../nrfx/mdk/gcc_startup_nrf52805.S | 390 - .../nrfx/mdk/gcc_startup_nrf52810.S | 417 - .../nrfx/mdk/gcc_startup_nrf52811.S | 394 - .../nrfx/mdk/gcc_startup_nrf52833.S | 408 - .../nrfx/mdk/gcc_startup_nrf52840.S | 426 - .../nrfx/mdk/gcc_startup_nrf9160.S | 533 - .../nrfx/mdk/iar_startup_nrf51.s | 310 - .../nrfx/mdk/iar_startup_nrf52.s | 456 - .../nrfx/mdk/iar_startup_nrf52805.s | 386 - .../nrfx/mdk/iar_startup_nrf52810.s | 429 - .../nrfx/mdk/iar_startup_nrf52811.s | 406 - .../nrfx/mdk/iar_startup_nrf52833.s | 476 - .../nrfx/mdk/iar_startup_nrf52840.s | 486 - .../nrfx/mdk/iar_startup_nrf9160.s | 559 - .../NordicSemiconductor/nrfx/mdk/nrf.h | 143 - .../NordicSemiconductor/nrfx/mdk/nrf51.h | 1304 - .../NordicSemiconductor/nrfx/mdk/nrf51.svd | 20959 ------ .../nrfx/mdk/nrf51422_peripherals.h | 160 - .../nrfx/mdk/nrf51801_peripherals.h | 160 - .../nrfx/mdk/nrf51802_peripherals.h | 160 - .../nrfx/mdk/nrf51822_peripherals.h | 161 - .../nrfx/mdk/nrf51824_peripherals.h | 161 - .../nrfx/mdk/nrf51_bitfields.h | 6131 -- .../nrfx/mdk/nrf51_common.ld | 170 - .../nrfx/mdk/nrf51_deprecated.h | 446 - .../nrfx/mdk/nrf51_peripherals.h | 159 - .../nrfx/mdk/nrf51_to_nrf52.h | 2355 - .../nrfx/mdk/nrf51_to_nrf52810.h | 1222 - .../nrfx/mdk/nrf51_to_nrf52840.h | 1333 - .../nrfx/mdk/nrf51_xxaa.ld | 13 - .../nrfx/mdk/nrf51_xxab.ld | 13 - .../nrfx/mdk/nrf51_xxac.ld | 13 - .../NordicSemiconductor/nrfx/mdk/nrf52.h | 2443 - .../NordicSemiconductor/nrfx/mdk/nrf52.svd | 42660 ------------ .../NordicSemiconductor/nrfx/mdk/nrf52805.h | 1766 - .../NordicSemiconductor/nrfx/mdk/nrf52805.svd | 32763 --------- .../nrfx/mdk/nrf52805_bitfields.h | 10267 --- .../nrfx/mdk/nrf52805_peripherals.h | 209 - .../nrfx/mdk/nrf52805_xxaa.ld | 13 - .../NordicSemiconductor/nrfx/mdk/nrf52810.h | 2005 - .../NordicSemiconductor/nrfx/mdk/nrf52810.svd | 36131 ---------- .../nrfx/mdk/nrf52810_bitfields.h | 11344 ---- .../nrfx/mdk/nrf52810_name_change.h | 55 - .../nrfx/mdk/nrf52810_peripherals.h | 225 - .../nrfx/mdk/nrf52810_to_nrf52811.h | 59 - .../nrfx/mdk/nrf52810_xxaa.ld | 13 - .../NordicSemiconductor/nrfx/mdk/nrf52811.h | 2079 - .../NordicSemiconductor/nrfx/mdk/nrf52811.svd | 38250 ----------- .../nrfx/mdk/nrf52811_bitfields.h | 12026 ---- .../nrfx/mdk/nrf52811_peripherals.h | 231 - .../nrfx/mdk/nrf52811_xxaa.ld | 13 - .../nrfx/mdk/nrf52832_peripherals.h | 280 - .../nrfx/mdk/nrf52832_xxaa.ld | 13 - .../nrfx/mdk/nrf52832_xxab.ld | 13 - .../NordicSemiconductor/nrfx/mdk/nrf52833.h | 2794 - .../NordicSemiconductor/nrfx/mdk/nrf52833.svd | 53945 --------------- .../nrfx/mdk/nrf52833_bitfields.h | 17053 ----- .../nrfx/mdk/nrf52833_peripherals.h | 301 - .../nrfx/mdk/nrf52833_xxaa.ld | 13 - .../NordicSemiconductor/nrfx/mdk/nrf52840.h | 2928 - .../NordicSemiconductor/nrfx/mdk/nrf52840.svd | 54788 ---------------- .../nrfx/mdk/nrf52840_bitfields.h | 17406 ----- .../nrfx/mdk/nrf52840_peripherals.h | 306 - .../nrfx/mdk/nrf52840_xxaa.ld | 13 - .../nrfx/mdk/nrf52_bitfields.h | 12654 ---- .../nrfx/mdk/nrf52_common.ld | 170 - .../nrfx/mdk/nrf52_name_change.h | 72 - .../nrfx/mdk/nrf52_to_nrf52810.h | 153 - .../nrfx/mdk/nrf52_to_nrf52833.h | 150 - .../nrfx/mdk/nrf52_to_nrf52840.h | 152 - .../nrfx/mdk/nrf52_xxaa.ld | 13 - .../NordicSemiconductor/nrfx/mdk/nrf9160.h | 2250 - .../NordicSemiconductor/nrfx/mdk/nrf9160.svd | 35285 ---------- .../nrfx/mdk/nrf9160_bitfields.h | 11043 ---- .../nrfx/mdk/nrf9160_name_change.h | 56 - .../nrfx/mdk/nrf9160_peripherals.h | 216 - .../nrfx/mdk/nrf9160_xxaa.ld | 13 - .../nrfx/mdk/nrf_common.ld | 168 - .../nrfx/mdk/nrf_peripherals.h | 72 - .../nrfx/mdk/ses_startup_nrf51.s | 269 - .../nrfx/mdk/ses_startup_nrf52.s | 391 - .../nrfx/mdk/ses_startup_nrf52805.s | 349 - .../nrfx/mdk/ses_startup_nrf52810.s | 384 - .../nrfx/mdk/ses_startup_nrf52811.s | 361 - .../nrfx/mdk/ses_startup_nrf52833.s | 403 - .../nrfx/mdk/ses_startup_nrf52840.s | 409 - .../nrfx/mdk/ses_startup_nrf9160.s | 506 - .../nrfx/mdk/ses_startup_nrf_common.s | 186 - .../NordicSemiconductor/nrfx/mdk/system_nrf.h | 61 - .../nrfx/mdk/system_nrf51.c | 143 - .../nrfx/mdk/system_nrf51.h | 46 - .../nrfx/mdk/system_nrf52.c | 373 - .../nrfx/mdk/system_nrf52.h | 46 - .../nrfx/mdk/system_nrf52805.c | 191 - .../nrfx/mdk/system_nrf52805.h | 46 - .../nrfx/mdk/system_nrf52810.c | 469 - .../nrfx/mdk/system_nrf52810.h | 46 - .../nrfx/mdk/system_nrf52811.c | 293 - .../nrfx/mdk/system_nrf52811.h | 46 - .../nrfx/mdk/system_nrf52833.c | 191 - .../nrfx/mdk/system_nrf52833.h | 46 - .../nrfx/mdk/system_nrf52840.c | 300 - .../nrfx/mdk/system_nrf52840.h | 46 - .../nrfx/mdk/system_nrf9160.c | 304 - .../nrfx/mdk/system_nrf9160.h | 46 - third_party/NordicSemiconductor/nrfx/nrfx.h | 40 - .../nrfx/soc/nrfx_atomic.c | 386 - .../nrfx/soc/nrfx_atomic.h | 275 - .../nrfx/soc/nrfx_atomic_internal.h | 326 - .../nrfx/soc/nrfx_coredep.h | 171 - .../NordicSemiconductor/nrfx/soc/nrfx_irqs.h | 53 - .../nrfx/soc/nrfx_irqs_nrf51.h | 128 - .../nrfx/soc/nrfx_irqs_nrf52810.h | 140 - .../nrfx/soc/nrfx_irqs_nrf52811.h | 143 - .../nrfx/soc/nrfx_irqs_nrf52832.h | 185 - .../nrfx/soc/nrfx_irqs_nrf52833.h | 196 - .../nrfx/soc/nrfx_irqs_nrf52840.h | 202 - .../nrfx/soc/nrfx_irqs_nrf9160.h | 161 - .../nrfx/templates/nRF51/nrfx_config.h | 1605 - .../nrfx/templates/nRF52810/nrfx_config.h | 2415 - .../nrfx/templates/nRF52811/nrfx_config.h | 2430 - .../nrfx/templates/nRF52832/nrfx_config.h | 2990 - .../nrfx/templates/nRF52833/nrfx_config.h | 3042 - .../nrfx/templates/nRF52840/nrfx_config.h | 3180 - .../nrfx/templates/nRF9160/nrfx_config.h | 2079 - .../nrfx/templates/nrfx_glue.h | 258 - .../nrfx/templates/nrfx_log.h | 135 - .../segger_rtt/SEGGER_RTT_Conf.h | 332 - .../s140_nrf52_7.0.1_licence-agreement.txt | 35 - .../s140_nrf52_7.0.1_migration-document.pdf | Bin 90738 -> 0 bytes .../doc/s140_nrf52_7.0.1_release-notes.pdf | Bin 106570 -> 0 bytes .../softdevice/s140/headers/ble.h | 662 - .../softdevice/s140/headers/ble_err.h | 93 - .../softdevice/s140/headers/ble_gap.h | 2846 - .../softdevice/s140/headers/ble_gatt.h | 229 - .../softdevice/s140/headers/ble_gattc.h | 715 - .../softdevice/s140/headers/ble_gatts.h | 845 - .../softdevice/s140/headers/ble_hci.h | 135 - .../softdevice/s140/headers/ble_l2cap.h | 506 - .../softdevice/s140/headers/ble_ranges.h | 156 - .../softdevice/s140/headers/ble_types.h | 215 - .../softdevice/s140/headers/nrf52/nrf_mbr.h | 268 - .../softdevice/s140/headers/nrf_error.h | 90 - .../softdevice/s140/headers/nrf_error_sdm.h | 70 - .../softdevice/s140/headers/nrf_error_soc.h | 85 - .../softdevice/s140/headers/nrf_nvic.h | 491 - .../softdevice/s140/headers/nrf_sd_def.h | 59 - .../softdevice/s140/headers/nrf_sdm.h | 371 - .../softdevice/s140/headers/nrf_soc.h | 1080 - .../softdevice/s140/headers/nrf_svc.h | 100 - third_party/jlink/CMakeLists.txt | 31 - third_party/jlink/Makefile.am | 45 - 711 files changed, 13 insertions(+), 699632 deletions(-) delete mode 100644 examples/Makefile-nrf52811 delete mode 100644 examples/Makefile-nrf52833 delete mode 100644 examples/Makefile-nrf52840 delete mode 100644 examples/platforms/nrf528xx/CMakeLists.txt delete mode 100644 examples/platforms/nrf528xx/DIAG.md delete mode 100644 examples/platforms/nrf528xx/Makefile.am delete mode 100644 examples/platforms/nrf528xx/README.md delete mode 100644 examples/platforms/nrf528xx/nrf52811/Makefile.am delete mode 100644 examples/platforms/nrf528xx/nrf52811/Makefile.platform.am delete mode 100644 examples/platforms/nrf528xx/nrf52811/arm-none-eabi.cmake delete mode 100644 examples/platforms/nrf528xx/nrf52811/nrf52811.cmake delete mode 100644 examples/platforms/nrf528xx/nrf52811/nrf52811.ld delete mode 100644 examples/platforms/nrf528xx/nrf52811/openthread-core-nrf52811-config-check.h delete mode 100644 examples/platforms/nrf528xx/nrf52811/openthread-core-nrf52811-config.h delete mode 100644 examples/platforms/nrf528xx/nrf52811/platform-config.h delete mode 100644 examples/platforms/nrf528xx/nrf52811/transport-config.h delete mode 100644 examples/platforms/nrf528xx/nrf52833/Makefile.am delete mode 100644 examples/platforms/nrf528xx/nrf52833/Makefile.platform.am delete mode 100644 examples/platforms/nrf528xx/nrf52833/arm-none-eabi.cmake delete mode 100644 examples/platforms/nrf528xx/nrf52833/nrf52833.cmake delete mode 100644 examples/platforms/nrf528xx/nrf52833/nrf52833.ld delete mode 100644 examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_ble.ld delete mode 100644 examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_uart.ld delete mode 100644 examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_usb.ld delete mode 100644 examples/platforms/nrf528xx/nrf52833/openthread-core-nrf52833-config-check.h delete mode 100644 examples/platforms/nrf528xx/nrf52833/openthread-core-nrf52833-config.h delete mode 100644 examples/platforms/nrf528xx/nrf52833/platform-config.h delete mode 100644 examples/platforms/nrf528xx/nrf52833/transport-config.h delete mode 100644 examples/platforms/nrf528xx/nrf52840/Makefile.am delete mode 100644 examples/platforms/nrf528xx/nrf52840/Makefile.platform.am delete mode 100644 examples/platforms/nrf528xx/nrf52840/arm-none-eabi.cmake delete mode 100644 examples/platforms/nrf528xx/nrf52840/nrf52840.cmake delete mode 100644 examples/platforms/nrf528xx/nrf52840/nrf52840.ld delete mode 100644 examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_ble.ld delete mode 100644 examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_uart.ld delete mode 100644 examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_usb.ld delete mode 100644 examples/platforms/nrf528xx/nrf52840/openthread-core-nrf52840-config-check.h delete mode 100644 examples/platforms/nrf528xx/nrf52840/openthread-core-nrf52840-config.h delete mode 100644 examples/platforms/nrf528xx/nrf52840/platform-config.h delete mode 100644 examples/platforms/nrf528xx/nrf52840/transport-config.h delete mode 100644 examples/platforms/nrf528xx/src/alarm.c delete mode 100644 examples/platforms/nrf528xx/src/diag.c delete mode 100644 examples/platforms/nrf528xx/src/entropy.c delete mode 100644 examples/platforms/nrf528xx/src/fem.c delete mode 100644 examples/platforms/nrf528xx/src/flash.c delete mode 100644 examples/platforms/nrf528xx/src/flash_nosd.c delete mode 100644 examples/platforms/nrf528xx/src/flash_sd.c delete mode 100644 examples/platforms/nrf528xx/src/logging.c delete mode 100644 examples/platforms/nrf528xx/src/misc.c delete mode 100644 examples/platforms/nrf528xx/src/platform-fem.h delete mode 100644 examples/platforms/nrf528xx/src/platform-nrf5-transport.h delete mode 100644 examples/platforms/nrf528xx/src/platform-nrf5.h delete mode 100644 examples/platforms/nrf528xx/src/platform-softdevice.h delete mode 100644 examples/platforms/nrf528xx/src/radio.c delete mode 100644 examples/platforms/nrf528xx/src/softdevice.c delete mode 100644 examples/platforms/nrf528xx/src/softdevice.h delete mode 100644 examples/platforms/nrf528xx/src/system.c delete mode 100644 examples/platforms/nrf528xx/src/temp.c delete mode 100644 examples/platforms/nrf528xx/src/transport/spi-slave.c delete mode 100644 examples/platforms/nrf528xx/src/transport/transport-drivers.h delete mode 100644 examples/platforms/nrf528xx/src/transport/transport.c delete mode 100644 examples/platforms/nrf528xx/src/transport/uart.c delete mode 100644 examples/platforms/nrf528xx/src/transport/usb-cdc-uart.c delete mode 100644 third_party/NordicSemiconductor/CMakeLists.txt delete mode 100644 third_party/NordicSemiconductor/Makefile.am delete mode 100644 third_party/NordicSemiconductor/README.md delete mode 100644 third_party/NordicSemiconductor/cmsis/arm_math.h delete mode 100644 third_party/NordicSemiconductor/cmsis/cmsis_armcc.h delete mode 100644 third_party/NordicSemiconductor/cmsis/cmsis_armcc_V6.h delete mode 100644 third_party/NordicSemiconductor/cmsis/cmsis_gcc.h delete mode 100644 third_party/NordicSemiconductor/cmsis/core_cm4.h delete mode 100644 third_party/NordicSemiconductor/cmsis/core_cmFunc.h delete mode 100644 third_party/NordicSemiconductor/cmsis/core_cmInstr.h delete mode 100644 third_party/NordicSemiconductor/cmsis/core_cmSimd.h delete mode 100644 third_party/NordicSemiconductor/config/app_config.h delete mode 100644 third_party/NordicSemiconductor/config/nrf52811/config/sdk_config.h delete mode 100644 third_party/NordicSemiconductor/config/nrf52833/config/sdk_config.h delete mode 100644 third_party/NordicSemiconductor/config/nrf52840/config/sdk_config.h delete mode 100644 third_party/NordicSemiconductor/dependencies/app_util.h delete mode 100644 third_party/NordicSemiconductor/dependencies/app_util_platform.c delete mode 100644 third_party/NordicSemiconductor/dependencies/app_util_platform.h delete mode 100644 third_party/NordicSemiconductor/dependencies/legacy/apply_old_config.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nordic_common.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nrf_assert.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nrf_error.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nrf_log.h delete mode 100755 third_party/NordicSemiconductor/dependencies/nrf_log_ctrl.h delete mode 100755 third_party/NordicSemiconductor/dependencies/nrf_log_ctrl_internal.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nrf_log_instance.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nrf_log_internal.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nrf_log_types.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nrf_section.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nrfx_config.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nrfx_glue.h delete mode 100644 third_party/NordicSemiconductor/dependencies/nrfx_log.h delete mode 100644 third_party/NordicSemiconductor/dependencies/sdk_common.h delete mode 100644 third_party/NordicSemiconductor/dependencies/sdk_errors.h delete mode 100644 third_party/NordicSemiconductor/dependencies/sdk_macros.h delete mode 100644 third_party/NordicSemiconductor/dependencies/sdk_os.h delete mode 100644 third_party/NordicSemiconductor/dependencies/sdk_resources.h delete mode 100644 third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.c delete mode 100644 third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.h delete mode 100644 third_party/NordicSemiconductor/drivers/common/nrf_drv_common.h delete mode 100644 third_party/NordicSemiconductor/drivers/power/nrf_drv_power.c delete mode 100644 third_party/NordicSemiconductor/drivers/power/nrf_drv_power.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/fal/nrf_802154_fal.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/fal/nrf_802154_fal.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/fem/none/nrf_fem_config.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_config.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_protocol_api.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_protocol_legacy_api.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio/nrf_fem_config.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio/nrf_fem_simple_gpio.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio/nrf_fem_config.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio/nrf_fem_three_pin_gpio.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_delayed_trx.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_delayed_trx.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_frame_parser.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_frame_parser.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_precise_ack_timeout.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_config.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_const.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug_core.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification_direct.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification_swi.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_peripherals.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop_direct.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop_swi.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_procedures_duration.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_request.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_request_direct.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_request_swi.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_timer_coord.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_timer_coord.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_types.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/nrf_802154_utils.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_nodrv.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_ot.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_sdk.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/coex/nrf_802154_wifi_coex.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/coex/nrf_802154_wifi_coex_none.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/hp_timer/nrf_802154_hp_timer.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/hp_timer/nrf_802154_hp_timer.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer_nodrv.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer_none.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random_newlib.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random_stdlib.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/temperature/nrf_802154_temperature.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/platform/temperature/nrf_802154_temperature_none.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch_crit_sect.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch_crit_sect.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/raal/nrf_raal_api.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/raal/nrf_raal_config.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/raal/simulator/nrf_802154_debug.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/raal/simulator/nrf_raal_simulator.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/raal/single_phy/single_phy.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_802154_debug.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.h delete mode 100644 third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.c delete mode 100644 third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.h delete mode 100644 third_party/NordicSemiconductor/drivers/systick/nrf_drv_systick.h delete mode 100644 third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd.h delete mode 100644 third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd_errata.h delete mode 100644 third_party/NordicSemiconductor/libraries/app_error/app_error.c delete mode 100644 third_party/NordicSemiconductor/libraries/app_error/app_error.h delete mode 100644 third_party/NordicSemiconductor/libraries/app_error/app_error_weak.c delete mode 100644 third_party/NordicSemiconductor/libraries/app_error/app_error_weak.h delete mode 100644 third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.c delete mode 100644 third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.h delete mode 100644 third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo_internal.h delete mode 100644 third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.c delete mode 100644 third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.h delete mode 100644 third_party/NordicSemiconductor/libraries/atomic/nrf_atomic_internal.h delete mode 100644 third_party/NordicSemiconductor/libraries/block_dev/nrf_block_dev.h delete mode 100644 third_party/NordicSemiconductor/libraries/delay/nrf_delay.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/config/nrf-config.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aes.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aesni.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/arc4.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aria.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/asn1.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/asn1write.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/base64.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/bignum.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/blowfish.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/bn_mul.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/camellia.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ccm.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ccm_alt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/certs.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chacha20.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chacha20_alt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chachapoly.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chachapoly_alt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/check_config.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cipher.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cipher_internal.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cmac.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/compat-1.3.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/config.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ctr_drbg.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/debug.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/des.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/dhm.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecdh.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecdsa.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecjpake.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp_alt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp_internal.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/entropy.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/entropy_poll.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/error.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/gcm.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/havege.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/hkdf.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/hmac_drbg.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md2.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md4.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md5.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md_internal.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/memory_buffer_alloc.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/net.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/net_sockets.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/nist_kw.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/oid.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/padlock.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pem.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pk.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pk_internal.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs11.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs12.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs5.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_alt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_time.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_util.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/poly1305.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/poly1305_alt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/psa_util.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ripemd160.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/rsa.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/rsa_internal.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha1.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha1_alt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha256.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha256_alt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha512.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_cache.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_ciphersuites.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_cookie.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_internal.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_ticket.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/threading.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/threading_alt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/timing.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/version.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_crl.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_crt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_csr.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/xtea.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/include/software-only-threading/threading_alt.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_cc3xx.a delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_oberon.a delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_shared.a delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_x509_vanilla.a delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/lib/libnrf_cc310_platform_0.9.4.a delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52811-mbedtls-config.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52833-mbedtls-config.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52840-mbedtls-config.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_abort.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_defines.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_entropy.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_mutex.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_abort.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_ctr_drbg.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_defines.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_entropy.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_kmu.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_mutex.h delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_abort_freertos.c delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_abort_zephyr.c delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_mutex_freertos.c delete mode 100644 third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_mutex_zephyr.c delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd.c delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_class_base.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_core.c delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_core.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_descriptor.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_langid.h delete mode 100755 third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger.c delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger_internal.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger_types.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_request.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.c delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.c delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/app_usbd_types.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.c delete mode 100644 third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm_internal.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_desc.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_types.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/config/app_usbd_string_config.h delete mode 100644 third_party/NordicSemiconductor/libraries/usb/nordic_cdc_acm.cat delete mode 100644 third_party/NordicSemiconductor/libraries/usb/nordic_cdc_acm_example.inf delete mode 100644 third_party/NordicSemiconductor/libraries/usb/nrf_dfu_trigger_usb.c delete mode 100644 third_party/NordicSemiconductor/libraries/usb/nrf_dfu_trigger_usb.h delete mode 100644 third_party/NordicSemiconductor/libraries/utf_converter/LICENSE delete mode 100644 third_party/NordicSemiconductor/libraries/utf_converter/utf.c delete mode 100644 third_party/NordicSemiconductor/libraries/utf_converter/utf.h delete mode 100644 third_party/NordicSemiconductor/nrfx/.gitignore delete mode 100644 third_party/NordicSemiconductor/nrfx/CHANGELOG.md delete mode 100644 third_party/NordicSemiconductor/nrfx/LICENSE delete mode 100644 third_party/NordicSemiconductor/nrfx/README.md delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/buildfiles/extra_stylesheet.css delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/buildfiles/favicon.ico delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/buildfiles/footer.html delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/buildfiles/header.html delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/buildfiles/layout.xml delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/buildfiles/nordic_small.png delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_adc_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_clock_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_comp_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_gpiote_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_i2s_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_lpcomp_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_nfct_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_pdm_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_power_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_ppi_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_prs_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_pwm_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_qdec_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_qspi_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_rng_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_rtc_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_saadc_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spi_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spim_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spis_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_swi_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_systick_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_timer_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twi_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twim_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twis_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_uart_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_uarte_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_usbd_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_wdt_dox_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/drv_supp_matrix.dox delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/generate_html_doc.bat delete mode 100755 third_party/NordicSemiconductor/nrfx/doc/generate_html_doc.sh delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/main_page.dox delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/nrf51_series.dox delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/nrf52810.dox delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/nrf52832.dox delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/nrf52833.dox delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/nrf52840.dox delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/nrf9160.dox delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/nrfx.doxyfile delete mode 100644 third_party/NordicSemiconductor/nrfx/doc/nrfx_api.dox delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrf_bitmask.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_adc.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_clock.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_comp.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_dppi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_gpiote.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_i2s.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_lpcomp.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_nfct.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_nvmc.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_pdm.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_power.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_power_clock.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_ppi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_pwm.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_qdec.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_qspi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_rng.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_rtc.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_saadc.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_spi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_spim.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_spis.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_swi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_systick.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_temp.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_timer.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_twi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_twi_twim.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_twim.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_twis.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_uart.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_uarte.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_usbd.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_wdt.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/nrfx_common.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/nrfx_errors.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_adc.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_clock.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_comp.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_dppi.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_gpiote.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_i2s.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_lpcomp.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_nfct.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_nvmc.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_pdm.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_power.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_ppi.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_pwm.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_qdec.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_qspi.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_rng.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_rtc.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_saadc.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_spi.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_spim.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_spis.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_swi.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_systick.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_temp.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_timer.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_twi.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_twi_twim.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_twim.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_twis.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_uart.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_uarte.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_usbd.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_usbd_errata.h delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_wdt.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/prs/nrfx_prs.c delete mode 100644 third_party/NordicSemiconductor/nrfx/drivers/src/prs/nrfx_prs.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_aar.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_acl.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_adc.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_bprot.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_ccm.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_clock.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_comp.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_dppi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_ecb.c delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_ecb.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_egu.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_ficr.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_gpio.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_gpiote.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_i2s.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_kmu.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_lpcomp.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_mpu.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_mwu.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_nfct.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_nvmc.c delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_nvmc.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_pdm.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_power.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_ppi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_pwm.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_qdec.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_qspi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_radio.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_regulators.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_rng.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_rtc.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_saadc.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_spi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_spim.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_spis.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_spu.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_systick.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_temp.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_timer.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_twi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_twim.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_twis.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_uart.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_uarte.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_usbd.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_vmc.h delete mode 100644 third_party/NordicSemiconductor/nrfx/hal/nrf_wdt.h delete mode 100644 third_party/NordicSemiconductor/nrfx/helpers/nrfx_gppi/nrfx_gppi.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/arm_startup_nrf51.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/arm_startup_nrf52.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/arm_startup_nrf52805.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/arm_startup_nrf52810.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/arm_startup_nrf52811.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/arm_startup_nrf52833.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/arm_startup_nrf52840.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/arm_startup_nrf9160.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/compiler_abstraction.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/gcc_startup_nrf51.S delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/gcc_startup_nrf52.S delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/gcc_startup_nrf52805.S delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/gcc_startup_nrf52810.S delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/gcc_startup_nrf52811.S delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/gcc_startup_nrf52833.S delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/gcc_startup_nrf52840.S delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/gcc_startup_nrf9160.S delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/iar_startup_nrf51.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/iar_startup_nrf52.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/iar_startup_nrf52805.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/iar_startup_nrf52810.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/iar_startup_nrf52811.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/iar_startup_nrf52833.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/iar_startup_nrf52840.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/iar_startup_nrf9160.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51.svd delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51422_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51801_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51802_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51822_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51824_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51_bitfields.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51_common.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51_deprecated.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51_to_nrf52.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51_to_nrf52810.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51_to_nrf52840.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51_xxaa.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51_xxab.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf51_xxac.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52.svd delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52805.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52805.svd delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52805_bitfields.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52805_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52805_xxaa.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52810.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52810.svd delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52810_bitfields.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52810_name_change.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52810_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52810_to_nrf52811.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52810_xxaa.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52811.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52811.svd delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52811_bitfields.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52811_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52811_xxaa.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52832_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52832_xxaa.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52832_xxab.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52833.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52833.svd delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52833_bitfields.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52833_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52833_xxaa.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52840.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52840.svd delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52840_bitfields.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52840_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52840_xxaa.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52_bitfields.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52_common.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52_name_change.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52_to_nrf52810.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52_to_nrf52833.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52_to_nrf52840.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf52_xxaa.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf9160.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf9160.svd delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf9160_bitfields.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf9160_name_change.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf9160_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf9160_xxaa.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf_common.ld delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/nrf_peripherals.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf51.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf52.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf52805.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf52810.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf52811.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf52833.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf52840.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf9160.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/ses_startup_nrf_common.s delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf51.c delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf51.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52.c delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52805.c delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52805.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52810.c delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52810.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52811.c delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52811.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52833.c delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52833.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52840.c delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf52840.h delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf9160.c delete mode 100644 third_party/NordicSemiconductor/nrfx/mdk/system_nrf9160.h delete mode 100644 third_party/NordicSemiconductor/nrfx/nrfx.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_atomic.c delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_atomic.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_atomic_internal.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_coredep.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_irqs.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_irqs_nrf51.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_irqs_nrf52810.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_irqs_nrf52811.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_irqs_nrf52832.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_irqs_nrf52833.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_irqs_nrf52840.h delete mode 100644 third_party/NordicSemiconductor/nrfx/soc/nrfx_irqs_nrf9160.h delete mode 100644 third_party/NordicSemiconductor/nrfx/templates/nRF51/nrfx_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/templates/nRF52810/nrfx_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/templates/nRF52811/nrfx_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/templates/nRF52832/nrfx_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/templates/nRF52833/nrfx_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/templates/nRF52840/nrfx_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/templates/nRF9160/nrfx_config.h delete mode 100644 third_party/NordicSemiconductor/nrfx/templates/nrfx_glue.h delete mode 100644 third_party/NordicSemiconductor/nrfx/templates/nrfx_log.h delete mode 100644 third_party/NordicSemiconductor/segger_rtt/SEGGER_RTT_Conf.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/doc/s140_nrf52_7.0.1_licence-agreement.txt delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/doc/s140_nrf52_7.0.1_migration-document.pdf delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/doc/s140_nrf52_7.0.1_release-notes.pdf delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/ble.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/ble_err.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/ble_gap.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/ble_gatt.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/ble_gattc.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/ble_gatts.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/ble_hci.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/ble_l2cap.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/ble_ranges.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/ble_types.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/nrf52/nrf_mbr.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error_sdm.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error_soc.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/nrf_nvic.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/nrf_sd_def.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/nrf_sdm.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/nrf_soc.h delete mode 100644 third_party/NordicSemiconductor/softdevice/s140/headers/nrf_svc.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 1cf4b09f2..456d98293 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -175,9 +175,6 @@ if(OT_PLATFORM STREQUAL "posix") add_subdirectory("${PROJECT_SOURCE_DIR}/src/posix/platform") elseif(OT_PLATFORM STREQUAL "external") # skip in this case -elseif(OT_PLATFORM MATCHES "^nrf*") - target_include_directories(ot-config INTERFACE ${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx/${OT_PLATFORM}) - add_subdirectory("${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx") else() target_include_directories(ot-config INTERFACE ${PROJECT_SOURCE_DIR}/examples/platforms/${OT_PLATFORM}) add_subdirectory("${PROJECT_SOURCE_DIR}/examples/platforms/${OT_PLATFORM}") diff --git a/configure.ac b/configure.ac index 8d206fb46..be48617e7 100644 --- a/configure.ac +++ b/configure.ac @@ -780,14 +780,14 @@ AC_MSG_CHECKING([whether to build examples]) AC_ARG_WITH(examples, [AS_HELP_STRING([--with-examples=TARGET], - [Build example applications for one of: simulation, cc2538, nrf52811, nrf52833, nrf52840 @<:@default=no@:>@. + [Build example applications for one of: simulation, cc2538 @<:@default=no@:>@. Note that building example applications also builds the associated OpenThread platform libraries and any third_party libraries needed to support the examples.])], [ case "${with_examples}" in no) ;; - simulation|cc2538|nrf52811|nrf52833|nrf52840) + simulation|cc2538) ;; *) AC_MSG_RESULT(ERROR) @@ -801,14 +801,9 @@ AM_CONDITIONAL([OPENTHREAD_ENABLE_EXAMPLES], [test ${with_examples} != "no"]) AM_CONDITIONAL([OPENTHREAD_EXAMPLES_SIMULATION],[test "${with_examples}" = "simulation"]) AM_CONDITIONAL([OPENTHREAD_EXAMPLES_CC2538], [test "${with_examples}" = "cc2538"]) -AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52811], [test "${with_examples}" = "nrf52811"]) -AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52833], [test "${with_examples}" = "nrf52833"]) -AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF52840], [test "${with_examples}" = "nrf52840"]) AM_COND_IF([OPENTHREAD_EXAMPLES_SIMULATION], CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_EXAMPLES_SIMULATION=1", CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_EXAMPLES_SIMULATION=0") -AM_CONDITIONAL([OPENTHREAD_EXAMPLES_NRF528XX], [test OPENTHREAD_EXAMPLES_NRF52811 || test OPENTHREAD_EXAMPLES_NRF52833 || test OPENTHREAD_EXAMPLES_NRF52840]) - case ${with_examples} in no) AC_MSG_RESULT([no]) @@ -826,11 +821,11 @@ AC_MSG_CHECKING([whether to build platform libraries]) AC_ARG_WITH(platform, [AS_HELP_STRING([--with-platform=TARGET], - [Build OpenThread platform libraries for one of: cc2538, nrf52811, nrf52833, nrf52840, posix, simulation @<:@default=simulation@:>@.])], + [Build OpenThread platform libraries for one of: cc2538, posix, simulation @<:@default=simulation@:>@.])], [ # Make sure the given target is valid. case "${with_platform}" in - no|cc2538|nrf52811|nrf52833|nrf52840|posix|simulation) + no|cc2538|posix|simulation) ;; *) AC_MSG_RESULT(ERROR) @@ -862,14 +857,9 @@ AM_CONDITIONAL([OPENTHREAD_ENABLE_PLATFORM], [test ${with_platform} != "no"]) OPENTHREAD_ENABLE_PLATFORM=${with_platform} AM_CONDITIONAL([OPENTHREAD_PLATFORM_CC2538], [test "${with_platform}" = "cc2538"]) -AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF52811], [test "${with_platform}" = "nrf52811"]) -AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF52833], [test "${with_platform}" = "nrf52833"]) -AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF52840], [test "${with_platform}" = "nrf52840"]) AM_CONDITIONAL([OPENTHREAD_PLATFORM_POSIX], [test "${with_platform}" = "posix"]) AM_CONDITIONAL([OPENTHREAD_PLATFORM_SIMULATION],[test "${with_platform}" = "simulation"]) -AM_CONDITIONAL([OPENTHREAD_PLATFORM_NRF528XX], [test OPENTHREAD_PLATFORM_NRF52811 || test OPENTHREAD_PLATFORM_NRF52833 || test OPENTHREAD_PLATFORM_NRF52840]) - AM_COND_IF([OPENTHREAD_PLATFORM_POSIX], CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_PLATFORM_POSIX=1", CPPFLAGS="${CPPFLAGS} -DOPENTHREAD_PLATFORM_POSIX=0") case ${with_platform} in @@ -1002,14 +992,12 @@ src/lib/url/Makefile third_party/Makefile third_party/jlink/Makefile third_party/mbedtls/Makefile -third_party/NordicSemiconductor/Makefile examples/Makefile examples/apps/Makefile examples/apps/cli/Makefile examples/apps/ncp/Makefile examples/platforms/Makefile examples/platforms/cc2538/Makefile -examples/platforms/nrf528xx/Makefile examples/platforms/simulation/Makefile examples/platforms/utils/Makefile tools/Makefile diff --git a/etc/cmake/functions.cmake b/etc/cmake/functions.cmake index 7c5e62a68..4cb0bef8c 100755 --- a/etc/cmake/functions.cmake +++ b/etc/cmake/functions.cmake @@ -30,16 +30,14 @@ function(ot_get_platforms arg_platforms) list(APPEND result "NO" "posix" "external") set(platforms_dir "${PROJECT_SOURCE_DIR}/examples/platforms") - file(GLOB platforms RELATIVE "${platforms_dir}" "${platforms_dir}/*" - RELATIVE "${platforms_dir}/nrf528xx" "${platforms_dir}/nrf528xx/nrf*") + file(GLOB platforms RELATIVE "${platforms_dir}" "${platforms_dir}/*") foreach(platform IN LISTS platforms) - if((IS_DIRECTORY "${platforms_dir}/${platform}") OR - (IS_DIRECTORY "${platforms_dir}/nrf528xx/${platform}")) + if(IS_DIRECTORY "${platforms_dir}/${platform}") list(APPEND result "${platform}") endif() endforeach() - list(REMOVE_ITEM result utils nrf528xx) + list(REMOVE_ITEM result utils) list(SORT result) set(${arg_platforms} "${result}" PARENT_SCOPE) endfunction() diff --git a/examples/Makefile-nrf52811 b/examples/Makefile-nrf52811 deleted file mode 100644 index 6e38b3062..000000000 --- a/examples/Makefile-nrf52811 +++ /dev/null @@ -1,309 +0,0 @@ -# -# Copyright (c) 2019, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -.NOTPARALLEL: - -AR = arm-none-eabi-ar -CCAS = $(CCPREFIX) arm-none-eabi-gcc -CPP = arm-none-eabi-cpp -CC = $(CCPREFIX) arm-none-eabi-gcc -CXX = $(CCPREFIX) arm-none-eabi-g++ -LD = arm-none-eabi-ld -STRIP = arm-none-eabi-strip -NM = arm-none-eabi-nm -RANLIB = arm-none-eabi-ranlib -OBJCOPY = arm-none-eabi-objcopy - -GCCVersion = $(shell expr `$(CC) -dumpversion | cut -f1 -d.`) - -configure_OPTIONS = \ - --enable-mtd \ - --enable-linker-map \ - --with-examples=nrf52811 \ - MBEDTLS_CPPFLAGS="$(NRF52811_MBEDTLS_CPPFLAGS)" \ - $(NULL) - -ifdef SRC_PATH -configure_OPTIONS += --srcdir="$(SRC_PATH)" -endif - -TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST)))).. -AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))).. - -NRF52811_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"' -NRF52811_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"nrf52811-mbedtls-config.h\"' -NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls -NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include -NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls -NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config -NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/nrfx/mdk -NRF52811_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/cmsis -NRF52811_MBEDTLS_CPPFLAGS += -DNRF52811_XXAA - -NRF52811_CONFIG_FILE_CPPFLAGS = -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-nrf52811-config.h\"' -NRF52811_CONFIG_FILE_CPPFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='\"openthread-core-nrf52811-config-check.h\"' -NRF52811_CONFIG_FILE_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52811 - -COMMONCFLAGS := \ - -fdata-sections \ - -ffunction-sections \ - -Os \ - -g \ - $(NRF52811_CONFIG_FILE_CPPFLAGS) \ - $(NULL) - -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk - -ifeq ($(DCDC),1) -COMMONCFLAGS += -DDCDC_ENABLE -endif - -# -# Select transport which CLI, NCP and RCP examples will use to communicate. -# To disable all transports use the DISABLE_TRANSPORTS switch. This will disable -# the build of all above examples. -# If NCP_SPI switch is set, only NCP and RCP examples will be built. -# Otherwise, the default serial transport is UART. -# -ifndef DISABLE_TRANSPORTS -configure_OPTIONS += --enable-radio-only -ifeq ($(NCP_SPI),1) -COMMONCFLAGS += -DSPIS_AS_SERIAL_TRANSPORT=1 -COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 -else -COMMONCFLAGS += -DUART_AS_SERIAL_TRANSPORT=1 -COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_HDLC_ENABLE=1 -configure_OPTIONS += --enable-cli -endif # NCP_SPI == 1 -endif # DISABLE_TRANSPORTS - -NRF52811_MBEDTLS_CPPFLAGS += -DDISABLE_CC310=1 - -ifeq ($(shell expr $(GCCVersion) \>= 7), 1) - COMMONCFLAGS += -Wno-expansion-to-defined -endif - -CPPFLAGS += \ - $(COMMONCFLAGS) \ - $(target_CPPFLAGS) \ - $(NULL) - -CFLAGS += \ - $(COMMONCFLAGS) \ - $(target_CFLAGS) \ - $(NULL) - -CXXFLAGS += \ - $(COMMONCFLAGS) \ - $(target_CXXFLAGS) \ - -fno-exceptions \ - -fno-rtti \ - $(NULL) - -LDFLAGS += \ - $(COMMONCFLAGS) \ - $(target_LDFLAGS) \ - -specs=nano.specs \ - -specs=nosys.specs \ - -Wl,--gc-sections \ - $(NULL) - -CCASFLAGS += \ - $(COMMONCCASFLAGS) \ - $(target_CCASFLAGS) \ - -x \ - assembler-with-cpp \ - $(NULL) - -ECHO := @echo -MAKE := make -MKDIR_P := mkdir -p -LN_S := ln -s -RM_F := rm -f - -INSTALL := /usr/bin/install -INSTALLFLAGS := -p - -BuildPath = build -TopBuildDir = $(BuildPath) -AbsTopBuildDir = $(PWD)/$(TopBuildDir) - -ResultPath = output -TopResultDir = $(ResultPath) -AbsTopResultDir = $(PWD)/$(TopResultDir) - -TargetTuple = nrf52811 - -ARCHS = cortex-m4 - -TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib - -ifndef BuildJobs -BuildJobs := $(shell getconf _NPROCESSORS_ONLN) -endif -JOBSFLAG := -j$(BuildJobs) - -# -# configure-arch -# -# Configure OpenThread for the specified architecture. -# -# arch - The architecture to configure. -# -define configure-arch -$(ECHO) " CONFIG $(TargetTuple)..." -(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \ -INSTALL="$(INSTALL) $(INSTALLFLAGS)" \ -CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" CCAS="$(CCAS)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CCASFLAGS="$(CCASFLAGS)" LDFLAGS="$(LDFLAGS)" \ ---host=arm-none-eabi \ ---prefix=/ \ ---exec-prefix=/$(TargetTuple) \ -$(configure_OPTIONS)) -endef # configure-arch - -# -# build-arch -# -# Build the OpenThread intermediate build products for the specified -# architecture. -# -# arch - The architecture to build. -# -define build-arch -$(ECHO) " BUILD $(TargetTuple)" -$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \ -all -endef # build-arch - -# -# stage-arch -# -# Stage (install) the OpenThread final build products for the specified -# architecture. -# -# arch - The architecture to stage. -# -define stage-arch -$(ECHO) " STAGE $(TargetTuple)" -$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \ -DESTDIR=$(AbsTopResultDir) \ -install -endef # stage-arch - -# -# ARCH_template -# -# Define macros, targets and rules to configure, build, and stage the -# OpenThread for a single architecture. -# -# arch - The architecture to instantiate the template for. -# -define ARCH_template -CONFIGURE_TARGETS += configure-$(1) -BUILD_TARGETS += do-build-$(1) -STAGE_TARGETS += stage-$(1) -BUILD_DIRS += $(BuildPath)/$(TargetTuple) -DIRECTORIES += $(BuildPath)/$(TargetTuple) - -configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS) -configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS) -configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS) -configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS) -configure-$(1): target_CCASFLAGS=$($(1)_target_CCASFLAGS) - -configure-$(1): $(BuildPath)/$(TargetTuple)/config.status - -$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple) - $$(call configure-arch,$(1)) - -do-build-$(1): configure-$(1) - -do-build-$(1): - +$$(call build-arch,$(1)) - -stage-$(1): do-build-$(1) - -stage-$(1): | $(TopResultDir) - $$(call stage-arch,$(1)) - -$(1): stage-$(1) -endef # ARCH_template - -.DEFAULT_GOAL := all - -all: stage - -# -# Cortex-m4 -# - -cortex-m4_target_ABI = cortex-m4 -cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb -mabi=aapcs -cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb -mabi=aapcs -cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb -mabi=aapcs -cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfloat-abi=soft -mthumb -mabi=aapcs - -# Instantiate an architecture-specific build template for each target -# architecture. - -$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch)))) - -# -# Common / Finalization -# - -configure: $(CONFIGURE_TARGETS) - -build: $(BUILD_TARGETS) - -stage: $(STAGE_TARGETS) - -DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS) - -CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS) - -all: stage - -$(DIRECTORIES): - $(ECHO) " MKDIR $@" - @$(MKDIR_P) "$@" - -clean: - $(ECHO) " CLEAN" - @$(RM_F) -r $(CLEAN_DIRS) - -help: - $(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following " - $(ECHO) "architectures: " - $(ECHO) "" - $(ECHO) " $(ARCHS)" - $(ECHO) "" - $(ECHO) "To build only a particular architecture, specify: " - $(ECHO) "" - $(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) " - $(ECHO) "" diff --git a/examples/Makefile-nrf52833 b/examples/Makefile-nrf52833 deleted file mode 100644 index 9a5bb5360..000000000 --- a/examples/Makefile-nrf52833 +++ /dev/null @@ -1,342 +0,0 @@ -# -# Copyright (c) 2019, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -.NOTPARALLEL: - -AR = arm-none-eabi-ar -CCAS = $(CCPREFIX) arm-none-eabi-gcc -CPP = arm-none-eabi-cpp -CC = $(CCPREFIX) arm-none-eabi-gcc -CXX = $(CCPREFIX) arm-none-eabi-g++ -LD = arm-none-eabi-ld -STRIP = arm-none-eabi-strip -NM = arm-none-eabi-nm -RANLIB = arm-none-eabi-ranlib -OBJCOPY = arm-none-eabi-objcopy - -GCCVersion = $(shell expr `$(CC) -dumpversion | cut -f1 -d.`) - -configure_OPTIONS = \ - --enable-ftd \ - --enable-mtd \ - --enable-linker-map \ - --with-examples=nrf52833 \ - MBEDTLS_CPPFLAGS="$(NRF52833_MBEDTLS_CPPFLAGS)" \ - $(NULL) - -ifdef SRC_PATH -configure_OPTIONS += --srcdir="$(SRC_PATH)" -endif - -TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST)))).. -AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))).. - -NRF52833_MBEDTLS_CPPFLAGS = -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"' -NRF52833_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"nrf52833-mbedtls-config.h\"' -NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls -NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include -NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include/mbedtls -NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config -NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/nrfx/mdk -NRF52833_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/cmsis -NRF52833_MBEDTLS_CPPFLAGS += -DNRF52833_XXAA - -NRF52833_CONFIG_FILE_CPPFLAGS = -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-nrf52833-config.h\"' -NRF52833_CONFIG_FILE_CPPFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='\"openthread-core-nrf52833-config-check.h\"' -NRF52833_CONFIG_FILE_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52833 - -COMMONCFLAGS := \ - -fdata-sections \ - -ffunction-sections \ - -Os \ - -g \ - $(NRF52833_CONFIG_FILE_CPPFLAGS) \ - $(NULL) - -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk - -ifeq ($(BOOTLOADER),1) -$(info Warning: BOOTLOADER=1 switch is deprecated. Defaulting to BOOTLOADER=USB.) -override BOOTLOADER = USB -endif - -ifeq ($(BOOTLOADER),USB) -configure_OPTIONS += --with-custom-linker-file=$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_usb.ld -COMMONCFLAGS += -DAPP_USBD_NRF_DFU_TRIGGER_ENABLED=1 -endif - -ifeq ($(BOOTLOADER),UART) -configure_OPTIONS += --with-custom-linker-file=$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_uart.ld -endif - -ifeq ($(BOOTLOADER),BLE) -configure_OPTIONS += --with-custom-linker-file=$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_ble.ld -endif - -# -# Select transport which CLI, NCP and RCP examples will use to communicate. -# To disable all transports use the DISABLE_TRANSPORTS switch. This will disable -# the build of all above examples. -# If NCP_SPI switch is set, only NCP and RCP examples will be built. -# Otherwise the user can select USB transport. If no transports were selected, -# the default serial transport is UART. -# -ifndef DISABLE_TRANSPORTS -configure_OPTIONS += --enable-ncp -configure_OPTIONS += --enable-radio-only -ifeq ($(NCP_SPI),1) -COMMONCFLAGS += -DSPIS_AS_SERIAL_TRANSPORT=1 -COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 -else -COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_HDLC_ENABLE=1 -configure_OPTIONS += --enable-cli -ifeq ($(USB),1) -COMMONCFLAGS += -DUSB_CDC_AS_SERIAL_TRANSPORT=1 -else -COMMONCFLAGS += -DUART_AS_SERIAL_TRANSPORT=1 -endif # USB == 1 -endif # NCP_SPI == 1 -endif # DISABLE_TRANSPORTS - -NRF52833_MBEDTLS_CPPFLAGS += -DDISABLE_CC310=1 - -ifeq ($(shell expr $(GCCVersion) \>= 7), 1) - COMMONCFLAGS += -Wno-expansion-to-defined -endif - -CPPFLAGS += \ - $(COMMONCFLAGS) \ - $(target_CPPFLAGS) \ - $(NULL) - -CFLAGS += \ - $(COMMONCFLAGS) \ - $(target_CFLAGS) \ - $(NULL) - -CXXFLAGS += \ - $(COMMONCFLAGS) \ - $(target_CXXFLAGS) \ - -fno-exceptions \ - -fno-rtti \ - $(NULL) - -LDFLAGS += \ - $(COMMONCFLAGS) \ - $(target_LDFLAGS) \ - -specs=nano.specs \ - -specs=nosys.specs \ - -Wl,--gc-sections \ - $(NULL) - -CCASFLAGS += \ - $(COMMONCCASFLAGS) \ - $(target_CCASFLAGS) \ - -x \ - assembler-with-cpp \ - $(NULL) - -ECHO := @echo -MAKE := make -MKDIR_P := mkdir -p -LN_S := ln -s -RM_F := rm -f - -INSTALL := /usr/bin/install -INSTALLFLAGS := -p - -BuildPath = build -TopBuildDir = $(BuildPath) -AbsTopBuildDir = $(PWD)/$(TopBuildDir) - -ResultPath = output -TopResultDir = $(ResultPath) -AbsTopResultDir = $(PWD)/$(TopResultDir) - -TargetTuple = nrf52833 - -ARCHS = cortex-m4 - -TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib - -ifndef BuildJobs -BuildJobs := $(shell getconf _NPROCESSORS_ONLN) -endif -JOBSFLAG := -j$(BuildJobs) - -# -# configure-arch -# -# Configure OpenThread for the specified architecture. -# -# arch - The architecture to configure. -# -define configure-arch -$(ECHO) " CONFIG $(TargetTuple)..." -(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \ -INSTALL="$(INSTALL) $(INSTALLFLAGS)" \ -CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" CCAS="$(CCAS)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CCASFLAGS="$(CCASFLAGS)" LDFLAGS="$(LDFLAGS)" \ ---host=arm-none-eabi \ ---prefix=/ \ ---exec-prefix=/$(TargetTuple) \ -$(configure_OPTIONS)) -endef # configure-arch - -# -# build-arch -# -# Build the OpenThread intermediate build products for the specified -# architecture. -# -# arch - The architecture to build. -# -define build-arch -$(ECHO) " BUILD $(TargetTuple)" -$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \ -all -endef # build-arch - -# -# stage-arch -# -# Stage (install) the OpenThread final build products for the specified -# architecture. -# -# arch - The architecture to stage. -# -define stage-arch -$(ECHO) " STAGE $(TargetTuple)" -$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \ -DESTDIR=$(AbsTopResultDir) \ -install -endef # stage-arch - -# -# ARCH_template -# -# Define macros, targets and rules to configure, build, and stage the -# OpenThread for a single architecture. -# -# arch - The architecture to instantiate the template for. -# -define ARCH_template -CONFIGURE_TARGETS += configure-$(1) -BUILD_TARGETS += do-build-$(1) -STAGE_TARGETS += stage-$(1) -BUILD_DIRS += $(BuildPath)/$(TargetTuple) -DIRECTORIES += $(BuildPath)/$(TargetTuple) - -configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS) -configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS) -configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS) -configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS) -configure-$(1): target_CCASFLAGS=$($(1)_target_CCASFLAGS) - -configure-$(1): $(BuildPath)/$(TargetTuple)/config.status - -$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple) - $$(call configure-arch,$(1)) - -do-build-$(1): configure-$(1) - -do-build-$(1): - +$$(call build-arch,$(1)) - -stage-$(1): do-build-$(1) - -stage-$(1): | $(TopResultDir) - $$(call stage-arch,$(1)) - -$(1): stage-$(1) -endef # ARCH_template - -.DEFAULT_GOAL := all - -all: stage - -# -# Cortex-m4 -# - -cortex-m4_target_ABI = cortex-m4 -cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs -cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs -cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs -cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs - -# Instantiate an architecture-specific build template for each target -# architecture. - -$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch)))) - -# -# Flashing / Debugging -# - -TARGET_APP ?= ot-cli-ftd -APP_FILE_NAME = $(TopResultDir)/$(TargetTuple)/bin/$(TARGET_APP) -APP_FILE_HEX = $(TopResultDir)/$(TargetTuple)/bin/$(TARGET_APP).hex - -nrfjprog: $(APP_FILE_NAME) - arm-none-eabi-objcopy -O ihex $(<) $(APP_FILE_HEX) - nrfjprog -f NRF52 --sectorerase --reset --program $(APP_FILE_HEX) - -# -# Common / Finalization -# - -configure: $(CONFIGURE_TARGETS) - -build: $(BUILD_TARGETS) - -stage: $(STAGE_TARGETS) - -DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS) - -CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS) - -all: stage - -$(DIRECTORIES): - $(ECHO) " MKDIR $@" - @$(MKDIR_P) "$@" - -clean: - $(ECHO) " CLEAN" - @$(RM_F) -r $(CLEAN_DIRS) - -help: - $(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following " - $(ECHO) "architectures: " - $(ECHO) "" - $(ECHO) " $(ARCHS)" - $(ECHO) "" - $(ECHO) "To build only a particular architecture, specify: " - $(ECHO) "" - $(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) " - $(ECHO) "" diff --git a/examples/Makefile-nrf52840 b/examples/Makefile-nrf52840 deleted file mode 100644 index 8ea88f382..000000000 --- a/examples/Makefile-nrf52840 +++ /dev/null @@ -1,376 +0,0 @@ -# -# Copyright (c) 2016, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -.NOTPARALLEL: - -AR = arm-none-eabi-ar -CCAS = $(CCPREFIX) arm-none-eabi-gcc -CPP = arm-none-eabi-cpp -CC = $(CCPREFIX) arm-none-eabi-gcc -CXX = $(CCPREFIX) arm-none-eabi-g++ -LD = arm-none-eabi-ld -STRIP = arm-none-eabi-strip -NM = arm-none-eabi-nm -RANLIB = arm-none-eabi-ranlib -OBJCOPY = arm-none-eabi-objcopy - -GCCVersion = $(shell expr `$(CC) -dumpversion | cut -f1 -d.`) - -# Disable built-in mbedTLS by default allowing for nrf_security implementation with hardware acceleration. -# When set to 0 built-in, software implementation would be used. -DISABLE_BUILTIN_MBEDTLS ?= 1 - -ifeq ($(DISABLE_CC310), 1) -$(error DISABLE_CC310=1 is deprecated, please use DISABLE_BUILTIN_MBEDTLS=0) -endif - -configure_OPTIONS = \ - --enable-ftd \ - --enable-mtd \ - --enable-linker-map \ - --with-examples=nrf52840 \ - $(NULL) - -ifdef SRC_PATH -configure_OPTIONS += --srcdir="$(SRC_PATH)" -endif - -TopSourceDir := $(dir $(shell readlink $(firstword $(MAKEFILE_LIST)))).. -AbsTopSourceDir := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))).. - -NRF52840_MBEDTLS_CPPFLAGS += -DMBEDTLS_USER_CONFIG_FILE='\"nrf52840-mbedtls-config.h\"' -NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config - -ifeq ($(DISABLE_BUILTIN_MBEDTLS), 1) -NRF52840_MBEDTLS_CPPFLAGS += -DMBEDTLS_CONFIG_FILE='\"nrf-config.h\"' -NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/nrf_security/include -NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/nrf_security/config -NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include -else -NRF52840_MBEDTLS_CPPFLAGS += -DMBEDTLS_CONFIG_FILE='\"mbedtls-config.h\"' -NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls -NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/mbedtls/repo/include -NRF52840_MBEDTLS_CPPFLAGS += -DNRF52840_XXAA -endif - -ifeq ($(MBEDTLS_THREADING), 1) -ifeq ($(DISABLE_BUILTIN_MBEDTLS), 1) -$(error Cannot use MBEDTLS_THREADING with CC310 support. CC310 library comes with built-in threading support. To disable CC310 please use DISABLE_BUILTIN_MBEDTLS=0) -else -NRF52840_MBEDTLS_CPPFLAGS += -DMBEDTLS_THREADING_C -NRF52840_MBEDTLS_CPPFLAGS += -DMBEDTLS_THREADING_ALT -NRF52840_MBEDTLS_CPPFLAGS += -I$(AbsTopSourceDir)/third_party/NordicSemiconductor/libraries/nrf_security/include/software-only-threading -endif -endif - -ifdef MBEDTLS_THREADING_MUTEX_DEF -ifneq ($(MBEDTLS_THREADING), 1) -$(error Cannot use MBEDTLS_THREADING_MUTEX_DEF without MBEDTLS_THREADING=1) -else -NRF52840_MBEDTLS_CPPFLAGS += -DMBEDTLS_THREADING_MUTEX_DEF='\"$(MBEDTLS_THREADING_MUTEX_DEF)\"' -endif -endif - -NRF52840_CONFIG_FILE_CPPFLAGS = -DOPENTHREAD_PROJECT_CORE_CONFIG_FILE='\"openthread-core-nrf52840-config.h\"' -NRF52840_CONFIG_FILE_CPPFLAGS += -DOPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE='\"openthread-core-nrf52840-config-check.h\"' -NRF52840_CONFIG_FILE_CPPFLAGS += -I$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52840 - -COMMONCFLAGS := \ - -fdata-sections \ - -ffunction-sections \ - -Os \ - -g \ - $(NRF52840_CONFIG_FILE_CPPFLAGS) \ - $(NULL) - -include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/common-switches.mk - -ifeq ($(DISABLE_BUILTIN_MBEDTLS),1) -COMMONCFLAGS += $(NRF52840_MBEDTLS_CPPFLAGS) -else -configure_OPTIONS += MBEDTLS_CPPFLAGS="$(NRF52840_MBEDTLS_CPPFLAGS)" -endif - -ifeq ($(BOOTLOADER),1) -$(info Warning: BOOTLOADER=1 switch is deprecated. Defaulting to BOOTLOADER=USB.) -override BOOTLOADER = USB -endif - -ifeq ($(BOOTLOADER),USB) -configure_OPTIONS += --with-custom-linker-file=$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_usb.ld -COMMONCFLAGS += -DAPP_USBD_NRF_DFU_TRIGGER_ENABLED=1 -endif - -ifeq ($(BOOTLOADER),UART) -configure_OPTIONS += --with-custom-linker-file=$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_uart.ld -endif - -ifeq ($(BOOTLOADER),BLE) -configure_OPTIONS += --with-custom-linker-file=$(AbsTopSourceDir)/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_ble.ld -endif - -# -# Select transport which CLI, NCP and RCP examples will use to communicate. -# To disable all transports use the DISABLE_TRANSPORTS switch. This will disable -# the build of all above examples. -# If NCP_SPI switch is set, only NCP and RCP examples will be built. -# Otherwise the user can select USB transport. If no transports were selected, -# the default serial transport is UART. -# -ifndef DISABLE_TRANSPORTS -configure_OPTIONS += --enable-ncp -configure_OPTIONS += --enable-radio-only -ifeq ($(NCP_SPI),1) -COMMONCFLAGS += -DSPIS_AS_SERIAL_TRANSPORT=1 -COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_SPI_ENABLE=1 -else -COMMONCFLAGS += -DOPENTHREAD_CONFIG_NCP_HDLC_ENABLE=1 -configure_OPTIONS += --enable-cli -ifeq ($(USB),1) -COMMONCFLAGS += -DUSB_CDC_AS_SERIAL_TRANSPORT=1 -else -COMMONCFLAGS += -DUART_AS_SERIAL_TRANSPORT=1 -endif # USB == 1 -endif # NCP_SPI == 1 -endif # DISABLE_TRANSPORTS - -ifeq ($(shell expr $(GCCVersion) \>= 7), 1) - COMMONCFLAGS += -Wno-expansion-to-defined -endif - -CPPFLAGS += \ - $(COMMONCFLAGS) \ - $(target_CPPFLAGS) \ - $(NULL) - -CFLAGS += \ - $(COMMONCFLAGS) \ - $(target_CFLAGS) \ - $(NULL) - -CXXFLAGS += \ - $(COMMONCFLAGS) \ - $(target_CXXFLAGS) \ - -fno-exceptions \ - -fno-rtti \ - $(NULL) - -LDFLAGS += \ - $(COMMONCFLAGS) \ - $(target_LDFLAGS) \ - -specs=nano.specs \ - -specs=nosys.specs \ - -Wl,--gc-sections \ - $(NULL) - -CCASFLAGS += \ - $(COMMONCCASFLAGS) \ - $(target_CCASFLAGS) \ - -x \ - assembler-with-cpp \ - $(NULL) - -ECHO := @echo -MAKE := make -MKDIR_P := mkdir -p -LN_S := ln -s -RM_F := rm -f - -INSTALL := /usr/bin/install -INSTALLFLAGS := -p - -BuildPath = build -TopBuildDir = $(BuildPath) -AbsTopBuildDir = $(PWD)/$(TopBuildDir) - -ResultPath = output -TopResultDir = $(ResultPath) -AbsTopResultDir = $(PWD)/$(TopResultDir) - -TargetTuple = nrf52840 - -ARCHS = cortex-m4 - -TopTargetLibDir = $(TopResultDir)/$(TargetTuple)/lib - -ifndef BuildJobs -BuildJobs := $(shell getconf _NPROCESSORS_ONLN) -endif -JOBSFLAG := -j$(BuildJobs) - -# -# configure-arch -# -# Configure OpenThread for the specified architecture. -# -# arch - The architecture to configure. -# -define configure-arch -$(ECHO) " CONFIG $(TargetTuple)..." -(cd $(BuildPath)/$(TargetTuple) && $(AbsTopSourceDir)/configure \ -INSTALL="$(INSTALL) $(INSTALLFLAGS)" \ -CPP="$(CPP)" CC="$(CC)" CXX="$(CXX)" CCAS="$(CCAS)" OBJC="$(OBJC)" OBJCXX="$(OBJCXX)" AR="$(AR)" RANLIB="$(RANLIB)" NM="$(NM)" STRIP="$(STRIP)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CCASFLAGS="$(CCASFLAGS)" LDFLAGS="$(LDFLAGS)" \ ---host=arm-none-eabi \ ---prefix=/ \ ---exec-prefix=/$(TargetTuple) \ -$(configure_OPTIONS)) -endef # configure-arch - -# -# build-arch -# -# Build the OpenThread intermediate build products for the specified -# architecture. -# -# arch - The architecture to build. -# -define build-arch -$(ECHO) " BUILD $(TargetTuple)" -$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \ -all -endef # build-arch - -# -# stage-arch -# -# Stage (install) the OpenThread final build products for the specified -# architecture. -# -# arch - The architecture to stage. -# -define stage-arch -$(ECHO) " STAGE $(TargetTuple)" -$(MAKE) $(JOBSFLAG) -C $(BuildPath)/$(TargetTuple) --no-print-directory \ -DESTDIR=$(AbsTopResultDir) \ -install -endef # stage-arch - -# -# ARCH_template -# -# Define macros, targets and rules to configure, build, and stage the -# OpenThread for a single architecture. -# -# arch - The architecture to instantiate the template for. -# -define ARCH_template -CONFIGURE_TARGETS += configure-$(1) -BUILD_TARGETS += do-build-$(1) -STAGE_TARGETS += stage-$(1) -BUILD_DIRS += $(BuildPath)/$(TargetTuple) -DIRECTORIES += $(BuildPath)/$(TargetTuple) - -configure-$(1): target_CPPFLAGS=$($(1)_target_CPPFLAGS) -configure-$(1): target_CFLAGS=$($(1)_target_CFLAGS) -configure-$(1): target_CXXFLAGS=$($(1)_target_CXXFLAGS) -configure-$(1): target_LDFLAGS=$($(1)_target_LDFLAGS) -configure-$(1): target_CCASFLAGS=$($(1)_target_CCASFLAGS) - -configure-$(1): $(BuildPath)/$(TargetTuple)/config.status - -$(BuildPath)/$(TargetTuple)/config.status: | $(BuildPath)/$(TargetTuple) - $$(call configure-arch,$(1)) - -do-build-$(1): configure-$(1) - -do-build-$(1): - +$$(call build-arch,$(1)) - -stage-$(1): do-build-$(1) - -stage-$(1): | $(TopResultDir) - $$(call stage-arch,$(1)) - -$(1): stage-$(1) -endef # ARCH_template - -.DEFAULT_GOAL := all - -all: stage - -# -# Cortex-m4 -# - -cortex-m4_target_ABI = cortex-m4 -cortex-m4_target_CPPFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs -cortex-m4_target_CFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs -cortex-m4_target_CXXFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs -cortex-m4_target_LDFLAGS = -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs - -# Instantiate an architecture-specific build template for each target -# architecture. - -$(foreach arch,$(ARCHS),$(eval $(call ARCH_template,$(arch)))) - -# -# Flashing / Debugging -# - -TARGET_APP ?= ot-cli-ftd -APP_FILE_NAME = $(TopResultDir)/$(TargetTuple)/bin/$(TARGET_APP) -APP_FILE_HEX = $(TopResultDir)/$(TargetTuple)/bin/$(TARGET_APP).hex - -nrfjprog: $(APP_FILE_NAME) - arm-none-eabi-objcopy -O ihex $(<) $(APP_FILE_HEX) - nrfjprog -f NRF52 --sectorerase --reset --program $(APP_FILE_HEX) - -# -# Common / Finalization -# - -configure: $(CONFIGURE_TARGETS) - -build: $(BUILD_TARGETS) - -stage: $(STAGE_TARGETS) - -DIRECTORIES = $(TopResultDir) $(TopResultDir)/$(TargetTuple)/lib $(BUILD_DIRS) - -CLEAN_DIRS = $(TopResultDir) $(BUILD_DIRS) - -all: stage - -$(DIRECTORIES): - $(ECHO) " MKDIR $@" - @$(MKDIR_P) "$@" - -clean: - $(ECHO) " CLEAN" - @$(RM_F) -r $(CLEAN_DIRS) - -help: - $(ECHO) "Simply type 'make -f $(firstword $(MAKEFILE_LIST))' to build OpenThread for the following " - $(ECHO) "architectures: " - $(ECHO) "" - $(ECHO) " $(ARCHS)" - $(ECHO) "" - $(ECHO) "To build only a particular architecture, specify: " - $(ECHO) "" - $(ECHO) " make -f $(firstword $(MAKEFILE_LIST)) " - $(ECHO) "" diff --git a/examples/platforms/Makefile.am b/examples/platforms/Makefile.am index 5814e58f7..e7bd3ed6c 100644 --- a/examples/platforms/Makefile.am +++ b/examples/platforms/Makefile.am @@ -35,6 +35,7 @@ EXTRA_DIST = \ gp712 \ k32w \ kw41z \ + nrf528xx \ qpg6095 \ qpg6100 \ qpg7015m \ @@ -45,7 +46,6 @@ EXTRA_DIST = \ DIST_SUBDIRS = \ cc2538 \ - nrf528xx \ simulation \ utils \ $(NULL) @@ -60,10 +60,6 @@ if OPENTHREAD_PLATFORM_CC2538 SUBDIRS += cc2538 endif -if OPENTHREAD_PLATFORM_NRF528XX -SUBDIRS += nrf528xx -endif - if OPENTHREAD_PLATFORM_SIMULATION SUBDIRS += simulation endif diff --git a/examples/platforms/Makefile.platform.am b/examples/platforms/Makefile.platform.am index a2ffb30d2..8ab6520e2 100644 --- a/examples/platforms/Makefile.platform.am +++ b/examples/platforms/Makefile.platform.am @@ -45,18 +45,6 @@ if OPENTHREAD_EXAMPLES_CC2538 include $(top_srcdir)/examples/platforms/cc2538/Makefile.platform.am endif -if OPENTHREAD_EXAMPLES_NRF52811 -include $(top_srcdir)/examples/platforms/nrf528xx/nrf52811/Makefile.platform.am -endif - -if OPENTHREAD_EXAMPLES_NRF52833 -include $(top_srcdir)/examples/platforms/nrf528xx/nrf52833/Makefile.platform.am -endif - -if OPENTHREAD_EXAMPLES_NRF52840 -include $(top_srcdir)/examples/platforms/nrf528xx/nrf52840/Makefile.platform.am -endif - if OPENTHREAD_EXAMPLES_SIMULATION include $(top_srcdir)/examples/platforms/simulation/Makefile.platform.am endif diff --git a/examples/platforms/nrf528xx/CMakeLists.txt b/examples/platforms/nrf528xx/CMakeLists.txt deleted file mode 100644 index 8b474e021..000000000 --- a/examples/platforms/nrf528xx/CMakeLists.txt +++ /dev/null @@ -1,103 +0,0 @@ -# -# Copyright (c) 2021, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -if(OT_NCP_SPI) - list(APPEND OT_PLATFORM_DEFINES "SPIS_AS_SERIAL_TRANSPORT=1") -else() - option(OT_USB "enable nrf USB as serial transport support") - if(OT_USB) - list(APPEND OT_PLATFORM_DEFINES "USB_CDC_AS_SERIAL_TRANSPORT=1") - else() - list(APPEND OT_PLATFORM_DEFINES "UART_AS_SERIAL_TRANSPORT=1") - endif() -endif() - -set(NRF_COMM_SOURCES - src/alarm.c - src/diag.c - src/entropy.c - src/fem.c - src/flash.c - src/logging.c - src/misc.c - src/radio.c - src/system.c - src/temp.c -) - -set(NRF_TRANSPORT_SOURCES - src/transport/spi-slave.c - src/transport/transport.c - src/transport/uart.c - src/transport/usb-cdc-uart.c -) - -set(NRF_SINGLEPHY_SOURCES - src/flash_nosd.c -) - -set(NRF_SOFTDEVICE_SOURCES - src/flash_sd.c - src/softdevice.c -) - -set(NRF_INCLUDES - ${CMAKE_CURRENT_SOURCE_DIR}/src - ${PROJECT_SOURCE_DIR}/examples/platforms - ${PROJECT_SOURCE_DIR}/src/core -) - -if(OT_PLATFORM STREQUAL "nrf52811") - set(NRF_TRANSPORT_SOURCES - src/transport/spi-slave.c - src/transport/transport.c - src/transport/uart.c - ) - set(NRF52811_3RD_LIBS - nordicsemi-nrf52811-radio-driver - nordicsemi-nrf52811-sdk - jlinkrtt - ) - include(nrf52811/nrf52811.cmake) -elseif(OT_PLATFORM STREQUAL "nrf52833") - set(NRF52833_3RD_LIBS - nordicsemi-nrf52833-radio-driver - nordicsemi-nrf52833-radio-driver-softdevice - nordicsemi-nrf52833-sdk - jlinkrtt - ) - include(nrf52833/nrf52833.cmake) -elseif(OT_PLATFORM STREQUAL "nrf52840") - set(NRF52840_3RD_LIBS - nordicsemi-nrf52840-radio-driver - nordicsemi-nrf52840-radio-driver-softdevice - nordicsemi-nrf52840-sdk - jlinkrtt - ) - include(nrf52840/nrf52840.cmake) -endif() diff --git a/examples/platforms/nrf528xx/DIAG.md b/examples/platforms/nrf528xx/DIAG.md deleted file mode 100644 index 1801d2424..000000000 --- a/examples/platforms/nrf528xx/DIAG.md +++ /dev/null @@ -1,174 +0,0 @@ -## Diagnostic module - -nRF52811 and nRF52840 ports extend [OpenThread Diagnostics Module][diag]. - -New commands allow for more accurate low level radio testing. - -### New commands - -- [diag ccathreshold](#diag-ccathreshold) -- [diag gpio](#diag-gpio) -- [diag id](#diag-id) -- [diag listen](#diag-listen) -- [diag temp](#diag-temp) -- [diag transmit](#diag-transmit) - -### Diagnostic radio packet - -[diag listen](#diag-listen) and [diag transmit](#diag-transmit) use radio frame payload specified below. - -```c -struct PlatformDiagMessage -{ - const char mMessageDescriptor[11]; - uint8_t mChannel; - int16_t mID; - uint32_t mCnt; -}; -``` - -`mMessageDescriptor` is a constant string `"DiagMessage"`.
`mChannel` contains the channel number on which the packet was transmitted.
`mID` contains the board ID set with the [diag id](#diag-id) command.
`mCnt` is a counter incremented every time the board transmits diagnostic radio packet. - -If the [listen mode](#diag-listen) is enabled and OpenThread was built with the`DEFAULT_LOGGING` flag, JSON string is printed every time a diagnostic radio packet is received. - -```JSON - {"Frame":{ - "LocalChannel":"", - "RemoteChannel":"", - "CNT":"", - "LocalID":"", - "RemoteID":"", - "RSSI":"" - }} -``` - -### diag ccathreshold - -Get the current CCA threshold. - -### diag ccathreshold \ - -Set the CCA threshold. - -Value range: 0 to 255. - -Default: `45`. - -### diag gpio - -Manage GPIO pins. - -### diag gpio \ - -Return the current value of the gpio. - -Note: \ is an integer that combines port and pin into a single, contiguous number space as follows: - -``` - pinnum = (port * 32) + pin -``` - -See also the [`NRF_GPIO_PIN_MAP`](../../../third_party/NordicSemiconductor/hal/nrf_gpio.h) macro. - -```bash -> diag gpio 47 -gpio 47 = 0 -``` - -### diag gpio out \ - -Set the given GPIO to the output mode. - -```bash -> diag gpio out 47 -gpio 47: out -``` - -### diag gpio in \ - -Sets the given GPIO to the input mode with no pull variant. - -```bash -> diag gpio in 47 -gpio 47: in no pull -``` - -### diag gpio set \ - -Sets the given output gpio to high. - -```bash -> diag gpio set 47 -gpio 47 = 1 -``` - -### diag gpio clr \ - -Sets the given output gpio to low. - -```bash -> diag gpio clr 47 -gpio 47 = 0 -``` - -### diag id - -Get board ID. - -### diag id \ - -Set board ID. - -Value range: 0 to 32767. - -Default: `-1`. - -### diag listen - -Get the listen state. - -### diag listen \ - -Set the listen state. - -`0` disables the listen state.
`1` enables the listen state. - -By default, the listen state is disabled. - -### diag temp - -Get the temperature from the internal temperature sensor (in degrees Celsius). - -### diag transmit - -Get the message count and the interval between the messages that will be transmitted after `diag transmit start`. - -### diag transmit interval \ - -Set the interval in ms between the transmitted messages. - -Value range: 1 to 4294967295. - -Default: `1`. - -### diag transmit count \ - -Set the number of messages to be transmitted. - -Value range: 1 to 2147483647
or
For continuous transmission: `-1` - -Default: `1` - -### diag transmit stop - -Stop the ongoing transmission regardless of the remaining number of messages to be sent. - -### diag transmit start - -Start transmiting messages with specified interval. - -### diag transmit carrier - -Start transmitting continuous carrier wave. - -[diag]: ./../../../src/core/diags/README.md diff --git a/examples/platforms/nrf528xx/Makefile.am b/examples/platforms/nrf528xx/Makefile.am deleted file mode 100644 index ac2923a5d..000000000 --- a/examples/platforms/nrf528xx/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# -# Copyright (c) 2019, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -# Use automake includes since we cannot use SUBDIRS feature due to cleanup -# errors - few targets may use the same source file but dependency file is -# created only once which leads to errors when auto-generated Makefile tries -# to remove .Po files that were already removed - -if OPENTHREAD_PLATFORM_NRF52811 -include nrf52811/Makefile.am -endif - -if OPENTHREAD_PLATFORM_NRF52833 -include nrf52833/Makefile.am -endif - -if OPENTHREAD_PLATFORM_NRF52840 -include nrf52840/Makefile.am -endif diff --git a/examples/platforms/nrf528xx/README.md b/examples/platforms/nrf528xx/README.md deleted file mode 100644 index f94a1809d..000000000 --- a/examples/platforms/nrf528xx/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# OpenThread on nRF528xx Example - -This directory contains example platform drivers for [Nordic Semiconductor nRF52840 SoC][nrf52840], [Nordic Semiconductor nRF52833 SoC][nrf52833] and [Nordic Semiconductor nRF52811 SoC][nrf52811]. - -[nrf52840]: https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52840 -[nrf52833]: https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52833 -[nrf52811]: https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52811 - -To learn more about building and running the examples please check: - -- [OpenThread on nRF52840 examples][nrf52840-page] -- [OpenThread on nRF52833 examples][nrf52833-page] -- [OpenThread on nRF52811 examples][nrf52811-page] - -[nrf52840-page]: ./nrf52840/README.md -[nrf52833-page]: ./nrf52833/README.md -[nrf52811-page]: ./nrf52811/README.md diff --git a/examples/platforms/nrf528xx/nrf52811/Makefile.am b/examples/platforms/nrf528xx/nrf52811/Makefile.am deleted file mode 100644 index 43803bab3..000000000 --- a/examples/platforms/nrf528xx/nrf52811/Makefile.am +++ /dev/null @@ -1,175 +0,0 @@ -# -# Copyright (c) 2019, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -include $(abs_top_nlbuild_autotools_dir)/automake/pre.am - -lib_LIBRARIES = \ - libopenthread-nrf52811.a \ - libopenthread-nrf52811-sdk.a \ - libopenthread-nrf52811-transport.a \ - $(NULL) - -# Do not enable -pedantic-errors for nRF52811 driver library -override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS)) -override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS)) - -# Do not enable -Wundef for nRF52811 driver library -override CFLAGS := $(filter-out -Wundef,$(CFLAGS)) -override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS)) - -# Do not enable -Wcast-align for nRF52811 driver library -override CFLAGS := $(filter-out -Wcast-align,$(CFLAGS)) -override CXXFLAGS := $(filter-out -Wcast-align,$(CXXFLAGS)) - -COMMONCPPFLAGS = \ - -DCONFIG_GPIO_AS_PINRESET \ - -DNRF52811_XXAA \ - -DUSE_APP_CONFIG=1 \ - -I$(srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/examples/platforms \ - -I$(top_srcdir)/examples/platforms/nrf528xx/src \ - -I$(top_srcdir)/examples/platforms/nrf528xx/src/transport \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/temperature \ - $(NULL) - -# Only reference the SDK header files included in third_party/NordicSemiconductor -# when building the example applications. -# -# When building just the platform libraries, the caller of configure is expected -# to provide the correct -I arguments to locate the necessary header files in an -# external copy of the Nordic nRF5 SDK. -# -# Note that an exception is made for the 802.15.4 radio driver, which is always -# built using the sources in third_party/NordicSemiconductor/drivers/radio. -if OPENTHREAD_ENABLE_EXAMPLES -COMMONCPPFLAGS += \ - -I$(top_srcdir)/third_party/NordicSemiconductor \ - -I$(top_srcdir)/third_party/NordicSemiconductor/cmsis \ - -I$(top_srcdir)/third_party/NordicSemiconductor/config \ - -I$(top_srcdir)/third_party/NordicSemiconductor/config/nrf52811/config \ - -I$(top_srcdir)/third_party/NordicSemiconductor/dependencies \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/clock \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/common \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/power \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/systick \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/app_error \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/atfifo \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/atomic \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/block_dev \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/delay \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/utf_converter \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/soc \ - $(NULL) -endif - -PLATFORM_COMMON_SOURCES = \ - src/alarm.c \ - src/diag.c \ - src/entropy.c \ - src/fem.c \ - src/flash.c \ - src/logging.c \ - src/misc.c \ - src/radio.c \ - src/system.c \ - src/temp.c \ - $(NULL) - -TRANSPORT_SOURCES = \ - src/transport/spi-slave.c \ - src/transport/uart.c \ - src/transport/transport.c \ - $(NULL) - -SINGLEPHY_SOURCES = \ - src/flash_nosd.c \ - $(NULL) - -SINGLEPHY_CPPFLAGS = \ - -DRAAL_SINGLE_PHY=1 \ - $(NULL) - -PLATFORM_SOURCES = \ - $(PLATFORM_COMMON_SOURCES) \ - $(NULL) - -libopenthread_nrf52811_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(SINGLEPHY_CPPFLAGS) \ - $(NULL) - -libopenthread_nrf52811_a_SOURCES = \ - $(PLATFORM_SOURCES) \ - $(SINGLEPHY_SOURCES) \ - $(NULL) - -libopenthread_nrf52811_sdk_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(SINGLEPHY_CPPFLAGS) \ - $(NULL) - -libopenthread_nrf52811_sdk_a_SOURCES = \ - $(PLATFORM_SOURCES) \ - $(SINGLEPHY_SOURCES) \ - $(NULL) - -libopenthread_nrf52811_transport_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NULL) - -libopenthread_nrf52811_transport_a_SOURCES = \ - $(TRANSPORT_SOURCES) \ - $(NULL) - -Dash = - - -libopenthread_nrf52811_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") \ - $(shell find $(top_builddir)/third_party/jlink/SEGGER_RTT_V640/RTT $(Dash)type f $(Dash)name "*.o") - -libopenthread_nrf52811_sdk_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") - -libopenthread_nrf52811_transport_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") - -include $(abs_top_nlbuild_autotools_dir)/automake/post.am diff --git a/examples/platforms/nrf528xx/nrf52811/Makefile.platform.am b/examples/platforms/nrf528xx/nrf52811/Makefile.platform.am deleted file mode 100644 index d0042b053..000000000 --- a/examples/platforms/nrf528xx/nrf52811/Makefile.platform.am +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright (c) 2019, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -# -# nrf52811 platform-specific Makefile -# - -LDADD_COMMON += \ - $(top_builddir)/examples/platforms/nrf528xx/libopenthread-nrf52811.a \ - $(top_builddir)/examples/platforms/nrf528xx/libopenthread-nrf52811-transport.a \ - $(top_builddir)/third_party/NordicSemiconductor/libnordicsemi-nrf52811-sdk.a \ - $(top_builddir)/third_party/NordicSemiconductor/libnordicsemi-nrf52811-radio-driver.a \ - $(NULL) - -if OPENTHREAD_ENABLE_CUSTOM_LINKER_FILE -LDFLAGS_COMMON += \ - -T $(OPENTHREAD_CUSTOM_LINKER_FILE) \ - $(NULL) -else -LDFLAGS_COMMON += \ - -T $(top_srcdir)/examples/platforms/nrf528xx/nrf52811/nrf52811.ld \ - $(NULL) -endif diff --git a/examples/platforms/nrf528xx/nrf52811/README.md b/examples/platforms/nrf528xx/nrf52811/README.md index 1607ceb18..0f151e6f2 100644 --- a/examples/platforms/nrf528xx/nrf52811/README.md +++ b/examples/platforms/nrf528xx/nrf52811/README.md @@ -1,366 +1 @@ -# OpenThread on nRF52811 Example - -This directory contains example platform drivers for [Nordic Semiconductor nRF52811 SoC][nrf52811]. - -[nrf52811]: https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52811 - -This SoC is meant to be used in the configuration that involves the Host Processor and the IEEE 802.15.4 radio. In this configuration, the full OpenThread stack is running on the Host Processor and the nRF52811 SoC acts as an IEEE 802.15.4 radio. The radio is running a minimal OpenThread implementation that allows for communication between the Host Processor and the nRF52811. In this architecture the nRF52811 SoC device is called RCP (Radio Co-Processor). - -The nRF52811 platform is currently under development. - -For the SoC capable to a run full OpenThread stack, see the [nRF52840 platform][nrf52840-page]. - -[nrf52840-page]: ./../nrf52840/README.md - -## Emulation on nRF52840 - -You can use examples for nRF52811 on nRF52840 without any changes in the generated binary files. This allows for easier testing in early stages of development. - -## Prerequisites - -Before you start building the examples, you must download and install the toolchain and the tools required for flashing and debugging. - -### Toolchain - -Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain]. - -[gnu-toolchain]: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm - -To install the GNU toolchain and its dependencies, run the following commands in Bash: - -```bash -$ cd -$ ./script/bootstrap -``` - -### Flashing and debugging tools - -[nrf-command-line-tools]: https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Command-Line-Tools - -Install the [nRF Command Line Tools][nrf-command-line-tools] to flash, debug, and make use of logging features on the nRF52811 DK with SEGGER J-Link. - -## Building the examples - -With this platform, you can build: - -- Limited version of CLI example (e.g. without Thread commissioning functionality) -- RCP example that consists of two parts: - - firmware that is flashed to the nRF52811 SoC - - host executables to be executed on a POSIX platform in case of the RCP usage - -### Building host executables - -```bash -$ cd -$ ./bootstrap -$ make -f src/posix/Makefile-posix -``` - -After a successful build, executables can be found in `/openthread/output/posix//bin`. It is recommended to copy them to `/usr/bin` for easier access. - -### Building the firmware with UART support - -To build the firmware using default UART RCP transport, run the following make commands: - -```bash -$ cd -$ ./bootstrap -$ make -f examples/Makefile-nrf52811 -``` - -After a successful build, the `elf` files can be found in `/output/nrf52811/bin`. You can convert them to hex using `arm-none-eabi-objcopy`: - -```bash -$ arm-none-eabi-objcopy -O ihex ot-cli-mtd ot-cli-mtd.hex -$ arm-none-eabi-objcopy -O ihex ot-rcp ot-rcp.hex -``` - -### Building the firmware with native SPI support - -You can build the libraries with support for the native SPI Slave. To do so, build the libraries with the following parameter: - -``` -$ make -f examples/Makefile-nrf52811 NCP_SPI=1 -``` - -With this option enabled, the RCP example can communicate through SPI with wpantund (provided that the wpantund host supports SPI Master). To achieve this communication, choose the right SPI device in the wpantund configuration file, `/etc/wpantund.conf`. See the following example. - -``` -Config:NCP:SocketPath "system:/usr/bin/ot-ncp /usr/bin/spi-hdlc-adapter -- '--stdio -i /sys/class/gpio/gpio25 /dev/spidev0.1'" -``` - -In this example, [spi-hdlc-adapter][spi-hdlc-adapter] is a tool that you can use to communicate between RCP and wpantund over SPI. For this example, `spi-hdlc-adapter` is installed in `/usr/bin`. - -The default SPI Slave pin configuration for nRF52811 is defined in `examples/platforms/nrf52811/transport-config.h`. - -[spi-hdlc-adapter]: https://github.com/openthread/openthread/tree/master/tools/spi-hdlc-adapter - -### IEEE EUI-64 address - -When the Thread device is configured to obtain the Thread Network security credentials with either Thread Commissioning or an out-of-band method, the extended MAC address should be constructed out of the globally unique IEEE EUI-64. - -The IEEE EUI-64 address consists of two parts: - -- 24 bits of MA-L (MAC Address Block Large), formerly called OUI (Organizationally Unique Identifier) -- 40-bit device unique identifier - -By default, the device uses Nordic Semiconductor's MA-L (f4-ce-36). You can modify it by overwriting the `OPENTHREAD_CONFIG_STACK_VENDOR_OUI` define, located in the `openthread-core-nrf52811-config.h` file. This value must be publicly registered by the IEEE Registration Authority. - -You can also provide the full IEEE EUI-64 address by providing a custom `otPlatRadioGetIeeeEui64` function. To do this, define the flag `OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE`. - -After the Thread Network security credentials have been successfully obtained, the device uses randomly generated extended MAC address. - -## Flashing binaries - -Once the examples and libraries are built, flash the compiled binaries onto nRF52811 using `nrfjprog` that is part of the [nRF Command Line Tools][nrf-command-line-tools]. - -Run the following command: - -```bash -$ nrfjprog -f nrf52 --chiperase --program output/nrf52811/bin/ot-cli-mtd.hex --reset -``` - -## Running the example - -To test the example: - -1. Prepare two boards. - -2. Flash one with the `CLI MTD Example` (ot-cli-mtd.hex, as shown above). - -3. Flash `RCP Example` (ot-rcp.hex) to the other board. - -4. Connect the RCP to the PC. - -5. Start the ot-cli host application and connect with the RCP. It is assumed that the default UART version of RCP is being used (make executed without the NCP-SPI=1 flag). On Linux system, call a port name, for example `/dev/ttyACM0` for the first connected development kit, and `/dev/ttyACM1` for the second one. - - ```bash - $ /usr/bin/ot-cli /dev/ttyACM0 115200 - ``` - - You are now connected with the CLI on the first board - -6. Use the following commands to form a network: - - ```bash - > dataset init new - Done - > dataset - Active Timestamp: 1 - Channel: 13 - Channel Mask: 0x07fff800 - Ext PAN ID: d63e8e3e495ebbc3 - Mesh Local Prefix: fd3d:b50b:f96d:722d::/64 - Master Key: dfd34f0f05cad978ec4e32b0413038ff - Network Name: OpenThread-8f28 - PAN ID: 0x8f28 - PSKc: c23a76e98f1a6483639b1ac1271e2e27 - Security Policy: 0, onrcb - Done - > dataset commit active - Done - > ifconfig up - Done - > thread start - Done - ``` - - After a couple of seconds the node will become a Leader of the network. - - ```bash - > state - leader - ``` - -7. Open a terminal connection on the second board and attach a node to the network: - - a. Start a terminal emulator like screen. - - b. Connect to the used COM port with the following direct UART settings: - - - Baud rate: 115200 - - 8 data bits - - 1 stop bit - - No parity - - HW flow control: RTS/CTS This allows you to view the raw UART output. - - c. Run the following command to connect to the second board. - - ```shell - screen /dev/ttyACM1 115200 - ``` - - You are now connected with the CLI on the second board - -8. Use the following commands to attach to the network on the second board: - - ```bash - > dataset masterkey dfd34f0f05cad978ec4e32b0413038ff - Done - > dataset commit active - Done - > ifconfig up - Done - > thread start - Done - ``` - - After a couple of seconds the second node will attach and become a Child. - - ```bash - > state - child - ``` - -9. List all IPv6 addresses of the first board. - - ```bash - > ipaddr - fd3d:b50b:f96d:722d:0:ff:fe00:fc00 - fd3d:b50b:f96d:722d:0:ff:fe00:c00 - fd3d:b50b:f96d:722d:7a73:bff6:9093:9117 - fe80:0:0:0:6c41:9001:f3d6:4148 - Done - ``` - -10. Choose one of them and send an ICMPv6 ping from the second board. - - ```bash - > ping fd3d:b50b:f96d:722d:7a73:bff6:9093:9117 - 16 bytes from fd3d:b50b:f96d:722d:558:f56b:d688:799: icmp_seq=1 hlim=64 time=24ms - ``` - -For a list of all available commands, visit [OpenThread CLI Reference README.md][cli]. - -[cli]: ./../../../src/cli/README.md - -## SEGGER J-Link tools - -SEGGER J-Link tools allow to debug and flash generated firmware using on-board debugger or external one. - -### Working with RTT logging - -By default, the OpenThread's logging module provides functions to output logging information over SEGGER's Real Time Transfer (RTT). - -You can set the desired log level by using the `OPENTHREAD_CONFIG_LOG_LEVEL` define. - -To enable the highest verbosity level, append `FULL_LOGS` flag to the `make` command: - -``` -$ make -f examples/Makefile-nrf52811 FULL_LOGS=1 -``` - -#### Enable logging on Windows - -1. Connect the DK to your machine with a USB cable. -2. Run `J-Link RTT Viewer`. The configuration window appears. -3. From the Specify Target Device dropdown menu, select `NRF52810_XXAA`. -4. From the Target Interface & Speed dropdown menu, select `SWD`. - -#### Enable logging on Linux - -1. Connect the DK to your machine with a USB cable. -2. Run `JLinkExe` to connect to the target. For example: - -``` -JLinkExe -device NRF52810_XXAA -if SWD -speed 4000 -autoconnect 1 -SelectEmuBySN -RTTTelnetPort 19021 -``` - -3. Run `JLinkRTTTelnet` to obtain the RTT logs from the connected device in a separate console. For example: - -``` -JLinkRTTClient -RTTTelnetPort 19021 -``` - -### Mass Storage Device known issue - -Depending on your version, due to a known issue in SEGGER's J-Link firmware, you might experience data corruption or data drops if you use the serial port. You can avoid this issue by disabling the Mass Storage Device. - -#### Disabling the Mass Storage Device on Windows - -1. Connect the DK to your machine with a USB cable. -2. Run `J-Link Commander`. The configuration window appears. -3. From the Specify Target Device dropdown menu, select `NRF52810_XXAA`. -4. From the Target Interface & Speed dropdown menu, select `SWD`. -5. Run the following command: - -``` -MSDDisable -``` - -6. Power cycle the DK. - -#### Disabling the Mass Storage Device on Linux - -1. Connect the DK to your machine with a USB cable. -2. Run `JLinkExe` to connect to the target. For example: - -``` -JLinkExe -device NRF52810_XXAA -if SWD -speed 4000 -autoconnect 1 -SelectEmuBySN -``` - -3. Run the following command: - -``` -MSDDisable -``` - -4. Power cycle the DK. - -### Hardware Flow Control detection - -By default, SEGGER J-Link automatically detects at runtime whether the target is using Hardware Flow Control (HWFC). - -The automatic HWFC detection is done by driving P0.07 (Clear to Send - CTS) from the interface MCU and evaluating the state of P0.05 (Request to Send - RTS) when the first data is sent or received. If the state of P0.05 (RTS) is high, it is assumed that HWFC is not used. - -To avoid potential race conditions, you can force HWFC and bypass the runtime auto-detection. - -#### Disabling the HWFC detection on Windows - -1. Connect the DK to your machine with a USB cable. -2. Run `J-Link Commander`. The configuration window appears. -3. From the Specify Target Device dropdown menu, select `NRF52810_XXAA`. -4. From the Target Interface & Speed dropdown menu, select `SWD`. -5. Run the following command: - -``` -SetHWFC Force -``` - -6. Power cycle the DK. - -#### Disabling the HWFC detection on Linux - -1. Connect the DK to your machine with a USB cable. -2. Run `JLinkExe` to connect to the target. For example: - -``` -JLinkExe -device NRF52810_XXAA -if SWD -speed 4000 -autoconnect 1 -SelectEmuBySN -``` - -3. Run the following command: - -``` -SetHWFC Force -``` - -4. Power cycle the DK. - -You can find more details [here][j-link-ob]. - -[j-link-ob]: https://wiki.segger.com/J-Link_OB_SAM3U_NordicSemi#Hardware_flow_control_support - -## Diagnostic module - -nRF52811 supports [OpenThread Diagnostics Module][diag], with some additional features. - -For more information, see [nRF Diag command reference][nrfdiag]. - -[diag]: ./../../../src/core/diags/README.md -[nrfdiag]: ./../DIAG.md - -## Radio driver documentation - -The radio driver documentation includes \*.uml state machines sequence diagrams that can be opened with [PlantUML][plantuml-url]. - -[plantuml-url]: http://plantuml.com/ +The OpenThread on nRF528xx example has moved to https://github.com/openthread/ot-nrf528xx diff --git a/examples/platforms/nrf528xx/nrf52811/arm-none-eabi.cmake b/examples/platforms/nrf528xx/nrf52811/arm-none-eabi.cmake deleted file mode 100644 index a2e520ae7..000000000 --- a/examples/platforms/nrf528xx/nrf52811/arm-none-eabi.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright (c) 2021, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -set(CMAKE_SYSTEM_NAME Generic) -set(CMAKE_SYSTEM_PROCESSOR ARM) - -set(CMAKE_C_COMPILER arm-none-eabi-gcc) -set(CMAKE_CXX_COMPILER arm-none-eabi-g++) -set(CMAKE_ASM_COMPILER arm-none-eabi-as) -set(CMAKE_RANLIB arm-none-eabi-ranlib) - -execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - -set(COMMON_C_FLAGS "-mcpu=cortex-m4 -mfloat-abi=soft -mthumb -mabi=aapcs -fdata-sections -ffunction-sections") - -if(COMPILER_VERSION VERSION_GREATER_EQUAL 7) - set(COMMON_C_FLAGS "${COMMON_C_FLAGS} -Wno-expansion-to-defined") -endif() - -set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=gnu99") -set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti") -set(CMAKE_ASM_FLAGS_INIT "${COMMON_C_FLAGS} -x assembler-with-cpp") -set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs") - -set(CMAKE_C_FLAGS_DEBUG "-Og -g") -set(CMAKE_CXX_FLAGS_DEBUG "-Og -g") -set(CMAKE_ASM_FLAGS_DEBUG "-g") - -set(CMAKE_C_FLAGS_RELEASE "-Os") -set(CMAKE_CXX_FLAGS_RELEASE "-Os") -set(CMAKE_ASM_FLAGS_RELEASE "") diff --git a/examples/platforms/nrf528xx/nrf52811/nrf52811.cmake b/examples/platforms/nrf528xx/nrf52811/nrf52811.cmake deleted file mode 100644 index 9b8d654c3..000000000 --- a/examples/platforms/nrf528xx/nrf52811/nrf52811.cmake +++ /dev/null @@ -1,173 +0,0 @@ -# -# Copyright (c) 2021, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -set(OT_PLATFORM_LIB "openthread-nrf52811" "openthread-nrf52811-transport" PARENT_SCOPE) - -if(NOT OT_CONFIG) - set(OT_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/nrf52811/openthread-core-nrf52811-config.h") - set(OT_CONFIG ${OT_CONFIG} PARENT_SCOPE) -endif() - -set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/nrf52811/nrf52811.ld") - -set(COMM_FLAGS - -DDISABLE_CC310=1 - -DCONFIG_GPIO_AS_PINRESET - -DNRF52811_XXAA - -DUSE_APP_CONFIG=1 - -Wno-unused-parameter - -Wno-expansion-to-defined -) - -list(APPEND OT_PLATFORM_DEFINES - "OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=\"openthread-core-nrf52811-config-check.h\"" -) - -list(APPEND OT_PUBLIC_INCLUDES - "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config" - "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/nrfx/mdk" - "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/cmsis" -) - -set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE) -target_compile_definitions(ot-config INTERFACE - "MBEDTLS_USER_CONFIG_FILE=\"nrf52811-mbedtls-config.h\"" -) -set(OT_PUBLIC_INCLUDES ${OT_PUBLIC_INCLUDES} PARENT_SCOPE) - -if(OT_CFLAGS MATCHES "-pedantic-errors") - string(REPLACE "-pedantic-errors" "" OT_CFLAGS "${OT_CFLAGS}") -endif() - -list(APPEND OT_PLATFORM_DEFINES "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${OT_CONFIG}\"") - -add_library(openthread-nrf52811 - ${NRF_COMM_SOURCES} - ${NRF_SINGLEPHY_SOURCES} - $ -) - -add_library(openthread-nrf52811-transport - ${NRF_TRANSPORT_SOURCES} -) - -add_library(openthread-nrf52811-sdk - ${NRF_COMM_SOURCES} - ${NRF_SINGLEPHY_SOURCES} - $ -) - -target_link_libraries(openthread-nrf52811 - PUBLIC - ${OT_MBEDTLS} - ${NRF52811_3RD_LIBS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - ot-config -) - -target_link_libraries(openthread-nrf52811-transport - PUBLIC - ${OT_MBEDTLS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - nordicsemi-nrf52811-sdk - ot-config -) - -target_link_libraries(openthread-nrf52811-sdk - PUBLIC - ${OT_MBEDTLS} - ${NRF52811_3RD_LIBS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - ot-config -) - -target_compile_definitions(openthread-nrf52811 - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_definitions(openthread-nrf52811-transport - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_definitions(openthread-nrf52811-sdk - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_options(openthread-nrf52811 - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} - -DRAAL_SINGLE_PHY=1 -) - -target_compile_options(openthread-nrf52811-transport - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} -) - -target_compile_options(openthread-nrf52811-sdk - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} - -DRAAL_SINGLE_PHY=1 -) - -target_include_directories(openthread-nrf52811 - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52811 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) - -target_include_directories(openthread-nrf52811-transport - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52811 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) - -target_include_directories(openthread-nrf52811-sdk - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52811 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) - diff --git a/examples/platforms/nrf528xx/nrf52811/nrf52811.ld b/examples/platforms/nrf528xx/nrf52811/nrf52811.ld deleted file mode 100644 index d050a22d4..000000000 --- a/examples/platforms/nrf528xx/nrf52811/nrf52811.ld +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * GCC linker script for nRF52811. - */ - -SEARCH_DIR(.) -GROUP(-lgcc -lc -lnosys) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x30000 - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x6000 -} - -OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") - -ENTRY(Reset_Handler) - -FLASH_PAGE_SIZE = 4096; -FLASH_DATA_PAGES_USED = 2; - -SECTIONS -{ - .text : - { - KEEP(*(.isr_vector)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - __etext = .; - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - PROVIDE(end = .); - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - __stop_ot_flash_data = (ORIGIN(FLASH) + LENGTH(FLASH)); - __start_ot_flash_data = (__stop_ot_flash_data - (FLASH_PAGE_SIZE * FLASH_DATA_PAGES_USED)); - - /* Assure that code does not overlap flash data area.*/ - ASSERT((__start_ot_flash_data >= __etext + SIZEOF(.data)), "Error: Code overlaps flash data area.") - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") -} diff --git a/examples/platforms/nrf528xx/nrf52811/openthread-core-nrf52811-config-check.h b/examples/platforms/nrf528xx/nrf52811/openthread-core-nrf52811-config-check.h deleted file mode 100644 index 9b9c87d72..000000000 --- a/examples/platforms/nrf528xx/nrf52811/openthread-core-nrf52811-config-check.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef OPENTHREAD_CORE_NRF52811_CONFIG_CHECK_H_ -#define OPENTHREAD_CORE_NRF52811_CONFIG_CHECK_H_ - -#if OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT -#error "Platform nrf52811 doesn't support configuration option: OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT" -#endif - -#endif /* OPENTHREAD_CORE_NRF52811_CONFIG_CHECK_H_ */ diff --git a/examples/platforms/nrf528xx/nrf52811/openthread-core-nrf52811-config.h b/examples/platforms/nrf528xx/nrf52811/openthread-core-nrf52811-config.h deleted file mode 100644 index c3fc13a73..000000000 --- a/examples/platforms/nrf528xx/nrf52811/openthread-core-nrf52811-config.h +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes nrf52811 compile-time configuration constants - * for OpenThread. - */ - -#ifndef OPENTHREAD_CORE_NRF52811_CONFIG_H_ -#define OPENTHREAD_CORE_NRF52811_CONFIG_H_ - -/* - * The GNU Autoconf system defines a PACKAGE macro which is the name - * of the software package. This name collides with PACKAGE field in - * the nRF52 Factory Information Configuration Registers (FICR) - * structure. - */ -#undef PACKAGE - -/** - * @def OPENTHREAD_CONFIG_LOG_OUTPUT - * - * The nrf52811 platform provides an otPlatLog() function. - */ -#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT -#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED -#endif - -/** - * @def OPENTHREAD_CONFIG_PLATFORM_INFO - * - * The platform-specific string to insert into the OpenThread version string. - * - */ -#define OPENTHREAD_CONFIG_PLATFORM_INFO "NRF52811" - -/** - * @def OPENTHREAD_CONFIG_STACK_VENDOR_OUI - * - * The Organizationally Unique Identifier for the vendor. - * - */ -#ifndef OPENTHREAD_CONFIG_STACK_VENDOR_OUI -#define OPENTHREAD_CONFIG_STACK_VENDOR_OUI 0xf4ce36 -#endif - -/** - * @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS - * - * The number of message buffers in the buffer pool. - * - */ -#ifndef OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS -#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 60 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS - * - * The maximum number of state-changed callback handlers (set using `otSetStateChangedCallback()`). - * - */ -#ifndef OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS -#define OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS 3 -#endif - -/** - * @def OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES - * - * The number of EID-to-RLOC cache entries. - * - */ -#ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES -#define OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES 20 -#endif - -/** - * @def OPENTHREAD_CONFIG_LOG_PREPREND_LEVEL - * - * Define to prepend the log level to all log messages - * - */ -#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL -#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE - * - * Define to 1 if you want to enable software ACK timeout logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE - * - * Define to 1 if you want to enable software retransmission logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE - * - * Define to 1 if you want to enable software CSMA-CA backoff logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE - * - * Define to 1 if you want to enable software transmission security logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE - * - * Define to 1 to enable software transmission target time logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE - * - * Define to 1 to enable software reception target time logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) -#endif - -/** - * @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE - * - * Define to 1 if you want to support microsecond timer in platform. - * - */ -#ifndef OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE -#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1 -#endif - -/** - * @def OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE - * - * Define to 1 to enable otPlatFlash* APIs to support non-volatile storage. - * - * When defined to 1, the platform MUST implement the otPlatFlash* APIs instead of the otPlatSettings* APIs. - * - */ -#ifndef OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE -#define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 1 -#endif - -/** - * @def OPENTHREAD_CONFIG_TIME_SYNC_ENABLE - * - * Define as 1 to enable the time synchronization service feature. - * - */ -#ifndef OPENTHREAD_CONFIG_TIME_SYNC_ENABLE -#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT - * - * Define as 1 to support IEEE 802.15.4-2015 Header IE (Information Element) generation and parsing, it must be set - * to support following features: - * 1. Time synchronization service feature (i.e., OPENTHREAD_CONFIG_TIME_SYNC_ENABLE is set). - * - * @note If it's enabled, plaforms must support interrupt context and concurrent access AES. - * - */ -#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE -#define OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT 1 -#endif - -/** - * @def RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM - * - * The number of short source address table entries. - * - */ -#ifndef RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM -#define RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM 0 -#endif - -/** - * @def RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM - * - * The number of extended source address table entries. - * - */ -#ifndef RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM -#define RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD - * - * Reception scheduling and ramp up time needed for the CSL receiver to be ready, in units of microseconds. - * - */ -#ifndef OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD -#define OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD 2000 -#endif - -/** - * @def OPENTHREAD_CONFIG_CSL_MIN_RECEIVE_ON - * - * The minimum CSL receive window (in microseconds) required to receive an IEEE 802.15.4 frame. - * - Frame preamble: 6*2 symbols + margin - * - */ -#ifndef OPENTHREAD_CONFIG_CSL_MIN_RECEIVE_ON -#define OPENTHREAD_CONFIG_CSL_MIN_RECEIVE_ON 12 * 16 -#endif - -/* - * Suppress the ARMCC warning on unreachable statement, - * e.g. break after assert(false) or ExitNow() macro. - */ -#if defined(__CC_ARM) -_Pragma("diag_suppress=111") _Pragma("diag_suppress=128") -#endif - -#endif // OPENTHREAD_CORE_NRF52811_CONFIG_H_ diff --git a/examples/platforms/nrf528xx/nrf52811/platform-config.h b/examples/platforms/nrf528xx/nrf52811/platform-config.h deleted file mode 100644 index 660a35234..000000000 --- a/examples/platforms/nrf528xx/nrf52811/platform-config.h +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the platform-specific configuration. - * - */ - -#ifndef PLATFORM_CONFIG_H_ -#define PLATFORM_CONFIG_H_ - -#include "nrf.h" -#include "nrf_drv_clock.h" -#include "nrf_peripherals.h" -#include "hal/nrf_radio.h" -#include "hal/nrf_uart.h" - -#include "openthread-core-config.h" -#include - -/******************************************************************************* - * @section Alarm Driver Configuration. - ******************************************************************************/ - -/** - * @def RTC_INSTANCE - * - * RTC Instance. - * - */ -#ifndef RTC_INSTANCE -#define RTC_INSTANCE NRF_RTC1 -#endif - -/** - * @def RTC_IRQ_HANDLER - * - * RTC interrupt handler name - * - */ -#ifndef RTC_IRQ_HANDLER -#define RTC_IRQ_HANDLER RTC1_IRQHandler -#endif - -/** - * @def RTC_IRQN - * - * RTC Interrupt number. - * - */ -#ifndef RTC_IRQN -#define RTC_IRQN RTC1_IRQn -#endif - -/** - * @def RTC_IRQ_PRIORITY - * - * RTC Interrupt priority. - * - */ -#ifndef RTC_IRQ_PRIORITY -#define RTC_IRQ_PRIORITY 6 -#endif - -/******************************************************************************* - * @section Random Number Generator Driver Configuration. - ******************************************************************************/ - -/** - * @def RNG_BUFFER_SIZE - * - * True Random Number Generator buffer size. - * - */ -#ifndef RNG_BUFFER_SIZE -#define RNG_BUFFER_SIZE 128 -#endif - -/** - * @def RNG_IRQ_PRIORITY - * - * RNG Interrupt priority. - * - */ -#ifndef RNG_IRQ_PRIORITY -#define RNG_IRQ_PRIORITY 6 -#endif - -/******************************************************************************* - * @section Platform Flash Configuration - ******************************************************************************/ - -/** - * @def PLATFORM_FLASH_PAGE_NUM - * - * Number of flash pages to use for OpenThread's non-volatile settings. - * - * @note This define applies only for MDK-ARM Keil toolchain configuration. - * - */ -#ifndef PLATFORM_FLASH_PAGE_NUM -#define PLATFORM_FLASH_PAGE_NUM 2 -#endif - -/******************************************************************************* - * @section Platform FEM Configuration - ******************************************************************************/ - -/** - * @def PLATFORM_FEM_ENABLE_DEFAULT_CONFIG - * - * Enable default front end module configuration. - * - */ -#ifndef PLATFORM_FEM_ENABLE_DEFAULT_CONFIG -#define PLATFORM_FEM_ENABLE_DEFAULT_CONFIG 0 -#endif - -/******************************************************************************* - * @section Radio driver configuration. - ******************************************************************************/ - -/** - * @def NRF_802154_PENDING_SHORT_ADDRESSES - * - * Number of slots containing short addresses of nodes for which pending data is stored. - * - */ -#ifndef NRF_802154_PENDING_SHORT_ADDRESSES -#define NRF_802154_PENDING_SHORT_ADDRESSES OPENTHREAD_CONFIG_MLE_MAX_CHILDREN -#endif - -/** - * @def NRF_802154_PENDING_EXTENDED_ADDRESSES - * - * Number of slots containing extended addresses of nodes for which pending data is stored. - * - */ -#ifndef NRF_802154_PENDING_EXTENDED_ADDRESSES -#define NRF_802154_PENDING_EXTENDED_ADDRESSES OPENTHREAD_CONFIG_MLE_MAX_CHILDREN -#endif - -/** - * @def NRF_802154_CSMA_CA_ENABLED - * - * If CSMA-CA procedure should be enabled by the driver. Disabling CSMA-CA procedure improves - * driver performance. - * - */ -#ifndef NRF_802154_CSMA_CA_ENABLED -#define NRF_802154_CSMA_CA_ENABLED 1 -#endif - -/** - * @def NRF_802154_ACK_TIMEOUT_ENABLED - * - * If ACK timeout feature should be enabled in the driver. - * - */ -#ifndef NRF_802154_ACK_TIMEOUT_ENABLED -#define NRF_802154_ACK_TIMEOUT_ENABLED 1 -#endif - -/******************************************************************************* - * @section Temperature sensor driver configuration. - ******************************************************************************/ - -/** - * @def TEMP_MEASUREMENT_INTERVAL - * - * Interval of consecutive temperature measurements [s]. - * - */ -#ifndef TEMP_MEASUREMENT_INTERVAL -#define TEMP_MEASUREMENT_INTERVAL 30 -#endif - -/** - * @def NRF_802154_TX_STARTED_NOTIFY_ENABLED - * - * If notification of started transmission should be enabled in the driver. - * - * @note This feature must be enabled to support Header IE related features. - * - */ -#ifndef NRF_802154_TX_STARTED_NOTIFY_ENABLED -#define NRF_802154_TX_STARTED_NOTIFY_ENABLED 1 -#endif - -#endif // PLATFORM_CONFIG_H_ diff --git a/examples/platforms/nrf528xx/nrf52811/transport-config.h b/examples/platforms/nrf528xx/nrf52811/transport-config.h deleted file mode 100644 index a4361357f..000000000 --- a/examples/platforms/nrf528xx/nrf52811/transport-config.h +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Copyright (c) 2020, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the transport-specific configuration. - * - */ - -#ifndef TRANSPORT_CONFIG_H_ -#define TRANSPORT_CONFIG_H_ - -#include "nrf.h" -#include "nrf_drv_clock.h" -#include "nrf_peripherals.h" -#include "hal/nrf_radio.h" -#include "hal/nrf_uart.h" - -#include "openthread-core-config.h" -#include - -/******************************************************************************* - * @section UART Driver Configuration. - ******************************************************************************/ - -/** - * @def UART_INSTANCE - * - * UART Instance. - * - */ -#ifndef UART_INSTANCE -#define UART_INSTANCE NRF_UARTE0 -#endif - -/** - * @def UART_PARITY - * - * UART Parity configuration. - * - * @brief Possible values: - * \ref NRF_UARTE_PARITY_EXCLUDED - Parity bit is not present. - * \ref NRF_UARTE_PARITY_INCLUDED - Parity bit is present. - * - */ -#ifndef UART_PARITY -#define UART_PARITY NRF_UARTE_PARITY_EXCLUDED -#endif - -/** - * @def UART_HWFC_ENABLED - * - * Enable UART Hardware Flow Control. - * - */ -#ifndef UART_HWFC_ENABLED -#define UART_HWFC_ENABLED 1 -#endif - -/** - * @def UART_BAUDRATE - * - * UART Baudrate. - * - * @brief Possible values: - * \ref NRF_UARTE_BAUDRATE_1200 - 1200 baud. - * \ref NRF_UARTE_BAUDRATE_2400 - 2400 baud. - * \ref NRF_UARTE_BAUDRATE_4800 - 4800 baud. - * \ref NRF_UARTE_BAUDRATE_9600 - 9600 baud. - * \ref NRF_UARTE_BAUDRATE_14400 - 14400 baud. - * \ref NRF_UARTE_BAUDRATE_19200 - 19200 baud. - * \ref NRF_UARTE_BAUDRATE_28800 - 28800 baud. - * \ref NRF_UARTE_BAUDRATE_38400 - 38400 baud. - * \ref NRF_UARTE_BAUDRATE_57600 - 57600 baud. - * \ref NRF_UARTE_BAUDRATE_76800 - 76800 baud. - * \ref NRF_UARTE_BAUDRATE_115200 - 115200 baud. - * \ref NRF_UARTE_BAUDRATE_230400 - 230400 baud. - * \ref NRF_UARTE_BAUDRATE_250000 - 250000 baud. - * \ref NRF_UARTE_BAUDRATE_460800 - 460800 baud. - * \ref NRF_UARTE_BAUDRATE_921600 - 921600 baud. - * \ref NRF_UARTE_BAUDRATE_1000000 - 1000000 baud. - * - */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE NRF_UARTE_BAUDRATE_115200 -#endif - -/** - * @def UART_IRQN - * - * UART Interrupt number. - * - */ -#ifndef UART_IRQN -#define UART_IRQN UARTE0_UART0_IRQn -#endif - -/** - * @def UART_IRQ_PRIORITY - * - * UART Interrupt priority. - * - */ -#ifndef UART_IRQ_PRIORITY -#define UART_IRQ_PRIORITY 6 -#endif - -/** - * @def UART_RX_BUFFER_SIZE - * - * UART Receive buffer size. - * - */ -#ifndef UART_RX_BUFFER_SIZE -#define UART_RX_BUFFER_SIZE 256 -#endif - -/** - * @def UART_PIN_TX - * - * UART TX Pin. - * - */ -#ifndef UART_PIN_TX -#define UART_PIN_TX 6 -#endif - -/** - * @def UART_PIN_RX - * - * UART RX Pin. - * - */ -#ifndef UART_PIN_RX -#define UART_PIN_RX 8 -#endif - -/** - * @def UART_PIN_CTS - * - * UART CTS Pin. - * - */ -#ifndef UART_PIN_CTS -#define UART_PIN_CTS 7 -#endif - -/** - * @def UART_PIN_RTS - * - * UART RTS Pin. - * - */ -#ifndef UART_PIN_RTS -#define UART_PIN_RTS 5 -#endif - -/******************************************************************************* - * @section SPI Slave configuration. - ******************************************************************************/ - -/** - * @def SPIS Instance. - */ -#ifndef SPIS_INSTANCE -#define SPIS_INSTANCE 0 -#endif - -/** - * @def SPIS mode. - * - * @brief Possible values: - * \ref NRF_SPIS_MODE_0 - SCK active high, sample on leading edge of clock. - * \ref NRF_SPIS_MODE_1 - SCK active high, sample on trailing edge of clock. - * \ref NRF_SPIS_MODE_2 - SCK active low, sample on leading edge of clock. - * \ref NRF_SPIS_MODE_3 - SCK active low, sample on trailing edge of clock. - */ -#ifndef SPIS_MODE -#define SPIS_MODE NRF_SPIS_MODE_0 -#endif - -/** - * @def SPIS bit orders. - * - * @brief Possible values: - * \ref NRF_SPIS_BIT_ORDER_MSB_FIRST - Most significant bit shifted out first. - * \ref NRF_SPIS_BIT_ORDER_LSB_FIRST - Least significant bit shifted out first. - */ -#ifndef SPIS_BIT_ORDER -#define SPIS_BIT_ORDER NRF_SPIS_BIT_ORDER_MSB_FIRST -#endif - -/** - * @def SPIS Interrupt priority. - */ -#ifndef SPIS_IRQ_PRIORITY -#define SPIS_IRQ_PRIORITY 6 -#endif - -/** - * @def SPIS MOSI Pin. - */ -#ifndef SPIS_PIN_MOSI -#define SPIS_PIN_MOSI 4 -#endif - -/** - * @def SPIS MISO Pin. - */ -#ifndef SPIS_PIN_MISO -#define SPIS_PIN_MISO 28 -#endif - -/** - * @def SPIS SCK Pin. - */ -#ifndef SPIS_PIN_SCK -#define SPIS_PIN_SCK 3 -#endif - -/** - * @def SPIS CSN Pin. - */ -#ifndef SPIS_PIN_CSN -#define SPIS_PIN_CSN 29 -#endif - -/** - * @def SPIS Host IRQ Pin. - */ -#ifndef SPIS_PIN_HOST_IRQ -#define SPIS_PIN_HOST_IRQ 30 -#endif - -#endif // TRANSPORT_CONFIG_H_ diff --git a/examples/platforms/nrf528xx/nrf52833/Makefile.am b/examples/platforms/nrf528xx/nrf52833/Makefile.am deleted file mode 100644 index 21ee11784..000000000 --- a/examples/platforms/nrf528xx/nrf52833/Makefile.am +++ /dev/null @@ -1,205 +0,0 @@ -# -# Copyright (c) 2019, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -include $(abs_top_nlbuild_autotools_dir)/automake/pre.am - -lib_LIBRARIES = \ - libopenthread-nrf52833.a \ - libopenthread-nrf52833-sdk.a \ - libopenthread-nrf52833-softdevice-sdk.a \ - libopenthread-nrf52833-transport.a \ - $(NULL) - -# Do not enable -pedantic-errors for nRF52833 driver library -override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS)) -override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS)) - -# Do not enable -Wundef for nRF52833 driver library -override CFLAGS := $(filter-out -Wundef,$(CFLAGS)) -override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS)) - -# Do not enable -Wcast-align for nRF52833 driver library -override CFLAGS := $(filter-out -Wcast-align,$(CFLAGS)) -override CXXFLAGS := $(filter-out -Wcast-align,$(CXXFLAGS)) - -COMMONCPPFLAGS = \ - -DCONFIG_GPIO_AS_PINRESET \ - -DNRF52833_XXAA \ - -DUSE_APP_CONFIG=1 \ - -I$(srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/examples/platforms \ - -I$(top_srcdir)/examples/platforms/nrf528xx/src \ - -I$(top_srcdir)/examples/platforms/nrf528xx/src/transport \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/temperature \ - $(NULL) - -# Only reference the SDK header files included in third_party/NordicSemiconductor -# when building the example applications. -# -# When building just the platform libraries, the caller of configure is expected -# to provide the correct -I arguments to locate the necessary header files in an -# external copy of the Nordic nRF5 SDK. -# -# Note that an exception is made for the 802.15.4 radio driver, which is always -# built using the sources in third_party/NordicSemiconductor/drivers/radio. -if OPENTHREAD_ENABLE_EXAMPLES -COMMONCPPFLAGS += \ - -I$(top_srcdir)/third_party/NordicSemiconductor \ - -I$(top_srcdir)/third_party/NordicSemiconductor/cmsis \ - -I$(top_srcdir)/third_party/NordicSemiconductor/config \ - -I$(top_srcdir)/third_party/NordicSemiconductor/config/nrf52833/config \ - -I$(top_srcdir)/third_party/NordicSemiconductor/dependencies \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/clock \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/common \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/power \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/systick \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/usbd \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/app_error \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/atfifo \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/atomic \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/block_dev \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/delay \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/config \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/utf_converter \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/soc \ - -I$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers \ - -I$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf52 \ - $(NULL) -endif - -PLATFORM_COMMON_SOURCES = \ - src/alarm.c \ - src/diag.c \ - src/entropy.c \ - src/fem.c \ - src/flash.c \ - src/logging.c \ - src/misc.c \ - src/radio.c \ - src/system.c \ - src/temp.c \ - $(NULL) - -TRANSPORT_SOURCES = \ - src/transport/spi-slave.c \ - src/transport/uart.c \ - src/transport/usb-cdc-uart.c \ - src/transport/transport.c \ - $(NULL) - -SINGLEPHY_SOURCES = \ - src/flash_nosd.c \ - $(NULL) - -SOFTDEVICE_SOURCES = \ - src/flash_sd.c \ - src/softdevice.c \ - $(NULL) - -SOFTDEVICE_CPPFLAGS = \ - -DSOFTDEVICE_PRESENT \ - -DS140 \ - -Wno-unused-parameter \ - $(NULL) - -PLATFORM_SOURCES = \ - $(PLATFORM_COMMON_SOURCES) \ - $(NULL) - -libopenthread_nrf52833_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(SINGLEPHY_CPPFLAGS) \ - $(NULL) - -libopenthread_nrf52833_a_SOURCES = \ - $(PLATFORM_SOURCES) \ - $(SINGLEPHY_SOURCES) \ - $(NULL) - -libopenthread_nrf52833_sdk_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(SINGLEPHY_CPPFLAGS) \ - $(NULL) - -libopenthread_nrf52833_sdk_a_SOURCES = \ - $(PLATFORM_SOURCES) \ - $(SINGLEPHY_SOURCES) \ - $(NULL) - -libopenthread_nrf52833_softdevice_sdk_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(SOFTDEVICE_CPPFLAGS) \ - $(NULL) - -libopenthread_nrf52833_softdevice_sdk_a_SOURCES = \ - $(PLATFORM_SOURCES) \ - $(SOFTDEVICE_SOURCES) \ - $(NULL) - -libopenthread_nrf52833_transport_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NULL) - -libopenthread_nrf52833_transport_a_SOURCES = \ - $(TRANSPORT_SOURCES) \ - $(NULL) - -Dash = - - -libopenthread_nrf52833_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") \ - $(shell find $(top_builddir)/third_party/jlink/SEGGER_RTT_V640/RTT $(Dash)type f $(Dash)name "*.o") - -libopenthread_nrf52833_sdk_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") - -libopenthread_nrf52833_softdevice_sdk_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") - -libopenthread_nrf52833_transport_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") - -include $(abs_top_nlbuild_autotools_dir)/automake/post.am diff --git a/examples/platforms/nrf528xx/nrf52833/Makefile.platform.am b/examples/platforms/nrf528xx/nrf52833/Makefile.platform.am deleted file mode 100644 index 1412d57a9..000000000 --- a/examples/platforms/nrf528xx/nrf52833/Makefile.platform.am +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright (c) 2019, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -# -# nrf52833 platform-specific Makefile -# - -LDADD_COMMON += \ - $(top_builddir)/examples/platforms/nrf528xx/libopenthread-nrf52833.a \ - $(top_builddir)/examples/platforms/nrf528xx/libopenthread-nrf52833-transport.a \ - $(top_builddir)/third_party/NordicSemiconductor/libnordicsemi-nrf52833-sdk.a \ - $(top_builddir)/third_party/NordicSemiconductor/libnordicsemi-nrf52833-radio-driver.a \ - $(NULL) - -if OPENTHREAD_ENABLE_CUSTOM_LINKER_FILE -LDFLAGS_COMMON += \ - -T $(OPENTHREAD_CUSTOM_LINKER_FILE) \ - $(NULL) -else -LDFLAGS_COMMON += \ - -T $(top_srcdir)/examples/platforms/nrf528xx/nrf52833/nrf52833.ld \ - $(NULL) -endif diff --git a/examples/platforms/nrf528xx/nrf52833/README.md b/examples/platforms/nrf528xx/nrf52833/README.md index fa377772b..0f151e6f2 100644 --- a/examples/platforms/nrf528xx/nrf52833/README.md +++ b/examples/platforms/nrf528xx/nrf52833/README.md @@ -1,407 +1 @@ -# OpenThread on nRF52833 Example - -This directory contains example platform drivers for [Nordic Semiconductor nRF52833 SoC][nrf52833]. - -To facilitate Thread products development with the nRF52833 platform, Nordic Semiconductor provides nRF5 SDK for Thread and Zigbee. See [Nordic Semiconductor's nRF5 SDK for Thread and Zigbee][nrf5-sdk-section] section for more details. - -[nrf52833]: https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52833 -[nrf5-sdk-section]: #nordic-semiconductors-nrf5-sdk-for-thread-and-zigbee - -## Prerequisites - -Before you start building the examples, you must download and install the toolchain and the tools required for flashing and debugging. - -### Toolchain - -Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain]. - -[gnu-toolchain]: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm - -To install the GNU toolchain and its dependencies, run the following commands in Bash: - -```bash -$ cd -$ ./script/bootstrap -``` - -### Flashing and debugging tools - -[nrf5-command-line-tools]: https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF5-Command-Line-Tools - -Install the [nRF5 Command Line Tools][nrf5-command-line-tools] to flash, debug, and make use of logging features on the nRF52833 DK with SEGGER J-Link. - -## Building the examples - -To build the examples, run the following command in Bash: - -```bash -$ cd -$ ./bootstrap -$ make -f examples/Makefile-nrf52833 -``` - -After a successful build, the `elf` files can be found in `/output/nrf52833/bin`. You can convert them to hex using `arm-none-eabi-objcopy`: - -```bash -$ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.hex -``` - -### USB CDC ACM support - -You can build the libraries with support for the native USB CDC ACM as a serial transport. To do so, build the firmware with the following parameter: - -``` -$ make -f examples/Makefile-nrf52833 USB=1 -``` - -Note that the USB CDC ACM serial transport is not supported with Engineering sample A of the nRF52833 chip. - -If you are using Windows 7 or earlier, you must load an additional USB CDC driver. The driver can be found in `third_party/NordicSemiconductor/libraries/usb/nordic_cdc_acm_example.inf`. - -### Bootloader support - -The examples support the following bootloaders for performing a Device Firmware Upgrade (DFU): - -- USB bootloader -- UART bootloader -- BLE bootloader - -The support for a particular bootloader can be enabled with the following switches: - -- USB: `BOOTLOADER=USB` -- UART: `BOOTLOADER=UART` -- BLE: `BOOTLOADER=BLE` - -### Native SPI support - -You can build the libraries with support for native SPI Slave. To build the libraries, run make with the following parameter: - -``` -$ make -f examples/Makefile-nrf52833 NCP_SPI=1 -``` - -With this option enabled, SPI communication between the NCP example and wpantund is possible (provided that the wpantund host supports SPI Master). To achieve that, an appropriate SPI device should be chosen in wpantund configuration file, `/etc/wpantund.conf`. You can find an example below. - -``` -Config:NCP:SocketPath "system:/usr/bin/spi-hdlc-adapter --gpio-int /sys/class/gpio/gpio25 /dev/spidev0.0" -``` - -In this example, [spi-hdlc-adapter][spi-hdlc-adapter] is a tool that you can use to communicate between NCP and wpantund over SPI. For this example, `spi-hdlc-adapter` is installed in `/usr/bin`. - -The default SPI Slave pin configuration for nRF52833 is defined in `examples/platforms/nrf52833/transport-config.h`. - -Note that the native SPI Slave support is not intended to be used with Engineering sample A of the nRF52833 chip due to single transfer size limitation. - -[spi-hdlc-adapter]: https://github.com/openthread/openthread/tree/master/tools/spi-hdlc-adapter - -### Optional prefix for compiler command - -You can prefix the compiler command using the CCPREFIX parameter. This speeds up the compilation when you use tools like [ccache][ccache-website]. Example usage: - -[ccache-website]: https://ccache.samba.org/ - -``` -$ make -f examples/Makefile-nrf52833 USB=1 CCPREFIX=ccache -``` - -### Optional mbedTLS threading support - -By default, mbedTLS library is built without support for multiple threads. You can enable this built-in support by building OpenThread with the following parameter: - -``` -$ make -f examples/Makefile-nrf52833 MBEDTLS_THREADING=1 -``` - -The simple mutex definition is used as shown below: - -``` -typedef void * mbedtls_threading_mutex_t; -``` - -However, you can modify it, by providing a path to a header file with proper definition. To do that, build OpenThread with the following parameter: - -``` -$ make -f examples/Makefile-nrf52833 MBEDTLS_THREADING=1 MBEDTLS_THREADING_MUTEX_DEF="path_to_a_header_file_with_mutex_definition.h" -``` - -See [mbedTls Thread Safety and Multi Threading][mbedtls-thread-safety-and-multi-threading] for more details. - -[mbedtls-thread-safety-and-multi-threading]: https://tls.mbed.org/kb/development/thread-safety-and-multi-threading - -### IEEE EUI-64 address - -When the Thread device is configured to obtain the Thread Network security credentials with either Thread Commissioning or an out-of-band method, the extended MAC address should be constructed out of the globally unique IEEE EUI-64. - -The IEEE EUI-64 address consists of two parts: - -- 24 bits of MA-L (MAC Address Block Large), formerly called OUI (Organizationally Unique Identifier) -- 40-bit device unique identifier - -By default, the device uses Nordic Semiconductor's MA-L (f4-ce-36). You can modify it by overwriting the `OPENTHREAD_CONFIG_STACK_VENDOR_OUI` define, located in the `openthread-core-nrf52833-config.h` file. This value must be publicly registered by the IEEE Registration Authority. - -You can also provide the full IEEE EUI-64 address by providing a custom `otPlatRadioGetIeeeEui64` function. To do this, define the flag `OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE`. - -After the Thread Network security credentials have been successfully obtained, the device uses randomly generated extended MAC address. - -## Flashing the binaries - -Flash the compiled binaries onto nRF52833 using `nrfjprog` which is part of the [nRF5 Command Line Tools][nrf5-command-line-tools]. - -```bash -$ nrfjprog -f nrf52 --chiperase --program output/nrf52833/bin/ot-cli-ftd.hex --reset -``` - -## Running the example - -To test the example: - -1. Prepare two boards with the flashed `CLI Example` (as shown above). The CLI FTD example uses the direct UART connection. - -2. Open a terminal connection on two boards: - - a. Start a terminal emulator like screen. - - b. Connect to the used COM port with the following direct UART settings: - - - Baud rate: 115200 - - 8 data bits - - 1 stop bit - - No parity - - HW flow control: RTS/CTS This allows you to view the raw UART output. - - On Linux system a port name should be called e.g. `/dev/ttyACM0` or `/dev/ttyACM1`. - - c. Run the following command to connect to a board. - - ```shell - screen /dev/ttyACM0 115200 - ``` - - Now you are connected with the CLI. - -3. Use the following commands to form a network on the first board. - - ```bash - > dataset init new - Done - > dataset - Active Timestamp: 1 - Channel: 13 - Channel Mask: 0x07fff800 - Ext PAN ID: d63e8e3e495ebbc3 - Mesh Local Prefix: fd3d:b50b:f96d:722d::/64 - Master Key: dfd34f0f05cad978ec4e32b0413038ff - Network Name: OpenThread-8f28 - PAN ID: 0x8f28 - PSKc: c23a76e98f1a6483639b1ac1271e2e27 - Security Policy: 0, onrcb - Done - > dataset commit active - Done - > ifconfig up - Done - > thread start - Done - ``` - - After a couple of seconds the node will become a Leader of the network. - - ```bash - > state - leader - ``` - -4. Use the following commands to attach to the network on the second board. - - ```bash - > dataset masterkey dfd34f0f05cad978ec4e32b0413038ff - Done - > dataset commit active - Done - > ifconfig up - Done - > thread start - Done - ``` - - After a couple of seconds the second node will attach and become a Child. - - ```bash - > state - child - ``` - -5. List all IPv6 addresses of the first board. - - ```bash - > ipaddr - fd3d:b50b:f96d:722d:0:ff:fe00:fc00 - fd3d:b50b:f96d:722d:0:ff:fe00:c00 - fd3d:b50b:f96d:722d:7a73:bff6:9093:9117 - fe80:0:0:0:6c41:9001:f3d6:4148 - Done - ``` - -6. Choose one of them and send an ICMPv6 ping from the second board. - - ```bash - > ping fd3d:b50b:f96d:722d:7a73:bff6:9093:9117 - 16 bytes from fd3d:b50b:f96d:722d:558:f56b:d688:799: icmp_seq=1 hlim=64 time=24ms - ``` - -For a list of all available commands, visit [OpenThread CLI Reference README.md][cli]. - -[cli]: ./../../../src/cli/README.md - -## SEGGER J-Link tools - -SEGGER J-Link tools allow to debug and flash generated firmware using on-board debugger or external one. - -### Working with RTT logging - -By default, the OpenThread's logging module provides functions to output logging information over SEGGER's Real Time Transfer (RTT). - -You can set the desired log level by using the `OPENTHREAD_CONFIG_LOG_LEVEL` define. - -To enable the highest verbosity level, append `FULL_LOGS` flag to the `make` command: - -``` -$ make -f examples/Makefile-nrf52833 FULL_LOGS=1 -``` - -#### Enable logging on Windows - -1. Connect the DK to your machine with a USB cable. -2. Run `J-Link RTT Viewer`. The configuration window appears. -3. From the Specify Target Device dropdown menu, select `NRF52833_XXAA`. -4. From the Target Interface & Speed dropdown menu, select `SWD`. - -#### Enable logging on Linux - -1. Connect the DK to your machine with a USB cable. -2. Run `JLinkExe` to connect to the target. For example: - -``` -JLinkExe -device NRF52833_XXAA -if SWD -speed 4000 -autoconnect 1 -SelectEmuBySN -RTTTelnetPort 19021 -``` - -3. Run `JLinkRTTTelnet` to obtain the RTT logs from the connected device in a separate console. For example: - -``` -JLinkRTTClient -RTTTelnetPort 19021 -``` - -### Mass Storage Device known issue - -Depending on your version, due to a known issue in SEGGER's J-Link firmware, you might experience data corruption or data drops if you use the serial port. You can avoid this issue by disabling the Mass Storage Device. - -#### Disabling the Mass Storage Device on Windows - -1. Connect the DK to your machine with a USB cable. -2. Run `J-Link Commander`. The configuration window appears. -3. From the Specify Target Device dropdown menu, select `NRF52833_XXAA`. -4. From the Target Interface & Speed dropdown menu, select `SWD`. -5. Run the following command: - -``` -MSDDisable -``` - -6. Power cycle the DK. - -#### Disabling the Mass Storage Device on Linux - -1. Connect the DK to your machine with a USB cable. -2. Run `JLinkExe` to connect to the target. For example: - -``` -JLinkExe -device NRF52833_XXAA -if SWD -speed 4000 -autoconnect 1 -SelectEmuBySN -``` - -3. Run the following command: - -``` -MSDDisable -``` - -4. Power cycle the DK. - -### Hardware Flow Control detection - -By default, SEGGER J-Link automatically detects at runtime whether the target is using Hardware Flow Control (HWFC). - -The automatic HWFC detection is done by driving P0.07 (Clear to Send - CTS) from the interface MCU and evaluating the state of P0.05 (Request to Send - RTS) when the first data is sent or received. If the state of P0.05 (RTS) is high, it is assumed that HWFC is not used. - -To avoid potential race conditions, you can force HWFC and bypass the runtime auto-detection. - -#### Disabling the HWFC detection on Windows - -1. Connect the DK to your machine with a USB cable. -2. Run `J-Link Commander`. The configuration window appears. -3. From the Specify Target Device dropdown menu, select `NRF52833_XXAA`. -4. From the Target Interface & Speed dropdown menu, select `SWD`. -5. Run the following command: - -``` -SetHWFC Force -``` - -6. Power cycle the DK. - -#### Disabling the HWFC detection on Linux - -1. Connect the DK to your machine with a USB cable. -2. Run `JLinkExe` to connect to the target. For example: - -``` -JLinkExe -device NRF52833_XXAA -if SWD -speed 4000 -autoconnect 1 -SelectEmuBySN -``` - -3. Run the following command: - -``` -SetHWFC Force -``` - -4. Power cycle the DK. - -You can find more details [here][j-link-ob]. - -[j-link-ob]: https://wiki.segger.com/J-Link_OB_SAM3U_NordicSemi#Hardware_flow_control_support - -## Diagnostic module - -nRF52833 port extends [OpenThread Diagnostics Module][diag]. - -You can read about all the features [here][nrfdiag]. - -[diag]: ./../../../src/core/diags/README.md -[nrfdiag]: ./../DIAG.md - -## Radio driver documentation - -The radio driver comes with documentation that describes the operation of state machines in this module. To open the `*.uml` sequence diagrams, use [PlantUML][plantuml-url]. - -[plantuml-url]: http://plantuml.com/ - -# Nordic Semiconductor's nRF5 SDK for Thread and Zigbee - -Use [nRF5 Software Development Kit (SDK) for Thread and Zigbee][nrf5-sdk-thread-zigbee] when developing Thread products with Nordic Semiconductor's advanced nRF52840, nRF52833 or nRF52811 SoCs. - -The nRF5 SDK for Thread and Zigbee includes: - -- a pre-built OpenThread stack for the Nordic nRF52840, nRF52833 and nRF52811 SoCs, -- support for hardware-accelerated cryptographic operations using ARM® CryptoCell-310, -- unique Thread/Bluetooth Low Energy dynamic multiprotocol solution which allows for concurrent operation of Thread and Bluetooth Low Energy utilizing OpenThread and SoftDevice (Nordic’s Bluetooth Low Energy stack) with accompanying example applications, -- Thread/Bluetooth Low Energy switched multiprotocol solution with accompanying example applications, -- unique support for DFU-over-Thread (Device Firmware Upgrade), -- examples to demonstrate interactions between nodes performing different Thread roles with the use of OpenThread and CoAP, CoAP Secure or MQTT-SN protocols, -- support for OpenThread Network Co-Processor (NCP) and Radio Co-Processor (RCP) using UART, USB or SPI transport protocol, -- Border Router and cloud connectivity example (e.g. with Google Cloud Platform), -- Thread native commissioning with NFC example, -- example applications demonstrating the use of FreeRTOS with OpenThread, -- support for IAR, Keil MDK-ARM and SEGGER Embedded Studio (SES) IDEs for OpenThread stack and all example applications, -- range of PC tools including Thread Topology Monitor and nRF Sniffer for 802.15.4, -- software modules inherited from the nRF5 SDK e.g. peripheral drivers, NFC libraries, Bluetooth Low Energy libraries etc. - -[nrf5-sdk-thread-zigbee]: https://www.nordicsemi.com/Software-and-Tools/Software/nRF5-SDK-for-Thread-and-Zigbee +The OpenThread on nRF528xx example has moved to https://github.com/openthread/ot-nrf528xx diff --git a/examples/platforms/nrf528xx/nrf52833/arm-none-eabi.cmake b/examples/platforms/nrf528xx/nrf52833/arm-none-eabi.cmake deleted file mode 100644 index 3147abe0c..000000000 --- a/examples/platforms/nrf528xx/nrf52833/arm-none-eabi.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright (c) 2021, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -set(CMAKE_SYSTEM_NAME Generic) -set(CMAKE_SYSTEM_PROCESSOR ARM) - -set(CMAKE_C_COMPILER arm-none-eabi-gcc) -set(CMAKE_CXX_COMPILER arm-none-eabi-g++) -set(CMAKE_ASM_COMPILER arm-none-eabi-as) -set(CMAKE_RANLIB arm-none-eabi-ranlib) - -execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - -set(COMMON_C_FLAGS "-mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs -fdata-sections -ffunction-sections") - -if(COMPILER_VERSION VERSION_GREATER_EQUAL 7) - set(COMMON_C_FLAGS "${COMMON_C_FLAGS} -Wno-expansion-to-defined") -endif() - -set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=gnu99") -set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti") -set(CMAKE_ASM_FLAGS_INIT "${COMMON_C_FLAGS} -x assembler-with-cpp") -set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs") - -set(CMAKE_C_FLAGS_DEBUG "-Og -g") -set(CMAKE_CXX_FLAGS_DEBUG "-Og -g") -set(CMAKE_ASM_FLAGS_DEBUG "-g") - -set(CMAKE_C_FLAGS_RELEASE "-Os") -set(CMAKE_CXX_FLAGS_RELEASE "-Os") -set(CMAKE_ASM_FLAGS_RELEASE "") diff --git a/examples/platforms/nrf528xx/nrf52833/nrf52833.cmake b/examples/platforms/nrf528xx/nrf52833/nrf52833.cmake deleted file mode 100644 index a02ae6e24..000000000 --- a/examples/platforms/nrf528xx/nrf52833/nrf52833.cmake +++ /dev/null @@ -1,214 +0,0 @@ -# -# Copyright (c) 2021, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -set(OT_PLATFORM_LIB "openthread-nrf52833" "openthread-nrf52833-transport" PARENT_SCOPE) - -if(NOT OT_CONFIG) - set(OT_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/nrf52833/openthread-core-nrf52833-config.h") - set(OT_CONFIG ${OT_CONFIG} PARENT_SCOPE) -endif() - -option(OT_BOOTLOADER "OT nrf bootloader type") -if(OT_BOOTLOADER STREQUAL "USB") - list(APPEND OT_PLATFORM_DEFINES "APP_USBD_NRF_DFU_TRIGGER_ENABLED=1") - set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/nrf52833/nrf52833_bootloader_usb.ld") -elseif(OT_BOOTLOADER STREQUAL "UART") - set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/nrf52833/nrf52833_bootloader_uart.ld") -elseif(OT_BOOTLOADER STREQUAL "BLE") - set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/nrf52833/nrf52833_bootloader_ble.ld") -else() - set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/nrf52833/nrf52833.ld") -endif() - -list(APPEND OT_PLATFORM_DEFINES - "OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=\"openthread-core-nrf52833-config-check.h\"" -) -list(APPEND OT_PUBLIC_INCLUDES - "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config" - "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/nrf_security/nrfx/mdk" - "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/cmsis" -) - -set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE) -target_compile_definitions(ot-config INTERFACE - "MBEDTLS_USER_CONFIG_FILE=\"nrf52833-mbedtls-config.h\"" -) -set(OT_PUBLIC_INCLUDES ${OT_PUBLIC_INCLUDES} PARENT_SCOPE) - -set(COMM_FLAGS - -DDISABLE_CC310=1 - -DCONFIG_GPIO_AS_PINRESET - -DNRF52833_XXAA - -DUSE_APP_CONFIG=1 - -Wno-unused-parameter - -Wno-expansion-to-defined -) -if(OT_CFLAGS MATCHES "-pedantic-errors") - string(REPLACE "-pedantic-errors" "" OT_CFLAGS "${OT_CFLAGS}") -endif() -list(APPEND OT_PLATFORM_DEFINES "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${OT_CONFIG}\"") - -add_library(openthread-nrf52833 - ${NRF_COMM_SOURCES} - ${NRF_SINGLEPHY_SOURCES} - $ -) - -add_library(openthread-nrf52833-transport - ${NRF_TRANSPORT_SOURCES} -) - -add_library(openthread-nrf52833-sdk - ${NRF_COMM_SOURCES} - ${NRF_SINGLEPHY_SOURCES} - $ -) - -add_library(openthread-nrf52833-softdevice-sdk - ${NRF_COMM_SOURCES} - ${NRF_SOFTDEVICE_SOURCES} - $ -) - -target_link_libraries(openthread-nrf52833 - PUBLIC - ${OT_MBEDTLS} - ${NRF52833_3RD_LIBS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - ot-config -) - -target_link_libraries(openthread-nrf52833-transport - PUBLIC - ${OT_MBEDTLS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - nordicsemi-nrf52833-sdk - ot-config -) - -target_link_libraries(openthread-nrf52833-sdk - PUBLIC - ${OT_MBEDTLS} - ${NRF52833_3RD_LIBS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - ot-config -) - -target_link_libraries(openthread-nrf52833-softdevice-sdk - PUBLIC - ${OT_MBEDTLS} - ${NRF52833_3RD_LIBS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - ot-config -) - -target_compile_definitions(openthread-nrf52833 - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_definitions(openthread-nrf52833-transport - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_definitions(openthread-nrf52833-sdk - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_definitions(openthread-nrf52833-softdevice-sdk - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_options(openthread-nrf52833 - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} -) - -target_compile_options(openthread-nrf52833-transport - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} -) - -target_compile_options(openthread-nrf52833-sdk - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} -) - -target_compile_options(openthread-nrf52833-softdevice-sdk - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} - -DSOFTDEVICE_PRESENT - -DS140 -) - -target_include_directories(openthread-nrf52833 - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52833 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) - -target_include_directories(openthread-nrf52833-transport - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52833 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) - -target_include_directories(openthread-nrf52833-sdk - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52833 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) - -target_include_directories(openthread-nrf52833-softdevice-sdk - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52833 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) diff --git a/examples/platforms/nrf528xx/nrf52833/nrf52833.ld b/examples/platforms/nrf528xx/nrf52833/nrf52833.ld deleted file mode 100644 index 5939881d5..000000000 --- a/examples/platforms/nrf528xx/nrf52833/nrf52833.ld +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVEpR CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * GCC linker script for nRF52833. - */ - -SEARCH_DIR(.) -GROUP(-lgcc -lc -lnosys) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000 - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000 -} - -OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") - -ENTRY(Reset_Handler) - -FLASH_PAGE_SIZE = 4096; -FLASH_DATA_PAGES_USED = 2; - -SECTIONS -{ - .text : - { - KEEP(*(.isr_vector)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - __etext = .; - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - PROVIDE(end = .); - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - __stop_ot_flash_data = (ORIGIN(FLASH) + LENGTH(FLASH)); - __start_ot_flash_data = (__stop_ot_flash_data - (FLASH_PAGE_SIZE * FLASH_DATA_PAGES_USED)); - - /* Assure that code does not overlap flash data area.*/ - ASSERT((__start_ot_flash_data >= __etext + SIZEOF(.data)), "Error: Code overlaps flash data area.") - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") -} diff --git a/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_ble.ld b/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_ble.ld deleted file mode 100644 index c826fe0f8..000000000 --- a/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_ble.ld +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * GCC linker script for nRF52833 with BLE bootloader. - */ - -SEARCH_DIR(.) -GROUP(-lgcc -lc -lnosys) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00026000, LENGTH = 0x52000 - RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x1fff8 -} - -OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") - -ENTRY(Reset_Handler) - -FLASH_PAGE_SIZE = 4096; -FLASH_DATA_PAGES_USED = 2; - -SECTIONS -{ - .text : - { - KEEP(*(.isr_vector)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - __etext = .; - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - PROVIDE(end = .); - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - __stop_ot_flash_data = (ORIGIN(FLASH) + LENGTH(FLASH)); - __start_ot_flash_data = (__stop_ot_flash_data - (FLASH_PAGE_SIZE * FLASH_DATA_PAGES_USED)); - - /* Assure that code does not overlap flash data area.*/ - ASSERT((__start_ot_flash_data >= __etext + SIZEOF(.data)), "Error: Code overlaps flash data area.") - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") -} diff --git a/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_uart.ld b/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_uart.ld deleted file mode 100644 index 3c955fb3d..000000000 --- a/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_uart.ld +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * GCC linker script for nRF52833 with UART bootloader. - */ - -SEARCH_DIR(.) -GROUP(-lgcc -lc -lnosys) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 0x77000 - RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x1fff8 -} - -OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") - -ENTRY(Reset_Handler) - -FLASH_PAGE_SIZE = 4096; -FLASH_DATA_PAGES_USED = 2; - -SECTIONS -{ - .text : - { - KEEP(*(.isr_vector)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - __etext = .; - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - PROVIDE(end = .); - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - __stop_ot_flash_data = (ORIGIN(FLASH) + LENGTH(FLASH)); - __start_ot_flash_data = (__stop_ot_flash_data - (FLASH_PAGE_SIZE * FLASH_DATA_PAGES_USED)); - - /* Assure that code does not overlap flash data area.*/ - ASSERT((__start_ot_flash_data >= __etext + SIZEOF(.data)), "Error: Code overlaps flash data area.") - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") -} diff --git a/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_usb.ld b/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_usb.ld deleted file mode 100644 index 3e60bcfa2..000000000 --- a/examples/platforms/nrf528xx/nrf52833/nrf52833_bootloader_usb.ld +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2018, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * GCC linker script for nRF52833 with USB bootloader. - */ - -SEARCH_DIR(.) -GROUP(-lgcc -lc -lnosys) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 0x5f000 - RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x1fff8 -} - -OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") - -ENTRY(Reset_Handler) - -FLASH_PAGE_SIZE = 4096; -FLASH_DATA_PAGES_USED = 2; - -SECTIONS -{ - .text : - { - KEEP(*(.isr_vector)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - __etext = .; - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - PROVIDE(end = .); - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - __stop_ot_flash_data = (ORIGIN(FLASH) + LENGTH(FLASH)); - __start_ot_flash_data = (__stop_ot_flash_data - (FLASH_PAGE_SIZE * FLASH_DATA_PAGES_USED)); - - /* Assure that code does not overlap flash data area.*/ - ASSERT((__start_ot_flash_data >= __etext + SIZEOF(.data)), "Error: Code overlaps flash data area.") - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") -} diff --git a/examples/platforms/nrf528xx/nrf52833/openthread-core-nrf52833-config-check.h b/examples/platforms/nrf528xx/nrf52833/openthread-core-nrf52833-config-check.h deleted file mode 100644 index 4151f0795..000000000 --- a/examples/platforms/nrf528xx/nrf52833/openthread-core-nrf52833-config-check.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef OPENTHREAD_CORE_NRF52833_CONFIG_CHECK_H_ -#define OPENTHREAD_CORE_NRF52833_CONFIG_CHECK_H_ - -#if OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT -#error "Platform nrf52833 doesn't support configuration option: OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT" -#endif - -#endif /* OPENTHREAD_CORE_NRF52833_CONFIG_CHECK_H_ */ diff --git a/examples/platforms/nrf528xx/nrf52833/openthread-core-nrf52833-config.h b/examples/platforms/nrf528xx/nrf52833/openthread-core-nrf52833-config.h deleted file mode 100644 index 759432c16..000000000 --- a/examples/platforms/nrf528xx/nrf52833/openthread-core-nrf52833-config.h +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes nrf52833 compile-time configuration constants - * for OpenThread. - */ - -#ifndef OPENTHREAD_CORE_NRF52833_CONFIG_H_ -#define OPENTHREAD_CORE_NRF52833_CONFIG_H_ - -/* - * The GNU Autoconf system defines a PACKAGE macro which is the name - * of the software package. This name collides with PACKAGE field in - * the nRF52 Factory Information Configuration Registers (FICR) - * structure. - */ -#undef PACKAGE - -/** - * @def OPENTHREAD_CONFIG_LOG_OUTPUT - * - * The nrf52833 platform provides an otPlatLog() function. - */ -#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT -#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED -#endif - -/** - * @def OPENTHREAD_CONFIG_PLATFORM_INFO - * - * The platform-specific string to insert into the OpenThread version string. - * - */ -#ifndef OPENTHREAD_CONFIG_PLATFORM_INFO -#define OPENTHREAD_CONFIG_PLATFORM_INFO "NRF52833" -#endif - -/** - * @def OPENTHREAD_CONFIG_STACK_VENDOR_OUI - * - * The Organizationally Unique Identifier for the vendor. - * - */ -#ifndef OPENTHREAD_CONFIG_STACK_VENDOR_OUI -#define OPENTHREAD_CONFIG_STACK_VENDOR_OUI 0xf4ce36 -#endif - -/** - * @def OPENTHREAD_CONFIG_MLE_MAX_CHILDREN - * - * The maximum number of children. - * - */ -#ifndef OPENTHREAD_CONFIG_MLE_MAX_CHILDREN -#define OPENTHREAD_CONFIG_MLE_MAX_CHILDREN 32 -#endif - -/** - * @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS - * - * The number of message buffers in the buffer pool. - * - */ -#ifndef OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS -#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 160 -#endif - -/** - * @def OPENTHREAD_CONFIG_MLE_IP_ADDRS_PER_CHILD - * - * The maximum number of supported IPv6 address registrations per child. - * - */ -#ifndef OPENTHREAD_CONFIG_MLE_IP_ADDRS_PER_CHILD -#define OPENTHREAD_CONFIG_MLE_IP_ADDRS_PER_CHILD 6 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS - * - * The maximum number of state-changed callback handlers (set using `otSetStateChangedCallback()`). - * - */ -#ifndef OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS -#define OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS 3 -#endif - -/** - * @def OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES - * - * The number of EID-to-RLOC cache entries. - * - */ -#ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES -#define OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES 32 -#endif - -/** - * @def OPENTHREAD_CONFIG_LOG_PREPREND_LEVEL - * - * Define to prepend the log level to all log messages - * - */ -#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL -#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE - * - * Define to 1 if you want to enable software ACK timeout logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE - * - * Define to 1 if you want to enable software retransmission logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE - * - * Define to 1 if you want to enable software CSMA-CA backoff logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE - * - * Define to 1 if you want to enable software transmission security logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE - * - * Define to 1 to enable software transmission target time logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE - * - * Define to 1 to enable software reception target time logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) -#endif - -/** - * @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE - * - * Define to 1 if you want to support microsecond timer in platform. - * - */ -#ifndef OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE -#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1 -#endif - -/** - * @def OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE - * - * Define to 1 to enable otPlatFlash* APIs to support non-volatile storage. - * - * When defined to 1, the platform MUST implement the otPlatFlash* APIs instead of the otPlatSettings* APIs. - * - */ -#ifndef OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE -#define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 1 -#endif - -/** - * @def OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE - * - * The size of heap buffer when DTLS is enabled. - * - */ -#ifndef OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE -#define OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE (4096 * sizeof(void *)) -#endif - -/** - * @def OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE_NO_DTLS - * - * The size of heap buffer when DTLS is disabled. - * - */ -#ifndef OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE_NO_DTLS -#define OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE_NO_DTLS 4000 -#endif - -/** - * @def OPENTHREAD_CONFIG_TIME_SYNC_ENABLE - * - * Define as 1 to enable the time synchronization service feature. - * - */ -#ifndef OPENTHREAD_CONFIG_TIME_SYNC_ENABLE -#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_CLI_TX_BUFFER_SIZE - * - * The size of CLI message buffer in bytes - * - */ -#ifndef OPENTHREAD_CONFIG_CLI_UART_TX_BUFFER_SIZE -#define OPENTHREAD_CONFIG_CLI_UART_TX_BUFFER_SIZE 2048 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT - * - * Define as 1 to support IEEE 802.15.4-2015 Header IE (Information Element) generation and parsing, it must be set - * to support following features: - * 1. Time synchronization service feature (i.e., OPENTHREAD_CONFIG_TIME_SYNC_ENABLE is set). - * - * @note If it's enabled, plaforms must support interrupt context and concurrent access AES. - * - */ -#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE -#define OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT 1 -#endif - -/** - * @def RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM - * - * The number of short source address table entries. - * - */ -#ifndef RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM -#define RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM 0 -#endif - -/** - * @def RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM - * - * The number of extended source address table entries. - * - */ -#ifndef RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM -#define RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD - * - * Reception scheduling and ramp up time needed for the CSL receiver to be ready, in units of microseconds. - * - */ -#ifndef OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD -#define OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD 2000 -#endif - -/** - * @def OPENTHREAD_CONFIG_CSL_MIN_RECEIVE_ON - * - * The minimum CSL receive window (in microseconds) required to receive an IEEE 802.15.4 frame. - * - Frame preamble: 6*2 symbols + margin - * - */ -#ifndef OPENTHREAD_CONFIG_CSL_MIN_RECEIVE_ON -#define OPENTHREAD_CONFIG_CSL_MIN_RECEIVE_ON 12 * 16 -#endif - -/* - * Suppress the ARMCC warning on unreachable statement, - * e.g. break after assert(false) or ExitNow() macro. - */ -#if defined(__CC_ARM) -_Pragma("diag_suppress=111") _Pragma("diag_suppress=128") -#endif - -#endif // OPENTHREAD_CORE_NRF52833_CONFIG_H_ diff --git a/examples/platforms/nrf528xx/nrf52833/platform-config.h b/examples/platforms/nrf528xx/nrf52833/platform-config.h deleted file mode 100644 index e4b829d7f..000000000 --- a/examples/platforms/nrf528xx/nrf52833/platform-config.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the platform-specific configuration. - * - */ - -#ifndef PLATFORM_CONFIG_H_ -#define PLATFORM_CONFIG_H_ - -#include "nrf.h" -#include "nrf_drv_clock.h" -#include "nrf_peripherals.h" -#include "hal/nrf_radio.h" - -#include "openthread-core-config.h" -#include - -/******************************************************************************* - * @section Alarm Driver Configuration. - ******************************************************************************/ - -/** - * @def RTC_INSTANCE - * - * RTC Instance. - * - */ -#ifndef RTC_INSTANCE -#define RTC_INSTANCE NRF_RTC2 -#endif - -/** - * @def RTC_IRQ_HANDLER - * - * RTC interrupt handler name - * - */ -#ifndef RTC_IRQ_HANDLER -#define RTC_IRQ_HANDLER RTC2_IRQHandler -#endif - -/** - * @def RTC_IRQN - * - * RTC Interrupt number. - * - */ -#ifndef RTC_IRQN -#define RTC_IRQN RTC2_IRQn -#endif - -/** - * @def RTC_IRQ_PRIORITY - * - * RTC Interrupt priority. - * - */ -#ifndef RTC_IRQ_PRIORITY -#define RTC_IRQ_PRIORITY 6 -#endif - -/******************************************************************************* - * @section Random Number Generator Driver Configuration. - ******************************************************************************/ - -/** - * @def RNG_BUFFER_SIZE - * - * True Random Number Generator buffer size. - * - */ -#ifndef RNG_BUFFER_SIZE -#define RNG_BUFFER_SIZE 128 -#endif - -/** - * @def RNG_IRQ_PRIORITY - * - * RNG Interrupt priority. - * - */ -#ifndef RNG_IRQ_PRIORITY -#define RNG_IRQ_PRIORITY 6 -#endif - -/******************************************************************************* - * @section Platform Flash Configuration - ******************************************************************************/ - -/** - * @def PLATFORM_FLASH_PAGE_NUM - * - * Number of flash pages to use for OpenThread's non-volatile settings. - * - * @note This define applies only for MDK-ARM Keil toolchain configuration. - * - */ -#ifndef PLATFORM_FLASH_PAGE_NUM -#define PLATFORM_FLASH_PAGE_NUM 2 -#endif - -/******************************************************************************* - * @section Platform FEM Configuration - ******************************************************************************/ - -/** - * @def PLATFORM_FEM_ENABLE_DEFAULT_CONFIG - * - * Enable default front end module configuration. - * - */ -#ifndef PLATFORM_FEM_ENABLE_DEFAULT_CONFIG -#define PLATFORM_FEM_ENABLE_DEFAULT_CONFIG 0 -#endif - -/******************************************************************************* - * @section Radio driver configuration. - ******************************************************************************/ - -/** - * @def NRF_802154_PENDING_SHORT_ADDRESSES - * - * Number of slots containing short addresses of nodes for which pending data is stored. - * - */ -#ifndef NRF_802154_PENDING_SHORT_ADDRESSES -#define NRF_802154_PENDING_SHORT_ADDRESSES OPENTHREAD_CONFIG_MLE_MAX_CHILDREN -#endif - -/** - * @def NRF_802154_PENDING_EXTENDED_ADDRESSES - * - * Number of slots containing extended addresses of nodes for which pending data is stored. - * - */ -#ifndef NRF_802154_PENDING_EXTENDED_ADDRESSES -#define NRF_802154_PENDING_EXTENDED_ADDRESSES OPENTHREAD_CONFIG_MLE_MAX_CHILDREN -#endif - -/** - * @def NRF_802154_CSMA_CA_ENABLED - * - * If CSMA-CA procedure should be enabled by the driver. Disabling CSMA-CA procedure improves - * driver performance. - * - */ -#ifndef NRF_802154_CSMA_CA_ENABLED -#define NRF_802154_CSMA_CA_ENABLED 1 -#endif - -/** - * @def NRF_802154_ACK_TIMEOUT_ENABLED - * - * If ACK timeout feature should be enabled in the driver. - * - */ -#ifndef NRF_802154_ACK_TIMEOUT_ENABLED -#define NRF_802154_ACK_TIMEOUT_ENABLED 1 -#endif - -/******************************************************************************* - * @section Temperature sensor driver configuration. - ******************************************************************************/ - -/** - * @def TEMP_MEASUREMENT_INTERVAL - * - * Interval of consecutive temperature measurements [s]. - * - */ -#ifndef TEMP_MEASUREMENT_INTERVAL -#define TEMP_MEASUREMENT_INTERVAL 30 -#endif - -/** - * @def NRF_802154_TX_STARTED_NOTIFY_ENABLED - * - * If notification of started transmission should be enabled in the driver. - * - * @note This feature must be enabled to support Header IE related features. - * - */ -#ifndef NRF_802154_TX_STARTED_NOTIFY_ENABLED -#define NRF_802154_TX_STARTED_NOTIFY_ENABLED 1 -#endif - -#endif // PLATFORM_CONFIG_H_ diff --git a/examples/platforms/nrf528xx/nrf52833/transport-config.h b/examples/platforms/nrf528xx/nrf52833/transport-config.h deleted file mode 100644 index d408302c4..000000000 --- a/examples/platforms/nrf528xx/nrf52833/transport-config.h +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2020, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the transport-specific configuration. - * - */ - -#ifndef TRANSPORT_CONFIG_H_ -#define TRANSPORT_CONFIG_H_ - -#include "nrf.h" -#include "hal/nrf_spis.h" -#include "hal/nrf_uart.h" - -/******************************************************************************* - * @section UART Driver Configuration. - ******************************************************************************/ - -/** - * @def UART_INSTANCE - * - * UART Instance. - * - */ -#ifndef UART_INSTANCE -#define UART_INSTANCE NRF_UARTE0 -#endif - -/** - * @def UART_PARITY - * - * UART Parity configuration. - * - * @brief Possible values: - * \ref NRF_UARTE_PARITY_EXCLUDED - Parity bit is not present. - * \ref NRF_UARTE_PARITY_INCLUDED - Parity bit is present. - * - */ -#ifndef UART_PARITY -#define UART_PARITY NRF_UARTE_PARITY_EXCLUDED -#endif - -/** - * @def UART_HWFC_ENABLED - * - * Enable UART Hardware Flow Control. - * - */ -#ifndef UART_HWFC_ENABLED -#define UART_HWFC_ENABLED 1 -#endif - -/** - * @def UART_BAUDRATE - * - * UART Baudrate. - * - * @brief Possible values: - * \ref NRF_UARTE_BAUDRATE_1200 - 1200 baud. - * \ref NRF_UARTE_BAUDRATE_2400 - 2400 baud. - * \ref NRF_UARTE_BAUDRATE_4800 - 4800 baud. - * \ref NRF_UARTE_BAUDRATE_9600 - 9600 baud. - * \ref NRF_UARTE_BAUDRATE_14400 - 14400 baud. - * \ref NRF_UARTE_BAUDRATE_19200 - 19200 baud. - * \ref NRF_UARTE_BAUDRATE_28800 - 28800 baud. - * \ref NRF_UARTE_BAUDRATE_38400 - 38400 baud. - * \ref NRF_UARTE_BAUDRATE_57600 - 57600 baud. - * \ref NRF_UARTE_BAUDRATE_76800 - 76800 baud. - * \ref NRF_UARTE_BAUDRATE_115200 - 115200 baud. - * \ref NRF_UARTE_BAUDRATE_230400 - 230400 baud. - * \ref NRF_UARTE_BAUDRATE_250000 - 250000 baud. - * \ref NRF_UARTE_BAUDRATE_460800 - 460800 baud. - * \ref NRF_UARTE_BAUDRATE_921600 - 921600 baud. - * \ref NRF_UARTE_BAUDRATE_1000000 - 1000000 baud. - * - */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE NRF_UARTE_BAUDRATE_115200 -#endif - -/** - * @def UART_IRQN - * - * UART Interrupt number. - * - */ -#ifndef UART_IRQN -#define UART_IRQN UARTE0_UART0_IRQn -#endif - -/** - * @def UART_IRQ_PRIORITY - * - * UART Interrupt priority. - * - */ -#ifndef UART_IRQ_PRIORITY -#define UART_IRQ_PRIORITY 6 -#endif - -/** - * @def UART_RX_BUFFER_SIZE - * - * UART Receive buffer size. - * - */ -#ifndef UART_RX_BUFFER_SIZE -#define UART_RX_BUFFER_SIZE 512 -#endif - -/** - * @def UART_PIN_TX - * - * UART TX Pin. - * - */ -#ifndef UART_PIN_TX -#define UART_PIN_TX 6 -#endif - -/** - * @def UART_PIN_RX - * - * UART RX Pin. - * - */ -#ifndef UART_PIN_RX -#define UART_PIN_RX 8 -#endif - -/** - * @def UART_PIN_CTS - * - * UART CTS Pin. - * - */ -#ifndef UART_PIN_CTS -#define UART_PIN_CTS 7 -#endif - -/** - * @def UART_PIN_RTS - * - * UART RTS Pin. - * - */ -#ifndef UART_PIN_RTS -#define UART_PIN_RTS 5 -#endif - -/******************************************************************************* - * @section SPI Slave configuration. - ******************************************************************************/ - -/** - * @def SPIS Instance. - */ -#ifndef SPIS_INSTANCE -#define SPIS_INSTANCE 0 -#endif - -/** - * @def SPIS mode. - * - * @brief Possible values: - * \ref NRF_SPIS_MODE_0 - SCK active high, sample on leading edge of clock. - * \ref NRF_SPIS_MODE_1 - SCK active high, sample on trailing edge of clock. - * \ref NRF_SPIS_MODE_2 - SCK active low, sample on leading edge of clock. - * \ref NRF_SPIS_MODE_3 - SCK active low, sample on trailing edge of clock. - */ -#ifndef SPIS_MODE -#define SPIS_MODE NRF_SPIS_MODE_0 -#endif - -/** - * @def SPIS bit orders. - * - * @brief Possible values: - * \ref NRF_SPIS_BIT_ORDER_MSB_FIRST - Most significant bit shifted out first. - * \ref NRF_SPIS_BIT_ORDER_LSB_FIRST - Least significant bit shifted out first. - */ -#ifndef SPIS_BIT_ORDER -#define SPIS_BIT_ORDER NRF_SPIS_BIT_ORDER_MSB_FIRST -#endif - -/** - * @def SPIS Interrupt priority. - */ -#ifndef SPIS_IRQ_PRIORITY -#define SPIS_IRQ_PRIORITY 6 -#endif - -/** - * @def SPIS MOSI Pin. - */ -#ifndef SPIS_PIN_MOSI -#define SPIS_PIN_MOSI 4 -#endif - -/** - * @def SPIS MISO Pin. - */ -#ifndef SPIS_PIN_MISO -#define SPIS_PIN_MISO 28 -#endif - -/** - * @def SPIS SCK Pin. - */ -#ifndef SPIS_PIN_SCK -#define SPIS_PIN_SCK 3 -#endif - -/** - * @def SPIS CSN Pin. - */ -#ifndef SPIS_PIN_CSN -#define SPIS_PIN_CSN 29 -#endif - -/** - * @def SPIS Host IRQ Pin. - */ -#ifndef SPIS_PIN_HOST_IRQ -#define SPIS_PIN_HOST_IRQ 30 -#endif - -/******************************************************************************* - * @section USB driver configuration. - ******************************************************************************/ - -/** - * @def USB_HOST_UART_CONFIG_DELAY_MS - * - * Delay after DTR gets asserted that we start send any queued data. This allows slow - * Linux-based hosts to have enough time to configure their port for raw mode. - * - */ -#ifndef USB_HOST_UART_CONFIG_DELAY_MS -#define USB_HOST_UART_CONFIG_DELAY_MS 10 -#endif - -/** - * @def USB_CDC_AS_SERIAL_TRANSPORT - * - * Use USB CDC driver for serial communication. - */ -#ifndef USB_CDC_AS_SERIAL_TRANSPORT -#define USB_CDC_AS_SERIAL_TRANSPORT 0 -#endif - -/** - * @def The USB interface to use for CDC ACM COMM. - * - * According to the USB Specification, interface numbers cannot have gaps. Tailor this value to adhere to this - * limitation. Takes values between 0-255. - */ -#ifndef USB_CDC_ACM_COMM_INTERFACE -#define USB_CDC_ACM_COMM_INTERFACE 1 -#endif - -/** - * @def The USB interface to use for CDC ACM DATA. - * - * According to the USB Specification, interface numbers cannot have gaps. Tailor this value to adhere to this - * limitation. Takes values between 0-255. - */ -#ifndef USB_CDC_ACM_DATA_INTERFACE -#define USB_CDC_ACM_DATA_INTERFACE 2 -#endif - -/** - * @def OPENTHREAD_PLATFORM_USE_PSEUDO_RESET - * - * Reset the application, not the chip, when a software reset is requested. - * via `otPlatReset()`. - */ -#ifndef OPENTHREAD_PLATFORM_USE_PSEUDO_RESET -#define OPENTHREAD_PLATFORM_USE_PSEUDO_RESET USB_CDC_AS_SERIAL_TRANSPORT -#endif - -#endif // TRANSPORT_CONFIG_H_ diff --git a/examples/platforms/nrf528xx/nrf52840/Makefile.am b/examples/platforms/nrf528xx/nrf52840/Makefile.am deleted file mode 100644 index 863775bdb..000000000 --- a/examples/platforms/nrf528xx/nrf52840/Makefile.am +++ /dev/null @@ -1,207 +0,0 @@ -# -# Copyright (c) 2016-2017, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -include $(abs_top_nlbuild_autotools_dir)/automake/pre.am - -lib_LIBRARIES = \ - libopenthread-nrf52840.a \ - libopenthread-nrf52840-sdk.a \ - libopenthread-nrf52840-softdevice-sdk.a \ - libopenthread-nrf52840-transport.a \ - $(NULL) - -# Do not enable -pedantic-errors for nRF52840 driver library -override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS)) -override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS)) - -# Do not enable -Wundef for nRF52840 driver library -override CFLAGS := $(filter-out -Wundef,$(CFLAGS)) -override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS)) - -# Do not enable -Wcast-align for nRF52840 driver library -override CFLAGS := $(filter-out -Wcast-align,$(CFLAGS)) -override CXXFLAGS := $(filter-out -Wcast-align,$(CXXFLAGS)) - -COMMONCPPFLAGS = \ - -DCONFIG_GPIO_AS_PINRESET \ - -DNRF52840_XXAA \ - -DUSE_APP_CONFIG=1 \ - -I$(srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/examples/platforms \ - -I$(top_srcdir)/examples/platforms/nrf528xx/src \ - -I$(top_srcdir)/examples/platforms/nrf528xx/src/transport \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/temperature \ - $(NULL) - -# Only reference the SDK header files included in third_party/NordicSemiconductor -# when building the example applications. -# -# When building just the platform libraries, the caller of configure is expected -# to provide the correct -I arguments to locate the necessary header files in an -# external copy of the Nordic nRF5 SDK. -# -# Note that an exception is made for the 802.15.4 radio driver, which is always -# built using the sources in third_party/NordicSemiconductor/drivers/radio. -if OPENTHREAD_ENABLE_EXAMPLES -COMMONCPPFLAGS += \ - -I$(top_srcdir)/third_party/NordicSemiconductor \ - -I$(top_srcdir)/third_party/NordicSemiconductor/cmsis \ - -I$(top_srcdir)/third_party/NordicSemiconductor/config \ - -I$(top_srcdir)/third_party/NordicSemiconductor/config/nrf52840/config \ - -I$(top_srcdir)/third_party/NordicSemiconductor/dependencies \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/clock \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/common \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/power \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/systick \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/usbd \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/app_error \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/atfifo \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/atomic \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/block_dev \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/delay \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/config \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/utf_converter \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/soc \ - -I$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers \ - -I$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf52 \ - $(NULL) -endif - -PLATFORM_COMMON_SOURCES = \ - src/alarm.c \ - src/diag.c \ - src/entropy.c \ - src/fem.c \ - src/flash.c \ - src/logging.c \ - src/misc.c \ - src/radio.c \ - src/system.c \ - src/temp.c \ - $(NULL) - -TRANSPORT_SOURCES = \ - src/transport/spi-slave.c \ - src/transport/uart.c \ - src/transport/usb-cdc-uart.c \ - src/transport/transport.c \ - $(NULL) - -SINGLEPHY_SOURCES = \ - src/flash_nosd.c \ - $(NULL) - -SOFTDEVICE_SOURCES = \ - src/flash_sd.c \ - src/softdevice.c \ - src/softdevice.h \ - $(NULL) - -SOFTDEVICE_CPPFLAGS = \ - -DSOFTDEVICE_PRESENT \ - -DS140 \ - -Wno-unused-parameter \ - $(NULL) - -PLATFORM_SOURCES = \ - $(PLATFORM_COMMON_SOURCES) \ - $(NULL) - -libopenthread_nrf52840_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(SINGLEPHY_CPPFLAGS) \ - -DPLATFORM_OPENTHREAD_VANILLA \ - $(NULL) - -libopenthread_nrf52840_a_SOURCES = \ - $(PLATFORM_SOURCES) \ - $(SINGLEPHY_SOURCES) \ - $(NULL) - -libopenthread_nrf52840_sdk_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(SINGLEPHY_CPPFLAGS) \ - $(NULL) - -libopenthread_nrf52840_sdk_a_SOURCES = \ - $(PLATFORM_SOURCES) \ - $(SINGLEPHY_SOURCES) \ - $(NULL) - -libopenthread_nrf52840_softdevice_sdk_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(SOFTDEVICE_CPPFLAGS) \ - $(NULL) - -libopenthread_nrf52840_softdevice_sdk_a_SOURCES = \ - $(PLATFORM_SOURCES) \ - $(SOFTDEVICE_SOURCES) \ - $(NULL) - -libopenthread_nrf52840_transport_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NULL) - -libopenthread_nrf52840_transport_a_SOURCES = \ - $(TRANSPORT_SOURCES) \ - $(NULL) - -Dash = - - -libopenthread_nrf52840_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") \ - $(shell find $(top_builddir)/third_party/jlink/SEGGER_RTT_V640/RTT $(Dash)type f $(Dash)name "*.o") - -libopenthread_nrf52840_sdk_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") - -libopenthread_nrf52840_softdevice_sdk_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") - -libopenthread_nrf52840_transport_a_LIBADD = \ - $(shell find $(top_builddir)/examples/platforms/utils $(Dash)type f $(Dash)name "*.o") - -include $(abs_top_nlbuild_autotools_dir)/automake/post.am diff --git a/examples/platforms/nrf528xx/nrf52840/Makefile.platform.am b/examples/platforms/nrf528xx/nrf52840/Makefile.platform.am deleted file mode 100644 index 7225db5ae..000000000 --- a/examples/platforms/nrf528xx/nrf52840/Makefile.platform.am +++ /dev/null @@ -1,61 +0,0 @@ -# -# Copyright (c) 2017, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -# -# nrf52840 platform-specific Makefile -# - -LDADD_COMMON += \ - $(top_builddir)/examples/platforms/nrf528xx/libopenthread-nrf52840.a \ - $(top_builddir)/examples/platforms/nrf528xx/libopenthread-nrf52840-transport.a \ - $(top_builddir)/third_party/NordicSemiconductor/libnordicsemi-nrf52840-sdk.a \ - $(top_builddir)/third_party/NordicSemiconductor/libnordicsemi-nrf52840-radio-driver.a \ - $(NULL) - -if !OPENTHREAD_ENABLE_BUILTIN_MBEDTLS -# !!!!Order of linking is important here!!!! -LDADD_COMMON += \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_shared.a \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_x509_vanilla.a \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_cc3xx.a \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/nrf_security/lib/libnrf_cc310_platform_0.9.4.a \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_oberon.a \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a \ - $(NULL) -endif - -if OPENTHREAD_ENABLE_CUSTOM_LINKER_FILE -LDFLAGS_COMMON += \ - -T $(OPENTHREAD_CUSTOM_LINKER_FILE) \ - $(NULL) -else -LDFLAGS_COMMON += \ - -T $(top_srcdir)/examples/platforms/nrf528xx/nrf52840/nrf52840.ld \ - $(NULL) -endif diff --git a/examples/platforms/nrf528xx/nrf52840/README.md b/examples/platforms/nrf528xx/nrf52840/README.md index 4b8c5c8da..0f151e6f2 100644 --- a/examples/platforms/nrf528xx/nrf52840/README.md +++ b/examples/platforms/nrf528xx/nrf52840/README.md @@ -1,571 +1 @@ -# OpenThread on nRF52840 Example - - -Thread Certified Component - - -This directory contains example platform drivers for [Nordic Semiconductor nRF52840 SoC][nrf52840]. The OpenThread stack has been officially certified as a _Thread Certified Component_ on this platform. - -[nrf52840]: https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52840 - -To facilitate Thread products development with the nRF52840 platform, Nordic Semiconductor provides nRF5 SDK for Thread and Zigbee. See [Nordic Semiconductor's nRF5 SDK for Thread and Zigbee][nrf5-sdk-section] section for more details. - -[nrf5-sdk-section]: #nordic-semiconductors-nrf5-sdk-for-thread-and-zigbee - -## Prerequisites - -Before you start building the examples, you must download and install the toolchain and the tools required for flashing and debugging. - -### Toolchain - -Download and install the [GNU toolchain for ARM Cortex-M][gnu-toolchain]. - -[gnu-toolchain]: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm - -To install the GNU toolchain and its dependencies, run the following commands in Bash: - -```bash -$ cd -$ ./script/bootstrap -``` - -### Flashing and debugging tools - -[nrf-command-line-tools]: https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Command-Line-Tools - -Install the [nRF Command Line Tools][nrf-command-line-tools] to flash, debug, and make use of logging features on the nRF52840 DK with SEGGER J-Link. - -## Building the examples - -To build the examples, run the following command in Bash: - -```bash -$ cd -$ ./bootstrap -$ make -f examples/Makefile-nrf52840 -``` - -After a successful build, the `elf` files can be found in `/output/nrf52840/bin`. You can convert them to hex using `arm-none-eabi-objcopy`: - -```bash -$ arm-none-eabi-objcopy -O ihex ot-cli-ftd ot-cli-ftd.hex -``` - -### USB CDC ACM support - -You can build the libraries with support for the native USB CDC ACM as a serial transport. To do so, build the firmware with the following parameter: - -``` -$ make -f examples/Makefile-nrf52840 USB=1 -``` - -Note that the USB CDC ACM serial transport is not supported with Engineering sample A of the nRF52840 chip. - -If you are using Windows 7 or earlier, you must load an additional USB CDC driver. The driver can be found in `third_party/NordicSemiconductor/libraries/usb/nordic_cdc_acm_example.inf`. - -### Bootloader support - -The examples support the following bootloaders for performing a Device Firmware Upgrade (DFU): - -- USB bootloader -- UART bootloader -- BLE bootloader - -The support for a particular bootloader can be enabled with the following switches: - -- USB: `BOOTLOADER=USB` -- UART: `BOOTLOADER=UART` -- BLE: `BOOTLOADER=BLE` - -### nRF52840 dongle support (PCA10059) - -You can build the libraries with support for the USB bootloader with USB DFU trigger support in PCA10059. As this dongle uses the native USB support, you must enable it as well. - -To build the libraries, run make with the following parameters: - -``` -$ make -f examples/Makefile-nrf52840 USB=1 BOOTLOADER=USB -``` - -See [nRF52840 Dongle Programming][nrf52840-dongle-programming] for more details about how to use the USB bootloader. - -[nrf52840-dongle-programming]: https://infocenter.nordicsemi.com/topic/ug_nc_programmer/UG/nrf_connect_programmer/ncp_programming_dongle.html - -### Native SPI support - -You can build the libraries with support for native SPI Slave. To build the libraries, run make with the following parameter: - -``` -$ make -f examples/Makefile-nrf52840 NCP_SPI=1 -``` - -With this option enabled, SPI communication between the NCP example and wpantund is possible (provided that the wpantund host supports SPI Master). To achieve that, an appropriate SPI device should be chosen in wpantund configuration file, `/etc/wpantund.conf`. You can find an example below. - -``` -Config:NCP:SocketPath "system:/usr/bin/spi-hdlc-adapter --gpio-int /sys/class/gpio/gpio25 /dev/spidev0.0" -``` - -In this example, [spi-hdlc-adapter][spi-hdlc-adapter] is a tool that you can use to communicate between NCP and wpantund over SPI. For this example, `spi-hdlc-adapter` is installed in `/usr/bin`. - -The default SPI Slave pin configuration for nRF52840 is defined in `examples/platforms/nrf52840/transport-config.h`. - -Note that the native SPI Slave support is not intended to be used with Engineering sample A of the nRF52840 chip due to single transfer size limitation. - -[spi-hdlc-adapter]: https://github.com/openthread/openthread/tree/master/tools/spi-hdlc-adapter - -### Optional prefix for compiler command - -You can prefix the compiler command using the CCPREFIX parameter. This speeds up the compilation when you use tools like [ccache][ccache-website]. Example usage: - -[ccache-website]: https://ccache.samba.org/ - -``` -$ make -f examples/Makefile-nrf52840 USB=1 CCPREFIX=ccache -``` - -### CryptoCell 310 support - -By default, OpenThread uses mbedTLS library with support for CryptoCell 310 hardware acceleration of cryptographic operations. When building the application, an explicit setup is needed (error checking omitted): - -``` -mbedtls_platform_set_calloc_free(calloc, free); -mbedtls_platform_setup(NULL); -``` - -When building an external application with OpenThread libraries and CryptoCell 310 hardware acceleration, use the following configuration: - -- Crypto libraries: - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_shared.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_x509_vanilla.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_cc3xx.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libnrf_cc310_platform_0.9.4.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_oberon.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a` -- Include directories: - - `third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_platform_config` - - `third_party/NordicSemiconductor/libraries/nrf_security/include` - - `third_party/NordicSemiconductor/libraries/nrf_security/config` - - `third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_platform/include` -- Defines: - - `MBEDTLS_CONFIG_FILE` set to `"nrf-config.h"` - - `MBEDTLS_USER_CONFIG_FILE` set to `"nrf52840-mbedtls-config.h"` - -### Optional disabling of CryptoCell 310 support - -By default, OpenThread uses mbedTLS library with support for CryptoCell 310 hardware acceleration of cryptographic operations. You can disable CryptoCell 310 and use software cryptography instead by building OpenThread with the following parameter: - -``` -$ make -f examples/Makefile-nrf52840 DISABLE_BUILTIN_MBEDTLS=0 ... -``` - -When building an external application with OpenThread libraries and software cryptography, use the following configuration: - -- Crypto libraries: - - `output/nrf52840/lib/libmbedcrypto.a` (present after successful build) -- Include directories: - - `third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_platform_config` - - `third_party/mbedtls` - - `third_party/mbedtls/repo/include` -- Defines: - - `MBEDTLS_CONFIG_FILE` set to `"mbedtls-config.h"` - - `MBEDTLS_USER_CONFIG_FILE` set to `"nrf52840-mbedtls-config.h"` - -### CryptoCell 310 abort mechanism - -The CryptoCell 310 platform implements an abort mechanism. By default, any fault in the CryptoCell 310 library results in the system reset. This behavior can be changed by a call to the `nrf_cc310_platform_set_abort()` function. This function must be called before `mbedtls_platform_setup`: - -``` -void nrf_cc310_platform_set_abort( - nrf_cc310_platform_abort_apis_t const * const apis) -``` - -### CryptoCell 310 RTOS support - -The hardware-accelerated mbedTLS library supports access from multiple threads. By default, simple blocking implementation of mutexes is used. The locking mechanism can be replaced by using the `nrf_cc310_platform_set_mutexes()` function. This function must be called before `mbedtls_platform_setup`: - -``` -void nrf_cc310_platform_set_mutexes(nrf_cc310_platform_mutex_apis_t const * const apis, - nrf_cc310_platform_mutexes_t const * const mutexes) -``` - -The sample implementation of mutexes for FreeRTOS and Zephyr operating systems can be found in `nrf_cc3xx_platform_mutex_freertos.c` and `nrf_cc3xx_platform_mutex_zephyr.c`. Both files implement the function `int nrf_cc310_platform_mutex_init(void)`. This function must be called before `mbedtls_platform_setup`. - -The sample implementation of the abort functionality for FreeRTOS and Zephyr operating systems can be found in `nrf_cc3xx_platform_abort_freertos.c` and `nrf_cc3xx_platform_abort_zephyr.c`. Both files implement the function `void nrf_cc310_platform_abort_init(void)`. This function must be called before `mbedtls_platform_setup`. - -The typical setup in the RTOS environment (error checking omitted) is as follows: - -``` -mbedtls_platform_set_calloc_free(calloc, free); -nrf_cc310_platform_abort_init(); -nrf_cc310_platform_mutex_init(); -mbedtls_platform_setup(NULL); -``` - -When building an external application that uses RTOS with OpenThread libraries and the CryptoCell 310 hardware acceleration, use the following configuration: - -- Crypto libraries: - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_shared.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_x509_vanilla.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_cc3xx.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libnrf_cc310_platform_0.9.4.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_oberon.a` - - `/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a` -- Include directories: - - `third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_platform_config` - - `third_party/NordicSemiconductor/libraries/nrf_security/include` - - `third_party/NordicSemiconductor/libraries/nrf_security/config` - - `third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_platform/include` -- Defines: - - `MBEDTLS_CONFIG_FILE` set to `"nrf-config.h"` - - `MBEDTLS_USER_CONFIG_FILE` set to `"nrf52840-mbedtls-config.h"` -- Sources: - - `nrf_cc3xx_platform_mutex_freertos.c` or `nrf_cc3xx_platform_mutex_zephyr.c` from `third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_platform/src`, depending on the RTOS used. - - `nrf_cc3xx_platform_abort_freertos.c` or `nrf_cc3xx_platform_abort_zephyr.c` from `third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_platform/src`, depending on the RTOS used. - -See [mbedTls Thread Safety and Multi Threading][mbedtls-thread-safety-and-multi-threading] for more details. - -### Optional software only mbedTLS threading support - -By default, the software-only mbedTLS library is built without support for multiple threads. You can enable this built-in support by building OpenThread with the following parameter: - -``` -$ make -f examples/Makefile-nrf52840 MBEDTLS_THREADING=1 -``` - -The simple mutex definition is used as shown below: - -``` -typedef void * mbedtls_threading_mutex_t; -``` - -However, you can modify it, by providing a path to a header file with proper definition. To do that, build OpenThread with the following parameter: - -``` -$ make -f examples/Makefile-nrf52840 MBEDTLS_THREADING=1 MBEDTLS_THREADING_MUTEX_DEF="path_to_a_header_file_with_mutex_definition.h" -``` - -When building an external application that uses RTOS with OpenThread libraries and software cryptography, use the following configuration: - -- Crypto libraries: - - `output/nrf52840/lib/libmbedcrypto.a` (present after successful build) -- Include directories: - - `third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_platform_config` - - `third_party/mbedtls` - - `third_party/mbedtls/repo/include` - - `third_party/NordicSemiconductor/libraries/nrf_security/include/software-only-threading` -- Defines: - - `MBEDTLS_CONFIG_FILE` set to `"mbedtls-config.h"` - - `MBEDTLS_USER_CONFIG_FILE` set to `"nrf52840-mbedtls-config.h"` - - `MBEDTLS_THREADING_C` - - `MBEDTLS_THREADING_ALT` - -See [mbedTls Thread Safety and Multi Threading][mbedtls-thread-safety-and-multi-threading] for more details. - -[mbedtls-thread-safety-and-multi-threading]: https://tls.mbed.org/kb/development/thread-safety-and-multi-threading - -### IEEE EUI-64 address - -When the Thread device is configured to obtain the Thread Network security credentials with either Thread Commissioning or an out-of-band method, the extended MAC address should be constructed out of the globally unique IEEE EUI-64. - -The IEEE EUI-64 address consists of two parts: - -- 24 bits of MA-L (MAC Address Block Large), formerly called OUI (Organizationally Unique Identifier) -- 40-bit device unique identifier - -By default, the device uses Nordic Semiconductor's MA-L (f4-ce-36). You can modify it by overwriting the `OPENTHREAD_CONFIG_STACK_VENDOR_OUI` define, located in the `openthread-core-nrf52840-config.h` file. This value must be publicly registered by the IEEE Registration Authority. - -You can also provide the full IEEE EUI-64 address by providing a custom `otPlatRadioGetIeeeEui64` function. To do this, define the flag `OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE`. - -After the Thread Network security credentials have been successfully obtained, the device uses randomly generated extended MAC address. - -## Flashing the binaries - -Flash the compiled binaries onto nRF52840 using `nrfjprog` which is part of the [nRF Command Line Tools][nrf-command-line-tools]. - -```bash -$ nrfjprog -f nrf52 --chiperase --program output/nrf52840/bin/ot-cli-ftd.hex --reset -``` - -## Running the example - -To test the example: - -1. Prepare two boards with the flashed `CLI Example` (as shown above). The CLI FTD example uses the direct UART connection. - -2. Open a terminal connection on two boards: - - a. Start a terminal emulator like screen. - - b. Connect to the used COM port with the following direct UART settings: - - - Baud rate: 115200 - - 8 data bits - - 1 stop bit - - No parity - - HW flow control: RTS/CTS This allows you to view the raw UART output. - - On Linux system a port name should be called e.g. `/dev/ttyACM0` or `/dev/ttyACM1`. - - c. Run the following command to connect to a board. - - ```shell - screen /dev/ttyACM0 115200 - ``` - - Now you are connected with the CLI. - -3. Use the following commands to form a network on the first board. - - ```bash - > dataset init new - Done - > dataset - Active Timestamp: 1 - Channel: 13 - Channel Mask: 0x07fff800 - Ext PAN ID: d63e8e3e495ebbc3 - Mesh Local Prefix: fd3d:b50b:f96d:722d::/64 - Master Key: dfd34f0f05cad978ec4e32b0413038ff - Network Name: OpenThread-8f28 - PAN ID: 0x8f28 - PSKc: c23a76e98f1a6483639b1ac1271e2e27 - Security Policy: 0, onrcb - Done - > dataset commit active - Done - > ifconfig up - Done - > thread start - Done - ``` - - After a couple of seconds the node will become a Leader of the network. - - ```bash - > state - leader - ``` - -4. Use the following commands to attach to the network on the second board. - - ```bash - > dataset masterkey dfd34f0f05cad978ec4e32b0413038ff - Done - > dataset commit active - Done - > ifconfig up - Done - > thread start - Done - ``` - - After a couple of seconds the second node will attach and become a Child. - - ```bash - > state - child - ``` - -5. List all IPv6 addresses of the first board. - - ```bash - > ipaddr - fd3d:b50b:f96d:722d:0:ff:fe00:fc00 - fd3d:b50b:f96d:722d:0:ff:fe00:c00 - fd3d:b50b:f96d:722d:7a73:bff6:9093:9117 - fe80:0:0:0:6c41:9001:f3d6:4148 - Done - ``` - -6. Choose one of them and send an ICMPv6 ping from the second board. - - ```bash - > ping fd3d:b50b:f96d:722d:7a73:bff6:9093:9117 - 16 bytes from fd3d:b50b:f96d:722d:558:f56b:d688:799: icmp_seq=1 hlim=64 time=24ms - ``` - -For a list of all available commands, visit [OpenThread CLI Reference README.md][cli]. - -[cli]: ./../../../src/cli/README.md - -## SEGGER J-Link tools - -SEGGER J-Link tools allow to debug and flash generated firmware using on-board debugger or external one. - -### Working with RTT logging - -By default, the OpenThread's logging module provides functions to output logging information over SEGGER's Real Time Transfer (RTT). - -You can set the desired log level by using the `OPENTHREAD_CONFIG_LOG_LEVEL` define. - -To enable the highest verbosity level, append `FULL_LOGS` flag to the `make` command: - -``` -$ make -f examples/Makefile-nrf52840 FULL_LOGS=1 -``` - -#### Enable logging on Windows - -1. Connect the DK to your machine with a USB cable. -2. Run `J-Link RTT Viewer`. The configuration window appears. -3. From the Specify Target Device dropdown menu, select `NRF52840_XXAA`. -4. From the Target Interface & Speed dropdown menu, select `SWD`. - -#### Enable logging on Linux - -1. Connect the DK to your machine with a USB cable. -2. Run `JLinkExe` to connect to the target. For example: - -``` -JLinkExe -device NRF52840_XXAA -if SWD -speed 4000 -autoconnect 1 -SelectEmuBySN -RTTTelnetPort 19021 -``` - -3. Run `JLinkRTTTelnet` to obtain the RTT logs from the connected device in a separate console. For example: - -``` -JLinkRTTClient -RTTTelnetPort 19021 -``` - -### Mass Storage Device known issue - -Depending on your version, due to a known issue in SEGGER's J-Link firmware, you might experience data corruption or data drops if you use the serial port. You can avoid this issue by disabling the Mass Storage Device. - -#### Disabling the Mass Storage Device on Windows - -1. Connect the DK to your machine with a USB cable. -2. Run `J-Link Commander`. The configuration window appears. -3. From the Specify Target Device dropdown menu, select `NRF52840_XXAA`. -4. From the Target Interface & Speed dropdown menu, select `SWD`. -5. Run the following command: - -``` -MSDDisable -``` - -6. Power cycle the DK. - -#### Disabling the Mass Storage Device on Linux - -1. Connect the DK to your machine with a USB cable. -2. Run `JLinkExe` to connect to the target. For example: - -``` -JLinkExe -device NRF52840_XXAA -if SWD -speed 4000 -autoconnect 1 -SelectEmuBySN -``` - -3. Run the following command: - -``` -MSDDisable -``` - -4. Power cycle the DK. - -### Hardware Flow Control detection - -By default, SEGGER J-Link automatically detects at runtime whether the target is using Hardware Flow Control (HWFC). - -The automatic HWFC detection is done by driving P0.07 (Clear to Send - CTS) from the interface MCU and evaluating the state of P0.05 (Request to Send - RTS) when the first data is sent or received. If the state of P0.05 (RTS) is high, it is assumed that HWFC is not used. - -To avoid potential race conditions, you can force HWFC and bypass the runtime auto-detection. - -#### Disabling the HWFC detection on Windows - -1. Connect the DK to your machine with a USB cable. -2. Run `J-Link Commander`. The configuration window appears. -3. From the Specify Target Device dropdown menu, select `NRF52840_XXAA`. -4. From the Target Interface & Speed dropdown menu, select `SWD`. -5. Run the following command: - -``` -SetHWFC Force -``` - -6. Power cycle the DK. - -#### Disabling the HWFC detection on Linux - -1. Connect the DK to your machine with a USB cable. -2. Run `JLinkExe` to connect to the target. For example: - -``` -JLinkExe -device NRF52840_XXAA -if SWD -speed 4000 -autoconnect 1 -SelectEmuBySN -``` - -3. Run the following command: - -``` -SetHWFC Force -``` - -4. Power cycle the DK. - -You can find more details [here][j-link-ob]. - -[j-link-ob]: https://wiki.segger.com/J-Link_OB_SAM3U_NordicSemi#Hardware_flow_control_support - -## Diagnostic module - -nRF52840 port extends [OpenThread Diagnostics Module][diag]. - -You can read about all the features [here][nrfdiag]. - -[diag]: ./../../../src/core/diags/README.md -[nrfdiag]: ./../DIAG.md - -## Radio driver documentation - -The radio driver comes with documentation that describes the operation of state machines in this module. To open the `*.uml` sequence diagrams, use [PlantUML][plantuml-url]. - -[plantuml-url]: http://plantuml.com/ - -## Verification - -The following development kits have been used for testing and verification: - -- PCA10056 1.0.0 -- PCA10059 1.0.0 -- PCA10068 0.5.0 - -The following toolchains have been used for testing and verification: - -- GCC: GCC ARM Embedded 7.2018 q2 update -- IAR: IAR Workbench 7.80.4 -- SES: SES 4.12 -- ARM: MDK-ARM version 5.25 - -The following OpenThread commits have been verified with nRF52840 and nRF52811 examples by Nordic Semiconductor: - -- `2279ef6` - 23.05.2019 (the latest checked) -- `23ff101` - 22.03.2019 -- `704511c` - 18.09.2018 -- `ec59d7e` - 06.04.2018 -- `a89eb88` - 16.11.2017 -- `6a15261` - 29.06.2017 -- `030efba` - 22.04.2017 -- `de48acf` - 02.03.2017 -- `50db58d` - 23.01.2017 - -# Nordic Semiconductor's nRF5 SDK for Thread and Zigbee - -Use [nRF5 Software Development Kit (SDK) for Thread and Zigbee][nrf5-sdk-thread-zigbee] when developing Thread products with Nordic Semiconductor's advanced nRF52840, nRF52833 or nRF52811 SoCs. - -The nRF5 SDK for Thread and Zigbee includes: - -- a pre-built OpenThread stack for the Nordic nRF52840 and nRF52811 SoCs, -- support for hardware-accelerated cryptographic operations using ARM® CryptoCell-310, -- unique Thread/Bluetooth Low Energy dynamic multiprotocol solution which allows for concurrent operation of Thread and Bluetooth Low Energy utilizing OpenThread and SoftDevice (Nordic’s Bluetooth Low Energy stack) with accompanying example applications, -- Thread/Bluetooth Low Energy switched multiprotocol solution with accompanying example applications, -- unique support for DFU-over-Thread (Device Firmware Upgrade), -- examples to demonstrate interactions between nodes performing different Thread roles with the use of OpenThread and CoAP, CoAP Secure or MQTT-SN protocols, -- support for OpenThread Network Co-Processor (NCP) and Radio Co-Processor (RCP) using UART, USB or SPI transport protocol, -- Border Router and cloud connectivity example (e.g. with Google Cloud Platform), -- Thread native commissioning with NFC example, -- example applications demonstrating the use of FreeRTOS with OpenThread, -- support for IAR, Keil MDK-ARM and SEGGER Embedded Studio (SES) IDEs for OpenThread stack and all example applications, -- range of PC tools including Thread Topology Monitor and nRF Sniffer for 802.15.4, -- software modules inherited from the nRF5 SDK e.g. peripheral drivers, NFC libraries, Bluetooth Low Energy libraries etc. - -[nrf5-sdk-thread-zigbee]: https://www.nordicsemi.com/Software-and-Tools/Software/nRF5-SDK-for-Thread-and-Zigbee +The OpenThread on nRF528xx example has moved to https://github.com/openthread/ot-nrf528xx diff --git a/examples/platforms/nrf528xx/nrf52840/arm-none-eabi.cmake b/examples/platforms/nrf528xx/nrf52840/arm-none-eabi.cmake deleted file mode 100644 index 3147abe0c..000000000 --- a/examples/platforms/nrf528xx/nrf52840/arm-none-eabi.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright (c) 2021, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -set(CMAKE_SYSTEM_NAME Generic) -set(CMAKE_SYSTEM_PROCESSOR ARM) - -set(CMAKE_C_COMPILER arm-none-eabi-gcc) -set(CMAKE_CXX_COMPILER arm-none-eabi-g++) -set(CMAKE_ASM_COMPILER arm-none-eabi-as) -set(CMAKE_RANLIB arm-none-eabi-ranlib) - -execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - -set(COMMON_C_FLAGS "-mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mthumb -mabi=aapcs -fdata-sections -ffunction-sections") - -if(COMPILER_VERSION VERSION_GREATER_EQUAL 7) - set(COMMON_C_FLAGS "${COMMON_C_FLAGS} -Wno-expansion-to-defined") -endif() - -set(CMAKE_C_FLAGS_INIT "${COMMON_C_FLAGS} -std=gnu99") -set(CMAKE_CXX_FLAGS_INIT "${COMMON_C_FLAGS} -fno-exceptions -fno-rtti") -set(CMAKE_ASM_FLAGS_INIT "${COMMON_C_FLAGS} -x assembler-with-cpp") -set(CMAKE_EXE_LINKER_FLAGS_INIT "${COMMON_C_FLAGS} -specs=nano.specs -specs=nosys.specs") - -set(CMAKE_C_FLAGS_DEBUG "-Og -g") -set(CMAKE_CXX_FLAGS_DEBUG "-Og -g") -set(CMAKE_ASM_FLAGS_DEBUG "-g") - -set(CMAKE_C_FLAGS_RELEASE "-Os") -set(CMAKE_CXX_FLAGS_RELEASE "-Os") -set(CMAKE_ASM_FLAGS_RELEASE "") diff --git a/examples/platforms/nrf528xx/nrf52840/nrf52840.cmake b/examples/platforms/nrf528xx/nrf52840/nrf52840.cmake deleted file mode 100644 index 037e53da6..000000000 --- a/examples/platforms/nrf528xx/nrf52840/nrf52840.cmake +++ /dev/null @@ -1,227 +0,0 @@ -# -# Copyright (c) 2021, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -set(OT_PLATFORM_LIB "openthread-nrf52840" "openthread-nrf52840-transport" PARENT_SCOPE) - -if(NOT OT_CONFIG) - set(OT_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}/nrf52840/openthread-core-nrf52840-config.h") - set(OT_CONFIG ${OT_CONFIG} PARENT_SCOPE) -endif() - -option(OT_BOOTLOADER "OT nrf bootloader type") -if(OT_BOOTLOADER STREQUAL "USB") - list(APPEND OT_PLATFORM_DEFINES "APP_USBD_NRF_DFU_TRIGGER_ENABLED=1") - set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/nrf52840/nrf52840_bootloader_usb.ld") -elseif(OT_BOOTLOADER STREQUAL "UART") - set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/nrf52840/nrf52840_bootloader_uart.ld") -elseif(OT_BOOTLOADER STREQUAL "BLE") - set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/nrf52840/nrf52840_bootloader_ble.ld") -else() - set(LD_FILE "${CMAKE_CURRENT_SOURCE_DIR}/nrf52840/nrf52840.ld") -endif() - -list(APPEND OT_PLATFORM_DEFINES - "OPENTHREAD_CORE_CONFIG_PLATFORM_CHECK_FILE=\"openthread-core-nrf52840-config-check.h\"" -) -if(NOT OT_EXTERNAL_MBEDTLS) - if(OT_MBEDTLS_THREADING) - list(APPEND OT_PLATFORM_DEFINES "MBEDTLS_THREADING_C") - list(APPEND OT_PLATFORM_DEFINES "MBEDTLS_THREADING_ALT") - list(APPEND OT_PUBLIC_INCLUDES - "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/nrf_security/include/software-only-threading" - ) - endif() -else() - list(APPEND OT_PLATFORM_DEFINES "MBEDTLS_CONFIG_FILE=\"nrf-config.h\"") - list(APPEND OT_PUBLIC_INCLUDES - "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/nrf_security/include" - "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/nrf_security/config" - "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include" - ) -endif() - -set(OT_PLATFORM_DEFINES ${OT_PLATFORM_DEFINES} PARENT_SCOPE) -target_compile_definitions(ot-config INTERFACE - "MBEDTLS_USER_CONFIG_FILE=\"nrf52840-mbedtls-config.h\"" -) -list(APPEND OT_PUBLIC_INCLUDES "${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config") -set(OT_PUBLIC_INCLUDES ${OT_PUBLIC_INCLUDES} PARENT_SCOPE) - -set(COMM_FLAGS - -DCONFIG_GPIO_AS_PINRESET - -DNRF52840_XXAA - -DUSE_APP_CONFIG=1 - -Wno-unused-parameter - -Wno-expansion-to-defined -) -if(OT_CFLAGS MATCHES "-pedantic-errors") - string(REPLACE "-pedantic-errors" "" OT_CFLAGS "${OT_CFLAGS}") -endif() -list(APPEND OT_PLATFORM_DEFINES "OPENTHREAD_PROJECT_CORE_CONFIG_FILE=\"${OT_CONFIG}\"") - -add_library(openthread-nrf52840 - ${NRF_COMM_SOURCES} - ${NRF_SINGLEPHY_SOURCES} - $ -) - -add_library(openthread-nrf52840-transport - ${NRF_TRANSPORT_SOURCES} -) - -add_library(openthread-nrf52840-sdk - ${NRF_COMM_SOURCES} - ${NRF_SINGLEPHY_SOURCES} - $ -) - -add_library(openthread-nrf52840-softdevice-sdk - ${NRF_COMM_SOURCES} - ${NRF_SOFTDEVICE_SOURCES} - $ -) - -target_link_libraries(openthread-nrf52840 - PUBLIC - ${OT_MBEDTLS} - ${NRF52840_3RD_LIBS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - ot-config -) - -target_link_libraries(openthread-nrf52840-transport - PUBLIC - ${OT_MBEDTLS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - nordicsemi-nrf52840-sdk - ot-config -) - -target_link_libraries(openthread-nrf52840-sdk - PUBLIC - ${OT_MBEDTLS} - ${NRF52840_3RD_LIBS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - ot-config -) - -target_link_libraries(openthread-nrf52840-softdevice-sdk - PUBLIC - ${OT_MBEDTLS} - ${NRF52840_3RD_LIBS} - -T${LD_FILE} - -Wl,--gc-sections - -Wl,-Map=$.map - PRIVATE - ot-config -) - -target_compile_definitions(openthread-nrf52840 - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_definitions(openthread-nrf52840-transport - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_definitions(openthread-nrf52840-sdk - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_definitions(openthread-nrf52840-softdevice-sdk - PUBLIC - ${OT_PLATFORM_DEFINES} -) - -target_compile_options(openthread-nrf52840 - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} - -DPLATFORM_OPENTHREAD_VANILLA -) - -target_compile_options(openthread-nrf52840-transport - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} - -DPLATFORM_OPENTHREAD_VANILLA -) - -target_compile_options(openthread-nrf52840-sdk - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} -) - -target_compile_options(openthread-nrf52840-softdevice-sdk - PRIVATE - ${OT_CFLAGS} - ${COMM_FLAGS} - -DSOFTDEVICE_PRESENT - -DS140 -) - -target_include_directories(openthread-nrf52840 - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52840 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) - -target_include_directories(openthread-nrf52840-transport - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52840 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) - -target_include_directories(openthread-nrf52840-sdk - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52840 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) - -target_include_directories(openthread-nrf52840-softdevice-sdk - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/nrf52840 - ${NRF_INCLUDES} - ${OT_PUBLIC_INCLUDES} -) diff --git a/examples/platforms/nrf528xx/nrf52840/nrf52840.ld b/examples/platforms/nrf528xx/nrf52840/nrf52840.ld deleted file mode 100644 index 7dc49f984..000000000 --- a/examples/platforms/nrf528xx/nrf52840/nrf52840.ld +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * GCC linker script for nRF52840. - */ - -SEARCH_DIR(.) -GROUP(-lgcc -lc -lnosys) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x100000 - RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x40000 -} - -OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") - -ENTRY(Reset_Handler) - -FLASH_PAGE_SIZE = 4096; -FLASH_DATA_PAGES_USED = 4; - -SECTIONS -{ - .text : - { - KEEP(*(.isr_vector)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - __etext = .; - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - PROVIDE(end = .); - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - __stop_ot_flash_data = (ORIGIN(FLASH) + LENGTH(FLASH)); - __start_ot_flash_data = (__stop_ot_flash_data - (FLASH_PAGE_SIZE * FLASH_DATA_PAGES_USED)); - - /* Assure that code does not overlap flash data area.*/ - ASSERT((__start_ot_flash_data >= __etext + SIZEOF(.data)), "Error: Code overlaps flash data area.") - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") -} diff --git a/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_ble.ld b/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_ble.ld deleted file mode 100644 index 9c9c324ec..000000000 --- a/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_ble.ld +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * GCC linker script for nRF52840 with BLE bootloader. - */ - -SEARCH_DIR(.) -GROUP(-lgcc -lc -lnosys) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00026000, LENGTH = 0xd2000 - RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x3fff8 -} - -OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") - -ENTRY(Reset_Handler) - -FLASH_PAGE_SIZE = 4096; -FLASH_DATA_PAGES_USED = 4; - -SECTIONS -{ - .text : - { - KEEP(*(.isr_vector)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - __etext = .; - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - PROVIDE(end = .); - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - __stop_ot_flash_data = (ORIGIN(FLASH) + LENGTH(FLASH)); - __start_ot_flash_data = (__stop_ot_flash_data - (FLASH_PAGE_SIZE * FLASH_DATA_PAGES_USED)); - - /* Assure that code does not overlap flash data area.*/ - ASSERT((__start_ot_flash_data >= __etext + SIZEOF(.data)), "Error: Code overlaps flash data area.") - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") -} diff --git a/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_uart.ld b/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_uart.ld deleted file mode 100644 index 8532a83f1..000000000 --- a/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_uart.ld +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * GCC linker script for nRF52840 with UART bootloader. - */ - -SEARCH_DIR(.) -GROUP(-lgcc -lc -lnosys) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 0xf7000 - RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x3fff8 -} - -OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") - -ENTRY(Reset_Handler) - -FLASH_PAGE_SIZE = 4096; -FLASH_DATA_PAGES_USED = 4; - -SECTIONS -{ - .text : - { - KEEP(*(.isr_vector)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - __etext = .; - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - PROVIDE(end = .); - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - __stop_ot_flash_data = (ORIGIN(FLASH) + LENGTH(FLASH)); - __start_ot_flash_data = (__stop_ot_flash_data - (FLASH_PAGE_SIZE * FLASH_DATA_PAGES_USED)); - - /* Assure that code does not overlap flash data area.*/ - ASSERT((__start_ot_flash_data >= __etext + SIZEOF(.data)), "Error: Code overlaps flash data area.") - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") -} diff --git a/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_usb.ld b/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_usb.ld deleted file mode 100644 index 3348a4fce..000000000 --- a/examples/platforms/nrf528xx/nrf52840/nrf52840_bootloader_usb.ld +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * GCC linker script for nRF52840 with USB bootloader. - */ - -SEARCH_DIR(.) -GROUP(-lgcc -lc -lnosys) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00001000, LENGTH = 0xdf000 - RAM (rwx) : ORIGIN = 0x20000008, LENGTH = 0x3fff8 -} - -OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") - -ENTRY(Reset_Handler) - -FLASH_PAGE_SIZE = 4096; -FLASH_DATA_PAGES_USED = 4; - -SECTIONS -{ - .text : - { - KEEP(*(.isr_vector)) - *(.text*) - - KEEP(*(.init)) - KEEP(*(.fini)) - - /* .ctors */ - *crtbegin.o(.ctors) - *crtbegin?.o(.ctors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) - *(SORT(.ctors.*)) - *(.ctors) - - /* .dtors */ - *crtbegin.o(.dtors) - *crtbegin?.o(.dtors) - *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) - *(SORT(.dtors.*)) - *(.dtors) - - *(.rodata*) - - KEEP(*(.eh_frame*)) - } > FLASH - - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } > FLASH - - __exidx_start = .; - .ARM.exidx : - { - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - } > FLASH - __exidx_end = .; - - __etext = .; - - .data : AT (__etext) - { - __data_start__ = .; - *(vtable) - *(.data*) - - . = ALIGN(4); - /* preinit data */ - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP(*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); - - . = ALIGN(4); - /* init data */ - PROVIDE_HIDDEN (__init_array_start = .); - KEEP(*(SORT(.init_array.*))) - KEEP(*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); - - - . = ALIGN(4); - /* finit data */ - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP(*(SORT(.fini_array.*))) - KEEP(*(.fini_array)) - PROVIDE_HIDDEN (__fini_array_end = .); - - KEEP(*(.jcr*)) - . = ALIGN(4); - /* All data end */ - __data_end__ = .; - - } > RAM - - .bss : - { - . = ALIGN(4); - __bss_start__ = .; - *(.bss*) - *(COMMON) - . = ALIGN(4); - __bss_end__ = .; - } > RAM - - .heap (COPY): - { - __HeapBase = .; - __end__ = .; - PROVIDE(end = .); - KEEP(*(.heap*)) - __HeapLimit = .; - } > RAM - - /* .stack_dummy section doesn't contains any symbols. It is only - * used for linker to calculate size of stack sections, and assign - * values to stack symbols later */ - .stack_dummy (COPY): - { - KEEP(*(.stack*)) - } > RAM - - __stop_ot_flash_data = (ORIGIN(FLASH) + LENGTH(FLASH)); - __start_ot_flash_data = (__stop_ot_flash_data - (FLASH_PAGE_SIZE * FLASH_DATA_PAGES_USED)); - - /* Assure that code does not overlap flash data area.*/ - ASSERT((__start_ot_flash_data >= __etext + SIZEOF(.data)), "Error: Code overlaps flash data area.") - - /* Set stack top to end of RAM, and stack limit move down by - * size of stack_dummy section */ - __StackTop = ORIGIN(RAM) + LENGTH(RAM); - __StackLimit = __StackTop - SIZEOF(.stack_dummy); - PROVIDE(__stack = __StackTop); - - /* Check if data + heap + stack exceeds RAM limit */ - ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") -} diff --git a/examples/platforms/nrf528xx/nrf52840/openthread-core-nrf52840-config-check.h b/examples/platforms/nrf528xx/nrf52840/openthread-core-nrf52840-config-check.h deleted file mode 100644 index bdeb78210..000000000 --- a/examples/platforms/nrf528xx/nrf52840/openthread-core-nrf52840-config-check.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef OPENTHREAD_CORE_NRF52840_CONFIG_CHECK_H_ -#define OPENTHREAD_CORE_NRF52840_CONFIG_CHECK_H_ - -#if OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT -#error "Platform nrf52840 doesn't support configuration option: OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT" -#endif - -#endif /* OPENTHREAD_CORE_NRF52840_CONFIG_CHECK_H_ */ diff --git a/examples/platforms/nrf528xx/nrf52840/openthread-core-nrf52840-config.h b/examples/platforms/nrf528xx/nrf52840/openthread-core-nrf52840-config.h deleted file mode 100644 index d2a47086c..000000000 --- a/examples/platforms/nrf528xx/nrf52840/openthread-core-nrf52840-config.h +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes nrf52840 compile-time configuration constants - * for OpenThread. - */ - -#ifndef OPENTHREAD_CORE_NRF52840_CONFIG_H_ -#define OPENTHREAD_CORE_NRF52840_CONFIG_H_ - -/* - * The GNU Autoconf system defines a PACKAGE macro which is the name - * of the software package. This name collides with PACKAGE field in - * the nRF52 Factory Information Configuration Registers (FICR) - * structure. - */ -#undef PACKAGE - -/** - * @def OPENTHREAD_CONFIG_LOG_OUTPUT - * - * The nrf52840 platform provides an otPlatLog() function. - */ -#ifndef OPENTHREAD_CONFIG_LOG_OUTPUT -#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED -#endif - -/** - * @def OPENTHREAD_CONFIG_PLATFORM_INFO - * - * The platform-specific string to insert into the OpenThread version string. - * - */ -#ifndef OPENTHREAD_CONFIG_PLATFORM_INFO -#define OPENTHREAD_CONFIG_PLATFORM_INFO "NRF52840" -#endif - -/** - * @def OPENTHREAD_CONFIG_STACK_VENDOR_OUI - * - * The Organizationally Unique Identifier for the vendor. - * - */ -#ifndef OPENTHREAD_CONFIG_STACK_VENDOR_OUI -#define OPENTHREAD_CONFIG_STACK_VENDOR_OUI 0xf4ce36 -#endif - -/** - * @def OPENTHREAD_CONFIG_MLE_MAX_CHILDREN - * - * The maximum number of children. - * - */ -#ifndef OPENTHREAD_CONFIG_MLE_MAX_CHILDREN -#define OPENTHREAD_CONFIG_MLE_MAX_CHILDREN 32 -#endif - -/** - * @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS - * - * The number of message buffers in the buffer pool. - * - */ -#ifndef OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS -#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 160 -#endif - -/** - * @def OPENTHREAD_CONFIG_MLE_IP_ADDRS_PER_CHILD - * - * The maximum number of supported IPv6 address registrations per child. - * - */ -#ifndef OPENTHREAD_CONFIG_MLE_IP_ADDRS_PER_CHILD -#define OPENTHREAD_CONFIG_MLE_IP_ADDRS_PER_CHILD 6 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS - * - * The maximum number of state-changed callback handlers (set using `otSetStateChangedCallback()`). - * - */ -#ifndef OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS -#define OPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS 3 -#endif - -/** - * @def OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES - * - * The number of EID-to-RLOC cache entries. - * - */ -#ifndef OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES -#define OPENTHREAD_CONFIG_TMF_ADDRESS_CACHE_ENTRIES 32 -#endif - -/** - * @def OPENTHREAD_CONFIG_LOG_PREPREND_LEVEL - * - * Define to prepend the log level to all log messages - * - */ -#ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL -#define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE - * - * Define to 1 if you want to enable software ACK timeout logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_ACK_TIMEOUT_ENABLE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE - * - * Define to 1 if you want to enable software retransmission logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETRANSMIT_ENABLE 1 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE - * - * Define to 1 if you want to enable software CSMA-CA backoff logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_CSMA_BACKOFF_ENABLE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE - * - * Define to 1 if you want to enable software transmission security logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_SECURITY_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE - * - * Define to 1 to enable software transmission target time logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE - * - * Define to 1 to enable software reception target time logic. - * - */ -#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE -#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RX_TIMING_ENABLE (OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2) -#endif - -/** - * @def OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE - * - * Define to 1 if you want to support microsecond timer in platform. - * - */ -#ifndef OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE -#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1 -#endif - -/** - * @def OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE - * - * Define to 1 to enable otPlatFlash* APIs to support non-volatile storage. - * - * When defined to 1, the platform MUST implement the otPlatFlash* APIs instead of the otPlatSettings* APIs. - * - */ -#ifndef OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE -#define OPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE 1 -#endif - -/** - * @def OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE - * - * The size of heap buffer when DTLS is enabled. - * - */ -#ifndef OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE -#define OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE (4096 * sizeof(void *)) -#endif - -/** - * @def OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE_NO_DTLS - * - * The size of heap buffer when DTLS is disabled. - * - */ -#ifndef OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE_NO_DTLS -#define OPENTHREAD_CONFIG_HEAP_INTERNAL_SIZE_NO_DTLS 4000 -#endif - -/** - * @def OPENTHREAD_CONFIG_TIME_SYNC_ENABLE - * - * Define as 1 to enable the time synchronization service feature. - * - */ -#ifndef OPENTHREAD_CONFIG_TIME_SYNC_ENABLE -#define OPENTHREAD_CONFIG_TIME_SYNC_ENABLE 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_CLI_TX_BUFFER_SIZE - * - * The size of CLI message buffer in bytes - * - */ -#ifndef OPENTHREAD_CONFIG_CLI_UART_TX_BUFFER_SIZE -#define OPENTHREAD_CONFIG_CLI_UART_TX_BUFFER_SIZE 2048 -#endif - -/** - * @def OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT - * - * Define as 1 to support IEEE 802.15.4-2015 Header IE (Information Element) generation and parsing, it must be set - * to support following features: - * 1. Time synchronization service feature (i.e., OPENTHREAD_CONFIG_TIME_SYNC_ENABLE is set). - * - * @note If it's enabled, plaforms must support interrupt context and concurrent access AES. - * - */ -#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE -#define OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT 1 -#endif - -/** - * @def RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM - * - * The number of short source address table entries. - * - */ -#ifndef RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM -#define RADIO_CONFIG_SRC_MATCH_SHORT_ENTRY_NUM 0 -#endif - -/** - * @def RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM - * - * The number of extended source address table entries. - * - */ -#ifndef RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM -#define RADIO_CONFIG_SRC_MATCH_EXT_ENTRY_NUM 0 -#endif - -/** - * @def OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD - * - * Reception scheduling and ramp up time needed for the CSL receiver to be ready, in units of microseconds. - * - */ -#ifndef OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD -#define OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD 2000 -#endif - -/** - * @def OPENTHREAD_CONFIG_CSL_MIN_RECEIVE_ON - * - * The minimum CSL receive window (in microseconds) required to receive an IEEE 802.15.4 frame. - * - Frame preamble: 6*2 symbols + margin - * - */ -#ifndef OPENTHREAD_CONFIG_CSL_MIN_RECEIVE_ON -#define OPENTHREAD_CONFIG_CSL_MIN_RECEIVE_ON 12 * 16 -#endif - -/* - * Suppress the ARMCC warning on unreachable statement, - * e.g. break after assert(false) or ExitNow() macro. - */ -#if defined(__CC_ARM) -_Pragma("diag_suppress=111") _Pragma("diag_suppress=128") -#endif - -#endif // OPENTHREAD_CORE_NRF52840_CONFIG_H_ diff --git a/examples/platforms/nrf528xx/nrf52840/platform-config.h b/examples/platforms/nrf528xx/nrf52840/platform-config.h deleted file mode 100644 index fba961620..000000000 --- a/examples/platforms/nrf528xx/nrf52840/platform-config.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the platform-specific configuration. - * - */ - -#ifndef PLATFORM_CONFIG_H_ -#define PLATFORM_CONFIG_H_ - -#include "nrf.h" -#include "nrf_drv_clock.h" -#include "nrf_peripherals.h" -#include "hal/nrf_radio.h" - -#include "openthread-core-config.h" -#include - -/******************************************************************************* - * @section Alarm Driver Configuration. - ******************************************************************************/ - -/** - * @def RTC_INSTANCE - * - * RTC Instance. - * - */ -#ifndef RTC_INSTANCE -#define RTC_INSTANCE NRF_RTC2 -#endif - -/** - * @def RTC_IRQ_HANDLER - * - * RTC interrupt handler name - * - */ -#ifndef RTC_IRQ_HANDLER -#define RTC_IRQ_HANDLER RTC2_IRQHandler -#endif - -/** - * @def RTC_IRQN - * - * RTC Interrupt number. - * - */ -#ifndef RTC_IRQN -#define RTC_IRQN RTC2_IRQn -#endif - -/** - * @def RTC_IRQ_PRIORITY - * - * RTC Interrupt priority. - * - */ -#ifndef RTC_IRQ_PRIORITY -#define RTC_IRQ_PRIORITY 6 -#endif - -/******************************************************************************* - * @section Random Number Generator Driver Configuration. - ******************************************************************************/ - -/** - * @def RNG_BUFFER_SIZE - * - * True Random Number Generator buffer size. - * - */ -#ifndef RNG_BUFFER_SIZE -#define RNG_BUFFER_SIZE 128 -#endif - -/** - * @def RNG_IRQ_PRIORITY - * - * RNG Interrupt priority. - * - */ -#ifndef RNG_IRQ_PRIORITY -#define RNG_IRQ_PRIORITY 6 -#endif - -/******************************************************************************* - * @section Platform Flash Configuration - ******************************************************************************/ - -/** - * @def PLATFORM_FLASH_PAGE_NUM - * - * Number of flash pages to use for OpenThread's non-volatile settings. - * - * @note This define applies only for MDK-ARM Keil toolchain configuration. - * - */ -#ifndef PLATFORM_FLASH_PAGE_NUM -#define PLATFORM_FLASH_PAGE_NUM 4 -#endif - -/******************************************************************************* - * @section Platform FEM Configuration - ******************************************************************************/ - -/** - * @def PLATFORM_FEM_ENABLE_DEFAULT_CONFIG - * - * Enable default front end module configuration. - * - */ -#ifndef PLATFORM_FEM_ENABLE_DEFAULT_CONFIG -#define PLATFORM_FEM_ENABLE_DEFAULT_CONFIG 0 -#endif - -/******************************************************************************* - * @section Radio driver configuration. - ******************************************************************************/ - -/** - * @def NRF_802154_PENDING_SHORT_ADDRESSES - * - * Number of slots containing short addresses of nodes for which pending data is stored. - * - */ -#ifndef NRF_802154_PENDING_SHORT_ADDRESSES -#define NRF_802154_PENDING_SHORT_ADDRESSES OPENTHREAD_CONFIG_MLE_MAX_CHILDREN -#endif - -/** - * @def NRF_802154_PENDING_EXTENDED_ADDRESSES - * - * Number of slots containing extended addresses of nodes for which pending data is stored. - * - */ -#ifndef NRF_802154_PENDING_EXTENDED_ADDRESSES -#define NRF_802154_PENDING_EXTENDED_ADDRESSES OPENTHREAD_CONFIG_MLE_MAX_CHILDREN -#endif - -/** - * @def NRF_802154_CSMA_CA_ENABLED - * - * If CSMA-CA procedure should be enabled by the driver. Disabling CSMA-CA procedure improves - * driver performance. - * - */ -#ifndef NRF_802154_CSMA_CA_ENABLED -#define NRF_802154_CSMA_CA_ENABLED 1 -#endif - -/** - * @def NRF_802154_ACK_TIMEOUT_ENABLED - * - * If ACK timeout feature should be enabled in the driver. - * - */ -#ifndef NRF_802154_ACK_TIMEOUT_ENABLED -#define NRF_802154_ACK_TIMEOUT_ENABLED 1 -#endif - -/******************************************************************************* - * @section Temperature sensor driver configuration. - ******************************************************************************/ - -/** - * @def TEMP_MEASUREMENT_INTERVAL - * - * Interval of consecutive temperature measurements [s]. - * - */ -#ifndef TEMP_MEASUREMENT_INTERVAL -#define TEMP_MEASUREMENT_INTERVAL 30 -#endif - -/** - * @def NRF_802154_TX_STARTED_NOTIFY_ENABLED - * - * If notification of started transmission should be enabled in the driver. - * - * @note This feature must be enabled to support Header IE related features. - * - */ -#ifndef NRF_802154_TX_STARTED_NOTIFY_ENABLED -#define NRF_802154_TX_STARTED_NOTIFY_ENABLED 1 -#endif - -#endif // PLATFORM_CONFIG_H_ diff --git a/examples/platforms/nrf528xx/nrf52840/transport-config.h b/examples/platforms/nrf528xx/nrf52840/transport-config.h deleted file mode 100644 index d408302c4..000000000 --- a/examples/platforms/nrf528xx/nrf52840/transport-config.h +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2020, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the transport-specific configuration. - * - */ - -#ifndef TRANSPORT_CONFIG_H_ -#define TRANSPORT_CONFIG_H_ - -#include "nrf.h" -#include "hal/nrf_spis.h" -#include "hal/nrf_uart.h" - -/******************************************************************************* - * @section UART Driver Configuration. - ******************************************************************************/ - -/** - * @def UART_INSTANCE - * - * UART Instance. - * - */ -#ifndef UART_INSTANCE -#define UART_INSTANCE NRF_UARTE0 -#endif - -/** - * @def UART_PARITY - * - * UART Parity configuration. - * - * @brief Possible values: - * \ref NRF_UARTE_PARITY_EXCLUDED - Parity bit is not present. - * \ref NRF_UARTE_PARITY_INCLUDED - Parity bit is present. - * - */ -#ifndef UART_PARITY -#define UART_PARITY NRF_UARTE_PARITY_EXCLUDED -#endif - -/** - * @def UART_HWFC_ENABLED - * - * Enable UART Hardware Flow Control. - * - */ -#ifndef UART_HWFC_ENABLED -#define UART_HWFC_ENABLED 1 -#endif - -/** - * @def UART_BAUDRATE - * - * UART Baudrate. - * - * @brief Possible values: - * \ref NRF_UARTE_BAUDRATE_1200 - 1200 baud. - * \ref NRF_UARTE_BAUDRATE_2400 - 2400 baud. - * \ref NRF_UARTE_BAUDRATE_4800 - 4800 baud. - * \ref NRF_UARTE_BAUDRATE_9600 - 9600 baud. - * \ref NRF_UARTE_BAUDRATE_14400 - 14400 baud. - * \ref NRF_UARTE_BAUDRATE_19200 - 19200 baud. - * \ref NRF_UARTE_BAUDRATE_28800 - 28800 baud. - * \ref NRF_UARTE_BAUDRATE_38400 - 38400 baud. - * \ref NRF_UARTE_BAUDRATE_57600 - 57600 baud. - * \ref NRF_UARTE_BAUDRATE_76800 - 76800 baud. - * \ref NRF_UARTE_BAUDRATE_115200 - 115200 baud. - * \ref NRF_UARTE_BAUDRATE_230400 - 230400 baud. - * \ref NRF_UARTE_BAUDRATE_250000 - 250000 baud. - * \ref NRF_UARTE_BAUDRATE_460800 - 460800 baud. - * \ref NRF_UARTE_BAUDRATE_921600 - 921600 baud. - * \ref NRF_UARTE_BAUDRATE_1000000 - 1000000 baud. - * - */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE NRF_UARTE_BAUDRATE_115200 -#endif - -/** - * @def UART_IRQN - * - * UART Interrupt number. - * - */ -#ifndef UART_IRQN -#define UART_IRQN UARTE0_UART0_IRQn -#endif - -/** - * @def UART_IRQ_PRIORITY - * - * UART Interrupt priority. - * - */ -#ifndef UART_IRQ_PRIORITY -#define UART_IRQ_PRIORITY 6 -#endif - -/** - * @def UART_RX_BUFFER_SIZE - * - * UART Receive buffer size. - * - */ -#ifndef UART_RX_BUFFER_SIZE -#define UART_RX_BUFFER_SIZE 512 -#endif - -/** - * @def UART_PIN_TX - * - * UART TX Pin. - * - */ -#ifndef UART_PIN_TX -#define UART_PIN_TX 6 -#endif - -/** - * @def UART_PIN_RX - * - * UART RX Pin. - * - */ -#ifndef UART_PIN_RX -#define UART_PIN_RX 8 -#endif - -/** - * @def UART_PIN_CTS - * - * UART CTS Pin. - * - */ -#ifndef UART_PIN_CTS -#define UART_PIN_CTS 7 -#endif - -/** - * @def UART_PIN_RTS - * - * UART RTS Pin. - * - */ -#ifndef UART_PIN_RTS -#define UART_PIN_RTS 5 -#endif - -/******************************************************************************* - * @section SPI Slave configuration. - ******************************************************************************/ - -/** - * @def SPIS Instance. - */ -#ifndef SPIS_INSTANCE -#define SPIS_INSTANCE 0 -#endif - -/** - * @def SPIS mode. - * - * @brief Possible values: - * \ref NRF_SPIS_MODE_0 - SCK active high, sample on leading edge of clock. - * \ref NRF_SPIS_MODE_1 - SCK active high, sample on trailing edge of clock. - * \ref NRF_SPIS_MODE_2 - SCK active low, sample on leading edge of clock. - * \ref NRF_SPIS_MODE_3 - SCK active low, sample on trailing edge of clock. - */ -#ifndef SPIS_MODE -#define SPIS_MODE NRF_SPIS_MODE_0 -#endif - -/** - * @def SPIS bit orders. - * - * @brief Possible values: - * \ref NRF_SPIS_BIT_ORDER_MSB_FIRST - Most significant bit shifted out first. - * \ref NRF_SPIS_BIT_ORDER_LSB_FIRST - Least significant bit shifted out first. - */ -#ifndef SPIS_BIT_ORDER -#define SPIS_BIT_ORDER NRF_SPIS_BIT_ORDER_MSB_FIRST -#endif - -/** - * @def SPIS Interrupt priority. - */ -#ifndef SPIS_IRQ_PRIORITY -#define SPIS_IRQ_PRIORITY 6 -#endif - -/** - * @def SPIS MOSI Pin. - */ -#ifndef SPIS_PIN_MOSI -#define SPIS_PIN_MOSI 4 -#endif - -/** - * @def SPIS MISO Pin. - */ -#ifndef SPIS_PIN_MISO -#define SPIS_PIN_MISO 28 -#endif - -/** - * @def SPIS SCK Pin. - */ -#ifndef SPIS_PIN_SCK -#define SPIS_PIN_SCK 3 -#endif - -/** - * @def SPIS CSN Pin. - */ -#ifndef SPIS_PIN_CSN -#define SPIS_PIN_CSN 29 -#endif - -/** - * @def SPIS Host IRQ Pin. - */ -#ifndef SPIS_PIN_HOST_IRQ -#define SPIS_PIN_HOST_IRQ 30 -#endif - -/******************************************************************************* - * @section USB driver configuration. - ******************************************************************************/ - -/** - * @def USB_HOST_UART_CONFIG_DELAY_MS - * - * Delay after DTR gets asserted that we start send any queued data. This allows slow - * Linux-based hosts to have enough time to configure their port for raw mode. - * - */ -#ifndef USB_HOST_UART_CONFIG_DELAY_MS -#define USB_HOST_UART_CONFIG_DELAY_MS 10 -#endif - -/** - * @def USB_CDC_AS_SERIAL_TRANSPORT - * - * Use USB CDC driver for serial communication. - */ -#ifndef USB_CDC_AS_SERIAL_TRANSPORT -#define USB_CDC_AS_SERIAL_TRANSPORT 0 -#endif - -/** - * @def The USB interface to use for CDC ACM COMM. - * - * According to the USB Specification, interface numbers cannot have gaps. Tailor this value to adhere to this - * limitation. Takes values between 0-255. - */ -#ifndef USB_CDC_ACM_COMM_INTERFACE -#define USB_CDC_ACM_COMM_INTERFACE 1 -#endif - -/** - * @def The USB interface to use for CDC ACM DATA. - * - * According to the USB Specification, interface numbers cannot have gaps. Tailor this value to adhere to this - * limitation. Takes values between 0-255. - */ -#ifndef USB_CDC_ACM_DATA_INTERFACE -#define USB_CDC_ACM_DATA_INTERFACE 2 -#endif - -/** - * @def OPENTHREAD_PLATFORM_USE_PSEUDO_RESET - * - * Reset the application, not the chip, when a software reset is requested. - * via `otPlatReset()`. - */ -#ifndef OPENTHREAD_PLATFORM_USE_PSEUDO_RESET -#define OPENTHREAD_PLATFORM_USE_PSEUDO_RESET USB_CDC_AS_SERIAL_TRANSPORT -#endif - -#endif // TRANSPORT_CONFIG_H_ diff --git a/examples/platforms/nrf528xx/src/alarm.c b/examples/platforms/nrf528xx/src/alarm.c deleted file mode 100644 index 5e74eaaca..000000000 --- a/examples/platforms/nrf528xx/src/alarm.c +++ /dev/null @@ -1,699 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements the OpenThread platform abstraction for the alarm. - * - */ - -#include -#include - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "openthread-system.h" - -#include "platform-config.h" -#include "platform-nrf5.h" - -#include -#include -#include - -#include - -#include - -// clang-format off -#define RTC_FREQUENCY NRF_802154_RTC_FREQUENCY - -#define US_PER_MS 1000ULL -#define US_PER_S NRF_802154_US_PER_S -#define US_PER_OVERFLOW (512UL * NRF_802154_US_PER_S) ///< Time that has passed between overflow events. On full RTC speed, it occurs every 512 s. - -#define RTC_COUNTER_BITS 24 ///< Number of bits in RTC COUNTER register. - -#define MS_PER_S 1000UL - -#define MIN_RTC_COMPARE_EVENT_TICKS 2 ///< Minimum number of RTC ticks delay that guarantees that RTC compare event will fire. -#define MIN_RTC_COMPARE_EVENT_DT (MIN_RTC_COMPARE_EVENT_TICKS * NRF_802154_US_PER_TICK) ///< Minimum time delta from now before RTC compare event is guaranteed to fire. -#define EPOCH_32BIT_US (1ULL << 32) -#define EPOCH_FROM_TIME(time) ((time) & ((uint64_t)UINT32_MAX << 32)) - -#define XTAL_ACCURACY 40 // The crystal used on nRF52840PDK has ±20ppm accuracy. -// clang-format on - -typedef enum -{ - kMsTimer, - kUsTimer, - k802154Timer, - k802154Sync, - kNumTimers -} AlarmIndex; - -typedef struct -{ - volatile bool mFireAlarm; ///< Information for processing function, that alarm should fire. - uint64_t mTargetTime; ///< Alarm fire time (in millisecond for MsTimer, in microsecond for UsTimer) -} AlarmData; - -typedef struct -{ - uint32_t mChannelNumber; - uint32_t mCompareEventMask; - nrf_rtc_event_t mCompareEvent; - nrf_rtc_int_t mCompareInt; -} AlarmChannelData; - -static volatile uint32_t sOverflowCounter; ///< Counter of RTC overflowCounter, incremented by 2 on each OVERFLOW event. -static volatile uint8_t sMutex; ///< Mutex for write access to @ref sOverflowCounter. -static volatile uint64_t sTimeOffset = 0; ///< Time overflowCounter to keep track of current time (in millisecond). -static volatile bool sEventPending; ///< Timer fired and upper layer should be notified. -static AlarmData sTimerData[kNumTimers]; ///< Data of the timers. - -static const AlarmChannelData sChannelData[kNumTimers] = // - { // - [kMsTimer] = - { - .mChannelNumber = 0, - .mCompareEventMask = RTC_EVTEN_COMPARE0_Msk, - .mCompareEvent = NRF_RTC_EVENT_COMPARE_0, - .mCompareInt = NRF_RTC_INT_COMPARE0_MASK, - }, - [kUsTimer] = - { - .mChannelNumber = 1, - .mCompareEventMask = RTC_EVTEN_COMPARE1_Msk, - .mCompareEvent = NRF_RTC_EVENT_COMPARE_1, - .mCompareInt = NRF_RTC_INT_COMPARE1_MASK, - }, - [k802154Timer] = - { - .mChannelNumber = 2, - .mCompareEventMask = RTC_EVTEN_COMPARE2_Msk, - .mCompareEvent = NRF_RTC_EVENT_COMPARE_2, - .mCompareInt = NRF_RTC_INT_COMPARE2_MASK, - }, - [k802154Sync] = { - .mChannelNumber = 3, - .mCompareEventMask = RTC_EVTEN_COMPARE3_Msk, - .mCompareEvent = NRF_RTC_EVENT_COMPARE_3, - .mCompareInt = NRF_RTC_INT_COMPARE3_MASK, - }}; - -static inline bool MutexGet(void) -{ - do - { - volatile uint8_t mutexValue = __LDREXB(&sMutex); - - if (mutexValue) - { - __CLREX(); - return false; - } - } while (__STREXB(1, &sMutex)); - - // Disable OVERFLOW interrupt to prevent lock-up in interrupt context while mutex is locked from lower priority - // context and OVERFLOW event flag is stil up. - nrf_rtc_int_disable(RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - - __DMB(); - - return true; -} - -static inline void MutexRelease(void) -{ - // Re-enable OVERFLOW interrupt. - nrf_rtc_int_enable(RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - - __DMB(); - sMutex = 0; -} - -static inline uint64_t TimeToTicks(uint64_t aTime, AlarmIndex aIndex) -{ - if (aIndex == kMsTimer) - { - aTime *= US_PER_MS; - } - - return NRF_802154_US_TO_RTC_TICKS(aTime); -} - -static inline uint64_t TicksToTime(uint64_t aTicks, AlarmIndex aIndex) -{ - uint64_t result = NRF_802154_RTC_TICKS_TO_US(aTicks); - - if (aIndex == kMsTimer) - { - result /= US_PER_MS; - } - - return result; -} - -static inline bool AlarmShallStrike(uint64_t aNow, AlarmIndex aIndex) -{ - return aNow >= sTimerData[aIndex].mTargetTime; -} - -static uint32_t GetOverflowCounter(void) -{ - uint32_t overflowCounter; - - // Get mutual access for writing to sOverflowCounter variable. - if (MutexGet()) - { - bool increasing = false; - - // Check if interrupt was handled already. - if (nrf_rtc_event_pending(RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW)) - { - sOverflowCounter++; - increasing = true; - - __DMB(); - - // Mark that interrupt was handled. - nrf_rtc_event_clear(RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW); - - // Result should be incremented. sOverflowCounter will be incremented after mutex is released. - } - else - { - // Either overflow handling is not needed OR we acquired the mutex just after it was released. - // Overflow is handled after mutex is released, but it cannot be assured that sOverflowCounter - // was incremented for the second time, so we increment the result here. - } - - overflowCounter = (sOverflowCounter + 1) / 2; - - MutexRelease(); - - if (increasing) - { - // It's virtually impossible that overflow event is pending again before next instruction is performed. It - // is an error condition. - assert(sOverflowCounter & 0x01); - - // Increment the counter for the second time, to allow instructions from other context get correct value of - // the counter. - sOverflowCounter++; - } - } - else - { - // Failed to acquire mutex. - if (nrf_rtc_event_pending(RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW) || (sOverflowCounter & 0x01)) - { - // Lower priority context is currently incrementing sOverflowCounter variable. - overflowCounter = (sOverflowCounter + 2) / 2; - } - else - { - // Lower priority context has already incremented sOverflowCounter variable or incrementing is not needed - // now. - overflowCounter = sOverflowCounter / 2; - } - } - - return overflowCounter; -} - -static uint32_t GetRtcCounter(void) -{ - return nrf_rtc_counter_get(RTC_INSTANCE); -} - -static void GetOffsetAndCounter(uint32_t *aOffset, uint32_t *aCounter) -{ - uint32_t offset1 = GetOverflowCounter(); - - __DMB(); - - uint32_t rtcValue1 = GetRtcCounter(); - - __DMB(); - - uint32_t offset2 = GetOverflowCounter(); - - *aOffset = offset2; - *aCounter = (offset1 == offset2) ? rtcValue1 : GetRtcCounter(); -} - -static uint64_t GetTime(uint32_t aOffset, uint32_t aCounter, AlarmIndex aIndex) -{ - uint64_t result = (uint64_t)aOffset * US_PER_OVERFLOW + TicksToTime(aCounter, kUsTimer); - - if (aIndex == kMsTimer) - { - result /= US_PER_MS; - } - - return result; -} - -static uint64_t GetCurrentTime(AlarmIndex aIndex) -{ - uint32_t offset; - uint32_t rtc_counter; - - GetOffsetAndCounter(&offset, &rtc_counter); - - return GetTime(offset, rtc_counter, aIndex); -} - -static void HandleCompareMatch(AlarmIndex aIndex, bool aSkipCheck) -{ - nrf_rtc_event_clear(RTC_INSTANCE, sChannelData[aIndex].mCompareEvent); - - uint64_t now = GetCurrentTime(aIndex); - - // In case the target time was larger than single overflow, - // we should only strike the timer on final compare event. - if (aSkipCheck || AlarmShallStrike(now, aIndex)) - { - nrf_rtc_event_disable(RTC_INSTANCE, sChannelData[aIndex].mCompareEventMask); - nrf_rtc_int_disable(RTC_INSTANCE, sChannelData[aIndex].mCompareInt); - - switch (aIndex) - { - case k802154Timer: - nrf_802154_lp_timer_fired(); - break; - - case k802154Sync: - nrf_802154_lp_timer_synchronized(); - break; - - case kMsTimer: - case kUsTimer: - sTimerData[aIndex].mFireAlarm = true; - sEventPending = true; - otSysEventSignalPending(); - break; - - default: - assert(false); - } - } -} - -static uint64_t ConvertT0AndDtTo64BitTime(uint32_t aT0, uint32_t aDt, const uint64_t *aNow) -{ - uint64_t now; - now = *aNow; - - if (((uint32_t)now < aT0) && ((aT0 - (uint32_t)now) > (UINT32_MAX / 2))) - { - now -= EPOCH_32BIT_US; - } - else if (((uint32_t)now > aT0) && (((uint32_t)now) - aT0 > (UINT32_MAX / 2))) - { - now += EPOCH_32BIT_US; - } - - return (EPOCH_FROM_TIME(now)) + aT0 + aDt; -} - -static uint64_t RoundUpTimeToTimerTicksMultiply(uint64_t aTime, AlarmIndex aIndex) -{ - uint64_t ticks = TimeToTicks(aTime, aIndex); - uint64_t result = TicksToTime(ticks, aIndex); - return result; -} - -static void TimerStartAt(uint32_t aT0, uint32_t aDt, AlarmIndex aIndex, const uint64_t *aNow) -{ - uint64_t targetCounter; - uint64_t targetTime; - - nrf_rtc_int_disable(RTC_INSTANCE, sChannelData[aIndex].mCompareInt); - nrf_rtc_event_enable(RTC_INSTANCE, sChannelData[aIndex].mCompareEventMask); - - targetTime = ConvertT0AndDtTo64BitTime(aT0, aDt, aNow); - targetCounter = TimeToTicks(targetTime, aIndex) & RTC_CC_COMPARE_Msk; - - sTimerData[aIndex].mTargetTime = RoundUpTimeToTimerTicksMultiply(targetTime, aIndex); - - nrf_rtc_cc_set(RTC_INSTANCE, sChannelData[aIndex].mChannelNumber, targetCounter); -} - -static void AlarmStartAt(uint32_t aT0, uint32_t aDt, AlarmIndex aIndex) -{ - uint32_t offset; - uint32_t rtc_value; - uint64_t now; - uint64_t now_rtc_protected; - - GetOffsetAndCounter(&offset, &rtc_value); - now = GetTime(offset, rtc_value, aIndex); - - TimerStartAt(aT0, aDt, aIndex, &now); - - if (rtc_value != GetRtcCounter()) - { - GetOffsetAndCounter(&offset, &rtc_value); - } - - now_rtc_protected = GetTime(offset, rtc_value + MIN_RTC_COMPARE_EVENT_TICKS, aIndex); - - if (AlarmShallStrike(now_rtc_protected, aIndex)) - { - HandleCompareMatch(aIndex, true); - - /** - * Normally ISR sets event flag automatically. - * Here we are calling HandleCompareMatch explicitly and no ISR will be fired. - * To prevent possible permanent sleep on next WFE we have to set event flag. - */ - __SEV(); - } - else - { - nrf_rtc_int_enable(RTC_INSTANCE, sChannelData[aIndex].mCompareInt); - } -} - -static void TimerSyncStartAt(uint32_t aT0, uint32_t aDt, const uint64_t *aNow) -{ - TimerStartAt(aT0, aDt, k802154Sync, aNow); - - nrf_rtc_int_enable(RTC_INSTANCE, sChannelData[k802154Sync].mCompareInt); -} - -static void AlarmStop(AlarmIndex aIndex) -{ - nrf_rtc_event_disable(RTC_INSTANCE, sChannelData[aIndex].mCompareEventMask); - nrf_rtc_int_disable(RTC_INSTANCE, sChannelData[aIndex].mCompareInt); - nrf_rtc_event_clear(RTC_INSTANCE, sChannelData[aIndex].mCompareEvent); - - sTimerData[aIndex].mFireAlarm = false; -} - -void nrf5AlarmInit(void) -{ - memset(sTimerData, 0, sizeof(sTimerData)); - sOverflowCounter = 0; - sMutex = 0; - sTimeOffset = 0; - - // Setup low frequency clock. - nrf_drv_clock_lfclk_request(NULL); - - while (!nrf_drv_clock_lfclk_is_running()) - { - } - - // Setup RTC timer. - NVIC_SetPriority(RTC_IRQN, RTC_IRQ_PRIORITY); - NVIC_ClearPendingIRQ(RTC_IRQN); - NVIC_EnableIRQ(RTC_IRQN); - - nrf_rtc_prescaler_set(RTC_INSTANCE, 0); - - nrf_rtc_event_clear(RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW); - nrf_rtc_event_enable(RTC_INSTANCE, RTC_EVTEN_OVRFLW_Msk); - nrf_rtc_int_enable(RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - - for (uint32_t i = 0; i < kNumTimers; i++) - { - nrf_rtc_event_clear(RTC_INSTANCE, sChannelData[i].mCompareEvent); - nrf_rtc_event_disable(RTC_INSTANCE, sChannelData[i].mCompareEventMask); - nrf_rtc_int_disable(RTC_INSTANCE, sChannelData[i].mCompareInt); - } - - nrf_rtc_task_trigger(RTC_INSTANCE, NRF_RTC_TASK_START); -} - -void nrf5AlarmDeinit(void) -{ - nrf_rtc_task_trigger(RTC_INSTANCE, NRF_RTC_TASK_STOP); - - for (uint32_t i = 0; i < kNumTimers; i++) - { - nrf_rtc_event_clear(RTC_INSTANCE, sChannelData[i].mCompareEvent); - nrf_rtc_event_disable(RTC_INSTANCE, sChannelData[i].mCompareEventMask); - nrf_rtc_int_disable(RTC_INSTANCE, sChannelData[i].mCompareInt); - } - - nrf_rtc_int_disable(RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - nrf_rtc_event_disable(RTC_INSTANCE, RTC_EVTEN_OVRFLW_Msk); - nrf_rtc_event_clear(RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW); - - nrf_802154_lp_timer_sync_stop(); - - NVIC_DisableIRQ(RTC_IRQN); - NVIC_ClearPendingIRQ(RTC_IRQN); - NVIC_SetPriority(RTC_IRQN, 0); - - nrf_drv_clock_lfclk_release(); -} - -void nrf5AlarmProcess(otInstance *aInstance) -{ - do - { - sEventPending = false; - - if (sTimerData[kMsTimer].mFireAlarm) - { - sTimerData[kMsTimer].mFireAlarm = false; - -#if OPENTHREAD_CONFIG_DIAG_ENABLE - - if (otPlatDiagModeGet()) - { - otPlatDiagAlarmFired(aInstance); - } - else -#endif - { - otPlatAlarmMilliFired(aInstance); - } - } - - if (sTimerData[kUsTimer].mFireAlarm) - { - sTimerData[kUsTimer].mFireAlarm = false; - - otPlatAlarmMicroFired(aInstance); - } - } while (sEventPending); -} - -inline uint64_t nrf5AlarmGetCurrentTime(void) -{ - return GetCurrentTime(kUsTimer); -} - -uint64_t nrf5AlarmGetRawCounter(void) -{ - uint32_t offset = 0; - uint32_t counter = 0; - - GetOffsetAndCounter(&offset, &counter); - - return (((uint64_t)offset) << RTC_COUNTER_BITS) | counter; -} - -uint32_t otPlatAlarmMilliGetNow(void) -{ - return (uint32_t)(nrf5AlarmGetCurrentTime() / US_PER_MS); -} - -void otPlatAlarmMilliStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt) -{ - OT_UNUSED_VARIABLE(aInstance); - - AlarmStartAt(aT0, aDt, kMsTimer); -} - -void otPlatAlarmMilliStop(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - AlarmStop(kMsTimer); -} - -uint32_t otPlatAlarmMicroGetNow(void) -{ - return (uint32_t)nrf5AlarmGetCurrentTime(); -} - -void otPlatAlarmMicroStartAt(otInstance *aInstance, uint32_t aT0, uint32_t aDt) -{ - OT_UNUSED_VARIABLE(aInstance); - - AlarmStartAt(aT0, aDt, kUsTimer); -} - -void otPlatAlarmMicroStop(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - AlarmStop(kUsTimer); -} - -/** - * Radio driver timer abstraction API - */ - -void nrf_802154_lp_timer_init(void) -{ - // Intentionally empty -} - -void nrf_802154_lp_timer_deinit(void) -{ - // Intentionally empty -} - -void nrf_802154_lp_timer_critical_section_enter(void) -{ - nrf_rtc_int_disable(RTC_INSTANCE, sChannelData[k802154Timer].mCompareInt); - __DSB(); - __ISB(); -} - -void nrf_802154_lp_timer_critical_section_exit(void) -{ - nrf_rtc_int_enable(RTC_INSTANCE, sChannelData[k802154Timer].mCompareInt); -} - -uint32_t nrf_802154_lp_timer_time_get(void) -{ - return (uint32_t)nrf5AlarmGetCurrentTime(); -} - -uint32_t nrf_802154_lp_timer_granularity_get(void) -{ - return NRF_802154_US_PER_TICK; -} - -void nrf_802154_lp_timer_start(uint32_t t0, uint32_t dt) -{ - AlarmStartAt(t0, dt, k802154Timer); -} - -bool nrf_802154_lp_timer_is_running(void) -{ - return nrf_rtc_int_is_enabled(RTC_INSTANCE, sChannelData[k802154Timer].mCompareInt); -} - -void nrf_802154_lp_timer_stop(void) -{ - AlarmStop(k802154Timer); -} - -void nrf_802154_lp_timer_sync_start_now(void) -{ - uint32_t counter; - uint32_t offset; - uint64_t now; - - do - { - GetOffsetAndCounter(&offset, &counter); - now = GetTime(offset, counter, k802154Sync); - TimerSyncStartAt((uint32_t)now, MIN_RTC_COMPARE_EVENT_DT, &now); - } while (GetRtcCounter() != counter); -} - -void nrf_802154_lp_timer_sync_start_at(uint32_t t0, uint32_t dt) -{ - uint64_t now = GetCurrentTime(k802154Sync); - - TimerSyncStartAt(t0, dt, &now); -} - -void nrf_802154_lp_timer_sync_stop(void) -{ - AlarmStop(k802154Sync); -} - -uint32_t nrf_802154_lp_timer_sync_event_get(void) -{ - return (uint32_t)nrf_rtc_event_address_get(RTC_INSTANCE, sChannelData[k802154Sync].mCompareEvent); -} - -uint32_t nrf_802154_lp_timer_sync_time_get(void) -{ - return (uint32_t)sTimerData[k802154Sync].mTargetTime; -} - -/** - * RTC IRQ handler - */ - -void RTC_IRQ_HANDLER(void) -{ - // Handle overflow. - if (nrf_rtc_event_pending(RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW)) - { - // Disable OVERFLOW interrupt to prevent lock-up in interrupt context while mutex is locked from lower priority - // context and OVERFLOW event flag is stil up. OVERFLOW interrupt will be re-enabled when mutex is released - - // either from this handler, or from lower priority context, that locked the mutex. - nrf_rtc_int_disable(RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - - // Handle OVERFLOW event by reading current value of overflow counter. - (void)GetOverflowCounter(); - } - - // Handle compare match. - for (uint32_t i = 0; i < kNumTimers; i++) - { - if (nrf_rtc_int_is_enabled(RTC_INSTANCE, sChannelData[i].mCompareInt) && - nrf_rtc_event_pending(RTC_INSTANCE, sChannelData[i].mCompareEvent)) - { - HandleCompareMatch((AlarmIndex)i, false); - } - } -} - -uint64_t otPlatTimeGet(void) -{ - return nrf5AlarmGetCurrentTime(); -} - -uint16_t otPlatTimeGetXtalAccuracy(void) -{ - return XTAL_ACCURACY; -} diff --git a/examples/platforms/nrf528xx/src/diag.c b/examples/platforms/nrf528xx/src/diag.c deleted file mode 100644 index 32c78cbd9..000000000 --- a/examples/platforms/nrf528xx/src/diag.c +++ /dev/null @@ -1,535 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include - -#include -#include -#include -#include -#include - -#include "platform-nrf5.h" - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -typedef enum -{ - kDiagTransmitModeIdle, - kDiagTransmitModePackets, - kDiagTransmitModeCarrier -} DiagTrasmitMode; - -struct PlatformDiagCommand -{ - const char *mName; - otError (*mCommand)(otInstance *aInstance, uint8_t aArgsLength, char *aArgs[], char *aOutput, size_t aOutputMaxLen); -}; - -struct PlatformDiagMessage -{ - const char mMessageDescriptor[11]; - uint8_t mChannel; - int16_t mID; - uint32_t mCnt; -}; - -/** - * Diagnostics mode variables. - * - */ -static bool sDiagMode = false; -static bool sListen = false; -static DiagTrasmitMode sTransmitMode = kDiagTransmitModeIdle; -static uint8_t sChannel = 20; -static int8_t sTxPower = 0; -static uint32_t sTxPeriod = 1; -static int32_t sTxCount = 0; -static int32_t sTxRequestedCount = 1; -static int16_t sID = -1; -static struct PlatformDiagMessage sDiagMessage = {.mMessageDescriptor = "DiagMessage", - .mChannel = 0, - .mID = 0, - .mCnt = 0}; - -static otError parseLong(char *aArgs, long *aValue) -{ - char *endptr; - *aValue = strtol(aArgs, &endptr, 0); - return (*endptr == '\0') ? OT_ERROR_NONE : OT_ERROR_PARSE; -} - -static void appendErrorResult(otError aError, char *aOutput, size_t aOutputMaxLen) -{ - if (aError != OT_ERROR_NONE) - { - snprintf(aOutput, aOutputMaxLen, "failed\r\nstatus %#x\r\n", aError); - } -} - -static bool startCarrierTransmision(void) -{ - nrf_802154_channel_set(sChannel); - nrf_802154_tx_power_set(sTxPower); - - return nrf_802154_continuous_carrier(); -} - -static otError processListen(otInstance *aInstance, - uint8_t aArgsLength, - char * aArgs[], - char * aOutput, - size_t aOutputMaxLen) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error = OT_ERROR_NONE; - - otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE); - - if (aArgsLength == 0) - { - snprintf(aOutput, aOutputMaxLen, "listen: %s\r\n", sListen == true ? "yes" : "no"); - } - else - { - long value; - - error = parseLong(aArgs[0], &value); - otEXPECT(error == OT_ERROR_NONE); - sListen = (bool)(value); - snprintf(aOutput, aOutputMaxLen, "set listen to %s\r\nstatus 0x%02x\r\n", sListen == true ? "yes" : "no", - error); - } - -exit: - appendErrorResult(error, aOutput, aOutputMaxLen); - return error; -} - -static otError processID(otInstance *aInstance, uint8_t aArgsLength, char *aArgs[], char *aOutput, size_t aOutputMaxLen) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error = OT_ERROR_NONE; - - otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE); - - if (aArgsLength == 0) - { - snprintf(aOutput, aOutputMaxLen, "ID: %" PRId16 "\r\n", sID); - } - else - { - long value; - - error = parseLong(aArgs[0], &value); - otEXPECT(error == OT_ERROR_NONE); - otEXPECT_ACTION(value >= 0, error = OT_ERROR_INVALID_ARGS); - sID = (int16_t)(value); - snprintf(aOutput, aOutputMaxLen, "set ID to %" PRId16 "\r\nstatus 0x%02x\r\n", sID, error); - } - -exit: - appendErrorResult(error, aOutput, aOutputMaxLen); - return error; -} - -static otError processTransmit(otInstance *aInstance, - uint8_t aArgsLength, - char * aArgs[], - char * aOutput, - size_t aOutputMaxLen) -{ - otError error = OT_ERROR_NONE; - - otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE); - - if (aArgsLength == 0) - { - snprintf(aOutput, aOutputMaxLen, - "transmit will send %" PRId32 " diagnostic messages with %" PRIu32 " ms interval\r\nstatus 0x%02x\r\n", - sTxRequestedCount, sTxPeriod, error); - } - else if (strcmp(aArgs[0], "stop") == 0) - { - otEXPECT_ACTION(sTransmitMode != kDiagTransmitModeIdle, error = OT_ERROR_INVALID_STATE); - - otPlatAlarmMilliStop(aInstance); - snprintf(aOutput, aOutputMaxLen, "diagnostic message transmission is stopped\r\nstatus 0x%02x\r\n", error); - sTransmitMode = kDiagTransmitModeIdle; - otPlatRadioReceive(aInstance, sChannel); - } - else if (strcmp(aArgs[0], "start") == 0) - { - otEXPECT_ACTION(sTransmitMode == kDiagTransmitModeIdle, error = OT_ERROR_INVALID_STATE); - - otPlatAlarmMilliStop(aInstance); - sTransmitMode = kDiagTransmitModePackets; - sTxCount = sTxRequestedCount; - uint32_t now = otPlatAlarmMilliGetNow(); - otPlatAlarmMilliStartAt(aInstance, now, sTxPeriod); - snprintf(aOutput, aOutputMaxLen, - "sending %" PRId32 " diagnostic messages with %" PRIu32 " ms interval\r\nstatus 0x%02x\r\n", - sTxRequestedCount, sTxPeriod, error); - } - else if (strcmp(aArgs[0], "carrier") == 0) - { - otEXPECT_ACTION(sTransmitMode == kDiagTransmitModeIdle, error = OT_ERROR_INVALID_STATE); - - otEXPECT_ACTION(startCarrierTransmision(), error = OT_ERROR_FAILED); - - sTransmitMode = kDiagTransmitModeCarrier; - - snprintf(aOutput, aOutputMaxLen, "sending carrier on channel %d with tx power %d\r\nstatus 0x%02x\r\n", - sChannel, sTxPower, error); - } - else if (strcmp(aArgs[0], "interval") == 0) - { - long value; - - otEXPECT_ACTION(aArgsLength == 2, error = OT_ERROR_INVALID_ARGS); - - error = parseLong(aArgs[1], &value); - otEXPECT(error == OT_ERROR_NONE); - otEXPECT_ACTION(value > 0, error = OT_ERROR_INVALID_ARGS); - sTxPeriod = (uint32_t)(value); - snprintf(aOutput, aOutputMaxLen, "set diagnostic messages interval to %" PRIu32 " ms\r\nstatus 0x%02x\r\n", - sTxPeriod, error); - } - else if (strcmp(aArgs[0], "count") == 0) - { - long value; - - otEXPECT_ACTION(aArgsLength == 2, error = OT_ERROR_INVALID_ARGS); - - error = parseLong(aArgs[1], &value); - otEXPECT(error == OT_ERROR_NONE); - otEXPECT_ACTION((value > 0) || (value == -1), error = OT_ERROR_INVALID_ARGS); - sTxRequestedCount = (uint32_t)(value); - snprintf(aOutput, aOutputMaxLen, "set diagnostic messages count to %" PRId32 "\r\nstatus 0x%02x\r\n", - sTxRequestedCount, error); - } - else - { - error = OT_ERROR_INVALID_ARGS; - } - -exit: - appendErrorResult(error, aOutput, aOutputMaxLen); - return error; -} - -static otError processGpio(otInstance *aInstance, - uint8_t aArgsLength, - char * aArgs[], - char * aOutput, - size_t aOutputMaxLen) -{ - OT_UNUSED_VARIABLE(aInstance); - - long pinnum; - otError error = OT_ERROR_NONE; - - otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE); - - if (aArgsLength == 1) - { - uint32_t value; - nrf_gpio_pin_dir_t pindir; - - error = parseLong(aArgs[0], &pinnum); - otEXPECT(error == OT_ERROR_NONE); - - pindir = nrf_gpio_pin_dir_get(pinnum); - - if (pindir == NRF_GPIO_PIN_DIR_INPUT) - { - value = nrf_gpio_pin_read(pinnum); - } - else - { - value = nrf_gpio_pin_out_read(pinnum); - } - - snprintf(aOutput, aOutputMaxLen, "gpio %d = %d\r\n", (uint8_t)pinnum, (uint8_t)value); - } - else if (strcmp(aArgs[0], "set") == 0) - { - otEXPECT_ACTION(aArgsLength == 2, error = OT_ERROR_INVALID_ARGS); - error = parseLong(aArgs[1], &pinnum); - otEXPECT(error == OT_ERROR_NONE); - - nrf_gpio_pin_set(pinnum); - - snprintf(aOutput, aOutputMaxLen, "gpio %d = 1\r\n", (uint8_t)pinnum); - } - else if (strcmp(aArgs[0], "clr") == 0) - { - otEXPECT_ACTION(aArgsLength == 2, error = OT_ERROR_INVALID_ARGS); - error = parseLong(aArgs[1], &pinnum); - otEXPECT(error == OT_ERROR_NONE); - - nrf_gpio_pin_clear(pinnum); - - snprintf(aOutput, aOutputMaxLen, "gpio %d = 0\r\n", (uint8_t)pinnum); - } - else if (strcmp(aArgs[0], "out") == 0) - { - otEXPECT_ACTION(aArgsLength == 2, error = OT_ERROR_INVALID_ARGS); - error = parseLong(aArgs[1], &pinnum); - otEXPECT(error == OT_ERROR_NONE); - - nrf_gpio_cfg_output(pinnum); - - snprintf(aOutput, aOutputMaxLen, "gpio %d: out\r\n", (uint8_t)pinnum); - } - else if (strcmp(aArgs[0], "in") == 0) - { - otEXPECT_ACTION(aArgsLength == 2, error = OT_ERROR_INVALID_ARGS); - error = parseLong(aArgs[1], &pinnum); - otEXPECT(error == OT_ERROR_NONE); - - nrf_gpio_cfg_input(pinnum, NRF_GPIO_PIN_NOPULL); - - snprintf(aOutput, aOutputMaxLen, "gpio %d: in no pull\r\n", (uint8_t)pinnum); - } - else - { - error = OT_ERROR_INVALID_ARGS; - } - -exit: - appendErrorResult(error, aOutput, aOutputMaxLen); - return error; -} - -static otError processTemp(otInstance *aInstance, - uint8_t aArgsLength, - char * aArgs[], - char * aOutput, - size_t aOutputMaxLen) -{ - OT_UNUSED_VARIABLE(aInstance); - OT_UNUSED_VARIABLE(aArgs); - - otError error = OT_ERROR_NONE; - int32_t temperature; - - otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE); - otEXPECT_ACTION(aArgsLength == 0, error = OT_ERROR_INVALID_ARGS); - - temperature = nrf5TempGet(); - - // Measurement resolution is 0.25 degrees Celsius - // Convert the temperature measurement to a decimal value, in degrees Celsius - snprintf(aOutput, aOutputMaxLen, "%" PRId32 ".%02" PRId32 "\r\n", temperature / 4, 25 * (temperature % 4)); - -exit: - appendErrorResult(error, aOutput, aOutputMaxLen); - return error; -} - -static otError processCcaThreshold(otInstance *aInstance, - uint8_t aArgsLength, - char * aArgs[], - char * aOutput, - size_t aOutputMaxLen) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error = OT_ERROR_NONE; - nrf_802154_cca_cfg_t ccaConfig; - - otEXPECT_ACTION(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE); - - if (aArgsLength == 0) - { - nrf_802154_cca_cfg_get(&ccaConfig); - - snprintf(aOutput, aOutputMaxLen, "cca threshold: %u\r\n", ccaConfig.ed_threshold); - } - else - { - long value; - error = parseLong(aArgs[0], &value); - otEXPECT(error == OT_ERROR_NONE); - otEXPECT_ACTION(value >= 0 && value <= 0xFF, error = OT_ERROR_INVALID_ARGS); - - memset(&ccaConfig, 0, sizeof(ccaConfig)); - ccaConfig.mode = NRF_RADIO_CCA_MODE_ED; - ccaConfig.ed_threshold = (uint8_t)value; - - nrf_802154_cca_cfg_set(&ccaConfig); - snprintf(aOutput, aOutputMaxLen, "set cca threshold to %u\r\nstatus 0x%02x\r\n", ccaConfig.ed_threshold, error); - } - -exit: - appendErrorResult(error, aOutput, aOutputMaxLen); - return error; -} - -const struct PlatformDiagCommand sCommands[] = { - {"ccathreshold", &processCcaThreshold}, - {"gpio", &processGpio}, - {"id", &processID}, - {"listen", &processListen}, - {"temp", &processTemp}, - {"transmit", &processTransmit}, -}; - -otError otPlatDiagProcess(otInstance *aInstance, - uint8_t aArgsLength, - char * aArgs[], - char * aOutput, - size_t aOutputMaxLen) -{ - otError error = OT_ERROR_INVALID_COMMAND; - size_t i; - - for (i = 0; i < otARRAY_LENGTH(sCommands); i++) - { - if (strcmp(aArgs[0], sCommands[i].mName) == 0) - { - error = sCommands[i].mCommand(aInstance, aArgsLength - 1, aArgsLength > 1 ? &aArgs[1] : NULL, aOutput, - aOutputMaxLen); - break; - } - } - - return error; -} - -void otPlatDiagModeSet(bool aMode) -{ - sDiagMode = aMode; - - if (!sDiagMode) - { - otPlatRadioReceive(NULL, sChannel); - otPlatRadioSleep(NULL); - - // Clear all remaining events before switching to MAC callbacks. - nrf5RadioClearPendingEvents(); - } - else - { - // Reinit - sTransmitMode = kDiagTransmitModeIdle; - } -} - -bool otPlatDiagModeGet() -{ - return sDiagMode; -} - -void otPlatDiagChannelSet(uint8_t aChannel) -{ - sChannel = aChannel; -} - -void otPlatDiagTxPowerSet(int8_t aTxPower) -{ - sTxPower = aTxPower; -} - -void otPlatDiagRadioReceived(otInstance *aInstance, otRadioFrame *aFrame, otError aError) -{ - OT_UNUSED_VARIABLE(aInstance); - - if (sListen && (aError == OT_ERROR_NONE)) - { - if (aFrame->mLength == sizeof(struct PlatformDiagMessage)) - { - struct PlatformDiagMessage *message = (struct PlatformDiagMessage *)aFrame->mPsdu; - - if (strncmp(message->mMessageDescriptor, "DiagMessage", 11) == 0) - { - otPlatLog(OT_LOG_LEVEL_DEBG, OT_LOG_REGION_PLATFORM, - "{\"Frame\":{" - "\"LocalChannel\":%u ," - "\"RemoteChannel\":%u," - "\"CNT\":%" PRIu32 "," - "\"LocalID\":%" PRId16 "," - "\"RemoteID\":%" PRId16 "," - "\"RSSI\":%d" - "}}\r\n", - aFrame->mChannel, message->mChannel, message->mCnt, sID, message->mID, - aFrame->mInfo.mRxInfo.mRssi); - } - } - } -} - -void otPlatDiagAlarmCallback(otInstance *aInstance) -{ - if (sTransmitMode == kDiagTransmitModePackets) - { - if ((sTxCount > 0) || (sTxCount == -1)) - { - otRadioFrame *sTxPacket = otPlatRadioGetTransmitBuffer(aInstance); - - sTxPacket->mLength = sizeof(struct PlatformDiagMessage); - sTxPacket->mChannel = sChannel; - - sDiagMessage.mChannel = sTxPacket->mChannel; - sDiagMessage.mID = sID; - - memcpy(sTxPacket->mPsdu, &sDiagMessage, sizeof(struct PlatformDiagMessage)); - otPlatRadioTransmit(aInstance, sTxPacket); - - sDiagMessage.mCnt++; - - if (sTxCount != -1) - { - sTxCount--; - } - - uint32_t now = otPlatAlarmMilliGetNow(); - otPlatAlarmMilliStartAt(aInstance, now, sTxPeriod); - } - else - { - sTransmitMode = kDiagTransmitModeIdle; - otPlatAlarmMilliStop(aInstance); - otPlatLog(OT_LOG_LEVEL_DEBG, OT_LOG_REGION_PLATFORM, "Transmit done"); - } - } -} diff --git a/examples/platforms/nrf528xx/src/entropy.c b/examples/platforms/nrf528xx/src/entropy.c deleted file mode 100644 index 93c988561..000000000 --- a/examples/platforms/nrf528xx/src/entropy.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements an entropy source based on TRNG. - * - */ - -#include - -#include -#include - -#include -#include -#include -#include - -#include - -#include "platform-nrf5.h" - -static volatile bool sEntropyGetEntered; - -#if SOFTDEVICE_PRESENT -#include "softdevice.h" -#else -#include - -static uint8_t sBuffer[RNG_BUFFER_SIZE]; -static volatile uint32_t sReadPosition; -static volatile uint32_t sWritePosition; - -static inline uint32_t bufferCount(void) -{ - uint32_t writePos = sWritePosition; - return writePos - sReadPosition; -} - -static inline bool bufferIsEmpty(void) -{ - return (bufferCount() == 0); -} - -static inline bool bufferIsUint32Ready(void) -{ - return (bufferCount() >= 4); -} - -static inline bool bufferIsFull(void) -{ - return (bufferCount() >= RNG_BUFFER_SIZE); -} - -static inline void bufferPut(uint8_t val) -{ - if (!bufferIsFull()) - { - sBuffer[(sWritePosition++) % RNG_BUFFER_SIZE] = val; - } -} - -static inline uint8_t bufferGet() -{ - uint8_t retVal = 0; - - if (!bufferIsEmpty()) - { - retVal = sBuffer[sReadPosition++ % RNG_BUFFER_SIZE]; - } - - return retVal; -} - -static inline uint32_t bufferGetUint32() -{ - uint32_t retVal = 0; - - if (bufferIsUint32Ready()) - { - for (uint32_t i = 0; i < 4; i++) - { - retVal <<= 8; - retVal |= bufferGet(); - } - } - - return retVal; -} - -static void generatorStart(void) -{ - nrf_rng_event_clear(NRF_RNG_EVENT_VALRDY); - nrf_rng_int_enable(NRF_RNG_INT_VALRDY_MASK); - nrf_rng_task_trigger(NRF_RNG_TASK_START); -} - -static void generatorStop(void) -{ - nrf_rng_int_disable(NRF_RNG_INT_VALRDY_MASK); - nrf_rng_task_trigger(NRF_RNG_TASK_STOP); -} - -void RNG_IRQHandler(void) -{ - if (nrf_rng_event_get(NRF_RNG_EVENT_VALRDY) && nrf_rng_int_get(NRF_RNG_INT_VALRDY_MASK)) - { - nrf_rng_event_clear(NRF_RNG_EVENT_VALRDY); - - bufferPut(nrf_rng_random_value_get()); - - if (bufferIsFull()) - { - generatorStop(); - } - } -} -#endif // SOFTDEVICE_PRESENT - -void nrf5RandomInit(void) -{ - uint32_t seed = 0; - -#if SOFTDEVICE_PRESENT - uint32_t retval; - - do - { - // Wait for the first randomized 4 bytes, to randomize software generator seed. - retval = sd_rand_application_vector_get((uint8_t *)&seed, sizeof(seed)); - } while (retval != NRF_SUCCESS && seed == 0); - -#else // SOFTDEVICE_PRESENT - memset(sBuffer, 0, sizeof(sBuffer)); - sReadPosition = 0; - sWritePosition = 0; - - NVIC_SetPriority(RNG_IRQn, RNG_IRQ_PRIORITY); - NVIC_ClearPendingIRQ(RNG_IRQn); - NVIC_EnableIRQ(RNG_IRQn); - - nrf_rng_error_correction_enable(); - nrf_rng_shorts_disable(NRF_RNG_SHORT_VALRDY_STOP_MASK); - generatorStart(); - - // Wait for the first randomized 4 bytes, to randomize software generator seed. - while (!bufferIsUint32Ready()) - ; - - seed = bufferGetUint32(); -#endif // SOFTDEVICE_PRESENT - - srand(seed); -} - -void nrf5RandomDeinit(void) -{ -#ifndef SOFTDEVICE_PRESENT - generatorStop(); - - NVIC_DisableIRQ(RNG_IRQn); - NVIC_ClearPendingIRQ(RNG_IRQn); - NVIC_SetPriority(RNG_IRQn, 0); -#endif // SOFTDEVICE_PRESENT -} - -otError otPlatEntropyGet(uint8_t *aOutput, uint16_t aOutputLength) -{ - otError error = OT_ERROR_NONE; - uint8_t copyLength; - uint16_t index = 0; - - assert(!sEntropyGetEntered); - sEntropyGetEntered = true; - - otEXPECT_ACTION(aOutput && aOutputLength, error = OT_ERROR_INVALID_ARGS); - - do - { -#if SOFTDEVICE_PRESENT - sd_rand_application_bytes_available_get(©Length); -#else // SOFTDEVICE_PRESENT - copyLength = (uint8_t)bufferCount(); -#endif // SOFTDEVICE_PRESENT - - if (copyLength > aOutputLength - index) - { - copyLength = aOutputLength - index; - } - - if (copyLength > 0) - { -#if SOFTDEVICE_PRESENT - uint32_t retval = sd_rand_application_vector_get(aOutput + index, copyLength); - otEXPECT_ACTION(retval == NRF_SUCCESS, error = OT_ERROR_FAILED); -#else // SOFTDEVICE_PRESENT - - for (uint32_t i = 0; i < copyLength; i++) - { - aOutput[i + index] = bufferGet(); - } - - generatorStart(); -#endif // SOFTDEVICE_PRESENT - - index += copyLength; - } - } while (index < aOutputLength); - -exit: - sEntropyGetEntered = false; - - return error; -} diff --git a/examples/platforms/nrf528xx/src/fem.c b/examples/platforms/nrf528xx/src/fem.c deleted file mode 100644 index 4a17849b5..000000000 --- a/examples/platforms/nrf528xx/src/fem.c +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2017, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements the OpenThread FEM helper functions. - * - */ - -#include -#include - -#include -#include - -#include "platform-config.h" -#include "platform-fem.h" - -#define ENABLE_FEM 1 -#include - -// clang-format off - -/** - * @brief Configuration parameters for the Front End Module. - */ -#define PLATFORM_FEM_DEFAULT_PA_PIN 26 /**< Default Power Amplifier pin. */ -#define PLATFORM_FEM_DEFAULT_LNA_PIN 27 /**< Default Low Noise Amplifier pin. */ -#define PLATFORM_FEM_DEFAULT_PDN_PIN 28 /**< Default Power Down pin. */ -#define PLATFORM_FEM_DEFAULT_SET_PPI_CHANNEL 15 /**< Default PPI channel for pin setting. */ -#define PLATFORM_FEM_DEFAULT_CLR_PPI_CHANNEL 16 /**< Default PPI channel for pin clearing. */ -#define PLATFORM_FEM_DEFAULT_PDN_PPI_CHANNEL 14 /**< Default PPI channel for Power Down control. */ -#define PLATFORM_FEM_DEFAULT_TIMER_MATCH_PPI_GROUP 4 /**< Default PPI channel group used to disable timer match PPI. */ -#define PLATFORM_FEM_DEFAULT_RADIO_DISABLED_PPI_GROUP 5 /**< Default PPI channel group used to disable radio disabled PPI. */ -#define PLATFORM_FEM_DEFAULT_PA_GPIOTE_CHANNEL 6 /**< Default PA GPIOTE channel for FEM control. */ -#define PLATFORM_FEM_DEFAULT_LNA_GPIOTE_CHANNEL 7 /**< Default LNA GPIOTE channel for FEM control. */ -#define PLATFORM_FEM_DEFAULT_PDN_GPIOTE_CHANNEL 5 /**< Default PDN GPIOTE channel for FEM control. */ - -/** - * @brief Configuration parameters for the Front End Module timings and gain. - */ -#define PLATFORM_FEM_PA_TIME_IN_ADVANCE_US 13 /**< Default time in microseconds when PA GPIO is activated before the radio is ready for transmission. */ -#define PLATFORM_FEM_LNA_TIME_IN_ADVANCE_US 13 /**< Default time in microseconds when LNA GPIO is activated before the radio is ready for reception. */ -#define PLATFORM_FEM_PDN_SETTLE_US 18 /**< Default the time between activating the PDN and asserting the RX_EN/TX_EN. */ -#define PLATFORM_FEM_TRX_HOLD_US 5 /**< Default the time between deasserting the RX_EN/TX_EN and deactivating PDN. */ -#define PLATFORM_FEM_PA_GAIN_DB 0 /**< Default PA gain. Ignored if the amplifier is not supporting this feature. */ -#define PLATFORM_FEM_LNA_GAIN_DB 0 /**< Default LNA gain. Ignored if the amplifier is not supporting this feature. */ - -// clang-format on - -#define PLATFORM_FEM_DEFAULT_CONFIG \ - ((PlatformFemConfigParams){ \ - .mFemPhyCfg = \ - { \ - .mPaTimeGapUs = PLATFORM_FEM_PA_TIME_IN_ADVANCE_US, \ - .mLnaTimeGapUs = PLATFORM_FEM_LNA_TIME_IN_ADVANCE_US, \ - .mPdnSettleUs = PLATFORM_FEM_PDN_SETTLE_US, \ - .mTrxHoldUs = PLATFORM_FEM_TRX_HOLD_US, \ - .mPaGainDb = PLATFORM_FEM_PA_GAIN_DB, \ - .mLnaGainDb = PLATFORM_FEM_LNA_GAIN_DB, \ - }, \ - .mPaCfg = \ - { \ - .mEnable = 1, \ - .mActiveHigh = 1, \ - .mGpioPin = PLATFORM_FEM_DEFAULT_PA_PIN, \ - .mGpioteChId = PLATFORM_FEM_DEFAULT_PA_GPIOTE_CHANNEL, \ - }, \ - .mLnaCfg = \ - { \ - .mEnable = 1, \ - .mActiveHigh = 1, \ - .mGpioPin = PLATFORM_FEM_DEFAULT_LNA_PIN, \ - .mGpioteChId = PLATFORM_FEM_DEFAULT_LNA_GPIOTE_CHANNEL, \ - }, \ - .mPdnCfg = \ - { \ - .mEnable = 1, \ - .mActiveHigh = 1, \ - .mGpioPin = PLATFORM_FEM_DEFAULT_PDN_PIN, \ - .mGpioteChId = PLATFORM_FEM_DEFAULT_PDN_GPIOTE_CHANNEL, \ - }, \ - .mPpiChIdClr = PLATFORM_FEM_DEFAULT_CLR_PPI_CHANNEL, \ - .mPpiChIdSet = PLATFORM_FEM_DEFAULT_SET_PPI_CHANNEL, \ - .mPpiChIdPdn = PLATFORM_FEM_DEFAULT_PDN_PPI_CHANNEL, \ - }) - -/** - * @brief Configuration parameters for FEM PHY. - */ -typedef struct -{ - uint32_t mPaTimeGapUs; - uint32_t mLnaTimeGapUs; - uint32_t mPdnSettleUs; - uint32_t mTrxHoldUs; - uint8_t mPaGainDb; - uint8_t mLnaGainDb; -} PlatformFemPhyConfig; - -/** - * @brief Configuration parameters for the PA and LNA. - */ -typedef struct -{ - uint8_t mEnable : 1; /**< Enable toggling for this amplifier */ - uint8_t mActiveHigh : 1; /**< Set the pin to be active high */ - uint8_t mGpioPin : 6; /**< The GPIO pin to toggle for this amplifier */ - uint8_t mGpioteChId; /**< The GPIOTE Channel ID used for toggling pins */ -} PlatformFemPinConfig; - -/** - * @brief PA & LNA GPIO toggle configuration - * - * This option configures the nRF 802.15.4 radio driver to toggle pins when the radio - * is active for use with a power amplifier and/or a low noise amplifier. - * - * Toggling the pins is achieved by using two PPI channels and a GPIOTE channel. The hardware channel IDs are provided - * by the application and should be regarded as reserved as long as any PA/LNA toggling is enabled. - * - * @note Changing this configuration while the radio is in use may have undefined - * consequences and must be avoided by the application. - */ -typedef struct -{ - PlatformFemPhyConfig mFemPhyCfg; /**< Front End Module Physical layer configuration */ - PlatformFemPinConfig mPaCfg; /**< Power Amplifier configuration */ - PlatformFemPinConfig mLnaCfg; /**< Low Noise Amplifier configuration */ - PlatformFemPinConfig mPdnCfg; /**< Power Down configuration */ - uint8_t mPpiChIdSet; /**< PPI channel to be used for setting pins */ - uint8_t mPpiChIdClr; /**< PPI channel to be used for clearing pins */ - uint8_t mPpiChIdPdn; /**< PPI channel to handle PDN pin */ -} PlatformFemConfigParams; - -void PlatformFemSetConfigParams(const PlatformFemConfigParams *aConfig) -{ - nrf_fem_interface_config_t cfg; - - memset(&cfg, 0, sizeof(cfg)); - - cfg.fem_config.pa_time_gap_us = aConfig->mFemPhyCfg.mPaTimeGapUs; - cfg.fem_config.lna_time_gap_us = aConfig->mFemPhyCfg.mLnaTimeGapUs; - cfg.fem_config.pdn_settle_us = aConfig->mFemPhyCfg.mPdnSettleUs; - cfg.fem_config.trx_hold_us = aConfig->mFemPhyCfg.mTrxHoldUs; - cfg.fem_config.pa_gain_db = aConfig->mFemPhyCfg.mPaGainDb; - cfg.fem_config.lna_gain_db = aConfig->mFemPhyCfg.mLnaGainDb; - cfg.pa_pin_config.enable = aConfig->mPaCfg.mEnable; - cfg.pa_pin_config.active_high = aConfig->mPaCfg.mActiveHigh; - cfg.pa_pin_config.gpio_pin = aConfig->mPaCfg.mGpioPin; - cfg.pa_pin_config.gpiote_ch_id = aConfig->mPaCfg.mGpioteChId; - cfg.lna_pin_config.enable = aConfig->mLnaCfg.mEnable; - cfg.lna_pin_config.active_high = aConfig->mLnaCfg.mActiveHigh; - cfg.lna_pin_config.gpio_pin = aConfig->mLnaCfg.mGpioPin; - cfg.lna_pin_config.gpiote_ch_id = aConfig->mLnaCfg.mGpioteChId; - cfg.pdn_pin_config.enable = aConfig->mPdnCfg.mEnable; - cfg.pdn_pin_config.active_high = aConfig->mPdnCfg.mActiveHigh; - cfg.pdn_pin_config.gpio_pin = aConfig->mPdnCfg.mGpioPin; - cfg.pdn_pin_config.gpiote_ch_id = aConfig->mPdnCfg.mGpioteChId; - cfg.ppi_ch_id_clr = aConfig->mPpiChIdClr; - cfg.ppi_ch_id_set = aConfig->mPpiChIdSet; - cfg.ppi_ch_id_pdn = aConfig->mPpiChIdPdn; - - nrf_fem_interface_configuration_set(&cfg); -} - -void nrf5FemInit(void) -{ -#if PLATFORM_FEM_ENABLE_DEFAULT_CONFIG - PlatformFemSetConfigParams(&PLATFORM_FEM_DEFAULT_CONFIG); -#endif -} - -void nrf5FemDeinit(void) -{ -} - -void nrf5FemEnable(void) -{ -} - -void nrf5FemDisable(void) -{ -} diff --git a/examples/platforms/nrf528xx/src/flash.c b/examples/platforms/nrf528xx/src/flash.c deleted file mode 100644 index 5282cd236..000000000 --- a/examples/platforms/nrf528xx/src/flash.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include "platform-nrf5.h" - -/** - * @def PLATFORM_FLASH_PAGE_NUM - * - * Number of flash pages to use for OpenThread's non-volatile settings. - * - * @note This define applies only for MDK-ARM Keil toolchain configuration. - * - */ -#ifndef PLATFORM_FLASH_PAGE_NUM -#define PLATFORM_FLASH_PAGE_NUM 4 -#endif - -#define FLASH_PAGE_ADDR_MASK 0xFFFFF000 -#define FLASH_PAGE_SIZE 4096 - -static uint32_t sFlashDataStart; -static uint32_t sFlashDataEnd; -static uint32_t sSwapSize; - -static inline uint32_t mapAddress(uint8_t aSwapIndex, uint32_t aOffset) -{ - uint32_t address; - - address = sFlashDataStart + aOffset; - - if (aSwapIndex) - { - address += sSwapSize; - } - - return address; -} - -void otPlatFlashInit(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - -#if defined(__CC_ARM) - // Temporary solution for Keil compiler. - uint32_t const bootloaderAddr = NRF_UICR->NRFFW[0]; - uint32_t const pageSize = NRF_FICR->CODEPAGESIZE; - uint32_t const codeSize = NRF_FICR->CODESIZE; - - if (bootloaderAddr != 0xFFFFFFFF) - { - sFlashDataEnd = bootloaderAddr; - } - else - { - sFlashDataEnd = pageSize * codeSize; - } - - sFlashDataStart = sFlashDataEnd - (pageSize * PLATFORM_FLASH_PAGE_NUM); - -#elif defined(__GNUC__) || defined(__ICCARM__) - extern uint32_t __start_ot_flash_data; - extern uint32_t __stop_ot_flash_data; - - sFlashDataStart = (uint32_t)&__start_ot_flash_data; - sFlashDataEnd = (uint32_t)&__stop_ot_flash_data; - -#endif - - // Just ensure that the start and end addresses are page-aligned. - assert((sFlashDataStart % FLASH_PAGE_SIZE) == 0); - assert((sFlashDataEnd % FLASH_PAGE_SIZE) == 0); - - sSwapSize = ((sFlashDataEnd - sFlashDataStart) / FLASH_PAGE_SIZE / 2) * FLASH_PAGE_SIZE; - assert(sSwapSize > 0); -} - -uint32_t otPlatFlashGetSwapSize(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - return sSwapSize; -} - -void otPlatFlashErase(otInstance *aInstance, uint8_t aSwapIndex) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error; - - for (uint32_t offset = 0; offset < sSwapSize; offset += FLASH_PAGE_SIZE) - { - error = nrf5FlashPageErase(mapAddress(aSwapIndex, offset)); - assert(error == OT_ERROR_NONE); - - while (nrf5FlashIsBusy()) - { - } - } - - OT_UNUSED_VARIABLE(error); -} - -void otPlatFlashWrite(otInstance *aInstance, uint8_t aSwapIndex, uint32_t aOffset, const void *aData, uint32_t aSize) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error; - - error = nrf5FlashWrite(mapAddress(aSwapIndex, aOffset), aData, aSize); - assert(error == OT_ERROR_NONE); - - OT_UNUSED_VARIABLE(error); -} - -void otPlatFlashRead(otInstance *aInstance, uint8_t aSwapIndex, uint32_t aOffset, void *aData, uint32_t aSize) -{ - OT_UNUSED_VARIABLE(aInstance); - - memcpy(aData, (uint8_t *)mapAddress(aSwapIndex, aOffset), aSize); -} diff --git a/examples/platforms/nrf528xx/src/flash_nosd.c b/examples/platforms/nrf528xx/src/flash_nosd.c deleted file mode 100644 index 711ab38e4..000000000 --- a/examples/platforms/nrf528xx/src/flash_nosd.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2017, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include - -#include "platform-nrf5.h" -#include "drivers/include/nrfx_nvmc.h" - -otError nrf5FlashPageErase(uint32_t aAddress) -{ - nrfx_nvmc_page_erase(aAddress); - - return OT_ERROR_NONE; -} - -bool nrf5FlashIsBusy(void) -{ - return NRF_NVMC->READY != NVMC_READY_READY_Ready; -} - -otError nrf5FlashWrite(uint32_t aAddress, const uint8_t *aData, uint32_t aSize) -{ - nrfx_nvmc_bytes_write(aAddress, aData, aSize); - - return OT_ERROR_NONE; -} diff --git a/examples/platforms/nrf528xx/src/flash_sd.c b/examples/platforms/nrf528xx/src/flash_sd.c deleted file mode 100644 index fbac9d3ef..000000000 --- a/examples/platforms/nrf528xx/src/flash_sd.c +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (c) 2017, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include - -#include -#include -#include - -#include - -#include - -#include "platform-nrf5.h" -#include "softdevice.h" - -#define FLASH_PAGE_SIZE 4096 -#define FLASH_MAX_RETRY 5 - -typedef enum -{ - FLASH_STATE_IDLE, - FLASH_STATE_WAITING_FOR_IDLE, - FLASH_STATE_PENDING, - FLASH_STATE_COMPLETE_SUCCESS, - FLASH_STATE_COMPLETE_FAILED -} SdFlashState; - -static volatile SdFlashState sState; - -void nrf5SdSocFlashProcess(uint32_t aEvtId) -{ - switch (aEvtId) - { - case NRF_EVT_FLASH_OPERATION_SUCCESS: - switch (sState) - { - case FLASH_STATE_PENDING: - sState = FLASH_STATE_COMPLETE_SUCCESS; - break; - - case FLASH_STATE_WAITING_FOR_IDLE: - sState = FLASH_STATE_IDLE; - break; - - default: - break; - } - - break; - - case NRF_EVT_FLASH_OPERATION_ERROR: - switch (sState) - { - case FLASH_STATE_PENDING: - sState = FLASH_STATE_COMPLETE_FAILED; - break; - - case FLASH_STATE_WAITING_FOR_IDLE: - sState = FLASH_STATE_IDLE; - break; - - default: - break; - } - - break; - - default: - break; - } -} - -static void waitInState(SdFlashState state) -{ - do - { - nrf_sdh_evts_poll(); - - } while (sState == state); -} - -static otError sdFlashSingleWrite(uint32_t aAddress, const uint8_t *aData, uint32_t aSize) -{ - uint32_t retval; - uint32_t maxRetry = FLASH_MAX_RETRY; - - do - { - nrf_sdh_suspend(); - - do - { - sState = FLASH_STATE_PENDING; - - retval = sd_flash_write((uint32_t *)aAddress, (uint32_t *)aData, aSize); - - if (retval == NRF_SUCCESS) - { - break; - } - else if (retval == NRF_ERROR_BUSY) - { - sState = FLASH_STATE_WAITING_FOR_IDLE; - } - else - { - assert(false); - } - - waitInState(FLASH_STATE_WAITING_FOR_IDLE); - - } while (retval == NRF_ERROR_BUSY); - - waitInState(FLASH_STATE_PENDING); - - if (sState != FLASH_STATE_COMPLETE_SUCCESS) - { - retval = NRF_ERROR_INTERNAL; - } - - sState = FLASH_STATE_IDLE; - - nrf_sdh_resume(); - - } while (retval != NRF_SUCCESS && maxRetry--); - - return nrf5SdErrorToOtError(retval); -} - -otError nrf5FlashPageErase(uint32_t aAddress) -{ - uint32_t retval; - uint32_t maxRetry = FLASH_MAX_RETRY; - - do - { - nrf_sdh_suspend(); - - do - { - sState = FLASH_STATE_PENDING; - - retval = sd_flash_page_erase(aAddress / FLASH_PAGE_SIZE); - - if (retval == NRF_SUCCESS) - { - break; - } - else if (retval == NRF_ERROR_BUSY) - { - sState = FLASH_STATE_WAITING_FOR_IDLE; - } - else - { - assert(false); - } - - waitInState(FLASH_STATE_WAITING_FOR_IDLE); - - } while (retval == NRF_ERROR_BUSY); - - waitInState(FLASH_STATE_PENDING); - - if (sState != FLASH_STATE_COMPLETE_SUCCESS) - { - retval = NRF_ERROR_INTERNAL; - } - - sState = FLASH_STATE_IDLE; - - nrf_sdh_resume(); - - } while (retval != NRF_SUCCESS && maxRetry--); - - return nrf5SdErrorToOtError(retval); -} - -bool nrf5FlashIsBusy(void) -{ - return sState != FLASH_STATE_IDLE; -} - -otError nrf5FlashWrite(uint32_t aAddress, const uint8_t *aData, uint32_t aSize) -{ - otError error = OT_ERROR_NONE; - uint32_t remainder = (aAddress % sizeof(uint32_t)); - uint32_t blockSize; - uint32_t blockValue; - - otEXPECT_ACTION(sState == FLASH_STATE_IDLE, error = OT_ERROR_BUSY); - - // Check if @p aAddress is aligned to full word size. If not, make additional - // flash write at the beginning. - if (remainder) - { - blockSize = MIN((sizeof(uint32_t) - remainder), aSize); - blockValue = 0xffffffff; - - memcpy((uint8_t *)&blockValue + remainder, aData, blockSize); - - error = sdFlashSingleWrite(aAddress - remainder, (uint8_t *)&blockValue, sizeof(blockValue) / sizeof(uint32_t)); - - otEXPECT(error == OT_ERROR_NONE); - - aAddress += blockSize; - aData += blockSize; - aSize -= blockSize; - } - - otEXPECT(aSize); - - // Store the middle block of data. - remainder = aSize % sizeof(uint32_t); - blockSize = aSize - remainder; - - error = sdFlashSingleWrite(aAddress, aData, blockSize / sizeof(uint32_t)); - - otEXPECT(error == OT_ERROR_NONE); - - aAddress += blockSize; - aData += blockSize; - aSize -= blockSize; - - // Store any additional bytes that didn't fit into middle block. - if (remainder) - { - blockValue = 0xffffffff; - - memcpy((uint8_t *)&blockValue, aData, remainder); - - error = sdFlashSingleWrite(aAddress, (uint8_t *)&blockValue, sizeof(blockValue) / sizeof(uint32_t)); - - otEXPECT(error == OT_ERROR_NONE); - } - -exit: - return error; -} diff --git a/examples/platforms/nrf528xx/src/logging.c b/examples/platforms/nrf528xx/src/logging.c deleted file mode 100644 index 9110f393a..000000000 --- a/examples/platforms/nrf528xx/src/logging.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements the OpenThread platform abstraction for logging. - * - */ - -#include -#include -#include -#include - -#include - -#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) -void nrf5LogInit(void) -{ - utilsLogRttInit(); -} - -void nrf5LogDeinit(void) -{ - utilsLogRttDeinit(); -} - -OT_TOOL_WEAK void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...) -{ - va_list ap; - - va_start(ap, aFormat); - - utilsLogRttOutput(aLogLevel, aLogRegion, aFormat, ap); - - va_end(ap); -} -#endif diff --git a/examples/platforms/nrf528xx/src/misc.c b/examples/platforms/nrf528xx/src/misc.c deleted file mode 100644 index 740fc8da8..000000000 --- a/examples/platforms/nrf528xx/src/misc.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include - -#include "platform-nrf5-transport.h" -#include "platform-nrf5.h" - -#if SOFTDEVICE_PRESENT -#include "softdevice.h" -#endif // SOFTDEVICE_PRESENT - -static uint32_t sResetReason; - -bool gPlatformPseudoResetWasRequested; - -#if NRF52840_XXAA -__WEAK void nrf5CryptoInit(void) -{ - // This function is defined as weak so it could be overridden with external implementation. -} - -__WEAK void nrf5CryptoDeinit(void) -{ - // This function is defined as weak so it could be overridden with external implementation. -} -#endif - -void nrf5MiscInit(void) -{ -#if SOFTDEVICE_PRESENT - sd_power_reset_reason_get(&sResetReason); - sd_power_reset_reason_clr(0xFFFFFFFF); -#else - sResetReason = NRF_POWER->RESETREAS; - NRF_POWER->RESETREAS = 0xFFFFFFFF; -#endif // SOFTDEVICE_PRESENT -} - -void nrf5MiscDeinit(void) -{ - // Intentionally empty. -} - -void otPlatReset(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - gPlatformPseudoResetWasRequested = nrf5TransportPseudoResetRequired(); - - if (gPlatformPseudoResetWasRequested) - { - sResetReason = POWER_RESETREAS_SREQ_Msk; - } - else - { - NVIC_SystemReset(); - } -} - -otPlatResetReason otPlatGetResetReason(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - otPlatResetReason reason; - - if (sResetReason & POWER_RESETREAS_RESETPIN_Msk) - { - reason = OT_PLAT_RESET_REASON_EXTERNAL; - } - else if (sResetReason & POWER_RESETREAS_DOG_Msk) - { - reason = OT_PLAT_RESET_REASON_WATCHDOG; - } - else if (sResetReason & POWER_RESETREAS_SREQ_Msk) - { - reason = OT_PLAT_RESET_REASON_SOFTWARE; - } - else if (sResetReason & POWER_RESETREAS_LOCKUP_Msk) - { - reason = OT_PLAT_RESET_REASON_FAULT; - } - else if ((sResetReason & POWER_RESETREAS_OFF_Msk) || (sResetReason & POWER_RESETREAS_DIF_Msk)) - { - reason = OT_PLAT_RESET_REASON_OTHER; - } -#if NRF52840_XXAA - else if ((sResetReason & POWER_RESETREAS_LPCOMP_Msk) || (sResetReason & POWER_RESETREAS_NFC_Msk) || - (sResetReason & POWER_RESETREAS_VBUS_Msk)) - { - reason = OT_PLAT_RESET_REASON_OTHER; - } -#endif // NRF52840_XXAA - else - { - reason = OT_PLAT_RESET_REASON_POWER_ON; - } - - return reason; -} - -void otPlatWakeHost(void) -{ - // TODO: implement an operation to wake the host from sleep state. -} diff --git a/examples/platforms/nrf528xx/src/platform-fem.h b/examples/platforms/nrf528xx/src/platform-fem.h deleted file mode 100644 index c6ab1623f..000000000 --- a/examples/platforms/nrf528xx/src/platform-fem.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2017, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes front end module platform-specific functions. - * - */ - -#ifndef PLATFORM_FEM_H_ -#define PLATFORM_FEM_H_ - -#include - -/** - * Initialization of the FEM. - * - */ -void nrf5FemInit(void); - -/** - * Deinitialization of the FEM. - * - */ -void nrf5FemDeinit(void); - -/** - * Enable the FEM. - * - */ -void nrf5FemEnable(void); - -/** - * Disable the FEM. - * - */ -void nrf5FemDisable(void); - -#endif // PLATFORM_FEM_H_ diff --git a/examples/platforms/nrf528xx/src/platform-nrf5-transport.h b/examples/platforms/nrf528xx/src/platform-nrf5-transport.h deleted file mode 100644 index e10507fa9..000000000 --- a/examples/platforms/nrf528xx/src/platform-nrf5-transport.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2020, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the platform-specific transport initializers. - * - */ - -#ifndef PLATFORM_NRF5_TRANSPORT_H_ -#define PLATFORM_NRF5_TRANSPORT_H_ - -#include - -#include "transport-config.h" - -/** - * Initialization of transport. - * - */ -void nrf5TransportInit(bool aPseudoReset); - -/** - * Deinitialization of transport. - * - */ -void nrf5TransportDeinit(bool aPseudoReset); - -/** - * This function performs transport processing. - * - */ -void nrf5TransportProcess(void); - -/** - * This function returns true if transport driver should not be affected - * by reset. Otherwise, false is returned. - */ -bool nrf5TransportPseudoResetRequired(void); - -#endif diff --git a/examples/platforms/nrf528xx/src/platform-nrf5.h b/examples/platforms/nrf528xx/src/platform-nrf5.h deleted file mode 100644 index 2034a2f2c..000000000 --- a/examples/platforms/nrf528xx/src/platform-nrf5.h +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the platform-specific initializers. - * - */ - -#ifndef PLATFORM_NRF5_H_ -#define PLATFORM_NRF5_H_ - -#include - -#include - -#include "platform-config.h" - -void nrf5AlarmInit(void); - -/** - * Deinitialization of Alarm driver. - * - */ -void nrf5AlarmDeinit(void); - -/** - * Function for processing Alarm. - * - */ -void nrf5AlarmProcess(otInstance *aInstance); - -/** - * Function for geting current time in mircosecond. - * - */ -uint64_t nrf5AlarmGetCurrentTime(void); - -/** - * Function for getting raw counter value in RTC ticks. - * - */ -uint64_t nrf5AlarmGetRawCounter(void); - -/** - * Initialization of Random Number Generator. - * - */ -void nrf5RandomInit(void); - -/** - * Deinitialization of Random Number Generator. - * - */ -void nrf5RandomDeinit(void); - -/** - * Initialization of Logger driver. - * - */ -void nrf5LogInit(void); - -/** - * Deinitialization of Logger driver. - * - */ -void nrf5LogDeinit(void); - -/** - * Initialization of Misc module. - * - */ -void nrf5MiscInit(void); - -/** - * Deinitialization of Misc module. - * - */ -void nrf5MiscDeinit(void); - -/** - * Initialization of Radio driver. - * - */ -void nrf5RadioInit(void); - -/** - * Deinitialization of Radio driver. - * - */ -void nrf5RadioDeinit(void); - -/** - * Function for processing Radio. - * - */ -void nrf5RadioProcess(otInstance *aInstance); - -/** - * Function for clearing Radio driver pending events. - * - */ -void nrf5RadioClearPendingEvents(void); - -/** - * Initialization of hardware crypto engine. - * - */ -void nrf5CryptoInit(void); - -/** - * Deinitialization of hardware crypto engine. - * - */ -void nrf5CryptoDeinit(void); - -/** - * Function for erasing page in flash. - * - */ -otError nrf5FlashPageErase(uint32_t aAddress); - -/** - * Function for checking state of flash driver. - * - */ -bool nrf5FlashIsBusy(void); - -/** - * Function for writing data into flash. - * - */ -otError nrf5FlashWrite(uint32_t aAddress, const uint8_t *aData, uint32_t aSize); - -/** - * Initialization of temperature controller. - * - */ -void nrf5TempInit(void); - -/** - * Deinitialization of temperature controller. - * - */ -void nrf5TempDeinit(void); - -/** - * Function for processing temperature controller. - * - */ -void nrf5TempProcess(void); - -/** - * Function for measuring internal temperature. - * - * @return Temperature value measured. - * - */ -int32_t nrf5TempGet(void); - -#if SOFTDEVICE_PRESENT -/** - * Function for translating SoftDevice error into OpenThread's one. - * - */ -otError nrf5SdErrorToOtError(uint32_t aSdError); - -/** - * Function for processing SoftDevice SoC events in flash module. - * - */ -void nrf5SdSocFlashProcess(uint32_t aEvtId); -#endif // SOFTDEVICE_PRESENT - -int8_t nrf5GetChannelMaxTransmitPower(uint8_t aChannel); - -/** - * Callback function for region changed. - * - */ -void nrf5HandleRegionChanged(uint16_t aRegionCode); - -#endif // PLATFORM_NRF5_H_ diff --git a/examples/platforms/nrf528xx/src/platform-softdevice.h b/examples/platforms/nrf528xx/src/platform-softdevice.h deleted file mode 100644 index ba7429f5a..000000000 --- a/examples/platforms/nrf528xx/src/platform-softdevice.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2017, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the SoftDevice platform-specific functions. - * - */ - -#ifndef PLATFORM_SOFTDEVICE_H_ -#define PLATFORM_SOFTDEVICE_H_ - -#include - -/** @brief RAAL Softdevice default parameters. */ -#define PLATFORM_SOFTDEVICE_RAAL_TIMESLOT_DEFAULT_LENGTH 6400 -#define PLATFORM_SOFTDEVICE_RAAL_TIMESLOT_DEFAULT_ALLOC_ITERS 5 -#define PLATFORM_SOFTDEVICE_RAAL_TIMESLOT_DEFAULT_SAFE_MARGIN 126 -#define PLATFORM_SOFTDEVICE_RAAL_TIMESLOT_DEFAULT_TIMEOUT 6400 -#define PLATFORM_SOFTDEVICE_RAAL_TIMESLOT_DEFAULT_MAX_LENGTH 120000000 -#define PLATFORM_SOFTDEVICE_RAAL_DEFAULT_LF_CLK_ACCURACY_PPM 500 - -/** @brief RAAL Softdevice configuration parameters. */ -typedef struct -{ - uint32_t timeslotLength; /**< Timeslot length requested by the module in microseconds. */ - uint32_t - timeslotTimeout; /**< Longest acceptable delay until the start of the requested timeslot in microseconds. */ - uint32_t timeslotMaxLength; /**< Maximum single timeslot length created by extension processing in microseconds. */ - uint16_t timeslotAllocIters; /**< Maximum number of iteration of dividing timeslot_length by factor of 2 performed - by arbiter. */ - uint16_t timeslotSafeMargin; /**< Safe margin before timeslot is finished and nrf_raal_timeslot_ended should be - called in microseconds. */ - uint16_t lfClkAccuracyPpm; /**< Clock accuracy in ppm unit. */ -} otSysSoftdeviceRaalConfigParams; - -/** - * Function for processing SoftDevice SoC events. - * - */ -void otSysSoftdeviceSocEvtHandler(uint32_t aEvtId); - -/** - * Function used to set non-default parameters of Softdevice RAAL. - * - */ -void otSysSoftdeviceRaalConfig(const otSysSoftdeviceRaalConfigParams *aConfig); - -#endif // PLATFORM_SOFTDEVICE_H_ diff --git a/examples/platforms/nrf528xx/src/radio.c b/examples/platforms/nrf528xx/src/radio.c deleted file mode 100644 index 1aefd2128..000000000 --- a/examples/platforms/nrf528xx/src/radio.c +++ /dev/null @@ -1,1483 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements the OpenThread platform abstraction for radio communication. - * - */ - -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include "common/code_utils.hpp" -#include "utils/code_utils.h" -#include "utils/link_metrics.h" -#include "utils/mac_frame.h" - -#include -#include -#include -#include -#include - -#include "openthread-system.h" -#include "platform-fem.h" -#include "platform-nrf5.h" - -#include -#include -#include - -#include -#include -#include - -// clang-format off - -#define SHORT_ADDRESS_SIZE 2 ///< Size of MAC short address. -#define US_PER_MS 1000ULL ///< Microseconds in millisecond. - -#define ACK_REQUEST_OFFSET 1 ///< Byte containing Ack request bit (+1 for frame length byte). -#define ACK_REQUEST_BIT (1 << 5) ///< Ack request bit. -#define FRAME_PENDING_OFFSET 1 ///< Byte containing pending bit (+1 for frame length byte). -#define FRAME_PENDING_BIT (1 << 4) ///< Frame Pending bit. -#define SECURITY_ENABLED_OFFSET 1 ///< Byte containing security enabled bit (+1 for frame length byte). -#define SECURITY_ENABLED_BIT (1 << 3) ///< Security enabled bit. - -#define RSSI_SETTLE_TIME_US 40 ///< RSSI settle time in microseconds. -#define SAFE_DELTA 1000 ///< A safe value for the `dt` parameter of delayed operations. - -#if defined(__ICCARM__) -_Pragma("diag_suppress=Pe167") -#endif - -enum -{ - NRF528XX_RECEIVE_SENSITIVITY = -100, // dBm - NRF528XX_MIN_CCA_ED_THRESHOLD = -94, // dBm -}; - -// clang-format on - -static bool sDisabled; - -static otError sReceiveError = OT_ERROR_NONE; -static otRadioFrame sReceivedFrames[NRF_802154_RX_BUFFERS]; -static otRadioFrame sTransmitFrame; -static uint8_t sTransmitPsdu[OT_RADIO_FRAME_MAX_SIZE + 1]; - -#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT -static otExtAddress sExtAddress; -static otRadioIeInfo sTransmitIeInfo; -static otInstance * sInstance = NULL; -#endif - -static otRadioFrame sAckFrame; -static bool sAckedWithFramePending; - -static int8_t sMaxTxPowerTable[OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MAX - OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MIN + 1]; -static int8_t sDefaultTxPower; -static int8_t sLnaGain = 0; -static uint16_t sRegionCode = 0; - -static uint32_t sEnergyDetectionTime; -static uint8_t sEnergyDetectionChannel; -static int8_t sEnergyDetected; - -#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE -static uint32_t sCslPeriod; -static uint32_t sCslSampleTime; -static const uint8_t sCslIeHeader[OT_IE_HEADER_SIZE] = {CSL_IE_HEADER_BYTES_LO, CSL_IE_HEADER_BYTES_HI}; -#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE - -typedef enum -{ - kPendingEventSleep, // Requested to enter Sleep state. - kPendingEventFrameTransmitted, // Transmitted frame and received ACK (if requested). - kPendingEventChannelAccessFailure, // Failed to transmit frame (channel busy). - kPendingEventInvalidOrNoAck, // Failed to transmit frame (received invalid or no ACK). - kPendingEventReceiveFailed, // Failed to receive a valid frame. - kPendingEventEnergyDetectionStart, // Requested to start Energy Detection procedure. - kPendingEventEnergyDetected, // Energy Detection finished. -} RadioPendingEvents; - -static uint32_t sPendingEvents; - -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 -static uint32_t sMacFrameCounter; -static uint8_t sKeyId; -static struct otMacKey sPrevKey; -static struct otMacKey sCurrKey; -static struct otMacKey sNextKey; -static bool sAckedWithSecEnhAck; -static uint32_t sAckFrameCounter; -static uint8_t sAckKeyId; -#endif - -static int8_t GetTransmitPowerForChannel(uint8_t aChannel) -{ - int8_t channelMaxPower = nrf5GetChannelMaxTransmitPower(aChannel); - int8_t power = 0; // 0 dbm as default value - - if (sDefaultTxPower != OT_RADIO_POWER_INVALID) - { - power = OT_MIN(channelMaxPower, sDefaultTxPower); - } - else if (channelMaxPower != OT_RADIO_POWER_INVALID) - { - power = channelMaxPower; - } - - return power; -} - -static void dataInit(void) -{ - sDisabled = true; - - sDefaultTxPower = OT_RADIO_POWER_INVALID; - sTransmitFrame.mPsdu = sTransmitPsdu + 1; -#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT - sTransmitFrame.mInfo.mTxInfo.mIeInfo = &sTransmitIeInfo; -#endif - - sReceiveError = OT_ERROR_NONE; - - for (uint32_t i = 0; i < NRF_802154_RX_BUFFERS; i++) - { - sReceivedFrames[i].mPsdu = NULL; - } - - for (size_t i = 0; i < OT_ARRAY_LENGTH(sMaxTxPowerTable); i++) - { - sMaxTxPowerTable[i] = OT_RADIO_POWER_INVALID; - } - - memset(&sAckFrame, 0, sizeof(sAckFrame)); -} - -static void convertShortAddress(uint8_t *aTo, uint16_t aFrom) -{ - aTo[0] = (uint8_t)aFrom; - aTo[1] = (uint8_t)(aFrom >> 8); -} - -#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE -static void convertExtAddress(uint8_t *aTo, const otExtAddress *aFrom) -{ - for (uint8_t i = 0; i < sizeof(otExtAddress); i++) - { - aTo[i] = aFrom->m8[sizeof(otExtAddress) - i - 1]; - } -} -#endif - -static inline bool isPendingEventSet(RadioPendingEvents aEvent) -{ - return sPendingEvents & (1UL << aEvent); -} - -static void setPendingEvent(RadioPendingEvents aEvent) -{ - volatile uint32_t pendingEvents; - uint32_t bitToSet = 1UL << aEvent; - - do - { - pendingEvents = __LDREXW((uint32_t *)&sPendingEvents); - pendingEvents |= bitToSet; - } while (__STREXW(pendingEvents, (uint32_t *)&sPendingEvents)); - - otSysEventSignalPending(); -} - -static void resetPendingEvent(RadioPendingEvents aEvent) -{ - volatile uint32_t pendingEvents; - uint32_t bitsToRemain = ~(1UL << aEvent); - - do - { - pendingEvents = __LDREXW((uint32_t *)&sPendingEvents); - pendingEvents &= bitsToRemain; - } while (__STREXW(pendingEvents, (uint32_t *)&sPendingEvents)); -} - -static inline void clearPendingEvents(void) -{ - // Clear pending events that could cause race in the MAC layer. - volatile uint32_t pendingEvents; - uint32_t bitsToRemain = ~(0UL); - - bitsToRemain &= ~(1UL << kPendingEventSleep); - - do - { - pendingEvents = __LDREXW((uint32_t *)&sPendingEvents); - pendingEvents &= bitsToRemain; - } while (__STREXW(pendingEvents, (uint32_t *)&sPendingEvents)); -} - -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 -static void txAckProcessSecurity(uint8_t *aAckFrame) -{ - otRadioFrame ackFrame; - struct otMacKey *key = NULL; - uint8_t keyId; - - sAckedWithSecEnhAck = false; - otEXPECT(aAckFrame[SECURITY_ENABLED_OFFSET] & SECURITY_ENABLED_BIT); - - memset(&ackFrame, 0, sizeof(ackFrame)); - ackFrame.mPsdu = &aAckFrame[1]; - ackFrame.mLength = aAckFrame[0]; - - keyId = otMacFrameGetKeyId(&ackFrame); - - otEXPECT(otMacFrameIsKeyIdMode1(&ackFrame) && keyId != 0); - - if (keyId == sKeyId) - { - key = &sCurrKey; - } - else if (keyId == sKeyId - 1) - { - key = &sPrevKey; - } - else if (keyId == sKeyId + 1) - { - key = &sNextKey; - } - else - { - otEXPECT(false); - } - - sAckFrameCounter = sMacFrameCounter; - sAckKeyId = keyId; - sAckedWithSecEnhAck = true; - - ackFrame.mInfo.mTxInfo.mAesKey = key; - - otMacFrameSetKeyId(&ackFrame, keyId); - otMacFrameSetFrameCounter(&ackFrame, sMacFrameCounter++); - - otMacFrameProcessTransmitAesCcm(&ackFrame, &sExtAddress); - -exit: - return; -} -#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 - -#if !OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE -void otPlatRadioGetIeeeEui64(otInstance *aInstance, uint8_t *aIeeeEui64) -{ - OT_UNUSED_VARIABLE(aInstance); - - uint64_t factoryAddress; - uint32_t index = 0; - - // Set the MAC Address Block Larger (MA-L) formerly called OUI. - aIeeeEui64[index++] = (OPENTHREAD_CONFIG_STACK_VENDOR_OUI >> 16) & 0xff; - aIeeeEui64[index++] = (OPENTHREAD_CONFIG_STACK_VENDOR_OUI >> 8) & 0xff; - aIeeeEui64[index++] = OPENTHREAD_CONFIG_STACK_VENDOR_OUI & 0xff; - - // Use device identifier assigned during the production. - factoryAddress = (uint64_t)NRF_FICR->DEVICEID[0] << 32; - factoryAddress |= NRF_FICR->DEVICEID[1]; - memcpy(aIeeeEui64 + index, &factoryAddress, sizeof(factoryAddress) - index); -} -#endif // OPENTHREAD_CONFIG_ENABLE_PLATFORM_EUI64_CUSTOM_SOURCE - -void otPlatRadioSetPanId(otInstance *aInstance, uint16_t aPanId) -{ - OT_UNUSED_VARIABLE(aInstance); - - uint8_t address[SHORT_ADDRESS_SIZE]; - convertShortAddress(address, aPanId); - - nrf_802154_pan_id_set(address); -} - -void otPlatRadioSetExtendedAddress(otInstance *aInstance, const otExtAddress *aExtAddress) -{ - OT_UNUSED_VARIABLE(aInstance); -#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT - for (size_t i = 0; i < sizeof(*aExtAddress); i++) - { - sExtAddress.m8[i] = aExtAddress->m8[sizeof(*aExtAddress) - 1 - i]; - } -#endif - nrf_802154_extended_address_set(aExtAddress->m8); -} - -void otPlatRadioSetShortAddress(otInstance *aInstance, uint16_t aShortAddress) -{ - OT_UNUSED_VARIABLE(aInstance); - - uint8_t address[SHORT_ADDRESS_SIZE]; - convertShortAddress(address, aShortAddress); - - nrf_802154_short_address_set(address); -} - -void nrf5RadioInit(void) -{ - dataInit(); - nrf_802154_init(); -} - -void nrf5RadioDeinit(void) -{ - nrf_802154_sleep(); - nrf_802154_deinit(); - sPendingEvents = 0; -} - -void nrf5RadioClearPendingEvents(void) -{ - sPendingEvents = 0; - - for (uint32_t i = 0; i < NRF_802154_RX_BUFFERS; i++) - { - if (sReceivedFrames[i].mPsdu != NULL) - { - uint8_t *bufferAddress = &sReceivedFrames[i].mPsdu[-1]; - sReceivedFrames[i].mPsdu = NULL; - nrf_802154_buffer_free_raw(bufferAddress); - } - } -} - -otRadioState otPlatRadioGetState(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - if (sDisabled) - { - return OT_RADIO_STATE_DISABLED; - } - - switch (nrf_802154_state_get()) - { - case NRF_802154_STATE_SLEEP: - return OT_RADIO_STATE_SLEEP; - - case NRF_802154_STATE_RECEIVE: - case NRF_802154_STATE_ENERGY_DETECTION: - return OT_RADIO_STATE_RECEIVE; - - case NRF_802154_STATE_TRANSMIT: - case NRF_802154_STATE_CCA: - case NRF_802154_STATE_CONTINUOUS_CARRIER: - return OT_RADIO_STATE_TRANSMIT; - - default: - assert(false); // Make sure driver returned valid state. - } - - return OT_RADIO_STATE_RECEIVE; // It is the default state. Return it in case of unknown. -} - -bool otPlatRadioIsEnabled(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - return !sDisabled; -} - -otError otPlatRadioEnable(otInstance *aInstance) -{ - otError error; - -#if !OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT - OT_UNUSED_VARIABLE(aInstance); -#else - sInstance = aInstance; -#endif - - if (sDisabled) - { - sDisabled = false; - error = OT_ERROR_NONE; - } - else - { - error = OT_ERROR_INVALID_STATE; - } - - return error; -} - -otError otPlatRadioDisable(otInstance *aInstance) -{ - otError error = OT_ERROR_NONE; - - otEXPECT(otPlatRadioIsEnabled(aInstance)); - otEXPECT_ACTION(otPlatRadioGetState(aInstance) == OT_RADIO_STATE_SLEEP || isPendingEventSet(kPendingEventSleep), - error = OT_ERROR_INVALID_STATE); - - sDisabled = true; - -exit: - return error; -} - -otError otPlatRadioSleep(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - if (nrf_802154_sleep_if_idle() == NRF_802154_SLEEP_ERROR_NONE) - { - nrf5FemDisable(); - clearPendingEvents(); - } - else - { - clearPendingEvents(); - setPendingEvent(kPendingEventSleep); - } - - return OT_ERROR_NONE; -} - -otError otPlatRadioReceive(otInstance *aInstance, uint8_t aChannel) -{ - OT_UNUSED_VARIABLE(aInstance); - - bool result; - - nrf_802154_channel_set(aChannel); - if (nrf_802154_state_get() == NRF_802154_STATE_SLEEP) - { - // Enable FEM before RADIO leaving SLEEP state. - nrf5FemEnable(); - } - - nrf_802154_tx_power_set(GetTransmitPowerForChannel(aChannel)); - result = nrf_802154_receive(); - clearPendingEvents(); - - return result ? OT_ERROR_NONE : OT_ERROR_INVALID_STATE; -} - -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 -otError otPlatRadioReceiveAt(otInstance *aInstance, uint8_t aChannel, uint32_t aStart, uint32_t aDuration) -{ - OT_UNUSED_VARIABLE(aInstance); - - bool result; - - nrf_802154_tx_power_set(GetTransmitPowerForChannel(aChannel)); - result = nrf_802154_receive_at(aStart - SAFE_DELTA, SAFE_DELTA, aDuration, aChannel); - clearPendingEvents(); - - return result ? OT_ERROR_NONE : OT_ERROR_FAILED; -} -#endif - -otError otPlatRadioTransmit(otInstance *aInstance, otRadioFrame *aFrame) -{ - bool result = true; - otError error = OT_ERROR_NONE; - - aFrame->mPsdu[-1] = aFrame->mLength; - - if (nrf_802154_state_get() == NRF_802154_STATE_SLEEP) - { - // Enable FEM before RADIO leaving SLEEP state. - nrf5FemEnable(); - } - -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 - if (otMacFrameIsSecurityEnabled(aFrame) && otMacFrameIsKeyIdMode1(aFrame) && !aFrame->mInfo.mTxInfo.mIsARetx) - { - otMacFrameSetKeyId(aFrame, sKeyId); - otMacFrameSetFrameCounter(aFrame, sMacFrameCounter++); - } - - if (aFrame->mInfo.mTxInfo.mTxDelay != 0) - { - if (!nrf_802154_transmit_raw_at(&aFrame->mPsdu[-1], true, aFrame->mInfo.mTxInfo.mTxDelayBaseTime, - aFrame->mInfo.mTxInfo.mTxDelay, aFrame->mChannel)) - { - error = OT_ERROR_INVALID_STATE; - } - } - else -#endif - { - nrf_802154_channel_set(aFrame->mChannel); - - if (aFrame->mInfo.mTxInfo.mCsmaCaEnabled) - { - nrf_802154_transmit_csma_ca_raw(&aFrame->mPsdu[-1]); - } - else - { - result = nrf_802154_transmit_raw(&aFrame->mPsdu[-1], false); - } - } - - clearPendingEvents(); - otPlatRadioTxStarted(aInstance, aFrame); - - if (!result) - { - setPendingEvent(kPendingEventChannelAccessFailure); - } - - return error; -} - -otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - return &sTransmitFrame; -} - -int8_t otPlatRadioGetRssi(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - // Ensure the RSSI measurement is done after RSSI settling time. - // This is necessary for the Channel Monitor feature which quickly switches between channels. - NRFX_DELAY_US(RSSI_SETTLE_TIME_US); - - nrf_802154_rssi_measure_begin(); - - return nrf_802154_rssi_last_get(); -} - -otRadioCaps otPlatRadioGetCaps(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - return (otRadioCaps)(OT_RADIO_CAPS_ENERGY_SCAN | OT_RADIO_CAPS_ACK_TIMEOUT | OT_RADIO_CAPS_CSMA_BACKOFF | -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 - OT_RADIO_CAPS_TRANSMIT_SEC | OT_RADIO_CAPS_TRANSMIT_TIMING | OT_RADIO_CAPS_RECEIVE_TIMING | -#endif - OT_RADIO_CAPS_SLEEP_TO_TX); -} - -bool otPlatRadioGetPromiscuous(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - return nrf_802154_promiscuous_get(); -} - -void otPlatRadioSetPromiscuous(otInstance *aInstance, bool aEnable) -{ - OT_UNUSED_VARIABLE(aInstance); - - nrf_802154_promiscuous_set(aEnable); -} - -void otPlatRadioEnableSrcMatch(otInstance *aInstance, bool aEnable) -{ - OT_UNUSED_VARIABLE(aInstance); - - nrf_802154_auto_pending_bit_set(aEnable); -} - -otError otPlatRadioAddSrcMatchShortEntry(otInstance *aInstance, uint16_t aShortAddress) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error; - - uint8_t shortAddress[SHORT_ADDRESS_SIZE]; - convertShortAddress(shortAddress, aShortAddress); - - if (nrf_802154_pending_bit_for_addr_set(shortAddress, false)) - { - error = OT_ERROR_NONE; - } - else - { - error = OT_ERROR_NO_BUFS; - } - - return error; -} - -otError otPlatRadioAddSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error; - - if (nrf_802154_pending_bit_for_addr_set(aExtAddress->m8, true)) - { - error = OT_ERROR_NONE; - } - else - { - error = OT_ERROR_NO_BUFS; - } - - return error; -} - -otError otPlatRadioClearSrcMatchShortEntry(otInstance *aInstance, uint16_t aShortAddress) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error; - - uint8_t shortAddress[SHORT_ADDRESS_SIZE]; - convertShortAddress(shortAddress, aShortAddress); - - if (nrf_802154_pending_bit_for_addr_clear(shortAddress, false)) - { - error = OT_ERROR_NONE; - } - else - { - error = OT_ERROR_NO_ADDRESS; - } - - return error; -} - -otError otPlatRadioClearSrcMatchExtEntry(otInstance *aInstance, const otExtAddress *aExtAddress) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error; - - if (nrf_802154_pending_bit_for_addr_clear(aExtAddress->m8, true)) - { - error = OT_ERROR_NONE; - } - else - { - error = OT_ERROR_NO_ADDRESS; - } - - return error; -} - -void otPlatRadioClearSrcMatchShortEntries(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - nrf_802154_pending_bit_for_addr_reset(false); -} - -void otPlatRadioClearSrcMatchExtEntries(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - nrf_802154_pending_bit_for_addr_reset(true); -} - -otError otPlatRadioEnergyScan(otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration) -{ - OT_UNUSED_VARIABLE(aInstance); - - sEnergyDetectionTime = (uint32_t)aScanDuration * 1000UL; - sEnergyDetectionChannel = aScanChannel; - - clearPendingEvents(); - - nrf_802154_channel_set(aScanChannel); - - if (nrf_802154_energy_detection(sEnergyDetectionTime)) - { - resetPendingEvent(kPendingEventEnergyDetectionStart); - } - else - { - setPendingEvent(kPendingEventEnergyDetectionStart); - } - - return OT_ERROR_NONE; -} - -otError otPlatRadioGetTransmitPower(otInstance *aInstance, int8_t *aPower) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error = OT_ERROR_NONE; - - if (aPower == NULL) - { - error = OT_ERROR_INVALID_ARGS; - } - else - { - *aPower = nrf_802154_tx_power_get(); - } - - return error; -} - -otError otPlatRadioSetTransmitPower(otInstance *aInstance, int8_t aPower) -{ - OT_UNUSED_VARIABLE(aInstance); - uint8_t channel = nrf_802154_channel_get(); - otError error = OT_ERROR_NONE; - - VerifyOrExit(aPower != OT_RADIO_POWER_INVALID, error = OT_ERROR_INVALID_ARGS); - sDefaultTxPower = aPower; - nrf_802154_tx_power_set(GetTransmitPowerForChannel(channel)); - -exit: - return error; -} - -otError otPlatRadioGetCcaEnergyDetectThreshold(otInstance *aInstance, int8_t *aThreshold) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error = OT_ERROR_NONE; - nrf_802154_cca_cfg_t ccaConfig; - - if (aThreshold == NULL) - { - error = OT_ERROR_INVALID_ARGS; - } - else - { - nrf_802154_cca_cfg_get(&ccaConfig); - // The radio driver has no function to convert ED threshold to dBm - *aThreshold = (int8_t)ccaConfig.ed_threshold + NRF528XX_MIN_CCA_ED_THRESHOLD - sLnaGain; - } - - return error; -} - -otError otPlatRadioSetCcaEnergyDetectThreshold(otInstance *aInstance, int8_t aThreshold) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error = OT_ERROR_NONE; - nrf_802154_cca_cfg_t ccaConfig; - - aThreshold += sLnaGain; - - // The minimum value of ED threshold for radio driver is -94 dBm - if (aThreshold < NRF528XX_MIN_CCA_ED_THRESHOLD) - { - error = OT_ERROR_INVALID_ARGS; - } - else - { - memset(&ccaConfig, 0, sizeof(ccaConfig)); - ccaConfig.mode = NRF_RADIO_CCA_MODE_ED; - ccaConfig.ed_threshold = nrf_802154_ccaedthres_from_dbm_calculate(aThreshold); - - nrf_802154_cca_cfg_set(&ccaConfig); - } - - return error; -} - -otError otPlatRadioGetFemLnaGain(otInstance *aInstance, int8_t *aGain) -{ - OT_UNUSED_VARIABLE(aInstance); - - otError error = OT_ERROR_NONE; - - if (aGain == NULL) - { - error = OT_ERROR_INVALID_ARGS; - } - else - { - *aGain = sLnaGain; - } - - return error; -} - -otError otPlatRadioSetFemLnaGain(otInstance *aInstance, int8_t aGain) -{ - OT_UNUSED_VARIABLE(aInstance); - - int8_t threshold; - int8_t oldLnaGain = sLnaGain; - otError error = OT_ERROR_NONE; - - error = otPlatRadioGetCcaEnergyDetectThreshold(aInstance, &threshold); - otEXPECT(error == OT_ERROR_NONE); - - sLnaGain = aGain; - error = otPlatRadioSetCcaEnergyDetectThreshold(aInstance, threshold); - otEXPECT_ACTION(error == OT_ERROR_NONE, sLnaGain = oldLnaGain); - -exit: - return error; -} - -void nrf5RadioProcess(otInstance *aInstance) -{ - bool isEventPending = false; - - for (uint32_t i = 0; i < NRF_802154_RX_BUFFERS; i++) - { - if (sReceivedFrames[i].mPsdu != NULL) - { -#if OPENTHREAD_CONFIG_DIAG_ENABLE - - if (otPlatDiagModeGet()) - { - otPlatDiagRadioReceiveDone(aInstance, &sReceivedFrames[i], OT_ERROR_NONE); - } - else -#endif - { - otPlatRadioReceiveDone(aInstance, &sReceivedFrames[i], OT_ERROR_NONE); - } - - uint8_t *bufferAddress = &sReceivedFrames[i].mPsdu[-1]; - sReceivedFrames[i].mPsdu = NULL; - nrf_802154_buffer_free_raw(bufferAddress); - } - } - - if (isPendingEventSet(kPendingEventFrameTransmitted)) - { - resetPendingEvent(kPendingEventFrameTransmitted); - -#if OPENTHREAD_CONFIG_DIAG_ENABLE - - if (otPlatDiagModeGet()) - { - otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, OT_ERROR_NONE); - } - else -#endif - { - otRadioFrame *ackPtr = (sAckFrame.mPsdu == NULL) ? NULL : &sAckFrame; - otPlatRadioTxDone(aInstance, &sTransmitFrame, ackPtr, OT_ERROR_NONE); - } - - if (sAckFrame.mPsdu != NULL) - { - nrf_802154_buffer_free_raw(sAckFrame.mPsdu - 1); - sAckFrame.mPsdu = NULL; - } - } - - if (isPendingEventSet(kPendingEventChannelAccessFailure)) - { - resetPendingEvent(kPendingEventChannelAccessFailure); - -#if OPENTHREAD_CONFIG_DIAG_ENABLE - - if (otPlatDiagModeGet()) - { - otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, OT_ERROR_CHANNEL_ACCESS_FAILURE); - } - else -#endif - { - otPlatRadioTxDone(aInstance, &sTransmitFrame, NULL, OT_ERROR_CHANNEL_ACCESS_FAILURE); - } - } - - if (isPendingEventSet(kPendingEventInvalidOrNoAck)) - { - resetPendingEvent(kPendingEventInvalidOrNoAck); - -#if OPENTHREAD_CONFIG_DIAG_ENABLE - - if (otPlatDiagModeGet()) - { - otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, OT_ERROR_NO_ACK); - } - else -#endif - { - otPlatRadioTxDone(aInstance, &sTransmitFrame, NULL, OT_ERROR_NO_ACK); - } - } - - if (isPendingEventSet(kPendingEventReceiveFailed)) - { - resetPendingEvent(kPendingEventReceiveFailed); - -#if OPENTHREAD_CONFIG_DIAG_ENABLE - - if (otPlatDiagModeGet()) - { - otPlatDiagRadioReceiveDone(aInstance, NULL, sReceiveError); - } - else -#endif - { - otPlatRadioReceiveDone(aInstance, NULL, sReceiveError); - } - } - - if (isPendingEventSet(kPendingEventEnergyDetected)) - { - resetPendingEvent(kPendingEventEnergyDetected); - - otPlatRadioEnergyScanDone(aInstance, sEnergyDetected); - } - - if (isPendingEventSet(kPendingEventSleep)) - { - if (nrf_802154_sleep_if_idle() == NRF_802154_SLEEP_ERROR_NONE) - { - nrf5FemDisable(); - resetPendingEvent(kPendingEventSleep); - } - else - { - isEventPending = true; - } - } - - if (isPendingEventSet(kPendingEventEnergyDetectionStart)) - { - nrf_802154_channel_set(sEnergyDetectionChannel); - - if (nrf_802154_energy_detection(sEnergyDetectionTime)) - { - resetPendingEvent(kPendingEventEnergyDetectionStart); - } - else - { - isEventPending = true; - } - } - - if (isEventPending) - { - otSysEventSignalPending(); - } -} - -void nrf_802154_received_timestamp_raw(uint8_t *p_data, int8_t power, uint8_t lqi, uint32_t time) -{ - otRadioFrame *receivedFrame = NULL; - - for (uint32_t i = 0; i < NRF_802154_RX_BUFFERS; i++) - { - if (sReceivedFrames[i].mPsdu == NULL) - { - receivedFrame = &sReceivedFrames[i]; - - memset(receivedFrame, 0, sizeof(*receivedFrame)); - break; - } - } - - assert(receivedFrame != NULL); - - receivedFrame->mPsdu = &p_data[1]; - receivedFrame->mLength = p_data[0]; - receivedFrame->mInfo.mRxInfo.mRssi = power; - receivedFrame->mInfo.mRxInfo.mLqi = lqi; - receivedFrame->mChannel = nrf_802154_channel_get(); - - // Inform if this frame was acknowledged with frame pending set. - if (p_data[ACK_REQUEST_OFFSET] & ACK_REQUEST_BIT) - { - receivedFrame->mInfo.mRxInfo.mAckedWithFramePending = sAckedWithFramePending; - } - else - { - receivedFrame->mInfo.mRxInfo.mAckedWithFramePending = false; - } - - // Get the timestamp when the SFD was received. -#if !NRF_802154_TX_STARTED_NOTIFY_ENABLED -#error "NRF_802154_TX_STARTED_NOTIFY_ENABLED is required!" -#endif - uint32_t offset = - (int32_t)otPlatAlarmMicroGetNow() - (int32_t)nrf_802154_first_symbol_timestamp_get(time, p_data[0]); - receivedFrame->mInfo.mRxInfo.mTimestamp = nrf5AlarmGetCurrentTime() - offset; - - sAckedWithFramePending = false; - -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 - // Inform if this frame was acknowledged with secured Enh-ACK. - if (p_data[ACK_REQUEST_OFFSET] & ACK_REQUEST_BIT && otMacFrameIsVersion2015(receivedFrame)) - { - receivedFrame->mInfo.mRxInfo.mAckedWithSecEnhAck = sAckedWithSecEnhAck; - receivedFrame->mInfo.mRxInfo.mAckFrameCounter = sAckFrameCounter; - receivedFrame->mInfo.mRxInfo.mAckKeyId = sAckKeyId; - } - - sAckedWithSecEnhAck = false; -#endif - - otSysEventSignalPending(); -} - -void nrf_802154_receive_failed(nrf_802154_rx_error_t error) -{ - switch (error) - { - case NRF_802154_RX_ERROR_INVALID_FRAME: - case NRF_802154_RX_ERROR_DELAYED_TIMEOUT: - sReceiveError = OT_ERROR_NO_FRAME_RECEIVED; - break; - - case NRF_802154_RX_ERROR_INVALID_FCS: - sReceiveError = OT_ERROR_FCS; - break; - - case NRF_802154_RX_ERROR_INVALID_DEST_ADDR: - sReceiveError = OT_ERROR_DESTINATION_ADDRESS_FILTERED; - break; - - case NRF_802154_RX_ERROR_RUNTIME: - case NRF_802154_RX_ERROR_TIMESLOT_ENDED: - case NRF_802154_RX_ERROR_ABORTED: - case NRF_802154_RX_ERROR_DELAYED_TIMESLOT_DENIED: - case NRF_802154_RX_ERROR_INVALID_LENGTH: - case NRF_802154_RX_ERROR_DELAYED_ABORTED: - sReceiveError = OT_ERROR_FAILED; - break; - - default: - assert(false); - } - - sAckedWithFramePending = false; -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 - sAckedWithSecEnhAck = false; -#endif - -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 - if ((error == NRF_802154_RX_ERROR_DELAYED_TIMEOUT) || (error == NRF_802154_RX_ERROR_TIMESLOT_ENDED)) - { - sReceiveError = OT_ERROR_NONE; - setPendingEvent(kPendingEventSleep); - } - else -#endif - { - setPendingEvent(kPendingEventReceiveFailed); - } -} - -#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE -static uint16_t getCslPhase() -{ - uint32_t curTime = otPlatAlarmMicroGetNow(); - uint32_t cslPeriodInUs = sCslPeriod * OT_US_PER_TEN_SYMBOLS; - uint32_t diff = (cslPeriodInUs - (curTime % cslPeriodInUs) + (sCslSampleTime % cslPeriodInUs)) % cslPeriodInUs; - return (uint16_t)(diff / OT_US_PER_TEN_SYMBOLS + 1); -} -#endif - -void nrf_802154_tx_ack_started(uint8_t *p_data, int8_t power, uint8_t lqi) -{ - otRadioFrame ackFrame; -#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE - uint8_t linkMetricsDataLen = 0; - uint8_t linkMetricsData[OT_ENH_PROBING_IE_DATA_MAX_SIZE]; - otMacAddress macAddress; -#else - OT_UNUSED_VARIABLE(power); - OT_UNUSED_VARIABLE(lqi); -#endif - - OT_UNUSED_VARIABLE(ackFrame); - - ackFrame.mPsdu = (uint8_t *)(p_data + 1); - ackFrame.mLength = p_data[0]; - - // Check if the frame pending bit is set in ACK frame. - sAckedWithFramePending = p_data[FRAME_PENDING_OFFSET] & FRAME_PENDING_BIT; - -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 - // Update IE and secure Enh-ACK. -#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE - if (sCslPeriod > 0) - { - otMacFrameSetCslIe(&ackFrame, sCslPeriod, getCslPhase()); - } -#endif - -#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE - otMacFrameGetDstAddr(&ackFrame, &macAddress); - if ((linkMetricsDataLen = otLinkMetricsEnhAckGenData(&macAddress, lqi, power, linkMetricsData)) > 0) - { - otMacFrameSetEnhAckProbingIe(&ackFrame, linkMetricsData, linkMetricsDataLen); - } -#endif - - txAckProcessSecurity(p_data); -#endif -} - -void nrf_802154_transmitted_timestamp_raw(const uint8_t *aFrame, - uint8_t * aAckPsdu, - int8_t aPower, - uint8_t aLqi, - uint32_t ack_time) -{ - OT_UNUSED_VARIABLE(aFrame); // For ARM gcc - assert(aFrame == sTransmitPsdu); - - if (aAckPsdu == NULL) - { - sAckFrame.mPsdu = NULL; - } - else - { - uint32_t offset = - (int32_t)otPlatAlarmMicroGetNow() - (int32_t)nrf_802154_first_symbol_timestamp_get(ack_time, aAckPsdu[0]); - - sAckFrame.mInfo.mRxInfo.mTimestamp = nrf5AlarmGetCurrentTime() - offset; - sAckFrame.mPsdu = &aAckPsdu[1]; - sAckFrame.mLength = aAckPsdu[0]; - sAckFrame.mInfo.mRxInfo.mRssi = aPower; - sAckFrame.mInfo.mRxInfo.mLqi = aLqi; - sAckFrame.mChannel = nrf_802154_channel_get(); - } - - setPendingEvent(kPendingEventFrameTransmitted); -} - -void nrf_802154_transmit_failed(const uint8_t *aFrame, nrf_802154_tx_error_t error) -{ - OT_UNUSED_VARIABLE(aFrame); // For ARM gcc - assert(aFrame == sTransmitPsdu); - - switch (error) - { - case NRF_802154_TX_ERROR_BUSY_CHANNEL: - case NRF_802154_TX_ERROR_TIMESLOT_ENDED: - case NRF_802154_TX_ERROR_ABORTED: - case NRF_802154_TX_ERROR_TIMESLOT_DENIED: - setPendingEvent(kPendingEventChannelAccessFailure); - break; - - case NRF_802154_TX_ERROR_INVALID_ACK: - case NRF_802154_TX_ERROR_NO_ACK: - case NRF_802154_TX_ERROR_NO_MEM: - setPendingEvent(kPendingEventInvalidOrNoAck); - break; - - default: - assert(false); - } -} - -void nrf_802154_energy_detected(uint8_t result) -{ - sEnergyDetected = nrf_802154_dbm_from_energy_level_calculate(result); - - setPendingEvent(kPendingEventEnergyDetected); -} - -int8_t otPlatRadioGetReceiveSensitivity(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - return NRF528XX_RECEIVE_SENSITIVITY; -} - -#if OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT -void nrf_802154_tx_started(const uint8_t *aFrame) -{ - bool processSecurity = false; - - assert(aFrame == sTransmitPsdu); - OT_UNUSED_VARIABLE(aFrame); - -#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE - if (sCslPeriod > 0) - { - otMacFrameSetCslIe(&sTransmitFrame, (uint16_t)sCslPeriod, getCslPhase()); - } -#endif - - // Update IE and secure transmit frame -#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE - if (sTransmitFrame.mInfo.mTxInfo.mIeInfo->mTimeIeOffset != 0) - { - uint8_t *timeIe = sTransmitFrame.mPsdu + sTransmitFrame.mInfo.mTxInfo.mIeInfo->mTimeIeOffset; - uint64_t time = otPlatTimeGet() + sTransmitFrame.mInfo.mTxInfo.mIeInfo->mNetworkTimeOffset; - - *timeIe = sTransmitFrame.mInfo.mTxInfo.mIeInfo->mTimeSyncSeq; - - *(++timeIe) = (uint8_t)(time & 0xff); - for (uint8_t i = 1; i < sizeof(uint64_t); i++) - { - time = time >> 8; - *(++timeIe) = (uint8_t)(time & 0xff); - } - - processSecurity = true; - } -#endif // OPENTHREAD_CONFIG_TIME_SYNC_ENABLE - -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 - otEXPECT(otMacFrameIsSecurityEnabled(&sTransmitFrame) && otMacFrameIsKeyIdMode1(&sTransmitFrame) && - !sTransmitFrame.mInfo.mTxInfo.mIsSecurityProcessed); - - sTransmitFrame.mInfo.mTxInfo.mAesKey = &sCurrKey; - - processSecurity = true; -#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 - - otEXPECT(processSecurity); - otMacFrameProcessTransmitAesCcm(&sTransmitFrame, &sExtAddress); - -exit: - return; -} -#endif - -void nrf_802154_random_init(void) -{ - // Intentionally empty -} - -void nrf_802154_random_deinit(void) -{ - // Intentionally empty -} - -uint32_t nrf_802154_random_get(void) -{ - return otRandomNonCryptoGetUint32(); -} - -uint64_t otPlatRadioGetNow(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - return otPlatTimeGet(); -} - -#if OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 -void otPlatRadioSetMacKey(otInstance * aInstance, - uint8_t aKeyIdMode, - uint8_t aKeyId, - const otMacKey *aPrevKey, - const otMacKey *aCurrKey, - const otMacKey *aNextKey) -{ - OT_UNUSED_VARIABLE(aInstance); - OT_UNUSED_VARIABLE(aKeyIdMode); - - assert(aPrevKey != NULL && aCurrKey != NULL && aNextKey != NULL); - - CRITICAL_REGION_ENTER(); - - sKeyId = aKeyId; - memcpy(sPrevKey.m8, aPrevKey->m8, OT_MAC_KEY_SIZE); - memcpy(sCurrKey.m8, aCurrKey->m8, OT_MAC_KEY_SIZE); - memcpy(sNextKey.m8, aNextKey->m8, OT_MAC_KEY_SIZE); - - CRITICAL_REGION_EXIT(); -} - -void otPlatRadioSetMacFrameCounter(otInstance *aInstance, uint32_t aMacFrameCounter) -{ - OT_UNUSED_VARIABLE(aInstance); - - CRITICAL_REGION_ENTER(); - - sMacFrameCounter = aMacFrameCounter; - - CRITICAL_REGION_EXIT(); -} -#endif // OPENTHREAD_CONFIG_THREAD_VERSION >= OT_THREAD_VERSION_1_2 - -#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE -static void updateIeData(otInstance *aInstance, otShortAddress aShortAddr, const otExtAddress *aExtAddr) -{ - OT_UNUSED_VARIABLE(aInstance); - - int8_t offset = 0; - uint8_t ackIeData[OT_ACK_IE_MAX_SIZE]; - uint8_t extAddr[OT_EXT_ADDRESS_SIZE]; - uint8_t shortAddr[SHORT_ADDRESS_SIZE]; -#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE - uint8_t enhAckProbingDataLen = 0; - otMacAddress macAddress; - macAddress.mType = OT_MAC_ADDRESS_TYPE_SHORT; - macAddress.mAddress.mShortAddress = aShortAddr; -#endif - -#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE - if (sCslPeriod > 0) - { - memcpy(ackIeData, sCslIeHeader, OT_IE_HEADER_SIZE); - offset += OT_IE_HEADER_SIZE + OT_CSL_IE_SIZE; // reserve space for CSL IE - } -#endif - -#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE - if ((enhAckProbingDataLen = otLinkMetricsEnhAckGetDataLen(&macAddress)) > 0) - { - offset += otMacFrameGenerateEnhAckProbingIe(ackIeData + offset, NULL, enhAckProbingDataLen); - } -#endif - - convertShortAddress(shortAddr, aShortAddr); - convertExtAddress(extAddr, aExtAddr); - - if (offset > 0) - { - nrf_802154_ack_data_set(shortAddr, false, ackIeData, offset, NRF_802154_ACK_DATA_IE); - nrf_802154_ack_data_set(extAddr, true, ackIeData, offset, NRF_802154_ACK_DATA_IE); - } - else - { - nrf_802154_ack_data_clear(shortAddr, false, NRF_802154_ACK_DATA_IE); - nrf_802154_ack_data_clear(extAddr, true, NRF_802154_ACK_DATA_IE); - } -} -#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE - -#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE -otError otPlatRadioEnableCsl(otInstance *aInstance, uint32_t aCslPeriod, const otExtAddress *aExtAddr) -{ - otError error = OT_ERROR_NONE; - otShortAddress shortAddress; - - sCslPeriod = aCslPeriod; - - shortAddress = nrf_802154_pib_short_address_get()[1] - << 8; // Don't need the other byte because this is parent's short address - shortAddress &= 0xfc00; - - updateIeData(aInstance, shortAddress, aExtAddr); - - return error; -} - -void otPlatRadioUpdateCslSampleTime(otInstance *aInstance, uint32_t aCslSampleTime) -{ - OT_UNUSED_VARIABLE(aInstance); - - sCslSampleTime = aCslSampleTime; -} - -uint8_t otPlatRadioGetCslAccuracy(otInstance *aInstance) -{ - OT_UNUSED_VARIABLE(aInstance); - - return otPlatTimeGetXtalAccuracy() / 2; -} -#endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE - -#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_ENABLE -otError otPlatRadioConfigureEnhAckProbing(otInstance * aInstance, - otLinkMetrics aLinkMetrics, - const otShortAddress aShortAddress, - const otExtAddress * aExtAddress) -{ - OT_UNUSED_VARIABLE(aInstance); - OT_UNUSED_VARIABLE(aLinkMetrics); - OT_UNUSED_VARIABLE(aShortAddress); - OT_UNUSED_VARIABLE(aExtAddress); - - otError error = OT_ERROR_NONE; - - SuccessOrExit(error = otLinkMetricsConfigureEnhAckProbing(aShortAddress, aExtAddress, aLinkMetrics)); - updateIeData(aInstance, aShortAddress, aExtAddress); - -exit: - return error; -} -#endif - -otError otPlatRadioSetChannelMaxTransmitPower(otInstance *aInstance, uint8_t aChannel, int8_t aMaxPower) -{ - OT_UNUSED_VARIABLE(aInstance); - otError error = OT_ERROR_NONE; - - otEXPECT_ACTION(aChannel >= OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MIN && aChannel <= OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MAX, - error = OT_ERROR_INVALID_ARGS); - - sMaxTxPowerTable[aChannel - OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MIN] = aMaxPower; - if (aChannel == nrf_802154_channel_get()) - { - nrf_802154_tx_power_set(GetTransmitPowerForChannel(aChannel)); - } - -exit: - return error; -} - -int8_t nrf5GetChannelMaxTransmitPower(uint8_t aChannel) -{ - int8_t power; - - if (aChannel < OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MIN || aChannel > OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MAX) - { - power = OT_RADIO_POWER_INVALID; - } - else - { - power = sMaxTxPowerTable[aChannel - OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MIN]; - } - - return power; -} - -otError otPlatRadioSetRegion(otInstance *aInstance, uint16_t aRegionCode) -{ - OT_UNUSED_VARIABLE(aInstance); - - sRegionCode = aRegionCode; - nrf5HandleRegionChanged(aRegionCode); - return OT_ERROR_NONE; -} - -otError otPlatRadioGetRegion(otInstance *aInstance, uint16_t *aRegionCode) -{ - OT_UNUSED_VARIABLE(aInstance); - otError error = OT_ERROR_NONE; - - VerifyOrExit(aRegionCode != NULL, error = OT_ERROR_INVALID_ARGS); - - *aRegionCode = sRegionCode; -exit: - return error; -} - -OT_TOOL_WEAK void nrf5HandleRegionChanged(uint16_t aRegionCode) -{ - OT_UNUSED_VARIABLE(aRegionCode); -} diff --git a/examples/platforms/nrf528xx/src/softdevice.c b/examples/platforms/nrf528xx/src/softdevice.c deleted file mode 100644 index 427000119..000000000 --- a/examples/platforms/nrf528xx/src/softdevice.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2017, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements the OpenThread softdevice helper functions. - * - */ - -#include -#include - -#include -#include -#include -#include - -#include "platform-nrf5.h" -#include "platform-softdevice.h" -#include "softdevice.h" - -#include - -otError nrf5SdErrorToOtError(uint32_t aSdError) -{ - switch (aSdError) - { - case NRF_SUCCESS: - return OT_ERROR_NONE; - break; - - case NRF_ERROR_INVALID_STATE: - case NRF_ERROR_BUSY: - return OT_ERROR_INVALID_STATE; - break; - - case NRF_ERROR_INVALID_PARAM: - case NRF_ERROR_INVALID_ADDR: - return OT_ERROR_INVALID_ARGS; - break; - - case NRF_ERROR_NO_MEM: - return OT_ERROR_NO_BUFS; - break; - - case NRF_ERROR_NOT_FOUND: - return OT_ERROR_NOT_FOUND; - break; - - case NRF_ERROR_NOT_SUPPORTED: - return OT_ERROR_NOT_IMPLEMENTED; - break; - - default: - return OT_ERROR_FAILED; - break; - } -} - -void otSysSoftdeviceSocEvtHandler(uint32_t aEvtId) -{ - nrf5SdSocFlashProcess(aEvtId); - nrf_raal_softdevice_soc_evt_handler(aEvtId); -} - -void otSysSoftdeviceRaalConfig(const otSysSoftdeviceRaalConfigParams *aConfig) -{ - nrf_raal_softdevice_cfg_t cfg; - memset(&cfg, 0, sizeof(cfg)); - - cfg.timeslot_length = aConfig->timeslotLength; - cfg.timeslot_timeout = aConfig->timeslotTimeout; - cfg.timeslot_max_length = aConfig->timeslotMaxLength; - cfg.timeslot_alloc_iters = aConfig->timeslotAllocIters; - cfg.timeslot_safe_margin = aConfig->timeslotSafeMargin; - cfg.lf_clk_accuracy_ppm = aConfig->lfClkAccuracyPpm; - - nrf_raal_softdevice_config(&cfg); -} diff --git a/examples/platforms/nrf528xx/src/softdevice.h b/examples/platforms/nrf528xx/src/softdevice.h deleted file mode 100644 index 234f45c9e..000000000 --- a/examples/platforms/nrf528xx/src/softdevice.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2017, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the common SoftDevice headers. - * - */ - -#ifndef SOFTDEVICE_H_ -#define SOFTDEVICE_H_ - -// clang-format off -#if defined(__GNUC__) - _Pragma("GCC diagnostic push") - _Pragma("GCC diagnostic ignored \"-Wreturn-type\"") - _Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") - _Pragma("GCC diagnostic ignored \"-Wpedantic\"") -#endif - -#include -#include -#include -#include - -#if defined(__GNUC__) - _Pragma("GCC diagnostic pop") -#endif - -/******************************************************************************* - * @section nRF SoftDevice Handler declarations. - * - * @note Definitions for below functions are placed in nRF5 SDK. - ******************************************************************************/ - -/** - * @brief Function for stopping the incoming stack events. - * - * This function disables the SoftDevice interrupt. To resume polling for events, - * call @ref nrf_sdh_resume. - */ -void nrf_sdh_suspend(void); - -/** - * @brief Function for resuming polling incoming events from the SoftDevice. - */ -void nrf_sdh_resume(void); - -/** - * @brief Function for polling stack events from the SoftDevice. - * - * The events are passed to the application using the registered event handlers. - */ -void nrf_sdh_evts_poll(void); - -// clang-format on -#endif // SOFTDEVICE_H_ diff --git a/examples/platforms/nrf528xx/src/system.c b/examples/platforms/nrf528xx/src/system.c deleted file mode 100644 index 824d47772..000000000 --- a/examples/platforms/nrf528xx/src/system.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes the platform-specific initializers. - * - */ - -#include -#include - -#include - -#include "openthread-system.h" -#include "platform-fem.h" -#include "platform-nrf5-transport.h" -#include "platform-nrf5.h" -#include -#include - -#include - -#if !OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT && PLATFORM_OPENTHREAD_VANILLA - -#include -#include - -#include - -#endif - -extern bool gPlatformPseudoResetWasRequested; - -void __cxa_pure_virtual(void) -{ - while (1) - ; -} - -void otSysInit(int argc, char *argv[]) -{ - OT_UNUSED_VARIABLE(argc); - OT_UNUSED_VARIABLE(argv); - - if (gPlatformPseudoResetWasRequested) - { - otSysDeinit(); - } - -#if ((!SOFTDEVICE_PRESENT) && (NRF52840_XXAA)) - // Enable I-code cache - NRF_NVMC->ICACHECNF = NVMC_ICACHECNF_CACHEEN_Enabled; -#elif (DCDC_ENABLE) - NRF_POWER->DCDCEN = 1; -#endif - -#if !OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT && PLATFORM_OPENTHREAD_VANILLA - mbedtls_platform_set_calloc_free(otHeapCAlloc, otHeapFree); - mbedtls_platform_setup(NULL); -#endif - - nrf_drv_clock_init(); - -#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) - nrf5LogInit(); -#endif - nrf5AlarmInit(); - nrf5RandomInit(); - if (!gPlatformPseudoResetWasRequested) - { -#if NRF52840_XXAA - nrf5CryptoInit(); -#endif - } - nrf5TransportInit(gPlatformPseudoResetWasRequested); - nrf5MiscInit(); - nrf5RadioInit(); - nrf5TempInit(); - nrf5FemInit(); - - gPlatformPseudoResetWasRequested = false; -} - -void otSysDeinit(void) -{ - nrf5FemDeinit(); - nrf5TempDeinit(); - nrf5RadioDeinit(); - nrf5MiscDeinit(); - if (!gPlatformPseudoResetWasRequested) - { -#if NRF52840_XXAA - nrf5CryptoDeinit(); -#endif - } - nrf5TransportDeinit(gPlatformPseudoResetWasRequested); - nrf5RandomDeinit(); - nrf5AlarmDeinit(); -#if (OPENTHREAD_CONFIG_LOG_OUTPUT == OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED) - nrf5LogDeinit(); -#endif - -#if !OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT && PLATFORM_OPENTHREAD_VANILLA - mbedtls_platform_teardown(NULL); -#endif -} - -bool otSysPseudoResetWasRequested(void) -{ - return gPlatformPseudoResetWasRequested; -} - -void otSysProcessDrivers(otInstance *aInstance) -{ - nrf5RadioProcess(aInstance); - nrf5TransportProcess(); - nrf5TempProcess(); - nrf5AlarmProcess(aInstance); -} - -__WEAK void otSysEventSignalPending(void) -{ - // Intentionally empty -} diff --git a/examples/platforms/nrf528xx/src/temp.c b/examples/platforms/nrf528xx/src/temp.c deleted file mode 100644 index 75504395f..000000000 --- a/examples/platforms/nrf528xx/src/temp.c +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright (c) 2017, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include - -#include -#include - -#include "platform-nrf5.h" -#include - -#if SOFTDEVICE_PRESENT -#include "softdevice.h" -#endif - -#define US_PER_S 1000000ULL - -static uint64_t sLastReadTimestamp; -static int32_t sTemperature; - -#if !SOFTDEVICE_PRESENT -__STATIC_INLINE void dataReadyEventClear(void) -{ - NRF_TEMP->EVENTS_DATARDY = 0; - volatile uint32_t dummy = NRF_TEMP->EVENTS_DATARDY; - OT_UNUSED_VARIABLE(dummy); -} -#endif - -void nrf5TempInit(void) -{ -#if !SOFTDEVICE_PRESENT - nrf_temp_init(); - - NRF_TEMP->TASKS_START = 1; -#endif -} - -void nrf5TempDeinit(void) -{ -#if !SOFTDEVICE_PRESENT - NRF_TEMP->TASKS_STOP = 1; -#endif -} - -void nrf5TempProcess(void) -{ - int32_t prevTemperature = sTemperature; - uint64_t now; - -#if SOFTDEVICE_PRESENT - now = nrf5AlarmGetCurrentTime(); - - if (now - sLastReadTimestamp > (TEMP_MEASUREMENT_INTERVAL * US_PER_S)) - { - (void)sd_temp_get(&sTemperature); - sLastReadTimestamp = now; - } -#else - if (NRF_TEMP->EVENTS_DATARDY) - { - dataReadyEventClear(); - - sTemperature = nrf_temp_read(); - } - - now = nrf5AlarmGetCurrentTime(); - - if (now - sLastReadTimestamp > (TEMP_MEASUREMENT_INTERVAL * US_PER_S)) - { - NRF_TEMP->TASKS_START = 1; - sLastReadTimestamp = now; - } -#endif - - if (prevTemperature != sTemperature) - { - nrf_802154_temperature_changed(); - } -} - -int32_t nrf5TempGet(void) -{ - // Provide temperature value in [0.25 C] unit. - return sTemperature; -} - -void nrf_802154_temperature_init(void) -{ - // Intentionally empty -} - -void nrf_802154_temperature_deinit(void) -{ - // Intentionally empty -} - -int8_t nrf_802154_temperature_get(void) -{ - // Provide temperature value in [C]. - return (int8_t)(sTemperature / 4); -} diff --git a/examples/platforms/nrf528xx/src/transport/spi-slave.c b/examples/platforms/nrf528xx/src/transport/spi-slave.c deleted file mode 100644 index 7738d62b1..000000000 --- a/examples/platforms/nrf528xx/src/transport/spi-slave.c +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements the OpenThread platform abstraction for SPIS communication. - * - */ -#include - -#include -#include - -#include "platform-nrf5-transport.h" -#include -#include -#include - -#include "openthread-system.h" - -#if (SPIS_AS_SERIAL_TRANSPORT == 1) - -/** - * SPI Slave transaction variables. - */ -static void * sContext = NULL; -static uint8_t * sOutputBuf = NULL; -static uint16_t sOutputBufLen = 0; -static uint8_t * sInputBuf = NULL; -static uint16_t sInputBufLen = 0; -static bool sRequestTransactionFlag = false; -static bool sFurtherProcessingFlag = false; -static otPlatSpiSlaveTransactionProcessCallback sProcessCallback = NULL; -static otPlatSpiSlaveTransactionCompleteCallback sCompleteCallback = NULL; -static const nrfx_spis_t sSpiSlaveInstance = NRFX_SPIS_INSTANCE(SPIS_INSTANCE); - -static void spisEventHandler(nrfx_spis_evt_t const *aEvent, void *aContext) -{ - OT_UNUSED_VARIABLE(aContext); - - switch (aEvent->evt_type) - { - case NRFX_SPIS_BUFFERS_SET_DONE: - if (sRequestTransactionFlag) - { - // Host IRQ pin is active low. - nrf_gpio_pin_clear(SPIS_PIN_HOST_IRQ); - } - break; - - case NRFX_SPIS_XFER_DONE: - // Ensure Host IRQ pin is set. - nrf_gpio_pin_set(SPIS_PIN_HOST_IRQ); - - // Execute application callback. - if (sCompleteCallback(sContext, aEvent->tx_buffer, aEvent->tx_buffer_size, aEvent->rx_buffer, - aEvent->rx_buffer_size, aEvent->rx_amount)) - { - // Further processing is required. - sFurtherProcessingFlag = true; - - otSysEventSignalPending(); - } - break; - - default: - assert(false); - break; - } -} - -void nrf5SpiSlaveInit(void) -{ - // Intentionally empty. -} - -void nrf5SpiSlaveDeinit(void) -{ - sOutputBuf = NULL; - sOutputBufLen = 0; - sInputBuf = NULL; - sInputBufLen = 0; - sRequestTransactionFlag = false; - - otPlatSpiSlaveDisable(); -} - -void nrf5SpiSlaveProcess(void) -{ - otEXPECT(sFurtherProcessingFlag == true); - - // Clear further processing flag. - sFurtherProcessingFlag = false; - - // Perform any further processing if necessary. - sProcessCallback(sContext); - -exit: - return; -} - -otError otPlatSpiSlaveEnable(otPlatSpiSlaveTransactionCompleteCallback aCompleteCallback, - otPlatSpiSlaveTransactionProcessCallback aProcessCallback, - void * aContext) -{ - otError result = OT_ERROR_NONE; - nrfx_err_t error = NRFX_SUCCESS; - nrfx_spis_config_t config = NRFX_SPIS_DEFAULT_CONFIG; - - assert(aCompleteCallback != NULL); - assert(aProcessCallback != NULL); - - // Check if SPI Slave interface is already enabled. - otEXPECT_ACTION(sCompleteCallback == NULL, error = OT_ERROR_ALREADY); - - config.csn_pin = SPIS_PIN_CSN; - config.miso_pin = SPIS_PIN_MISO; - config.mosi_pin = SPIS_PIN_MOSI; - config.sck_pin = SPIS_PIN_SCK; - config.mode = SPIS_MODE; - config.bit_order = SPIS_BIT_ORDER; - config.irq_priority = SPIS_IRQ_PRIORITY; - - error = nrfx_spis_init(&sSpiSlaveInstance, &config, spisEventHandler, NULL); - assert(error == NRFX_SUCCESS); - if (error != NRFX_SUCCESS) - { - result = OT_ERROR_FAILED; - } - - // Set up Host IRQ pin. - nrf_gpio_pin_set(SPIS_PIN_HOST_IRQ); - nrf_gpio_cfg_output(SPIS_PIN_HOST_IRQ); - - // Set proper callback and context. - sProcessCallback = aProcessCallback; - sCompleteCallback = aCompleteCallback; - sContext = aContext; - -exit: - return result; -} - -void otPlatSpiSlaveDisable(void) -{ - nrfx_spis_uninit(&sSpiSlaveInstance); -} - -otError otPlatSpiSlavePrepareTransaction(uint8_t *aOutputBuf, - uint16_t aOutputBufLen, - uint8_t *aInputBuf, - uint16_t aInputBufLen, - bool aRequestTransactionFlag) -{ - otError result = OT_ERROR_NONE; - nrfx_err_t error = NRFX_SUCCESS; - nrf_spis_semstat_t semaphore_status = nrf_spis_semaphore_status_get(sSpiSlaveInstance.p_reg); - - assert(sCompleteCallback != NULL); - - otEXPECT_ACTION(((semaphore_status != NRF_SPIS_SEMSTAT_SPIS) && (semaphore_status != NRF_SPIS_SEMSTAT_CPUPENDING)), - result = OT_ERROR_BUSY); - - if (aOutputBuf != NULL) - { - sOutputBuf = aOutputBuf; - sOutputBufLen = aOutputBufLen; - } - - if (aInputBuf != NULL) - { - sInputBuf = aInputBuf; - sInputBufLen = aInputBufLen; - } - - sRequestTransactionFlag = aRequestTransactionFlag; - - error = nrfx_spis_buffers_set(&sSpiSlaveInstance, sOutputBuf, sOutputBufLen, sInputBuf, sInputBufLen); - if (error == NRFX_ERROR_INVALID_STATE) - { - result = OT_ERROR_BUSY; - } - else - { - assert(error == NRFX_SUCCESS); - } - -exit: - return result; -} - -#endif // SPIS_AS_SERIAL_TRANSPORT == 1 diff --git a/examples/platforms/nrf528xx/src/transport/transport-drivers.h b/examples/platforms/nrf528xx/src/transport/transport-drivers.h deleted file mode 100644 index fd46d00e2..000000000 --- a/examples/platforms/nrf528xx/src/transport/transport-drivers.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file includes UART/USB and SPI driver initializers. - * - */ - -#ifndef TRANSPORT_DRIVERS_H_ -#define TRANSPORT_DRIVERS_H_ - -/** - * Initialization of UART driver. - * - */ -void nrf5UartInit(void); - -/** - * Deinitialization of UART driver. - * - */ -void nrf5UartDeinit(void); - -/** - * Clear pending UART data. - * - */ -void nrf5UartClearPendingData(void); - -/** - * This function performs UART driver processing. - * - */ -void nrf5UartProcess(void); - -/** - * Initialization of SPI Slave driver. - * - */ -void nrf5SpiSlaveInit(void); - -/** - * Deinitialization of SPI Slave driver. - * - */ -void nrf5SpiSlaveDeinit(void); - -/** - * Function for processing SPI Slave driver. - */ -void nrf5SpiSlaveProcess(void); - -#endif diff --git a/examples/platforms/nrf528xx/src/transport/transport.c b/examples/platforms/nrf528xx/src/transport/transport.c deleted file mode 100644 index 074be8864..000000000 --- a/examples/platforms/nrf528xx/src/transport/transport.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2020, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements the nrf5 platform transport initialization functions. - * - */ - -#include - -#include "platform-nrf5-transport.h" - -#include "transport-drivers.h" - -void nrf5TransportInit(bool aPseudoReset) -{ - OT_UNUSED_VARIABLE(aPseudoReset); - -#if ((UART_AS_SERIAL_TRANSPORT == 1) || (USB_CDC_AS_SERIAL_TRANSPORT == 1)) - if (!aPseudoReset) - { - nrf5UartInit(); - } - else - { - nrf5UartClearPendingData(); - } -#endif - -#if (SPIS_AS_SERIAL_TRANSPORT == 1) - nrf5SpiSlaveInit(); -#endif -} - -void nrf5TransportDeinit(bool aPseudoReset) -{ - OT_UNUSED_VARIABLE(aPseudoReset); - -#if ((UART_AS_SERIAL_TRANSPORT == 1) || (USB_CDC_AS_SERIAL_TRANSPORT == 1)) - if (!aPseudoReset) - { - nrf5UartDeinit(); - } -#endif - -#if (SPIS_AS_SERIAL_TRANSPORT == 1) - nrf5SpiSlaveDeinit(); -#endif -} - -void nrf5TransportProcess(void) -{ -#if ((UART_AS_SERIAL_TRANSPORT == 1) || (USB_CDC_AS_SERIAL_TRANSPORT == 1)) - nrf5UartProcess(); -#endif -#if (SPIS_AS_SERIAL_TRANSPORT == 1) - nrf5SpiSlaveProcess(); -#endif -} - -bool nrf5TransportPseudoResetRequired(void) -{ -#if OPENTHREAD_PLATFORM_USE_PSEUDO_RESET - return true; -#else // if OPENTHREAD_PLATFORM_USE_PSEUDO_RESET - return false; -#endif -} diff --git a/examples/platforms/nrf528xx/src/transport/uart.c b/examples/platforms/nrf528xx/src/transport/uart.c deleted file mode 100644 index e418bf6ca..000000000 --- a/examples/platforms/nrf528xx/src/transport/uart.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Copyright (c) 2016, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements the OpenThread platform abstraction for UART communication. - * - */ - -#include -#include - -#include -#include -#include - -#include -#include -#include - -#include "openthread-system.h" - -#include "platform-nrf5-transport.h" -#include -#include -#include - -#if (UART_AS_SERIAL_TRANSPORT == 1) - -/** - * UART enable flag. - */ -bool sUartEnabled = false; - -/** - * UART TX buffer variables. - */ -static const uint8_t *sTransmitBuffer = NULL; -static volatile bool sTransmitDone = 0; - -/** - * UART RX ring buffer variables. - */ -static uint8_t sReceiveBuffer[UART_RX_BUFFER_SIZE]; -static volatile uint16_t sReceiveHead = 0; -static volatile uint16_t sReceiveTail = 0; - -/** - * Function for returning the next RX buffer index. - * - * @return Next RX buffer index. - */ -static __INLINE uint16_t getNextRxBufferIndex() -{ - return (sReceiveHead + 1) % UART_RX_BUFFER_SIZE; -} - -/** - * Function for checking if RX buffer is full. - * - * @retval true RX buffer is full. - * @retval false RX buffer is not full. - */ -static __INLINE bool isRxBufferFull() -{ - return getNextRxBufferIndex() == sReceiveTail; -} - -/** - * Function for checking if RX buffer is empty. - * - * @retval true RX buffer is empty. - * @retval false RX buffer is not empty. - */ -static __INLINE bool isRxBufferEmpty() -{ - uint16_t head = sReceiveHead; - return (head == sReceiveTail); -} - -/** - * Function for notifying application about new bytes received. - */ -static void processReceive(void) -{ - // Set head position to not be changed during read procedure. - uint16_t head = sReceiveHead; - uint8_t *position; - - otEXPECT(isRxBufferEmpty() == false); - - // In case head roll back to the beginning of the buffer, notify about left - // bytes from the end of the buffer. - if (head < sReceiveTail) - { - position = &sReceiveBuffer[sReceiveTail]; - otPlatUartReceived(position, (UART_RX_BUFFER_SIZE - sReceiveTail)); - sReceiveTail = 0; - } - - // Notify about received bytes. - if (head > sReceiveTail) - { - position = &sReceiveBuffer[sReceiveTail]; - otPlatUartReceived(position, (head - sReceiveTail)); - sReceiveTail = head; - } - - // In case interrupts were disabled due to the full buffer, re-enable it now. - if (!nrf_uarte_int_enable_check(UART_INSTANCE, NRF_UARTE_INT_RXDRDY_MASK)) - { - nrf_uarte_int_enable(UART_INSTANCE, NRF_UARTE_INT_RXDRDY_MASK | NRF_UARTE_INT_ERROR_MASK); - } - -exit: - return; -} - -otError otPlatUartFlush(void) -{ - return OT_ERROR_NOT_IMPLEMENTED; -} - -/** - * Function for notifying application about transmission being done. - */ -static void processTransmit(void) -{ - otEXPECT(sTransmitBuffer != NULL); - - if (sTransmitDone) - { - // Clear Transmition transaction and notify application. - sTransmitBuffer = NULL; - sTransmitDone = false; - otPlatUartSendDone(); - } - -exit: - return; -} - -void nrf5UartProcess(void) -{ - processReceive(); - processTransmit(); -} - -void nrf5UartInit(void) -{ - // Intentionally empty. -} - -void nrf5UartClearPendingData(void) -{ - // Intentionally empty. -} - -void nrf5UartDeinit(void) -{ - if (sUartEnabled) - { - otPlatUartDisable(); - } -} - -otError otPlatUartEnable(void) -{ - otError error = OT_ERROR_NONE; - - otEXPECT_ACTION(sUartEnabled == false, error = OT_ERROR_ALREADY); - - // Set up TX and RX pins. - nrf_gpio_pin_set(UART_PIN_TX); - nrf_gpio_cfg_output(UART_PIN_TX); - nrf_gpio_cfg_input(UART_PIN_RX, NRF_GPIO_PIN_NOPULL); - nrf_uarte_txrx_pins_set(UART_INSTANCE, UART_PIN_TX, UART_PIN_RX); - -#if (UART_HWFC_ENABLED == 1) - // Set up CTS and RTS pins. - nrf_gpio_cfg_input(UART_PIN_CTS, NRF_GPIO_PIN_NOPULL); - nrf_gpio_pin_set(UART_PIN_RTS); - nrf_gpio_cfg_output(UART_PIN_RTS); - nrf_uarte_hwfc_pins_set(UART_INSTANCE, UART_PIN_RTS, UART_PIN_CTS); - - nrf_uarte_configure(UART_INSTANCE, UART_PARITY, NRF_UARTE_HWFC_ENABLED); -#else - nrf_uarte_configure(UART_INSTANCE, UART_PARITY, NRF_UARTE_HWFC_DISABLED); -#endif - - // Configure baudrate. - nrf_uarte_baudrate_set(UART_INSTANCE, UART_BAUDRATE); - - // Clear UART specific events. - nrf_uarte_event_clear(UART_INSTANCE, NRF_UARTE_EVENT_ENDTX); - nrf_uarte_event_clear(UART_INSTANCE, NRF_UARTE_EVENT_ERROR); - nrf_uarte_event_clear(UART_INSTANCE, NRF_UARTE_EVENT_RXDRDY); - - // Enable interrupts for TX. - nrf_uarte_int_enable(UART_INSTANCE, NRF_UARTE_INT_ENDTX_MASK); - - // Enable interrupts for RX. - nrf_uarte_int_enable(UART_INSTANCE, NRF_UARTE_INT_RXDRDY_MASK | NRF_UARTE_INT_ERROR_MASK); - - // Configure NVIC to handle UART interrupts. - NVIC_SetPriority(UART_IRQN, UART_IRQ_PRIORITY); - NVIC_ClearPendingIRQ(UART_IRQN); - NVIC_EnableIRQ(UART_IRQN); - - // Start HFCLK - nrf_drv_clock_hfclk_request(NULL); - - while (!nrf_drv_clock_hfclk_is_running()) - { - } - - // Enable UART instance, and start RX on it. - nrf_uarte_enable(UART_INSTANCE); - nrf_uarte_task_trigger(UART_INSTANCE, NRF_UARTE_TASK_STARTRX); - - sUartEnabled = true; - -exit: - return error; -} - -otError otPlatUartDisable(void) -{ - otError error = OT_ERROR_NONE; - - otEXPECT_ACTION(sUartEnabled == true, error = OT_ERROR_ALREADY); - - // Disable NVIC interrupt. - NVIC_DisableIRQ(UART_IRQN); - NVIC_ClearPendingIRQ(UART_IRQN); - NVIC_SetPriority(UART_IRQN, 0); - - // Disable interrupts for TX. - nrf_uarte_int_disable(UART_INSTANCE, NRF_UARTE_INT_ENDTX_MASK); - - // Disable interrupts for RX. - nrf_uarte_int_disable(UART_INSTANCE, NRF_UARTE_INT_RXDRDY_MASK | NRF_UARTE_INT_ERROR_MASK); - - // Disable UART instance. - nrf_uarte_disable(UART_INSTANCE); - - // Release HF clock. - nrf_drv_clock_hfclk_release(); - - sUartEnabled = false; - -exit: - return error; -} - -otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength) -{ - otError error = OT_ERROR_NONE; - - otEXPECT_ACTION(sTransmitBuffer == NULL, error = OT_ERROR_BUSY); - - // Set up transmit buffer. - sTransmitBuffer = aBuf; - - // Initiate transmission process. - nrf_uarte_event_clear(UART_INSTANCE, NRF_UARTE_EVENT_ENDTX); - nrf_uarte_tx_buffer_set(UART_INSTANCE, sTransmitBuffer, aBufLength); - nrf_uarte_task_trigger(UART_INSTANCE, NRF_UARTE_TASK_STARTTX); - -exit: - return error; -} - -/** - * Interrupt handler of UART0 peripherial. - */ -void UARTE0_UART0_IRQHandler(void) -{ - // Check if any error has been detected. - if (nrf_uarte_int_enable_check(UART_INSTANCE, NRF_UARTE_INT_ERROR_MASK) && - nrf_uarte_event_check(UART_INSTANCE, NRF_UARTE_EVENT_ERROR)) - { - nrf_uarte_event_clear(UART_INSTANCE, NRF_UARTE_EVENT_ERROR); - } - else if (nrf_uarte_int_enable_check(UART_INSTANCE, NRF_UARTE_INT_RXDRDY_MASK) && - nrf_uarte_event_check(UART_INSTANCE, NRF_UARTE_EVENT_RXDRDY)) - { - // Clear RXDRDY event. - nrf_uarte_event_clear(UART_INSTANCE, NRF_UARTE_EVENT_RXDRDY); - - // Read byte from the UART buffer. - uint8_t byte = nrf_uart_rxd_get((NRF_UART_Type *)UART_INSTANCE); - - assert(!isRxBufferFull()); - - sReceiveBuffer[sReceiveHead] = byte; - sReceiveHead = getNextRxBufferIndex(); - - // Check if we are able to process next RX bytes. - if (isRxBufferFull()) - { - // Disable interrupts for RX. - nrf_uarte_int_disable(UART_INSTANCE, NRF_UARTE_INT_RXDRDY_MASK | NRF_UARTE_INT_ERROR_MASK); - } - - otSysEventSignalPending(); - } - - if (nrf_uarte_event_check(UART_INSTANCE, NRF_UARTE_EVENT_ENDTX)) - { - // Clear ENDTX event. - nrf_uarte_event_clear(UART_INSTANCE, NRF_UARTE_EVENT_ENDTX); - - sTransmitDone = true; - - nrf_uarte_task_trigger(UART_INSTANCE, NRF_UARTE_TASK_STOPTX); - - otSysEventSignalPending(); - } -} - -#endif // UART_AS_SERIAL_TRANSPORT == 1 - -/** - * The UART driver weak functions definition. - * - */ -OT_TOOL_WEAK void otPlatUartSendDone(void) -{ -} - -OT_TOOL_WEAK void otPlatUartReceived(const uint8_t *aBuf, uint16_t aBufLength) -{ - OT_UNUSED_VARIABLE(aBuf); - OT_UNUSED_VARIABLE(aBufLength); -} diff --git a/examples/platforms/nrf528xx/src/transport/usb-cdc-uart.c b/examples/platforms/nrf528xx/src/transport/usb-cdc-uart.c deleted file mode 100644 index a05c41a86..000000000 --- a/examples/platforms/nrf528xx/src/transport/usb-cdc-uart.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Copyright (c) 2017, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -/** - * @file - * This file implements the OpenThread platform abstraction for UART communication over USB CDC. - * - */ - -#if defined(__GNUC__) -#pragma GCC diagnostic ignored "-Wpedantic" -#endif - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "platform-nrf5-transport.h" - -#include "app_usbd.h" -#include "app_usbd_serial_num.h" -#include "nrf_dfu_trigger_usb.h" -#include "nrf_drv_clock.h" -#include "nrf_drv_power.h" -#include "class/cdc/acm/app_usbd_cdc_acm.h" - -#if (USB_CDC_AS_SERIAL_TRANSPORT == 1) - -static void cdcAcmUserEventHandler(app_usbd_class_inst_t const *aInstance, app_usbd_cdc_acm_user_event_t aEvent); - -#define CDC_ACM_COMM_EPIN NRF_DRV_USBD_EPIN2 - -#define CDC_ACM_DATA_EPIN NRF_DRV_USBD_EPIN1 -#define CDC_ACM_DATA_EPOUT NRF_DRV_USBD_EPOUT1 - -APP_USBD_CDC_ACM_GLOBAL_DEF(sAppCdcAcm, - cdcAcmUserEventHandler, - USB_CDC_ACM_COMM_INTERFACE, - USB_CDC_ACM_DATA_INTERFACE, - CDC_ACM_COMM_EPIN, - CDC_ACM_DATA_EPIN, - CDC_ACM_DATA_EPOUT, - APP_USBD_CDC_COMM_PROTOCOL_NONE); - -// Rx buffer length must by multiple of NRF_DRV_USBD_EPSIZE. -static char sRxBuffer[NRF_DRV_USBD_EPSIZE * ((UART_RX_BUFFER_SIZE + NRF_DRV_USBD_EPSIZE - 1) / NRF_DRV_USBD_EPSIZE)]; - -static struct -{ - const uint8_t *mTxBuffer; - uint16_t mTxSize; - size_t mReceivedDataSize; - bool mUartEnabled; - bool mLastConnectionStatus; - uint32_t mOpenTimestamp; - volatile bool mConnected; - volatile bool mReadyToStart; - volatile bool mTransferInProgress; - volatile bool mTransferDone; - volatile bool mReceiveDone; -} sUsbState; - -static void cdcAcmUserEventHandler(app_usbd_class_inst_t const *aCdcAcmInstance, app_usbd_cdc_acm_user_event_t aEvent) -{ - app_usbd_cdc_acm_t const *cdcAcmClass = app_usbd_cdc_acm_class_get(aCdcAcmInstance); - - switch (aEvent) - { - case APP_USBD_CDC_ACM_USER_EVT_PORT_OPEN: - // Setup first transfer. - (void)app_usbd_cdc_acm_read_any(&sAppCdcAcm, sRxBuffer, sizeof(sRxBuffer)); - sUsbState.mOpenTimestamp = otPlatAlarmMilliGetNow(); - break; - - case APP_USBD_CDC_ACM_USER_EVT_PORT_CLOSE: - break; - - case APP_USBD_CDC_ACM_USER_EVT_TX_DONE: - sUsbState.mTransferDone = true; - break; - - case APP_USBD_CDC_ACM_USER_EVT_RX_DONE: - sUsbState.mReceiveDone = true; - // Get amount of data received. - sUsbState.mReceivedDataSize = app_usbd_cdc_acm_rx_size(cdcAcmClass); - break; - - default: - break; - } -} - -static void usbdIsrHandler(app_usbd_internal_evt_t const *const aEvent, bool aQueued) -{ - (void)aEvent; - (void)aQueued; - - otSysEventSignalPending(); -} - -static void usbdUserEventHandler(app_usbd_event_type_t aEvent) -{ - switch (aEvent) - { - case APP_USBD_EVT_STOPPED: - app_usbd_disable(); - break; - - case APP_USBD_EVT_POWER_DETECTED: - // Workaround for missing port open event. - sAppCdcAcm.specific.p_data->ctx.line_state = 0; - - sUsbState.mConnected = true; - break; - - case APP_USBD_EVT_POWER_REMOVED: - sUsbState.mConnected = false; - break; - - case APP_USBD_EVT_POWER_READY: - sUsbState.mReadyToStart = true; - break; - - default: - break; - } -} - -static bool hasPortOpenDelayPassed(void) -{ - int32_t timeDiff = otPlatAlarmMilliGetNow() - sUsbState.mOpenTimestamp; - - return (timeDiff < 0) || (timeDiff > USB_HOST_UART_CONFIG_DELAY_MS); -} - -static bool isPortOpened(void) -{ - uint32_t value; - - if (app_usbd_cdc_acm_line_state_get(&sAppCdcAcm, APP_USBD_CDC_ACM_LINE_STATE_DTR, &value) == NRF_SUCCESS) - { - return (value != 0) && hasPortOpenDelayPassed(); - } - - return false; -} - -static void processConnection(void) -{ - bool connectionStatus = sUsbState.mUartEnabled && sUsbState.mConnected; - - if (sUsbState.mLastConnectionStatus != connectionStatus) - { - sUsbState.mLastConnectionStatus = connectionStatus; - - if (connectionStatus) - { - if (!nrf_drv_usbd_is_enabled()) - { - app_usbd_enable(); - } - } - else - { - if (nrf_drv_usbd_is_started()) - { - app_usbd_stop(); - } - else - { - app_usbd_disable(); - } - } - } - - // Provide some delay so the OS can re-enumerate the device in case of reset. - if (sUsbState.mReadyToStart) - { - sUsbState.mReadyToStart = false; - - if (nrf_drv_usbd_is_enabled()) - { - app_usbd_start(); - } - } -} - -static void processReceive(void) -{ - if (sUsbState.mReceiveDone) - { - if (sUsbState.mReceivedDataSize != 0) - { - otPlatUartReceived((const uint8_t *)sRxBuffer, sUsbState.mReceivedDataSize); - sUsbState.mReceivedDataSize = 0; - } - - // Setup next transfer. - if (app_usbd_cdc_acm_read_any(&sAppCdcAcm, sRxBuffer, sizeof(sRxBuffer)) == NRF_SUCCESS) - { - sUsbState.mReceiveDone = false; - } - } -} - -static void processTransmit(void) -{ - // If some data was requested to send while port was closed, send it now. - if ((sUsbState.mTxBuffer != NULL) && isPortOpened()) - { - if (app_usbd_cdc_acm_write(&sAppCdcAcm, sUsbState.mTxBuffer, sUsbState.mTxSize) == NRF_SUCCESS) - { - sUsbState.mTransferInProgress = true; - sUsbState.mTxBuffer = NULL; - sUsbState.mTxSize = 0; - } - } - else if (sUsbState.mTransferDone) - { - sUsbState.mTransferDone = false; - sUsbState.mTransferInProgress = false; - - otPlatUartSendDone(); - } -} - -void nrf5UartInit(void) -{ - static const app_usbd_config_t usbdConfig = { - .ev_state_proc = usbdUserEventHandler, - .ev_isr_handler = usbdIsrHandler, - }; - - memset((void *)&sUsbState, 0, sizeof(sUsbState)); - - app_usbd_serial_num_generate(); - - ret_code_t ret = app_usbd_init(&usbdConfig); - assert(ret == NRF_SUCCESS); - -#if NRF_MODULE_ENABLED(APP_USBD_NRF_DFU_TRIGGER) - ret = nrf_dfu_trigger_usb_init(); - assert(ret == NRF_SUCCESS); -#endif // NRF_MODULE_ENABLED(APP_USBD_NRF_DFU_TRIGGER) - - app_usbd_class_inst_t const *cdcAcmInstance = app_usbd_cdc_acm_class_inst_get(&sAppCdcAcm); - ret = app_usbd_class_append(cdcAcmInstance); - assert(ret == NRF_SUCCESS); - - ret = app_usbd_power_events_enable(); - assert(ret == NRF_SUCCESS); - - OT_UNUSED_VARIABLE(ret); -} - -void nrf5UartDeinit(void) -{ - if (nrf_drv_usbd_is_started()) - { - app_usbd_stop(); - - while (app_usbd_event_queue_process()) - { - } - } - else if (nrf_drv_usbd_is_enabled()) - { - app_usbd_disable(); - } - - app_usbd_class_remove_all(); - app_usbd_uninit(); -} - -void nrf5UartClearPendingData(void) -{ - sUsbState.mTransferInProgress = false; - sUsbState.mTxBuffer = NULL; - sUsbState.mTxSize = 0; -} - -void nrf5UartProcess(void) -{ - while (app_usbd_event_queue_process()) - { - } - - processConnection(); - processReceive(); - processTransmit(); -} - -otError otPlatUartEnable(void) -{ - sUsbState.mUartEnabled = true; - - return OT_ERROR_NONE; -} - -otError otPlatUartDisable(void) -{ - sUsbState.mUartEnabled = false; - - return OT_ERROR_NONE; -} - -otError otPlatUartSend(const uint8_t *aBuf, uint16_t aBufLength) -{ - otError error = OT_ERROR_NONE; - - otEXPECT_ACTION(sUsbState.mTransferInProgress == false, error = OT_ERROR_BUSY); - otEXPECT_ACTION(sUsbState.mTxBuffer == NULL, error = OT_ERROR_BUSY); - - if (!isPortOpened()) - { - // If port is closed, queue the message until it can be sent. - sUsbState.mTxBuffer = aBuf; - sUsbState.mTxSize = aBufLength; - } - else - { - otEXPECT_ACTION(app_usbd_cdc_acm_write(&sAppCdcAcm, aBuf, aBufLength) == NRF_SUCCESS, error = OT_ERROR_FAILED); - sUsbState.mTransferInProgress = true; - } - -exit: - - return error; -} - -otError otPlatUartFlush(void) -{ - return OT_ERROR_NOT_IMPLEMENTED; -} - -#endif // USB_CDC_AS_SERIAL_TRANSPORT == 1 diff --git a/script/check-arm-build-autotools b/script/check-arm-build-autotools index d891abce8..4390ff8da 100755 --- a/script/check-arm-build-autotools +++ b/script/check-arm-build-autotools @@ -51,124 +51,6 @@ build_cc2538() make -f examples/Makefile-cc2538 "${options[@]}" } -build_nrf52811() -{ - local options=( - "COAP=1" - "DNS_CLIENT=1" - "LINK_RAW=1" - "MAC_FILTER=1" - "MTD_NETDIAG=1" - ) - - # UART transport - reset_source - make -f examples/Makefile-nrf52811 "${options[@]}" - - # SPI transport for NCP - reset_source - make -f examples/Makefile-nrf52811 "${options[@]}" NCP_SPI=1 - - # Build without transport (no CLI or NCP applications) - reset_source - make -f examples/Makefile-nrf52811 DISABLE_TRANSPORTS=1 -} - -build_nrf52833() -{ - local options=( - "BORDER_AGENT=1" - "BORDER_ROUTER=1" - "COAP=1" - "COAPS=1" - "COMMISSIONER=1" - "DHCP6_CLIENT=1" - "DHCP6_SERVER=1" - "DNS_CLIENT=1" - "ECDSA=1" - "FULL_LOGS=1" - "IP6_FRAGM=1" - "JOINER=1" - "LINK_RAW=1" - "MAC_FILTER=1" - "MTD_NETDIAG=1" - "PING_SENDER=1" - "SERVICE=1" - "SLAAC=1" - "SNTP_CLIENT=1" - "SRP_CLIENT=1" - "UDP_FORWARD=1" - ) - - # UART transport - reset_source - make -f examples/Makefile-nrf52833 "${options[@]}" - - # USB transport - reset_source - make -f examples/Makefile-nrf52833 "${options[@]}" USB=1 - - # SPI transport for NCP - reset_source - make -f examples/Makefile-nrf52833 "${options[@]}" NCP_SPI=1 - - # Build without transport (no CLI or NCP applications) - reset_source - make -f examples/Makefile-nrf52833 "${options[@]}" DISABLE_TRANSPORTS=1 -} - -build_nrf52840() -{ - local options=( - "BORDER_AGENT=1" - "BORDER_ROUTER=1" - "COAP=1" - "COAPS=1" - "COMMISSIONER=1" - "DEBUG=1" - "DHCP6_CLIENT=1" - "DHCP6_SERVER=1" - "DNS_CLIENT=1" - "ECDSA=1" - "FULL_LOGS=1" - "IP6_FRAGM=1" - "JOINER=1" - "LINK_RAW=1" - "MAC_FILTER=1" - "MTD_NETDIAG=1" - "PING_SENDER=1" - "SERVICE=1" - "SLAAC=1" - "SNTP_CLIENT=1" - "SRP_CLIENT=1" - "UDP_FORWARD=1" - ) - - # UART transport - reset_source - make -f examples/Makefile-nrf52840 "${options[@]}" - - # USB transport with bootloader e.g. to support PCA10059 dongle - reset_source - make -f examples/Makefile-nrf52840 "${options[@]}" BOOTLOADER=1 USB=1 - - # SPI transport for NCP - reset_source - make -f examples/Makefile-nrf52840 "${options[@]}" NCP_SPI=1 - - # Build without transport (no CLI or NCP applications) - reset_source - make -f examples/Makefile-nrf52840 "${options[@]}" DISABLE_TRANSPORTS=1 - - # Software cryptography - reset_source - make -f examples/Makefile-nrf52840 "${options[@]}" DISABLE_BUILTIN_MBEDTLS=0 - - # Software cryptography with threading support - reset_source - make -f examples/Makefile-nrf52840 "${options[@]}" DISABLE_BUILTIN_MBEDTLS=0 MBEDTLS_THREADING=1 -} - main() { ./bootstrap @@ -177,9 +59,6 @@ main() if [[ $# == 0 ]]; then build_cc2538 - build_nrf52811 - build_nrf52833 - build_nrf52840 return 0 fi diff --git a/script/check-arm-build-cmake b/script/check-arm-build-cmake index 5ff52f6d9..d8210ab1f 100755 --- a/script/check-arm-build-cmake +++ b/script/check-arm-build-cmake @@ -59,40 +59,12 @@ build_cc2538() "$(dirname "$0")"/cmake-build cc2538 "${OT_COMMON_OPTIONS[@]}" "${OT_BASIC_CHECK_OPTIONS[@]}" "${options[@]}" } -build_nrf52811() -{ - reset_source - "$(dirname "$0")"/cmake-build nrf52811 "$1" "${OT_COMMON_OPTIONS[@]}" -} - -build_nrf52833() -{ - reset_source - "$(dirname "$0")"/cmake-build nrf52833 "$1" "${OT_COMMON_OPTIONS[@]}" "${OT_BASIC_CHECK_OPTIONS[@]}" -} - -build_nrf52840() -{ - reset_source - "$(dirname "$0")"/cmake-build nrf52840 "$1" "${OT_COMMON_OPTIONS[@]}" "${OT_BASIC_CHECK_OPTIONS[@]}" -} - main() { export CPPFLAGS="${CPPFLAGS:-} -DNDEBUG" if [[ $# == 0 ]]; then build_cc2538 - # UART transport - build_nrf52840 UART_trans - # USB transport with bootloader e.g. to support PCA10059 dongle - build_nrf52840 USB_trans_bl - # SPI transport for NCP - build_nrf52840 SPI_trans_NCP - # Software cryptography - build_nrf52840 soft_crypto - # Software cryptography with threading support - build_nrf52840 soft_crypto_threading return 0 fi diff --git a/script/cmake-build b/script/cmake-build index 5f0d083ff..d53b2cceb 100755 --- a/script/cmake-build +++ b/script/cmake-build @@ -42,10 +42,6 @@ # # script/cmake-build ${platform} -D${option}=OFF # -# Need to add build type when compilling nrf528xx: -# -# script/cmake-build ${platform} ${nrf_build_type} -D${option}=ON -D${option}=OFF -# # Compile with the specified ninja build target: # # OT_CMAKE_NINJA_TARGET="ot-cli-ftd" script/cmake-build ${platform} @@ -68,8 +64,7 @@ set -euxo pipefail OT_CMAKE_NINJA_TARGET=${OT_CMAKE_NINJA_TARGET:-} readonly OT_SRCDIR="$(pwd)" -readonly OT_PLATFORMS=(cc2538 nrf52811 nrf52833 nrf52840 simulation posix) -readonly OT_NRF528XX_BUILD_TYPES=(UART_trans USB_trans_bl SPI_trans_NCP soft_crypto soft_crypto_threading) +readonly OT_PLATFORMS=(cc2538 simulation posix) readonly OT_POSIX_SIM_COMMON_OPTIONS=( "-DOT_BORDER_AGENT=ON" "-DOT_BORDER_ROUTER=ON" @@ -105,33 +100,6 @@ readonly OT_POSIX_SIM_COMMON_OPTIONS=( "-DOT_RCP_RESTORATION_MAX_COUNT=2" ) -readonly OT_nrf52811_OPTIONS=( - "-DOT_BORDER_ROUTER=ON" - "-DOT_COAP=ON" - "-DOT_DNS_CLIENT=ON" - "-DOT_LINK_RAW=ON" - "-DOT_MAC_FILTER=ON" - "-DOT_MTD_NETDIAG=ON" -) - -readonly OT_nrf52833_OPTIONS=( - "-DOT_BORDER_AGENT=ON" - "-DOT_BORDER_ROUTER=ON" - "-DOT_COAP=ON" - "-DOT_COAPS=ON" - "-DOT_ECDSA=ON" - "-DOT_FULL_LOGS=ON" - "-DOT_IP6_FRAGM=ON" - "-DOT_LINK_RAW=ON" - "-DOT_MAC_FILTER=ON" - "-DOT_MTD_NETDIAG=ON" - "-DOT_SERVICE=ON" - "-DOT_SNTP_CLIENT=ON" - "-DOT_UDP_FORWARD=ON" -) - -readonly OT_nrf52840_OPTIONS=("${OT_nrf52833_OPTIONS[@]:0}") - die() { echo " ** ERROR: Openthread CMake doesn't support platform \"$1\"" @@ -169,13 +137,6 @@ main() # Check if the platform supports cmake. echo "${OT_PLATFORMS[@]}" | grep -wq "${platform}" || die "${platform}" - local nrf_build_type="" - if [[ ${platform} == nrf528* ]]; then - nrf_build_type="$2" - echo "${OT_NRF528XX_BUILD_TYPES[@]}" | grep -wq "${nrf_build_type}" || die "${nrf_build_type}" - shift - fi - shift local local_options=() local options=( @@ -198,55 +159,6 @@ main() cc2538) options+=("-DCMAKE_TOOLCHAIN_FILE=examples/platforms/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=MinSizeRel") ;; - nrf52811) - local_options+=("${OT_nrf52811_OPTIONS[@]}" "-DCMAKE_TOOLCHAIN_FILE=examples/platforms/nrf528xx/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=Release") - case "${nrf_build_type}" in - UART_trans) - OT_CMAKE_NINJA_TARGET=("ot-cli-mtd" "ot-ncp-mtd" "ot-rcp") - options+=("${local_options[@]}") - ;; - SPI_trans_NCP) - OT_CMAKE_NINJA_TARGET=("ot-ncp-mtd" "ot-rcp") - options+=("${local_options[@]}" "-DOT_NCP_SPI=ON") - ;; - esac - ;; - nrf52833) - local_options+=("${OT_nrf52833_OPTIONS[@]}" "-DCMAKE_TOOLCHAIN_FILE=examples/platforms/nrf528xx/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=Release") - case "${nrf_build_type}" in - UART_trans) - options+=("${local_options[@]}") - ;; - USB_trans_bl) - options+=("${local_options[@]}" "-DOT_USB=ON" "-DOT_BOOTLOADER=USB") - ;; - SPI_trans_NCP) - OT_CMAKE_NINJA_TARGET=("ot-ncp-ftd" "ot-ncp-mtd" "ot-rcp") - options+=("${local_options[@]}" "-DOT_NCP_SPI=ON") - ;; - esac - ;; - nrf52840) - local_options+=("${OT_nrf52840_OPTIONS[@]}" "-DCMAKE_TOOLCHAIN_FILE=examples/platforms/nrf528xx/${platform}/arm-none-eabi.cmake" "-DCMAKE_BUILD_TYPE=Release") - case "${nrf_build_type}" in - UART_trans) - options+=("${local_options[@]}" "-DOT_EXTERNAL_MBEDTLS=nordicsemi-mbedtls") - ;; - USB_trans_bl) - options+=("${local_options[@]}" "-DOT_USB=ON" "-DOT_BOOTLOADER=USB" "-DOT_EXTERNAL_MBEDTLS=nordicsemi-mbedtls") - ;; - SPI_trans_NCP) - OT_CMAKE_NINJA_TARGET=("ot-ncp-ftd" "ot-ncp-mtd" "ot-rcp") - options+=("${local_options[@]}" "-DOT_NCP_SPI=ON" "-DOT_EXTERNAL_MBEDTLS=nordicsemi-mbedtls") - ;; - soft_crypto) - options+=("${local_options[@]}") - ;; - soft_crypto_threading) - options+=("${local_options[@]}" "-DOT_MBEDTLS_THREADING=ON") - ;; - esac - ;; *) options+=("-DCMAKE_TOOLCHAIN_FILE=examples/platforms/${platform}/arm-none-eabi.cmake") ;; diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 62d6b764f..365623c24 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -29,8 +29,3 @@ if(NOT OT_EXTERNAL_MBEDTLS) add_subdirectory(mbedtls) endif() - -if(OT_PLATFORM MATCHES "^nrf*") - add_subdirectory(jlink) - add_subdirectory(NordicSemiconductor) -endif() diff --git a/third_party/Makefile.am b/third_party/Makefile.am index 4ac2fe659..1410a6a10 100644 --- a/third_party/Makefile.am +++ b/third_party/Makefile.am @@ -31,7 +31,6 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am EXTRA_DIST = \ nlbuild-autotools \ openthread-test-driver \ - NordicSemiconductor \ $(NULL) # Always package (e.g. for 'make dist') these subdirectories. @@ -41,43 +40,8 @@ DIST_SUBDIRS = \ mbedtls \ $(NULL) -SUBDIRS = - -if OPENTHREAD_PLATFORM_NRF52811 -SUBDIRS += \ - NordicSemiconductor \ +SUBDIRS = \ $(NULL) -endif - -if OPENTHREAD_EXAMPLES_NRF52811 -SUBDIRS += \ - jlink \ - $(NULL) -endif - -if OPENTHREAD_PLATFORM_NRF52833 -SUBDIRS += \ - NordicSemiconductor \ - $(NULL) -endif - -if OPENTHREAD_EXAMPLES_NRF52833 -SUBDIRS += \ - jlink \ - $(NULL) -endif - -if OPENTHREAD_PLATFORM_NRF52840 -SUBDIRS += \ - NordicSemiconductor \ - $(NULL) -endif - -if OPENTHREAD_EXAMPLES_NRF52840 -SUBDIRS += \ - jlink \ - $(NULL) -endif if OPENTHREAD_ENABLE_BUILTIN_MBEDTLS SUBDIRS += \ diff --git a/third_party/NordicSemiconductor/CMakeLists.txt b/third_party/NordicSemiconductor/CMakeLists.txt deleted file mode 100644 index 008b1be10..000000000 --- a/third_party/NordicSemiconductor/CMakeLists.txt +++ /dev/null @@ -1,375 +0,0 @@ -# -# Copyright (c) 2020, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -set(COMMON_INCLUDES - ${PROJECT_SOURCE_DIR}/include - ${PROJECT_SOURCE_DIR}/src - ${PROJECT_SOURCE_DIR}/src/core - ${CMAKE_CURRENT_SOURCE_DIR}/drivers/radio - ${CMAKE_CURRENT_SOURCE_DIR}/drivers/radio/fem - ${CMAKE_CURRENT_SOURCE_DIR}/drivers/radio/fem/three_pin_gpio - ${CMAKE_CURRENT_SOURCE_DIR}/drivers/radio/mac_features - ${CMAKE_CURRENT_SOURCE_DIR}/drivers/radio/mac_features/ack_generator - ${CMAKE_CURRENT_SOURCE_DIR}/drivers/radio/platform/temperature - ${CMAKE_CURRENT_SOURCE_DIR}/drivers/radio/platform/lp_timer - ${CMAKE_CURRENT_SOURCE_DIR}/drivers/radio/rsch - ${CMAKE_CURRENT_SOURCE_DIR}/drivers/radio/rsch/raal - ${CMAKE_CURRENT_SOURCE_DIR}/drivers/radio/rsch/raal/softdevice -) - -set(EXAMPLE_INCLUDES - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/cmsis - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/config - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/dependencies - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/drivers/clock - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/drivers/common - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/drivers/power - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/drivers/systick - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/drivers/usbd - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/app_error - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/atfifo - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/atomic - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/block_dev - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/delay - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/usb - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/usb/config - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/usb/class/cdc - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/libraries/utf_converter - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/nrfx - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/nrfx/hal - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/nrfx/drivers - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/nrfx/drivers/include - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/nrfx/mdk - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/nrfx/soc - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/softdevice/s140/headers - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/softdevice/s140/headers/nrf52 -) - -set(COMMON_FLAG - -DSPIS_ENABLED=1 - -DSPIS0_ENABLED=1 - -DNRFX_SPIS_ENABLED=1 - -DNRFX_SPIS0_ENABLED=1 - -DCONFIG_GPIO_AS_PINRESET - -DENABLE_FEM=1 - -DUSE_APP_CONFIG=1 -) - -set(COMMON_SOURCES - dependencies/app_util_platform.c - drivers/clock/nrf_drv_clock.c - drivers/power/nrf_drv_power.c - libraries/app_error/app_error.c - libraries/app_error/app_error_weak.c - libraries/utf_converter/utf.c - nrfx/drivers/src/nrfx_clock.c - nrfx/drivers/src/nrfx_nvmc.c - nrfx/drivers/src/nrfx_power.c - nrfx/drivers/src/nrfx_spis.c - nrfx/drivers/src/nrfx_systick.c - nrfx/hal/nrf_nvmc.c - nrfx/soc/nrfx_atomic.c -) - -set(USB_SOURCES - nrfx/drivers/src/nrfx_usbd.c - libraries/atfifo/nrf_atfifo.c - libraries/atomic/nrf_atomic.c - libraries/usb/app_usbd.c - libraries/usb/app_usbd_core.c - libraries/usb/app_usbd_string_desc.c - libraries/usb/app_usbd_serial_num.c - libraries/usb/app_usbd_nrf_dfu_trigger.c - libraries/usb/nrf_dfu_trigger_usb.c - libraries/usb/class/cdc/acm/app_usbd_cdc_acm.c -) - -set(RADIO_DRIVER_SOURCES - drivers/radio/fal/nrf_802154_fal.c - drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.c - drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.c - drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.c - drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.c - drivers/radio/mac_features/nrf_802154_csma_ca.c - drivers/radio/mac_features/nrf_802154_delayed_trx.c - drivers/radio/mac_features/nrf_802154_filter.c - drivers/radio/mac_features/nrf_802154_frame_parser.c - drivers/radio/mac_features/nrf_802154_precise_ack_timeout.c - drivers/radio/fem/three_pin_gpio/nrf_fem_three_pin_gpio.c - drivers/radio/nrf_802154_core_hooks.c - drivers/radio/nrf_802154_core.c - drivers/radio/nrf_802154_critical_section.c - drivers/radio/nrf_802154_debug.c - drivers/radio/nrf_802154_pib.c - drivers/radio/nrf_802154_rssi.c - drivers/radio/nrf_802154_rx_buffer.c - drivers/radio/nrf_802154_timer_coord.c - drivers/radio/nrf_802154.c - drivers/radio/platform/coex/nrf_802154_wifi_coex_none.c - drivers/radio/platform/clock/nrf_802154_clock_ot.c - drivers/radio/platform/hp_timer/nrf_802154_hp_timer.c - drivers/radio/rsch/nrf_802154_rsch_crit_sect.c - drivers/radio/rsch/nrf_802154_rsch.c - drivers/radio/timer_scheduler/nrf_802154_timer_sched.c -) - -set(SINGLE_PHY_SOURCES - drivers/radio/nrf_802154_notification_direct.c - drivers/radio/nrf_802154_priority_drop_direct.c - drivers/radio/nrf_802154_request_direct.c - drivers/radio/rsch/raal/single_phy/single_phy.c -) - -set(RADIO_DRIVER_SOFTDEVICE_SOURCES - drivers/radio/nrf_802154_notification_swi.c - drivers/radio/nrf_802154_priority_drop_swi.c - drivers/radio/nrf_802154_request_swi.c - drivers/radio/nrf_802154_swi.c - drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.c -) - -set(RADIO_DRIVER_SINGLE_PHY_SOURCES - drivers/radio/nrf_802154_notification_direct.c - drivers/radio/nrf_802154_priority_drop_direct.c - drivers/radio/nrf_802154_request_direct.c - drivers/radio/rsch/raal/single_phy/single_phy.c -) - -if(OT_PLATFORM STREQUAL "nrf52811") - add_library(nordicsemi-nrf52811-sdk) - target_compile_definitions(nordicsemi-nrf52811-sdk - PRIVATE - ${COMMON_FLAG} - -DNRF52811_XXAA - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" - -D__HEAP_SIZE=0 - -D__STACK_SIZE=2048 - ) - target_include_directories(nordicsemi-nrf52811-sdk - PUBLIC - ${COMMON_INCLUDES} - ${EXAMPLE_INCLUDES} - ${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx/nrf52811 - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/config/nrf52811/config - ) - set_property(SOURCE nrfx/mdk/gcc_startup_nrf52811.S PROPERTY LANGUAGE C) - target_sources(nordicsemi-nrf52811-sdk - PRIVATE - ${COMMON_SOURCES} - nrfx/mdk/gcc_startup_nrf52811.S - nrfx/mdk/system_nrf52811.c - ) - target_link_libraries(nordicsemi-nrf52811-sdk PRIVATE ot-config) - - add_library(nordicsemi-nrf52811-radio-driver) - target_compile_definitions(nordicsemi-nrf52811-radio-driver - PRIVATE - ${COMMON_FLAG} - -DNRF52811_XXAA - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" - -D__HEAP_SIZE=0 - -D__STACK_SIZE=2048 - -DRAAL_SINGLE_PHY=1 - ) - target_include_directories(nordicsemi-nrf52811-radio-driver - PUBLIC - ${COMMON_INCLUDES} - ${EXAMPLE_INCLUDES} - ${OT_PUBLIC_INCLUDES} - ${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx/nrf52811 - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/config/nrf52811/config - ) - target_sources(nordicsemi-nrf52811-radio-driver - PRIVATE - ${RADIO_DRIVER_SOURCES} - ${RADIO_DRIVER_SINGLE_PHY_SOURCES} - ) -elseif(OT_PLATFORM STREQUAL "nrf52833") - add_library(nordicsemi-nrf52833-sdk) - target_compile_definitions(nordicsemi-nrf52833-sdk - PRIVATE - ${COMMON_FLAG} - -DNRF52833_XXAA - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" - ) - target_include_directories(nordicsemi-nrf52833-sdk - PUBLIC - ${COMMON_INCLUDES} - ${EXAMPLE_INCLUDES} - ${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx/nrf52833 - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/config/nrf52833/config - ) - set_property(SOURCE nrfx/mdk/gcc_startup_nrf52833.S PROPERTY LANGUAGE C) - target_sources(nordicsemi-nrf52833-sdk - PRIVATE - ${COMMON_SOURCES} - ${USB_SOURCES} - nrfx/mdk/gcc_startup_nrf52833.S - nrfx/mdk/system_nrf52833.c - ) - target_link_libraries(nordicsemi-nrf52833-sdk PRIVATE ot-config) - - add_library(nordicsemi-nrf52833-radio-driver) - target_compile_definitions(nordicsemi-nrf52833-radio-driver - PRIVATE - ${COMMON_FLAG} - -DNRF52833_XXAA - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" - -DRAAL_SINGLE_PHY=1 - ) - target_include_directories(nordicsemi-nrf52833-radio-driver - PUBLIC - ${COMMON_INCLUDES} - ${EXAMPLE_INCLUDES} - ${OT_PUBLIC_INCLUDES} - ${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx/nrf52833 - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/config/nrf52833/config - ) - target_sources(nordicsemi-nrf52833-radio-driver - PRIVATE - ${RADIO_DRIVER_SOURCES} - ${RADIO_DRIVER_SINGLE_PHY_SOURCES} - ) - add_library(nordicsemi-nrf52833-radio-driver-softdevice) - target_compile_definitions(nordicsemi-nrf52833-radio-driver-softdevice - PRIVATE - ${COMMON_FLAG} - -DNRF52833_XXAA - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" - -DRAAL_SINGLE_PHY=1 - -DSOFTDEVICE_PRESENT - -DS140 - -DRAAL_SOFTDEVICE=1 - ) - target_include_directories(nordicsemi-nrf52833-radio-driver-softdevice - PUBLIC - ${COMMON_INCLUDES} - ${EXAMPLE_INCLUDES} - ${OT_PUBLIC_INCLUDES} - ${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx/nrf52833 - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/config/nrf52833/config - ) - target_sources(nordicsemi-nrf52833-radio-driver-softdevice - PRIVATE - ${RADIO_DRIVER_SOURCES} - ${RADIO_DRIVER_SINGLE_PHY_SOURCES} - ) -elseif(OT_PLATFORM STREQUAL "nrf52840") - add_library(nordicsemi-nrf52840-sdk) - target_compile_definitions(nordicsemi-nrf52840-sdk - PRIVATE - ${COMMON_FLAG} - -DNRF52840_XXAA - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" - ) - target_include_directories(nordicsemi-nrf52840-sdk - PUBLIC - ${COMMON_INCLUDES} - ${EXAMPLE_INCLUDES} - ${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx/nrf52840/ - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/config/nrf52840/config - ) - set_property(SOURCE nrfx/mdk/gcc_startup_nrf52840.S PROPERTY LANGUAGE C) - target_sources(nordicsemi-nrf52840-sdk - PRIVATE - ${COMMON_SOURCES} - ${USB_SOURCES} - nrfx/mdk/gcc_startup_nrf52840.S - nrfx/mdk/system_nrf52840.c - ) - target_link_libraries(nordicsemi-nrf52840-sdk PRIVATE ot-config) - - add_library(nordicsemi-nrf52840-radio-driver) - target_compile_definitions(nordicsemi-nrf52840-radio-driver - PRIVATE - ${COMMON_FLAG} - -DNRF52840_XXAA - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" - -DRAAL_SINGLE_PHY=1 - ) - target_include_directories(nordicsemi-nrf52840-radio-driver - PUBLIC - ${COMMON_INCLUDES} - ${EXAMPLE_INCLUDES} - ${OT_PUBLIC_INCLUDES} - ${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx/nrf52840/ - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/config/nrf52840/config - ) - target_sources(nordicsemi-nrf52840-radio-driver - PRIVATE - ${RADIO_DRIVER_SOURCES} - ${RADIO_DRIVER_SINGLE_PHY_SOURCES} - ) - - add_library(nordicsemi-nrf52840-radio-driver-softdevice) - target_compile_definitions(nordicsemi-nrf52840-radio-driver-softdevice - PRIVATE - ${COMMON_FLAG} - -DNRF52840_XXAA - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" - -DRAAL_SINGLE_PHY=1 - -DSOFTDEVICE_PRESENT - -DS140 - -DRAAL_SOFTDEVICE=1 - ) - target_include_directories(nordicsemi-nrf52840-radio-driver-softdevice - PUBLIC - ${COMMON_INCLUDES} - ${EXAMPLE_INCLUDES} - ${OT_PUBLIC_INCLUDES} - ${PROJECT_SOURCE_DIR}/examples/platforms/nrf528xx/nrf52840/ - ${PROJECT_SOURCE_DIR}/third_party/NordicSemiconductor/config/nrf52840/config - ) - target_sources(nordicsemi-nrf52840-radio-driver-softdevice - PRIVATE - ${RADIO_DRIVER_SOURCES} - ${RADIO_DRIVER_SINGLE_PHY_SOURCES} - ) -else() - message(FATAL_ERROR "Platform unknown: ${OT_PLATFORM}") -endif() - -add_library(nordicsemi-mbedtls INTERFACE) - -target_link_libraries(nordicsemi-mbedtls - INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libmbedcrypto_shared.a - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libmbedtls_tls_vanilla.a - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libmbedtls_x509_vanilla.a - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libmbedcrypto_cc3xx.a - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libnrf_cc310_platform_0.9.4.a - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libmbedcrypto_oberon.a - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libmbedtls_base_vanilla.a - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libmbedcrypto_cc3xx.a - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libmbedtls_base_vanilla.a - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libmbedcrypto_shared.a - ${CMAKE_CURRENT_SOURCE_DIR}/libraries/nrf_security/lib/libnrf_cc310_platform_0.9.4.a -) - diff --git a/third_party/NordicSemiconductor/Makefile.am b/third_party/NordicSemiconductor/Makefile.am deleted file mode 100644 index 998487be4..000000000 --- a/third_party/NordicSemiconductor/Makefile.am +++ /dev/null @@ -1,541 +0,0 @@ -# -# Copyright (c) 2016-2019, The OpenThread Authors. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. Neither the name of the copyright holder nor the -# names of its contributors may be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. -# - -include $(abs_top_nlbuild_autotools_dir)/automake/pre.am - - -lib_LIBRARIES = \ - $(NULL) - -# Build radio drivers when building platform libraries. -if OPENTHREAD_PLATFORM_NRF52811 -lib_LIBRARIES += \ - libnordicsemi-nrf52811-radio-driver.a \ - $(NULL) -endif - -if OPENTHREAD_PLATFORM_NRF52833 -lib_LIBRARIES += \ - libnordicsemi-nrf52833-radio-driver.a \ - libnordicsemi-nrf52833-radio-driver-softdevice.a \ - $(NULL) -endif - -if OPENTHREAD_PLATFORM_NRF52840 -lib_LIBRARIES += \ - libnordicsemi-nrf52840-radio-driver.a \ - libnordicsemi-nrf52840-radio-driver-softdevice.a \ - $(NULL) -endif - -# Only build the SDK library when building the example applications. -if OPENTHREAD_EXAMPLES_NRF52811 -lib_LIBRARIES += \ - libnordicsemi-nrf52811-sdk.a \ - $(NULL) -endif - -if OPENTHREAD_EXAMPLES_NRF52833 -lib_LIBRARIES += \ - libnordicsemi-nrf52833-sdk.a \ - $(NULL) -endif - -if OPENTHREAD_EXAMPLES_NRF52840 -lib_LIBRARIES += \ - libnordicsemi-nrf52840-sdk.a \ - $(NULL) -endif - -# Do not enable -pedantic-errors for Nordic Semiconductor driver library -override CFLAGS := $(filter-out -pedantic-errors,$(CFLAGS)) -override CXXFLAGS := $(filter-out -pedantic-errors,$(CXXFLAGS)) - -# Do not enable -Wundef for Nordic Semiconductor driver library -override CFLAGS := $(filter-out -Wundef,$(CFLAGS)) -override CXXFLAGS := $(filter-out -Wundef,$(CXXFLAGS)) - -# Do not enable -Wcast-align for Nordic Semiconductor driver library -override CFLAGS := $(filter-out -Wcast-align,$(CFLAGS)) -override CXXFLAGS := $(filter-out -Wcast-align,$(CXXFLAGS)) - -CFLAGS += -Wno-unused-but-set-variable -CXXFLAGS += -Wno-unused-but-set-variable - -COMMONCPPFLAGS = \ - -DCONFIG_GPIO_AS_PINRESET \ - -DENABLE_FEM=1 \ - -DUSE_APP_CONFIG=1 \ - -I$(srcdir) \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/core \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator \ - $(NULL) - -# Only reference the SDK header files included in third_party/NordicSemiconductor -# when building the example applications. -# -# When building just the platform libraries, the caller of configure is expected -# to provide the correct -I arguments to locate the necessary header files in an -# external copy of the Nordic nRF5 SDK. -# -# Note that an exception is made for the 802.15.4 radio driver, which is always built -# using the sources in third_party/NordicSemiconductor/drivers/radio. -if OPENTHREAD_ENABLE_EXAMPLES -COMMONCPPFLAGS += \ - -I$(top_srcdir)/third_party/NordicSemiconductor \ - -I$(top_srcdir)/third_party/NordicSemiconductor/cmsis \ - -I$(top_srcdir)/third_party/NordicSemiconductor/config \ - -I$(top_srcdir)/third_party/NordicSemiconductor/dependencies \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/clock \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/common \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/power \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/systick \ - -I$(top_srcdir)/third_party/NordicSemiconductor/drivers/usbd \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/app_error \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/atfifo \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/atomic \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/block_dev \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/delay \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/config \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm \ - -I$(top_srcdir)/third_party/NordicSemiconductor/libraries/utf_converter \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk \ - -I$(top_srcdir)/third_party/NordicSemiconductor/nrfx/soc \ - -I$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers \ - -I$(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf52 \ - -Wno-unused-parameter \ - $(NULL) - -NRF52811_CPPFLAGS = \ - -DNRF52811_XXAA \ - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" \ - -D__HEAP_SIZE=0 \ - -D__STACK_SIZE=2048 \ - -I$(top_srcdir)/examples/platforms/nrf528xx/nrf52811 \ - -I$(top_srcdir)/third_party/NordicSemiconductor/config/nrf52811/config \ - $(NULL) -endif - -NRF52833_CPPFLAGS = \ - -DNRF52833_XXAA \ - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" \ - -I$(top_srcdir)/examples/platforms/nrf52833 \ - -I$(top_srcdir)/third_party/NordicSemiconductor/config/nrf52833/config \ - $(NULL) - -NRF52840_CPPFLAGS = \ - -DNRF52840_XXAA \ - -DNRF_802154_PROJECT_CONFIG=\"platform-config.h\" \ - -I$(top_srcdir)/examples/platforms/nrf528xx/nrf52840/ \ - -I$(top_srcdir)/third_party/NordicSemiconductor/config/nrf52840/config \ - $(NULL) - -NORDICSEMI_COMMON_SOURCES = \ - dependencies/app_util_platform.c \ - drivers/clock/nrf_drv_clock.c \ - drivers/power/nrf_drv_power.c \ - libraries/app_error/app_error.c \ - libraries/app_error/app_error_weak.c \ - libraries/utf_converter/utf.c \ - nrfx/drivers/src/nrfx_clock.c \ - nrfx/drivers/src/nrfx_nvmc.c \ - nrfx/drivers/src/nrfx_power.c \ - nrfx/drivers/src/nrfx_spis.c \ - nrfx/drivers/src/nrfx_systick.c \ - nrfx/hal/nrf_nvmc.c \ - nrfx/soc/nrfx_atomic.c \ - $(NULL) - -NORDICSEMI_USB_SOURCES = \ - nrfx/drivers/src/nrfx_usbd.c \ - libraries/atfifo/nrf_atfifo.c \ - libraries/atomic/nrf_atomic.c \ - libraries/usb/app_usbd.c \ - libraries/usb/app_usbd_core.c \ - libraries/usb/app_usbd_string_desc.c \ - libraries/usb/app_usbd_serial_num.c \ - libraries/usb/app_usbd_nrf_dfu_trigger.c \ - libraries/usb/nrf_dfu_trigger_usb.c \ - libraries/usb/class/cdc/acm/app_usbd_cdc_acm.c \ - $(NULL) - -NORDICSEMI_NRF52811_SOURCES = \ - nrfx/mdk/gcc_startup_nrf52811.S \ - nrfx/mdk/system_nrf52811.c \ - $(NULL) - -NORDICSEMI_NRF52833_SOURCES = \ - nrfx/mdk/gcc_startup_nrf52833.S \ - nrfx/mdk/system_nrf52833.c \ - $(NULL) - -NORDICSEMI_NRF52840_SOURCES = \ - nrfx/mdk/gcc_startup_nrf52840.S \ - nrfx/mdk/system_nrf52840.c \ - $(NULL) - -RADIO_DRIVER_SOURCES = \ - drivers/radio/fal/nrf_802154_fal.c \ - drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.c \ - drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.c \ - drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.c \ - drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.c \ - drivers/radio/mac_features/nrf_802154_csma_ca.c \ - drivers/radio/mac_features/nrf_802154_delayed_trx.c \ - drivers/radio/mac_features/nrf_802154_filter.c \ - drivers/radio/mac_features/nrf_802154_frame_parser.c \ - drivers/radio/mac_features/nrf_802154_precise_ack_timeout.c \ - drivers/radio/fem/three_pin_gpio/nrf_fem_three_pin_gpio.c \ - drivers/radio/nrf_802154_core_hooks.c \ - drivers/radio/nrf_802154_core.c \ - drivers/radio/nrf_802154_critical_section.c \ - drivers/radio/nrf_802154_debug.c \ - drivers/radio/nrf_802154_pib.c \ - drivers/radio/nrf_802154_rssi.c \ - drivers/radio/nrf_802154_rx_buffer.c \ - drivers/radio/nrf_802154_timer_coord.c \ - drivers/radio/nrf_802154.c \ - drivers/radio/platform/coex/nrf_802154_wifi_coex_none.c \ - drivers/radio/platform/clock/nrf_802154_clock_ot.c \ - drivers/radio/platform/hp_timer/nrf_802154_hp_timer.c \ - drivers/radio/rsch/nrf_802154_rsch_crit_sect.c \ - drivers/radio/rsch/nrf_802154_rsch.c \ - drivers/radio/timer_scheduler/nrf_802154_timer_sched.c \ - $(NULL) - -RADIO_DRIVER_SINGLE_PHY_SOURCES = \ - drivers/radio/nrf_802154_notification_direct.c \ - drivers/radio/nrf_802154_priority_drop_direct.c \ - drivers/radio/nrf_802154_request_direct.c \ - drivers/radio/rsch/raal/single_phy/single_phy.c \ - $(NULL) - -RADIO_DRIVER_SINGLE_PHY_CPPFLAGS = \ - -DRAAL_SINGLE_PHY=1 \ - $(NULL) - -RADIO_DRIVER_SOFTDEVICE_SOURCES = \ - drivers/radio/nrf_802154_notification_swi.c \ - drivers/radio/nrf_802154_priority_drop_swi.c \ - drivers/radio/nrf_802154_request_swi.c \ - drivers/radio/nrf_802154_swi.c \ - drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.c \ - $(NULL) - -RADIO_DRIVER_SOFTDEVICE_CPPFLAGS = \ - -DRAAL_SOFTDEVICE=1 \ - $(NULL) - -SOFTDEVICE_CPPFLAGS = \ - -DSOFTDEVICE_PRESENT \ - -DS140 \ - -DRAAL_SOFTDEVICE=1 \ - $(NULL) - -libnordicsemi_nrf52811_sdk_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NRF52811_CPPFLAGS) \ - $(NULL) - -libnordicsemi_nrf52811_sdk_a_SOURCES = \ - $(NORDICSEMI_COMMON_SOURCES) \ - $(NORDICSEMI_NRF52811_SOURCES) \ - $(NULL) - -libnordicsemi_nrf52811_radio_driver_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NRF52811_CPPFLAGS) \ - $(RADIO_DRIVER_SINGLE_PHY_CPPFLAGS) \ - $(NULL) - -libnordicsemi_nrf52811_radio_driver_a_SOURCES = \ - $(RADIO_DRIVER_SOURCES) \ - $(RADIO_DRIVER_SINGLE_PHY_SOURCES) \ - $(NULL) - -libnordicsemi_nrf52833_sdk_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NRF52833_CPPFLAGS) \ - $(NULL) - -libnordicsemi_nrf52833_sdk_a_SOURCES = \ - $(NORDICSEMI_COMMON_SOURCES) \ - $(NORDICSEMI_USB_SOURCES) \ - $(NORDICSEMI_NRF52833_SOURCES) \ - $(NULL) - -libnordicsemi_nrf52833_radio_driver_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NRF52833_CPPFLAGS) \ - $(RADIO_DRIVER_SINGLE_PHY_CPPFLAGS) \ - $(NULL) - -libnordicsemi_nrf52833_radio_driver_a_SOURCES = \ - $(RADIO_DRIVER_SOURCES) \ - $(RADIO_DRIVER_SINGLE_PHY_SOURCES) \ - $(NULL) - -libnordicsemi_nrf52833_radio_driver_softdevice_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NRF52833_CPPFLAGS) \ - $(SOFTDEVICE_CPPFLAGS) \ - $(RADIO_DRIVER_SOFTDEVICE_CPPFLAGS) \ - $(NULL) - -libnordicsemi_nrf52833_radio_driver_softdevice_a_SOURCES = \ - $(RADIO_DRIVER_SOURCES) \ - $(RADIO_DRIVER_SOFTDEVICE_SOURCES) \ - $(NULL) - -libnordicsemi_nrf52840_sdk_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NRF52840_CPPFLAGS) \ - $(NULL) - -libnordicsemi_nrf52840_sdk_a_SOURCES = \ - $(NORDICSEMI_COMMON_SOURCES) \ - $(NORDICSEMI_USB_SOURCES) \ - $(NORDICSEMI_NRF52840_SOURCES) \ - $(NULL) - -libnordicsemi_nrf52840_radio_driver_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NRF52840_CPPFLAGS) \ - $(RADIO_DRIVER_SINGLE_PHY_CPPFLAGS) \ - $(NULL) - -libnordicsemi_nrf52840_radio_driver_a_SOURCES = \ - $(RADIO_DRIVER_SOURCES) \ - $(RADIO_DRIVER_SINGLE_PHY_SOURCES) \ - $(NULL) - -libnordicsemi_nrf52840_radio_driver_softdevice_a_CPPFLAGS = \ - $(COMMONCPPFLAGS) \ - $(NRF52840_CPPFLAGS) \ - $(SOFTDEVICE_CPPFLAGS) \ - $(RADIO_DRIVER_SOFTDEVICE_CPPFLAGS) \ - $(NULL) - -libnordicsemi_nrf52840_radio_driver_softdevice_a_SOURCES = \ - $(RADIO_DRIVER_SOURCES) \ - $(RADIO_DRIVER_SOFTDEVICE_SOURCES) \ - $(NULL) - -noinst_HEADERS = \ - $(top_srcdir)/third_party/NordicSemiconductor/cmsis/arm_math.h \ - $(top_srcdir)/third_party/NordicSemiconductor/cmsis/cmsis_armcc_V6.h \ - $(top_srcdir)/third_party/NordicSemiconductor/cmsis/cmsis_armcc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/cmsis/cmsis_gcc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cm4.h \ - $(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cmFunc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cmInstr.h \ - $(top_srcdir)/third_party/NordicSemiconductor/cmsis/core_cmSimd.h \ - $(top_srcdir)/third_party/NordicSemiconductor/config/app_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/config/nrf52811/config/sdk_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/config/nrf52833/config/sdk_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/config/nrf52840/config/sdk_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/app_util_platform.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/app_util.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/legacy/apply_old_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nordic_common.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_assert.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_error.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_instance.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_internal.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_types.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_ctrl.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_log_ctrl_internal.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrf_section.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrfx_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrfx_glue.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/nrfx_log.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_common.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_errors.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_macros.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_os.h \ - $(top_srcdir)/third_party/NordicSemiconductor/dependencies/sdk_resources.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/common/nrf_drv_common.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/power/nrf_drv_power.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/systick/nrf_drv_systick.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd_errata.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fal/nrf_802154_fal.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/none/nrf_fem_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_protocol_api.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_protocol_legacy_api.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio/nrf_fem_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio/nrf_fem_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_delayed_trx.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_frame_parser.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_const.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug_core.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_peripherals.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_procedures_duration.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_timer_coord.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_types.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/nrf_802154_utils.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/coex/nrf_802154_wifi_coex.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/hp_timer/nrf_802154_hp_timer.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/platform/temperature/nrf_802154_temperature.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch_crit_sect.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal/nrf_raal_api.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal/nrf_raal_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal/simulator/nrf_802154_debug.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_802154_debug.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.h \ - $(top_srcdir)/third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/app_error/app_error_weak.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/app_error/app_error.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo_internal.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic_internal.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/block_dev/nrf_block_dev.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/delay/nrf_delay.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_class_base.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_core.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_descriptor.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_langid.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_request.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_types.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger_types.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger_internal.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_desc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_types.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm_internal.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/usb/config/app_usbd_string_config.h \ - $(top_srcdir)/third_party/NordicSemiconductor/libraries/utf_converter/utf.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/nrfx_common.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/nrfx_errors.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_clock.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_nvmc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_power_clock.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_power.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_spis.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_systick.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/include/nrfx_usbd.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/drivers/src/nrfx_usbd_errata.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_clock.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_gpio.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_gpiote.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_egu.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_nvmc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_ppi.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_power.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_rng.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_spis.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_uart.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/hal/nrf_usbd.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/compiler_abstraction.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf_peripherals.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf51_to_nrf52.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf51_to_nrf52810.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52_to_nrf52810.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf51_to_nrf52840.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52_to_nrf52833.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52_to_nrf52840.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52810_to_nrf52811.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52811.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52811_bitfields.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52811_peripherals.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52833.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52833_bitfields.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52833_peripherals.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/system_nrf52833.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52840.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52840_bitfields.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/nrf52840_peripherals.h \ - $(top_srcdir)/third_party/NordicSemiconductor/nrfx/mdk/system_nrf52840.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_err.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gap.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gatt.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gattc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_gatts.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_hci.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_l2cap.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_ranges.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/ble_types.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error_sdm.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_error_soc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_nvic.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_sdm.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_soc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf_svc.h \ - $(top_srcdir)/third_party/NordicSemiconductor/softdevice/s140/headers/nrf52/nrf_mbr.h \ - $(NULL) - -include $(abs_top_nlbuild_autotools_dir)/automake/post.am diff --git a/third_party/NordicSemiconductor/README.md b/third_party/NordicSemiconductor/README.md deleted file mode 100644 index b51ba0ef4..000000000 --- a/third_party/NordicSemiconductor/README.md +++ /dev/null @@ -1,15 +0,0 @@ -Description: -This folder consists of selected components from the nRF5 SDK, that are used -in process of building the OpenThread's nRF528xx platform. - -Directory consists of following folders: - - /cmsis - Core Peripheral Access Layer Headers files - - /dependencies - Dependencies for drivers and libraries from nRF5 SDK - - /drivers - Drivers for the nRF528xx platform - - /libraries - Libraries for the nRF528xx platform - - /nrfx - Standalone drivers for peripherals present in Nordic SoCs (https://github.com/NordicSemiconductor/nrfx) - - /segger_rtt - Configuration files for RTT communication - - /softdevice - SoftDevice s140 headers - - The following changes comparing to the nRF5 SDK 16.0 have been incorporated: -- modified nrf_log module files in order to remove unused backend logging functions \ No newline at end of file diff --git a/third_party/NordicSemiconductor/cmsis/arm_math.h b/third_party/NordicSemiconductor/cmsis/arm_math.h deleted file mode 100644 index e21a3cc37..000000000 --- a/third_party/NordicSemiconductor/cmsis/arm_math.h +++ /dev/null @@ -1,7030 +0,0 @@ -/* ---------------------------------------------------------------------- -* Copyright (C) 2010-2015 ARM Limited. All rights reserved. -* -* $Date: 20. October 2015 -* $Revision: V1.4.5 b -* -* Project: CMSIS DSP Library -* Title: arm_math.h -* -* Description: Public header file for CMSIS DSP Library -* -* Target Processor: Cortex-M7/Cortex-M4/Cortex-M3/Cortex-M0 -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* - Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* - Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in -* the documentation and/or other materials provided with the -* distribution. -* - Neither the name of ARM LIMITED nor the names of its contributors -* may be used to endorse or promote products derived from this -* software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -* POSSIBILITY OF SUCH DAMAGE. - * -------------------------------------------------------------------- */ - -/** - * @defgroup groupMath Basic Math Functions - */ - -/** - * @defgroup groupFastMath Fast Math Functions - * This set of functions provides a fast approximation to sine, cosine, and square root. - * As compared to most of the other functions in the CMSIS math library, the fast math functions - * operate on individual values and not arrays. - * There are separate functions for Q15, Q31, and floating-point data. - * - */ - -/** - * @defgroup groupCmplxMath Complex Math Functions - * This set of functions operates on complex data vectors. - * The data in the complex arrays is stored in an interleaved fashion - * (real, imag, real, imag, ...). - * In the API functions, the number of samples in a complex array refers - * to the number of complex values; the array contains twice this number of - * real values. - */ - -/** - * @defgroup groupFilters Filtering Functions - */ - -/** - * @defgroup groupMatrix Matrix Functions - * - * This set of functions provides basic matrix math operations. - * The functions operate on matrix data structures. For example, - * the type - * definition for the floating-point matrix structure is shown - * below: - *
- *     typedef struct
- *     {
- *       uint16_t numRows;     // number of rows of the matrix.
- *       uint16_t numCols;     // number of columns of the matrix.
- *       float32_t *pData;     // points to the data of the matrix.
- *     } arm_matrix_instance_f32;
- * 
- * There are similar definitions for Q15 and Q31 data types. - * - * The structure specifies the size of the matrix and then points to - * an array of data. The array is of size numRows X numCols - * and the values are arranged in row order. That is, the - * matrix element (i, j) is stored at: - *
- *     pData[i*numCols + j]
- * 
- * - * \par Init Functions - * There is an associated initialization function for each type of matrix - * data structure. - * The initialization function sets the values of the internal structure fields. - * Refer to the function arm_mat_init_f32(), arm_mat_init_q31() - * and arm_mat_init_q15() for floating-point, Q31 and Q15 types, respectively. - * - * \par - * Use of the initialization function is optional. However, if initialization function is used - * then the instance structure cannot be placed into a const data section. - * To place the instance structure in a const data - * section, manually initialize the data structure. For example: - *
- * arm_matrix_instance_f32 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q31 S = {nRows, nColumns, pData};
- * arm_matrix_instance_q15 S = {nRows, nColumns, pData};
- * 
- * where nRows specifies the number of rows, nColumns - * specifies the number of columns, and pData points to the - * data array. - * - * \par Size Checking - * By default all of the matrix functions perform size checking on the input and - * output matrices. For example, the matrix addition function verifies that the - * two input matrices and the output matrix all have the same number of rows and - * columns. If the size check fails the functions return: - *
- *     ARM_MATH_SIZE_MISMATCH
- * 
- * Otherwise the functions return - *
- *     ARM_MATH_SUCCESS
- * 
- * There is some overhead associated with this matrix size checking. - * The matrix size checking is enabled via the \#define - *
- *     ARM_MATH_MATRIX_CHECK
- * 
- * within the library project settings. By default this macro is defined - * and size checking is enabled. By changing the project settings and - * undefining this macro size checking is eliminated and the functions - * run a bit faster. With size checking disabled the functions always - * return ARM_MATH_SUCCESS. - */ - -/** - * @defgroup groupTransforms Transform Functions - */ - -/** - * @defgroup groupController Controller Functions - */ - -/** - * @defgroup groupStats Statistics Functions - */ -/** - * @defgroup groupSupport Support Functions - */ - -/** - * @defgroup groupInterpolation Interpolation Functions - * These functions perform 1- and 2-dimensional interpolation of data. - * Linear interpolation is used for 1-dimensional data and - * bilinear interpolation is used for 2-dimensional data. - */ - -/** - * @defgroup groupExamples Examples - */ -#ifndef _ARM_MATH_H -#define _ARM_MATH_H - -/* ignore some GCC warnings */ -#if defined ( __GNUC__ ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -#define __CMSIS_GENERIC /* disable NVIC and Systick functions */ - -#if defined(ARM_MATH_CM7) - #include "core_cm7.h" -#elif defined (ARM_MATH_CM4) - #include "core_cm4.h" -#elif defined (ARM_MATH_CM3) - #include "core_cm3.h" -#elif defined (ARM_MATH_CM0) - #include "core_cm0.h" - #define ARM_MATH_CM0_FAMILY -#elif defined (ARM_MATH_CM0PLUS) - #include "core_cm0plus.h" - #define ARM_MATH_CM0_FAMILY -#else - #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or ARM_MATH_CM0" -#endif - -#undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ -#include "string.h" -#include "math.h" -#ifdef __cplusplus -extern "C" -{ -#endif - - - /** - * @brief Macros required for reciprocal calculation in Normalized LMS - */ - -#define DELTA_Q31 (0x100) -#define DELTA_Q15 0x5 -#define INDEX_MASK 0x0000003F -#ifndef PI -#define PI 3.14159265358979f -#endif - - /** - * @brief Macros required for SINE and COSINE Fast math approximations - */ - -#define FAST_MATH_TABLE_SIZE 512 -#define FAST_MATH_Q31_SHIFT (32 - 10) -#define FAST_MATH_Q15_SHIFT (16 - 10) -#define CONTROLLER_Q31_SHIFT (32 - 9) -#define TABLE_SIZE 256 -#define TABLE_SPACING_Q31 0x400000 -#define TABLE_SPACING_Q15 0x80 - - /** - * @brief Macros required for SINE and COSINE Controller functions - */ - /* 1.31(q31) Fixed value of 2/360 */ - /* -1 to +1 is divided into 360 values so total spacing is (2/360) */ -#define INPUT_SPACING 0xB60B61 - - /** - * @brief Macro for Unaligned Support - */ -#ifndef UNALIGNED_SUPPORT_DISABLE - #define ALIGN4 -#else - #if defined (__GNUC__) - #define ALIGN4 __attribute__((aligned(4))) - #else - #define ALIGN4 __align(4) - #endif -#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ - - /** - * @brief Error status returned by some functions in the library. - */ - - typedef enum - { - ARM_MATH_SUCCESS = 0, /**< No error */ - ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ - ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ - ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ - ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ - ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ - ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ - } arm_status; - - /** - * @brief 8-bit fractional data type in 1.7 format. - */ - typedef int8_t q7_t; - - /** - * @brief 16-bit fractional data type in 1.15 format. - */ - typedef int16_t q15_t; - - /** - * @brief 32-bit fractional data type in 1.31 format. - */ - typedef int32_t q31_t; - - /** - * @brief 64-bit fractional data type in 1.63 format. - */ - typedef int64_t q63_t; - - /** - * @brief 32-bit floating-point type definition. - */ - typedef float float32_t; - - /** - * @brief 64-bit floating-point type definition. - */ - typedef double float64_t; - - /** - * @brief definition to read/write two 16 bit values. - */ -#if defined __CC_ARM - #define __SIMD32_TYPE int32_t __packed - #define CMSIS_UNUSED __attribute__((unused)) - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED __attribute__((unused)) - -#elif defined __GNUC__ - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED __attribute__((unused)) - -#elif defined __ICCARM__ - #define __SIMD32_TYPE int32_t __packed - #define CMSIS_UNUSED - -#elif defined __CSMC__ - #define __SIMD32_TYPE int32_t - #define CMSIS_UNUSED - -#elif defined __TASKING__ - #define __SIMD32_TYPE __unaligned int32_t - #define CMSIS_UNUSED - -#else - #error Unknown compiler -#endif - -#define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) -#define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) -#define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) -#define __SIMD64(addr) (*(int64_t **) & (addr)) - -#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) - /** - * @brief definition to pack two 16 bit values. - */ -#define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ - (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) -#define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ - (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) - -#endif - - - /** - * @brief definition to pack four 8 bit values. - */ -#ifndef ARM_MATH_BIG_ENDIAN - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) -#else - -#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ - (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ - (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ - (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) - -#endif - - - /** - * @brief Clips Q63 to Q31 values. - */ - static __INLINE q31_t clip_q63_to_q31( - q63_t x) - { - return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x; - } - - /** - * @brief Clips Q63 to Q15 values. - */ - static __INLINE q15_t clip_q63_to_q15( - q63_t x) - { - return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? - ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15); - } - - /** - * @brief Clips Q31 to Q7 values. - */ - static __INLINE q7_t clip_q31_to_q7( - q31_t x) - { - return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ? - ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x; - } - - /** - * @brief Clips Q31 to Q15 values. - */ - static __INLINE q15_t clip_q31_to_q15( - q31_t x) - { - return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ? - ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x; - } - - /** - * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. - */ - - static __INLINE q63_t mult32x64( - q63_t x, - q31_t y) - { - return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) + - (((q63_t) (x >> 32) * y))); - } - -/* - #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) - #define __CLZ __clz - #endif - */ -/* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */ -#if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) - static __INLINE uint32_t __CLZ( - q31_t data); - - static __INLINE uint32_t __CLZ( - q31_t data) - { - uint32_t count = 0; - uint32_t mask = 0x80000000; - - while ((data & mask) == 0) - { - count += 1u; - mask = mask >> 1u; - } - - return (count); - } -#endif - - /** - * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. - */ - - static __INLINE uint32_t arm_recip_q31( - q31_t in, - q31_t * dst, - q31_t * pRecipTable) - { - q31_t out; - uint32_t tempVal; - uint32_t index, i; - uint32_t signBits; - - if (in > 0) - { - signBits = ((uint32_t) (__CLZ( in) - 1)); - } - else - { - signBits = ((uint32_t) (__CLZ(-in) - 1)); - } - - /* Convert input sample to 1.31 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 24); - index = (index & INDEX_MASK); - - /* 1.31 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t) (((q63_t) in * out) >> 31); - tempVal = 0x7FFFFFFFu - tempVal; - /* 1.31 with exp 1 */ - /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */ - out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30); - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1u); - } - - - /** - * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. - */ - static __INLINE uint32_t arm_recip_q15( - q15_t in, - q15_t * dst, - q15_t * pRecipTable) - { - q15_t out = 0; - uint32_t tempVal = 0; - uint32_t index = 0, i = 0; - uint32_t signBits = 0; - - if (in > 0) - { - signBits = ((uint32_t)(__CLZ( in) - 17)); - } - else - { - signBits = ((uint32_t)(__CLZ(-in) - 17)); - } - - /* Convert input sample to 1.15 format */ - in = (in << signBits); - - /* calculation of index for initial approximated Val */ - index = (uint32_t)(in >> 8); - index = (index & INDEX_MASK); - - /* 1.15 with exp 1 */ - out = pRecipTable[index]; - - /* calculation of reciprocal value */ - /* running approximation for two iterations */ - for (i = 0u; i < 2u; i++) - { - tempVal = (uint32_t) (((q31_t) in * out) >> 15); - tempVal = 0x7FFFu - tempVal; - /* 1.15 with exp 1 */ - out = (q15_t) (((q31_t) out * tempVal) >> 14); - /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */ - } - - /* write output */ - *dst = out; - - /* return num of signbits of out = 1/in value */ - return (signBits + 1); - } - - - /* - * @brief C custom defined intrinisic function for only M0 processors - */ -#if defined(ARM_MATH_CM0_FAMILY) - static __INLINE q31_t __SSAT( - q31_t x, - uint32_t y) - { - int32_t posMax, negMin; - uint32_t i; - - posMax = 1; - for (i = 0; i < (y - 1); i++) - { - posMax = posMax * 2; - } - - if (x > 0) - { - posMax = (posMax - 1); - - if (x > posMax) - { - x = posMax; - } - } - else - { - negMin = -posMax; - - if (x < negMin) - { - x = negMin; - } - } - return (x); - } -#endif /* end of ARM_MATH_CM0_FAMILY */ - - - /* - * @brief C custom defined intrinsic function for M3 and M0 processors - */ -#if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) - - /* - * @brief C custom defined QADD8 for M3 and M0 processors - */ - static __INLINE uint32_t __QADD8( - uint32_t x, - uint32_t y) - { - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x ) >> 24) + (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); - } - - - /* - * @brief C custom defined QSUB8 for M3 and M0 processors - */ - static __INLINE uint32_t __QSUB8( - uint32_t x, - uint32_t y) - { - q31_t r, s, t, u; - - r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; - s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; - t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; - u = __SSAT(((((q31_t)x ) >> 24) - (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; - - return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); - } - - - /* - * @brief C custom defined QADD16 for M3 and M0 processors - */ - static __INLINE uint32_t __QADD16( - uint32_t x, - uint32_t y) - { -/* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */ - q31_t r = 0, s = 0; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHADD16 for M3 and M0 processors - */ - static __INLINE uint32_t __SHADD16( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined QSUB16 for M3 and M0 processors - */ - static __INLINE uint32_t __QSUB16( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHSUB16 for M3 and M0 processors - */ - static __INLINE uint32_t __SHSUB16( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined QASX for M3 and M0 processors - */ - static __INLINE uint32_t __QASX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHASX for M3 and M0 processors - */ - static __INLINE uint32_t __SHASX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined QSAX for M3 and M0 processors - */ - static __INLINE uint32_t __QSAX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; - s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SHSAX for M3 and M0 processors - */ - static __INLINE uint32_t __SHSAX( - uint32_t x, - uint32_t y) - { - q31_t r, s; - - r = (((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; - s = (((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; - - return ((uint32_t)((s << 16) | (r ))); - } - - - /* - * @brief C custom defined SMUSDX for M3 and M0 processors - */ - static __INLINE uint32_t __SMUSDX( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); - } - - /* - * @brief C custom defined SMUADX for M3 and M0 processors - */ - static __INLINE uint32_t __SMUADX( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); - } - - - /* - * @brief C custom defined QADD for M3 and M0 processors - */ - static __INLINE int32_t __QADD( - int32_t x, - int32_t y) - { - return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y))); - } - - - /* - * @brief C custom defined QSUB for M3 and M0 processors - */ - static __INLINE int32_t __QSUB( - int32_t x, - int32_t y) - { - return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y))); - } - - - /* - * @brief C custom defined SMLAD for M3 and M0 processors - */ - static __INLINE uint32_t __SMLAD( - uint32_t x, - uint32_t y, - uint32_t sum) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + - ( ((q31_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLADX for M3 and M0 processors - */ - static __INLINE uint32_t __SMLADX( - uint32_t x, - uint32_t y, - uint32_t sum) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + - ( ((q31_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLSDX for M3 and M0 processors - */ - static __INLINE uint32_t __SMLSDX( - uint32_t x, - uint32_t y, - uint32_t sum) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + - ( ((q31_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLALD for M3 and M0 processors - */ - static __INLINE uint64_t __SMLALD( - uint32_t x, - uint32_t y, - uint64_t sum) - { -/* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + - ( ((q63_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMLALDX for M3 and M0 processors - */ - static __INLINE uint64_t __SMLALDX( - uint32_t x, - uint32_t y, - uint64_t sum) - { -/* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */ - return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + - ( ((q63_t)sum ) ) )); - } - - - /* - * @brief C custom defined SMUAD for M3 and M0 processors - */ - static __INLINE uint32_t __SMUAD( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); - } - - - /* - * @brief C custom defined SMUSD for M3 and M0 processors - */ - static __INLINE uint32_t __SMUSD( - uint32_t x, - uint32_t y) - { - return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) - - ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); - } - - - /* - * @brief C custom defined SXTB16 for M3 and M0 processors - */ - static __INLINE uint32_t __SXTB16( - uint32_t x) - { - return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) | - ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000) )); - } - -#endif /* defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ - - - /** - * @brief Instance structure for the Q7 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q7_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - } arm_fir_instance_q7; - - /** - * @brief Instance structure for the Q15 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - } arm_fir_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - } arm_fir_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of filter coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - } arm_fir_instance_f32; - - - /** - * @brief Processing function for the Q7 FIR filter. - * @param[in] S points to an instance of the Q7 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_q7( - const arm_fir_instance_q7 * S, - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q7 FIR filter. - * @param[in,out] S points to an instance of the Q7 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed. - */ - void arm_fir_init_q7( - arm_fir_instance_q7 * S, - uint16_t numTaps, - q7_t * pCoeffs, - q7_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 FIR filter. - * @param[in] S points to an instance of the Q15 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_q15( - const arm_fir_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_fast_q15( - const arm_fir_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 FIR filter. - * @param[in,out] S points to an instance of the Q15 FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if - * numTaps is not a supported value. - */ - arm_status arm_fir_init_q15( - arm_fir_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 FIR filter. - * @param[in] S points to an instance of the Q31 FIR filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_q31( - const arm_fir_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_fast_q31( - const arm_fir_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR filter. - * @param[in,out] S points to an instance of the Q31 FIR structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ - void arm_fir_init_q31( - arm_fir_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point FIR filter. - * @param[in] S points to an instance of the floating-point FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_f32( - const arm_fir_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point FIR filter. - * @param[in,out] S points to an instance of the floating-point FIR filter structure. - * @param[in] numTaps Number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of samples that are processed at a time. - */ - void arm_fir_init_f32( - arm_fir_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 Biquad cascade filter. - */ - typedef struct - { - int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ - } arm_biquad_casd_df1_inst_q15; - - /** - * @brief Instance structure for the Q31 Biquad cascade filter. - */ - typedef struct - { - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ - } arm_biquad_casd_df1_inst_q31; - - /** - * @brief Instance structure for the floating-point Biquad cascade filter. - */ - typedef struct - { - uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_casd_df1_inst_f32; - - - /** - * @brief Processing function for the Q15 Biquad cascade filter. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_q15( - const arm_biquad_casd_df1_inst_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ - void arm_biquad_cascade_df1_init_q15( - arm_biquad_casd_df1_inst_q15 * S, - uint8_t numStages, - q15_t * pCoeffs, - q15_t * pState, - int8_t postShift); - - - /** - * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_fast_q15( - const arm_biquad_casd_df1_inst_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 Biquad cascade filter - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_q31( - const arm_biquad_casd_df1_inst_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_fast_q31( - const arm_biquad_casd_df1_inst_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 Biquad cascade filter. - * @param[in,out] S points to an instance of the Q31 Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format - */ - void arm_biquad_cascade_df1_init_q31( - arm_biquad_casd_df1_inst_q31 * S, - uint8_t numStages, - q31_t * pCoeffs, - q31_t * pState, - int8_t postShift); - - - /** - * @brief Processing function for the floating-point Biquad cascade filter. - * @param[in] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df1_f32( - const arm_biquad_casd_df1_inst_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point Biquad cascade filter. - * @param[in,out] S points to an instance of the floating-point Biquad cascade structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_df1_init_f32( - arm_biquad_casd_df1_inst_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Instance structure for the floating-point matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float32_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_f32; - - - /** - * @brief Instance structure for the floating-point matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - float64_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_f64; - - /** - * @brief Instance structure for the Q15 matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q15_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_q15; - - /** - * @brief Instance structure for the Q31 matrix structure. - */ - typedef struct - { - uint16_t numRows; /**< number of rows of the matrix. */ - uint16_t numCols; /**< number of columns of the matrix. */ - q31_t *pData; /**< points to the data of the matrix. */ - } arm_matrix_instance_q31; - - - /** - * @brief Floating-point matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_add_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_add_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix addition. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_add_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_cmplx_mult_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_cmplx_mult_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pScratch); - - - /** - * @brief Q31, complex, matrix multiplication. - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_cmplx_mult_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_trans_f32( - const arm_matrix_instance_f32 * pSrc, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_trans_q15( - const arm_matrix_instance_q15 * pSrc, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix transpose. - * @param[in] pSrc points to the input matrix - * @param[out] pDst points to the output matrix - * @return The function returns either ARM_MATH_SIZE_MISMATCH - * or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_trans_q31( - const arm_matrix_instance_q31 * pSrc, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pState); - - - /** - * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @param[in] pState points to the array for storing intermediate results - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_fast_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst, - q15_t * pState); - - - /** - * @brief Q31 matrix multiplication - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_mult_fast_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_sub_f32( - const arm_matrix_instance_f32 * pSrcA, - const arm_matrix_instance_f32 * pSrcB, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_sub_q15( - const arm_matrix_instance_q15 * pSrcA, - const arm_matrix_instance_q15 * pSrcB, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix subtraction - * @param[in] pSrcA points to the first input matrix structure - * @param[in] pSrcB points to the second input matrix structure - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_sub_q31( - const arm_matrix_instance_q31 * pSrcA, - const arm_matrix_instance_q31 * pSrcB, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Floating-point matrix scaling. - * @param[in] pSrc points to the input matrix - * @param[in] scale scale factor - * @param[out] pDst points to the output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_scale_f32( - const arm_matrix_instance_f32 * pSrc, - float32_t scale, - arm_matrix_instance_f32 * pDst); - - - /** - * @brief Q15 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_scale_q15( - const arm_matrix_instance_q15 * pSrc, - q15_t scaleFract, - int32_t shift, - arm_matrix_instance_q15 * pDst); - - - /** - * @brief Q31 matrix scaling. - * @param[in] pSrc points to input matrix - * @param[in] scaleFract fractional portion of the scale factor - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to output matrix structure - * @return The function returns either - * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. - */ - arm_status arm_mat_scale_q31( - const arm_matrix_instance_q31 * pSrc, - q31_t scaleFract, - int32_t shift, - arm_matrix_instance_q31 * pDst); - - - /** - * @brief Q31 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ - void arm_mat_init_q31( - arm_matrix_instance_q31 * S, - uint16_t nRows, - uint16_t nColumns, - q31_t * pData); - - - /** - * @brief Q15 matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ - void arm_mat_init_q15( - arm_matrix_instance_q15 * S, - uint16_t nRows, - uint16_t nColumns, - q15_t * pData); - - - /** - * @brief Floating-point matrix initialization. - * @param[in,out] S points to an instance of the floating-point matrix structure. - * @param[in] nRows number of rows in the matrix. - * @param[in] nColumns number of columns in the matrix. - * @param[in] pData points to the matrix data array. - */ - void arm_mat_init_f32( - arm_matrix_instance_f32 * S, - uint16_t nRows, - uint16_t nColumns, - float32_t * pData); - - - - /** - * @brief Instance structure for the Q15 PID Control. - */ - typedef struct - { - q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ -#ifdef ARM_MATH_CM0_FAMILY - q15_t A1; - q15_t A2; -#else - q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ -#endif - q15_t state[3]; /**< The state array of length 3. */ - q15_t Kp; /**< The proportional gain. */ - q15_t Ki; /**< The integral gain. */ - q15_t Kd; /**< The derivative gain. */ - } arm_pid_instance_q15; - - /** - * @brief Instance structure for the Q31 PID Control. - */ - typedef struct - { - q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - q31_t A2; /**< The derived gain, A2 = Kd . */ - q31_t state[3]; /**< The state array of length 3. */ - q31_t Kp; /**< The proportional gain. */ - q31_t Ki; /**< The integral gain. */ - q31_t Kd; /**< The derivative gain. */ - } arm_pid_instance_q31; - - /** - * @brief Instance structure for the floating-point PID Control. - */ - typedef struct - { - float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ - float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ - float32_t A2; /**< The derived gain, A2 = Kd . */ - float32_t state[3]; /**< The state array of length 3. */ - float32_t Kp; /**< The proportional gain. */ - float32_t Ki; /**< The integral gain. */ - float32_t Kd; /**< The derivative gain. */ - } arm_pid_instance_f32; - - - - /** - * @brief Initialization function for the floating-point PID Control. - * @param[in,out] S points to an instance of the PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ - void arm_pid_init_f32( - arm_pid_instance_f32 * S, - int32_t resetStateFlag); - - - /** - * @brief Reset function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - */ - void arm_pid_reset_f32( - arm_pid_instance_f32 * S); - - - /** - * @brief Initialization function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ - void arm_pid_init_q31( - arm_pid_instance_q31 * S, - int32_t resetStateFlag); - - - /** - * @brief Reset function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - */ - - void arm_pid_reset_q31( - arm_pid_instance_q31 * S); - - - /** - * @brief Initialization function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID structure. - * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. - */ - void arm_pid_init_q15( - arm_pid_instance_q15 * S, - int32_t resetStateFlag); - - - /** - * @brief Reset function for the Q15 PID Control. - * @param[in,out] S points to an instance of the q15 PID Control structure - */ - void arm_pid_reset_q15( - arm_pid_instance_q15 * S); - - - /** - * @brief Instance structure for the floating-point Linear Interpolate function. - */ - typedef struct - { - uint32_t nValues; /**< nValues */ - float32_t x1; /**< x1 */ - float32_t xSpacing; /**< xSpacing */ - float32_t *pYData; /**< pointer to the table of Y values */ - } arm_linear_interp_instance_f32; - - /** - * @brief Instance structure for the floating-point bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - float32_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_f32; - - /** - * @brief Instance structure for the Q31 bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q31_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q31; - - /** - * @brief Instance structure for the Q15 bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q15_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q15; - - /** - * @brief Instance structure for the Q15 bilinear interpolation function. - */ - typedef struct - { - uint16_t numRows; /**< number of rows in the data table. */ - uint16_t numCols; /**< number of columns in the data table. */ - q7_t *pData; /**< points to the data table. */ - } arm_bilinear_interp_instance_q7; - - - /** - * @brief Q7 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Floating-point vector multiplication. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_mult_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix2_instance_q15; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_q15( - arm_cfft_radix2_instance_q15 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_q15( - const arm_cfft_radix2_instance_q15 * S, - q15_t * pSrc); - - - /** - * @brief Instance structure for the Q15 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix4_instance_q15; - -/* Deprecated */ - arm_status arm_cfft_radix4_init_q15( - arm_cfft_radix4_instance_q15 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix4_q15( - const arm_cfft_radix4_instance_q15 * S, - q15_t * pSrc); - - /** - * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix2_instance_q31; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_q31( - arm_cfft_radix2_instance_q31 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_q31( - const arm_cfft_radix2_instance_q31 * S, - q31_t * pSrc); - - /** - * @brief Instance structure for the Q31 CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - } arm_cfft_radix4_instance_q31; - -/* Deprecated */ - void arm_cfft_radix4_q31( - const arm_cfft_radix4_instance_q31 * S, - q31_t * pSrc); - -/* Deprecated */ - arm_status arm_cfft_radix4_init_q31( - arm_cfft_radix4_instance_q31 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ - } arm_cfft_radix2_instance_f32; - -/* Deprecated */ - arm_status arm_cfft_radix2_init_f32( - arm_cfft_radix2_instance_f32 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix2_f32( - const arm_cfft_radix2_instance_f32 * S, - float32_t * pSrc); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ - uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ - float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ - float32_t onebyfftLen; /**< value of 1/fftLen. */ - } arm_cfft_radix4_instance_f32; - -/* Deprecated */ - arm_status arm_cfft_radix4_init_f32( - arm_cfft_radix4_instance_f32 * S, - uint16_t fftLen, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - -/* Deprecated */ - void arm_cfft_radix4_f32( - const arm_cfft_radix4_instance_f32 * S, - float32_t * pSrc); - - /** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_q15; - -void arm_cfft_q15( - const arm_cfft_instance_q15 * S, - q15_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the fixed-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_q31; - -void arm_cfft_q31( - const arm_cfft_instance_q31 * S, - q31_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the floating-point CFFT/CIFFT function. - */ - typedef struct - { - uint16_t fftLen; /**< length of the FFT. */ - const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ - const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ - uint16_t bitRevLength; /**< bit reversal table length. */ - } arm_cfft_instance_f32; - - void arm_cfft_f32( - const arm_cfft_instance_f32 * S, - float32_t * p1, - uint8_t ifftFlag, - uint8_t bitReverseFlag); - - /** - * @brief Instance structure for the Q15 RFFT/RIFFT function. - */ - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_q15; - - arm_status arm_rfft_init_q15( - arm_rfft_instance_q15 * S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_q15( - const arm_rfft_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst); - - /** - * @brief Instance structure for the Q31 RFFT/RIFFT function. - */ - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_q31; - - arm_status arm_rfft_init_q31( - arm_rfft_instance_q31 * S, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_q31( - const arm_rfft_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst); - - /** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ - typedef struct - { - uint32_t fftLenReal; /**< length of the real FFT. */ - uint16_t fftLenBy2; /**< length of the complex FFT. */ - uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ - uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ - uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ - float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ - float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ - } arm_rfft_instance_f32; - - arm_status arm_rfft_init_f32( - arm_rfft_instance_f32 * S, - arm_cfft_radix4_instance_f32 * S_CFFT, - uint32_t fftLenReal, - uint32_t ifftFlagR, - uint32_t bitReverseFlag); - - void arm_rfft_f32( - const arm_rfft_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst); - - /** - * @brief Instance structure for the floating-point RFFT/RIFFT function. - */ -typedef struct - { - arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ - uint16_t fftLenRFFT; /**< length of the real sequence */ - float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */ - } arm_rfft_fast_instance_f32 ; - -arm_status arm_rfft_fast_init_f32 ( - arm_rfft_fast_instance_f32 * S, - uint16_t fftLen); - -void arm_rfft_fast_f32( - arm_rfft_fast_instance_f32 * S, - float32_t * p, float32_t * pOut, - uint8_t ifftFlag); - - /** - * @brief Instance structure for the floating-point DCT4/IDCT4 function. - */ - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - float32_t normalize; /**< normalizing factor. */ - float32_t *pTwiddle; /**< points to the twiddle factor table. */ - float32_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_f32; - - - /** - * @brief Initialization function for the floating-point DCT4/IDCT4. - * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported transform length. - */ - arm_status arm_dct4_init_f32( - arm_dct4_instance_f32 * S, - arm_rfft_instance_f32 * S_RFFT, - arm_cfft_radix4_instance_f32 * S_CFFT, - uint16_t N, - uint16_t Nby2, - float32_t normalize); - - - /** - * @brief Processing function for the floating-point DCT4/IDCT4. - * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ - void arm_dct4_f32( - const arm_dct4_instance_f32 * S, - float32_t * pState, - float32_t * pInlineBuffer); - - - /** - * @brief Instance structure for the Q31 DCT4/IDCT4 function. - */ - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q31_t normalize; /**< normalizing factor. */ - q31_t *pTwiddle; /**< points to the twiddle factor table. */ - q31_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_q31; - - - /** - * @brief Initialization function for the Q31 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure - * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ - arm_status arm_dct4_init_q31( - arm_dct4_instance_q31 * S, - arm_rfft_instance_q31 * S_RFFT, - arm_cfft_radix4_instance_q31 * S_CFFT, - uint16_t N, - uint16_t Nby2, - q31_t normalize); - - - /** - * @brief Processing function for the Q31 DCT4/IDCT4. - * @param[in] S points to an instance of the Q31 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ - void arm_dct4_q31( - const arm_dct4_instance_q31 * S, - q31_t * pState, - q31_t * pInlineBuffer); - - - /** - * @brief Instance structure for the Q15 DCT4/IDCT4 function. - */ - typedef struct - { - uint16_t N; /**< length of the DCT4. */ - uint16_t Nby2; /**< half of the length of the DCT4. */ - q15_t normalize; /**< normalizing factor. */ - q15_t *pTwiddle; /**< points to the twiddle factor table. */ - q15_t *pCosFactor; /**< points to the cosFactor table. */ - arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ - arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ - } arm_dct4_instance_q15; - - - /** - * @brief Initialization function for the Q15 DCT4/IDCT4. - * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure. - * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure. - * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure. - * @param[in] N length of the DCT4. - * @param[in] Nby2 half of the length of the DCT4. - * @param[in] normalize normalizing factor. - * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. - */ - arm_status arm_dct4_init_q15( - arm_dct4_instance_q15 * S, - arm_rfft_instance_q15 * S_RFFT, - arm_cfft_radix4_instance_q15 * S_CFFT, - uint16_t N, - uint16_t Nby2, - q15_t normalize); - - - /** - * @brief Processing function for the Q15 DCT4/IDCT4. - * @param[in] S points to an instance of the Q15 DCT4 structure. - * @param[in] pState points to state buffer. - * @param[in,out] pInlineBuffer points to the in-place input and output buffer. - */ - void arm_dct4_q15( - const arm_dct4_instance_q15 * S, - q15_t * pState, - q15_t * pInlineBuffer); - - - /** - * @brief Floating-point vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q7 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector addition. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_add_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Floating-point vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q7 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_q7( - q7_t * pSrcA, - q7_t * pSrcB, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector subtraction. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in each vector - */ - void arm_sub_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a floating-point vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scale scale factor to be applied - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_f32( - float32_t * pSrc, - float32_t scale, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a Q7 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_q7( - q7_t * pSrc, - q7_t scaleFract, - int8_t shift, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a Q15 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_q15( - q15_t * pSrc, - q15_t scaleFract, - int8_t shift, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Multiplies a Q31 vector by a scalar. - * @param[in] pSrc points to the input vector - * @param[in] scaleFract fractional portion of the scale value - * @param[in] shift number of bits to shift the result by - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_scale_q31( - q31_t * pSrc, - q31_t scaleFract, - int8_t shift, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q7 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Floating-point vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q15 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Q31 vector absolute value. - * @param[in] pSrc points to the input buffer - * @param[out] pDst points to the output buffer - * @param[in] blockSize number of samples in each vector - */ - void arm_abs_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Dot product of floating-point vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_f32( - float32_t * pSrcA, - float32_t * pSrcB, - uint32_t blockSize, - float32_t * result); - - - /** - * @brief Dot product of Q7 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_q7( - q7_t * pSrcA, - q7_t * pSrcB, - uint32_t blockSize, - q31_t * result); - - - /** - * @brief Dot product of Q15 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_q15( - q15_t * pSrcA, - q15_t * pSrcB, - uint32_t blockSize, - q63_t * result); - - - /** - * @brief Dot product of Q31 vectors. - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] blockSize number of samples in each vector - * @param[out] result output result returned here - */ - void arm_dot_prod_q31( - q31_t * pSrcA, - q31_t * pSrcB, - uint32_t blockSize, - q63_t * result); - - - /** - * @brief Shifts the elements of a Q7 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_shift_q7( - q7_t * pSrc, - int8_t shiftBits, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Shifts the elements of a Q15 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_shift_q15( - q15_t * pSrc, - int8_t shiftBits, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Shifts the elements of a Q31 vector a specified number of bits. - * @param[in] pSrc points to the input vector - * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_shift_q31( - q31_t * pSrc, - int8_t shiftBits, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_f32( - float32_t * pSrc, - float32_t offset, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_q7( - q7_t * pSrc, - q7_t offset, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_q15( - q15_t * pSrc, - q15_t offset, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Adds a constant offset to a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[in] offset is the offset to be added - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_offset_q31( - q31_t * pSrc, - q31_t offset, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a floating-point vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a Q7 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a Q15 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Negates the elements of a Q31 vector. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] blockSize number of samples in the vector - */ - void arm_negate_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a floating-point vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a Q7 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_q7( - q7_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Copies the elements of a Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_copy_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a floating-point vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_f32( - float32_t value, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a Q7 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_q7( - q7_t value, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a Q15 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_q15( - q15_t value, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Fills a constant value into a Q31 vector. - * @param[in] value input value to be filled - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_fill_q31( - q31_t value, - q31_t * pDst, - uint32_t blockSize); - - -/** - * @brief Convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen + srcBLen-1. - */ - void arm_conv_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst); - - - /** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen + srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ - void arm_conv_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - -/** - * @brief Convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the location where the output result is written. Length srcALen + srcBLen-1. - */ - void arm_conv_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen + srcBLen-1. - */ - void arm_conv_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen + srcBLen-1. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - */ - void arm_conv_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen + srcBLen-1. - */ - void arm_conv_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen + srcBLen-1. - */ - void arm_conv_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen + srcBLen-1. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - */ - void arm_conv_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length srcALen + srcBLen-1. - */ - void arm_conv_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst); - - - /** - * @brief Partial convolution of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen + srcBLen-2]. - */ - arm_status arm_conv_partial_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen + srcBLen-2]. - */ - arm_status arm_conv_partial_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Partial convolution of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen + srcBLen-2]. - */ - arm_status arm_conv_partial_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen + srcBLen-2]. - */ - arm_status arm_conv_partial_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen + srcBLen-2]. - */ - arm_status arm_conv_partial_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Partial convolution of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen + srcBLen-2]. - */ - arm_status arm_conv_partial_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen + srcBLen-2]. - */ - arm_status arm_conv_partial_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Partial convolution of Q7 sequences - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen + srcBLen-2]. - */ - arm_status arm_conv_partial_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - uint32_t firstIndex, - uint32_t numPoints, - q15_t * pScratch1, - q15_t * pScratch2); - - -/** - * @brief Partial convolution of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data - * @param[in] firstIndex is the first output sample to start with. - * @param[in] numPoints is the number of output points to be computed. - * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen + srcBLen-2]. - */ - arm_status arm_conv_partial_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - uint32_t firstIndex, - uint32_t numPoints); - - - /** - * @brief Instance structure for the Q15 FIR decimator. - */ - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - } arm_fir_decimate_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR decimator. - */ - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - } arm_fir_decimate_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR decimator. - */ - typedef struct - { - uint8_t M; /**< decimation factor. */ - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - } arm_fir_decimate_instance_f32; - - - /** - * @brief Processing function for the floating-point FIR decimator. - * @param[in] S points to an instance of the floating-point FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_f32( - const arm_fir_decimate_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point FIR decimator. - * @param[in,out] S points to an instance of the floating-point FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - arm_status arm_fir_decimate_init_f32( - arm_fir_decimate_instance_f32 * S, - uint16_t numTaps, - uint8_t M, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 FIR decimator. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_q15( - const arm_fir_decimate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q15 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_fast_q15( - const arm_fir_decimate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 FIR decimator. - * @param[in,out] S points to an instance of the Q15 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - arm_status arm_fir_decimate_init_q15( - arm_fir_decimate_instance_q15 * S, - uint16_t numTaps, - uint8_t M, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 FIR decimator. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_q31( - const arm_fir_decimate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - /** - * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. - * @param[in] S points to an instance of the Q31 FIR decimator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_decimate_fast_q31( - arm_fir_decimate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR decimator. - * @param[in,out] S points to an instance of the Q31 FIR decimator structure. - * @param[in] numTaps number of coefficients in the filter. - * @param[in] M decimation factor. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * blockSize is not a multiple of M. - */ - arm_status arm_fir_decimate_init_q31( - arm_fir_decimate_instance_q31 * S, - uint16_t numTaps, - uint8_t M, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 FIR interpolator. - */ - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q15_t *pState; /**< points to the state variable array. The array is of length blockSize + phaseLength-1. */ - } arm_fir_interpolate_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR interpolator. - */ - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - q31_t *pState; /**< points to the state variable array. The array is of length blockSize + phaseLength-1. */ - } arm_fir_interpolate_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR interpolator. - */ - typedef struct - { - uint8_t L; /**< upsample factor. */ - uint16_t phaseLength; /**< length of each polyphase filter component. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ - float32_t *pState; /**< points to the state variable array. The array is of length phaseLength + numTaps-1. */ - } arm_fir_interpolate_instance_f32; - - - /** - * @brief Processing function for the Q15 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_interpolate_q15( - const arm_fir_interpolate_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 FIR interpolator. - * @param[in,out] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - arm_status arm_fir_interpolate_init_q15( - arm_fir_interpolate_instance_q15 * S, - uint8_t L, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 FIR interpolator. - * @param[in] S points to an instance of the Q15 FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_interpolate_q31( - const arm_fir_interpolate_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR interpolator. - * @param[in,out] S points to an instance of the Q31 FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - arm_status arm_fir_interpolate_init_q31( - arm_fir_interpolate_instance_q31 * S, - uint8_t L, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point FIR interpolator. - * @param[in] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_interpolate_f32( - const arm_fir_interpolate_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point FIR interpolator. - * @param[in,out] S points to an instance of the floating-point FIR interpolator structure. - * @param[in] L upsample factor. - * @param[in] numTaps number of filter coefficients in the filter. - * @param[in] pCoeffs points to the filter coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] blockSize number of input samples to process per call. - * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if - * the filter length numTaps is not a multiple of the interpolation factor L. - */ - arm_status arm_fir_interpolate_init_f32( - arm_fir_interpolate_instance_f32 * S, - uint8_t L, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the high precision Q31 Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ - } arm_biquad_cas_df1_32x64_ins_q31; - - - /** - * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cas_df1_32x64_q31( - const arm_biquad_cas_df1_32x64_ins_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format - */ - void arm_biquad_cas_df1_32x64_init_q31( - arm_biquad_cas_df1_32x64_ins_q31 * S, - uint8_t numStages, - q31_t * pCoeffs, - q63_t * pState, - uint8_t postShift); - - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_df2T_instance_f32; - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ - float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_stereo_df2T_instance_f32; - - /** - * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. - */ - typedef struct - { - uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ - float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ - float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ - } arm_biquad_cascade_df2T_instance_f64; - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df2T_f32( - const arm_biquad_cascade_df2T_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_stereo_df2T_f32( - const arm_biquad_cascade_stereo_df2T_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in] S points to an instance of the filter data structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_biquad_cascade_df2T_f64( - const arm_biquad_cascade_df2T_instance_f64 * S, - float64_t * pSrc, - float64_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_df2T_init_f32( - arm_biquad_cascade_df2T_instance_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_stereo_df2T_init_f32( - arm_biquad_cascade_stereo_df2T_instance_f32 * S, - uint8_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. - * @param[in,out] S points to an instance of the filter data structure. - * @param[in] numStages number of 2nd order stages in the filter. - * @param[in] pCoeffs points to the filter coefficients. - * @param[in] pState points to the state buffer. - */ - void arm_biquad_cascade_df2T_init_f64( - arm_biquad_cascade_df2T_instance_f64 * S, - uint8_t numStages, - float64_t * pCoeffs, - float64_t * pState); - - - /** - * @brief Instance structure for the Q15 FIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_q15; - - /** - * @brief Instance structure for the Q31 FIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_q31; - - /** - * @brief Instance structure for the floating-point FIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of filter stages. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ - } arm_fir_lattice_instance_f32; - - - /** - * @brief Initialization function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ - void arm_fir_lattice_init_q15( - arm_fir_lattice_instance_q15 * S, - uint16_t numStages, - q15_t * pCoeffs, - q15_t * pState); - - - /** - * @brief Processing function for the Q15 FIR lattice filter. - * @param[in] S points to an instance of the Q15 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_fir_lattice_q15( - const arm_fir_lattice_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ - void arm_fir_lattice_init_q31( - arm_fir_lattice_instance_q31 * S, - uint16_t numStages, - q31_t * pCoeffs, - q31_t * pState); - - - /** - * @brief Processing function for the Q31 FIR lattice filter. - * @param[in] S points to an instance of the Q31 FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_fir_lattice_q31( - const arm_fir_lattice_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] numStages number of filter stages. - * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. - * @param[in] pState points to the state buffer. The array is of length numStages. - */ - void arm_fir_lattice_init_f32( - arm_fir_lattice_instance_f32 * S, - uint16_t numStages, - float32_t * pCoeffs, - float32_t * pState); - - - /** - * @brief Processing function for the floating-point FIR lattice filter. - * @param[in] S points to an instance of the floating-point FIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] blockSize number of samples to process. - */ - void arm_fir_lattice_f32( - const arm_fir_lattice_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numStages + blockSize. */ - q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages + 1. */ - } arm_iir_lattice_instance_q15; - - /** - * @brief Instance structure for the Q31 IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numStages + blockSize. */ - q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages + 1. */ - } arm_iir_lattice_instance_q31; - - /** - * @brief Instance structure for the floating-point IIR lattice filter. - */ - typedef struct - { - uint16_t numStages; /**< number of stages in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numStages + blockSize. */ - float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ - float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages + 1. */ - } arm_iir_lattice_instance_f32; - - - /** - * @brief Processing function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_f32( - const arm_iir_lattice_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point IIR lattice filter. - * @param[in] S points to an instance of the floating-point IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages + 1. - * @param[in] pState points to the state buffer. The array is of length numStages + blockSize-1. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_init_f32( - arm_iir_lattice_instance_f32 * S, - uint16_t numStages, - float32_t * pkCoeffs, - float32_t * pvCoeffs, - float32_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_q31( - const arm_iir_lattice_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 IIR lattice filter. - * @param[in] S points to an instance of the Q31 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages + 1. - * @param[in] pState points to the state buffer. The array is of length numStages + blockSize. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_init_q31( - arm_iir_lattice_instance_q31 * S, - uint16_t numStages, - q31_t * pkCoeffs, - q31_t * pvCoeffs, - q31_t * pState, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the Q15 IIR lattice structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data. - * @param[in] blockSize number of samples to process. - */ - void arm_iir_lattice_q15( - const arm_iir_lattice_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - -/** - * @brief Initialization function for the Q15 IIR lattice filter. - * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure. - * @param[in] numStages number of stages in the filter. - * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages. - * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages + 1. - * @param[in] pState points to state buffer. The array is of length numStages + blockSize. - * @param[in] blockSize number of samples to process per call. - */ - void arm_iir_lattice_init_q15( - arm_iir_lattice_instance_q15 * S, - uint16_t numStages, - q15_t * pkCoeffs, - q15_t * pvCoeffs, - q15_t * pState, - uint32_t blockSize); - - - /** - * @brief Instance structure for the floating-point LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that controls filter coefficient updates. */ - } arm_lms_instance_f32; - - - /** - * @brief Processing function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_f32( - const arm_lms_instance_f32 * S, - float32_t * pSrc, - float32_t * pRef, - float32_t * pOut, - float32_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for floating-point LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_init_f32( - arm_lms_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - float32_t mu, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q15 LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ - } arm_lms_instance_q15; - - - /** - * @brief Initialization function for the Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to the coefficient buffer. - * @param[in] pState points to the state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_init_q15( - arm_lms_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - q15_t mu, - uint32_t blockSize, - uint32_t postShift); - - - /** - * @brief Processing function for Q15 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_q15( - const arm_lms_instance_q15 * S, - q15_t * pSrc, - q15_t * pRef, - q15_t * pOut, - q15_t * pErr, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q31 LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint32_t postShift; /**< bit shift applied to coefficients. */ - } arm_lms_instance_q31; - - - /** - * @brief Processing function for Q31 LMS filter. - * @param[in] S points to an instance of the Q15 LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_q31( - const arm_lms_instance_q31 * S, - q31_t * pSrc, - q31_t * pRef, - q31_t * pOut, - q31_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for Q31 LMS filter. - * @param[in] S points to an instance of the Q31 LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_init_q31( - arm_lms_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - q31_t mu, - uint32_t blockSize, - uint32_t postShift); - - - /** - * @brief Instance structure for the floating-point normalized LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - float32_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - float32_t mu; /**< step size that control filter coefficient updates. */ - float32_t energy; /**< saves previous frame energy. */ - float32_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_f32; - - - /** - * @brief Processing function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_f32( - arm_lms_norm_instance_f32 * S, - float32_t * pSrc, - float32_t * pRef, - float32_t * pOut, - float32_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for floating-point normalized LMS filter. - * @param[in] S points to an instance of the floating-point LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_init_f32( - arm_lms_norm_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - float32_t mu, - uint32_t blockSize); - - - /** - * @brief Instance structure for the Q31 normalized LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - q31_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q31_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q31_t *recipTable; /**< points to the reciprocal initial value table. */ - q31_t energy; /**< saves previous frame energy. */ - q31_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_q31; - - - /** - * @brief Processing function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_q31( - arm_lms_norm_instance_q31 * S, - q31_t * pSrc, - q31_t * pRef, - q31_t * pOut, - q31_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for Q31 normalized LMS filter. - * @param[in] S points to an instance of the Q31 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_norm_init_q31( - arm_lms_norm_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - q31_t mu, - uint32_t blockSize, - uint8_t postShift); - - - /** - * @brief Instance structure for the Q15 normalized LMS filter. - */ - typedef struct - { - uint16_t numTaps; /**< Number of coefficients in the filter. */ - q15_t *pState; /**< points to the state variable array. The array is of length numTaps + blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ - q15_t mu; /**< step size that controls filter coefficient updates. */ - uint8_t postShift; /**< bit shift applied to coefficients. */ - q15_t *recipTable; /**< Points to the reciprocal initial value table. */ - q15_t energy; /**< saves previous frame energy. */ - q15_t x0; /**< saves previous input sample. */ - } arm_lms_norm_instance_q15; - - - /** - * @brief Processing function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] pSrc points to the block of input data. - * @param[in] pRef points to the block of reference data. - * @param[out] pOut points to the block of output data. - * @param[out] pErr points to the block of error data. - * @param[in] blockSize number of samples to process. - */ - void arm_lms_norm_q15( - arm_lms_norm_instance_q15 * S, - q15_t * pSrc, - q15_t * pRef, - q15_t * pOut, - q15_t * pErr, - uint32_t blockSize); - - - /** - * @brief Initialization function for Q15 normalized LMS filter. - * @param[in] S points to an instance of the Q15 normalized LMS filter structure. - * @param[in] numTaps number of filter coefficients. - * @param[in] pCoeffs points to coefficient buffer. - * @param[in] pState points to state buffer. - * @param[in] mu step size that controls filter coefficient updates. - * @param[in] blockSize number of samples to process. - * @param[in] postShift bit shift applied to coefficients. - */ - void arm_lms_norm_init_q15( - arm_lms_norm_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - q15_t mu, - uint32_t blockSize, - uint8_t postShift); - - - /** - * @brief Correlation of floating-point sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_f32( - float32_t * pSrcA, - uint32_t srcALen, - float32_t * pSrcB, - uint32_t srcBLen, - float32_t * pDst); - - - /** - * @brief Correlation of Q15 sequences - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - */ - void arm_correlate_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch); - - - /** - * @brief Correlation of Q15 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - - void arm_correlate_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - - void arm_correlate_fast_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst); - - - /** - * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - */ - void arm_correlate_fast_opt_q15( - q15_t * pSrcA, - uint32_t srcALen, - q15_t * pSrcB, - uint32_t srcBLen, - q15_t * pDst, - q15_t * pScratch); - - - /** - * @brief Correlation of Q31 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_fast_q31( - q31_t * pSrcA, - uint32_t srcALen, - q31_t * pSrcB, - uint32_t srcBLen, - q31_t * pDst); - - - /** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. - * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). - */ - void arm_correlate_opt_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst, - q15_t * pScratch1, - q15_t * pScratch2); - - - /** - * @brief Correlation of Q7 sequences. - * @param[in] pSrcA points to the first input sequence. - * @param[in] srcALen length of the first input sequence. - * @param[in] pSrcB points to the second input sequence. - * @param[in] srcBLen length of the second input sequence. - * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. - */ - void arm_correlate_q7( - q7_t * pSrcA, - uint32_t srcALen, - q7_t * pSrcB, - uint32_t srcBLen, - q7_t * pDst); - - - /** - * @brief Instance structure for the floating-point sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay + blockSize-1. */ - float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_f32; - - /** - * @brief Instance structure for the Q31 sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay + blockSize-1. */ - q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q31; - - /** - * @brief Instance structure for the Q15 sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay + blockSize-1. */ - q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q15; - - /** - * @brief Instance structure for the Q7 sparse FIR filter. - */ - typedef struct - { - uint16_t numTaps; /**< number of coefficients in the filter. */ - uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ - q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay + blockSize-1. */ - q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ - uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ - int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ - } arm_fir_sparse_instance_q7; - - - /** - * @brief Processing function for the floating-point sparse FIR filter. - * @param[in] S points to an instance of the floating-point sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_f32( - arm_fir_sparse_instance_f32 * S, - float32_t * pSrc, - float32_t * pDst, - float32_t * pScratchIn, - uint32_t blockSize); - - - /** - * @brief Initialization function for the floating-point sparse FIR filter. - * @param[in,out] S points to an instance of the floating-point sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_f32( - arm_fir_sparse_instance_f32 * S, - uint16_t numTaps, - float32_t * pCoeffs, - float32_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q31 sparse FIR filter. - * @param[in] S points to an instance of the Q31 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_q31( - arm_fir_sparse_instance_q31 * S, - q31_t * pSrc, - q31_t * pDst, - q31_t * pScratchIn, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q31 sparse FIR filter. - * @param[in,out] S points to an instance of the Q31 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_q31( - arm_fir_sparse_instance_q31 * S, - uint16_t numTaps, - q31_t * pCoeffs, - q31_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q15 sparse FIR filter. - * @param[in] S points to an instance of the Q15 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_q15( - arm_fir_sparse_instance_q15 * S, - q15_t * pSrc, - q15_t * pDst, - q15_t * pScratchIn, - q31_t * pScratchOut, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q15 sparse FIR filter. - * @param[in,out] S points to an instance of the Q15 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_q15( - arm_fir_sparse_instance_q15 * S, - uint16_t numTaps, - q15_t * pCoeffs, - q15_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Processing function for the Q7 sparse FIR filter. - * @param[in] S points to an instance of the Q7 sparse FIR structure. - * @param[in] pSrc points to the block of input data. - * @param[out] pDst points to the block of output data - * @param[in] pScratchIn points to a temporary buffer of size blockSize. - * @param[in] pScratchOut points to a temporary buffer of size blockSize. - * @param[in] blockSize number of input samples to process per call. - */ - void arm_fir_sparse_q7( - arm_fir_sparse_instance_q7 * S, - q7_t * pSrc, - q7_t * pDst, - q7_t * pScratchIn, - q31_t * pScratchOut, - uint32_t blockSize); - - - /** - * @brief Initialization function for the Q7 sparse FIR filter. - * @param[in,out] S points to an instance of the Q7 sparse FIR structure. - * @param[in] numTaps number of nonzero coefficients in the filter. - * @param[in] pCoeffs points to the array of filter coefficients. - * @param[in] pState points to the state buffer. - * @param[in] pTapDelay points to the array of offset times. - * @param[in] maxDelay maximum offset time supported. - * @param[in] blockSize number of samples that will be processed per block. - */ - void arm_fir_sparse_init_q7( - arm_fir_sparse_instance_q7 * S, - uint16_t numTaps, - q7_t * pCoeffs, - q7_t * pState, - int32_t * pTapDelay, - uint16_t maxDelay, - uint32_t blockSize); - - - /** - * @brief Floating-point sin_cos function. - * @param[in] theta input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cos output. - */ - void arm_sin_cos_f32( - float32_t theta, - float32_t * pSinVal, - float32_t * pCosVal); - - - /** - * @brief Q31 sin_cos function. - * @param[in] theta scaled input value in degrees - * @param[out] pSinVal points to the processed sine output. - * @param[out] pCosVal points to the processed cosine output. - */ - void arm_sin_cos_q31( - q31_t theta, - q31_t * pSinVal, - q31_t * pCosVal); - - - /** - * @brief Floating-point complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_conj_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - /** - * @brief Q31 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_conj_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex conjugate. - * @param[in] pSrc points to the input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_conj_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @brief Floating-point complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_squared_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_squared_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex magnitude squared - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_squared_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @ingroup groupController - */ - - /** - * @defgroup PID PID Motor Control - * - * A Proportional Integral Derivative (PID) controller is a generic feedback control - * loop mechanism widely used in industrial control systems. - * A PID controller is the most commonly used type of feedback controller. - * - * This set of functions implements (PID) controllers - * for Q15, Q31, and floating-point data types. The functions operate on a single sample - * of data and each call to the function returns a single processed value. - * S points to an instance of the PID control data structure. in - * is the input sample value. The functions return the output value. - * - * \par Algorithm: - *
-   *    y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
-   *    A0 = Kp + Ki + Kd
-   *    A1 = (-Kp ) - (2 * Kd )
-   *    A2 = Kd  
- * - * \par - * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant - * - * \par - * \image html PID.gif "Proportional Integral Derivative Controller" - * - * \par - * The PID controller calculates an "error" value as the difference between - * the measured output and the reference input. - * The controller attempts to minimize the error by adjusting the process control inputs. - * The proportional value determines the reaction to the current error, - * the integral value determines the reaction based on the sum of recent errors, - * and the derivative value determines the reaction based on the rate at which the error has been changing. - * - * \par Instance Structure - * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. - * A separate instance structure must be defined for each PID Controller. - * There are separate instance structure declarations for each of the 3 supported data types. - * - * \par Reset Functions - * There is also an associated reset function for each data type which clears the state array. - * - * \par Initialization Functions - * There is also an associated initialization function for each data type. - * The initialization function performs the following operations: - * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. - * - Zeros out the values in the state buffer. - * - * \par - * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. - * - * \par Fixed-Point Behavior - * Care must be taken when using the fixed-point versions of the PID Controller functions. - * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup PID - * @{ - */ - - /** - * @brief Process function for the floating-point PID Control. - * @param[in,out] S is an instance of the floating-point PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - */ - static __INLINE float32_t arm_pid_f32( - arm_pid_instance_f32 * S, - float32_t in) - { - float32_t out; - - /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ - out = (S->A0 * in) + - (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - - } - - /** - * @brief Process function for the Q31 PID Control. - * @param[in,out] S points to an instance of the Q31 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 64-bit accumulator. - * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. - * Thus, if the accumulator result overflows it wraps around rather than clip. - * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. - * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. - */ - static __INLINE q31_t arm_pid_q31( - arm_pid_instance_q31 * S, - q31_t in) - { - q63_t acc; - q31_t out; - - /* acc = A0 * x[n] */ - acc = (q63_t) S->A0 * in; - - /* acc += A1 * x[n-1] */ - acc += (q63_t) S->A1 * S->state[0]; - - /* acc += A2 * x[n-2] */ - acc += (q63_t) S->A2 * S->state[1]; - - /* convert output to 1.31 format to add y[n-1] */ - out = (q31_t) (acc >> 31u); - - /* out += y[n-1] */ - out += S->state[2]; - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - } - - - /** - * @brief Process function for the Q15 PID Control. - * @param[in,out] S points to an instance of the Q15 PID Control structure - * @param[in] in input sample to process - * @return out processed output sample. - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using a 64-bit internal accumulator. - * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. - * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. - * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. - * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. - * Lastly, the accumulator is saturated to yield a result in 1.15 format. - */ - static __INLINE q15_t arm_pid_q15( - arm_pid_instance_q15 * S, - q15_t in) - { - q63_t acc; - q15_t out; - -#ifndef ARM_MATH_CM0_FAMILY - __SIMD32_TYPE *vstate; - - /* Implementation of PID controller */ - - /* acc = A0 * x[n] */ - acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in); - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - vstate = __SIMD32_CONST(S->state); - acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc); -#else - /* acc = A0 * x[n] */ - acc = ((q31_t) S->A0) * in; - - /* acc += A1 * x[n-1] + A2 * x[n-2] */ - acc += (q31_t) S->A1 * S->state[0]; - acc += (q31_t) S->A2 * S->state[1]; -#endif - - /* acc += y[n-1] */ - acc += (q31_t) S->state[2] << 15; - - /* saturate the output */ - out = (q15_t) (__SSAT((acc >> 15), 16)); - - /* Update state */ - S->state[1] = S->state[0]; - S->state[0] = in; - S->state[2] = out; - - /* return to application */ - return (out); - } - - /** - * @} end of PID group - */ - - - /** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ - arm_status arm_mat_inverse_f32( - const arm_matrix_instance_f32 * src, - arm_matrix_instance_f32 * dst); - - - /** - * @brief Floating-point matrix inverse. - * @param[in] src points to the instance of the input floating-point matrix structure. - * @param[out] dst points to the instance of the output floating-point matrix structure. - * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. - * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. - */ - arm_status arm_mat_inverse_f64( - const arm_matrix_instance_f64 * src, - arm_matrix_instance_f64 * dst); - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup clarke Vector Clarke Transform - * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. - * Generally the Clarke transform uses three-phase currents Ia, Ib and Ic to calculate currents - * in the two-phase orthogonal stator axis Ialpha and Ibeta. - * When Ialpha is superposed with Ia as shown in the figure below - * \image html clarke.gif Stator current space vector and its components in (a,b). - * and Ia + Ib + Ic = 0, in this condition Ialpha and Ibeta - * can be calculated using only Ia and Ib. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeFormula.gif - * where Ia and Ib are the instantaneous stator phases and - * pIalpha and pIbeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup clarke - * @{ - */ - - /** - * - * @brief Floating-point Clarke transform - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - */ - static __INLINE void arm_clarke_f32( - float32_t Ia, - float32_t Ib, - float32_t * pIalpha, - float32_t * pIbeta) - { - /* Calculate pIalpha using the equation, pIalpha = Ia */ - *pIalpha = Ia; - - /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ - *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); - } - - - /** - * @brief Clarke transform for Q31 version - * @param[in] Ia input three-phase coordinate a - * @param[in] Ib input three-phase coordinate b - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ - static __INLINE void arm_clarke_q31( - q31_t Ia, - q31_t Ib, - q31_t * pIalpha, - q31_t * pIbeta) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIalpha from Ia by equation pIalpha = Ia */ - *pIalpha = Ia; - - /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ - product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30); - - /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ - product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30); - - /* pIbeta is calculated by adding the intermediate products */ - *pIbeta = __QADD(product1, product2); - } - - /** - * @} end of clarke group - */ - - /** - * @brief Converts the elements of the Q7 vector to Q31 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_q7_to_q31( - q7_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup inv_clarke Vector Inverse Clarke Transform - * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html clarkeInvFormula.gif - * where pIa and pIb are the instantaneous stator phases and - * Ialpha and Ibeta are the two coordinates of time invariant vector. - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Clarke transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup inv_clarke - * @{ - */ - - /** - * @brief Floating-point Inverse Clarke transform - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] pIa points to output three-phase coordinate a - * @param[out] pIb points to output three-phase coordinate b - */ - static __INLINE void arm_inv_clarke_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t * pIa, - float32_t * pIb) - { - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ - *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta; - } - - - /** - * @brief Inverse Clarke transform for Q31 version - * @param[in] Ialpha input two-phase orthogonal vector axis alpha - * @param[in] Ibeta input two-phase orthogonal vector axis beta - * @param[out] pIa points to output three-phase coordinate a - * @param[out] pIb points to output three-phase coordinate b - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the subtraction, hence there is no risk of overflow. - */ - static __INLINE void arm_inv_clarke_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t * pIa, - q31_t * pIb) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - - /* Calculating pIa from Ialpha by equation pIa = Ialpha */ - *pIa = Ialpha; - - /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ - product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31); - - /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ - product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31); - - /* pIb is calculated by subtracting the products */ - *pIb = __QSUB(product2, product1); - } - - /** - * @} end of inv_clarke group - */ - - /** - * @brief Converts the elements of the Q7 vector to Q15 vector. - * @param[in] pSrc input pointer - * @param[out] pDst output pointer - * @param[in] blockSize number of samples to process - */ - void arm_q7_to_q15( - q7_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - - /** - * @ingroup groupController - */ - - /** - * @defgroup park Vector Park Transform - * - * Forward Park transform converts the input two-coordinate vector to flux and torque components. - * The Park transform can be used to realize the transformation of the Ialpha and the Ibeta currents - * from the stationary to the moving reference frame and control the spatial relationship between - * the stator vector current and rotor flux vector. - * If we consider the d axis aligned with the rotor flux, the diagram below shows the - * current vector and the relationship from the two reference frames: - * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkFormula.gif - * where Ialpha and Ibeta are the stator vector components, - * pId and pIq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup park - * @{ - */ - - /** - * @brief Floating-point Park transform - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * The function implements the forward Park transform. - * - */ - static __INLINE void arm_park_f32( - float32_t Ialpha, - float32_t Ibeta, - float32_t * pId, - float32_t * pIq, - float32_t sinVal, - float32_t cosVal) - { - /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ - *pId = Ialpha * cosVal + Ibeta * sinVal; - - /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ - *pIq = -Ialpha * sinVal + Ibeta * cosVal; - } - - - /** - * @brief Park transform for Q31 version - * @param[in] Ialpha input two-phase vector coordinate alpha - * @param[in] Ibeta input two-phase vector coordinate beta - * @param[out] pId points to output rotor reference frame d - * @param[out] pIq points to output rotor reference frame q - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition and subtraction, hence there is no risk of overflow. - */ - static __INLINE void arm_park_q31( - q31_t Ialpha, - q31_t Ibeta, - q31_t * pId, - q31_t * pIq, - q31_t sinVal, - q31_t cosVal) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Ialpha * cosVal) */ - product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * sinVal) */ - product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Ialpha * sinVal) */ - product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Ibeta * cosVal) */ - product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31); - - /* Calculate pId by adding the two intermediate products 1 and 2 */ - *pId = __QADD(product1, product2); - - /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ - *pIq = __QSUB(product4, product3); - } - - /** - * @} end of park group - */ - - /** - * @brief Converts the elements of the Q7 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q7_to_float( - q7_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @ingroup groupController - */ - - /** - * @defgroup inv_park Vector Inverse Park transform - * Inverse Park transform converts the input flux and torque components to two-coordinate vector. - * - * The function operates on a single sample of data and each call to the function returns the processed output. - * The library provides separate functions for Q31 and floating-point data types. - * \par Algorithm - * \image html parkInvFormula.gif - * where pIalpha and pIbeta are the stator vector components, - * Id and Iq are rotor vector components and cosVal and sinVal are the - * cosine and sine values of theta (rotor flux position). - * \par Fixed-Point Behavior - * Care must be taken when using the Q31 version of the Park transform. - * In particular, the overflow and saturation behavior of the accumulator used must be considered. - * Refer to the function specific documentation below for usage guidelines. - */ - - /** - * @addtogroup inv_park - * @{ - */ - - /** - * @brief Floating-point Inverse Park transform - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - */ - static __INLINE void arm_inv_park_f32( - float32_t Id, - float32_t Iq, - float32_t * pIalpha, - float32_t * pIbeta, - float32_t sinVal, - float32_t cosVal) - { - /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ - *pIalpha = Id * cosVal - Iq * sinVal; - - /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ - *pIbeta = Id * sinVal + Iq * cosVal; - } - - - /** - * @brief Inverse Park transform for Q31 version - * @param[in] Id input coordinate of rotor reference frame d - * @param[in] Iq input coordinate of rotor reference frame q - * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha - * @param[out] pIbeta points to output two-phase orthogonal vector axis beta - * @param[in] sinVal sine value of rotation angle theta - * @param[in] cosVal cosine value of rotation angle theta - * - * Scaling and Overflow Behavior: - * \par - * The function is implemented using an internal 32-bit accumulator. - * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. - * There is saturation on the addition, hence there is no risk of overflow. - */ - static __INLINE void arm_inv_park_q31( - q31_t Id, - q31_t Iq, - q31_t * pIalpha, - q31_t * pIbeta, - q31_t sinVal, - q31_t cosVal) - { - q31_t product1, product2; /* Temporary variables used to store intermediate results */ - q31_t product3, product4; /* Temporary variables used to store intermediate results */ - - /* Intermediate product is calculated by (Id * cosVal) */ - product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31); - - /* Intermediate product is calculated by (Iq * sinVal) */ - product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31); - - - /* Intermediate product is calculated by (Id * sinVal) */ - product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31); - - /* Intermediate product is calculated by (Iq * cosVal) */ - product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31); - - /* Calculate pIalpha by using the two intermediate products 1 and 2 */ - *pIalpha = __QSUB(product1, product2); - - /* Calculate pIbeta by using the two intermediate products 3 and 4 */ - *pIbeta = __QADD(product4, product3); - } - - /** - * @} end of Inverse park group - */ - - - /** - * @brief Converts the elements of the Q31 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q31_to_float( - q31_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - /** - * @ingroup groupInterpolation - */ - - /** - * @defgroup LinearInterpolate Linear Interpolation - * - * Linear interpolation is a method of curve fitting using linear polynomials. - * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line - * - * \par - * \image html LinearInterp.gif "Linear interpolation" - * - * \par - * A Linear Interpolate function calculates an output value(y), for the input(x) - * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) - * - * \par Algorithm: - *
-   *       y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
-   *       where x0, x1 are nearest values of input x
-   *             y0, y1 are nearest values to output y
-   * 
- * - * \par - * This set of functions implements Linear interpolation process - * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single - * sample of data and each call to the function returns a single processed value. - * S points to an instance of the Linear Interpolate function data structure. - * x is the input sample value. The functions returns the output value. - * - * \par - * if x is outside of the table boundary, Linear interpolation returns first value of the table - * if x is below input range and returns last value of table if x is above range. - */ - - /** - * @addtogroup LinearInterpolate - * @{ - */ - - /** - * @brief Process function for the floating-point Linear Interpolation Function. - * @param[in,out] S is an instance of the floating-point Linear Interpolation structure - * @param[in] x input sample to process - * @return y processed output sample. - * - */ - static __INLINE float32_t arm_linear_interp_f32( - arm_linear_interp_instance_f32 * S, - float32_t x) - { - float32_t y; - float32_t x0, x1; /* Nearest input values */ - float32_t y0, y1; /* Nearest output values */ - float32_t xSpacing = S->xSpacing; /* spacing between input values */ - int32_t i; /* Index variable */ - float32_t *pYData = S->pYData; /* pointer to output table */ - - /* Calculation of index */ - i = (int32_t) ((x - S->x1) / xSpacing); - - if (i < 0) - { - /* Iniatilize output for below specified range as least output value of table */ - y = pYData[0]; - } - else if ((uint32_t)i >= S->nValues) - { - /* Iniatilize output for above specified range as last output value of table */ - y = pYData[S->nValues - 1]; - } - else - { - /* Calculation of nearest input values */ - x0 = S->x1 + i * xSpacing; - x1 = S->x1 + (i + 1) * xSpacing; - - /* Read of nearest output values */ - y0 = pYData[i]; - y1 = pYData[i + 1]; - - /* Calculation of output */ - y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); - - } - - /* returns output value */ - return (y); - } - - - /** - * - * @brief Process function for the Q31 Linear Interpolation Function. - * @param[in] pYData pointer to Q31 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ - static __INLINE q31_t arm_linear_interp_q31( - q31_t * pYData, - q31_t x, - uint32_t nValues) - { - q31_t y; /* output */ - q31_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (q31_t)0xFFF00000) >> 20); - - if (index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if (index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* shift left by 11 to keep fract in 1.31 format */ - fract = (x & 0x000FFFFF) << 11; - - /* Read two nearest output values from the index in 1.31(q31) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 2.30 format */ - y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); - - /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ - y += ((q31_t) (((q63_t) y1 * fract) >> 32)); - - /* Convert y to 1.31 format */ - return (y << 1u); - } - } - - - /** - * - * @brief Process function for the Q15 Linear Interpolation Function. - * @param[in] pYData pointer to Q15 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - * - */ - static __INLINE q15_t arm_linear_interp_q15( - q15_t * pYData, - q31_t x, - uint32_t nValues) - { - q63_t y; /* output */ - q15_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - int32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - index = ((x & (int32_t)0xFFF00000) >> 20); - - if (index >= (int32_t)(nValues - 1)) - { - return (pYData[nValues - 1]); - } - else if (index < 0) - { - return (pYData[0]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract) and y is in 13.35 format */ - y = ((q63_t) y0 * (0xFFFFF - fract)); - - /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ - y += ((q63_t) y1 * (fract)); - - /* convert y to 1.15 format */ - return (q15_t) (y >> 20); - } - } - - - /** - * - * @brief Process function for the Q7 Linear Interpolation Function. - * @param[in] pYData pointer to Q7 Linear Interpolation table - * @param[in] x input sample to process - * @param[in] nValues number of table values - * @return y processed output sample. - * - * \par - * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. - * This function can support maximum of table size 2^12. - */ - static __INLINE q7_t arm_linear_interp_q7( - q7_t * pYData, - q31_t x, - uint32_t nValues) - { - q31_t y; /* output */ - q7_t y0, y1; /* Nearest output values */ - q31_t fract; /* fractional part */ - uint32_t index; /* Index to read nearest output values */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - if (x < 0) - { - return (pYData[0]); - } - index = (x >> 20) & 0xfff; - - if (index >= (nValues - 1)) - { - return (pYData[nValues - 1]); - } - else - { - /* 20 bits for the fractional part */ - /* fract is in 12.20 format */ - fract = (x & 0x000FFFFF); - - /* Read two nearest output values from the index and are in 1.7(q7) format */ - y0 = pYData[index]; - y1 = pYData[index + 1]; - - /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ - y = ((y0 * (0xFFFFF - fract))); - - /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ - y += (y1 * fract); - - /* convert y to 1.7(q7) format */ - return (q7_t) (y >> 20); - } - } - - /** - * @} end of LinearInterpolate group - */ - - /** - * @brief Fast approximation to the trigonometric sine function for floating-point data. - * @param[in] x input value in radians. - * @return sin(x). - */ - float32_t arm_sin_f32( - float32_t x); - - - /** - * @brief Fast approximation to the trigonometric sine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ - q31_t arm_sin_q31( - q31_t x); - - - /** - * @brief Fast approximation to the trigonometric sine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return sin(x). - */ - q15_t arm_sin_q15( - q15_t x); - - - /** - * @brief Fast approximation to the trigonometric cosine function for floating-point data. - * @param[in] x input value in radians. - * @return cos(x). - */ - float32_t arm_cos_f32( - float32_t x); - - - /** - * @brief Fast approximation to the trigonometric cosine function for Q31 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ - q31_t arm_cos_q31( - q31_t x); - - - /** - * @brief Fast approximation to the trigonometric cosine function for Q15 data. - * @param[in] x Scaled input value in radians. - * @return cos(x). - */ - q15_t arm_cos_q15( - q15_t x); - - - /** - * @ingroup groupFastMath - */ - - - /** - * @defgroup SQRT Square Root - * - * Computes the square root of a number. - * There are separate functions for Q15, Q31, and floating-point data types. - * The square root function is computed using the Newton-Raphson algorithm. - * This is an iterative algorithm of the form: - *
-   *      x1 = x0 - f(x0)/f'(x0)
-   * 
- * where x1 is the current estimate, - * x0 is the previous estimate, and - * f'(x0) is the derivative of f() evaluated at x0. - * For the square root function, the algorithm reduces to: - *
-   *     x0 = in/2                         [initial guess]
-   *     x1 = 1/2 * ( x0 + in / x0)        [each iteration]
-   * 
- */ - - - /** - * @addtogroup SQRT - * @{ - */ - - /** - * @brief Floating-point square root function. - * @param[in] in input value. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - static __INLINE arm_status arm_sqrt_f32( - float32_t in, - float32_t * pOut) - { - if (in >= 0.0f) - { - -#if (__FPU_USED == 1) && defined ( __CC_ARM ) - *pOut = __sqrtf(in); -#elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined(__GNUC__) - *pOut = __builtin_sqrtf(in); -#elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000) - __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in)); -#else - *pOut = sqrtf(in); -#endif - - return (ARM_MATH_SUCCESS); - } - else - { - *pOut = 0.0f; - return (ARM_MATH_ARGUMENT_ERROR); - } - } - - - /** - * @brief Q31 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - arm_status arm_sqrt_q31( - q31_t in, - q31_t * pOut); - - - /** - * @brief Q15 square root function. - * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. - * @param[out] pOut square root of input value. - * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if - * in is negative value and returns zero output for negative values. - */ - arm_status arm_sqrt_q15( - q15_t in, - q15_t * pOut); - - /** - * @} end of SQRT group - */ - - - /** - * @brief floating-point Circular write function. - */ - static __INLINE void arm_circularWrite_f32( - int32_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const int32_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; - } - - - - /** - * @brief floating-point Circular Read function. - */ - static __INLINE void arm_circularRead_f32( - int32_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - int32_t * dst, - int32_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (int32_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Q15 Circular write function. - */ - static __INLINE void arm_circularWrite_q15( - q15_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const q15_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; - } - - - /** - * @brief Q15 Circular Read function. - */ - static __INLINE void arm_circularRead_q15( - q15_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - q15_t * dst, - q15_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (q15_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update wOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Q7 Circular write function. - */ - static __INLINE void arm_circularWrite_q7( - q7_t * circBuffer, - int32_t L, - uint16_t * writeOffset, - int32_t bufferInc, - const q7_t * src, - int32_t srcInc, - uint32_t blockSize) - { - uint32_t i = 0u; - int32_t wOffset; - - /* Copy the value of Index pointer that points - * to the current location where the input samples to be copied */ - wOffset = *writeOffset; - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the input sample to the circular buffer */ - circBuffer[wOffset] = *src; - - /* Update the input pointer */ - src += srcInc; - - /* Circularly update wOffset. Watch out for positive and negative value */ - wOffset += bufferInc; - if (wOffset >= L) - wOffset -= L; - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *writeOffset = (uint16_t)wOffset; - } - - - /** - * @brief Q7 Circular Read function. - */ - static __INLINE void arm_circularRead_q7( - q7_t * circBuffer, - int32_t L, - int32_t * readOffset, - int32_t bufferInc, - q7_t * dst, - q7_t * dst_base, - int32_t dst_length, - int32_t dstInc, - uint32_t blockSize) - { - uint32_t i = 0; - int32_t rOffset, dst_end; - - /* Copy the value of Index pointer that points - * to the current location from where the input samples to be read */ - rOffset = *readOffset; - - dst_end = (int32_t) (dst_base + dst_length); - - /* Loop over the blockSize */ - i = blockSize; - - while (i > 0u) - { - /* copy the sample from the circular buffer to the destination buffer */ - *dst = circBuffer[rOffset]; - - /* Update the input pointer */ - dst += dstInc; - - if (dst == (q7_t *) dst_end) - { - dst = dst_base; - } - - /* Circularly update rOffset. Watch out for positive and negative value */ - rOffset += bufferInc; - - if (rOffset >= L) - { - rOffset -= L; - } - - /* Decrement the loop counter */ - i--; - } - - /* Update the index pointer */ - *readOffset = rOffset; - } - - - /** - * @brief Sum of the squares of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_q31( - q31_t * pSrc, - uint32_t blockSize, - q63_t * pResult); - - - /** - * @brief Sum of the squares of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Sum of the squares of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_q15( - q15_t * pSrc, - uint32_t blockSize, - q63_t * pResult); - - - /** - * @brief Sum of the squares of the elements of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_power_q7( - q7_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Mean value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * pResult); - - - /** - * @brief Mean value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Mean value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Mean value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_mean_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Variance of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_var_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Variance of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_var_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Variance of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_var_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Root Mean Square of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_rms_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Root Mean Square of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_rms_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Root Mean Square of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_rms_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Standard deviation of the elements of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_std_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult); - - - /** - * @brief Standard deviation of the elements of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_std_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult); - - - /** - * @brief Standard deviation of the elements of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output value. - */ - void arm_std_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult); - - - /** - * @brief Floating-point complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_f32( - float32_t * pSrc, - float32_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_q31( - q31_t * pSrc, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex magnitude - * @param[in] pSrc points to the complex input vector - * @param[out] pDst points to the real output vector - * @param[in] numSamples number of complex samples in the input vector - */ - void arm_cmplx_mag_q15( - q15_t * pSrc, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q15 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ - void arm_cmplx_dot_prod_q15( - q15_t * pSrcA, - q15_t * pSrcB, - uint32_t numSamples, - q31_t * realResult, - q31_t * imagResult); - - - /** - * @brief Q31 complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ - void arm_cmplx_dot_prod_q31( - q31_t * pSrcA, - q31_t * pSrcB, - uint32_t numSamples, - q63_t * realResult, - q63_t * imagResult); - - - /** - * @brief Floating-point complex dot product - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[in] numSamples number of complex samples in each vector - * @param[out] realResult real part of the result returned here - * @param[out] imagResult imaginary part of the result returned here - */ - void arm_cmplx_dot_prod_f32( - float32_t * pSrcA, - float32_t * pSrcB, - uint32_t numSamples, - float32_t * realResult, - float32_t * imagResult); - - - /** - * @brief Q15 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ - void arm_cmplx_mult_real_q15( - q15_t * pSrcCmplx, - q15_t * pSrcReal, - q15_t * pCmplxDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ - void arm_cmplx_mult_real_q31( - q31_t * pSrcCmplx, - q31_t * pSrcReal, - q31_t * pCmplxDst, - uint32_t numSamples); - - - /** - * @brief Floating-point complex-by-real multiplication - * @param[in] pSrcCmplx points to the complex input vector - * @param[in] pSrcReal points to the real input vector - * @param[out] pCmplxDst points to the complex output vector - * @param[in] numSamples number of samples in each vector - */ - void arm_cmplx_mult_real_f32( - float32_t * pSrcCmplx, - float32_t * pSrcReal, - float32_t * pCmplxDst, - uint32_t numSamples); - - - /** - * @brief Minimum value of a Q7 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] result is output pointer - * @param[in] index is the array index of the minimum value in the input buffer. - */ - void arm_min_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * result, - uint32_t * index); - - - /** - * @brief Minimum value of a Q15 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[in] pIndex is the array index of the minimum value in the input buffer. - */ - void arm_min_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult, - uint32_t * pIndex); - - - /** - * @brief Minimum value of a Q31 vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ - void arm_min_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult, - uint32_t * pIndex); - - - /** - * @brief Minimum value of a floating-point vector. - * @param[in] pSrc is input pointer - * @param[in] blockSize is the number of samples to process - * @param[out] pResult is output pointer - * @param[out] pIndex is the array index of the minimum value in the input buffer. - */ - void arm_min_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a Q7 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_q7( - q7_t * pSrc, - uint32_t blockSize, - q7_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a Q15 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_q15( - q15_t * pSrc, - uint32_t blockSize, - q15_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a Q31 vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_q31( - q31_t * pSrc, - uint32_t blockSize, - q31_t * pResult, - uint32_t * pIndex); - - -/** - * @brief Maximum value of a floating-point vector. - * @param[in] pSrc points to the input buffer - * @param[in] blockSize length of the input vector - * @param[out] pResult maximum value returned here - * @param[out] pIndex index of maximum value returned here - */ - void arm_max_f32( - float32_t * pSrc, - uint32_t blockSize, - float32_t * pResult, - uint32_t * pIndex); - - - /** - * @brief Q15 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_mult_cmplx_q15( - q15_t * pSrcA, - q15_t * pSrcB, - q15_t * pDst, - uint32_t numSamples); - - - /** - * @brief Q31 complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_mult_cmplx_q31( - q31_t * pSrcA, - q31_t * pSrcB, - q31_t * pDst, - uint32_t numSamples); - - - /** - * @brief Floating-point complex-by-complex multiplication - * @param[in] pSrcA points to the first input vector - * @param[in] pSrcB points to the second input vector - * @param[out] pDst points to the output vector - * @param[in] numSamples number of complex samples in each vector - */ - void arm_cmplx_mult_cmplx_f32( - float32_t * pSrcA, - float32_t * pSrcB, - float32_t * pDst, - uint32_t numSamples); - - - /** - * @brief Converts the elements of the floating-point vector to Q31 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q31 output vector - * @param[in] blockSize length of the input vector - */ - void arm_float_to_q31( - float32_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the floating-point vector to Q15 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q15 output vector - * @param[in] blockSize length of the input vector - */ - void arm_float_to_q15( - float32_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the floating-point vector to Q7 vector. - * @param[in] pSrc points to the floating-point input vector - * @param[out] pDst points to the Q7 output vector - * @param[in] blockSize length of the input vector - */ - void arm_float_to_q7( - float32_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q31 vector to Q15 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q31_to_q15( - q31_t * pSrc, - q15_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q31 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q31_to_q7( - q31_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to floating-point vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q15_to_float( - q15_t * pSrc, - float32_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to Q31 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q15_to_q31( - q15_t * pSrc, - q31_t * pDst, - uint32_t blockSize); - - - /** - * @brief Converts the elements of the Q15 vector to Q7 vector. - * @param[in] pSrc is input pointer - * @param[out] pDst is output pointer - * @param[in] blockSize is the number of samples to process - */ - void arm_q15_to_q7( - q15_t * pSrc, - q7_t * pDst, - uint32_t blockSize); - - - /** - * @ingroup groupInterpolation - */ - - /** - * @defgroup BilinearInterpolate Bilinear Interpolation - * - * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. - * The underlying function f(x, y) is sampled on a regular grid and the interpolation process - * determines values between the grid points. - * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. - * Bilinear interpolation is often used in image processing to rescale images. - * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. - * - * Algorithm - * \par - * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. - * For floating-point, the instance structure is defined as: - *
-   *   typedef struct
-   *   {
-   *     uint16_t numRows;
-   *     uint16_t numCols;
-   *     float32_t *pData;
-   * } arm_bilinear_interp_instance_f32;
-   * 
- * - * \par - * where numRows specifies the number of rows in the table; - * numCols specifies the number of columns in the table; - * and pData points to an array of size numRows*numCols values. - * The data table pTable is organized in row order and the supplied data values fall on integer indexes. - * That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers. - * - * \par - * Let (x, y) specify the desired interpolation point. Then define: - *
-   *     XF = floor(x)
-   *     YF = floor(y)
-   * 
- * \par - * The interpolated output point is computed as: - *
-   *  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
-   *           + f(XF + 1, YF) * (x-XF)*(1-(y-YF))
-   *           + f(XF, YF + 1) * (1-(x-XF))*(y-YF)
-   *           + f(XF + 1, YF + 1) * (x-XF)*(y-YF)
-   * 
- * Note that the coordinates (x, y) contain integer and fractional components. - * The integer components specify which portion of the table to use while the - * fractional components control the interpolation processor. - * - * \par - * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. - */ - - /** - * @addtogroup BilinearInterpolate - * @{ - */ - - - /** - * - * @brief Floating-point bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate. - * @param[in] Y interpolation coordinate. - * @return out interpolated value. - */ - static __INLINE float32_t arm_bilinear_interp_f32( - const arm_bilinear_interp_instance_f32 * S, - float32_t X, - float32_t Y) - { - float32_t out; - float32_t f00, f01, f10, f11; - float32_t *pData = S->pData; - int32_t xIndex, yIndex, index; - float32_t xdiff, ydiff; - float32_t b1, b2, b3, b4; - - xIndex = (int32_t) X; - yIndex = (int32_t) Y; - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1)) - { - return (0); - } - - /* Calculation of index for two nearest points in X-direction */ - index = (xIndex - 1) + (yIndex - 1) * S->numCols; - - - /* Read two nearest points in X-direction */ - f00 = pData[index]; - f01 = pData[index + 1]; - - /* Calculation of index for two nearest points in Y-direction */ - index = (xIndex - 1) + (yIndex) * S->numCols; - - - /* Read two nearest points in Y-direction */ - f10 = pData[index]; - f11 = pData[index + 1]; - - /* Calculation of intermediate values */ - b1 = f00; - b2 = f01 - f00; - b3 = f10 - f00; - b4 = f00 - f01 - f10 + f11; - - /* Calculation of fractional part in X */ - xdiff = X - xIndex; - - /* Calculation of fractional part in Y */ - ydiff = Y - yIndex; - - /* Calculation of bi-linear interpolated output */ - out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; - - /* return to application */ - return (out); - } - - - /** - * - * @brief Q31 bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - static __INLINE q31_t arm_bilinear_interp_q31( - arm_bilinear_interp_instance_q31 * S, - q31_t X, - q31_t Y) - { - q31_t out; /* Temporary output */ - q31_t acc = 0; /* output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q31_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q31_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* shift left xfract by 11 to keep 1.31 format */ - xfract = (X & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - x1 = pYData[(rI) + (int32_t)nCols * (cI) ]; - x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1]; - - /* 20 bits for the fractional part */ - /* shift left yfract by 11 to keep 1.31 format */ - yfract = (Y & 0x000FFFFF) << 11u; - - /* Read two nearest output values from the index */ - y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ]; - y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ - out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); - acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); - - /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (xfract) >> 32)); - - /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); - - /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ - out = ((q31_t) ((q63_t) y2 * (xfract) >> 32)); - acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); - - /* Convert acc to 1.31(q31) format */ - return ((q31_t)(acc << 2)); - } - - - /** - * @brief Q15 bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - static __INLINE q15_t arm_bilinear_interp_q15( - arm_bilinear_interp_instance_q15 * S, - q31_t X, - q31_t Y) - { - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q15_t x1, x2, y1, y2; /* Nearest output values */ - q31_t xfract, yfract; /* X, Y fractional parts */ - int32_t rI, cI; /* Row and column indices */ - q15_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & 0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & 0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ - - /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ - /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ - out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); - acc = ((q63_t) out * (0xFFFFF - yfract)); - - /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); - acc += ((q63_t) out * (xfract)); - - /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ - out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u); - acc += ((q63_t) out * (yfract)); - - /* acc is in 13.51 format and down shift acc by 36 times */ - /* Convert out to 1.15 format */ - return ((q15_t)(acc >> 36)); - } - - - /** - * @brief Q7 bilinear interpolation. - * @param[in,out] S points to an instance of the interpolation structure. - * @param[in] X interpolation coordinate in 12.20 format. - * @param[in] Y interpolation coordinate in 12.20 format. - * @return out interpolated value. - */ - static __INLINE q7_t arm_bilinear_interp_q7( - arm_bilinear_interp_instance_q7 * S, - q31_t X, - q31_t Y) - { - q63_t acc = 0; /* output */ - q31_t out; /* Temporary output */ - q31_t xfract, yfract; /* X, Y fractional parts */ - q7_t x1, x2, y1, y2; /* Nearest output values */ - int32_t rI, cI; /* Row and column indices */ - q7_t *pYData = S->pData; /* pointer to output table values */ - uint32_t nCols = S->numCols; /* num of rows */ - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - rI = ((X & (q31_t)0xFFF00000) >> 20); - - /* Input is in 12.20 format */ - /* 12 bits for the table index */ - /* Index value calculation */ - cI = ((Y & (q31_t)0xFFF00000) >> 20); - - /* Care taken for table outside boundary */ - /* Returns zero output when values are outside table boundary */ - if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) - { - return (0); - } - - /* 20 bits for the fractional part */ - /* xfract should be in 12.20 format */ - xfract = (X & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; - x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; - - /* 20 bits for the fractional part */ - /* yfract should be in 12.20 format */ - yfract = (Y & (q31_t)0x000FFFFF); - - /* Read two nearest output values from the index */ - y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; - y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; - - /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ - out = ((x1 * (0xFFFFF - xfract))); - acc = (((q63_t) out * (0xFFFFF - yfract))); - - /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ - out = ((x2 * (0xFFFFF - yfract))); - acc += (((q63_t) out * (xfract))); - - /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y1 * (0xFFFFF - xfract))); - acc += (((q63_t) out * (yfract))); - - /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ - out = ((y2 * (yfract))); - acc += (((q63_t) out * (xfract))); - - /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ - return ((q7_t)(acc >> 40)); - } - - /** - * @} end of BilinearInterpolate group - */ - - -/* SMMLAR */ -#define multAcc_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMLSR */ -#define multSub_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) - -/* SMMULR */ -#define mult_32x32_keep32_R(a, x, y) \ - a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) - -/* SMMLA */ -#define multAcc_32x32_keep32(a, x, y) \ - a += (q31_t) (((q63_t) x * y) >> 32) - -/* SMMLS */ -#define multSub_32x32_keep32(a, x, y) \ - a -= (q31_t) (((q63_t) x * y) >> 32) - -/* SMMUL */ -#define mult_32x32_keep32(a, x, y) \ - a = (q31_t) (((q63_t) x * y ) >> 32) - - -#if defined ( __CC_ARM ) - /* Enter low optimization region - place directly above function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define LOW_OPTIMIZATION_ENTER \ - _Pragma ("push") \ - _Pragma ("O1") - #else - #define LOW_OPTIMIZATION_ENTER - #endif - - /* Exit low optimization region - place directly after end of function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define LOW_OPTIMIZATION_EXIT \ - _Pragma ("pop") - #else - #define LOW_OPTIMIZATION_EXIT - #endif - - /* Enter low optimization region - place directly above function definition */ - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - - /* Exit low optimization region - place directly after end of function definition */ - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define LOW_OPTIMIZATION_ENTER - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__GNUC__) - #define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") )) - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__ICCARM__) - /* Enter low optimization region - place directly above function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") - #else - #define LOW_OPTIMIZATION_ENTER - #endif - - /* Exit low optimization region - place directly after end of function definition */ - #define LOW_OPTIMIZATION_EXIT - - /* Enter low optimization region - place directly above function definition */ - #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ - _Pragma ("optimize=low") - #else - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #endif - - /* Exit low optimization region - place directly after end of function definition */ - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__CSMC__) - #define LOW_OPTIMIZATION_ENTER - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#elif defined(__TASKING__) - #define LOW_OPTIMIZATION_ENTER - #define LOW_OPTIMIZATION_EXIT - #define IAR_ONLY_LOW_OPTIMIZATION_ENTER - #define IAR_ONLY_LOW_OPTIMIZATION_EXIT - -#endif - - -#ifdef __cplusplus -} -#endif - - -#if defined ( __GNUC__ ) -#pragma GCC diagnostic pop -#endif - -#endif /* _ARM_MATH_H */ - -/** - * - * End of file. - */ diff --git a/third_party/NordicSemiconductor/cmsis/cmsis_armcc.h b/third_party/NordicSemiconductor/cmsis/cmsis_armcc.h deleted file mode 100644 index 74c49c67d..000000000 --- a/third_party/NordicSemiconductor/cmsis/cmsis_armcc.h +++ /dev/null @@ -1,734 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CMSIS_ARMCC_H -#define __CMSIS_ARMCC_H - - -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677) - #error "Please use ARM Compiler Toolchain V4.0.677 or later!" -#endif - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/* intrinsic void __enable_irq(); */ -/* intrinsic void __disable_irq(); */ - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__STATIC_INLINE uint32_t __get_CONTROL(void) -{ - register uint32_t __regControl __ASM("control"); - return(__regControl); -} - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - register uint32_t __regControl __ASM("control"); - __regControl = control; -} - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__STATIC_INLINE uint32_t __get_IPSR(void) -{ - register uint32_t __regIPSR __ASM("ipsr"); - return(__regIPSR); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__STATIC_INLINE uint32_t __get_APSR(void) -{ - register uint32_t __regAPSR __ASM("apsr"); - return(__regAPSR); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__STATIC_INLINE uint32_t __get_xPSR(void) -{ - register uint32_t __regXPSR __ASM("xpsr"); - return(__regXPSR); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t __regProcessStackPointer __ASM("psp"); - return(__regProcessStackPointer); -} - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - register uint32_t __regProcessStackPointer __ASM("psp"); - __regProcessStackPointer = topOfProcStack; -} - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t __regMainStackPointer __ASM("msp"); - return(__regMainStackPointer); -} - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - register uint32_t __regMainStackPointer __ASM("msp"); - __regMainStackPointer = topOfMainStack; -} - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - register uint32_t __regPriMask __ASM("primask"); - return(__regPriMask); -} - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - register uint32_t __regPriMask __ASM("primask"); - __regPriMask = (priMask); -} - - -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -#define __enable_fault_irq __enable_fiq - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -#define __disable_fault_irq __disable_fiq - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - register uint32_t __regBasePri __ASM("basepri"); - return(__regBasePri); -} - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__STATIC_INLINE void __set_BASEPRI(uint32_t basePri) -{ - register uint32_t __regBasePri __ASM("basepri"); - __regBasePri = (basePri & 0xFFU); -} - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri) -{ - register uint32_t __regBasePriMax __ASM("basepri_max"); - __regBasePriMax = (basePri & 0xFFU); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - register uint32_t __regFaultMask __ASM("faultmask"); - return(__regFaultMask); -} - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - register uint32_t __regFaultMask __ASM("faultmask"); - __regFaultMask = (faultMask & (uint32_t)1); -} - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - - -#if (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -__STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - register uint32_t __regfpscr __ASM("fpscr"); - return(__regfpscr); -#else - return(0U); -#endif -} - - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -__STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - register uint32_t __regfpscr __ASM("fpscr"); - __regfpscr = (fpscr); -#endif -} - -#endif /* (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) */ - - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP __nop - - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI __wfi - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE __wfe - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV __sev - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -#define __ISB() do {\ - __schedule_barrier();\ - __isb(0xF);\ - __schedule_barrier();\ - } while (0U) - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -#define __DSB() do {\ - __schedule_barrier();\ - __dsb(0xF);\ - __schedule_barrier();\ - } while (0U) - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -#define __DMB() do {\ - __schedule_barrier();\ - __dmb(0xF);\ - __schedule_barrier();\ - } while (0U) - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __rev - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) -{ - rev16 r0, r0 - bx lr -} -#endif - -/** - \brief Reverse byte order in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int32_t __REVSH(int32_t value) -{ - revsh r0, r0 - bx lr -} -#endif - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] value Value to rotate - \param [in] value Number of Bits to rotate - \return Rotated value - */ -#define __ROR __ror - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __breakpoint(value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - #define __RBIT __rbit -#else -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; value >>= 1U) - { - result <<= 1U; - result |= value & 1U; - s--; - } - result <<= s; /* shift when v's highest bits are zero */ - return(result); -} -#endif - - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -#define __CLZ __clz - - -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr)) -#else - #define __LDREXB(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr)) _Pragma("pop") -#endif - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __LDREXH(ptr) ((uint16_t) __ldrex(ptr)) -#else - #define __LDREXH(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr)) _Pragma("pop") -#endif - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr)) -#else - #define __LDREXW(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr)) _Pragma("pop") -#endif - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __STREXB(value, ptr) __strex(value, ptr) -#else - #define __STREXB(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") -#endif - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __STREXH(value, ptr) __strex(value, ptr) -#else - #define __STREXH(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") -#endif - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) - #define __STREXW(value, ptr) __strex(value, ptr) -#else - #define __STREXW(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") -#endif - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -#define __CLREX __clrex - - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT __ssat - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __usat - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -#ifndef __NO_EMBEDDED_ASM -__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value) -{ - rrx r0, r0 - bx lr -} -#endif - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr)) - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr)) - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr)) - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -#define __STRBT(value, ptr) __strt(value, ptr) - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -#define __STRHT(value, ptr) __strt(value, ptr) - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -#define __STRT(value, ptr) __strt(value, ptr) - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__CORTEX_M >= 0x04U) /* only for Cortex-M4 and above */ - -#define __SADD8 __sadd8 -#define __QADD8 __qadd8 -#define __SHADD8 __shadd8 -#define __UADD8 __uadd8 -#define __UQADD8 __uqadd8 -#define __UHADD8 __uhadd8 -#define __SSUB8 __ssub8 -#define __QSUB8 __qsub8 -#define __SHSUB8 __shsub8 -#define __USUB8 __usub8 -#define __UQSUB8 __uqsub8 -#define __UHSUB8 __uhsub8 -#define __SADD16 __sadd16 -#define __QADD16 __qadd16 -#define __SHADD16 __shadd16 -#define __UADD16 __uadd16 -#define __UQADD16 __uqadd16 -#define __UHADD16 __uhadd16 -#define __SSUB16 __ssub16 -#define __QSUB16 __qsub16 -#define __SHSUB16 __shsub16 -#define __USUB16 __usub16 -#define __UQSUB16 __uqsub16 -#define __UHSUB16 __uhsub16 -#define __SASX __sasx -#define __QASX __qasx -#define __SHASX __shasx -#define __UASX __uasx -#define __UQASX __uqasx -#define __UHASX __uhasx -#define __SSAX __ssax -#define __QSAX __qsax -#define __SHSAX __shsax -#define __USAX __usax -#define __UQSAX __uqsax -#define __UHSAX __uhsax -#define __USAD8 __usad8 -#define __USADA8 __usada8 -#define __SSAT16 __ssat16 -#define __USAT16 __usat16 -#define __UXTB16 __uxtb16 -#define __UXTAB16 __uxtab16 -#define __SXTB16 __sxtb16 -#define __SXTAB16 __sxtab16 -#define __SMUAD __smuad -#define __SMUADX __smuadx -#define __SMLAD __smlad -#define __SMLADX __smladx -#define __SMLALD __smlald -#define __SMLALDX __smlaldx -#define __SMUSD __smusd -#define __SMUSDX __smusdx -#define __SMLSD __smlsd -#define __SMLSDX __smlsdx -#define __SMLSLD __smlsld -#define __SMLSLDX __smlsldx -#define __SEL __sel -#define __QADD __qadd -#define __QSUB __qsub - -#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ - ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) - -#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ - ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) - -#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \ - ((int64_t)(ARG3) << 32U) ) >> 32U)) - -#endif /* (__CORTEX_M >= 0x04) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCC_H */ diff --git a/third_party/NordicSemiconductor/cmsis/cmsis_armcc_V6.h b/third_party/NordicSemiconductor/cmsis/cmsis_armcc_V6.h deleted file mode 100644 index cd13240ce..000000000 --- a/third_party/NordicSemiconductor/cmsis/cmsis_armcc_V6.h +++ /dev/null @@ -1,1800 +0,0 @@ -/**************************************************************************//** - * @file cmsis_armcc_V6.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CMSIS_ARMCC_V6_H -#define __CMSIS_ARMCC_V6_H - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing the I-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__((always_inline)) __STATIC_INLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting the I-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__((always_inline)) __STATIC_INLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get Control Register (non-secure) - \details Returns the content of the non-secure Control Register when in secure mode. - \return non-secure Control Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_CONTROL_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Control Register (non-secure) - \details Writes the given value to the non-secure Control Register when in secure state. - \param [in] control Control Register value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_CONTROL_NS(uint32_t control) -{ - __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); -} -#endif - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get IPSR Register (non-secure) - \details Returns the content of the non-secure IPSR Register when in secure state. - \return IPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_IPSR_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get APSR Register (non-secure) - \details Returns the content of the non-secure APSR Register when in secure state. - \return APSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_APSR_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - \return xPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get xPSR Register (non-secure) - \details Returns the content of the non-secure xPSR Register when in secure state. - \return xPSR Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_xPSR_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psp" : "=r" (result) ); - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get Process Stack Pointer (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. - \return PSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : "sp"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : "sp"); -} -#endif - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msp" : "=r" (result) ); - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get Main Stack Pointer (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. - \return MSP Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : "sp"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Main Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : "sp"); -} -#endif - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get Priority Mask (non-secure) - \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. - \return Priority Mask value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PRIMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Priority Mask (non-secure) - \details Assigns the given value to the non-secure Priority Mask Register when in secure state. - \param [in] priMask Priority Mask - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) -{ - __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); -} -#endif - - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__((always_inline)) __STATIC_INLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__((always_inline)) __STATIC_INLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get Base Priority (non-secure) - \details Returns the current value of the non-secure Base Priority register when in secure state. - \return Base Priority register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_BASEPRI_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Base Priority (non-secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state. - \param [in] basePri Base Priority value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_NS(uint32_t value) -{ - __ASM volatile ("MSR basepri_ns, %0" : : "r" (value) : "memory"); -} -#endif - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t value) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (value) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Base Priority with condition (non_secure) - \details Assigns the given value to the non-secure Base Priority register when in secure state only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_MAX_NS(uint32_t value) -{ - __ASM volatile ("MSR basepri_max_ns, %0" : : "r" (value) : "memory"); -} -#endif - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get Fault Mask (non-secure) - \details Returns the current value of the non-secure Fault Mask register when in secure state. - \return Fault Mask register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_FAULTMASK_NS(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set Fault Mask (non-secure) - \details Assigns the given value to the non-secure Fault Mask register when in secure state. - \param [in] faultMask Fault Mask value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); -} -#endif - - -#endif /* ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - -#if (__ARM_ARCH_8M__ == 1U) - -/** - \brief Get Process Stack Pointer Limit - \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psplim" : "=r" (result) ); - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Get Process Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \return PSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Process Stack Pointer Limit - \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) -{ - __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Set Process Stack Pointer (non-secure) - \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. - \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) -{ - __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); -} -#endif - - -/** - \brief Get Main Stack Pointer Limit - \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msplim" : "=r" (result) ); - - return(result); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Get Main Stack Pointer Limit (non-secure) - \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. - \return MSPLIM Register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); - return(result); -} -#endif - - -/** - \brief Set Main Stack Pointer Limit - \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). - \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) -{ - __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); -} - - -#if (__ARM_FEATURE_CMSE == 3U) && (__ARM_ARCH_PROFILE == 'M') /* ToDo: ARMCC_V6: check predefined macro for mainline */ -/** - \brief Set Main Stack Pointer Limit (non-secure) - \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. - \param [in] MainStackPtrLimit Main Stack Pointer value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) -{ - __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); -} -#endif - -#endif /* (__ARM_ARCH_8M__ == 1U) */ - - -#if ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=4 */ - -/** - \brief Get FPSCR - \details eturns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -#define __get_FPSCR __builtin_arm_get_fpscr -#if 0 -__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - __ASM volatile (""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - __ASM volatile (""); - return(result); -#else - return(0); -#endif -} -#endif - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Get FPSCR (non-secure) - \details Returns the current value of the non-secure Floating Point Status/Control register when in secure state. - \return Floating Point Status/Control register value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_FPSCR_NS(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - __ASM volatile (""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile ("VMRS %0, fpscr_ns" : "=r" (result) ); - __ASM volatile (""); - return(result); -#else - return(0); -#endif -} -#endif - - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -#define __set_FPSCR __builtin_arm_set_fpscr -#if 0 -__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - __ASM volatile (""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc"); - __ASM volatile (""); -#endif -} -#endif - -#if (__ARM_FEATURE_CMSE == 3U) -/** - \brief Set FPSCR (non-secure) - \details Assigns the given value to the non-secure Floating Point Status/Control register when in secure state. - \param [in] fpscr Floating Point Status/Control value to set - */ -__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FPSCR_NS(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - __ASM volatile (""); /* Empty asm statement works as a scheduling barrier */ - __ASM volatile ("VMSR fpscr_ns, %0" : : "r" (fpscr) : "vfpcc"); - __ASM volatile (""); -#endif -} -#endif - -#endif /* ((__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -#define __NOP __builtin_arm_nop - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -#define __WFI __builtin_arm_wfi - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -#define __WFE __builtin_arm_wfe - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -#define __SEV __builtin_arm_sev - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -#define __ISB() __builtin_arm_isb(0xF); - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -#define __DSB() __builtin_arm_dsb(0xF); - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -#define __DMB() __builtin_arm_dmb(0xF); - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in integer value. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV __builtin_bswap32 - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -#define __REV16 __builtin_bswap16 /* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */ -#if 0 -__attribute__((always_inline)) __STATIC_INLINE uint32_t __REV16(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} -#endif - - -/** - \brief Reverse byte order in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ - /* ToDo: ARMCC_V6: check if __builtin_bswap16 could be used */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ - int32_t result; - - __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] op1 Value to rotate - \param [in] op2 Number of Bits to rotate - \return Rotated value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ - /* ToDo: ARMCC_V6: check if __builtin_arm_rbit is supported */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); -#else - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; value >>= 1U) - { - result <<= 1U; - result |= value & 1U; - s--; - } - result <<= s; /* shift when v's highest bits are zero */ -#endif - return(result); -} - - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -#define __CLZ __builtin_clz - - -#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) /* ToDo: ARMCC_V6: check if this is ok for cortex >=3 */ - -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDREXB (uint8_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDREXH (uint16_t)__builtin_arm_ldrex - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDREXW (uint32_t)__builtin_arm_ldrex - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXB (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXH (uint32_t)__builtin_arm_strex - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STREXW (uint32_t)__builtin_arm_strex - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -#define __CLREX __builtin_arm_clrex - - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -/*#define __SSAT __builtin_arm_ssat*/ -#define __SSAT(ARG1,ARG2) \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT __builtin_arm_usat -#if 0 -#define __USAT(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) -#endif - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDRBT(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDRHT(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); -} - -#endif /* ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_8M__ == 1U)) */ - - -#if (__ARM_ARCH_8M__ == 1U) - -/** - \brief Load-Acquire (8 bit) - \details Executes a LDAB instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDAB(volatile uint8_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint8_t) result); -} - - -/** - \brief Load-Acquire (16 bit) - \details Executes a LDAH instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDAH(volatile uint16_t *ptr) -{ - uint32_t result; - - __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) ); - return ((uint16_t) result); -} - - -/** - \brief Load-Acquire (32 bit) - \details Executes a LDA instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDA(volatile uint32_t *ptr) -{ - uint32_t result; - - __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) ); - return(result); -} - - -/** - \brief Store-Release (8 bit) - \details Executes a STLB instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STLB(uint8_t value, volatile uint8_t *ptr) -{ - __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief Store-Release (16 bit) - \details Executes a STLH instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STLH(uint16_t value, volatile uint16_t *ptr) -{ - __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief Store-Release (32 bit) - \details Executes a STL instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STL(uint32_t value, volatile uint32_t *ptr) -{ - __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); -} - - -/** - \brief Load-Acquire Exclusive (8 bit) - \details Executes a LDAB exclusive instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -#define __LDAEXB (uint8_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (16 bit) - \details Executes a LDAH exclusive instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -#define __LDAEXH (uint16_t)__builtin_arm_ldaex - - -/** - \brief Load-Acquire Exclusive (32 bit) - \details Executes a LDA exclusive instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -#define __LDAEX (uint32_t)__builtin_arm_ldaex - - -/** - \brief Store-Release Exclusive (8 bit) - \details Executes a STLB exclusive instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXB (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (16 bit) - \details Executes a STLH exclusive instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEXH (uint32_t)__builtin_arm_stlex - - -/** - \brief Store-Release Exclusive (32 bit) - \details Executes a STL exclusive instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -#define __STLEX (uint32_t)__builtin_arm_stlex - -#endif /* (__ARM_ARCH_8M__ == 1U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__ARM_FEATURE_DSP == 1U) /* ToDo: ARMCC_V6: This should be ARCH >= ARMv7-M + SIMD */ - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __QASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#define __SSAT16(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -#define __USAT16(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SEL (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE int32_t __QADD( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__((always_inline)) __STATIC_INLINE int32_t __QSUB( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -#define __PKHBT(ARG1,ARG2,ARG3) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - -#define __PKHTB(ARG1,ARG2,ARG3) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - if (ARG3 == 0) \ - __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ - else \ - __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - -__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__ARM_FEATURE_DSP == 1U) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#endif /* __CMSIS_ARMCC_V6_H */ diff --git a/third_party/NordicSemiconductor/cmsis/cmsis_gcc.h b/third_party/NordicSemiconductor/cmsis/cmsis_gcc.h deleted file mode 100644 index bb89fbba9..000000000 --- a/third_party/NordicSemiconductor/cmsis/cmsis_gcc.h +++ /dev/null @@ -1,1373 +0,0 @@ -/**************************************************************************//** - * @file cmsis_gcc.h - * @brief CMSIS Cortex-M Core Function/Instruction Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#ifndef __CMSIS_GCC_H -#define __CMSIS_GCC_H - -/* ignore some GCC warnings */ -#if defined ( __GNUC__ ) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-conversion" -#pragma GCC diagnostic ignored "-Wconversion" -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ - */ - -/** - \brief Enable IRQ Interrupts - \details Enables IRQ interrupts by clearing the I-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_irq(void) -{ - __ASM volatile ("cpsie i" : : : "memory"); -} - - -/** - \brief Disable IRQ Interrupts - \details Disables IRQ interrupts by setting the I-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_irq(void) -{ - __ASM volatile ("cpsid i" : : : "memory"); -} - - -/** - \brief Get Control Register - \details Returns the content of the Control Register. - \return Control Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_CONTROL(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, control" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Control Register - \details Writes the given value to the Control Register. - \param [in] control Control Register value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_CONTROL(uint32_t control) -{ - __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); -} - - -/** - \brief Get IPSR Register - \details Returns the content of the IPSR Register. - \return IPSR Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_IPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get APSR Register - \details Returns the content of the APSR Register. - \return APSR Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_APSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, apsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get xPSR Register - \details Returns the content of the xPSR Register. - - \return xPSR Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_xPSR(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); - return(result); -} - - -/** - \brief Get Process Stack Pointer - \details Returns the current value of the Process Stack Pointer (PSP). - \return PSP Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, psp\n" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Process Stack Pointer - \details Assigns the given value to the Process Stack Pointer (PSP). - \param [in] topOfProcStack Process Stack Pointer value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) -{ - __ASM volatile ("MSR psp, %0\n" : : "r" (topOfProcStack) : "sp"); -} - - -/** - \brief Get Main Stack Pointer - \details Returns the current value of the Main Stack Pointer (MSP). - \return MSP Register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_MSP(void) -{ - register uint32_t result; - - __ASM volatile ("MRS %0, msp\n" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Main Stack Pointer - \details Assigns the given value to the Main Stack Pointer (MSP). - - \param [in] topOfMainStack Main Stack Pointer value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) -{ - __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp"); -} - - -/** - \brief Get Priority Mask - \details Returns the current state of the priority mask bit from the Priority Mask Register. - \return Priority Mask value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_PRIMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, primask" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Priority Mask - \details Assigns the given value to the Priority Mask Register. - \param [in] priMask Priority Mask - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) -{ - __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); -} - - -#if (__CORTEX_M >= 0x03U) - -/** - \brief Enable FIQ - \details Enables FIQ interrupts by clearing the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __enable_fault_irq(void) -{ - __ASM volatile ("cpsie f" : : : "memory"); -} - - -/** - \brief Disable FIQ - \details Disables FIQ interrupts by setting the F-bit in the CPSR. - Can only be executed in Privileged modes. - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __disable_fault_irq(void) -{ - __ASM volatile ("cpsid f" : : : "memory"); -} - - -/** - \brief Get Base Priority - \details Returns the current value of the Base Priority register. - \return Base Priority register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_BASEPRI(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, basepri" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Base Priority - \details Assigns the given value to the Base Priority register. - \param [in] basePri Base Priority value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value) -{ - __ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory"); -} - - -/** - \brief Set Base Priority with condition - \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, - or the new value increases the BASEPRI priority level. - \param [in] basePri Base Priority value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t value) -{ - __ASM volatile ("MSR basepri_max, %0" : : "r" (value) : "memory"); -} - - -/** - \brief Get Fault Mask - \details Returns the current value of the Fault Mask register. - \return Fault Mask register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FAULTMASK(void) -{ - uint32_t result; - - __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); - return(result); -} - - -/** - \brief Set Fault Mask - \details Assigns the given value to the Fault Mask register. - \param [in] faultMask Fault Mask value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) -{ - __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); -} - -#endif /* (__CORTEX_M >= 0x03U) */ - - -#if (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) - -/** - \brief Get FPSCR - \details Returns the current value of the Floating Point Status/Control register. - \return Floating Point Status/Control register value - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_FPSCR(void) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - uint32_t result; - - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile (""); - __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); - __ASM volatile (""); - return(result); -#else - return(0); -#endif -} - - -/** - \brief Set FPSCR - \details Assigns the given value to the Floating Point Status/Control register. - \param [in] fpscr Floating Point Status/Control value to set - */ -__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) -{ -#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U) - /* Empty asm statement works as a scheduling barrier */ - __ASM volatile (""); - __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc"); - __ASM volatile (""); -#endif -} - -#endif /* (__CORTEX_M == 0x04U) || (__CORTEX_M == 0x07U) */ - - - -/*@} end of CMSIS_Core_RegAccFunctions */ - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/* Define macros for porting to both thumb1 and thumb2. - * For thumb1, use low register (r0-r7), specified by constraint "l" - * Otherwise, use general registers, specified by constraint "r" */ -#if defined (__thumb__) && !defined (__thumb2__) -#define __CMSIS_GCC_OUT_REG(r) "=l" (r) -#define __CMSIS_GCC_USE_REG(r) "l" (r) -#else -#define __CMSIS_GCC_OUT_REG(r) "=r" (r) -#define __CMSIS_GCC_USE_REG(r) "r" (r) -#endif - -/** - \brief No Operation - \details No Operation does nothing. This instruction can be used for code alignment purposes. - */ -__attribute__((always_inline)) __STATIC_INLINE void __NOP(void) -{ - __ASM volatile ("nop"); -} - - -/** - \brief Wait For Interrupt - \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. - */ -__attribute__((always_inline)) __STATIC_INLINE void __WFI(void) -{ - __ASM volatile ("wfi"); -} - - -/** - \brief Wait For Event - \details Wait For Event is a hint instruction that permits the processor to enter - a low-power state until one of a number of events occurs. - */ -__attribute__((always_inline)) __STATIC_INLINE void __WFE(void) -{ - __ASM volatile ("wfe"); -} - - -/** - \brief Send Event - \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. - */ -__attribute__((always_inline)) __STATIC_INLINE void __SEV(void) -{ - __ASM volatile ("sev"); -} - - -/** - \brief Instruction Synchronization Barrier - \details Instruction Synchronization Barrier flushes the pipeline in the processor, - so that all instructions following the ISB are fetched from cache or memory, - after the instruction has been completed. - */ -__attribute__((always_inline)) __STATIC_INLINE void __ISB(void) -{ - __ASM volatile ("isb 0xF":::"memory"); -} - - -/** - \brief Data Synchronization Barrier - \details Acts as a special kind of Data Memory Barrier. - It completes when all explicit memory accesses before this instruction complete. - */ -__attribute__((always_inline)) __STATIC_INLINE void __DSB(void) -{ - __ASM volatile ("dsb 0xF":::"memory"); -} - - -/** - \brief Data Memory Barrier - \details Ensures the apparent order of the explicit memory operations before - and after the instruction, without ensuring their completion. - */ -__attribute__((always_inline)) __STATIC_INLINE void __DMB(void) -{ - __ASM volatile ("dmb 0xF":::"memory"); -} - - -/** - \brief Reverse byte order (32 bit) - \details Reverses the byte order in integer value. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __REV(uint32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) - return __builtin_bswap32(value); -#else - uint32_t result; - - __ASM volatile ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -#endif -} - - -/** - \brief Reverse byte order (16 bit) - \details Reverses the byte order in two unsigned short values. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __REV16(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief Reverse byte order in signed short value - \details Reverses the byte order in a signed short value with sign extension to integer. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) -{ -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - return (short)__builtin_bswap16(value); -#else - int32_t result; - - __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -#endif -} - - -/** - \brief Rotate Right in unsigned value (32 bit) - \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. - \param [in] value Value to rotate - \param [in] value Number of Bits to rotate - \return Rotated value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) -{ - return (op1 >> op2) | (op1 << (32U - op2)); -} - - -/** - \brief Breakpoint - \details Causes the processor to enter Debug state. - Debug tools can use this to investigate system state when the instruction at a particular address is reached. - \param [in] value is ignored by the processor. - If required, a debugger can use it to store additional information about the breakpoint. - */ -#define __BKPT(value) __ASM volatile ("bkpt "#value) - - -/** - \brief Reverse bit order of value - \details Reverses the bit order of the given value. - \param [in] value Value to reverse - \return Reversed value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) -{ - uint32_t result; - -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); -#else - int32_t s = 4 /*sizeof(v)*/ * 8 - 1; /* extra shift needed at end */ - - result = value; /* r will be reversed bits of v; first get LSB of v */ - for (value >>= 1U; value; value >>= 1U) - { - result <<= 1U; - result |= value & 1U; - s--; - } - result <<= s; /* shift when v's highest bits are zero */ -#endif - return(result); -} - - -/** - \brief Count leading zeros - \details Counts the number of leading zeros of a data value. - \param [in] value Value to count the leading zeros - \return number of leading zeros in value - */ -#define __CLZ __builtin_clz - - -#if (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) - -/** - \brief LDR Exclusive (8 bit) - \details Executes a exclusive LDR instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDREXB(volatile uint8_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDR Exclusive (16 bit) - \details Executes a exclusive LDR instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDREXH(volatile uint16_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDR Exclusive (32 bit) - \details Executes a exclusive LDR instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDREXW(volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); - return(result); -} - - -/** - \brief STR Exclusive (8 bit) - \details Executes a exclusive STR instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) -{ - uint32_t result; - - __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); -} - - -/** - \brief STR Exclusive (16 bit) - \details Executes a exclusive STR instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) -{ - uint32_t result; - - __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); - return(result); -} - - -/** - \brief STR Exclusive (32 bit) - \details Executes a exclusive STR instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - \return 0 Function succeeded - \return 1 Function failed - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); - return(result); -} - - -/** - \brief Remove the exclusive lock - \details Removes the exclusive lock which is created by LDREX. - */ -__attribute__((always_inline)) __STATIC_INLINE void __CLREX(void) -{ - __ASM volatile ("clrex" ::: "memory"); -} - - -/** - \brief Signed Saturate - \details Saturates a signed value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (1..32) - \return Saturated value - */ -#define __SSAT(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - - -/** - \brief Unsigned Saturate - \details Saturates an unsigned value. - \param [in] value Value to be saturated - \param [in] sat Bit position to saturate to (0..31) - \return Saturated value - */ -#define __USAT(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - - -/** - \brief Rotate Right with Extend (32 bit) - \details Moves each bit of a bitstring right by one bit. - The carry input is shifted in at the left end of the bitstring. - \param [in] value Value to rotate - \return Rotated value - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __RRX(uint32_t value) -{ - uint32_t result; - - __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); - return(result); -} - - -/** - \brief LDRT Unprivileged (8 bit) - \details Executes a Unprivileged LDRT instruction for 8 bit value. - \param [in] ptr Pointer to data - \return value of type uint8_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDRBT(volatile uint8_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint8_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (16 bit) - \details Executes a Unprivileged LDRT instruction for 16 bit values. - \param [in] ptr Pointer to data - \return value of type uint16_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDRHT(volatile uint16_t *addr) -{ - uint32_t result; - -#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) - __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*addr) ); -#else - /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not - accepted by assembler. So has to use following less efficient pattern. - */ - __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); -#endif - return ((uint16_t) result); /* Add explicit type cast here */ -} - - -/** - \brief LDRT Unprivileged (32 bit) - \details Executes a Unprivileged LDRT instruction for 32 bit values. - \param [in] ptr Pointer to data - \return value of type uint32_t at (*ptr) - */ -__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t *addr) -{ - uint32_t result; - - __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*addr) ); - return(result); -} - - -/** - \brief STRT Unprivileged (8 bit) - \details Executes a Unprivileged STRT instruction for 8 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *addr) -{ - __ASM volatile ("strbt %1, %0" : "=Q" (*addr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (16 bit) - \details Executes a Unprivileged STRT instruction for 16 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *addr) -{ - __ASM volatile ("strht %1, %0" : "=Q" (*addr) : "r" ((uint32_t)value) ); -} - - -/** - \brief STRT Unprivileged (32 bit) - \details Executes a Unprivileged STRT instruction for 32 bit values. - \param [in] value Value to store - \param [in] ptr Pointer to location - */ -__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *addr) -{ - __ASM volatile ("strt %1, %0" : "=Q" (*addr) : "r" (value) ); -} - -#endif /* (__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U) */ - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -#if (__CORTEX_M >= 0x04U) /* only for Cortex-M4 and above */ - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#define __SSAT16(ARG1,ARG2) \ -({ \ - int32_t __RES, __ARG1 = (ARG1); \ - __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -#define __USAT16(ARG1,ARG2) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1); \ - __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ - __RES; \ - }) - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) -{ - uint32_t result; - - __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) -{ - uint32_t result; - - __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) -{ - union llreg_u{ - uint32_t w32[2]; - uint64_t w64; - } llr; - llr.w64 = acc; - -#ifndef __ARMEB__ /* Little endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); -#else /* Big endian */ - __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); -#endif - - return(llr.w64); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SEL (uint32_t op1, uint32_t op2) -{ - uint32_t result; - - __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE int32_t __QADD( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -__attribute__( ( always_inline ) ) __STATIC_INLINE int32_t __QSUB( int32_t op1, int32_t op2) -{ - int32_t result; - - __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); - return(result); -} - -#define __PKHBT(ARG1,ARG2,ARG3) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - -#define __PKHTB(ARG1,ARG2,ARG3) \ -({ \ - uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ - if (ARG3 == 0) \ - __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ - else \ - __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ - __RES; \ - }) - -__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) -{ - int32_t result; - - __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); - return(result); -} - -#endif /* (__CORTEX_M >= 0x04) */ -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#if defined ( __GNUC__ ) -#pragma GCC diagnostic pop -#endif - -#endif /* __CMSIS_GCC_H */ diff --git a/third_party/NordicSemiconductor/cmsis/core_cm4.h b/third_party/NordicSemiconductor/cmsis/core_cm4.h deleted file mode 100644 index d02b11136..000000000 --- a/third_party/NordicSemiconductor/cmsis/core_cm4.h +++ /dev/null @@ -1,1937 +0,0 @@ -/**************************************************************************//** - * @file core_cm4.h - * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CM4_H_GENERIC -#define __CORE_CM4_H_GENERIC - -#include - -#ifdef __cplusplus - extern "C" { -#endif - -/** - \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions - CMSIS violates the following MISRA-C:2004 rules: - - \li Required Rule 8.5, object/function definition in header file.
- Function definitions in header files are used to allow 'inlining'. - - \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
- Unions are used for effective representation of core registers. - - \li Advisory Rule 19.7, Function-like macro defined.
- Function-like macros are used to allow more efficient code. - */ - - -/******************************************************************************* - * CMSIS definitions - ******************************************************************************/ -/** - \ingroup Cortex_M4 - @{ - */ - -/* CMSIS CM4 definitions */ -#define __CM4_CMSIS_VERSION_MAIN (0x04U) /*!< [31:16] CMSIS HAL main version */ -#define __CM4_CMSIS_VERSION_SUB (0x1EU) /*!< [15:0] CMSIS HAL sub version */ -#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16U) | \ - __CM4_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ - -#define __CORTEX_M (0x04U) /*!< Cortex-M Core */ - - -#if defined ( __CC_ARM ) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #define __ASM __asm /*!< asm keyword for ARM Compiler */ - #define __INLINE __inline /*!< inline keyword for ARM Compiler */ - #define __STATIC_INLINE static __inline - -#elif defined ( __GNUC__ ) - #define __ASM __asm /*!< asm keyword for GNU Compiler */ - #define __INLINE inline /*!< inline keyword for GNU Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __ICCARM__ ) - #define __ASM __asm /*!< asm keyword for IAR Compiler */ - #define __INLINE inline /*!< inline keyword for IAR Compiler. Only available in High optimization mode! */ - #define __STATIC_INLINE static inline - -#elif defined ( __TMS470__ ) - #define __ASM __asm /*!< asm keyword for TI CCS Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __TASKING__ ) - #define __ASM __asm /*!< asm keyword for TASKING Compiler */ - #define __INLINE inline /*!< inline keyword for TASKING Compiler */ - #define __STATIC_INLINE static inline - -#elif defined ( __CSMC__ ) - #define __packed - #define __ASM _asm /*!< asm keyword for COSMIC Compiler */ - #define __INLINE inline /*!< inline keyword for COSMIC Compiler. Use -pc99 on compile line */ - #define __STATIC_INLINE static inline - -#else - #error Unknown compiler -#endif - -/** __FPU_USED indicates whether an FPU is used or not. - For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. -*/ -#if defined ( __CC_ARM ) - #if defined __TARGET_FPU_VFP - #if (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #if defined __ARM_PCS_VFP - #if (__FPU_PRESENT == 1) - #define __FPU_USED 1U - #else - #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#elif defined ( __GNUC__ ) - #if defined (__VFP_FP__) && !defined(__SOFTFP__) - #if (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#elif defined ( __ICCARM__ ) - #if defined __ARMVFP__ - #if (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#elif defined ( __TMS470__ ) - #if defined __TI_VFP_SUPPORT__ - #if (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#elif defined ( __TASKING__ ) - #if defined __FPU_VFP__ - #if (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#elif defined ( __CSMC__ ) - #if ( __CSMC__ & 0x400U) - #if (__FPU_PRESENT == 1U) - #define __FPU_USED 1U - #else - #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" - #define __FPU_USED 0U - #endif - #else - #define __FPU_USED 0U - #endif - -#endif - -#include "core_cmInstr.h" /* Core Instruction Access */ -#include "core_cmFunc.h" /* Core Function Access */ -#include "core_cmSimd.h" /* Compiler specific SIMD Intrinsics */ - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM4_H_GENERIC */ - -#ifndef __CMSIS_GENERIC - -#ifndef __CORE_CM4_H_DEPENDANT -#define __CORE_CM4_H_DEPENDANT - -#ifdef __cplusplus - extern "C" { -#endif - -/* check device defines and use defaults */ -#if defined __CHECK_DEVICE_DEFINES - #ifndef __CM4_REV - #define __CM4_REV 0x0000U - #warning "__CM4_REV not defined in device header file; using default!" - #endif - - #ifndef __FPU_PRESENT - #define __FPU_PRESENT 0U - #warning "__FPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __MPU_PRESENT - #define __MPU_PRESENT 0U - #warning "__MPU_PRESENT not defined in device header file; using default!" - #endif - - #ifndef __NVIC_PRIO_BITS - #define __NVIC_PRIO_BITS 4U - #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" - #endif - - #ifndef __Vendor_SysTickConfig - #define __Vendor_SysTickConfig 0U - #warning "__Vendor_SysTickConfig not defined in device header file; using default!" - #endif -#endif - -/* IO definitions (access restrictions to peripheral registers) */ -/** - \defgroup CMSIS_glob_defs CMSIS Global Defines - - IO Type Qualifiers are used - \li to specify the access to peripheral variables. - \li for automatic generation of peripheral register debug information. -*/ -#ifdef __cplusplus - #define __I volatile /*!< Defines 'read only' permissions */ -#else - #define __I volatile const /*!< Defines 'read only' permissions */ -#endif -#define __O volatile /*!< Defines 'write only' permissions */ -#define __IO volatile /*!< Defines 'read / write' permissions */ - -/* following defines should be used for structure members */ -#define __IM volatile const /*! Defines 'read only' structure member permissions */ -#define __OM volatile /*! Defines 'write only' structure member permissions */ -#define __IOM volatile /*! Defines 'read / write' structure member permissions */ - -/*@} end of group Cortex_M4 */ - - - -/******************************************************************************* - * Register Abstraction - Core Register contain: - - Core Register - - Core NVIC Register - - Core SCB Register - - Core SysTick Register - - Core Debug Register - - Core MPU Register - - Core FPU Register - ******************************************************************************/ -/** - \defgroup CMSIS_core_register Defines and Type Definitions - \brief Type definitions and defines for Cortex-M processor based devices. -*/ - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_CORE Status and Control Registers - \brief Core Register type definitions. - @{ - */ - -/** - \brief Union type to access the Application Program Status Register (APSR). - */ -typedef union -{ - struct - { - uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ - uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ - uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} APSR_Type; - -/* APSR Register Definitions */ -#define APSR_N_Pos 31U /*!< APSR: N Position */ -#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ - -#define APSR_Z_Pos 30U /*!< APSR: Z Position */ -#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ - -#define APSR_C_Pos 29U /*!< APSR: C Position */ -#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ - -#define APSR_V_Pos 28U /*!< APSR: V Position */ -#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ - -#define APSR_Q_Pos 27U /*!< APSR: Q Position */ -#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ - -#define APSR_GE_Pos 16U /*!< APSR: GE Position */ -#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ - - -/** - \brief Union type to access the Interrupt Program Status Register (IPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} IPSR_Type; - -/* IPSR Register Definitions */ -#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ - - -/** - \brief Union type to access the Special-Purpose Program Status Registers (xPSR). - */ -typedef union -{ - struct - { - uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ - uint32_t _reserved0:7; /*!< bit: 9..15 Reserved */ - uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ - uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ - uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ - uint32_t IT:2; /*!< bit: 25..26 saved IT state (read 0) */ - uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ - uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ - uint32_t C:1; /*!< bit: 29 Carry condition code flag */ - uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ - uint32_t N:1; /*!< bit: 31 Negative condition code flag */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} xPSR_Type; - -/* xPSR Register Definitions */ -#define xPSR_N_Pos 31U /*!< xPSR: N Position */ -#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ - -#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ -#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ - -#define xPSR_C_Pos 29U /*!< xPSR: C Position */ -#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ - -#define xPSR_V_Pos 28U /*!< xPSR: V Position */ -#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ - -#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ -#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ - -#define xPSR_IT_Pos 25U /*!< xPSR: IT Position */ -#define xPSR_IT_Msk (3UL << xPSR_IT_Pos) /*!< xPSR: IT Mask */ - -#define xPSR_T_Pos 24U /*!< xPSR: T Position */ -#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ - -#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ -#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ - -#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ -#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ - - -/** - \brief Union type to access the Control Registers (CONTROL). - */ -typedef union -{ - struct - { - uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ - uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ - uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */ - uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */ - } b; /*!< Structure used for bit access */ - uint32_t w; /*!< Type used for word access */ -} CONTROL_Type; - -/* CONTROL Register Definitions */ -#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ -#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ - -#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ -#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ - -#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ -#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ - -/*@} end of group CMSIS_CORE */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) - \brief Type definitions for the NVIC Registers - @{ - */ - -/** - \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). - */ -typedef struct -{ - __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ - uint32_t RESERVED0[24U]; - __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ - uint32_t RSERVED1[24U]; - __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ - uint32_t RESERVED2[24U]; - __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ - uint32_t RESERVED3[24U]; - __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ - uint32_t RESERVED4[56U]; - __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ - uint32_t RESERVED5[644U]; - __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ -} NVIC_Type; - -/* Software Triggered Interrupt Register Definitions */ -#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ -#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ - -/*@} end of group CMSIS_NVIC */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SCB System Control Block (SCB) - \brief Type definitions for the System Control Block Registers - @{ - */ - -/** - \brief Structure type to access the System Control Block (SCB). - */ -typedef struct -{ - __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ - __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ - __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ - __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ - __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ - __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ - __IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ - __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ - __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ - __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ - __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ - __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ - __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ - __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ - __IM uint32_t PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ - __IM uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ - __IM uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ - __IM uint32_t MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ - __IM uint32_t ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ - uint32_t RESERVED0[5U]; - __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ -} SCB_Type; - -/* SCB CPUID Register Definitions */ -#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ -#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ - -#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ -#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ - -#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ -#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ - -#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ -#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ - -#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ -#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ - -/* SCB Interrupt Control State Register Definitions */ -#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ -#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ - -#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ -#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ - -#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ -#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ - -#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ -#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ - -#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ -#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ - -#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ -#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ - -#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ -#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ - -#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ -#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ - -#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ -#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ - -#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ -#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ - -/* SCB Vector Table Offset Register Definitions */ -#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ -#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ - -/* SCB Application Interrupt and Reset Control Register Definitions */ -#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ -#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ - -#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ -#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ - -#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ -#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ - -#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ -#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ - -#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ -#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ - -#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ -#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ - -#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ -#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ - -/* SCB System Control Register Definitions */ -#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ -#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ - -#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ -#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ - -#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ -#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ - -/* SCB Configuration Control Register Definitions */ -#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ -#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ - -#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ -#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ - -#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ -#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ - -#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ -#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ - -#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ -#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ - -#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ -#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ - -/* SCB System Handler Control and State Register Definitions */ -#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ -#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ - -#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ -#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ - -#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ -#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ - -#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ -#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ - -#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ -#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ - -#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ -#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ - -#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ -#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ - -#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ -#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ - -#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ -#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ - -#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ -#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ - -#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ -#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ - -#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ -#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ - -#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ -#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ - -#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ -#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ - -/* SCB Configurable Fault Status Register Definitions */ -#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ -#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ - -#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ -#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ - -#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ -#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ - -/* SCB Hard Fault Status Register Definitions */ -#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ -#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ - -#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ -#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ - -#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ -#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ - -/* SCB Debug Fault Status Register Definitions */ -#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ -#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ - -#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ -#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ - -#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ -#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ - -#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ -#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ - -#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ -#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ - -/*@} end of group CMSIS_SCB */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) - \brief Type definitions for the System Control and ID Register not in the SCB - @{ - */ - -/** - \brief Structure type to access the System Control and ID Register not in the SCB. - */ -typedef struct -{ - uint32_t RESERVED0[1U]; - __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ - __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ -} SCnSCB_Type; - -/* Interrupt Controller Type Register Definitions */ -#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ -#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ - -/* Auxiliary Control Register Definitions */ -#define SCnSCB_ACTLR_DISOOFP_Pos 9U /*!< ACTLR: DISOOFP Position */ -#define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) /*!< ACTLR: DISOOFP Mask */ - -#define SCnSCB_ACTLR_DISFPCA_Pos 8U /*!< ACTLR: DISFPCA Position */ -#define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) /*!< ACTLR: DISFPCA Mask */ - -#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ -#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ - -#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1U /*!< ACTLR: DISDEFWBUF Position */ -#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ - -#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ -#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ - -/*@} end of group CMSIS_SCnotSCB */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_SysTick System Tick Timer (SysTick) - \brief Type definitions for the System Timer Registers. - @{ - */ - -/** - \brief Structure type to access the System Timer (SysTick). - */ -typedef struct -{ - __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ - __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ - __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ - __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ -} SysTick_Type; - -/* SysTick Control / Status Register Definitions */ -#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ -#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ - -#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ -#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ - -#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ -#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ - -#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ -#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ - -/* SysTick Reload Register Definitions */ -#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ -#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ - -/* SysTick Current Register Definitions */ -#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ -#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ - -/* SysTick Calibration Register Definitions */ -#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ -#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ - -#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ -#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ - -#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ -#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ - -/*@} end of group CMSIS_SysTick */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) - \brief Type definitions for the Instrumentation Trace Macrocell (ITM) - @{ - */ - -/** - \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). - */ -typedef struct -{ - __OM union - { - __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ - __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ - __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ - } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ - uint32_t RESERVED0[864U]; - __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ - uint32_t RESERVED1[15U]; - __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ - uint32_t RESERVED2[15U]; - __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ - uint32_t RESERVED3[29U]; - __OM uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ - __IM uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ - __IOM uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ - uint32_t RESERVED4[43U]; - __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ - __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ - uint32_t RESERVED5[6U]; - __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ - __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ - __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ - __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ - __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ - __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ - __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ - __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ - __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ - __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ - __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ - __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ -} ITM_Type; - -/* ITM Trace Privilege Register Definitions */ -#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ -#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ - -/* ITM Trace Control Register Definitions */ -#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ -#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ - -#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ -#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ - -#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ -#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ - -#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ -#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ - -#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ -#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ - -#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ -#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ - -#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ -#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ - -#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ -#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ - -#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ -#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ - -/* ITM Integration Write Register Definitions */ -#define ITM_IWR_ATVALIDM_Pos 0U /*!< ITM IWR: ATVALIDM Position */ -#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ - -/* ITM Integration Read Register Definitions */ -#define ITM_IRR_ATREADYM_Pos 0U /*!< ITM IRR: ATREADYM Position */ -#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ - -/* ITM Integration Mode Control Register Definitions */ -#define ITM_IMCR_INTEGRATION_Pos 0U /*!< ITM IMCR: INTEGRATION Position */ -#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ - -/* ITM Lock Status Register Definitions */ -#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ -#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ - -#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ -#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ - -#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ -#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ - -/*@}*/ /* end of group CMSIS_ITM */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) - \brief Type definitions for the Data Watchpoint and Trace (DWT) - @{ - */ - -/** - \brief Structure type to access the Data Watchpoint and Trace Register (DWT). - */ -typedef struct -{ - __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ - __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ - __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ - __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ - __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ - __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ - __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ - __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ - __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ - __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ - __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ - uint32_t RESERVED0[1U]; - __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ - __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ - __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ - uint32_t RESERVED1[1U]; - __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ - __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ - __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ - uint32_t RESERVED2[1U]; - __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ - __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ - __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ -} DWT_Type; - -/* DWT Control Register Definitions */ -#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ -#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ - -#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ -#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ - -#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ -#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ - -#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ -#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ - -#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ -#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ - -#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ -#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ - -#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ -#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ - -#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ -#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ - -#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ -#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ - -#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ -#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ - -#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ -#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ - -#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ -#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ - -#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ -#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ - -#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ -#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ - -#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ -#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ - -#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ -#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ - -#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ -#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ - -#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ -#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ - -/* DWT CPI Count Register Definitions */ -#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ -#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ - -/* DWT Exception Overhead Count Register Definitions */ -#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ -#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ - -/* DWT Sleep Count Register Definitions */ -#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ -#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ - -/* DWT LSU Count Register Definitions */ -#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ -#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ - -/* DWT Folded-instruction Count Register Definitions */ -#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ -#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ - -/* DWT Comparator Mask Register Definitions */ -#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ -#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ - -/* DWT Comparator Function Register Definitions */ -#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ -#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ - -#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ -#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ - -#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ -#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ - -#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ -#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ - -#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ -#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ - -#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ -#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ - -#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ -#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ - -#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ -#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ - -#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ -#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ - -/*@}*/ /* end of group CMSIS_DWT */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_TPI Trace Port Interface (TPI) - \brief Type definitions for the Trace Port Interface (TPI) - @{ - */ - -/** - \brief Structure type to access the Trace Port Interface Register (TPI). - */ -typedef struct -{ - __IOM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ - __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ - uint32_t RESERVED0[2U]; - __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ - uint32_t RESERVED1[55U]; - __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ - uint32_t RESERVED2[131U]; - __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ - __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ - __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ - uint32_t RESERVED3[759U]; - __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */ - __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ - __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ - uint32_t RESERVED4[1U]; - __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ - __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ - __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ - uint32_t RESERVED5[39U]; - __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ - __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ - uint32_t RESERVED7[8U]; - __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ - __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ -} TPI_Type; - -/* TPI Asynchronous Clock Prescaler Register Definitions */ -#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ -#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ - -/* TPI Selected Pin Protocol Register Definitions */ -#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ -#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ - -/* TPI Formatter and Flush Status Register Definitions */ -#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ -#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ - -#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ -#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ - -#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ -#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ - -#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ -#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ - -/* TPI Formatter and Flush Control Register Definitions */ -#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ -#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ - -#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ -#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ - -/* TPI TRIGGER Register Definitions */ -#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ -#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ - -/* TPI Integration ETM Data Register Definitions (FIFO0) */ -#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ -#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ - -#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ -#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ - -#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ -#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ - -#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ -#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ - -#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ -#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ - -#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ -#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ - -#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ -#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ - -/* TPI ITATBCTR2 Register Definitions */ -#define TPI_ITATBCTR2_ATREADY_Pos 0U /*!< TPI ITATBCTR2: ATREADY Position */ -#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY_Pos*/) /*!< TPI ITATBCTR2: ATREADY Mask */ - -/* TPI Integration ITM Data Register Definitions (FIFO1) */ -#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ -#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ - -#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ -#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ - -#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ -#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ - -#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ -#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ - -#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ -#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ - -#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ -#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ - -#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ -#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ - -/* TPI ITATBCTR0 Register Definitions */ -#define TPI_ITATBCTR0_ATREADY_Pos 0U /*!< TPI ITATBCTR0: ATREADY Position */ -#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY_Pos*/) /*!< TPI ITATBCTR0: ATREADY Mask */ - -/* TPI Integration Mode Control Register Definitions */ -#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ -#define TPI_ITCTRL_Mode_Msk (0x1UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ - -/* TPI DEVID Register Definitions */ -#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ -#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ - -#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ -#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ - -#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ -#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ - -#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ -#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ - -#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ -#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ - -#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ -#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ - -/* TPI DEVTYPE Register Definitions */ -#define TPI_DEVTYPE_MajorType_Pos 4U /*!< TPI DEVTYPE: MajorType Position */ -#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ - -#define TPI_DEVTYPE_SubType_Pos 0U /*!< TPI DEVTYPE: SubType Position */ -#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ - -/*@}*/ /* end of group CMSIS_TPI */ - - -#if (__MPU_PRESENT == 1U) -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_MPU Memory Protection Unit (MPU) - \brief Type definitions for the Memory Protection Unit (MPU) - @{ - */ - -/** - \brief Structure type to access the Memory Protection Unit (MPU). - */ -typedef struct -{ - __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ - __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ - __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ - __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ - __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ - __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ - __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ - __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ - __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ - __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ - __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ -} MPU_Type; - -/* MPU Type Register Definitions */ -#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ -#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ - -#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ -#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ - -#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ -#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ - -/* MPU Control Register Definitions */ -#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ -#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ - -#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ -#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ - -#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ -#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ - -/* MPU Region Number Register Definitions */ -#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ -#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ - -/* MPU Region Base Address Register Definitions */ -#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ -#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ - -#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ -#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ - -#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ -#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ - -/* MPU Region Attribute and Size Register Definitions */ -#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ -#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ - -#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ -#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ - -#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ -#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ - -#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ -#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ - -#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ -#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ - -#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ -#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ - -#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ -#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ - -#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ -#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ - -#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ -#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ - -#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ -#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ - -/*@} end of group CMSIS_MPU */ -#endif - - -#if (__FPU_PRESENT == 1U) -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_FPU Floating Point Unit (FPU) - \brief Type definitions for the Floating Point Unit (FPU) - @{ - */ - -/** - \brief Structure type to access the Floating Point Unit (FPU). - */ -typedef struct -{ - uint32_t RESERVED0[1U]; - __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ - __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ - __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ - __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ - __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ -} FPU_Type; - -/* Floating-Point Context Control Register Definitions */ -#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ -#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ - -#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ -#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ - -#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ -#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ - -#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ -#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ - -#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ -#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ - -#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ -#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ - -#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ -#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ - -#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ -#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ - -#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ -#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ - -/* Floating-Point Context Address Register Definitions */ -#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ -#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ - -/* Floating-Point Default Status Control Register Definitions */ -#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ -#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ - -#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ -#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ - -#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ -#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ - -#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ -#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ - -/* Media and FP Feature Register 0 Definitions */ -#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ -#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ - -#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ -#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ - -#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ -#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ - -#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ -#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ - -#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ -#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ - -#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ -#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ - -#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ -#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ - -#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ -#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ - -/* Media and FP Feature Register 1 Definitions */ -#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ -#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ - -#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ -#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ - -#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ -#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ - -#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ -#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ - -/*@} end of group CMSIS_FPU */ -#endif - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) - \brief Type definitions for the Core Debug Registers - @{ - */ - -/** - \brief Structure type to access the Core Debug Register (CoreDebug). - */ -typedef struct -{ - __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ - __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ - __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ - __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ -} CoreDebug_Type; - -/* Debug Halting Control and Status Register Definitions */ -#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ -#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ - -#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ -#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ - -#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ -#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ - -#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ -#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ - -#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ -#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ - -#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ -#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ - -#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ -#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ - -#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ -#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ - -#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ -#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ - -#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ -#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ - -#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ -#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ - -#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ -#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ - -/* Debug Core Register Selector Register Definitions */ -#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ -#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ - -#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ -#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ - -/* Debug Exception and Monitor Control Register Definitions */ -#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ -#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ - -#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ -#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ - -#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ -#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ - -#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ -#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ - -#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ -#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ - -#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ -#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ - -#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ -#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ - -#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ -#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ - -#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ -#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ - -#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ -#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ - -#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ -#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ - -#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ -#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ - -#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ -#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ - -/*@} end of group CMSIS_CoreDebug */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_core_bitfield Core register bit field macros - \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). - @{ - */ - -/** - \brief Mask and shift a bit field value for use in a register bit range. - \param[in] field Name of the register bit field. - \param[in] value Value of the bit field. - \return Masked and shifted value. -*/ -#define _VAL2FLD(field, value) ((value << field ## _Pos) & field ## _Msk) - -/** - \brief Mask and shift a register value to extract a bit filed value. - \param[in] field Name of the register bit field. - \param[in] value Value of register. - \return Masked and shifted bit field value. -*/ -#define _FLD2VAL(field, value) ((value & field ## _Msk) >> field ## _Pos) - -/*@} end of group CMSIS_core_bitfield */ - - -/** - \ingroup CMSIS_core_register - \defgroup CMSIS_core_base Core Definitions - \brief Definitions for base addresses, unions, and structures. - @{ - */ - -/* Memory mapping of Cortex-M4 Hardware */ -#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ -#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ -#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ -#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ -#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ -#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ -#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ -#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ - -#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ -#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ -#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ -#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ -#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ -#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ -#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ -#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ - -#if (__MPU_PRESENT == 1U) - #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ - #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ -#endif - -#if (__FPU_PRESENT == 1U) - #define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ - #define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ -#endif - -/*@} */ - - - -/******************************************************************************* - * Hardware Abstraction Layer - Core Function Interface contains: - - Core NVIC Functions - - Core SysTick Functions - - Core Debug Functions - - Core Register Access Functions - ******************************************************************************/ -/** - \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference -*/ - - - -/* ########################## NVIC functions #################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_NVICFunctions NVIC Functions - \brief Functions that manage interrupts and exceptions via the NVIC. - @{ - */ - -/** - \brief Set Priority Grouping - \details Sets the priority grouping field using the required unlock sequence. - The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. - Only values from 0..7 are used. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - \param [in] PriorityGroup Priority grouping field. - */ -__STATIC_INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup) -{ - uint32_t reg_value; - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - - reg_value = SCB->AIRCR; /* read old register configuration */ - reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ - reg_value = (reg_value | - ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ - SCB->AIRCR = reg_value; -} - - -/** - \brief Get Priority Grouping - \details Reads the priority grouping field from the NVIC Interrupt Controller. - \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). - */ -__STATIC_INLINE uint32_t NVIC_GetPriorityGrouping(void) -{ - return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); -} - - -/** - \brief Enable External Interrupt - \details Enables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn) -{ - NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Disable External Interrupt - \details Disables a device-specific interrupt in the NVIC interrupt controller. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn) -{ - NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Pending Interrupt - \details Reads the pending register in the NVIC and returns the pending bit for the specified interrupt. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not pending. - \return 1 Interrupt status is pending. - */ -__STATIC_INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Pending Interrupt - \details Sets the pending bit of an external interrupt. - \param [in] IRQn Interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Clear Pending Interrupt - \details Clears the pending bit of an external interrupt. - \param [in] IRQn External interrupt number. Value cannot be negative. - */ -__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn) -{ - NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); -} - - -/** - \brief Get Active Interrupt - \details Reads the active register in NVIC and returns the active bit. - \param [in] IRQn Interrupt number. - \return 0 Interrupt status is not active. - \return 1 Interrupt status is active. - */ -__STATIC_INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn) -{ - return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); -} - - -/** - \brief Set Interrupt Priority - \details Sets the priority of an interrupt. - \note The priority cannot be set for every core interrupt. - \param [in] IRQn Interrupt number. - \param [in] priority Priority to set. - */ -__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) -{ - if ((int32_t)(IRQn) < 0) - { - SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } - else - { - NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); - } -} - - -/** - \brief Get Interrupt Priority - \details Reads the priority of an interrupt. - The interrupt number can be positive to specify an external (device specific) interrupt, - or negative to specify an internal (core) interrupt. - \param [in] IRQn Interrupt number. - \return Interrupt Priority. - Value is aligned automatically to the implemented priority bits of the microcontroller. - */ -__STATIC_INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn) -{ - - if ((int32_t)(IRQn) < 0) - { - return(((uint32_t)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); - } - else - { - return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); - } -} - - -/** - \brief Encode Priority - \details Encodes the priority for an interrupt with the given priority group, - preemptive priority value, and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. - \param [in] PriorityGroup Used priority group. - \param [in] PreemptPriority Preemptive priority value (starting from 0). - \param [in] SubPriority Subpriority value (starting from 0). - \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). - */ -__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - return ( - ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | - ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) - ); -} - - -/** - \brief Decode Priority - \details Decodes an interrupt priority value with a given priority group to - preemptive priority value and subpriority value. - In case of a conflict between priority grouping and available - priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. - \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). - \param [in] PriorityGroup Used priority group. - \param [out] pPreemptPriority Preemptive priority value (starting from 0). - \param [out] pSubPriority Subpriority value (starting from 0). - */ -__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) -{ - uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ - uint32_t PreemptPriorityBits; - uint32_t SubPriorityBits; - - PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); - SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); - - *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); - *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); -} - - -/** - \brief System Reset - \details Initiates a system reset request to reset the MCU. - */ -__STATIC_INLINE void NVIC_SystemReset(void) -{ - __DSB(); /* Ensure all outstanding memory accesses included - buffered write are completed before reset */ - SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | - (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | - SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ - __DSB(); /* Ensure completion of memory access */ - - for (;;) /* wait until reset */ - { - __NOP(); - } -} - -/*@} end of CMSIS_Core_NVICFunctions */ - - - -/* ################################## SysTick function ############################################ */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_SysTickFunctions SysTick Functions - \brief Functions that configure the System. - @{ - */ - -#if (__Vendor_SysTickConfig == 0U) - -/** - \brief System Tick Configuration - \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. - Counter is in free running mode to generate periodic interrupts. - \param [in] ticks Number of ticks between two interrupts. - \return 0 Function succeeded. - \return 1 Function failed. - \note When the variable __Vendor_SysTickConfig is set to 1, then the - function SysTick_Config is not included. In this case, the file device.h - must contain a vendor-specific implementation of this function. - */ -__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) -{ - if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) - { - return (1UL); /* Reload value impossible */ - } - - SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ - NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ - SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ - SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | - SysTick_CTRL_TICKINT_Msk | - SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ - return (0UL); /* Function successful */ -} - -#endif - -/*@} end of CMSIS_Core_SysTickFunctions */ - - - -/* ##################################### Debug In/Output function ########################################### */ -/** - \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_core_DebugFunctions ITM Functions - \brief Functions that access the ITM debug interface. - @{ - */ - -extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ -#define ITM_RXBUFFER_EMPTY 0x5AA55AA5U /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ - - -/** - \brief ITM Send Character - \details Transmits a character via the ITM channel 0, and - \li Just returns when no debugger is connected that has booked the output. - \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. - \param [in] ch Character to transmit. - \returns Character to transmit. - */ -__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) -{ - if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ - ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ - { - while (ITM->PORT[0U].u32 == 0UL) - { - __NOP(); - } - ITM->PORT[0U].u8 = (uint8_t)ch; - } - return (ch); -} - - -/** - \brief ITM Receive Character - \details Inputs a character via the external variable \ref ITM_RxBuffer. - \return Received character. - \return -1 No character pending. - */ -__STATIC_INLINE int32_t ITM_ReceiveChar (void) -{ - int32_t ch = -1; /* no character available */ - - if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) - { - ch = ITM_RxBuffer; - ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ - } - - return (ch); -} - - -/** - \brief ITM Check Character - \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. - \return 0 No character available. - \return 1 Character available. - */ -__STATIC_INLINE int32_t ITM_CheckChar (void) -{ - - if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) - { - return (0); /* no character available */ - } - else - { - return (1); /* character available */ - } -} - -/*@} end of CMSIS_core_DebugFunctions */ - - - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CM4_H_DEPENDANT */ - -#endif /* __CMSIS_GENERIC */ diff --git a/third_party/NordicSemiconductor/cmsis/core_cmFunc.h b/third_party/NordicSemiconductor/cmsis/core_cmFunc.h deleted file mode 100644 index 979696f50..000000000 --- a/third_party/NordicSemiconductor/cmsis/core_cmFunc.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************//** - * @file core_cmFunc.h - * @brief CMSIS Cortex-M Core Function Access Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMFUNC_H -#define __CORE_CMFUNC_H - - -/* ########################### Core Function Access ########################### */ -/** \ingroup CMSIS_Core_FunctionInterface - \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) - #include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) - #include - -/*------------------ TASKING Compiler ------------------*/ -#elif defined ( __TASKING__ ) - /* - * The CMSIS functions have been implemented as intrinsics in the compiler. - * Please use "carm -?i" to get an up to date list of all intrinsics, - * Including the CMSIS ones. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) - #include - -#endif - -/*@} end of CMSIS_Core_RegAccFunctions */ - -#endif /* __CORE_CMFUNC_H */ diff --git a/third_party/NordicSemiconductor/cmsis/core_cmInstr.h b/third_party/NordicSemiconductor/cmsis/core_cmInstr.h deleted file mode 100644 index f474b0e6f..000000000 --- a/third_party/NordicSemiconductor/cmsis/core_cmInstr.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************//** - * @file core_cmInstr.h - * @brief CMSIS Cortex-M Core Instruction Access Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMINSTR_H -#define __CORE_CMINSTR_H - - -/* ########################## Core Instruction Access ######################### */ -/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface - Access to dedicated instructions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) - #include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) - #include - -/*------------------ TASKING Compiler ------------------*/ -#elif defined ( __TASKING__ ) - /* - * The CMSIS functions have been implemented as intrinsics in the compiler. - * Please use "carm -?i" to get an up to date list of all intrinsics, - * Including the CMSIS ones. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) - #include - -#endif - -/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ - -#endif /* __CORE_CMINSTR_H */ diff --git a/third_party/NordicSemiconductor/cmsis/core_cmSimd.h b/third_party/NordicSemiconductor/cmsis/core_cmSimd.h deleted file mode 100644 index 66bf5c2a7..000000000 --- a/third_party/NordicSemiconductor/cmsis/core_cmSimd.h +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************//** - * @file core_cmSimd.h - * @brief CMSIS Cortex-M SIMD Header File - * @version V4.30 - * @date 20. October 2015 - ******************************************************************************/ -/* Copyright (c) 2009 - 2015 ARM LIMITED - - All rights reserved. - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of ARM nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - * - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - ---------------------------------------------------------------------------*/ - - -#if defined ( __ICCARM__ ) - #pragma system_include /* treat file as system include file for MISRA check */ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #pragma clang system_header /* treat file as system include file */ -#endif - -#ifndef __CORE_CMSIMD_H -#define __CORE_CMSIMD_H - -#ifdef __cplusplus - extern "C" { -#endif - - -/* ################### Compiler specific Intrinsics ########################### */ -/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics - Access to dedicated SIMD instructions - @{ -*/ - -/*------------------ RealView Compiler -----------------*/ -#if defined ( __CC_ARM ) - #include "cmsis_armcc.h" - -/*------------------ ARM Compiler V6 -------------------*/ -#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #include "cmsis_armcc_V6.h" - -/*------------------ GNU Compiler ----------------------*/ -#elif defined ( __GNUC__ ) - #include "cmsis_gcc.h" - -/*------------------ ICC Compiler ----------------------*/ -#elif defined ( __ICCARM__ ) - #include - -/*------------------ TI CCS Compiler -------------------*/ -#elif defined ( __TMS470__ ) - #include - -/*------------------ TASKING Compiler ------------------*/ -#elif defined ( __TASKING__ ) - /* - * The CMSIS functions have been implemented as intrinsics in the compiler. - * Please use "carm -?i" to get an up to date list of all intrinsics, - * Including the CMSIS ones. - */ - -/*------------------ COSMIC Compiler -------------------*/ -#elif defined ( __CSMC__ ) - #include - -#endif - -/*@} end of group CMSIS_SIMD_intrinsics */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __CORE_CMSIMD_H */ diff --git a/third_party/NordicSemiconductor/config/app_config.h b/third_party/NordicSemiconductor/config/app_config.h deleted file mode 100644 index 65f36bd6b..000000000 --- a/third_party/NordicSemiconductor/config/app_config.h +++ /dev/null @@ -1,258 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief This file provides OpenThread configuration of nRF5 SDK modules. - * - * Below configuration overwrites the default sdk_config.h file for certain platform. - * - * Default configuration for the vanilla OpenThread can be overwritten by the custom configuration. - * To do that, provide the configuration through the APP_CONFIG_CUSTOM_FILE define. - * - */ - -#ifndef APP_CONFIG_H -#define APP_CONFIG_H - -#if (USB_CDC_AS_SERIAL_TRANSPORT == 1) - -#ifndef APP_USBD_ENABLED -#define APP_USBD_ENABLED 1 -#endif - -#ifndef APP_USBD_VID -#define APP_USBD_VID 0x1915 -#endif - -#ifndef APP_USBD_PID -#define APP_USBD_PID 0xCAFE -#endif - -#ifndef APP_USBD_DEVICE_VER_MAJOR -#define APP_USBD_DEVICE_VER_MAJOR 1 -#endif - -#ifndef APP_USBD_DEVICE_VER_MINOR -#define APP_USBD_DEVICE_VER_MINOR 0 -#endif - -#ifndef APP_USBD_DEVICE_VER_SUB -#define APP_USBD_DEVICE_VER_SUB 0 -#endif - -#ifndef APP_USBD_CONFIG_MAX_POWER -#define APP_USBD_CONFIG_MAX_POWER 500 -#endif - -#ifndef APP_USBD_STRING_ID_PRODUCT -#define APP_USBD_STRING_ID_PRODUCT 2 -#endif - -#ifndef APP_USBD_STRINGS_PRODUCT_EXTERN -#define APP_USBD_STRINGS_PRODUCT_EXTERN 0 -#endif - -#ifndef APP_USBD_STRINGS_PRODUCT -#define APP_USBD_STRINGS_PRODUCT APP_USBD_STRING_DESC("nRF528xx OpenThread Device") -#endif - -#ifndef APP_USBD_STRING_ID_SERIAL -#define APP_USBD_STRING_ID_SERIAL 3 -#endif - -#ifndef APP_USBD_STRING_SERIAL_EXTERN -#define APP_USBD_STRING_SERIAL_EXTERN 1 -#endif - -#ifndef APP_USBD_STRING_SERIAL -#define APP_USBD_STRING_SERIAL g_extern_serial_number -#endif - -#ifndef APP_USBD_CONFIG_LOG_ENABLED -#define APP_USBD_CONFIG_LOG_ENABLED 0 -#endif - -#ifndef USBD_ENABLED -#define USBD_ENABLED 1 -#endif - -#ifndef NRFX_USBD_ENABLED -#define NRFX_USBD_ENABLED 1 -#endif - -#ifndef NRFX_USBD_CONFIG_IRQ_PRIORITY -#define NRFX_USBD_CONFIG_IRQ_PRIORITY 7 -#endif - -#ifndef NRFX_SYSTICK_ENABLED -#define NRFX_SYSTICK_ENABLED 1 -#endif - -#ifndef APP_USBD_CDC_ACM_ENABLED -#define APP_USBD_CDC_ACM_ENABLED 1 -#endif - -#endif // USB_CDC_AS_SERIAL_TRANSPORT == 1 - -#ifndef APP_USBD_NRF_DFU_TRIGGER_ENABLED -#define APP_USBD_NRF_DFU_TRIGGER_ENABLED 0 -#endif - -#ifndef BSP_SELF_PINRESET_PIN -#define BSP_SELF_PINRESET_PIN NRF_GPIO_PIN_MAP(0, 19) -#endif - -#ifndef NRF_DFU_TRIGGER_USB_USB_SHARED -#define NRF_DFU_TRIGGER_USB_USB_SHARED 1 -#endif - -#ifndef NRF_DFU_TRIGGER_USB_INTERFACE_NUM -#define NRF_DFU_TRIGGER_USB_INTERFACE_NUM 0 -#endif - -#ifndef APP_NAME -#define APP_NAME "OpenThread App" -#endif - -#ifndef APP_VERSION_MAJOR -#define APP_VERSION_MAJOR 1 -#endif - -#ifndef APP_VERSION_MINOR -#define APP_VERSION_MINOR 0 -#endif - -#ifndef APP_VERSION_PATCH -#define APP_VERSION_PATCH 0 -#endif - -#ifndef APP_ID -#define APP_ID 1 -#endif - -#ifndef APP_VERSION_PRERELEASE -#define APP_VERSION_PRERELEASE "" -#endif - -#ifndef APP_VERSION_METADATA -#define APP_VERSION_METADATA "" -#endif - -#ifndef SEGGER_RTT_CONFIG_BUFFER_SIZE_UP -#define SEGGER_RTT_CONFIG_BUFFER_SIZE_UP 512 -#endif - -#ifndef SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS -#define SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS 2 -#endif - -#ifndef SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN -#define SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN 16 -#endif - -#ifndef SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS -#define SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS 2 -#endif - -#ifndef SEGGER_RTT_CONFIG_DEFAULT_MODE -#define SEGGER_RTT_CONFIG_DEFAULT_MODE 0 -#endif - -#ifndef NRF_CLOCK_ENABLED -#define NRF_CLOCK_ENABLED 1 -#endif - -#ifndef CLOCK_CONFIG_LF_SRC -#define CLOCK_CONFIG_LF_SRC 1 -#endif - -#ifndef CLOCK_CONFIG_IRQ_PRIORITY -#define CLOCK_CONFIG_IRQ_PRIORITY 7 -#endif - -#if (USB_CDC_AS_SERIAL_TRANSPORT == 1) - -#ifndef POWER_ENABLED -#define POWER_ENABLED 1 -#endif - -#endif // USB_CDC_AS_SERIAL_TRANSPORT == 1 - -#ifndef POWER_CONFIG_IRQ_PRIORITY -#define POWER_CONFIG_IRQ_PRIORITY 7 -#endif - -#if (SPIS_AS_SERIAL_TRANSPORT == 1) - -#ifndef SPIS_ENABLED -#define SPIS_ENABLED 1 -#endif - -#ifndef SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 7 -#endif - -#ifndef SPIS0_ENABLED -#define SPIS0_ENABLED 1 -#endif - -#endif // SPIS_AS_SERIAL_TRANSPORT == 1 - -#ifndef NRFX_NVMC_ENABLED -#define NRFX_NVMC_ENABLED 1 -#endif - -#ifndef TIMER_ENABLED -#define TIMER_ENABLED 1 -#endif - -#ifndef TIMER0_ENABLED -#define TIMER0_ENABLED 1 -#endif - -#ifndef TIMER1_ENABLED -#define TIMER1_ENABLED 1 -#endif - -#ifndef TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 7 -#endif - -#endif // APP_CONFIG_H diff --git a/third_party/NordicSemiconductor/config/nrf52811/config/sdk_config.h b/third_party/NordicSemiconductor/config/nrf52811/config/sdk_config.h deleted file mode 100644 index 0fc903898..000000000 --- a/third_party/NordicSemiconductor/config/nrf52811/config/sdk_config.h +++ /dev/null @@ -1,10335 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - - - -#ifndef SDK_CONFIG_H -#define SDK_CONFIG_H -// <<< Use Configuration Wizard in Context Menu >>>\n -#ifdef USE_APP_CONFIG -#include "app_config.h" -#endif -// nRF_BLE - -//========================================================== -// BLE_ADVERTISING_ENABLED - ble_advertising - Advertising module - - -#ifndef BLE_ADVERTISING_ENABLED -#define BLE_ADVERTISING_ENABLED 0 -#endif - -// BLE_DTM_ENABLED - ble_dtm - Module for testing RF/PHY using DTM commands - - -#ifndef BLE_DTM_ENABLED -#define BLE_DTM_ENABLED 0 -#endif - -// BLE_RACP_ENABLED - ble_racp - Record Access Control Point library - - -#ifndef BLE_RACP_ENABLED -#define BLE_RACP_ENABLED 0 -#endif - -// NRF_BLE_QWR_ENABLED - nrf_ble_qwr - Queued writes support module (prepare/execute write) -//========================================================== -#ifndef NRF_BLE_QWR_ENABLED -#define NRF_BLE_QWR_ENABLED 0 -#endif -// NRF_BLE_QWR_MAX_ATTR - Maximum number of attribute handles that can be registered. This number must be adjusted according to the number of attributes for which Queued Writes will be enabled. If it is zero, the module will reject all Queued Write requests. -#ifndef NRF_BLE_QWR_MAX_ATTR -#define NRF_BLE_QWR_MAX_ATTR 0 -#endif - -// - -// PEER_MANAGER_ENABLED - peer_manager - Peer Manager -//========================================================== -#ifndef PEER_MANAGER_ENABLED -#define PEER_MANAGER_ENABLED 0 -#endif -// PM_MAX_REGISTRANTS - Number of event handlers that can be registered. -#ifndef PM_MAX_REGISTRANTS -#define PM_MAX_REGISTRANTS 3 -#endif - -// PM_FLASH_BUFFERS - Number of internal buffers for flash operations. -// Decrease this value to lower RAM usage. - -#ifndef PM_FLASH_BUFFERS -#define PM_FLASH_BUFFERS 4 -#endif - -// PM_CENTRAL_ENABLED - Enable/disable central-specific Peer Manager functionality. - - -// Enable/disable central-specific Peer Manager functionality. - -#ifndef PM_CENTRAL_ENABLED -#define PM_CENTRAL_ENABLED 1 -#endif - -// PM_SERVICE_CHANGED_ENABLED - Enable/disable the service changed management for GATT server in Peer Manager. - - -// If not using a GATT server, or using a server wihout a service changed characteristic, -// disable this to save code space. - -#ifndef PM_SERVICE_CHANGED_ENABLED -#define PM_SERVICE_CHANGED_ENABLED 1 -#endif - -// PM_PEER_RANKS_ENABLED - Enable/disable the peer rank management in Peer Manager. - - -// Set this to false to save code space if not using the peer rank API. - -#ifndef PM_PEER_RANKS_ENABLED -#define PM_PEER_RANKS_ENABLED 1 -#endif - -// PM_LESC_ENABLED - Enable/disable LESC support in Peer Manager. - - -// If set to true, you need to call nrf_ble_lesc_request_handler() in the main loop to respond to LESC-related BLE events. If LESC support is not required, set this to false to save code space. - -#ifndef PM_LESC_ENABLED -#define PM_LESC_ENABLED 0 -#endif - -// PM_RA_PROTECTION_ENABLED - Enable/disable protection against repeated pairing attempts in Peer Manager. -//========================================================== -#ifndef PM_RA_PROTECTION_ENABLED -#define PM_RA_PROTECTION_ENABLED 0 -#endif -// PM_RA_PROTECTION_TRACKED_PEERS_NUM - Maximum number of peers whose authorization status can be tracked. -#ifndef PM_RA_PROTECTION_TRACKED_PEERS_NUM -#define PM_RA_PROTECTION_TRACKED_PEERS_NUM 8 -#endif - -// PM_RA_PROTECTION_MIN_WAIT_INTERVAL - Minimum waiting interval (in ms) before a new pairing attempt can be initiated. -#ifndef PM_RA_PROTECTION_MIN_WAIT_INTERVAL -#define PM_RA_PROTECTION_MIN_WAIT_INTERVAL 4000 -#endif - -// PM_RA_PROTECTION_MAX_WAIT_INTERVAL - Maximum waiting interval (in ms) before a new pairing attempt can be initiated. -#ifndef PM_RA_PROTECTION_MAX_WAIT_INTERVAL -#define PM_RA_PROTECTION_MAX_WAIT_INTERVAL 64000 -#endif - -// PM_RA_PROTECTION_REWARD_PERIOD - Reward period (in ms). -// The waiting interval is gradually decreased when no new failed pairing attempts are made during reward period. - -#ifndef PM_RA_PROTECTION_REWARD_PERIOD -#define PM_RA_PROTECTION_REWARD_PERIOD 10000 -#endif - -// - -// PM_HANDLER_SEC_DELAY_MS - Delay before starting security. -// This might be necessary for interoperability reasons, especially as peripheral. - -#ifndef PM_HANDLER_SEC_DELAY_MS -#define PM_HANDLER_SEC_DELAY_MS 0 -#endif - -// - -// -//========================================================== - -// nRF_BLE_Services - -//========================================================== -// BLE_ANCS_C_ENABLED - ble_ancs_c - Apple Notification Service Client - - -#ifndef BLE_ANCS_C_ENABLED -#define BLE_ANCS_C_ENABLED 0 -#endif - -// BLE_ANS_C_ENABLED - ble_ans_c - Alert Notification Service Client - - -#ifndef BLE_ANS_C_ENABLED -#define BLE_ANS_C_ENABLED 0 -#endif - -// BLE_BAS_C_ENABLED - ble_bas_c - Battery Service Client - - -#ifndef BLE_BAS_C_ENABLED -#define BLE_BAS_C_ENABLED 0 -#endif - -// BLE_BAS_ENABLED - ble_bas - Battery Service -//========================================================== -#ifndef BLE_BAS_ENABLED -#define BLE_BAS_ENABLED 0 -#endif -// BLE_BAS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef BLE_BAS_CONFIG_LOG_ENABLED -#define BLE_BAS_CONFIG_LOG_ENABLED 0 -#endif -// BLE_BAS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef BLE_BAS_CONFIG_LOG_LEVEL -#define BLE_BAS_CONFIG_LOG_LEVEL 3 -#endif - -// BLE_BAS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_BAS_CONFIG_INFO_COLOR -#define BLE_BAS_CONFIG_INFO_COLOR 0 -#endif - -// BLE_BAS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_BAS_CONFIG_DEBUG_COLOR -#define BLE_BAS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// BLE_CSCS_ENABLED - ble_cscs - Cycling Speed and Cadence Service - - -#ifndef BLE_CSCS_ENABLED -#define BLE_CSCS_ENABLED 0 -#endif - -// BLE_CTS_C_ENABLED - ble_cts_c - Current Time Service Client - - -#ifndef BLE_CTS_C_ENABLED -#define BLE_CTS_C_ENABLED 0 -#endif - -// BLE_DIS_ENABLED - ble_dis - Device Information Service - - -#ifndef BLE_DIS_ENABLED -#define BLE_DIS_ENABLED 0 -#endif - -// BLE_GLS_ENABLED - ble_gls - Glucose Service - - -#ifndef BLE_GLS_ENABLED -#define BLE_GLS_ENABLED 0 -#endif - -// BLE_HIDS_ENABLED - ble_hids - Human Interface Device Service - - -#ifndef BLE_HIDS_ENABLED -#define BLE_HIDS_ENABLED 0 -#endif - -// BLE_HRS_C_ENABLED - ble_hrs_c - Heart Rate Service Client - - -#ifndef BLE_HRS_C_ENABLED -#define BLE_HRS_C_ENABLED 0 -#endif - -// BLE_HRS_ENABLED - ble_hrs - Heart Rate Service - - -#ifndef BLE_HRS_ENABLED -#define BLE_HRS_ENABLED 0 -#endif - -// BLE_HTS_ENABLED - ble_hts - Health Thermometer Service - - -#ifndef BLE_HTS_ENABLED -#define BLE_HTS_ENABLED 0 -#endif - -// BLE_IAS_C_ENABLED - ble_ias_c - Immediate Alert Service Client - - -#ifndef BLE_IAS_C_ENABLED -#define BLE_IAS_C_ENABLED 0 -#endif - -// BLE_IAS_ENABLED - ble_ias - Immediate Alert Service -//========================================================== -#ifndef BLE_IAS_ENABLED -#define BLE_IAS_ENABLED 0 -#endif -// BLE_IAS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef BLE_IAS_CONFIG_LOG_ENABLED -#define BLE_IAS_CONFIG_LOG_ENABLED 0 -#endif -// BLE_IAS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef BLE_IAS_CONFIG_LOG_LEVEL -#define BLE_IAS_CONFIG_LOG_LEVEL 3 -#endif - -// BLE_IAS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_IAS_CONFIG_INFO_COLOR -#define BLE_IAS_CONFIG_INFO_COLOR 0 -#endif - -// BLE_IAS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_IAS_CONFIG_DEBUG_COLOR -#define BLE_IAS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// BLE_LBS_C_ENABLED - ble_lbs_c - Nordic LED Button Service Client - - -#ifndef BLE_LBS_C_ENABLED -#define BLE_LBS_C_ENABLED 0 -#endif - -// BLE_LBS_ENABLED - ble_lbs - LED Button Service - - -#ifndef BLE_LBS_ENABLED -#define BLE_LBS_ENABLED 0 -#endif - -// BLE_LLS_ENABLED - ble_lls - Link Loss Service - - -#ifndef BLE_LLS_ENABLED -#define BLE_LLS_ENABLED 0 -#endif - -// BLE_NUS_C_ENABLED - ble_nus_c - Nordic UART Central Service - - -#ifndef BLE_NUS_C_ENABLED -#define BLE_NUS_C_ENABLED 0 -#endif - -// BLE_NUS_ENABLED - ble_nus - Nordic UART Service -//========================================================== -#ifndef BLE_NUS_ENABLED -#define BLE_NUS_ENABLED 0 -#endif -// BLE_NUS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef BLE_NUS_CONFIG_LOG_ENABLED -#define BLE_NUS_CONFIG_LOG_ENABLED 0 -#endif -// BLE_NUS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef BLE_NUS_CONFIG_LOG_LEVEL -#define BLE_NUS_CONFIG_LOG_LEVEL 3 -#endif - -// BLE_NUS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_NUS_CONFIG_INFO_COLOR -#define BLE_NUS_CONFIG_INFO_COLOR 0 -#endif - -// BLE_NUS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_NUS_CONFIG_DEBUG_COLOR -#define BLE_NUS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// BLE_RSCS_C_ENABLED - ble_rscs_c - Running Speed and Cadence Client - - -#ifndef BLE_RSCS_C_ENABLED -#define BLE_RSCS_C_ENABLED 0 -#endif - -// BLE_RSCS_ENABLED - ble_rscs - Running Speed and Cadence Service - - -#ifndef BLE_RSCS_ENABLED -#define BLE_RSCS_ENABLED 0 -#endif - -// BLE_TPS_ENABLED - ble_tps - TX Power Service - - -#ifndef BLE_TPS_ENABLED -#define BLE_TPS_ENABLED 0 -#endif - -// -//========================================================== - -// nRF_Core - -//========================================================== -// NRF_MPU_LIB_ENABLED - nrf_mpu_lib - Module for MPU -//========================================================== -#ifndef NRF_MPU_LIB_ENABLED -#define NRF_MPU_LIB_ENABLED 0 -#endif -// NRF_MPU_LIB_CLI_CMDS - Enable CLI commands specific to the module. - - -#ifndef NRF_MPU_LIB_CLI_CMDS -#define NRF_MPU_LIB_CLI_CMDS 0 -#endif - -// - -// NRF_STACK_GUARD_ENABLED - nrf_stack_guard - Stack guard -//========================================================== -#ifndef NRF_STACK_GUARD_ENABLED -#define NRF_STACK_GUARD_ENABLED 0 -#endif -// NRF_STACK_GUARD_CONFIG_SIZE - Size of the stack guard. - -// <5=> 32 bytes -// <6=> 64 bytes -// <7=> 128 bytes -// <8=> 256 bytes -// <9=> 512 bytes -// <10=> 1024 bytes -// <11=> 2048 bytes -// <12=> 4096 bytes - -#ifndef NRF_STACK_GUARD_CONFIG_SIZE -#define NRF_STACK_GUARD_CONFIG_SIZE 7 -#endif - -// - -// -//========================================================== - -// nRF_Crypto - -//========================================================== -// NRF_CRYPTO_ENABLED - nrf_crypto - Cryptography library. -//========================================================== -#ifndef NRF_CRYPTO_ENABLED -#define NRF_CRYPTO_ENABLED 1 -#endif -// NRF_CRYPTO_ALLOCATOR - Memory allocator - - -// Choose memory allocator used by nrf_crypto. Default is alloca if possible or nrf_malloc otherwise. If 'User macros' are selected, the user has to create 'nrf_crypto_allocator.h' file that contains NRF_CRYPTO_ALLOC, NRF_CRYPTO_FREE, and NRF_CRYPTO_ALLOC_ON_STACK. -// <0=> Default -// <1=> User macros -// <2=> On stack (alloca) -// <3=> C dynamic memory (malloc) -// <4=> SDK Memory Manager (nrf_malloc) - -#ifndef NRF_CRYPTO_ALLOCATOR -#define NRF_CRYPTO_ALLOCATOR 0 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_ENABLED - Enable the ARM Cryptocell CC310 reduced backend. - -// The CC310 hardware-accelerated cryptography backend with reduced functionality and footprint (only available on nRF52840). -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED - Enable the secp224r1 elliptic curve support using CC310_BL. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED 0 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED - Enable the secp256r1 elliptic curve support using CC310_BL. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED - CC310_BL SHA-256 hash functionality. - - -// CC310_BL backend implementation for hardware-accelerated SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED - nrf_cc310_bl buffers to RAM before running hash operation - - -// Enabling this makes hashing of addresses in FLASH range possible. Size of buffer allocated for hashing is set by NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED 0 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE - nrf_cc310_bl hash outputs digests in little endian -// Makes the nrf_cc310_bl hash functions output digests in little endian format. Only for use in nRF SDK DFU! - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE -#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE 4096 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED - Enable Interrupts while support using CC310 bl. - - -// Select a library version compatible with the configuration. When interrupts are disable, a version named _noint must be used - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_CC310_ENABLED - Enable the ARM Cryptocell CC310 backend. - -// The CC310 hardware-accelerated cryptography backend (only available on nRF52840). -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_CC310_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED - Enable the AES CBC mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED - Enable the AES CTR mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED - Enable the AES ECB mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED - Enable the AES CBC_MAC mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED - Enable the AES CMAC mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED - Enable the AES CCM mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED - Enable the AES CCM* mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED - Enable the CHACHA-POLY mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED - Enable the secp160r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED - Enable the secp160r2 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED - Enable the secp192r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED - Enable the secp224r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED - Enable the secp256r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED - Enable the secp384r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED - Enable the secp521r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED - Enable the secp160k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED - Enable the secp192k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED - Enable the secp224k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED - Enable the secp256k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED - Enable the Curve25519 curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED - Enable the Ed25519 curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED - CC310 SHA-256 hash functionality. - - -// CC310 backend implementation for hardware-accelerated SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED - CC310 SHA-512 hash functionality - - -// CC310 backend implementation for SHA-512 (in software). - -#ifndef NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED - CC310 HMAC using SHA-256 - - -// CC310 backend implementation for HMAC using hardware-accelerated SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED - CC310 HMAC using SHA-512 - - -// CC310 backend implementation for HMAC using SHA-512 (in software). - -#ifndef NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED - Enable RNG support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED - Enable Interrupts while support using CC310. - - -// Select a library version compatible with the configuration. When interrupts are disable, a version named _noint must be used - -#ifndef NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_CIFRA_ENABLED - Enable the Cifra backend. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_CIFRA_ENABLED -#define NRF_CRYPTO_BACKEND_CIFRA_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED - Enable the AES EAX mode using Cifra. - - -#ifndef NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED -#define NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED - Enable the mbed TLS backend. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED - Enable the AES CBC mode mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED - Enable the AES CTR mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED - Enable the AES CFB mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED - Enable the AES ECB mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED - Enable the AES CBC MAC mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED - Enable the AES CMAC mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED - Enable the AES CCM mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED - Enable the AES GCM mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED - Enable secp192r1 (NIST 192-bit) curve - - -// Enable this setting if you need secp192r1 (NIST 192-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED - Enable secp224r1 (NIST 224-bit) curve - - -// Enable this setting if you need secp224r1 (NIST 224-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED - Enable secp256r1 (NIST 256-bit) curve - - -// Enable this setting if you need secp256r1 (NIST 256-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED - Enable secp384r1 (NIST 384-bit) curve - - -// Enable this setting if you need secp384r1 (NIST 384-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED - Enable secp521r1 (NIST 521-bit) curve - - -// Enable this setting if you need secp521r1 (NIST 521-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED - Enable secp192k1 (Koblitz 192-bit) curve - - -// Enable this setting if you need secp192k1 (Koblitz 192-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED - Enable secp224k1 (Koblitz 224-bit) curve - - -// Enable this setting if you need secp224k1 (Koblitz 224-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED - Enable secp256k1 (Koblitz 256-bit) curve - - -// Enable this setting if you need secp256k1 (Koblitz 256-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED - Enable bp256r1 (Brainpool 256-bit) curve - - -// Enable this setting if you need bp256r1 (Brainpool 256-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED - Enable bp384r1 (Brainpool 384-bit) curve - - -// Enable this setting if you need bp384r1 (Brainpool 384-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED - Enable bp512r1 (Brainpool 512-bit) curve - - -// Enable this setting if you need bp512r1 (Brainpool 512-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED - Enable Curve25519 curve - - -// Enable this setting if you need Curve25519 support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED - Enable mbed TLS SHA-256 hash functionality. - - -// mbed TLS backend implementation for SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED - Enable mbed TLS SHA-512 hash functionality. - - -// mbed TLS backend implementation for SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED - Enable mbed TLS HMAC using SHA-256. - - -// mbed TLS backend implementation for HMAC using SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED - Enable mbed TLS HMAC using SHA-512. - - -// mbed TLS backend implementation for HMAC using SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED - Enable the micro-ecc backend. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED - Enable secp192r1 (NIST 192-bit) curve - - -// Enable this setting if you need secp192r1 (NIST 192-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED - Enable secp224r1 (NIST 224-bit) curve - - -// Enable this setting if you need secp224r1 (NIST 224-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED - Enable secp256r1 (NIST 256-bit) curve - - -// Enable this setting if you need secp256r1 (NIST 256-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED - Enable secp256k1 (Koblitz 256-bit) curve - - -// Enable this setting if you need secp256k1 (Koblitz 256-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED - Enable the nRF HW RNG backend. - -// The nRF HW backend provide access to RNG peripheral in nRF5x devices. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED - Enable mbed TLS CTR-DRBG algorithm. - - -// Enable mbed TLS CTR-DRBG standardized by NIST (NIST SP 800-90A Rev. 1). The nRF HW RNG is used as an entropy source for seeding. - -#ifndef NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_NRF_SW_ENABLED - Enable the legacy nRFx sw for crypto. - -// The nRF SW cryptography backend (only used in bootloader context). -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_NRF_SW_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_SW_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED - nRF SW hash backend support for SHA-256 - - -// The nRF SW backend provide access to nRF SDK legacy hash implementation of SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_OBERON_ENABLED - Enable the Oberon backend - -// The Oberon backend -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_OBERON_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED - Enable the CHACHA-POLY mode using Oberon. - - -#ifndef NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED - Enable secp256r1 curve - - -// Enable this setting if you need secp256r1 curve support using Oberon library - -#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED - Enable Curve25519 ECDH - - -// Enable this setting if you need Curve25519 ECDH support using Oberon library - -#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED - Enable Ed25519 signature scheme - - -// Enable this setting if you need Ed25519 support using Oberon library - -#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED - Oberon SHA-256 hash functionality - - -// Oberon backend implementation for SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED - Oberon SHA-512 hash functionality - - -// Oberon backend implementation for SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED - Oberon HMAC using SHA-256 - - -// Oberon backend implementation for HMAC using SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED - Oberon HMAC using SHA-512 - - -// Oberon backend implementation for HMAC using SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_OPTIGA_ENABLED - Enable the nrf_crypto Optiga Trust X backend. - -// Enables the nrf_crypto backend for Optiga Trust X devices. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_OPTIGA_ENABLED -#define NRF_CRYPTO_BACKEND_OPTIGA_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED - Optiga backend support for RNG - - -// The Optiga backend provide external chip RNG. - -#ifndef NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED -#define NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED 0 -#endif - -// NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED - Optiga backend support for ECC secp256r1 - - -// The Optiga backend provide external chip ECC using secp256r1. - -#ifndef NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED - Big-endian byte order in raw Curve25519 data - - -// Enable big-endian byte order in Curve25519 API, if set to 1. Use little-endian, if set to 0. - -#ifndef NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED -#define NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED 0 -#endif - -// - -// -//========================================================== - -// nRF_DFU - -//========================================================== -// ble_dfu - Device Firmware Update - -//========================================================== -// BLE_DFU_ENABLED - Enable DFU Service. - - -#ifndef BLE_DFU_ENABLED -#define BLE_DFU_ENABLED 0 -#endif - -// NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS - Buttonless DFU supports bonds. - - -#ifndef NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS -#define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 0 -#endif - -// -//========================================================== - -// -//========================================================== - -// nRF_Drivers - -//========================================================== -// COMP_ENABLED - nrf_drv_comp - COMP peripheral driver - legacy layer -//========================================================== -#ifndef COMP_ENABLED -#define COMP_ENABLED 0 -#endif -// COMP_CONFIG_REF - Reference voltage - -// <0=> Internal 1.2V -// <1=> Internal 1.8V -// <2=> Internal 2.4V -// <4=> VDD -// <7=> ARef - -#ifndef COMP_CONFIG_REF -#define COMP_CONFIG_REF 1 -#endif - -// COMP_CONFIG_MAIN_MODE - Main mode - -// <0=> Single ended -// <1=> Differential - -#ifndef COMP_CONFIG_MAIN_MODE -#define COMP_CONFIG_MAIN_MODE 0 -#endif - -// COMP_CONFIG_SPEED_MODE - Speed mode - -// <0=> Low power -// <1=> Normal -// <2=> High speed - -#ifndef COMP_CONFIG_SPEED_MODE -#define COMP_CONFIG_SPEED_MODE 2 -#endif - -// COMP_CONFIG_HYST - Hystheresis - -// <0=> No -// <1=> 50mV - -#ifndef COMP_CONFIG_HYST -#define COMP_CONFIG_HYST 0 -#endif - -// COMP_CONFIG_ISOURCE - Current Source - -// <0=> Off -// <1=> 2.5 uA -// <2=> 5 uA -// <3=> 10 uA - -#ifndef COMP_CONFIG_ISOURCE -#define COMP_CONFIG_ISOURCE 0 -#endif - -// COMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef COMP_CONFIG_INPUT -#define COMP_CONFIG_INPUT 0 -#endif - -// COMP_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef COMP_CONFIG_IRQ_PRIORITY -#define COMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// EGU_ENABLED - nrf_drv_swi - SWI(EGU) peripheral driver - legacy layer - - -#ifndef EGU_ENABLED -#define EGU_ENABLED 0 -#endif - -// GPIOTE_ENABLED - nrf_drv_gpiote - GPIOTE peripheral driver - legacy layer -//========================================================== -#ifndef GPIOTE_ENABLED -#define GPIOTE_ENABLED 0 -#endif -// GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins -#ifndef GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS -#define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1 -#endif - -// GPIOTE_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef GPIOTE_CONFIG_IRQ_PRIORITY -#define GPIOTE_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// I2S_ENABLED - nrf_drv_i2s - I2S peripheral driver - legacy layer -//========================================================== -#ifndef I2S_ENABLED -#define I2S_ENABLED 0 -#endif -// I2S_CONFIG_SCK_PIN - SCK pin <0-31> - - -#ifndef I2S_CONFIG_SCK_PIN -#define I2S_CONFIG_SCK_PIN 31 -#endif - -// I2S_CONFIG_LRCK_PIN - LRCK pin <1-31> - - -#ifndef I2S_CONFIG_LRCK_PIN -#define I2S_CONFIG_LRCK_PIN 30 -#endif - -// I2S_CONFIG_MCK_PIN - MCK pin -#ifndef I2S_CONFIG_MCK_PIN -#define I2S_CONFIG_MCK_PIN 255 -#endif - -// I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31> - - -#ifndef I2S_CONFIG_SDOUT_PIN -#define I2S_CONFIG_SDOUT_PIN 29 -#endif - -// I2S_CONFIG_SDIN_PIN - SDIN pin <0-31> - - -#ifndef I2S_CONFIG_SDIN_PIN -#define I2S_CONFIG_SDIN_PIN 28 -#endif - -// I2S_CONFIG_MASTER - Mode - -// <0=> Master -// <1=> Slave - -#ifndef I2S_CONFIG_MASTER -#define I2S_CONFIG_MASTER 0 -#endif - -// I2S_CONFIG_FORMAT - Format - -// <0=> I2S -// <1=> Aligned - -#ifndef I2S_CONFIG_FORMAT -#define I2S_CONFIG_FORMAT 0 -#endif - -// I2S_CONFIG_ALIGN - Alignment - -// <0=> Left -// <1=> Right - -#ifndef I2S_CONFIG_ALIGN -#define I2S_CONFIG_ALIGN 0 -#endif - -// I2S_CONFIG_SWIDTH - Sample width (bits) - -// <0=> 8 -// <1=> 16 -// <2=> 24 - -#ifndef I2S_CONFIG_SWIDTH -#define I2S_CONFIG_SWIDTH 1 -#endif - -// I2S_CONFIG_CHANNELS - Channels - -// <0=> Stereo -// <1=> Left -// <2=> Right - -#ifndef I2S_CONFIG_CHANNELS -#define I2S_CONFIG_CHANNELS 1 -#endif - -// I2S_CONFIG_MCK_SETUP - MCK behavior - -// <0=> Disabled -// <2147483648=> 32MHz/2 -// <1342177280=> 32MHz/3 -// <1073741824=> 32MHz/4 -// <805306368=> 32MHz/5 -// <671088640=> 32MHz/6 -// <536870912=> 32MHz/8 -// <402653184=> 32MHz/10 -// <369098752=> 32MHz/11 -// <285212672=> 32MHz/15 -// <268435456=> 32MHz/16 -// <201326592=> 32MHz/21 -// <184549376=> 32MHz/23 -// <142606336=> 32MHz/30 -// <138412032=> 32MHz/31 -// <134217728=> 32MHz/32 -// <100663296=> 32MHz/42 -// <68157440=> 32MHz/63 -// <34340864=> 32MHz/125 - -#ifndef I2S_CONFIG_MCK_SETUP -#define I2S_CONFIG_MCK_SETUP 536870912 -#endif - -// I2S_CONFIG_RATIO - MCK/LRCK ratio - -// <0=> 32x -// <1=> 48x -// <2=> 64x -// <3=> 96x -// <4=> 128x -// <5=> 192x -// <6=> 256x -// <7=> 384x -// <8=> 512x - -#ifndef I2S_CONFIG_RATIO -#define I2S_CONFIG_RATIO 2000 -#endif - -// I2S_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef I2S_CONFIG_IRQ_PRIORITY -#define I2S_CONFIG_IRQ_PRIORITY 6 -#endif - -// I2S_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef I2S_CONFIG_LOG_ENABLED -#define I2S_CONFIG_LOG_ENABLED 0 -#endif -// I2S_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef I2S_CONFIG_LOG_LEVEL -#define I2S_CONFIG_LOG_LEVEL 3 -#endif - -// I2S_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef I2S_CONFIG_INFO_COLOR -#define I2S_CONFIG_INFO_COLOR 0 -#endif - -// I2S_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef I2S_CONFIG_DEBUG_COLOR -#define I2S_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// LPCOMP_ENABLED - nrf_drv_lpcomp - LPCOMP peripheral driver - legacy layer -//========================================================== -#ifndef LPCOMP_ENABLED -#define LPCOMP_ENABLED 0 -#endif -// LPCOMP_CONFIG_REFERENCE - Reference voltage - -// <0=> Supply 1/8 -// <1=> Supply 2/8 -// <2=> Supply 3/8 -// <3=> Supply 4/8 -// <4=> Supply 5/8 -// <5=> Supply 6/8 -// <6=> Supply 7/8 -// <8=> Supply 1/16 (nRF52) -// <9=> Supply 3/16 (nRF52) -// <10=> Supply 5/16 (nRF52) -// <11=> Supply 7/16 (nRF52) -// <12=> Supply 9/16 (nRF52) -// <13=> Supply 11/16 (nRF52) -// <14=> Supply 13/16 (nRF52) -// <15=> Supply 15/16 (nRF52) -// <7=> External Ref 0 -// <65543=> External Ref 1 - -#ifndef LPCOMP_CONFIG_REFERENCE -#define LPCOMP_CONFIG_REFERENCE 3 -#endif - -// LPCOMP_CONFIG_DETECTION - Detection - -// <0=> Crossing -// <1=> Up -// <2=> Down - -#ifndef LPCOMP_CONFIG_DETECTION -#define LPCOMP_CONFIG_DETECTION 2 -#endif - -// LPCOMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef LPCOMP_CONFIG_INPUT -#define LPCOMP_CONFIG_INPUT 0 -#endif - -// LPCOMP_CONFIG_HYST - Hysteresis - - -#ifndef LPCOMP_CONFIG_HYST -#define LPCOMP_CONFIG_HYST 0 -#endif - -// LPCOMP_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef LPCOMP_CONFIG_IRQ_PRIORITY -#define LPCOMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// NRFX_CLOCK_ENABLED - nrfx_clock - CLOCK peripheral driver -//========================================================== -#ifndef NRFX_CLOCK_ENABLED -#define NRFX_CLOCK_ENABLED 0 -#endif -// NRFX_CLOCK_CONFIG_LF_SRC - LF Clock Source - -// <0=> RC -// <1=> XTAL -// <2=> Synth -// <131073=> External Low Swing -// <196609=> External Full Swing - -#ifndef NRFX_CLOCK_CONFIG_LF_SRC -#define NRFX_CLOCK_CONFIG_LF_SRC 1 -#endif - -// NRFX_CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_CLOCK_CONFIG_IRQ_PRIORITY -#define NRFX_CLOCK_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_CLOCK_CONFIG_LOG_ENABLED -#define NRFX_CLOCK_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_CLOCK_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_CLOCK_CONFIG_LOG_LEVEL -#define NRFX_CLOCK_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_CLOCK_CONFIG_INFO_COLOR -#define NRFX_CLOCK_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_CLOCK_CONFIG_DEBUG_COLOR -#define NRFX_CLOCK_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_COMP_ENABLED - nrfx_comp - COMP peripheral driver -//========================================================== -#ifndef NRFX_COMP_ENABLED -#define NRFX_COMP_ENABLED 0 -#endif -// NRFX_COMP_CONFIG_REF - Reference voltage - -// <0=> Internal 1.2V -// <1=> Internal 1.8V -// <2=> Internal 2.4V -// <4=> VDD -// <7=> ARef - -#ifndef NRFX_COMP_CONFIG_REF -#define NRFX_COMP_CONFIG_REF 1 -#endif - -// NRFX_COMP_CONFIG_MAIN_MODE - Main mode - -// <0=> Single ended -// <1=> Differential - -#ifndef NRFX_COMP_CONFIG_MAIN_MODE -#define NRFX_COMP_CONFIG_MAIN_MODE 0 -#endif - -// NRFX_COMP_CONFIG_SPEED_MODE - Speed mode - -// <0=> Low power -// <1=> Normal -// <2=> High speed - -#ifndef NRFX_COMP_CONFIG_SPEED_MODE -#define NRFX_COMP_CONFIG_SPEED_MODE 2 -#endif - -// NRFX_COMP_CONFIG_HYST - Hystheresis - -// <0=> No -// <1=> 50mV - -#ifndef NRFX_COMP_CONFIG_HYST -#define NRFX_COMP_CONFIG_HYST 0 -#endif - -// NRFX_COMP_CONFIG_ISOURCE - Current Source - -// <0=> Off -// <1=> 2.5 uA -// <2=> 5 uA -// <3=> 10 uA - -#ifndef NRFX_COMP_CONFIG_ISOURCE -#define NRFX_COMP_CONFIG_ISOURCE 0 -#endif - -// NRFX_COMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_COMP_CONFIG_INPUT -#define NRFX_COMP_CONFIG_INPUT 0 -#endif - -// NRFX_COMP_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_COMP_CONFIG_IRQ_PRIORITY -#define NRFX_COMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_COMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_COMP_CONFIG_LOG_ENABLED -#define NRFX_COMP_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_COMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_COMP_CONFIG_LOG_LEVEL -#define NRFX_COMP_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_COMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_COMP_CONFIG_INFO_COLOR -#define NRFX_COMP_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_COMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_COMP_CONFIG_DEBUG_COLOR -#define NRFX_COMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_GPIOTE_ENABLED - nrfx_gpiote - GPIOTE peripheral driver -//========================================================== -#ifndef NRFX_GPIOTE_ENABLED -#define NRFX_GPIOTE_ENABLED 0 -#endif -// NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins -#ifndef NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS -#define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1 -#endif - -// NRFX_GPIOTE_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_GPIOTE_CONFIG_IRQ_PRIORITY -#define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_GPIOTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_GPIOTE_CONFIG_LOG_ENABLED -#define NRFX_GPIOTE_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_GPIOTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_GPIOTE_CONFIG_LOG_LEVEL -#define NRFX_GPIOTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_GPIOTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_GPIOTE_CONFIG_INFO_COLOR -#define NRFX_GPIOTE_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_GPIOTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_GPIOTE_CONFIG_DEBUG_COLOR -#define NRFX_GPIOTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_PDM_ENABLED - nrfx_pdm - PDM peripheral driver -//========================================================== -#ifndef NRFX_PDM_ENABLED -#define NRFX_PDM_ENABLED 0 -#endif -// NRFX_PDM_CONFIG_MODE - Mode - -// <0=> Stereo -// <1=> Mono - -#ifndef NRFX_PDM_CONFIG_MODE -#define NRFX_PDM_CONFIG_MODE 1 -#endif - -// NRFX_PDM_CONFIG_EDGE - Edge - -// <0=> Left falling -// <1=> Left rising - -#ifndef NRFX_PDM_CONFIG_EDGE -#define NRFX_PDM_CONFIG_EDGE 0 -#endif - -// NRFX_PDM_CONFIG_CLOCK_FREQ - Clock frequency - -// <134217728=> 1000k -// <138412032=> 1032k (default) -// <142606336=> 1067k - -#ifndef NRFX_PDM_CONFIG_CLOCK_FREQ -#define NRFX_PDM_CONFIG_CLOCK_FREQ 138412032 -#endif - -// NRFX_PDM_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_PDM_CONFIG_IRQ_PRIORITY -#define NRFX_PDM_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_PDM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_PDM_CONFIG_LOG_ENABLED -#define NRFX_PDM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_PDM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_PDM_CONFIG_LOG_LEVEL -#define NRFX_PDM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_PDM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PDM_CONFIG_INFO_COLOR -#define NRFX_PDM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_PDM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PDM_CONFIG_DEBUG_COLOR -#define NRFX_PDM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_POWER_ENABLED - nrfx_power - POWER peripheral driver -//========================================================== -#ifndef NRFX_POWER_ENABLED -#define NRFX_POWER_ENABLED 1 -#endif -// NRFX_POWER_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_POWER_CONFIG_IRQ_PRIORITY -#define NRFX_POWER_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCEN -#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 0 -#endif - -// NRFX_POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCENHV -#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0 -#endif - -// - -// NRFX_PPI_ENABLED - nrfx_ppi - PPI peripheral allocator -//========================================================== -#ifndef NRFX_PPI_ENABLED -#define NRFX_PPI_ENABLED 0 -#endif -// NRFX_PPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_PPI_CONFIG_LOG_ENABLED -#define NRFX_PPI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_PPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_PPI_CONFIG_LOG_LEVEL -#define NRFX_PPI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_PPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PPI_CONFIG_INFO_COLOR -#define NRFX_PPI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_PPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PPI_CONFIG_DEBUG_COLOR -#define NRFX_PPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_PWM_ENABLED - nrfx_pwm - PWM peripheral driver -//========================================================== -#ifndef NRFX_PWM_ENABLED -#define NRFX_PWM_ENABLED 0 -#endif -// NRFX_PWM0_ENABLED - Enable PWM0 instance - - -#ifndef NRFX_PWM0_ENABLED -#define NRFX_PWM0_ENABLED 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK - Base clock - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz - -#ifndef NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK -#define NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK 4 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE - Count mode - -// <0=> Up -// <1=> Up and Down - -#ifndef NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE -#define NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE - Top value -#ifndef NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE -#define NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE 1000 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE - Load mode - -// <0=> Common -// <1=> Grouped -// <2=> Individual -// <3=> Waveform - -#ifndef NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE -#define NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_STEP_MODE - Step mode - -// <0=> Auto -// <1=> Triggered - -#ifndef NRFX_PWM_DEFAULT_CONFIG_STEP_MODE -#define NRFX_PWM_DEFAULT_CONFIG_STEP_MODE 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_PWM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_PWM_CONFIG_LOG_ENABLED -#define NRFX_PWM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_PWM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_PWM_CONFIG_LOG_LEVEL -#define NRFX_PWM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_PWM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PWM_CONFIG_INFO_COLOR -#define NRFX_PWM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_PWM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PWM_CONFIG_DEBUG_COLOR -#define NRFX_PWM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_QDEC_ENABLED - nrfx_qdec - QDEC peripheral driver -//========================================================== -#ifndef NRFX_QDEC_ENABLED -#define NRFX_QDEC_ENABLED 0 -#endif -// NRFX_QDEC_CONFIG_REPORTPER - Report period - -// <0=> 10 Samples -// <1=> 40 Samples -// <2=> 80 Samples -// <3=> 120 Samples -// <4=> 160 Samples -// <5=> 200 Samples -// <6=> 240 Samples -// <7=> 280 Samples - -#ifndef NRFX_QDEC_CONFIG_REPORTPER -#define NRFX_QDEC_CONFIG_REPORTPER 0 -#endif - -// NRFX_QDEC_CONFIG_SAMPLEPER - Sample period - -// <0=> 128 us -// <1=> 256 us -// <2=> 512 us -// <3=> 1024 us -// <4=> 2048 us -// <5=> 4096 us -// <6=> 8192 us -// <7=> 16384 us - -#ifndef NRFX_QDEC_CONFIG_SAMPLEPER -#define NRFX_QDEC_CONFIG_SAMPLEPER 7 -#endif - -// NRFX_QDEC_CONFIG_PIO_A - A pin <0-31> - - -#ifndef NRFX_QDEC_CONFIG_PIO_A -#define NRFX_QDEC_CONFIG_PIO_A 31 -#endif - -// NRFX_QDEC_CONFIG_PIO_B - B pin <0-31> - - -#ifndef NRFX_QDEC_CONFIG_PIO_B -#define NRFX_QDEC_CONFIG_PIO_B 31 -#endif - -// NRFX_QDEC_CONFIG_PIO_LED - LED pin <0-31> - - -#ifndef NRFX_QDEC_CONFIG_PIO_LED -#define NRFX_QDEC_CONFIG_PIO_LED 31 -#endif - -// NRFX_QDEC_CONFIG_LEDPRE - LED pre -#ifndef NRFX_QDEC_CONFIG_LEDPRE -#define NRFX_QDEC_CONFIG_LEDPRE 511 -#endif - -// NRFX_QDEC_CONFIG_LEDPOL - LED polarity - -// <0=> Active low -// <1=> Active high - -#ifndef NRFX_QDEC_CONFIG_LEDPOL -#define NRFX_QDEC_CONFIG_LEDPOL 1 -#endif - -// NRFX_QDEC_CONFIG_DBFEN - Debouncing enable - - -#ifndef NRFX_QDEC_CONFIG_DBFEN -#define NRFX_QDEC_CONFIG_DBFEN 0 -#endif - -// NRFX_QDEC_CONFIG_SAMPLE_INTEN - Sample ready interrupt enable - - -#ifndef NRFX_QDEC_CONFIG_SAMPLE_INTEN -#define NRFX_QDEC_CONFIG_SAMPLE_INTEN 0 -#endif - -// NRFX_QDEC_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_QDEC_CONFIG_IRQ_PRIORITY -#define NRFX_QDEC_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_QDEC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_QDEC_CONFIG_LOG_ENABLED -#define NRFX_QDEC_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_QDEC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_QDEC_CONFIG_LOG_LEVEL -#define NRFX_QDEC_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_QDEC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_QDEC_CONFIG_INFO_COLOR -#define NRFX_QDEC_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_QDEC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_QDEC_CONFIG_DEBUG_COLOR -#define NRFX_QDEC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_RNG_ENABLED - nrfx_rng - RNG peripheral driver -//========================================================== -#ifndef NRFX_RNG_ENABLED -#define NRFX_RNG_ENABLED 0 -#endif -// NRFX_RNG_CONFIG_ERROR_CORRECTION - Error correction - - -#ifndef NRFX_RNG_CONFIG_ERROR_CORRECTION -#define NRFX_RNG_CONFIG_ERROR_CORRECTION 1 -#endif - -// NRFX_RNG_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_RNG_CONFIG_IRQ_PRIORITY -#define NRFX_RNG_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_RNG_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_RNG_CONFIG_LOG_ENABLED -#define NRFX_RNG_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_RNG_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_RNG_CONFIG_LOG_LEVEL -#define NRFX_RNG_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_RNG_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RNG_CONFIG_INFO_COLOR -#define NRFX_RNG_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RNG_CONFIG_DEBUG_COLOR -#define NRFX_RNG_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_RTC_ENABLED - nrfx_rtc - RTC peripheral driver -//========================================================== -#ifndef NRFX_RTC_ENABLED -#define NRFX_RTC_ENABLED 0 -#endif -// NRFX_RTC0_ENABLED - Enable RTC0 instance - - -#ifndef NRFX_RTC0_ENABLED -#define NRFX_RTC0_ENABLED 0 -#endif - -// NRFX_RTC1_ENABLED - Enable RTC1 instance - - -#ifndef NRFX_RTC1_ENABLED -#define NRFX_RTC1_ENABLED 0 -#endif - -// NRFX_RTC_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt -#ifndef NRFX_RTC_MAXIMUM_LATENCY_US -#define NRFX_RTC_MAXIMUM_LATENCY_US 2000 -#endif - -// NRFX_RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768> - - -#ifndef NRFX_RTC_DEFAULT_CONFIG_FREQUENCY -#define NRFX_RTC_DEFAULT_CONFIG_FREQUENCY 32768 -#endif - -// NRFX_RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering - - -#ifndef NRFX_RTC_DEFAULT_CONFIG_RELIABLE -#define NRFX_RTC_DEFAULT_CONFIG_RELIABLE 0 -#endif - -// NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_RTC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_RTC_CONFIG_LOG_ENABLED -#define NRFX_RTC_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_RTC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_RTC_CONFIG_LOG_LEVEL -#define NRFX_RTC_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_RTC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RTC_CONFIG_INFO_COLOR -#define NRFX_RTC_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RTC_CONFIG_DEBUG_COLOR -#define NRFX_RTC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SAADC_ENABLED - nrfx_saadc - SAADC peripheral driver -//========================================================== -#ifndef NRFX_SAADC_ENABLED -#define NRFX_SAADC_ENABLED 0 -#endif -// NRFX_SAADC_CONFIG_RESOLUTION - Resolution - -// <0=> 8 bit -// <1=> 10 bit -// <2=> 12 bit -// <3=> 14 bit - -#ifndef NRFX_SAADC_CONFIG_RESOLUTION -#define NRFX_SAADC_CONFIG_RESOLUTION 1 -#endif - -// NRFX_SAADC_CONFIG_OVERSAMPLE - Sample period - -// <0=> Disabled -// <1=> 2x -// <2=> 4x -// <3=> 8x -// <4=> 16x -// <5=> 32x -// <6=> 64x -// <7=> 128x -// <8=> 256x - -#ifndef NRFX_SAADC_CONFIG_OVERSAMPLE -#define NRFX_SAADC_CONFIG_OVERSAMPLE 0 -#endif - -// NRFX_SAADC_CONFIG_LP_MODE - Enabling low power mode - - -#ifndef NRFX_SAADC_CONFIG_LP_MODE -#define NRFX_SAADC_CONFIG_LP_MODE 0 -#endif - -// NRFX_SAADC_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SAADC_CONFIG_IRQ_PRIORITY -#define NRFX_SAADC_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SAADC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SAADC_CONFIG_LOG_ENABLED -#define NRFX_SAADC_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SAADC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SAADC_CONFIG_LOG_LEVEL -#define NRFX_SAADC_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SAADC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SAADC_CONFIG_INFO_COLOR -#define NRFX_SAADC_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SAADC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SAADC_CONFIG_DEBUG_COLOR -#define NRFX_SAADC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SPIM_ENABLED - nrfx_spim - SPIM peripheral driver -//========================================================== -#ifndef NRFX_SPIM_ENABLED -#define NRFX_SPIM_ENABLED 0 -#endif -// NRFX_SPIM0_ENABLED - Enable SPIM0 instance - - -#ifndef NRFX_SPIM0_ENABLED -#define NRFX_SPIM0_ENABLED 0 -#endif - -// NRFX_SPIM1_ENABLED - Enable SPIM1 instance - - -#ifndef NRFX_SPIM1_ENABLED -#define NRFX_SPIM1_ENABLED 0 -#endif - -// NRFX_SPIM_MISO_PULL_CFG - MISO pin pull configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP - -#ifndef NRFX_SPIM_MISO_PULL_CFG -#define NRFX_SPIM_MISO_PULL_CFG 1 -#endif - -// NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SPIM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SPIM_CONFIG_LOG_ENABLED -#define NRFX_SPIM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SPIM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SPIM_CONFIG_LOG_LEVEL -#define NRFX_SPIM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SPIM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIM_CONFIG_INFO_COLOR -#define NRFX_SPIM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SPIM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIM_CONFIG_DEBUG_COLOR -#define NRFX_SPIM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SPIS_ENABLED - nrfx_spis - SPIS peripheral driver -//========================================================== -#ifndef NRFX_SPIS_ENABLED -#define NRFX_SPIS_ENABLED 0 -#endif -// NRFX_SPIS0_ENABLED - Enable SPIS0 instance - - -#ifndef NRFX_SPIS0_ENABLED -#define NRFX_SPIS0_ENABLED 0 -#endif - -// NRFX_SPIS1_ENABLED - Enable SPIS1 instance - - -#ifndef NRFX_SPIS1_ENABLED -#define NRFX_SPIS1_ENABLED 0 -#endif - -// NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SPIS_DEFAULT_DEF - SPIS default DEF character <0-255> - - -#ifndef NRFX_SPIS_DEFAULT_DEF -#define NRFX_SPIS_DEFAULT_DEF 255 -#endif - -// NRFX_SPIS_DEFAULT_ORC - SPIS default ORC character <0-255> - - -#ifndef NRFX_SPIS_DEFAULT_ORC -#define NRFX_SPIS_DEFAULT_ORC 255 -#endif - -// NRFX_SPIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SPIS_CONFIG_LOG_ENABLED -#define NRFX_SPIS_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SPIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SPIS_CONFIG_LOG_LEVEL -#define NRFX_SPIS_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SPIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIS_CONFIG_INFO_COLOR -#define NRFX_SPIS_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SPIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIS_CONFIG_DEBUG_COLOR -#define NRFX_SPIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SPI_ENABLED - nrfx_spi - SPI peripheral driver -//========================================================== -#ifndef NRFX_SPI_ENABLED -#define NRFX_SPI_ENABLED 0 -#endif -// NRFX_SPI0_ENABLED - Enable SPI0 instance - - -#ifndef NRFX_SPI0_ENABLED -#define NRFX_SPI0_ENABLED 0 -#endif - -// NRFX_SPI1_ENABLED - Enable SPI1 instance - - -#ifndef NRFX_SPI1_ENABLED -#define NRFX_SPI1_ENABLED 0 -#endif - -// NRFX_SPI_MISO_PULL_CFG - MISO pin pull configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP - -#ifndef NRFX_SPI_MISO_PULL_CFG -#define NRFX_SPI_MISO_PULL_CFG 1 -#endif - -// NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SPI_CONFIG_LOG_ENABLED -#define NRFX_SPI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SPI_CONFIG_LOG_LEVEL -#define NRFX_SPI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPI_CONFIG_INFO_COLOR -#define NRFX_SPI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPI_CONFIG_DEBUG_COLOR -#define NRFX_SPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SWI_ENABLED - nrfx_swi - SWI/EGU peripheral allocator -//========================================================== -#ifndef NRFX_SWI_ENABLED -#define NRFX_SWI_ENABLED 0 -#endif -// NRFX_EGU_ENABLED - Enable EGU support - - -#ifndef NRFX_EGU_ENABLED -#define NRFX_EGU_ENABLED 0 -#endif - -// NRFX_SWI0_DISABLED - Exclude SWI0 from being utilized by the driver - - -#ifndef NRFX_SWI0_DISABLED -#define NRFX_SWI0_DISABLED 0 -#endif - -// NRFX_SWI1_DISABLED - Exclude SWI1 from being utilized by the driver - - -#ifndef NRFX_SWI1_DISABLED -#define NRFX_SWI1_DISABLED 0 -#endif - -// NRFX_SWI2_DISABLED - Exclude SWI2 from being utilized by the driver - - -#ifndef NRFX_SWI2_DISABLED -#define NRFX_SWI2_DISABLED 0 -#endif - -// NRFX_SWI3_DISABLED - Exclude SWI3 from being utilized by the driver - - -#ifndef NRFX_SWI3_DISABLED -#define NRFX_SWI3_DISABLED 0 -#endif - -// NRFX_SWI4_DISABLED - Exclude SWI4 from being utilized by the driver - - -#ifndef NRFX_SWI4_DISABLED -#define NRFX_SWI4_DISABLED 0 -#endif - -// NRFX_SWI5_DISABLED - Exclude SWI5 from being utilized by the driver - - -#ifndef NRFX_SWI5_DISABLED -#define NRFX_SWI5_DISABLED 0 -#endif - -// NRFX_SWI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SWI_CONFIG_LOG_ENABLED -#define NRFX_SWI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SWI_CONFIG_LOG_LEVEL -#define NRFX_SWI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SWI_CONFIG_INFO_COLOR -#define NRFX_SWI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SWI_CONFIG_DEBUG_COLOR -#define NRFX_SWI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver -//========================================================== -#ifndef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED 0 -#endif -// NRFX_TIMER0_ENABLED - Enable TIMER0 instance - - -#ifndef NRFX_TIMER0_ENABLED -#define NRFX_TIMER0_ENABLED 0 -#endif - -// NRFX_TIMER1_ENABLED - Enable TIMER1 instance - - -#ifndef NRFX_TIMER1_ENABLED -#define NRFX_TIMER1_ENABLED 0 -#endif - -// NRFX_TIMER2_ENABLED - Enable TIMER2 instance - - -#ifndef NRFX_TIMER2_ENABLED -#define NRFX_TIMER2_ENABLED 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz -// <8=> 62.5 kHz -// <9=> 31.25 kHz - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation - -// <0=> Timer -// <1=> Counter - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_MODE -#define NRFX_TIMER_DEFAULT_CONFIG_MODE 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width - -// <0=> 16 bit -// <1=> 8 bit -// <2=> 24 bit -// <3=> 32 bit - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH -#define NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TIMER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TIMER_CONFIG_LOG_ENABLED -#define NRFX_TIMER_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TIMER_CONFIG_LOG_LEVEL -#define NRFX_TIMER_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TIMER_CONFIG_INFO_COLOR -#define NRFX_TIMER_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TIMER_CONFIG_DEBUG_COLOR -#define NRFX_TIMER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TWIM_ENABLED - nrfx_twim - TWIM peripheral driver -//========================================================== -#ifndef NRFX_TWIM_ENABLED -#define NRFX_TWIM_ENABLED 0 -#endif -// NRFX_TWIM0_ENABLED - Enable TWIM0 instance - - -#ifndef NRFX_TWIM0_ENABLED -#define NRFX_TWIM0_ENABLED 0 -#endif - -// NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k - -#ifndef NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY 26738688 -#endif - -// NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - - -#ifndef NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 -#endif - -// NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TWIM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TWIM_CONFIG_LOG_ENABLED -#define NRFX_TWIM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TWIM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TWIM_CONFIG_LOG_LEVEL -#define NRFX_TWIM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TWIM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIM_CONFIG_INFO_COLOR -#define NRFX_TWIM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TWIM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIM_CONFIG_DEBUG_COLOR -#define NRFX_TWIM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TWIS_ENABLED - nrfx_twis - TWIS peripheral driver -//========================================================== -#ifndef NRFX_TWIS_ENABLED -#define NRFX_TWIS_ENABLED 0 -#endif -// NRFX_TWIS0_ENABLED - Enable TWIS0 instance - - -#ifndef NRFX_TWIS0_ENABLED -#define NRFX_TWIS0_ENABLED 0 -#endif - -// NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY - Assume that any instance would be initialized only once - - -// Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code. - -#ifndef NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 -#endif - -// NRFX_TWIS_NO_SYNC_MODE - Remove support for synchronous mode - - -// Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources. - -#ifndef NRFX_TWIS_NO_SYNC_MODE -#define NRFX_TWIS_NO_SYNC_MODE 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_ADDR0 - Address0 -#ifndef NRFX_TWIS_DEFAULT_CONFIG_ADDR0 -#define NRFX_TWIS_DEFAULT_CONFIG_ADDR0 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_ADDR1 - Address1 -#ifndef NRFX_TWIS_DEFAULT_CONFIG_ADDR1 -#define NRFX_TWIS_DEFAULT_CONFIG_ADDR1 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL -#define NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL -#define NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TWIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TWIS_CONFIG_LOG_ENABLED -#define NRFX_TWIS_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TWIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TWIS_CONFIG_LOG_LEVEL -#define NRFX_TWIS_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TWIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIS_CONFIG_INFO_COLOR -#define NRFX_TWIS_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TWIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIS_CONFIG_DEBUG_COLOR -#define NRFX_TWIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TWI_ENABLED - nrfx_twi - TWI peripheral driver -//========================================================== -#ifndef NRFX_TWI_ENABLED -#define NRFX_TWI_ENABLED 0 -#endif -// NRFX_TWI0_ENABLED - Enable TWI0 instance - - -#ifndef NRFX_TWI0_ENABLED -#define NRFX_TWI0_ENABLED 0 -#endif - -// NRFX_TWI_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k - -#ifndef NRFX_TWI_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TWI_DEFAULT_CONFIG_FREQUENCY 26738688 -#endif - -// NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - - -#ifndef NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 -#endif - -// NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TWI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TWI_CONFIG_LOG_ENABLED -#define NRFX_TWI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TWI_CONFIG_LOG_LEVEL -#define NRFX_TWI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWI_CONFIG_INFO_COLOR -#define NRFX_TWI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWI_CONFIG_DEBUG_COLOR -#define NRFX_TWI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_UARTE_ENABLED - nrfx_uarte - UARTE peripheral driver -//========================================================== -#ifndef NRFX_UARTE_ENABLED -#define NRFX_UARTE_ENABLED 0 -#endif -// NRFX_UARTE0_ENABLED - Enable UARTE0 instance -#ifndef NRFX_UARTE0_ENABLED -#define NRFX_UARTE0_ENABLED 0 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_HWFC -#define NRFX_UARTE_DEFAULT_CONFIG_HWFC 0 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_PARITY -#define NRFX_UARTE_DEFAULT_CONFIG_PARITY 0 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <8388608=> 31250 baud -// <10289152=> 38400 baud -// <15007744=> 56000 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE -#define NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE 30801920 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_UARTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_UARTE_CONFIG_LOG_ENABLED -#define NRFX_UARTE_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_UARTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_UARTE_CONFIG_LOG_LEVEL -#define NRFX_UARTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_UARTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UARTE_CONFIG_INFO_COLOR -#define NRFX_UARTE_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_UARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UARTE_CONFIG_DEBUG_COLOR -#define NRFX_UARTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_UART_ENABLED - nrfx_uart - UART peripheral driver -//========================================================== -#ifndef NRFX_UART_ENABLED -#define NRFX_UART_ENABLED 0 -#endif -// NRFX_UART0_ENABLED - Enable UART0 instance -#ifndef NRFX_UART0_ENABLED -#define NRFX_UART0_ENABLED 0 -#endif - -// NRFX_UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef NRFX_UART_DEFAULT_CONFIG_HWFC -#define NRFX_UART_DEFAULT_CONFIG_HWFC 0 -#endif - -// NRFX_UART_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included - -#ifndef NRFX_UART_DEFAULT_CONFIG_PARITY -#define NRFX_UART_DEFAULT_CONFIG_PARITY 0 -#endif - -// NRFX_UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3866624=> 14400 baud -// <5152768=> 19200 baud -// <7729152=> 28800 baud -// <8388608=> 31250 baud -// <10309632=> 38400 baud -// <15007744=> 56000 baud -// <15462400=> 57600 baud -// <20615168=> 76800 baud -// <30924800=> 115200 baud -// <61845504=> 230400 baud -// <67108864=> 250000 baud -// <123695104=> 460800 baud -// <247386112=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef NRFX_UART_DEFAULT_CONFIG_BAUDRATE -#define NRFX_UART_DEFAULT_CONFIG_BAUDRATE 30924800 -#endif - -// NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_UART_CONFIG_LOG_ENABLED -#define NRFX_UART_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_UART_CONFIG_LOG_LEVEL -#define NRFX_UART_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UART_CONFIG_INFO_COLOR -#define NRFX_UART_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UART_CONFIG_DEBUG_COLOR -#define NRFX_UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_WDT_ENABLED - nrfx_wdt - WDT peripheral driver -//========================================================== -#ifndef NRFX_WDT_ENABLED -#define NRFX_WDT_ENABLED 0 -#endif -// NRFX_WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode - -// <1=> Run in SLEEP, Pause in HALT -// <8=> Pause in SLEEP, Run in HALT -// <9=> Run in SLEEP and HALT -// <0=> Pause in SLEEP and HALT - -#ifndef NRFX_WDT_CONFIG_BEHAVIOUR -#define NRFX_WDT_CONFIG_BEHAVIOUR 1 -#endif - -// NRFX_WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> - - -#ifndef NRFX_WDT_CONFIG_RELOAD_VALUE -#define NRFX_WDT_CONFIG_RELOAD_VALUE 2000 -#endif - -// NRFX_WDT_CONFIG_NO_IRQ - Remove WDT IRQ handling from WDT driver - -// <0=> Include WDT IRQ handling -// <1=> Remove WDT IRQ handling - -#ifndef NRFX_WDT_CONFIG_NO_IRQ -#define NRFX_WDT_CONFIG_NO_IRQ 0 -#endif - -// NRFX_WDT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_WDT_CONFIG_IRQ_PRIORITY -#define NRFX_WDT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_WDT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_WDT_CONFIG_LOG_ENABLED -#define NRFX_WDT_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_WDT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_WDT_CONFIG_LOG_LEVEL -#define NRFX_WDT_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_WDT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_WDT_CONFIG_INFO_COLOR -#define NRFX_WDT_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_WDT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_WDT_CONFIG_DEBUG_COLOR -#define NRFX_WDT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRF_CLOCK_ENABLED - nrf_drv_clock - CLOCK peripheral driver - legacy layer -//========================================================== -#ifndef NRF_CLOCK_ENABLED -#define NRF_CLOCK_ENABLED 0 -#endif -// CLOCK_CONFIG_LF_SRC - LF Clock Source - -// <0=> RC -// <1=> XTAL -// <2=> Synth -// <131073=> External Low Swing -// <196609=> External Full Swing - -#ifndef CLOCK_CONFIG_LF_SRC -#define CLOCK_CONFIG_LF_SRC 1 -#endif - -// CLOCK_CONFIG_LF_CAL_ENABLED - Calibration enable for LF Clock Source - - -#ifndef CLOCK_CONFIG_LF_CAL_ENABLED -#define CLOCK_CONFIG_LF_CAL_ENABLED 0 -#endif - -// CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef CLOCK_CONFIG_IRQ_PRIORITY -#define CLOCK_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// PDM_ENABLED - nrf_drv_pdm - PDM peripheral driver - legacy layer -//========================================================== -#ifndef PDM_ENABLED -#define PDM_ENABLED 0 -#endif -// PDM_CONFIG_MODE - Mode - -// <0=> Stereo -// <1=> Mono - -#ifndef PDM_CONFIG_MODE -#define PDM_CONFIG_MODE 1 -#endif - -// PDM_CONFIG_EDGE - Edge - -// <0=> Left falling -// <1=> Left rising - -#ifndef PDM_CONFIG_EDGE -#define PDM_CONFIG_EDGE 0 -#endif - -// PDM_CONFIG_CLOCK_FREQ - Clock frequency - -// <134217728=> 1000k -// <138412032=> 1032k (default) -// <142606336=> 1067k - -#ifndef PDM_CONFIG_CLOCK_FREQ -#define PDM_CONFIG_CLOCK_FREQ 138412032 -#endif - -// PDM_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef PDM_CONFIG_IRQ_PRIORITY -#define PDM_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// POWER_ENABLED - nrf_drv_power - POWER peripheral driver - legacy layer -//========================================================== -#ifndef POWER_ENABLED -#define POWER_ENABLED 1 -#endif -// POWER_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef POWER_CONFIG_IRQ_PRIORITY -#define POWER_CONFIG_IRQ_PRIORITY 6 -#endif - -// POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef POWER_CONFIG_DEFAULT_DCDCEN -#define POWER_CONFIG_DEFAULT_DCDCEN 0 -#endif - -// POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef POWER_CONFIG_DEFAULT_DCDCENHV -#define POWER_CONFIG_DEFAULT_DCDCENHV 0 -#endif - -// - -// PPI_ENABLED - nrf_drv_ppi - PPI peripheral driver - legacy layer - - -#ifndef PPI_ENABLED -#define PPI_ENABLED 0 -#endif - -// PWM_ENABLED - nrf_drv_pwm - PWM peripheral driver - legacy layer -//========================================================== -#ifndef PWM_ENABLED -#define PWM_ENABLED 0 -#endif -// PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT0_PIN -#define PWM_DEFAULT_CONFIG_OUT0_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT1_PIN -#define PWM_DEFAULT_CONFIG_OUT1_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT2_PIN -#define PWM_DEFAULT_CONFIG_OUT2_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT3_PIN -#define PWM_DEFAULT_CONFIG_OUT3_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_BASE_CLOCK - Base clock - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz - -#ifndef PWM_DEFAULT_CONFIG_BASE_CLOCK -#define PWM_DEFAULT_CONFIG_BASE_CLOCK 4 -#endif - -// PWM_DEFAULT_CONFIG_COUNT_MODE - Count mode - -// <0=> Up -// <1=> Up and Down - -#ifndef PWM_DEFAULT_CONFIG_COUNT_MODE -#define PWM_DEFAULT_CONFIG_COUNT_MODE 0 -#endif - -// PWM_DEFAULT_CONFIG_TOP_VALUE - Top value -#ifndef PWM_DEFAULT_CONFIG_TOP_VALUE -#define PWM_DEFAULT_CONFIG_TOP_VALUE 1000 -#endif - -// PWM_DEFAULT_CONFIG_LOAD_MODE - Load mode - -// <0=> Common -// <1=> Grouped -// <2=> Individual -// <3=> Waveform - -#ifndef PWM_DEFAULT_CONFIG_LOAD_MODE -#define PWM_DEFAULT_CONFIG_LOAD_MODE 0 -#endif - -// PWM_DEFAULT_CONFIG_STEP_MODE - Step mode - -// <0=> Auto -// <1=> Triggered - -#ifndef PWM_DEFAULT_CONFIG_STEP_MODE -#define PWM_DEFAULT_CONFIG_STEP_MODE 0 -#endif - -// PWM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#define PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// PWM0_ENABLED - Enable PWM0 instance - - -#ifndef PWM0_ENABLED -#define PWM0_ENABLED 0 -#endif - -// PWM1_ENABLED - Enable PWM1 instance - - -#ifndef PWM1_ENABLED -#define PWM1_ENABLED 0 -#endif - -// PWM2_ENABLED - Enable PWM2 instance - - -#ifndef PWM2_ENABLED -#define PWM2_ENABLED 0 -#endif - -// - -// QDEC_ENABLED - nrf_drv_qdec - QDEC peripheral driver - legacy layer -//========================================================== -#ifndef QDEC_ENABLED -#define QDEC_ENABLED 0 -#endif -// QDEC_CONFIG_REPORTPER - Report period - -// <0=> 10 Samples -// <1=> 40 Samples -// <2=> 80 Samples -// <3=> 120 Samples -// <4=> 160 Samples -// <5=> 200 Samples -// <6=> 240 Samples -// <7=> 280 Samples - -#ifndef QDEC_CONFIG_REPORTPER -#define QDEC_CONFIG_REPORTPER 0 -#endif - -// QDEC_CONFIG_SAMPLEPER - Sample period - -// <0=> 128 us -// <1=> 256 us -// <2=> 512 us -// <3=> 1024 us -// <4=> 2048 us -// <5=> 4096 us -// <6=> 8192 us -// <7=> 16384 us - -#ifndef QDEC_CONFIG_SAMPLEPER -#define QDEC_CONFIG_SAMPLEPER 7 -#endif - -// QDEC_CONFIG_PIO_A - A pin <0-31> - - -#ifndef QDEC_CONFIG_PIO_A -#define QDEC_CONFIG_PIO_A 31 -#endif - -// QDEC_CONFIG_PIO_B - B pin <0-31> - - -#ifndef QDEC_CONFIG_PIO_B -#define QDEC_CONFIG_PIO_B 31 -#endif - -// QDEC_CONFIG_PIO_LED - LED pin <0-31> - - -#ifndef QDEC_CONFIG_PIO_LED -#define QDEC_CONFIG_PIO_LED 31 -#endif - -// QDEC_CONFIG_LEDPRE - LED pre -#ifndef QDEC_CONFIG_LEDPRE -#define QDEC_CONFIG_LEDPRE 511 -#endif - -// QDEC_CONFIG_LEDPOL - LED polarity - -// <0=> Active low -// <1=> Active high - -#ifndef QDEC_CONFIG_LEDPOL -#define QDEC_CONFIG_LEDPOL 1 -#endif - -// QDEC_CONFIG_DBFEN - Debouncing enable - - -#ifndef QDEC_CONFIG_DBFEN -#define QDEC_CONFIG_DBFEN 0 -#endif - -// QDEC_CONFIG_SAMPLE_INTEN - Sample ready interrupt enable - - -#ifndef QDEC_CONFIG_SAMPLE_INTEN -#define QDEC_CONFIG_SAMPLE_INTEN 0 -#endif - -// QDEC_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef QDEC_CONFIG_IRQ_PRIORITY -#define QDEC_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// QSPI_ENABLED - nrf_drv_qspi - QSPI peripheral driver - legacy layer -//========================================================== -#ifndef QSPI_ENABLED -#define QSPI_ENABLED 0 -#endif -// QSPI_CONFIG_SCK_DELAY - tSHSL, tWHSL and tSHWL in number of 16 MHz periods (62.5 ns). <0-255> - - -#ifndef QSPI_CONFIG_SCK_DELAY -#define QSPI_CONFIG_SCK_DELAY 1 -#endif - -// QSPI_CONFIG_XIP_OFFSET - Address offset in the external memory for Execute in Place operation. -#ifndef QSPI_CONFIG_XIP_OFFSET -#define QSPI_CONFIG_XIP_OFFSET 0 -#endif - -// QSPI_CONFIG_READOC - Number of data lines and opcode used for reading. - -// <0=> FastRead -// <1=> Read2O -// <2=> Read2IO -// <3=> Read4O -// <4=> Read4IO - -#ifndef QSPI_CONFIG_READOC -#define QSPI_CONFIG_READOC 0 -#endif - -// QSPI_CONFIG_WRITEOC - Number of data lines and opcode used for writing. - -// <0=> PP -// <1=> PP2O -// <2=> PP4O -// <3=> PP4IO - -#ifndef QSPI_CONFIG_WRITEOC -#define QSPI_CONFIG_WRITEOC 0 -#endif - -// QSPI_CONFIG_ADDRMODE - Addressing mode. - -// <0=> 24bit -// <1=> 32bit - -#ifndef QSPI_CONFIG_ADDRMODE -#define QSPI_CONFIG_ADDRMODE 0 -#endif - -// QSPI_CONFIG_MODE - SPI mode. - -// <0=> Mode 0 -// <1=> Mode 1 - -#ifndef QSPI_CONFIG_MODE -#define QSPI_CONFIG_MODE 0 -#endif - -// QSPI_CONFIG_FREQUENCY - Frequency divider. - -// <0=> 32MHz/1 -// <1=> 32MHz/2 -// <2=> 32MHz/3 -// <3=> 32MHz/4 -// <4=> 32MHz/5 -// <5=> 32MHz/6 -// <6=> 32MHz/7 -// <7=> 32MHz/8 -// <8=> 32MHz/9 -// <9=> 32MHz/10 -// <10=> 32MHz/11 -// <11=> 32MHz/12 -// <12=> 32MHz/13 -// <13=> 32MHz/14 -// <14=> 32MHz/15 -// <15=> 32MHz/16 - -#ifndef QSPI_CONFIG_FREQUENCY -#define QSPI_CONFIG_FREQUENCY 15 -#endif - -// QSPI_PIN_SCK - SCK pin value. -#ifndef QSPI_PIN_SCK -#define QSPI_PIN_SCK NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_CSN - CSN pin value. -#ifndef QSPI_PIN_CSN -#define QSPI_PIN_CSN NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO0 - IO0 pin value. -#ifndef QSPI_PIN_IO0 -#define QSPI_PIN_IO0 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO1 - IO1 pin value. -#ifndef QSPI_PIN_IO1 -#define QSPI_PIN_IO1 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO2 - IO2 pin value. -#ifndef QSPI_PIN_IO2 -#define QSPI_PIN_IO2 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO3 - IO3 pin value. -#ifndef QSPI_PIN_IO3 -#define QSPI_PIN_IO3 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef QSPI_CONFIG_IRQ_PRIORITY -#define QSPI_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// RNG_ENABLED - nrf_drv_rng - RNG peripheral driver - legacy layer -//========================================================== -#ifndef RNG_ENABLED -#define RNG_ENABLED 0 -#endif -// RNG_CONFIG_ERROR_CORRECTION - Error correction - - -#ifndef RNG_CONFIG_ERROR_CORRECTION -#define RNG_CONFIG_ERROR_CORRECTION 1 -#endif - -// RNG_CONFIG_POOL_SIZE - Pool size -#ifndef RNG_CONFIG_POOL_SIZE -#define RNG_CONFIG_POOL_SIZE 64 -#endif - -// RNG_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef RNG_CONFIG_IRQ_PRIORITY -#define RNG_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// RTC_ENABLED - nrf_drv_rtc - RTC peripheral driver - legacy layer -//========================================================== -#ifndef RTC_ENABLED -#define RTC_ENABLED 0 -#endif -// RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768> - - -#ifndef RTC_DEFAULT_CONFIG_FREQUENCY -#define RTC_DEFAULT_CONFIG_FREQUENCY 32768 -#endif - -// RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering - - -#ifndef RTC_DEFAULT_CONFIG_RELIABLE -#define RTC_DEFAULT_CONFIG_RELIABLE 0 -#endif - -// RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// RTC0_ENABLED - Enable RTC0 instance - - -#ifndef RTC0_ENABLED -#define RTC0_ENABLED 0 -#endif - -// RTC1_ENABLED - Enable RTC1 instance - - -#ifndef RTC1_ENABLED -#define RTC1_ENABLED 0 -#endif - -// RTC2_ENABLED - Enable RTC2 instance - - -#ifndef RTC2_ENABLED -#define RTC2_ENABLED 0 -#endif - -// NRF_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt -#ifndef NRF_MAXIMUM_LATENCY_US -#define NRF_MAXIMUM_LATENCY_US 2000 -#endif - -// - -// SAADC_ENABLED - nrf_drv_saadc - SAADC peripheral driver - legacy layer -//========================================================== -#ifndef SAADC_ENABLED -#define SAADC_ENABLED 0 -#endif -// SAADC_CONFIG_RESOLUTION - Resolution - -// <0=> 8 bit -// <1=> 10 bit -// <2=> 12 bit -// <3=> 14 bit - -#ifndef SAADC_CONFIG_RESOLUTION -#define SAADC_CONFIG_RESOLUTION 1 -#endif - -// SAADC_CONFIG_OVERSAMPLE - Sample period - -// <0=> Disabled -// <1=> 2x -// <2=> 4x -// <3=> 8x -// <4=> 16x -// <5=> 32x -// <6=> 64x -// <7=> 128x -// <8=> 256x - -#ifndef SAADC_CONFIG_OVERSAMPLE -#define SAADC_CONFIG_OVERSAMPLE 0 -#endif - -// SAADC_CONFIG_LP_MODE - Enabling low power mode - - -#ifndef SAADC_CONFIG_LP_MODE -#define SAADC_CONFIG_LP_MODE 0 -#endif - -// SAADC_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef SAADC_CONFIG_IRQ_PRIORITY -#define SAADC_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// SPIS_ENABLED - nrf_drv_spis - SPIS peripheral driver - legacy layer -//========================================================== -#ifndef SPIS_ENABLED -#define SPIS_ENABLED 0 -#endif -// SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// SPIS_DEFAULT_MODE - Mode - -// <0=> MODE_0 -// <1=> MODE_1 -// <2=> MODE_2 -// <3=> MODE_3 - -#ifndef SPIS_DEFAULT_MODE -#define SPIS_DEFAULT_MODE 0 -#endif - -// SPIS_DEFAULT_BIT_ORDER - SPIS default bit order - -// <0=> MSB first -// <1=> LSB first - -#ifndef SPIS_DEFAULT_BIT_ORDER -#define SPIS_DEFAULT_BIT_ORDER 0 -#endif - -// SPIS_DEFAULT_DEF - SPIS default DEF character <0-255> - - -#ifndef SPIS_DEFAULT_DEF -#define SPIS_DEFAULT_DEF 255 -#endif - -// SPIS_DEFAULT_ORC - SPIS default ORC character <0-255> - - -#ifndef SPIS_DEFAULT_ORC -#define SPIS_DEFAULT_ORC 255 -#endif - -// SPIS0_ENABLED - Enable SPIS0 instance - - -#ifndef SPIS0_ENABLED -#define SPIS0_ENABLED 0 -#endif - -// SPIS1_ENABLED - Enable SPIS1 instance - - -#ifndef SPIS1_ENABLED -#define SPIS1_ENABLED 0 -#endif - -// - -// SPI_ENABLED - nrf_drv_spi - SPI/SPIM peripheral driver - legacy layer -//========================================================== -#ifndef SPI_ENABLED -#define SPI_ENABLED 0 -#endif -// SPI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef SPI_DEFAULT_CONFIG_IRQ_PRIORITY -#define SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRF_SPI_DRV_MISO_PULLUP_CFG - MISO PIN pull-up configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP - -#ifndef NRF_SPI_DRV_MISO_PULLUP_CFG -#define NRF_SPI_DRV_MISO_PULLUP_CFG 1 -#endif - -// SPI0_ENABLED - Enable SPI0 instance -//========================================================== -#ifndef SPI0_ENABLED -#define SPI0_ENABLED 0 -#endif -// SPI0_USE_EASY_DMA - Use EasyDMA - - -#ifndef SPI0_USE_EASY_DMA -#define SPI0_USE_EASY_DMA 1 -#endif - -// - -// SPI1_ENABLED - Enable SPI1 instance -//========================================================== -#ifndef SPI1_ENABLED -#define SPI1_ENABLED 0 -#endif -// SPI1_USE_EASY_DMA - Use EasyDMA - - -#ifndef SPI1_USE_EASY_DMA -#define SPI1_USE_EASY_DMA 1 -#endif - -// - -// - -// TIMER_ENABLED - nrf_drv_timer - TIMER periperal driver - legacy layer -//========================================================== -#ifndef TIMER_ENABLED -#define TIMER_ENABLED 0 -#endif -// TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz -// <8=> 62.5 kHz -// <9=> 31.25 kHz - -#ifndef TIMER_DEFAULT_CONFIG_FREQUENCY -#define TIMER_DEFAULT_CONFIG_FREQUENCY 0 -#endif - -// TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation - -// <0=> Timer -// <1=> Counter - -#ifndef TIMER_DEFAULT_CONFIG_MODE -#define TIMER_DEFAULT_CONFIG_MODE 0 -#endif - -// TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width - -// <0=> 16 bit -// <1=> 8 bit -// <2=> 24 bit -// <3=> 32 bit - -#ifndef TIMER_DEFAULT_CONFIG_BIT_WIDTH -#define TIMER_DEFAULT_CONFIG_BIT_WIDTH 0 -#endif - -// TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// TIMER0_ENABLED - Enable TIMER0 instance - - -#ifndef TIMER0_ENABLED -#define TIMER0_ENABLED 0 -#endif - -// TIMER1_ENABLED - Enable TIMER1 instance - - -#ifndef TIMER1_ENABLED -#define TIMER1_ENABLED 0 -#endif - -// TIMER2_ENABLED - Enable TIMER2 instance - - -#ifndef TIMER2_ENABLED -#define TIMER2_ENABLED 0 -#endif - -// TIMER3_ENABLED - Enable TIMER3 instance - - -#ifndef TIMER3_ENABLED -#define TIMER3_ENABLED 0 -#endif - -// TIMER4_ENABLED - Enable TIMER4 instance - - -#ifndef TIMER4_ENABLED -#define TIMER4_ENABLED 0 -#endif - -// - -// TWIS_ENABLED - nrf_drv_twis - TWIS peripheral driver - legacy layer -//========================================================== -#ifndef TWIS_ENABLED -#define TWIS_ENABLED 0 -#endif -// TWIS0_ENABLED - Enable TWIS0 instance - - -#ifndef TWIS0_ENABLED -#define TWIS0_ENABLED 0 -#endif - -// TWIS1_ENABLED - Enable TWIS1 instance - - -#ifndef TWIS1_ENABLED -#define TWIS1_ENABLED 0 -#endif - -// TWIS_ASSUME_INIT_AFTER_RESET_ONLY - Assume that any instance would be initialized only once - - -// Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code. - -#ifndef TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#define TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 -#endif - -// TWIS_NO_SYNC_MODE - Remove support for synchronous mode - - -// Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources. - -#ifndef TWIS_NO_SYNC_MODE -#define TWIS_NO_SYNC_MODE 0 -#endif - -// TWIS_DEFAULT_CONFIG_ADDR0 - Address0 -#ifndef TWIS_DEFAULT_CONFIG_ADDR0 -#define TWIS_DEFAULT_CONFIG_ADDR0 0 -#endif - -// TWIS_DEFAULT_CONFIG_ADDR1 - Address1 -#ifndef TWIS_DEFAULT_CONFIG_ADDR1 -#define TWIS_DEFAULT_CONFIG_ADDR1 0 -#endif - -// TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef TWIS_DEFAULT_CONFIG_SCL_PULL -#define TWIS_DEFAULT_CONFIG_SCL_PULL 0 -#endif - -// TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef TWIS_DEFAULT_CONFIG_SDA_PULL -#define TWIS_DEFAULT_CONFIG_SDA_PULL 0 -#endif - -// TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// TWI_ENABLED - nrf_drv_twi - TWI/TWIM peripheral driver - legacy layer -//========================================================== -#ifndef TWI_ENABLED -#define TWI_ENABLED 0 -#endif -// TWI_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k - -#ifndef TWI_DEFAULT_CONFIG_FREQUENCY -#define TWI_DEFAULT_CONFIG_FREQUENCY 26738688 -#endif - -// TWI_DEFAULT_CONFIG_CLR_BUS_INIT - Enables bus clearing procedure during init - - -#ifndef TWI_DEFAULT_CONFIG_CLR_BUS_INIT -#define TWI_DEFAULT_CONFIG_CLR_BUS_INIT 0 -#endif - -// TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - - -#ifndef TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 -#endif - -// TWI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef TWI_DEFAULT_CONFIG_IRQ_PRIORITY -#define TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// TWI0_ENABLED - Enable TWI0 instance -//========================================================== -#ifndef TWI0_ENABLED -#define TWI0_ENABLED 0 -#endif -// TWI0_USE_EASY_DMA - Use EasyDMA (if present) - - -#ifndef TWI0_USE_EASY_DMA -#define TWI0_USE_EASY_DMA 0 -#endif - -// - -// - -// UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer -//========================================================== -#ifndef UART_ENABLED -#define UART_ENABLED 0 -#endif -// UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef UART_DEFAULT_CONFIG_HWFC -#define UART_DEFAULT_CONFIG_HWFC 0 -#endif - -// UART_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included - -#ifndef UART_DEFAULT_CONFIG_PARITY -#define UART_DEFAULT_CONFIG_PARITY 0 -#endif - -// UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef UART_DEFAULT_CONFIG_BAUDRATE -#define UART_DEFAULT_CONFIG_BAUDRATE 30801920 -#endif - -// UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef UART_DEFAULT_CONFIG_IRQ_PRIORITY -#define UART_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// UART_EASY_DMA_SUPPORT - Driver supporting EasyDMA - - -#ifndef UART_EASY_DMA_SUPPORT -#define UART_EASY_DMA_SUPPORT 1 -#endif - -// UART_LEGACY_SUPPORT - Driver supporting Legacy mode - - -#ifndef UART_LEGACY_SUPPORT -#define UART_LEGACY_SUPPORT 1 -#endif - -// UART0_ENABLED - Enable UART0 instance -//========================================================== -#ifndef UART0_ENABLED -#define UART0_ENABLED 0 -#endif -// UART0_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA - - -#ifndef UART0_CONFIG_USE_EASY_DMA -#define UART0_CONFIG_USE_EASY_DMA 1 -#endif - -// - -// - -// USBD_ENABLED - nrf_drv_usbd - Software Component -//========================================================== -#ifndef USBD_ENABLED -#define USBD_ENABLED 0 -#endif -// USBD_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef USBD_CONFIG_IRQ_PRIORITY -#define USBD_CONFIG_IRQ_PRIORITY 6 -#endif - -// USBD_CONFIG_DMASCHEDULER_MODE - USBD SMA scheduler working scheme - -// <0=> Prioritized access -// <1=> Round Robin - -#ifndef USBD_CONFIG_DMASCHEDULER_MODE -#define USBD_CONFIG_DMASCHEDULER_MODE 0 -#endif - -// USBD_CONFIG_DMASCHEDULER_ISO_BOOST - Give priority to isochronous transfers - - -// This option gives priority to isochronous transfers. -// Enabling it assures that isochronous transfers are always processed, -// even if multiple other transfers are pending. -// Isochronous endpoints are prioritized before the usbd_dma_scheduler_algorithm -// function is called, so the option is independent of the algorithm chosen. - -#ifndef USBD_CONFIG_DMASCHEDULER_ISO_BOOST -#define USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1 -#endif - -// USBD_CONFIG_ISO_IN_ZLP - Respond to an IN token on ISO IN endpoint with ZLP when no data is ready - - -// If set, ISO IN endpoint will respond to an IN token with ZLP when no data is ready to be sent. -// Else, there will be no response. -// NOTE: This option does not work on Engineering A chip. - -#ifndef USBD_CONFIG_ISO_IN_ZLP -#define USBD_CONFIG_ISO_IN_ZLP 0 -#endif - -// - -// WDT_ENABLED - nrf_drv_wdt - WDT peripheral driver - legacy layer -//========================================================== -#ifndef WDT_ENABLED -#define WDT_ENABLED 0 -#endif -// WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode - -// <1=> Run in SLEEP, Pause in HALT -// <8=> Pause in SLEEP, Run in HALT -// <9=> Run in SLEEP and HALT -// <0=> Pause in SLEEP and HALT - -#ifndef WDT_CONFIG_BEHAVIOUR -#define WDT_CONFIG_BEHAVIOUR 1 -#endif - -// WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> - - -#ifndef WDT_CONFIG_RELOAD_VALUE -#define WDT_CONFIG_RELOAD_VALUE 2000 -#endif - -// WDT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef WDT_CONFIG_IRQ_PRIORITY -#define WDT_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// nrfx_i2s - I2S peripheral driver - -//========================================================== -// -//========================================================== - -// nrfx_lpcomp - LPCOMP peripheral driver - -//========================================================== -// -//========================================================== - -// nrfx_qspi - QSPI peripheral driver - -//========================================================== -// -//========================================================== - -// nrfx_usbd - USBD peripheral driver - -//========================================================== -// -//========================================================== - -// -//========================================================== - -// nRF_Drivers_External - -//========================================================== -// NRF_TWI_SENSOR_ENABLED - nrf_twi_sensor - nRF TWI Sensor module - - -#ifndef NRF_TWI_SENSOR_ENABLED -#define NRF_TWI_SENSOR_ENABLED 0 -#endif - -// -//========================================================== - -// nRF_Libraries - -//========================================================== -// APP_GPIOTE_ENABLED - app_gpiote - GPIOTE events dispatcher - - -#ifndef APP_GPIOTE_ENABLED -#define APP_GPIOTE_ENABLED 0 -#endif - -// APP_PWM_ENABLED - app_pwm - PWM functionality - - -#ifndef APP_PWM_ENABLED -#define APP_PWM_ENABLED 0 -#endif - -// APP_SCHEDULER_ENABLED - app_scheduler - Events scheduler -//========================================================== -#ifndef APP_SCHEDULER_ENABLED -#define APP_SCHEDULER_ENABLED 0 -#endif -// APP_SCHEDULER_WITH_PAUSE - Enabling pause feature - - -#ifndef APP_SCHEDULER_WITH_PAUSE -#define APP_SCHEDULER_WITH_PAUSE 0 -#endif - -// APP_SCHEDULER_WITH_PROFILER - Enabling scheduler profiling - - -#ifndef APP_SCHEDULER_WITH_PROFILER -#define APP_SCHEDULER_WITH_PROFILER 0 -#endif - -// - -// APP_SDCARD_ENABLED - app_sdcard - SD/MMC card support using SPI -//========================================================== -#ifndef APP_SDCARD_ENABLED -#define APP_SDCARD_ENABLED 0 -#endif -// APP_SDCARD_SPI_INSTANCE - SPI instance used - -// <0=> 0 -// <1=> 1 -// <2=> 2 - -#ifndef APP_SDCARD_SPI_INSTANCE -#define APP_SDCARD_SPI_INSTANCE 0 -#endif - -// APP_SDCARD_FREQ_INIT - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz - -#ifndef APP_SDCARD_FREQ_INIT -#define APP_SDCARD_FREQ_INIT 67108864 -#endif - -// APP_SDCARD_FREQ_DATA - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz - -#ifndef APP_SDCARD_FREQ_DATA -#define APP_SDCARD_FREQ_DATA 1073741824 -#endif - -// - -// APP_TIMER_ENABLED - app_timer - Application timer functionality -//========================================================== -#ifndef APP_TIMER_ENABLED -#define APP_TIMER_ENABLED 0 -#endif -// APP_TIMER_CONFIG_RTC_FREQUENCY - Configure RTC prescaler. - -// <0=> 32768 Hz -// <1=> 16384 Hz -// <3=> 8192 Hz -// <7=> 4096 Hz -// <15=> 2048 Hz -// <31=> 1024 Hz - -#ifndef APP_TIMER_CONFIG_RTC_FREQUENCY -#define APP_TIMER_CONFIG_RTC_FREQUENCY 1 -#endif - -// APP_TIMER_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef APP_TIMER_CONFIG_IRQ_PRIORITY -#define APP_TIMER_CONFIG_IRQ_PRIORITY 6 -#endif - -// APP_TIMER_CONFIG_OP_QUEUE_SIZE - Capacity of timer requests queue. -// Size of the queue depends on how many timers are used -// in the system, how often timers are started and overall -// system latency. If queue size is too small app_timer calls -// will fail. - -#ifndef APP_TIMER_CONFIG_OP_QUEUE_SIZE -#define APP_TIMER_CONFIG_OP_QUEUE_SIZE 10 -#endif - -// APP_TIMER_CONFIG_USE_SCHEDULER - Enable scheduling app_timer events to app_scheduler - - -#ifndef APP_TIMER_CONFIG_USE_SCHEDULER -#define APP_TIMER_CONFIG_USE_SCHEDULER 0 -#endif - -// APP_TIMER_KEEPS_RTC_ACTIVE - Enable RTC always on - - -// If option is enabled RTC is kept running even if there is no active timers. -// This option can be used when app_timer is used for timestamping. - -#ifndef APP_TIMER_KEEPS_RTC_ACTIVE -#define APP_TIMER_KEEPS_RTC_ACTIVE 0 -#endif - -// APP_TIMER_SAFE_WINDOW_MS - Maximum possible latency (in milliseconds) of handling app_timer event. -// Maximum possible timeout that can be set is reduced by safe window. -// Example: RTC frequency 16384 Hz, maximum possible timeout 1024 seconds - APP_TIMER_SAFE_WINDOW_MS. -// Since RTC is not stopped when processor is halted in debugging session, this value -// must cover it if debugging is needed. It is possible to halt processor for APP_TIMER_SAFE_WINDOW_MS -// without corrupting app_timer behavior. - -#ifndef APP_TIMER_SAFE_WINDOW_MS -#define APP_TIMER_SAFE_WINDOW_MS 300000 -#endif - -// App Timer Legacy configuration - Legacy configuration. - -//========================================================== -// APP_TIMER_WITH_PROFILER - Enable app_timer profiling - - -#ifndef APP_TIMER_WITH_PROFILER -#define APP_TIMER_WITH_PROFILER 0 -#endif - -// APP_TIMER_CONFIG_SWI_NUMBER - Configure SWI instance used. - - -#ifndef APP_TIMER_CONFIG_SWI_NUMBER -#define APP_TIMER_CONFIG_SWI_NUMBER 0 -#endif - -// -//========================================================== - -// - -// APP_USBD_AUDIO_ENABLED - app_usbd_audio - USB AUDIO class - - -#ifndef APP_USBD_AUDIO_ENABLED -#define APP_USBD_AUDIO_ENABLED 0 -#endif - -// APP_USBD_ENABLED - app_usbd - USB Device library -//========================================================== -#ifndef APP_USBD_ENABLED -#define APP_USBD_ENABLED 0 -#endif -// APP_USBD_VID - Vendor ID. <0x0000-0xFFFF> - - -// Note: This value is not editable in Configuration Wizard. -// Vendor ID ordered from USB IF: http://www.usb.org/developers/vendor/ - -#ifndef APP_USBD_VID -#define APP_USBD_VID 0 -#endif - -// APP_USBD_PID - Product ID. <0x0000-0xFFFF> - - -// Note: This value is not editable in Configuration Wizard. -// Selected Product ID - -#ifndef APP_USBD_PID -#define APP_USBD_PID 0 -#endif - -// APP_USBD_DEVICE_VER_MAJOR - Major device version <0-99> - - -// Major device version, will be converted automatically to BCD notation. Use just decimal values. - -#ifndef APP_USBD_DEVICE_VER_MAJOR -#define APP_USBD_DEVICE_VER_MAJOR 1 -#endif - -// APP_USBD_DEVICE_VER_MINOR - Minor device version <0-9> - - -// Minor device version, will be converted automatically to BCD notation. Use just decimal values. - -#ifndef APP_USBD_DEVICE_VER_MINOR -#define APP_USBD_DEVICE_VER_MINOR 0 -#endif - -// APP_USBD_DEVICE_VER_SUB - Sub-minor device version <0-9> - - -// Sub-minor device version, will be converted automatically to BCD notation. Use just decimal values. - -#ifndef APP_USBD_DEVICE_VER_SUB -#define APP_USBD_DEVICE_VER_SUB 0 -#endif - -// APP_USBD_CONFIG_SELF_POWERED - Self-powered device, as opposed to bus-powered. - - -#ifndef APP_USBD_CONFIG_SELF_POWERED -#define APP_USBD_CONFIG_SELF_POWERED 1 -#endif - -// APP_USBD_CONFIG_MAX_POWER - MaxPower field in configuration descriptor in milliamps. <0-500> - - -#ifndef APP_USBD_CONFIG_MAX_POWER -#define APP_USBD_CONFIG_MAX_POWER 100 -#endif - -// APP_USBD_CONFIG_POWER_EVENTS_PROCESS - Process power events. - - -// Enable processing power events in USB event handler. - -#ifndef APP_USBD_CONFIG_POWER_EVENTS_PROCESS -#define APP_USBD_CONFIG_POWER_EVENTS_PROCESS 1 -#endif - -// APP_USBD_CONFIG_EVENT_QUEUE_ENABLE - Enable event queue. - -// This is the default configuration when all the events are placed into internal queue. -// Disable it when an external queue is used like app_scheduler or if you wish to process all events inside interrupts. -// Processing all events from the interrupt level adds requirement not to call any functions that modifies the USBD library state from the context higher than USB interrupt context. -// Functions that modify USBD state are functions for sleep, wakeup, start, stop, enable, and disable. -//========================================================== -#ifndef APP_USBD_CONFIG_EVENT_QUEUE_ENABLE -#define APP_USBD_CONFIG_EVENT_QUEUE_ENABLE 1 -#endif -// APP_USBD_CONFIG_EVENT_QUEUE_SIZE - The size of the event queue. <16-64> - - -// The size of the queue for the events that would be processed in the main loop. - -#ifndef APP_USBD_CONFIG_EVENT_QUEUE_SIZE -#define APP_USBD_CONFIG_EVENT_QUEUE_SIZE 32 -#endif - -// APP_USBD_CONFIG_SOF_HANDLING_MODE - Change SOF events handling mode. - - -// Normal queue - SOF events are pushed normally into the event queue. -// Compress queue - SOF events are counted and binded with other events or executed when the queue is empty. -// This prevents the queue from filling up with SOF events. -// Interrupt - SOF events are processed in interrupt. -// <0=> Normal queue -// <1=> Compress queue -// <2=> Interrupt - -#ifndef APP_USBD_CONFIG_SOF_HANDLING_MODE -#define APP_USBD_CONFIG_SOF_HANDLING_MODE 1 -#endif - -// - -// APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE - Provide a function that generates timestamps for logs based on the current SOF. - - -// The function app_usbd_sof_timestamp_get is implemented if the logger is enabled. -// Use it when initializing the logger. -// SOF processing is always enabled when this configuration parameter is active. -// Note: This option is configured outside of APP_USBD_CONFIG_LOG_ENABLED. -// This means that it works even if the logging in this very module is disabled. - -#ifndef APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE -#define APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE 0 -#endif - -// APP_USBD_CONFIG_DESC_STRING_SIZE - Maximum size of the NULL-terminated string of the string descriptor. <31-254> - - -// 31 characters can be stored in the internal USB buffer used for transfers. -// Any value higher than 31 creates an additional buffer just for descriptor strings. - -#ifndef APP_USBD_CONFIG_DESC_STRING_SIZE -#define APP_USBD_CONFIG_DESC_STRING_SIZE 31 -#endif - -// APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED - Enable UTF8 conversion. - - -// Enable UTF8-encoded characters. In normal processing, only ASCII characters are available. - -#ifndef APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED -#define APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED 0 -#endif - -// APP_USBD_STRINGS_LANGIDS - Supported languages identifiers. - -// Note: This value is not editable in Configuration Wizard. -// Comma-separated list of supported languages. -#ifndef APP_USBD_STRINGS_LANGIDS -#define APP_USBD_STRINGS_LANGIDS APP_USBD_LANG_AND_SUBLANG(APP_USBD_LANG_ENGLISH, APP_USBD_SUBLANG_ENGLISH_US) -#endif - -// APP_USBD_STRING_ID_MANUFACTURER - Define manufacturer string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_MANUFACTURER -#define APP_USBD_STRING_ID_MANUFACTURER 1 -#endif -// APP_USBD_STRINGS_MANUFACTURER_EXTERN - Define whether @ref APP_USBD_STRINGS_MANUFACTURER is created by macro or declared as a global variable. - - -#ifndef APP_USBD_STRINGS_MANUFACTURER_EXTERN -#define APP_USBD_STRINGS_MANUFACTURER_EXTERN 0 -#endif - -// APP_USBD_STRINGS_MANUFACTURER - String descriptor for the manufacturer name. - -// Note: This value is not editable in Configuration Wizard. -// Comma-separated list of manufacturer names for each defined language. -// Use @ref APP_USBD_STRING_DESC macro to create string descriptor from a NULL-terminated string. -// Use @ref APP_USBD_STRING_RAW8_DESC macro to create string descriptor from comma-separated uint8_t values. -// Use @ref APP_USBD_STRING_RAW16_DESC macro to create string descriptor from comma-separated uint16_t values. -// Alternatively, configure the macro to point to any internal variable pointer that already contains the descriptor. -// Setting string to NULL disables that string. -// The order of manufacturer names must be the same like in @ref APP_USBD_STRINGS_LANGIDS. -#ifndef APP_USBD_STRINGS_MANUFACTURER -#define APP_USBD_STRINGS_MANUFACTURER APP_USBD_STRING_DESC("Nordic Semiconductor") -#endif - -// - -// APP_USBD_STRING_ID_PRODUCT - Define product string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_PRODUCT -#define APP_USBD_STRING_ID_PRODUCT 2 -#endif -// APP_USBD_STRINGS_PRODUCT_EXTERN - Define whether @ref APP_USBD_STRINGS_PRODUCT is created by macro or declared as a global variable. - - -#ifndef APP_USBD_STRINGS_PRODUCT_EXTERN -#define APP_USBD_STRINGS_PRODUCT_EXTERN 0 -#endif - -// APP_USBD_STRINGS_PRODUCT - String descriptor for the product name. - -// Note: This value is not editable in Configuration Wizard. -// List of product names that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER. -#ifndef APP_USBD_STRINGS_PRODUCT -#define APP_USBD_STRINGS_PRODUCT APP_USBD_STRING_DESC("nRF52 USB Product") -#endif - -// - -// APP_USBD_STRING_ID_SERIAL - Define serial number string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_SERIAL -#define APP_USBD_STRING_ID_SERIAL 3 -#endif -// APP_USBD_STRING_SERIAL_EXTERN - Define whether @ref APP_USBD_STRING_SERIAL is created by macro or declared as a global variable. - - -#ifndef APP_USBD_STRING_SERIAL_EXTERN -#define APP_USBD_STRING_SERIAL_EXTERN 0 -#endif - -// APP_USBD_STRING_SERIAL - String descriptor for the serial number. - -// Note: This value is not editable in Configuration Wizard. -// Serial number that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER. -#ifndef APP_USBD_STRING_SERIAL -#define APP_USBD_STRING_SERIAL APP_USBD_STRING_DESC("000000000000") -#endif - -// - -// APP_USBD_STRING_ID_CONFIGURATION - Define configuration string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_CONFIGURATION -#define APP_USBD_STRING_ID_CONFIGURATION 4 -#endif -// APP_USBD_STRING_CONFIGURATION_EXTERN - Define whether @ref APP_USBD_STRINGS_CONFIGURATION is created by macro or declared as global variable. - - -#ifndef APP_USBD_STRING_CONFIGURATION_EXTERN -#define APP_USBD_STRING_CONFIGURATION_EXTERN 0 -#endif - -// APP_USBD_STRINGS_CONFIGURATION - String descriptor for the device configuration. - -// Note: This value is not editable in Configuration Wizard. -// Configuration string that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER. -#ifndef APP_USBD_STRINGS_CONFIGURATION -#define APP_USBD_STRINGS_CONFIGURATION APP_USBD_STRING_DESC("Default configuration") -#endif - -// - -// APP_USBD_STRINGS_USER - Default values for user strings. - -// Note: This value is not editable in Configuration Wizard. -// This value stores all application specific user strings with the default initialization. -// The setup is done by X-macros. -// Expected macro parameters: -// @code -// X(mnemonic, [=str_idx], ...) -// @endcode -// - @c mnemonic: Mnemonic of the string descriptor that would be added to -// @ref app_usbd_string_desc_idx_t enumerator. -// - @c str_idx : String index value, can be set or left empty. -// For example, WinUSB driver requires descriptor to be present on 0xEE index. -// Then use X(USBD_STRING_WINUSB, =0xEE, (APP_USBD_STRING_DESC(...))) -// - @c ... : List of string descriptors for each defined language. -#ifndef APP_USBD_STRINGS_USER -#define APP_USBD_STRINGS_USER X(APP_USER_1, , APP_USBD_STRING_DESC("User 1")) -#endif - -// - -// APP_USBD_HID_ENABLED - app_usbd_hid - USB HID class -//========================================================== -#ifndef APP_USBD_HID_ENABLED -#define APP_USBD_HID_ENABLED 0 -#endif -// APP_USBD_HID_DEFAULT_IDLE_RATE - Default idle rate for HID class. <0-255> - - -// 0 means indefinite duration, any other value is multiplied by 4 milliseconds. Refer to Chapter 7.2.4 of HID 1.11 Specification. - -#ifndef APP_USBD_HID_DEFAULT_IDLE_RATE -#define APP_USBD_HID_DEFAULT_IDLE_RATE 0 -#endif - -// APP_USBD_HID_REPORT_IDLE_TABLE_SIZE - Size of idle rate table. <1-255> - - -// Must be higher than the highest report ID used. - -#ifndef APP_USBD_HID_REPORT_IDLE_TABLE_SIZE -#define APP_USBD_HID_REPORT_IDLE_TABLE_SIZE 4 -#endif - -// - -// APP_USBD_HID_GENERIC_ENABLED - app_usbd_hid_generic - USB HID generic - - -#ifndef APP_USBD_HID_GENERIC_ENABLED -#define APP_USBD_HID_GENERIC_ENABLED 0 -#endif - -// APP_USBD_HID_KBD_ENABLED - app_usbd_hid_kbd - USB HID keyboard - - -#ifndef APP_USBD_HID_KBD_ENABLED -#define APP_USBD_HID_KBD_ENABLED 0 -#endif - -// APP_USBD_HID_MOUSE_ENABLED - app_usbd_hid_mouse - USB HID mouse - - -#ifndef APP_USBD_HID_MOUSE_ENABLED -#define APP_USBD_HID_MOUSE_ENABLED 0 -#endif - -// APP_USBD_MSC_ENABLED - app_usbd_msc - USB MSC class - - -#ifndef APP_USBD_MSC_ENABLED -#define APP_USBD_MSC_ENABLED 0 -#endif - -// CRC16_ENABLED - crc16 - CRC16 calculation routines - - -#ifndef CRC16_ENABLED -#define CRC16_ENABLED 0 -#endif - -// CRC32_ENABLED - crc32 - CRC32 calculation routines - - -#ifndef CRC32_ENABLED -#define CRC32_ENABLED 0 -#endif - -// ECC_ENABLED - ecc - Elliptic Curve Cryptography Library - - -#ifndef ECC_ENABLED -#define ECC_ENABLED 0 -#endif - -// FDS_ENABLED - fds - Flash data storage module -//========================================================== -#ifndef FDS_ENABLED -#define FDS_ENABLED 0 -#endif -// Pages - Virtual page settings - -// Configure the number of virtual pages to use and their size. -//========================================================== -// FDS_VIRTUAL_PAGES - Number of virtual flash pages to use. -// One of the virtual pages is reserved by the system for garbage collection. -// Therefore, the minimum is two virtual pages: one page to store data and one page to be used by the system for garbage collection. -// The total amount of flash memory that is used by FDS amounts to @ref FDS_VIRTUAL_PAGES * @ref FDS_VIRTUAL_PAGE_SIZE * 4 bytes. - -#ifndef FDS_VIRTUAL_PAGES -#define FDS_VIRTUAL_PAGES 3 -#endif - -// FDS_VIRTUAL_PAGE_SIZE - The size of a virtual flash page. - - -// Expressed in number of 4-byte words. -// By default, a virtual page is the same size as a physical page. -// The size of a virtual page must be a multiple of the size of a physical page. -// <1024=> 1024 -// <2048=> 2048 - -#ifndef FDS_VIRTUAL_PAGE_SIZE -#define FDS_VIRTUAL_PAGE_SIZE 1024 -#endif - -// FDS_VIRTUAL_PAGES_RESERVED - The number of virtual flash pages that are used by other modules. -// FDS module stores its data in the last pages of the flash memory. -// By setting this value, you can move flash end address used by the FDS. -// As a result the reserved space can be used by other modules. - -#ifndef FDS_VIRTUAL_PAGES_RESERVED -#define FDS_VIRTUAL_PAGES_RESERVED 0 -#endif - -// -//========================================================== - -// Backend - Backend configuration - -// Configure which nrf_fstorage backend is used by FDS to write to flash. -//========================================================== -// FDS_BACKEND - FDS flash backend. - - -// NRF_FSTORAGE_SD uses the nrf_fstorage_sd backend implementation using the SoftDevice API. Use this if you have a SoftDevice present. -// NRF_FSTORAGE_NVMC uses the nrf_fstorage_nvmc implementation. Use this setting if you don't use the SoftDevice. -// <1=> NRF_FSTORAGE_NVMC -// <2=> NRF_FSTORAGE_SD - -#ifndef FDS_BACKEND -#define FDS_BACKEND 2 -#endif - -// -//========================================================== - -// Queue - Queue settings - -//========================================================== -// FDS_OP_QUEUE_SIZE - Size of the internal queue. -// Increase this value if you frequently get synchronous FDS_ERR_NO_SPACE_IN_QUEUES errors. - -#ifndef FDS_OP_QUEUE_SIZE -#define FDS_OP_QUEUE_SIZE 4 -#endif - -// -//========================================================== - -// CRC - CRC functionality - -//========================================================== -// FDS_CRC_CHECK_ON_READ - Enable CRC checks. - -// Save a record's CRC when it is written to flash and check it when the record is opened. -// Records with an incorrect CRC can still be 'seen' by the user using FDS functions, but they cannot be opened. -// Additionally, they will not be garbage collected until they are deleted. -//========================================================== -#ifndef FDS_CRC_CHECK_ON_READ -#define FDS_CRC_CHECK_ON_READ 0 -#endif -// FDS_CRC_CHECK_ON_WRITE - Perform a CRC check on newly written records. - - -// Perform a CRC check on newly written records. -// This setting can be used to make sure that the record data was not altered while being written to flash. -// <1=> Enabled -// <0=> Disabled - -#ifndef FDS_CRC_CHECK_ON_WRITE -#define FDS_CRC_CHECK_ON_WRITE 0 -#endif - -// - -// -//========================================================== - -// Users - Number of users - -//========================================================== -// FDS_MAX_USERS - Maximum number of callbacks that can be registered. -#ifndef FDS_MAX_USERS -#define FDS_MAX_USERS 4 -#endif - -// -//========================================================== - -// - -// HARDFAULT_HANDLER_ENABLED - hardfault_default - HardFault default handler for debugging and release - - -#ifndef HARDFAULT_HANDLER_ENABLED -#define HARDFAULT_HANDLER_ENABLED 0 -#endif - -// HCI_MEM_POOL_ENABLED - hci_mem_pool - memory pool implementation used by HCI -//========================================================== -#ifndef HCI_MEM_POOL_ENABLED -#define HCI_MEM_POOL_ENABLED 0 -#endif -// HCI_TX_BUF_SIZE - TX buffer size in bytes. -#ifndef HCI_TX_BUF_SIZE -#define HCI_TX_BUF_SIZE 600 -#endif - -// HCI_RX_BUF_SIZE - RX buffer size in bytes. -#ifndef HCI_RX_BUF_SIZE -#define HCI_RX_BUF_SIZE 600 -#endif - -// HCI_RX_BUF_QUEUE_SIZE - RX buffer queue size. -#ifndef HCI_RX_BUF_QUEUE_SIZE -#define HCI_RX_BUF_QUEUE_SIZE 4 -#endif - -// - -// HCI_SLIP_ENABLED - hci_slip - SLIP protocol implementation used by HCI -//========================================================== -#ifndef HCI_SLIP_ENABLED -#define HCI_SLIP_ENABLED 0 -#endif -// HCI_UART_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef HCI_UART_BAUDRATE -#define HCI_UART_BAUDRATE 30801920 -#endif - -// HCI_UART_FLOW_CONTROL - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef HCI_UART_FLOW_CONTROL -#define HCI_UART_FLOW_CONTROL 0 -#endif - -// HCI_UART_RX_PIN - UART RX pin -#ifndef HCI_UART_RX_PIN -#define HCI_UART_RX_PIN 31 -#endif - -// HCI_UART_TX_PIN - UART TX pin -#ifndef HCI_UART_TX_PIN -#define HCI_UART_TX_PIN 31 -#endif - -// HCI_UART_RTS_PIN - UART RTS pin -#ifndef HCI_UART_RTS_PIN -#define HCI_UART_RTS_PIN 31 -#endif - -// HCI_UART_CTS_PIN - UART CTS pin -#ifndef HCI_UART_CTS_PIN -#define HCI_UART_CTS_PIN 31 -#endif - -// - -// HCI_TRANSPORT_ENABLED - hci_transport - HCI transport -//========================================================== -#ifndef HCI_TRANSPORT_ENABLED -#define HCI_TRANSPORT_ENABLED 0 -#endif -// HCI_MAX_PACKET_SIZE_IN_BITS - Maximum size of a single application packet in bits. -#ifndef HCI_MAX_PACKET_SIZE_IN_BITS -#define HCI_MAX_PACKET_SIZE_IN_BITS 8000 -#endif - -// - -// LED_SOFTBLINK_ENABLED - led_softblink - led_softblink module - - -#ifndef LED_SOFTBLINK_ENABLED -#define LED_SOFTBLINK_ENABLED 0 -#endif - -// LOW_POWER_PWM_ENABLED - low_power_pwm - low_power_pwm module - - -#ifndef LOW_POWER_PWM_ENABLED -#define LOW_POWER_PWM_ENABLED 0 -#endif - -// MEM_MANAGER_ENABLED - mem_manager - Dynamic memory allocator -//========================================================== -#ifndef MEM_MANAGER_ENABLED -#define MEM_MANAGER_ENABLED 0 -#endif -// MEMORY_MANAGER_SMALL_BLOCK_COUNT - Size of each memory blocks identified as 'small' block. <0-255> - - -#ifndef MEMORY_MANAGER_SMALL_BLOCK_COUNT -#define MEMORY_MANAGER_SMALL_BLOCK_COUNT 1 -#endif - -// MEMORY_MANAGER_SMALL_BLOCK_SIZE - Size of each memory blocks identified as 'small' block. -// Size of each memory blocks identified as 'small' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_SMALL_BLOCK_SIZE -#define MEMORY_MANAGER_SMALL_BLOCK_SIZE 32 -#endif - -// MEMORY_MANAGER_MEDIUM_BLOCK_COUNT - Size of each memory blocks identified as 'medium' block. <0-255> - - -#ifndef MEMORY_MANAGER_MEDIUM_BLOCK_COUNT -#define MEMORY_MANAGER_MEDIUM_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_MEDIUM_BLOCK_SIZE - Size of each memory blocks identified as 'medium' block. -// Size of each memory blocks identified as 'medium' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_MEDIUM_BLOCK_SIZE -#define MEMORY_MANAGER_MEDIUM_BLOCK_SIZE 256 -#endif - -// MEMORY_MANAGER_LARGE_BLOCK_COUNT - Size of each memory blocks identified as 'large' block. <0-255> - - -#ifndef MEMORY_MANAGER_LARGE_BLOCK_COUNT -#define MEMORY_MANAGER_LARGE_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_LARGE_BLOCK_SIZE - Size of each memory blocks identified as 'large' block. -// Size of each memory blocks identified as 'large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_LARGE_BLOCK_SIZE -#define MEMORY_MANAGER_LARGE_BLOCK_SIZE 256 -#endif - -// MEMORY_MANAGER_XLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra large' block. <0-255> - - -#ifndef MEMORY_MANAGER_XLARGE_BLOCK_COUNT -#define MEMORY_MANAGER_XLARGE_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra large' block. -// Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XLARGE_BLOCK_SIZE -#define MEMORY_MANAGER_XLARGE_BLOCK_SIZE 1320 -#endif - -// MEMORY_MANAGER_XXLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra large' block. <0-255> - - -#ifndef MEMORY_MANAGER_XXLARGE_BLOCK_COUNT -#define MEMORY_MANAGER_XXLARGE_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XXLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra large' block. -// Size of each memory blocks identified as 'extra extra large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XXLARGE_BLOCK_SIZE -#define MEMORY_MANAGER_XXLARGE_BLOCK_SIZE 3444 -#endif - -// MEMORY_MANAGER_XSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra small' block. <0-255> - - -#ifndef MEMORY_MANAGER_XSMALL_BLOCK_COUNT -#define MEMORY_MANAGER_XSMALL_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra small' block. -// Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XSMALL_BLOCK_SIZE -#define MEMORY_MANAGER_XSMALL_BLOCK_SIZE 64 -#endif - -// MEMORY_MANAGER_XXSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra small' block. <0-255> - - -#ifndef MEMORY_MANAGER_XXSMALL_BLOCK_COUNT -#define MEMORY_MANAGER_XXSMALL_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XXSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra small' block. -// Size of each memory blocks identified as 'extra extra small' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XXSMALL_BLOCK_SIZE -#define MEMORY_MANAGER_XXSMALL_BLOCK_SIZE 32 -#endif - -// MEM_MANAGER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef MEM_MANAGER_CONFIG_LOG_ENABLED -#define MEM_MANAGER_CONFIG_LOG_ENABLED 0 -#endif -// MEM_MANAGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef MEM_MANAGER_CONFIG_LOG_LEVEL -#define MEM_MANAGER_CONFIG_LOG_LEVEL 3 -#endif - -// MEM_MANAGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MEM_MANAGER_CONFIG_INFO_COLOR -#define MEM_MANAGER_CONFIG_INFO_COLOR 0 -#endif - -// MEM_MANAGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MEM_MANAGER_CONFIG_DEBUG_COLOR -#define MEM_MANAGER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// MEM_MANAGER_DISABLE_API_PARAM_CHECK - Disable API parameter checks in the module. - - -#ifndef MEM_MANAGER_DISABLE_API_PARAM_CHECK -#define MEM_MANAGER_DISABLE_API_PARAM_CHECK 0 -#endif - -// - -// NRF_BALLOC_ENABLED - nrf_balloc - Block allocator module -//========================================================== -#ifndef NRF_BALLOC_ENABLED -#define NRF_BALLOC_ENABLED 1 -#endif -// NRF_BALLOC_CONFIG_DEBUG_ENABLED - Enables debug mode in the module. -//========================================================== -#ifndef NRF_BALLOC_CONFIG_DEBUG_ENABLED -#define NRF_BALLOC_CONFIG_DEBUG_ENABLED 0 -#endif -// NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS - Number of words used as head guard. <0-255> - - -#ifndef NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS -#define NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS 1 -#endif - -// NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS - Number of words used as tail guard. <0-255> - - -#ifndef NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS -#define NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS 1 -#endif - -// NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED - Enables basic checks in this module. - - -#ifndef NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED -#define NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED 0 -#endif - -// NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED - Enables double memory free check in this module. - - -#ifndef NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED -#define NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED 0 -#endif - -// NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED - Enables free memory corruption check in this module. - - -#ifndef NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED -#define NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED 0 -#endif - -// NRF_BALLOC_CLI_CMDS - Enable CLI commands specific to the module - - -#ifndef NRF_BALLOC_CLI_CMDS -#define NRF_BALLOC_CLI_CMDS 0 -#endif - -// - -// - -// NRF_CSENSE_ENABLED - nrf_csense - Capacitive sensor module -//========================================================== -#ifndef NRF_CSENSE_ENABLED -#define NRF_CSENSE_ENABLED 0 -#endif -// NRF_CSENSE_PAD_HYSTERESIS - Minimum value of change required to determine that a pad was touched. -#ifndef NRF_CSENSE_PAD_HYSTERESIS -#define NRF_CSENSE_PAD_HYSTERESIS 15 -#endif - -// NRF_CSENSE_PAD_DEVIATION - Minimum value measured on a pad required to take it into account while calculating the step. -#ifndef NRF_CSENSE_PAD_DEVIATION -#define NRF_CSENSE_PAD_DEVIATION 70 -#endif - -// NRF_CSENSE_MIN_PAD_VALUE - Minimum normalized value on a pad required to take its value into account. -#ifndef NRF_CSENSE_MIN_PAD_VALUE -#define NRF_CSENSE_MIN_PAD_VALUE 20 -#endif - -// NRF_CSENSE_MAX_PADS_NUMBER - Maximum number of pads used for one instance. -#ifndef NRF_CSENSE_MAX_PADS_NUMBER -#define NRF_CSENSE_MAX_PADS_NUMBER 20 -#endif - -// NRF_CSENSE_MAX_VALUE - Maximum normalized value obtained from measurement. -#ifndef NRF_CSENSE_MAX_VALUE -#define NRF_CSENSE_MAX_VALUE 1000 -#endif - -// NRF_CSENSE_OUTPUT_PIN - Output pin used by the low-level module. -// This is used when capacitive sensor does not use COMP. - -#ifndef NRF_CSENSE_OUTPUT_PIN -#define NRF_CSENSE_OUTPUT_PIN 26 -#endif - -// - -// NRF_DRV_CSENSE_ENABLED - nrf_drv_csense - Capacitive sensor low-level module -//========================================================== -#ifndef NRF_DRV_CSENSE_ENABLED -#define NRF_DRV_CSENSE_ENABLED 0 -#endif -// USE_COMP - Use the comparator to implement the capacitive sensor driver. - -// Due to Anomaly 84, COMP I_SOURCE is not functional. It has too high a varation. -//========================================================== -#ifndef USE_COMP -#define USE_COMP 0 -#endif -// TIMER0_FOR_CSENSE - First TIMER instance used by the driver (not used on nRF51). -#ifndef TIMER0_FOR_CSENSE -#define TIMER0_FOR_CSENSE 1 -#endif - -// TIMER1_FOR_CSENSE - Second TIMER instance used by the driver (not used on nRF51). -#ifndef TIMER1_FOR_CSENSE -#define TIMER1_FOR_CSENSE 2 -#endif - -// MEASUREMENT_PERIOD - Single measurement period. -// Time of a single measurement can be calculated as -// T = (1/2)*MEASUREMENT_PERIOD*(1/f_OSC) where f_OSC = I_SOURCE / (2C*(VUP-VDOWN) ). -// I_SOURCE, VUP, and VDOWN are values used to initialize COMP and C is the capacitance of the used pad. - -#ifndef MEASUREMENT_PERIOD -#define MEASUREMENT_PERIOD 20 -#endif - -// - -// - -// NRF_FSTORAGE_ENABLED - nrf_fstorage - Flash abstraction library -//========================================================== -#ifndef NRF_FSTORAGE_ENABLED -#define NRF_FSTORAGE_ENABLED 0 -#endif -// nrf_fstorage - Common settings - -// Common settings to all fstorage implementations -//========================================================== -// NRF_FSTORAGE_PARAM_CHECK_DISABLED - Disable user input validation - - -// If selected, use ASSERT to validate user input. -// This effectively removes user input validation in production code. -// Recommended setting: OFF, only enable this setting if size is a major concern. - -#ifndef NRF_FSTORAGE_PARAM_CHECK_DISABLED -#define NRF_FSTORAGE_PARAM_CHECK_DISABLED 0 -#endif - -// -//========================================================== - -// nrf_fstorage_sd - Implementation using the SoftDevice - -// Configuration options for the fstorage implementation using the SoftDevice -//========================================================== -// NRF_FSTORAGE_SD_QUEUE_SIZE - Size of the internal queue of operations -// Increase this value if API calls frequently return the error @ref NRF_ERROR_NO_MEM. - -#ifndef NRF_FSTORAGE_SD_QUEUE_SIZE -#define NRF_FSTORAGE_SD_QUEUE_SIZE 4 -#endif - -// NRF_FSTORAGE_SD_MAX_RETRIES - Maximum number of attempts at executing an operation when the SoftDevice is busy -// Increase this value if events frequently return the @ref NRF_ERROR_TIMEOUT error. -// The SoftDevice might fail to schedule flash access due to high BLE activity. - -#ifndef NRF_FSTORAGE_SD_MAX_RETRIES -#define NRF_FSTORAGE_SD_MAX_RETRIES 8 -#endif - -// NRF_FSTORAGE_SD_MAX_WRITE_SIZE - Maximum number of bytes to be written to flash in a single operation -// This value must be a multiple of four. -// Lowering this value can increase the chances of the SoftDevice being able to execute flash operations in between radio activity. -// This value is bound by the maximum number of bytes that can be written to flash in a single call to @ref sd_flash_write. -// That is 1024 bytes for nRF51 ICs and 4096 bytes for nRF52 ICs. - -#ifndef NRF_FSTORAGE_SD_MAX_WRITE_SIZE -#define NRF_FSTORAGE_SD_MAX_WRITE_SIZE 4096 -#endif - -// -//========================================================== - -// - -// NRF_GFX_ENABLED - nrf_gfx - GFX module - - -#ifndef NRF_GFX_ENABLED -#define NRF_GFX_ENABLED 0 -#endif - -// NRF_MEMOBJ_ENABLED - nrf_memobj - Linked memory allocator module - - -#ifndef NRF_MEMOBJ_ENABLED -#define NRF_MEMOBJ_ENABLED 1 -#endif - -// NRF_PWR_MGMT_ENABLED - nrf_pwr_mgmt - Power management module -//========================================================== -#ifndef NRF_PWR_MGMT_ENABLED -#define NRF_PWR_MGMT_ENABLED 0 -#endif -// NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED - Enables pin debug in the module. - -// Selected pin will be set when CPU is in sleep mode. -//========================================================== -#ifndef NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED -#define NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED 0 -#endif -// NRF_PWR_MGMT_SLEEP_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <4294967295=> Not connected - -#ifndef NRF_PWR_MGMT_SLEEP_DEBUG_PIN -#define NRF_PWR_MGMT_SLEEP_DEBUG_PIN 31 -#endif - -// - -// NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED - Enables CPU usage monitor. - - -// Module will trace percentage of CPU usage in one second intervals. - -#ifndef NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED -#define NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED 0 -#endif - -// NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED - Enable standby timeout. -//========================================================== -#ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED -#define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED 0 -#endif -// NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S - Standby timeout (in seconds). -// Shutdown procedure will begin no earlier than after this number of seconds. - -#ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S -#define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S 3 -#endif - -// - -// NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED - Enables FPU event cleaning. - - -#ifndef NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED -#define NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED 0 -#endif - -// NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY - Blocked shutdown procedure will be retried every second. - - -#ifndef NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY -#define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 0 -#endif - -// NRF_PWR_MGMT_CONFIG_USE_SCHEDULER - Module will use @ref app_scheduler. - - -#ifndef NRF_PWR_MGMT_CONFIG_USE_SCHEDULER -#define NRF_PWR_MGMT_CONFIG_USE_SCHEDULER 0 -#endif - -// NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT - The number of priorities for module handlers. -// The number of stages of the shutdown process. - -#ifndef NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT -#define NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT 3 -#endif - -// - -// NRF_QUEUE_ENABLED - nrf_queue - Queue module -//========================================================== -#ifndef NRF_QUEUE_ENABLED -#define NRF_QUEUE_ENABLED 0 -#endif -// NRF_QUEUE_CLI_CMDS - Enable CLI commands specific to the module - - -#ifndef NRF_QUEUE_CLI_CMDS -#define NRF_QUEUE_CLI_CMDS 0 -#endif - -// - -// NRF_SECTION_ITER_ENABLED - nrf_section_iter - Section iterator - - -#ifndef NRF_SECTION_ITER_ENABLED -#define NRF_SECTION_ITER_ENABLED 1 -#endif - -// NRF_SORTLIST_ENABLED - nrf_sortlist - Sorted list - - -#ifndef NRF_SORTLIST_ENABLED -#define NRF_SORTLIST_ENABLED 1 -#endif - -// NRF_SPI_MNGR_ENABLED - nrf_spi_mngr - SPI transaction manager - - -#ifndef NRF_SPI_MNGR_ENABLED -#define NRF_SPI_MNGR_ENABLED 0 -#endif - -// NRF_STRERROR_ENABLED - nrf_strerror - Library for converting error code to string. - - -#ifndef NRF_STRERROR_ENABLED -#define NRF_STRERROR_ENABLED 1 -#endif - -// NRF_TWI_MNGR_ENABLED - nrf_twi_mngr - TWI transaction manager - - -#ifndef NRF_TWI_MNGR_ENABLED -#define NRF_TWI_MNGR_ENABLED 0 -#endif - -// SLIP_ENABLED - slip - SLIP encoding and decoding - - -#ifndef SLIP_ENABLED -#define SLIP_ENABLED 0 -#endif - -// TASK_MANAGER_ENABLED - task_manager - Task manager. -//========================================================== -#ifndef TASK_MANAGER_ENABLED -#define TASK_MANAGER_ENABLED 0 -#endif -// TASK_MANAGER_CLI_CMDS - Enable CLI commands specific to the module - - -#ifndef TASK_MANAGER_CLI_CMDS -#define TASK_MANAGER_CLI_CMDS 0 -#endif - -// TASK_MANAGER_CONFIG_MAX_TASKS - Maximum number of tasks which can be created -#ifndef TASK_MANAGER_CONFIG_MAX_TASKS -#define TASK_MANAGER_CONFIG_MAX_TASKS 2 -#endif - -// TASK_MANAGER_CONFIG_STACK_SIZE - Stack size for every task (power of 2) -#ifndef TASK_MANAGER_CONFIG_STACK_SIZE -#define TASK_MANAGER_CONFIG_STACK_SIZE 1024 -#endif - -// TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED - Enable stack profiling. - - -#ifndef TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED -#define TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED 1 -#endif - -// TASK_MANAGER_CONFIG_STACK_GUARD - Configures stack guard. - -// <0=> Disabled -// <4=> 32 bytes -// <5=> 64 bytes -// <6=> 128 bytes -// <7=> 256 bytes -// <8=> 512 bytes - -#ifndef TASK_MANAGER_CONFIG_STACK_GUARD -#define TASK_MANAGER_CONFIG_STACK_GUARD 7 -#endif - -// - -// app_button - buttons handling module - -//========================================================== -// BUTTON_ENABLED - Enables Button module - - -#ifndef BUTTON_ENABLED -#define BUTTON_ENABLED 0 -#endif - -// BUTTON_HIGH_ACCURACY_ENABLED - Enables GPIOTE high accuracy for buttons - - -#ifndef BUTTON_HIGH_ACCURACY_ENABLED -#define BUTTON_HIGH_ACCURACY_ENABLED 0 -#endif - -// -//========================================================== - -// app_usbd_cdc_acm - USB CDC ACM class - -//========================================================== -// APP_USBD_CDC_ACM_ENABLED - Enabling USBD CDC ACM Class library - - -#ifndef APP_USBD_CDC_ACM_ENABLED -#define APP_USBD_CDC_ACM_ENABLED 0 -#endif - -// APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE - Send ZLP on write with same size as endpoint - - -// If enabled, CDC ACM class will automatically send a zero length packet after transfer which has the same size as endpoint. -// This may limit throughput if a lot of binary data is sent, but in terminal mode operation it makes sure that the data is always displayed right after it is sent. - -#ifndef APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE -#define APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE 1 -#endif - -// -//========================================================== - -// nrf_cli - Command line interface - -//========================================================== -// NRF_CLI_ENABLED - Enable/disable the CLI module. - - -#ifndef NRF_CLI_ENABLED -#define NRF_CLI_ENABLED 0 -#endif - -// NRF_CLI_ARGC_MAX - Maximum number of parameters passed to the command handler. -#ifndef NRF_CLI_ARGC_MAX -#define NRF_CLI_ARGC_MAX 12 -#endif - -// NRF_CLI_BUILD_IN_CMDS_ENABLED - CLI built-in commands. - - -#ifndef NRF_CLI_BUILD_IN_CMDS_ENABLED -#define NRF_CLI_BUILD_IN_CMDS_ENABLED 1 -#endif - -// NRF_CLI_CMD_BUFF_SIZE - Maximum buffer size for a single command. -#ifndef NRF_CLI_CMD_BUFF_SIZE -#define NRF_CLI_CMD_BUFF_SIZE 128 -#endif - -// NRF_CLI_ECHO_STATUS - CLI echo status. If set, echo is ON. - - -#ifndef NRF_CLI_ECHO_STATUS -#define NRF_CLI_ECHO_STATUS 1 -#endif - -// NRF_CLI_WILDCARD_ENABLED - Enable wildcard functionality for CLI commands. - - -#ifndef NRF_CLI_WILDCARD_ENABLED -#define NRF_CLI_WILDCARD_ENABLED 0 -#endif - -// NRF_CLI_METAKEYS_ENABLED - Enable additional control keys for CLI commands like ctrl+a, ctrl+e, ctrl+w, ctrl+u - - -#ifndef NRF_CLI_METAKEYS_ENABLED -#define NRF_CLI_METAKEYS_ENABLED 0 -#endif - -// NRF_CLI_PRINTF_BUFF_SIZE - Maximum print buffer size. -#ifndef NRF_CLI_PRINTF_BUFF_SIZE -#define NRF_CLI_PRINTF_BUFF_SIZE 23 -#endif - -// NRF_CLI_HISTORY_ENABLED - Enable CLI history mode. -//========================================================== -#ifndef NRF_CLI_HISTORY_ENABLED -#define NRF_CLI_HISTORY_ENABLED 1 -#endif -// NRF_CLI_HISTORY_ELEMENT_SIZE - Size of one memory object reserved for CLI history. -#ifndef NRF_CLI_HISTORY_ELEMENT_SIZE -#define NRF_CLI_HISTORY_ELEMENT_SIZE 32 -#endif - -// NRF_CLI_HISTORY_ELEMENT_COUNT - Number of history memory objects. -#ifndef NRF_CLI_HISTORY_ELEMENT_COUNT -#define NRF_CLI_HISTORY_ELEMENT_COUNT 8 -#endif - -// - -// NRF_CLI_VT100_COLORS_ENABLED - CLI VT100 colors. - - -#ifndef NRF_CLI_VT100_COLORS_ENABLED -#define NRF_CLI_VT100_COLORS_ENABLED 1 -#endif - -// NRF_CLI_STATISTICS_ENABLED - Enable CLI statistics. - - -#ifndef NRF_CLI_STATISTICS_ENABLED -#define NRF_CLI_STATISTICS_ENABLED 1 -#endif - -// NRF_CLI_LOG_BACKEND - Enable logger backend interface. - - -#ifndef NRF_CLI_LOG_BACKEND -#define NRF_CLI_LOG_BACKEND 1 -#endif - -// NRF_CLI_USES_TASK_MANAGER_ENABLED - Enable CLI to use task_manager - - -#ifndef NRF_CLI_USES_TASK_MANAGER_ENABLED -#define NRF_CLI_USES_TASK_MANAGER_ENABLED 0 -#endif - -// -//========================================================== - -// nrf_fprintf - fprintf function. - -//========================================================== -// NRF_FPRINTF_ENABLED - Enable/disable fprintf module. - - -#ifndef NRF_FPRINTF_ENABLED -#define NRF_FPRINTF_ENABLED 1 -#endif - -// NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED - For each printed LF, function will add CR. - - -#ifndef NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED -#define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 1 -#endif - -// NRF_FPRINTF_DOUBLE_ENABLED - Enable IEEE-754 double precision formatting. - - -#ifndef NRF_FPRINTF_DOUBLE_ENABLED -#define NRF_FPRINTF_DOUBLE_ENABLED 0 -#endif - -// -//========================================================== - -// -//========================================================== - -// nRF_Log - -//========================================================== -// NRF_LOG_ENABLED - nrf_log - Logger -//========================================================== -#ifndef NRF_LOG_ENABLED -#define NRF_LOG_ENABLED 0 -#endif -// Log message pool - Configuration of log message pool - -//========================================================== -// NRF_LOG_MSGPOOL_ELEMENT_SIZE - Size of a single element in the pool of memory objects. -// If a small value is set, then performance of logs processing -// is degraded because data is fragmented. Bigger value impacts -// RAM memory utilization. The size is set to fit a message with -// a timestamp and up to 2 arguments in a single memory object. - -#ifndef NRF_LOG_MSGPOOL_ELEMENT_SIZE -#define NRF_LOG_MSGPOOL_ELEMENT_SIZE 20 -#endif - -// NRF_LOG_MSGPOOL_ELEMENT_COUNT - Number of elements in the pool of memory objects -// If a small value is set, then it may lead to a deadlock -// in certain cases if backend has high latency and holds -// multiple messages for long time. Bigger value impacts -// RAM memory usage. - -#ifndef NRF_LOG_MSGPOOL_ELEMENT_COUNT -#define NRF_LOG_MSGPOOL_ELEMENT_COUNT 8 -#endif - -// -//========================================================== - -// NRF_LOG_ALLOW_OVERFLOW - Configures behavior when circular buffer is full. - - -// If set then oldest logs are overwritten. Otherwise a -// marker is injected informing about overflow. - -#ifndef NRF_LOG_ALLOW_OVERFLOW -#define NRF_LOG_ALLOW_OVERFLOW 1 -#endif - -// NRF_LOG_BUFSIZE - Size of the buffer for storing logs (in bytes). - - -// Must be power of 2 and multiple of 4. -// If NRF_LOG_DEFERRED = 0 then buffer size can be reduced to minimum. -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 -// <2048=> 2048 -// <4096=> 4096 -// <8192=> 8192 -// <16384=> 16384 - -#ifndef NRF_LOG_BUFSIZE -#define NRF_LOG_BUFSIZE 1024 -#endif - -// NRF_LOG_CLI_CMDS - Enable CLI commands for the module. - - -#ifndef NRF_LOG_CLI_CMDS -#define NRF_LOG_CLI_CMDS 0 -#endif - -// NRF_LOG_DEFAULT_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_LOG_DEFAULT_LEVEL -#define NRF_LOG_DEFAULT_LEVEL 3 -#endif - -// NRF_LOG_DEFERRED - Enable deffered logger. - - -// Log data is buffered and can be processed in idle. - -#ifndef NRF_LOG_DEFERRED -#define NRF_LOG_DEFERRED 1 -#endif - -// NRF_LOG_FILTERS_ENABLED - Enable dynamic filtering of logs. - - -#ifndef NRF_LOG_FILTERS_ENABLED -#define NRF_LOG_FILTERS_ENABLED 0 -#endif - -// NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED - Enable use of critical region for non deffered mode when flushing logs. - - -// When enabled NRF_LOG_FLUSH is called from critical section when non deffered mode is used. -// Log output will never be corrupted as access to the log backend is exclusive -// but system will spend significant amount of time in critical section - -#ifndef NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED -#define NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED 0 -#endif - -// NRF_LOG_STR_PUSH_BUFFER_SIZE - Size of the buffer dedicated for strings stored using @ref NRF_LOG_PUSH. - -// <16=> 16 -// <32=> 32 -// <64=> 64 -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 - -#ifndef NRF_LOG_STR_PUSH_BUFFER_SIZE -#define NRF_LOG_STR_PUSH_BUFFER_SIZE 128 -#endif - -// NRF_LOG_STR_PUSH_BUFFER_SIZE - Size of the buffer dedicated for strings stored using @ref NRF_LOG_PUSH. - -// <16=> 16 -// <32=> 32 -// <64=> 64 -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 - -#ifndef NRF_LOG_STR_PUSH_BUFFER_SIZE -#define NRF_LOG_STR_PUSH_BUFFER_SIZE 128 -#endif - -// NRF_LOG_USES_COLORS - If enabled then ANSI escape code for colors is prefixed to every string -//========================================================== -#ifndef NRF_LOG_USES_COLORS -#define NRF_LOG_USES_COLORS 0 -#endif -// NRF_LOG_COLOR_DEFAULT - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LOG_COLOR_DEFAULT -#define NRF_LOG_COLOR_DEFAULT 0 -#endif - -// NRF_LOG_ERROR_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LOG_ERROR_COLOR -#define NRF_LOG_ERROR_COLOR 2 -#endif - -// NRF_LOG_WARNING_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LOG_WARNING_COLOR -#define NRF_LOG_WARNING_COLOR 4 -#endif - -// - -// NRF_LOG_USES_TIMESTAMP - Enable timestamping - -// Function for getting the timestamp is provided by the user -//========================================================== -#ifndef NRF_LOG_USES_TIMESTAMP -#define NRF_LOG_USES_TIMESTAMP 0 -#endif -// NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY - Default frequency of the timestamp (in Hz) or 0 to use app_timer frequency. -#ifndef NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY -#define NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY 0 -#endif - -// - -// nrf_log module configuration - -//========================================================== -// nrf_log in nRF_Core - -//========================================================== -// NRF_MPU_LIB_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_MPU_LIB_CONFIG_LOG_ENABLED -#define NRF_MPU_LIB_CONFIG_LOG_ENABLED 0 -#endif -// NRF_MPU_LIB_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_MPU_LIB_CONFIG_LOG_LEVEL -#define NRF_MPU_LIB_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_MPU_LIB_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MPU_LIB_CONFIG_INFO_COLOR -#define NRF_MPU_LIB_CONFIG_INFO_COLOR 0 -#endif - -// NRF_MPU_LIB_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MPU_LIB_CONFIG_DEBUG_COLOR -#define NRF_MPU_LIB_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_STACK_GUARD_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_STACK_GUARD_CONFIG_LOG_ENABLED -#define NRF_STACK_GUARD_CONFIG_LOG_ENABLED 0 -#endif -// NRF_STACK_GUARD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_STACK_GUARD_CONFIG_LOG_LEVEL -#define NRF_STACK_GUARD_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_STACK_GUARD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_STACK_GUARD_CONFIG_INFO_COLOR -#define NRF_STACK_GUARD_CONFIG_INFO_COLOR 0 -#endif - -// NRF_STACK_GUARD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_STACK_GUARD_CONFIG_DEBUG_COLOR -#define NRF_STACK_GUARD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TASK_MANAGER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TASK_MANAGER_CONFIG_LOG_ENABLED -#define TASK_MANAGER_CONFIG_LOG_ENABLED 0 -#endif -// TASK_MANAGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TASK_MANAGER_CONFIG_LOG_LEVEL -#define TASK_MANAGER_CONFIG_LOG_LEVEL 3 -#endif - -// TASK_MANAGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TASK_MANAGER_CONFIG_INFO_COLOR -#define TASK_MANAGER_CONFIG_INFO_COLOR 0 -#endif - -// TASK_MANAGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TASK_MANAGER_CONFIG_DEBUG_COLOR -#define TASK_MANAGER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// nrf_log in nRF_Drivers - -//========================================================== -// CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef CLOCK_CONFIG_LOG_ENABLED -#define CLOCK_CONFIG_LOG_ENABLED 0 -#endif -// CLOCK_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef CLOCK_CONFIG_LOG_LEVEL -#define CLOCK_CONFIG_LOG_LEVEL 3 -#endif - -// CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef CLOCK_CONFIG_INFO_COLOR -#define CLOCK_CONFIG_INFO_COLOR 0 -#endif - -// CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef CLOCK_CONFIG_DEBUG_COLOR -#define CLOCK_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// COMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef COMP_CONFIG_LOG_ENABLED -#define COMP_CONFIG_LOG_ENABLED 0 -#endif -// COMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef COMP_CONFIG_LOG_LEVEL -#define COMP_CONFIG_LOG_LEVEL 3 -#endif - -// COMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef COMP_CONFIG_INFO_COLOR -#define COMP_CONFIG_INFO_COLOR 0 -#endif - -// COMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef COMP_CONFIG_DEBUG_COLOR -#define COMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// GPIOTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef GPIOTE_CONFIG_LOG_ENABLED -#define GPIOTE_CONFIG_LOG_ENABLED 0 -#endif -// GPIOTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef GPIOTE_CONFIG_LOG_LEVEL -#define GPIOTE_CONFIG_LOG_LEVEL 3 -#endif - -// GPIOTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef GPIOTE_CONFIG_INFO_COLOR -#define GPIOTE_CONFIG_INFO_COLOR 0 -#endif - -// GPIOTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef GPIOTE_CONFIG_DEBUG_COLOR -#define GPIOTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// LPCOMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef LPCOMP_CONFIG_LOG_ENABLED -#define LPCOMP_CONFIG_LOG_ENABLED 0 -#endif -// LPCOMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef LPCOMP_CONFIG_LOG_LEVEL -#define LPCOMP_CONFIG_LOG_LEVEL 3 -#endif - -// LPCOMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef LPCOMP_CONFIG_INFO_COLOR -#define LPCOMP_CONFIG_INFO_COLOR 0 -#endif - -// LPCOMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef LPCOMP_CONFIG_DEBUG_COLOR -#define LPCOMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// MAX3421E_HOST_CONFIG_LOG_ENABLED - Enable logging in the module -//========================================================== -#ifndef MAX3421E_HOST_CONFIG_LOG_ENABLED -#define MAX3421E_HOST_CONFIG_LOG_ENABLED 0 -#endif -// MAX3421E_HOST_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef MAX3421E_HOST_CONFIG_LOG_LEVEL -#define MAX3421E_HOST_CONFIG_LOG_LEVEL 3 -#endif - -// MAX3421E_HOST_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MAX3421E_HOST_CONFIG_INFO_COLOR -#define MAX3421E_HOST_CONFIG_INFO_COLOR 0 -#endif - -// MAX3421E_HOST_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MAX3421E_HOST_CONFIG_DEBUG_COLOR -#define MAX3421E_HOST_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRFX_USBD_CONFIG_LOG_ENABLED - Enable logging in the module -//========================================================== -#ifndef NRFX_USBD_CONFIG_LOG_ENABLED -#define NRFX_USBD_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_USBD_CONFIG_LOG_LEVEL -#define NRFX_USBD_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_USBD_CONFIG_INFO_COLOR -#define NRFX_USBD_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_USBD_CONFIG_DEBUG_COLOR -#define NRFX_USBD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PDM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef PDM_CONFIG_LOG_ENABLED -#define PDM_CONFIG_LOG_ENABLED 0 -#endif -// PDM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PDM_CONFIG_LOG_LEVEL -#define PDM_CONFIG_LOG_LEVEL 3 -#endif - -// PDM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PDM_CONFIG_INFO_COLOR -#define PDM_CONFIG_INFO_COLOR 0 -#endif - -// PDM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PDM_CONFIG_DEBUG_COLOR -#define PDM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef PPI_CONFIG_LOG_ENABLED -#define PPI_CONFIG_LOG_ENABLED 0 -#endif -// PPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PPI_CONFIG_LOG_LEVEL -#define PPI_CONFIG_LOG_LEVEL 3 -#endif - -// PPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PPI_CONFIG_INFO_COLOR -#define PPI_CONFIG_INFO_COLOR 0 -#endif - -// PPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PPI_CONFIG_DEBUG_COLOR -#define PPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PWM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef PWM_CONFIG_LOG_ENABLED -#define PWM_CONFIG_LOG_ENABLED 0 -#endif -// PWM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PWM_CONFIG_LOG_LEVEL -#define PWM_CONFIG_LOG_LEVEL 3 -#endif - -// PWM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PWM_CONFIG_INFO_COLOR -#define PWM_CONFIG_INFO_COLOR 0 -#endif - -// PWM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PWM_CONFIG_DEBUG_COLOR -#define PWM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// QDEC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef QDEC_CONFIG_LOG_ENABLED -#define QDEC_CONFIG_LOG_ENABLED 0 -#endif -// QDEC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef QDEC_CONFIG_LOG_LEVEL -#define QDEC_CONFIG_LOG_LEVEL 3 -#endif - -// QDEC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef QDEC_CONFIG_INFO_COLOR -#define QDEC_CONFIG_INFO_COLOR 0 -#endif - -// QDEC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef QDEC_CONFIG_DEBUG_COLOR -#define QDEC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// RNG_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef RNG_CONFIG_LOG_ENABLED -#define RNG_CONFIG_LOG_ENABLED 0 -#endif -// RNG_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef RNG_CONFIG_LOG_LEVEL -#define RNG_CONFIG_LOG_LEVEL 3 -#endif - -// RNG_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RNG_CONFIG_INFO_COLOR -#define RNG_CONFIG_INFO_COLOR 0 -#endif - -// RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RNG_CONFIG_DEBUG_COLOR -#define RNG_CONFIG_DEBUG_COLOR 0 -#endif - -// RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED - Enables logging of random numbers. - - -#ifndef RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED -#define RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED 0 -#endif - -// - -// RTC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef RTC_CONFIG_LOG_ENABLED -#define RTC_CONFIG_LOG_ENABLED 0 -#endif -// RTC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef RTC_CONFIG_LOG_LEVEL -#define RTC_CONFIG_LOG_LEVEL 3 -#endif - -// RTC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RTC_CONFIG_INFO_COLOR -#define RTC_CONFIG_INFO_COLOR 0 -#endif - -// RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RTC_CONFIG_DEBUG_COLOR -#define RTC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// SAADC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SAADC_CONFIG_LOG_ENABLED -#define SAADC_CONFIG_LOG_ENABLED 0 -#endif -// SAADC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SAADC_CONFIG_LOG_LEVEL -#define SAADC_CONFIG_LOG_LEVEL 3 -#endif - -// SAADC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SAADC_CONFIG_INFO_COLOR -#define SAADC_CONFIG_INFO_COLOR 0 -#endif - -// SAADC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SAADC_CONFIG_DEBUG_COLOR -#define SAADC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// SPIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SPIS_CONFIG_LOG_ENABLED -#define SPIS_CONFIG_LOG_ENABLED 0 -#endif -// SPIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SPIS_CONFIG_LOG_LEVEL -#define SPIS_CONFIG_LOG_LEVEL 3 -#endif - -// SPIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPIS_CONFIG_INFO_COLOR -#define SPIS_CONFIG_INFO_COLOR 0 -#endif - -// SPIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPIS_CONFIG_DEBUG_COLOR -#define SPIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// SPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SPI_CONFIG_LOG_ENABLED -#define SPI_CONFIG_LOG_ENABLED 0 -#endif -// SPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SPI_CONFIG_LOG_LEVEL -#define SPI_CONFIG_LOG_LEVEL 3 -#endif - -// SPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPI_CONFIG_INFO_COLOR -#define SPI_CONFIG_INFO_COLOR 0 -#endif - -// SPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPI_CONFIG_DEBUG_COLOR -#define SPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TIMER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TIMER_CONFIG_LOG_ENABLED -#define TIMER_CONFIG_LOG_ENABLED 0 -#endif -// TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TIMER_CONFIG_LOG_LEVEL -#define TIMER_CONFIG_LOG_LEVEL 3 -#endif - -// TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TIMER_CONFIG_INFO_COLOR -#define TIMER_CONFIG_INFO_COLOR 0 -#endif - -// TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TIMER_CONFIG_DEBUG_COLOR -#define TIMER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TWIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TWIS_CONFIG_LOG_ENABLED -#define TWIS_CONFIG_LOG_ENABLED 0 -#endif -// TWIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TWIS_CONFIG_LOG_LEVEL -#define TWIS_CONFIG_LOG_LEVEL 3 -#endif - -// TWIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWIS_CONFIG_INFO_COLOR -#define TWIS_CONFIG_INFO_COLOR 0 -#endif - -// TWIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWIS_CONFIG_DEBUG_COLOR -#define TWIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TWI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TWI_CONFIG_LOG_ENABLED -#define TWI_CONFIG_LOG_ENABLED 0 -#endif -// TWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TWI_CONFIG_LOG_LEVEL -#define TWI_CONFIG_LOG_LEVEL 3 -#endif - -// TWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWI_CONFIG_INFO_COLOR -#define TWI_CONFIG_INFO_COLOR 0 -#endif - -// TWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWI_CONFIG_DEBUG_COLOR -#define TWI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef UART_CONFIG_LOG_ENABLED -#define UART_CONFIG_LOG_ENABLED 0 -#endif -// UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef UART_CONFIG_LOG_LEVEL -#define UART_CONFIG_LOG_LEVEL 3 -#endif - -// UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef UART_CONFIG_INFO_COLOR -#define UART_CONFIG_INFO_COLOR 0 -#endif - -// UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef UART_CONFIG_DEBUG_COLOR -#define UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// USBD_CONFIG_LOG_ENABLED - Enable logging in the module -//========================================================== -#ifndef USBD_CONFIG_LOG_ENABLED -#define USBD_CONFIG_LOG_ENABLED 0 -#endif -// USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef USBD_CONFIG_LOG_LEVEL -#define USBD_CONFIG_LOG_LEVEL 3 -#endif - -// USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef USBD_CONFIG_INFO_COLOR -#define USBD_CONFIG_INFO_COLOR 0 -#endif - -// USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef USBD_CONFIG_DEBUG_COLOR -#define USBD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// WDT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef WDT_CONFIG_LOG_ENABLED -#define WDT_CONFIG_LOG_ENABLED 0 -#endif -// WDT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef WDT_CONFIG_LOG_LEVEL -#define WDT_CONFIG_LOG_LEVEL 3 -#endif - -// WDT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef WDT_CONFIG_INFO_COLOR -#define WDT_CONFIG_INFO_COLOR 0 -#endif - -// WDT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef WDT_CONFIG_DEBUG_COLOR -#define WDT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// nrf_log in nRF_Libraries - -//========================================================== -// APP_BUTTON_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_BUTTON_CONFIG_LOG_ENABLED -#define APP_BUTTON_CONFIG_LOG_ENABLED 0 -#endif -// APP_BUTTON_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_BUTTON_CONFIG_LOG_LEVEL -#define APP_BUTTON_CONFIG_LOG_LEVEL 3 -#endif - -// APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled. - - -// If module generates a lot of logs, initial log level can -// be decreased to prevent flooding. Severity level can be -// increased on instance basis. -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL -#define APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL 3 -#endif - -// APP_BUTTON_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_BUTTON_CONFIG_INFO_COLOR -#define APP_BUTTON_CONFIG_INFO_COLOR 0 -#endif - -// APP_BUTTON_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_BUTTON_CONFIG_DEBUG_COLOR -#define APP_BUTTON_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_TIMER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_TIMER_CONFIG_LOG_ENABLED -#define APP_TIMER_CONFIG_LOG_ENABLED 0 -#endif -// APP_TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_TIMER_CONFIG_LOG_LEVEL -#define APP_TIMER_CONFIG_LOG_LEVEL 3 -#endif - -// APP_TIMER_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled. - - -// If module generates a lot of logs, initial log level can -// be decreased to prevent flooding. Severity level can be -// increased on instance basis. -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_TIMER_CONFIG_INITIAL_LOG_LEVEL -#define APP_TIMER_CONFIG_INITIAL_LOG_LEVEL 3 -#endif - -// APP_TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_TIMER_CONFIG_INFO_COLOR -#define APP_TIMER_CONFIG_INFO_COLOR 0 -#endif - -// APP_TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_TIMER_CONFIG_DEBUG_COLOR -#define APP_TIMER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED -#define APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL -#define APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_CDC_ACM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CDC_ACM_CONFIG_INFO_COLOR -#define APP_USBD_CDC_ACM_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR -#define APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_CONFIG_LOG_ENABLED - Enable logging in the module. -//========================================================== -#ifndef APP_USBD_CONFIG_LOG_ENABLED -#define APP_USBD_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_CONFIG_LOG_LEVEL -#define APP_USBD_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CONFIG_INFO_COLOR -#define APP_USBD_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CONFIG_DEBUG_COLOR -#define APP_USBD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_DUMMY_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_DUMMY_CONFIG_LOG_ENABLED -#define APP_USBD_DUMMY_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_DUMMY_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_DUMMY_CONFIG_LOG_LEVEL -#define APP_USBD_DUMMY_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_DUMMY_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_DUMMY_CONFIG_INFO_COLOR -#define APP_USBD_DUMMY_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_DUMMY_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_DUMMY_CONFIG_DEBUG_COLOR -#define APP_USBD_DUMMY_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_MSC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_MSC_CONFIG_LOG_ENABLED -#define APP_USBD_MSC_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_MSC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_MSC_CONFIG_LOG_LEVEL -#define APP_USBD_MSC_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_MSC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_MSC_CONFIG_INFO_COLOR -#define APP_USBD_MSC_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_MSC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_MSC_CONFIG_DEBUG_COLOR -#define APP_USBD_MSC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_ATFIFO_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_ATFIFO_CONFIG_LOG_ENABLED -#define NRF_ATFIFO_CONFIG_LOG_ENABLED 0 -#endif -// NRF_ATFIFO_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_ATFIFO_CONFIG_LOG_LEVEL -#define NRF_ATFIFO_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_ATFIFO_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_ATFIFO_CONFIG_INFO_COLOR -#define NRF_ATFIFO_CONFIG_INFO_COLOR 0 -#endif - -// NRF_ATFIFO_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_ATFIFO_CONFIG_DEBUG_COLOR -#define NRF_ATFIFO_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BALLOC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BALLOC_CONFIG_LOG_ENABLED -#define NRF_BALLOC_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BALLOC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BALLOC_CONFIG_LOG_LEVEL -#define NRF_BALLOC_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled. - - -// If module generates a lot of logs, initial log level can -// be decreased to prevent flooding. Severity level can be -// increased on instance basis. -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL -#define NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL 3 -#endif - -// NRF_BALLOC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BALLOC_CONFIG_INFO_COLOR -#define NRF_BALLOC_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BALLOC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BALLOC_CONFIG_DEBUG_COLOR -#define NRF_BALLOC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED -#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL -#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR -#define NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR -#define NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED -#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL -#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR -#define NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR -#define NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED -#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL -#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR -#define NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR -#define NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED -#define NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED 0 -#endif -// NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL -#define NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_CLI_BLE_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_BLE_UART_CONFIG_INFO_COLOR -#define NRF_CLI_BLE_UART_CONFIG_INFO_COLOR 0 -#endif - -// NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR -#define NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED -#define NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED 0 -#endif -// NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL -#define NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR -#define NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR 0 -#endif - -// NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR -#define NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_CLI_UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_CLI_UART_CONFIG_LOG_ENABLED -#define NRF_CLI_UART_CONFIG_LOG_ENABLED 0 -#endif -// NRF_CLI_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_CLI_UART_CONFIG_LOG_LEVEL -#define NRF_CLI_UART_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_CLI_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_UART_CONFIG_INFO_COLOR -#define NRF_CLI_UART_CONFIG_INFO_COLOR 0 -#endif - -// NRF_CLI_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_UART_CONFIG_DEBUG_COLOR -#define NRF_CLI_UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_LIBUARTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_LIBUARTE_CONFIG_LOG_ENABLED -#define NRF_LIBUARTE_CONFIG_LOG_ENABLED 0 -#endif -// NRF_LIBUARTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_LIBUARTE_CONFIG_LOG_LEVEL -#define NRF_LIBUARTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_LIBUARTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LIBUARTE_CONFIG_INFO_COLOR -#define NRF_LIBUARTE_CONFIG_INFO_COLOR 0 -#endif - -// NRF_LIBUARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LIBUARTE_CONFIG_DEBUG_COLOR -#define NRF_LIBUARTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_MEMOBJ_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_MEMOBJ_CONFIG_LOG_ENABLED -#define NRF_MEMOBJ_CONFIG_LOG_ENABLED 0 -#endif -// NRF_MEMOBJ_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_MEMOBJ_CONFIG_LOG_LEVEL -#define NRF_MEMOBJ_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_MEMOBJ_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MEMOBJ_CONFIG_INFO_COLOR -#define NRF_MEMOBJ_CONFIG_INFO_COLOR 0 -#endif - -// NRF_MEMOBJ_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MEMOBJ_CONFIG_DEBUG_COLOR -#define NRF_MEMOBJ_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_PWR_MGMT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_PWR_MGMT_CONFIG_LOG_ENABLED -#define NRF_PWR_MGMT_CONFIG_LOG_ENABLED 0 -#endif -// NRF_PWR_MGMT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_PWR_MGMT_CONFIG_LOG_LEVEL -#define NRF_PWR_MGMT_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_PWR_MGMT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_PWR_MGMT_CONFIG_INFO_COLOR -#define NRF_PWR_MGMT_CONFIG_INFO_COLOR 0 -#endif - -// NRF_PWR_MGMT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_PWR_MGMT_CONFIG_DEBUG_COLOR -#define NRF_PWR_MGMT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_QUEUE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_QUEUE_CONFIG_LOG_ENABLED -#define NRF_QUEUE_CONFIG_LOG_ENABLED 0 -#endif -// NRF_QUEUE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_QUEUE_CONFIG_LOG_LEVEL -#define NRF_QUEUE_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_QUEUE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_QUEUE_CONFIG_INFO_COLOR -#define NRF_QUEUE_CONFIG_INFO_COLOR 0 -#endif - -// NRF_QUEUE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_QUEUE_CONFIG_DEBUG_COLOR -#define NRF_QUEUE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_ANT_LOG_ENABLED - Enable logging in SoftDevice handler (ANT) module. -//========================================================== -#ifndef NRF_SDH_ANT_LOG_ENABLED -#define NRF_SDH_ANT_LOG_ENABLED 0 -#endif -// NRF_SDH_ANT_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_ANT_LOG_LEVEL -#define NRF_SDH_ANT_LOG_LEVEL 3 -#endif - -// NRF_SDH_ANT_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_ANT_INFO_COLOR -#define NRF_SDH_ANT_INFO_COLOR 0 -#endif - -// NRF_SDH_ANT_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_ANT_DEBUG_COLOR -#define NRF_SDH_ANT_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_BLE_LOG_ENABLED - Enable logging in SoftDevice handler (BLE) module. -//========================================================== -#ifndef NRF_SDH_BLE_LOG_ENABLED -#define NRF_SDH_BLE_LOG_ENABLED 1 -#endif -// NRF_SDH_BLE_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_BLE_LOG_LEVEL -#define NRF_SDH_BLE_LOG_LEVEL 3 -#endif - -// NRF_SDH_BLE_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_BLE_INFO_COLOR -#define NRF_SDH_BLE_INFO_COLOR 0 -#endif - -// NRF_SDH_BLE_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_BLE_DEBUG_COLOR -#define NRF_SDH_BLE_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_LOG_ENABLED - Enable logging in SoftDevice handler module. -//========================================================== -#ifndef NRF_SDH_LOG_ENABLED -#define NRF_SDH_LOG_ENABLED 1 -#endif -// NRF_SDH_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_LOG_LEVEL -#define NRF_SDH_LOG_LEVEL 3 -#endif - -// NRF_SDH_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_INFO_COLOR -#define NRF_SDH_INFO_COLOR 0 -#endif - -// NRF_SDH_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_DEBUG_COLOR -#define NRF_SDH_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_SOC_LOG_ENABLED - Enable logging in SoftDevice handler (SoC) module. -//========================================================== -#ifndef NRF_SDH_SOC_LOG_ENABLED -#define NRF_SDH_SOC_LOG_ENABLED 1 -#endif -// NRF_SDH_SOC_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_SOC_LOG_LEVEL -#define NRF_SDH_SOC_LOG_LEVEL 3 -#endif - -// NRF_SDH_SOC_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_SOC_INFO_COLOR -#define NRF_SDH_SOC_INFO_COLOR 0 -#endif - -// NRF_SDH_SOC_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_SOC_DEBUG_COLOR -#define NRF_SDH_SOC_DEBUG_COLOR 0 -#endif - -// - -// NRF_SORTLIST_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_SORTLIST_CONFIG_LOG_ENABLED -#define NRF_SORTLIST_CONFIG_LOG_ENABLED 0 -#endif -// NRF_SORTLIST_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SORTLIST_CONFIG_LOG_LEVEL -#define NRF_SORTLIST_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_SORTLIST_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SORTLIST_CONFIG_INFO_COLOR -#define NRF_SORTLIST_CONFIG_INFO_COLOR 0 -#endif - -// NRF_SORTLIST_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SORTLIST_CONFIG_DEBUG_COLOR -#define NRF_SORTLIST_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_TWI_SENSOR_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_TWI_SENSOR_CONFIG_LOG_ENABLED -#define NRF_TWI_SENSOR_CONFIG_LOG_ENABLED 0 -#endif -// NRF_TWI_SENSOR_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_TWI_SENSOR_CONFIG_LOG_LEVEL -#define NRF_TWI_SENSOR_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_TWI_SENSOR_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_TWI_SENSOR_CONFIG_INFO_COLOR -#define NRF_TWI_SENSOR_CONFIG_INFO_COLOR 0 -#endif - -// NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR -#define NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PM_LOG_ENABLED - Enable logging in Peer Manager and its submodules. -//========================================================== -#ifndef PM_LOG_ENABLED -#define PM_LOG_ENABLED 1 -#endif -// PM_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PM_LOG_LEVEL -#define PM_LOG_LEVEL 3 -#endif - -// PM_LOG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PM_LOG_INFO_COLOR -#define PM_LOG_INFO_COLOR 0 -#endif - -// PM_LOG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PM_LOG_DEBUG_COLOR -#define PM_LOG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// nrf_log in nRF_Serialization - -//========================================================== -// SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED -#define SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED 0 -#endif -// SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL -#define SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL 3 -#endif - -// SER_HAL_TRANSPORT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SER_HAL_TRANSPORT_CONFIG_INFO_COLOR -#define SER_HAL_TRANSPORT_CONFIG_INFO_COLOR 0 -#endif - -// SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR -#define SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// -//========================================================== - -// - -// NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED - nrf_log_str_formatter - Log string formatter - - -#ifndef NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED -#define NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED 1 -#endif - -// -//========================================================== - -// nRF_SoftDevice - -//========================================================== -// NRF_SDH_BLE_ENABLED - nrf_sdh_ble - SoftDevice BLE event handler -//========================================================== -#ifndef NRF_SDH_BLE_ENABLED -#define NRF_SDH_BLE_ENABLED 0 -#endif -// BLE Stack configuration - Stack configuration parameters - -// The SoftDevice handler will configure the stack with these parameters when calling @ref nrf_sdh_ble_default_cfg_set. -// Other libraries might depend on these values; keep them up-to-date even if you are not explicitely calling @ref nrf_sdh_ble_default_cfg_set. -//========================================================== -// NRF_SDH_BLE_GAP_DATA_LENGTH <27-251> - - -// Requested BLE GAP data length to be negotiated. - -#ifndef NRF_SDH_BLE_GAP_DATA_LENGTH -#define NRF_SDH_BLE_GAP_DATA_LENGTH 27 -#endif - -// NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. -#ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT -#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 0 -#endif - -// NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. -#ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT -#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0 -#endif - -// NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count. -// Maximum number of total concurrent connections using the default configuration. - -#ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT -#define NRF_SDH_BLE_TOTAL_LINK_COUNT 1 -#endif - -// NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length. -// The time set aside for this connection on every connection interval in 1.25 ms units. - -#ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH -#define NRF_SDH_BLE_GAP_EVENT_LENGTH 6 -#endif - -// NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. -#ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE -#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 23 -#endif - -// NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4. -#ifndef NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE -#define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408 -#endif - -// NRF_SDH_BLE_VS_UUID_COUNT - The number of vendor-specific UUIDs. -#ifndef NRF_SDH_BLE_VS_UUID_COUNT -#define NRF_SDH_BLE_VS_UUID_COUNT 0 -#endif - -// NRF_SDH_BLE_SERVICE_CHANGED - Include the Service Changed characteristic in the Attribute Table. - - -#ifndef NRF_SDH_BLE_SERVICE_CHANGED -#define NRF_SDH_BLE_SERVICE_CHANGED 0 -#endif - -// -//========================================================== - -// BLE Observers - Observers and priority levels - -//========================================================== -// NRF_SDH_BLE_OBSERVER_PRIO_LEVELS - Total number of priority levels for BLE observers. -// This setting configures the number of priority levels available for BLE event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_BLE_OBSERVER_PRIO_LEVELS -#define NRF_SDH_BLE_OBSERVER_PRIO_LEVELS 4 -#endif - -// BLE Observers priorities - Invididual priorities - -//========================================================== -// BLE_ADV_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Advertising module. - -#ifndef BLE_ADV_BLE_OBSERVER_PRIO -#define BLE_ADV_BLE_OBSERVER_PRIO 1 -#endif - -// BLE_ANCS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Apple Notification Service Client. - -#ifndef BLE_ANCS_C_BLE_OBSERVER_PRIO -#define BLE_ANCS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_ANS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Alert Notification Service Client. - -#ifndef BLE_ANS_C_BLE_OBSERVER_PRIO -#define BLE_ANS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_BAS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Battery Service. - -#ifndef BLE_BAS_BLE_OBSERVER_PRIO -#define BLE_BAS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_BAS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Battery Service Client. - -#ifndef BLE_BAS_C_BLE_OBSERVER_PRIO -#define BLE_BAS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_BPS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Blood Pressure Service. - -#ifndef BLE_BPS_BLE_OBSERVER_PRIO -#define BLE_BPS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_CONN_PARAMS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Connection parameters module. - -#ifndef BLE_CONN_PARAMS_BLE_OBSERVER_PRIO -#define BLE_CONN_PARAMS_BLE_OBSERVER_PRIO 1 -#endif - -// BLE_CONN_STATE_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Connection State module. - -#ifndef BLE_CONN_STATE_BLE_OBSERVER_PRIO -#define BLE_CONN_STATE_BLE_OBSERVER_PRIO 0 -#endif - -// BLE_CSCS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Cycling Speed and Cadence Service. - -#ifndef BLE_CSCS_BLE_OBSERVER_PRIO -#define BLE_CSCS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_CTS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Current Time Service Client. - -#ifndef BLE_CTS_C_BLE_OBSERVER_PRIO -#define BLE_CTS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_DB_DISC_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Database Discovery module. - -#ifndef BLE_DB_DISC_BLE_OBSERVER_PRIO -#define BLE_DB_DISC_BLE_OBSERVER_PRIO 1 -#endif - -// BLE_DFU_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the DFU Service. - -#ifndef BLE_DFU_BLE_OBSERVER_PRIO -#define BLE_DFU_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_DIS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Device Information Client. - -#ifndef BLE_DIS_C_BLE_OBSERVER_PRIO -#define BLE_DIS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_GLS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Glucose Service. - -#ifndef BLE_GLS_BLE_OBSERVER_PRIO -#define BLE_GLS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HIDS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Human Interface Device Service. - -#ifndef BLE_HIDS_BLE_OBSERVER_PRIO -#define BLE_HIDS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HRS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Heart Rate Service. - -#ifndef BLE_HRS_BLE_OBSERVER_PRIO -#define BLE_HRS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HRS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Heart Rate Service Client. - -#ifndef BLE_HRS_C_BLE_OBSERVER_PRIO -#define BLE_HRS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HTS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Health Thermometer Service. - -#ifndef BLE_HTS_BLE_OBSERVER_PRIO -#define BLE_HTS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_IAS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Immediate Alert Service. - -#ifndef BLE_IAS_BLE_OBSERVER_PRIO -#define BLE_IAS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_IAS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Immediate Alert Service Client. - -#ifndef BLE_IAS_C_BLE_OBSERVER_PRIO -#define BLE_IAS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LBS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the LED Button Service. - -#ifndef BLE_LBS_BLE_OBSERVER_PRIO -#define BLE_LBS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LBS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the LED Button Service Client. - -#ifndef BLE_LBS_C_BLE_OBSERVER_PRIO -#define BLE_LBS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LLS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Link Loss Service. - -#ifndef BLE_LLS_BLE_OBSERVER_PRIO -#define BLE_LLS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LNS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Location Navigation Service. - -#ifndef BLE_LNS_BLE_OBSERVER_PRIO -#define BLE_LNS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_NUS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the UART Service. - -#ifndef BLE_NUS_BLE_OBSERVER_PRIO -#define BLE_NUS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_NUS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the UART Central Service. - -#ifndef BLE_NUS_C_BLE_OBSERVER_PRIO -#define BLE_NUS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_OTS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Object transfer service. - -#ifndef BLE_OTS_BLE_OBSERVER_PRIO -#define BLE_OTS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_OTS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Object transfer service client. - -#ifndef BLE_OTS_C_BLE_OBSERVER_PRIO -#define BLE_OTS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_RSCS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Running Speed and Cadence Service. - -#ifndef BLE_RSCS_BLE_OBSERVER_PRIO -#define BLE_RSCS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_RSCS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Running Speed and Cadence Client. - -#ifndef BLE_RSCS_C_BLE_OBSERVER_PRIO -#define BLE_RSCS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_TPS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the TX Power Service. - -#ifndef BLE_TPS_BLE_OBSERVER_PRIO -#define BLE_TPS_BLE_OBSERVER_PRIO 2 -#endif - -// BSP_BTN_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Button Control module. - -#ifndef BSP_BTN_BLE_OBSERVER_PRIO -#define BSP_BTN_BLE_OBSERVER_PRIO 1 -#endif - -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the NFC pairing library. - -#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 -#endif - -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the NFC pairing library. - -#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 -#endif - -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the NFC pairing library. - -#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 -#endif - -// NRF_BLE_BMS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Bond Management Service. - -#ifndef NRF_BLE_BMS_BLE_OBSERVER_PRIO -#define NRF_BLE_BMS_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_CGMS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Contiuon Glucose Monitoring Service. - -#ifndef NRF_BLE_CGMS_BLE_OBSERVER_PRIO -#define NRF_BLE_CGMS_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_ES_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Eddystone module. - -#ifndef NRF_BLE_ES_BLE_OBSERVER_PRIO -#define NRF_BLE_ES_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the GATT Service Client. - -#ifndef NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO -#define NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_GATT_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the GATT module. - -#ifndef NRF_BLE_GATT_BLE_OBSERVER_PRIO -#define NRF_BLE_GATT_BLE_OBSERVER_PRIO 1 -#endif - -// NRF_BLE_GQ_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the GATT Queue module. - -#ifndef NRF_BLE_GQ_BLE_OBSERVER_PRIO -#define NRF_BLE_GQ_BLE_OBSERVER_PRIO 1 -#endif - -// NRF_BLE_QWR_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Queued writes module. - -#ifndef NRF_BLE_QWR_BLE_OBSERVER_PRIO -#define NRF_BLE_QWR_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_SCAN_OBSERVER_PRIO -// Priority for dispatching the BLE events to the Scanning Module. - -#ifndef NRF_BLE_SCAN_OBSERVER_PRIO -#define NRF_BLE_SCAN_OBSERVER_PRIO 1 -#endif - -// PM_BLE_OBSERVER_PRIO - Priority with which BLE events are dispatched to the Peer Manager module. -#ifndef PM_BLE_OBSERVER_PRIO -#define PM_BLE_OBSERVER_PRIO 1 -#endif - -// -//========================================================== - -// -//========================================================== - - -// - -// NRF_SDH_ENABLED - nrf_sdh - SoftDevice handler -//========================================================== -#ifndef NRF_SDH_ENABLED -#define NRF_SDH_ENABLED 0 -#endif -// Dispatch model - -// This setting configures how Stack events are dispatched to the application. -//========================================================== -// NRF_SDH_DISPATCH_MODEL - - -// NRF_SDH_DISPATCH_MODEL_INTERRUPT: SoftDevice events are passed to the application from the interrupt context. -// NRF_SDH_DISPATCH_MODEL_APPSH: SoftDevice events are scheduled using @ref app_scheduler. -// NRF_SDH_DISPATCH_MODEL_POLLING: SoftDevice events are to be fetched manually. -// <0=> NRF_SDH_DISPATCH_MODEL_INTERRUPT -// <1=> NRF_SDH_DISPATCH_MODEL_APPSH -// <2=> NRF_SDH_DISPATCH_MODEL_POLLING - -#ifndef NRF_SDH_DISPATCH_MODEL -#define NRF_SDH_DISPATCH_MODEL 0 -#endif - -// -//========================================================== - -// Clock - SoftDevice clock configuration - -//========================================================== -// NRF_SDH_CLOCK_LF_SRC - SoftDevice clock source. - -// <0=> NRF_CLOCK_LF_SRC_RC -// <1=> NRF_CLOCK_LF_SRC_XTAL -// <2=> NRF_CLOCK_LF_SRC_SYNTH - -#ifndef NRF_SDH_CLOCK_LF_SRC -#define NRF_SDH_CLOCK_LF_SRC 1 -#endif - -// NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. -#ifndef NRF_SDH_CLOCK_LF_RC_CTIV -#define NRF_SDH_CLOCK_LF_RC_CTIV 0 -#endif - -// NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. -// How often (in number of calibration intervals) the RC oscillator shall be calibrated -// if the temperature has not changed. - -#ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV -#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0 -#endif - -// NRF_SDH_CLOCK_LF_ACCURACY - External clock accuracy used in the LL to compute timing. - -// <0=> NRF_CLOCK_LF_ACCURACY_250_PPM -// <1=> NRF_CLOCK_LF_ACCURACY_500_PPM -// <2=> NRF_CLOCK_LF_ACCURACY_150_PPM -// <3=> NRF_CLOCK_LF_ACCURACY_100_PPM -// <4=> NRF_CLOCK_LF_ACCURACY_75_PPM -// <5=> NRF_CLOCK_LF_ACCURACY_50_PPM -// <6=> NRF_CLOCK_LF_ACCURACY_30_PPM -// <7=> NRF_CLOCK_LF_ACCURACY_20_PPM -// <8=> NRF_CLOCK_LF_ACCURACY_10_PPM -// <9=> NRF_CLOCK_LF_ACCURACY_5_PPM -// <10=> NRF_CLOCK_LF_ACCURACY_2_PPM -// <11=> NRF_CLOCK_LF_ACCURACY_1_PPM - -#ifndef NRF_SDH_CLOCK_LF_ACCURACY -#define NRF_SDH_CLOCK_LF_ACCURACY 7 -#endif - -// -//========================================================== - -// SDH Observers - Observers and priority levels - -//========================================================== -// NRF_SDH_REQ_OBSERVER_PRIO_LEVELS - Total number of priority levels for request observers. -// This setting configures the number of priority levels available for the SoftDevice request event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_REQ_OBSERVER_PRIO_LEVELS -#define NRF_SDH_REQ_OBSERVER_PRIO_LEVELS 2 -#endif - -// NRF_SDH_STATE_OBSERVER_PRIO_LEVELS - Total number of priority levels for state observers. -// This setting configures the number of priority levels available for the SoftDevice state event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_STATE_OBSERVER_PRIO_LEVELS -#define NRF_SDH_STATE_OBSERVER_PRIO_LEVELS 2 -#endif - -// NRF_SDH_STACK_OBSERVER_PRIO_LEVELS - Total number of priority levels for stack event observers. -// This setting configures the number of priority levels available for the SoftDevice stack event handlers (ANT, BLE, SoC). -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_STACK_OBSERVER_PRIO_LEVELS -#define NRF_SDH_STACK_OBSERVER_PRIO_LEVELS 2 -#endif - - -// State Observers priorities - Invididual priorities - -//========================================================== -// CLOCK_CONFIG_STATE_OBSERVER_PRIO -// Priority with which state events are dispatched to the Clock driver. - -#ifndef CLOCK_CONFIG_STATE_OBSERVER_PRIO -#define CLOCK_CONFIG_STATE_OBSERVER_PRIO 0 -#endif - -// POWER_CONFIG_STATE_OBSERVER_PRIO -// Priority with which state events are dispatched to the Power driver. - -#ifndef POWER_CONFIG_STATE_OBSERVER_PRIO -#define POWER_CONFIG_STATE_OBSERVER_PRIO 0 -#endif - -// RNG_CONFIG_STATE_OBSERVER_PRIO -// Priority with which state events are dispatched to this module. - -#ifndef RNG_CONFIG_STATE_OBSERVER_PRIO -#define RNG_CONFIG_STATE_OBSERVER_PRIO 0 -#endif - -// -//========================================================== - -// Stack Event Observers priorities - Invididual priorities - -//========================================================== -// NRF_SDH_ANT_STACK_OBSERVER_PRIO -// This setting configures the priority with which ANT events are processed with respect to other events coming from the stack. -// Modify this setting if you need to have ANT events dispatched before or after other stack events, such as BLE or SoC. -// Zero is the highest priority. - -#ifndef NRF_SDH_ANT_STACK_OBSERVER_PRIO -#define NRF_SDH_ANT_STACK_OBSERVER_PRIO 0 -#endif - -// NRF_SDH_BLE_STACK_OBSERVER_PRIO -// This setting configures the priority with which BLE events are processed with respect to other events coming from the stack. -// Modify this setting if you need to have BLE events dispatched before or after other stack events, such as ANT or SoC. -// Zero is the highest priority. - -#ifndef NRF_SDH_BLE_STACK_OBSERVER_PRIO -#define NRF_SDH_BLE_STACK_OBSERVER_PRIO 0 -#endif - -// NRF_SDH_SOC_STACK_OBSERVER_PRIO -// This setting configures the priority with which SoC events are processed with respect to other events coming from the stack. -// Modify this setting if you need to have SoC events dispatched before or after other stack events, such as ANT or BLE. -// Zero is the highest priority. - -#ifndef NRF_SDH_SOC_STACK_OBSERVER_PRIO -#define NRF_SDH_SOC_STACK_OBSERVER_PRIO 0 -#endif - -// -//========================================================== - -// -//========================================================== - - -// - -// NRF_SDH_SOC_ENABLED - nrf_sdh_soc - SoftDevice SoC event handler -//========================================================== -#ifndef NRF_SDH_SOC_ENABLED -#define NRF_SDH_SOC_ENABLED 0 -#endif -// SoC Observers - Observers and priority levels - -//========================================================== -// NRF_SDH_SOC_OBSERVER_PRIO_LEVELS - Total number of priority levels for SoC observers. -// This setting configures the number of priority levels available for the SoC event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_SOC_OBSERVER_PRIO_LEVELS -#define NRF_SDH_SOC_OBSERVER_PRIO_LEVELS 2 -#endif - -// SoC Observers priorities - Invididual priorities - -//========================================================== -// BLE_DFU_SOC_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the DFU Service. - -#ifndef BLE_DFU_SOC_OBSERVER_PRIO -#define BLE_DFU_SOC_OBSERVER_PRIO 1 -#endif - -// CLOCK_CONFIG_SOC_OBSERVER_PRIO -// Priority with which SoC events are dispatched to the Clock driver. - -#ifndef CLOCK_CONFIG_SOC_OBSERVER_PRIO -#define CLOCK_CONFIG_SOC_OBSERVER_PRIO 0 -#endif - -// POWER_CONFIG_SOC_OBSERVER_PRIO -// Priority with which SoC events are dispatched to the Power driver. - -#ifndef POWER_CONFIG_SOC_OBSERVER_PRIO -#define POWER_CONFIG_SOC_OBSERVER_PRIO 0 -#endif - -// -//========================================================== - -// -//========================================================== - - -// - -// -//========================================================== - -// <<< end of configuration section >>> -#endif //SDK_CONFIG_H - diff --git a/third_party/NordicSemiconductor/config/nrf52833/config/sdk_config.h b/third_party/NordicSemiconductor/config/nrf52833/config/sdk_config.h deleted file mode 100644 index 13eb3bee2..000000000 --- a/third_party/NordicSemiconductor/config/nrf52833/config/sdk_config.h +++ /dev/null @@ -1,11576 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - - - -#ifndef SDK_CONFIG_H -#define SDK_CONFIG_H -// <<< Use Configuration Wizard in Context Menu >>>\n -#ifdef USE_APP_CONFIG -#include "app_config.h" -#endif -// nRF_BLE - -//========================================================== -// BLE_ADVERTISING_ENABLED - ble_advertising - Advertising module - - -#ifndef BLE_ADVERTISING_ENABLED -#define BLE_ADVERTISING_ENABLED 0 -#endif - -// BLE_DTM_ENABLED - ble_dtm - Module for testing RF/PHY using DTM commands - - -#ifndef BLE_DTM_ENABLED -#define BLE_DTM_ENABLED 0 -#endif - -// BLE_RACP_ENABLED - ble_racp - Record Access Control Point library - - -#ifndef BLE_RACP_ENABLED -#define BLE_RACP_ENABLED 0 -#endif - -// NRF_BLE_QWR_ENABLED - nrf_ble_qwr - Queued writes support module (prepare/execute write) -//========================================================== -#ifndef NRF_BLE_QWR_ENABLED -#define NRF_BLE_QWR_ENABLED 0 -#endif -// NRF_BLE_QWR_MAX_ATTR - Maximum number of attribute handles that can be registered. This number must be adjusted according to the number of attributes for which Queued Writes will be enabled. If it is zero, the module will reject all Queued Write requests. -#ifndef NRF_BLE_QWR_MAX_ATTR -#define NRF_BLE_QWR_MAX_ATTR 0 -#endif - -// - -// PEER_MANAGER_ENABLED - peer_manager - Peer Manager -//========================================================== -#ifndef PEER_MANAGER_ENABLED -#define PEER_MANAGER_ENABLED 0 -#endif -// PM_MAX_REGISTRANTS - Number of event handlers that can be registered. -#ifndef PM_MAX_REGISTRANTS -#define PM_MAX_REGISTRANTS 3 -#endif - -// PM_FLASH_BUFFERS - Number of internal buffers for flash operations. -// Decrease this value to lower RAM usage. - -#ifndef PM_FLASH_BUFFERS -#define PM_FLASH_BUFFERS 4 -#endif - -// PM_CENTRAL_ENABLED - Enable/disable central-specific Peer Manager functionality. - - -// Enable/disable central-specific Peer Manager functionality. - -#ifndef PM_CENTRAL_ENABLED -#define PM_CENTRAL_ENABLED 1 -#endif - -// PM_SERVICE_CHANGED_ENABLED - Enable/disable the service changed management for GATT server in Peer Manager. - - -// If not using a GATT server, or using a server wihout a service changed characteristic, -// disable this to save code space. - -#ifndef PM_SERVICE_CHANGED_ENABLED -#define PM_SERVICE_CHANGED_ENABLED 1 -#endif - -// PM_PEER_RANKS_ENABLED - Enable/disable the peer rank management in Peer Manager. - - -// Set this to false to save code space if not using the peer rank API. - -#ifndef PM_PEER_RANKS_ENABLED -#define PM_PEER_RANKS_ENABLED 1 -#endif - -// PM_LESC_ENABLED - Enable/disable LESC support in Peer Manager. - - -// If set to true, you need to call nrf_ble_lesc_request_handler() in the main loop to respond to LESC-related BLE events. If LESC support is not required, set this to false to save code space. - -#ifndef PM_LESC_ENABLED -#define PM_LESC_ENABLED 0 -#endif - -// PM_RA_PROTECTION_ENABLED - Enable/disable protection against repeated pairing attempts in Peer Manager. -//========================================================== -#ifndef PM_RA_PROTECTION_ENABLED -#define PM_RA_PROTECTION_ENABLED 0 -#endif -// PM_RA_PROTECTION_TRACKED_PEERS_NUM - Maximum number of peers whose authorization status can be tracked. -#ifndef PM_RA_PROTECTION_TRACKED_PEERS_NUM -#define PM_RA_PROTECTION_TRACKED_PEERS_NUM 8 -#endif - -// PM_RA_PROTECTION_MIN_WAIT_INTERVAL - Minimum waiting interval (in ms) before a new pairing attempt can be initiated. -#ifndef PM_RA_PROTECTION_MIN_WAIT_INTERVAL -#define PM_RA_PROTECTION_MIN_WAIT_INTERVAL 4000 -#endif - -// PM_RA_PROTECTION_MAX_WAIT_INTERVAL - Maximum waiting interval (in ms) before a new pairing attempt can be initiated. -#ifndef PM_RA_PROTECTION_MAX_WAIT_INTERVAL -#define PM_RA_PROTECTION_MAX_WAIT_INTERVAL 64000 -#endif - -// PM_RA_PROTECTION_REWARD_PERIOD - Reward period (in ms). -// The waiting interval is gradually decreased when no new failed pairing attempts are made during reward period. - -#ifndef PM_RA_PROTECTION_REWARD_PERIOD -#define PM_RA_PROTECTION_REWARD_PERIOD 10000 -#endif - -// - -// PM_HANDLER_SEC_DELAY_MS - Delay before starting security. -// This might be necessary for interoperability reasons, especially as peripheral. - -#ifndef PM_HANDLER_SEC_DELAY_MS -#define PM_HANDLER_SEC_DELAY_MS 0 -#endif - -// - -// -//========================================================== - -// nRF_BLE_Services - -//========================================================== -// BLE_ANCS_C_ENABLED - ble_ancs_c - Apple Notification Service Client - - -#ifndef BLE_ANCS_C_ENABLED -#define BLE_ANCS_C_ENABLED 0 -#endif - -// BLE_ANS_C_ENABLED - ble_ans_c - Alert Notification Service Client - - -#ifndef BLE_ANS_C_ENABLED -#define BLE_ANS_C_ENABLED 0 -#endif - -// BLE_BAS_C_ENABLED - ble_bas_c - Battery Service Client - - -#ifndef BLE_BAS_C_ENABLED -#define BLE_BAS_C_ENABLED 0 -#endif - -// BLE_BAS_ENABLED - ble_bas - Battery Service -//========================================================== -#ifndef BLE_BAS_ENABLED -#define BLE_BAS_ENABLED 0 -#endif -// BLE_BAS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef BLE_BAS_CONFIG_LOG_ENABLED -#define BLE_BAS_CONFIG_LOG_ENABLED 0 -#endif -// BLE_BAS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef BLE_BAS_CONFIG_LOG_LEVEL -#define BLE_BAS_CONFIG_LOG_LEVEL 3 -#endif - -// BLE_BAS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_BAS_CONFIG_INFO_COLOR -#define BLE_BAS_CONFIG_INFO_COLOR 0 -#endif - -// BLE_BAS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_BAS_CONFIG_DEBUG_COLOR -#define BLE_BAS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// BLE_CSCS_ENABLED - ble_cscs - Cycling Speed and Cadence Service - - -#ifndef BLE_CSCS_ENABLED -#define BLE_CSCS_ENABLED 0 -#endif - -// BLE_CTS_C_ENABLED - ble_cts_c - Current Time Service Client - - -#ifndef BLE_CTS_C_ENABLED -#define BLE_CTS_C_ENABLED 0 -#endif - -// BLE_DIS_ENABLED - ble_dis - Device Information Service - - -#ifndef BLE_DIS_ENABLED -#define BLE_DIS_ENABLED 0 -#endif - -// BLE_GLS_ENABLED - ble_gls - Glucose Service - - -#ifndef BLE_GLS_ENABLED -#define BLE_GLS_ENABLED 0 -#endif - -// BLE_HIDS_ENABLED - ble_hids - Human Interface Device Service - - -#ifndef BLE_HIDS_ENABLED -#define BLE_HIDS_ENABLED 0 -#endif - -// BLE_HRS_C_ENABLED - ble_hrs_c - Heart Rate Service Client - - -#ifndef BLE_HRS_C_ENABLED -#define BLE_HRS_C_ENABLED 0 -#endif - -// BLE_HRS_ENABLED - ble_hrs - Heart Rate Service - - -#ifndef BLE_HRS_ENABLED -#define BLE_HRS_ENABLED 0 -#endif - -// BLE_HTS_ENABLED - ble_hts - Health Thermometer Service - - -#ifndef BLE_HTS_ENABLED -#define BLE_HTS_ENABLED 0 -#endif - -// BLE_IAS_C_ENABLED - ble_ias_c - Immediate Alert Service Client - - -#ifndef BLE_IAS_C_ENABLED -#define BLE_IAS_C_ENABLED 0 -#endif - -// BLE_IAS_ENABLED - ble_ias - Immediate Alert Service -//========================================================== -#ifndef BLE_IAS_ENABLED -#define BLE_IAS_ENABLED 0 -#endif -// BLE_IAS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef BLE_IAS_CONFIG_LOG_ENABLED -#define BLE_IAS_CONFIG_LOG_ENABLED 0 -#endif -// BLE_IAS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef BLE_IAS_CONFIG_LOG_LEVEL -#define BLE_IAS_CONFIG_LOG_LEVEL 3 -#endif - -// BLE_IAS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_IAS_CONFIG_INFO_COLOR -#define BLE_IAS_CONFIG_INFO_COLOR 0 -#endif - -// BLE_IAS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_IAS_CONFIG_DEBUG_COLOR -#define BLE_IAS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// BLE_LBS_C_ENABLED - ble_lbs_c - Nordic LED Button Service Client - - -#ifndef BLE_LBS_C_ENABLED -#define BLE_LBS_C_ENABLED 0 -#endif - -// BLE_LBS_ENABLED - ble_lbs - LED Button Service - - -#ifndef BLE_LBS_ENABLED -#define BLE_LBS_ENABLED 0 -#endif - -// BLE_LLS_ENABLED - ble_lls - Link Loss Service - - -#ifndef BLE_LLS_ENABLED -#define BLE_LLS_ENABLED 0 -#endif - -// BLE_NUS_C_ENABLED - ble_nus_c - Nordic UART Central Service - - -#ifndef BLE_NUS_C_ENABLED -#define BLE_NUS_C_ENABLED 0 -#endif - -// BLE_NUS_ENABLED - ble_nus - Nordic UART Service -//========================================================== -#ifndef BLE_NUS_ENABLED -#define BLE_NUS_ENABLED 0 -#endif -// BLE_NUS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef BLE_NUS_CONFIG_LOG_ENABLED -#define BLE_NUS_CONFIG_LOG_ENABLED 0 -#endif -// BLE_NUS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef BLE_NUS_CONFIG_LOG_LEVEL -#define BLE_NUS_CONFIG_LOG_LEVEL 3 -#endif - -// BLE_NUS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_NUS_CONFIG_INFO_COLOR -#define BLE_NUS_CONFIG_INFO_COLOR 0 -#endif - -// BLE_NUS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_NUS_CONFIG_DEBUG_COLOR -#define BLE_NUS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// BLE_RSCS_C_ENABLED - ble_rscs_c - Running Speed and Cadence Client - - -#ifndef BLE_RSCS_C_ENABLED -#define BLE_RSCS_C_ENABLED 0 -#endif - -// BLE_RSCS_ENABLED - ble_rscs - Running Speed and Cadence Service - - -#ifndef BLE_RSCS_ENABLED -#define BLE_RSCS_ENABLED 0 -#endif - -// BLE_TPS_ENABLED - ble_tps - TX Power Service - - -#ifndef BLE_TPS_ENABLED -#define BLE_TPS_ENABLED 0 -#endif - -// -//========================================================== - -// nRF_Core - -//========================================================== -// NRF_MPU_LIB_ENABLED - nrf_mpu_lib - Module for MPU -//========================================================== -#ifndef NRF_MPU_LIB_ENABLED -#define NRF_MPU_LIB_ENABLED 0 -#endif -// NRF_MPU_LIB_CLI_CMDS - Enable CLI commands specific to the module. - - -#ifndef NRF_MPU_LIB_CLI_CMDS -#define NRF_MPU_LIB_CLI_CMDS 0 -#endif - -// - -// NRF_STACK_GUARD_ENABLED - nrf_stack_guard - Stack guard -//========================================================== -#ifndef NRF_STACK_GUARD_ENABLED -#define NRF_STACK_GUARD_ENABLED 0 -#endif -// NRF_STACK_GUARD_CONFIG_SIZE - Size of the stack guard. - -// <5=> 32 bytes -// <6=> 64 bytes -// <7=> 128 bytes -// <8=> 256 bytes -// <9=> 512 bytes -// <10=> 1024 bytes -// <11=> 2048 bytes -// <12=> 4096 bytes - -#ifndef NRF_STACK_GUARD_CONFIG_SIZE -#define NRF_STACK_GUARD_CONFIG_SIZE 7 -#endif - -// - -// -//========================================================== - -// nRF_Crypto - -//========================================================== -// NRF_CRYPTO_ENABLED - nrf_crypto - Cryptography library. -//========================================================== -#ifndef NRF_CRYPTO_ENABLED -#define NRF_CRYPTO_ENABLED 1 -#endif -// NRF_CRYPTO_ALLOCATOR - Memory allocator - - -// Choose memory allocator used by nrf_crypto. Default is alloca if possible or nrf_malloc otherwise. If 'User macros' are selected, the user has to create 'nrf_crypto_allocator.h' file that contains NRF_CRYPTO_ALLOC, NRF_CRYPTO_FREE, and NRF_CRYPTO_ALLOC_ON_STACK. -// <0=> Default -// <1=> User macros -// <2=> On stack (alloca) -// <3=> C dynamic memory (malloc) -// <4=> SDK Memory Manager (nrf_malloc) - -#ifndef NRF_CRYPTO_ALLOCATOR -#define NRF_CRYPTO_ALLOCATOR 0 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_ENABLED - Enable the ARM Cryptocell CC310 reduced backend. - -// The CC310 hardware-accelerated cryptography backend with reduced functionality and footprint (only available on nRF52840). -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED - Enable the secp224r1 elliptic curve support using CC310_BL. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED 0 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED - Enable the secp256r1 elliptic curve support using CC310_BL. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED - CC310_BL SHA-256 hash functionality. - - -// CC310_BL backend implementation for hardware-accelerated SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED - nrf_cc310_bl buffers to RAM before running hash operation - - -// Enabling this makes hashing of addresses in FLASH range possible. Size of buffer allocated for hashing is set by NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED 0 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE - nrf_cc310_bl hash outputs digests in little endian -// Makes the nrf_cc310_bl hash functions output digests in little endian format. Only for use in nRF SDK DFU! - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE -#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE 4096 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED - Enable Interrupts while support using CC310 bl. - - -// Select a library version compatible with the configuration. When interrupts are disable, a version named _noint must be used - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_CC310_ENABLED - Enable the ARM Cryptocell CC310 backend. - -// The CC310 hardware-accelerated cryptography backend (only available on nRF52840). -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_CC310_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED - Enable the AES CBC mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED - Enable the AES CTR mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED - Enable the AES ECB mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED - Enable the AES CBC_MAC mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED - Enable the AES CMAC mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED - Enable the AES CCM mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED - Enable the AES CCM* mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED - Enable the CHACHA-POLY mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED - Enable the secp160r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED - Enable the secp160r2 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED - Enable the secp192r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED - Enable the secp224r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED - Enable the secp256r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED - Enable the secp384r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED - Enable the secp521r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED - Enable the secp160k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED - Enable the secp192k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED - Enable the secp224k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED - Enable the secp256k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED - Enable the Curve25519 curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED - Enable the Ed25519 curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED - CC310 SHA-256 hash functionality. - - -// CC310 backend implementation for hardware-accelerated SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED - CC310 SHA-512 hash functionality - - -// CC310 backend implementation for SHA-512 (in software). - -#ifndef NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED - CC310 HMAC using SHA-256 - - -// CC310 backend implementation for HMAC using hardware-accelerated SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED - CC310 HMAC using SHA-512 - - -// CC310 backend implementation for HMAC using SHA-512 (in software). - -#ifndef NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED - Enable RNG support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED - Enable Interrupts while support using CC310. - - -// Select a library version compatible with the configuration. When interrupts are disable, a version named _noint must be used - -#ifndef NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_CIFRA_ENABLED - Enable the Cifra backend. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_CIFRA_ENABLED -#define NRF_CRYPTO_BACKEND_CIFRA_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED - Enable the AES EAX mode using Cifra. - - -#ifndef NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED -#define NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED - Enable the mbed TLS backend. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED - Enable the AES CBC mode mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED - Enable the AES CTR mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED - Enable the AES CFB mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED - Enable the AES ECB mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED - Enable the AES CBC MAC mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED - Enable the AES CMAC mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED - Enable the AES CCM mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED - Enable the AES GCM mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED - Enable secp192r1 (NIST 192-bit) curve - - -// Enable this setting if you need secp192r1 (NIST 192-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED - Enable secp224r1 (NIST 224-bit) curve - - -// Enable this setting if you need secp224r1 (NIST 224-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED - Enable secp256r1 (NIST 256-bit) curve - - -// Enable this setting if you need secp256r1 (NIST 256-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED - Enable secp384r1 (NIST 384-bit) curve - - -// Enable this setting if you need secp384r1 (NIST 384-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED - Enable secp521r1 (NIST 521-bit) curve - - -// Enable this setting if you need secp521r1 (NIST 521-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED - Enable secp192k1 (Koblitz 192-bit) curve - - -// Enable this setting if you need secp192k1 (Koblitz 192-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED - Enable secp224k1 (Koblitz 224-bit) curve - - -// Enable this setting if you need secp224k1 (Koblitz 224-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED - Enable secp256k1 (Koblitz 256-bit) curve - - -// Enable this setting if you need secp256k1 (Koblitz 256-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED - Enable bp256r1 (Brainpool 256-bit) curve - - -// Enable this setting if you need bp256r1 (Brainpool 256-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED - Enable bp384r1 (Brainpool 384-bit) curve - - -// Enable this setting if you need bp384r1 (Brainpool 384-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED - Enable bp512r1 (Brainpool 512-bit) curve - - -// Enable this setting if you need bp512r1 (Brainpool 512-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED - Enable Curve25519 curve - - -// Enable this setting if you need Curve25519 support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED - Enable mbed TLS SHA-256 hash functionality. - - -// mbed TLS backend implementation for SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED - Enable mbed TLS SHA-512 hash functionality. - - -// mbed TLS backend implementation for SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED - Enable mbed TLS HMAC using SHA-256. - - -// mbed TLS backend implementation for HMAC using SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED - Enable mbed TLS HMAC using SHA-512. - - -// mbed TLS backend implementation for HMAC using SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED - Enable the micro-ecc backend. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED - Enable secp192r1 (NIST 192-bit) curve - - -// Enable this setting if you need secp192r1 (NIST 192-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED - Enable secp224r1 (NIST 224-bit) curve - - -// Enable this setting if you need secp224r1 (NIST 224-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED - Enable secp256r1 (NIST 256-bit) curve - - -// Enable this setting if you need secp256r1 (NIST 256-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED - Enable secp256k1 (Koblitz 256-bit) curve - - -// Enable this setting if you need secp256k1 (Koblitz 256-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED - Enable the nRF HW RNG backend. - -// The nRF HW backend provide access to RNG peripheral in nRF5x devices. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED - Enable mbed TLS CTR-DRBG algorithm. - - -// Enable mbed TLS CTR-DRBG standardized by NIST (NIST SP 800-90A Rev. 1). The nRF HW RNG is used as an entropy source for seeding. - -#ifndef NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_NRF_SW_ENABLED - Enable the legacy nRFx sw for crypto. - -// The nRF SW cryptography backend (only used in bootloader context). -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_NRF_SW_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_SW_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED - nRF SW hash backend support for SHA-256 - - -// The nRF SW backend provide access to nRF SDK legacy hash implementation of SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_OBERON_ENABLED - Enable the Oberon backend - -// The Oberon backend -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_OBERON_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED - Enable the CHACHA-POLY mode using Oberon. - - -#ifndef NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED - Enable secp256r1 curve - - -// Enable this setting if you need secp256r1 curve support using Oberon library - -#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED - Enable Curve25519 ECDH - - -// Enable this setting if you need Curve25519 ECDH support using Oberon library - -#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED - Enable Ed25519 signature scheme - - -// Enable this setting if you need Ed25519 support using Oberon library - -#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED - Oberon SHA-256 hash functionality - - -// Oberon backend implementation for SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED - Oberon SHA-512 hash functionality - - -// Oberon backend implementation for SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED - Oberon HMAC using SHA-256 - - -// Oberon backend implementation for HMAC using SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED - Oberon HMAC using SHA-512 - - -// Oberon backend implementation for HMAC using SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_OPTIGA_ENABLED - Enable the nrf_crypto Optiga Trust X backend. - -// Enables the nrf_crypto backend for Optiga Trust X devices. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_OPTIGA_ENABLED -#define NRF_CRYPTO_BACKEND_OPTIGA_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED - Optiga backend support for RNG - - -// The Optiga backend provide external chip RNG. - -#ifndef NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED -#define NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED 0 -#endif - -// NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED - Optiga backend support for ECC secp256r1 - - -// The Optiga backend provide external chip ECC using secp256r1. - -#ifndef NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED - Big-endian byte order in raw Curve25519 data - - -// Enable big-endian byte order in Curve25519 API, if set to 1. Use little-endian, if set to 0. - -#ifndef NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED -#define NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED 0 -#endif - -// - -// -//========================================================== - -// nRF_DFU - -//========================================================== -// ble_dfu - Device Firmware Update - -//========================================================== -// BLE_DFU_ENABLED - Enable DFU Service. - - -#ifndef BLE_DFU_ENABLED -#define BLE_DFU_ENABLED 0 -#endif - -// NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS - Buttonless DFU supports bonds. - - -#ifndef NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS -#define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 0 -#endif - -// -//========================================================== - -// -//========================================================== - -// nRF_Drivers - -//========================================================== -// COMP_ENABLED - nrf_drv_comp - COMP peripheral driver - legacy layer -//========================================================== -#ifndef COMP_ENABLED -#define COMP_ENABLED 0 -#endif -// COMP_CONFIG_REF - Reference voltage - -// <0=> Internal 1.2V -// <1=> Internal 1.8V -// <2=> Internal 2.4V -// <4=> VDD -// <7=> ARef - -#ifndef COMP_CONFIG_REF -#define COMP_CONFIG_REF 1 -#endif - -// COMP_CONFIG_MAIN_MODE - Main mode - -// <0=> Single ended -// <1=> Differential - -#ifndef COMP_CONFIG_MAIN_MODE -#define COMP_CONFIG_MAIN_MODE 0 -#endif - -// COMP_CONFIG_SPEED_MODE - Speed mode - -// <0=> Low power -// <1=> Normal -// <2=> High speed - -#ifndef COMP_CONFIG_SPEED_MODE -#define COMP_CONFIG_SPEED_MODE 2 -#endif - -// COMP_CONFIG_HYST - Hystheresis - -// <0=> No -// <1=> 50mV - -#ifndef COMP_CONFIG_HYST -#define COMP_CONFIG_HYST 0 -#endif - -// COMP_CONFIG_ISOURCE - Current Source - -// <0=> Off -// <1=> 2.5 uA -// <2=> 5 uA -// <3=> 10 uA - -#ifndef COMP_CONFIG_ISOURCE -#define COMP_CONFIG_ISOURCE 0 -#endif - -// COMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef COMP_CONFIG_INPUT -#define COMP_CONFIG_INPUT 0 -#endif - -// COMP_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef COMP_CONFIG_IRQ_PRIORITY -#define COMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// EGU_ENABLED - nrf_drv_swi - SWI(EGU) peripheral driver - legacy layer - - -#ifndef EGU_ENABLED -#define EGU_ENABLED 0 -#endif - -// GPIOTE_ENABLED - nrf_drv_gpiote - GPIOTE peripheral driver - legacy layer -//========================================================== -#ifndef GPIOTE_ENABLED -#define GPIOTE_ENABLED 0 -#endif -// GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins -#ifndef GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS -#define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1 -#endif - -// GPIOTE_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef GPIOTE_CONFIG_IRQ_PRIORITY -#define GPIOTE_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// I2S_ENABLED - nrf_drv_i2s - I2S peripheral driver - legacy layer -//========================================================== -#ifndef I2S_ENABLED -#define I2S_ENABLED 0 -#endif -// I2S_CONFIG_SCK_PIN - SCK pin <0-31> - - -#ifndef I2S_CONFIG_SCK_PIN -#define I2S_CONFIG_SCK_PIN 31 -#endif - -// I2S_CONFIG_LRCK_PIN - LRCK pin <1-31> - - -#ifndef I2S_CONFIG_LRCK_PIN -#define I2S_CONFIG_LRCK_PIN 30 -#endif - -// I2S_CONFIG_MCK_PIN - MCK pin -#ifndef I2S_CONFIG_MCK_PIN -#define I2S_CONFIG_MCK_PIN 255 -#endif - -// I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31> - - -#ifndef I2S_CONFIG_SDOUT_PIN -#define I2S_CONFIG_SDOUT_PIN 29 -#endif - -// I2S_CONFIG_SDIN_PIN - SDIN pin <0-31> - - -#ifndef I2S_CONFIG_SDIN_PIN -#define I2S_CONFIG_SDIN_PIN 28 -#endif - -// I2S_CONFIG_MASTER - Mode - -// <0=> Master -// <1=> Slave - -#ifndef I2S_CONFIG_MASTER -#define I2S_CONFIG_MASTER 0 -#endif - -// I2S_CONFIG_FORMAT - Format - -// <0=> I2S -// <1=> Aligned - -#ifndef I2S_CONFIG_FORMAT -#define I2S_CONFIG_FORMAT 0 -#endif - -// I2S_CONFIG_ALIGN - Alignment - -// <0=> Left -// <1=> Right - -#ifndef I2S_CONFIG_ALIGN -#define I2S_CONFIG_ALIGN 0 -#endif - -// I2S_CONFIG_SWIDTH - Sample width (bits) - -// <0=> 8 -// <1=> 16 -// <2=> 24 - -#ifndef I2S_CONFIG_SWIDTH -#define I2S_CONFIG_SWIDTH 1 -#endif - -// I2S_CONFIG_CHANNELS - Channels - -// <0=> Stereo -// <1=> Left -// <2=> Right - -#ifndef I2S_CONFIG_CHANNELS -#define I2S_CONFIG_CHANNELS 1 -#endif - -// I2S_CONFIG_MCK_SETUP - MCK behavior - -// <0=> Disabled -// <2147483648=> 32MHz/2 -// <1342177280=> 32MHz/3 -// <1073741824=> 32MHz/4 -// <805306368=> 32MHz/5 -// <671088640=> 32MHz/6 -// <536870912=> 32MHz/8 -// <402653184=> 32MHz/10 -// <369098752=> 32MHz/11 -// <285212672=> 32MHz/15 -// <268435456=> 32MHz/16 -// <201326592=> 32MHz/21 -// <184549376=> 32MHz/23 -// <142606336=> 32MHz/30 -// <138412032=> 32MHz/31 -// <134217728=> 32MHz/32 -// <100663296=> 32MHz/42 -// <68157440=> 32MHz/63 -// <34340864=> 32MHz/125 - -#ifndef I2S_CONFIG_MCK_SETUP -#define I2S_CONFIG_MCK_SETUP 536870912 -#endif - -// I2S_CONFIG_RATIO - MCK/LRCK ratio - -// <0=> 32x -// <1=> 48x -// <2=> 64x -// <3=> 96x -// <4=> 128x -// <5=> 192x -// <6=> 256x -// <7=> 384x -// <8=> 512x - -#ifndef I2S_CONFIG_RATIO -#define I2S_CONFIG_RATIO 2000 -#endif - -// I2S_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef I2S_CONFIG_IRQ_PRIORITY -#define I2S_CONFIG_IRQ_PRIORITY 6 -#endif - -// I2S_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef I2S_CONFIG_LOG_ENABLED -#define I2S_CONFIG_LOG_ENABLED 0 -#endif -// I2S_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef I2S_CONFIG_LOG_LEVEL -#define I2S_CONFIG_LOG_LEVEL 3 -#endif - -// I2S_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef I2S_CONFIG_INFO_COLOR -#define I2S_CONFIG_INFO_COLOR 0 -#endif - -// I2S_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef I2S_CONFIG_DEBUG_COLOR -#define I2S_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// LPCOMP_ENABLED - nrf_drv_lpcomp - LPCOMP peripheral driver - legacy layer -//========================================================== -#ifndef LPCOMP_ENABLED -#define LPCOMP_ENABLED 0 -#endif -// LPCOMP_CONFIG_REFERENCE - Reference voltage - -// <0=> Supply 1/8 -// <1=> Supply 2/8 -// <2=> Supply 3/8 -// <3=> Supply 4/8 -// <4=> Supply 5/8 -// <5=> Supply 6/8 -// <6=> Supply 7/8 -// <8=> Supply 1/16 (nRF52) -// <9=> Supply 3/16 (nRF52) -// <10=> Supply 5/16 (nRF52) -// <11=> Supply 7/16 (nRF52) -// <12=> Supply 9/16 (nRF52) -// <13=> Supply 11/16 (nRF52) -// <14=> Supply 13/16 (nRF52) -// <15=> Supply 15/16 (nRF52) -// <7=> External Ref 0 -// <65543=> External Ref 1 - -#ifndef LPCOMP_CONFIG_REFERENCE -#define LPCOMP_CONFIG_REFERENCE 3 -#endif - -// LPCOMP_CONFIG_DETECTION - Detection - -// <0=> Crossing -// <1=> Up -// <2=> Down - -#ifndef LPCOMP_CONFIG_DETECTION -#define LPCOMP_CONFIG_DETECTION 2 -#endif - -// LPCOMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef LPCOMP_CONFIG_INPUT -#define LPCOMP_CONFIG_INPUT 0 -#endif - -// LPCOMP_CONFIG_HYST - Hysteresis - - -#ifndef LPCOMP_CONFIG_HYST -#define LPCOMP_CONFIG_HYST 0 -#endif - -// LPCOMP_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef LPCOMP_CONFIG_IRQ_PRIORITY -#define LPCOMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// NRFX_CLOCK_ENABLED - nrfx_clock - CLOCK peripheral driver -//========================================================== -#ifndef NRFX_CLOCK_ENABLED -#define NRFX_CLOCK_ENABLED 0 -#endif -// NRFX_CLOCK_CONFIG_LF_SRC - LF Clock Source - -// <0=> RC -// <1=> XTAL -// <2=> Synth -// <131073=> External Low Swing -// <196609=> External Full Swing - -#ifndef NRFX_CLOCK_CONFIG_LF_SRC -#define NRFX_CLOCK_CONFIG_LF_SRC 1 -#endif - -// NRFX_CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_CLOCK_CONFIG_IRQ_PRIORITY -#define NRFX_CLOCK_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_CLOCK_CONFIG_LOG_ENABLED -#define NRFX_CLOCK_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_CLOCK_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_CLOCK_CONFIG_LOG_LEVEL -#define NRFX_CLOCK_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_CLOCK_CONFIG_INFO_COLOR -#define NRFX_CLOCK_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_CLOCK_CONFIG_DEBUG_COLOR -#define NRFX_CLOCK_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_COMP_ENABLED - nrfx_comp - COMP peripheral driver -//========================================================== -#ifndef NRFX_COMP_ENABLED -#define NRFX_COMP_ENABLED 0 -#endif -// NRFX_COMP_CONFIG_REF - Reference voltage - -// <0=> Internal 1.2V -// <1=> Internal 1.8V -// <2=> Internal 2.4V -// <4=> VDD -// <7=> ARef - -#ifndef NRFX_COMP_CONFIG_REF -#define NRFX_COMP_CONFIG_REF 1 -#endif - -// NRFX_COMP_CONFIG_MAIN_MODE - Main mode - -// <0=> Single ended -// <1=> Differential - -#ifndef NRFX_COMP_CONFIG_MAIN_MODE -#define NRFX_COMP_CONFIG_MAIN_MODE 0 -#endif - -// NRFX_COMP_CONFIG_SPEED_MODE - Speed mode - -// <0=> Low power -// <1=> Normal -// <2=> High speed - -#ifndef NRFX_COMP_CONFIG_SPEED_MODE -#define NRFX_COMP_CONFIG_SPEED_MODE 2 -#endif - -// NRFX_COMP_CONFIG_HYST - Hystheresis - -// <0=> No -// <1=> 50mV - -#ifndef NRFX_COMP_CONFIG_HYST -#define NRFX_COMP_CONFIG_HYST 0 -#endif - -// NRFX_COMP_CONFIG_ISOURCE - Current Source - -// <0=> Off -// <1=> 2.5 uA -// <2=> 5 uA -// <3=> 10 uA - -#ifndef NRFX_COMP_CONFIG_ISOURCE -#define NRFX_COMP_CONFIG_ISOURCE 0 -#endif - -// NRFX_COMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_COMP_CONFIG_INPUT -#define NRFX_COMP_CONFIG_INPUT 0 -#endif - -// NRFX_COMP_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_COMP_CONFIG_IRQ_PRIORITY -#define NRFX_COMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_COMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_COMP_CONFIG_LOG_ENABLED -#define NRFX_COMP_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_COMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_COMP_CONFIG_LOG_LEVEL -#define NRFX_COMP_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_COMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_COMP_CONFIG_INFO_COLOR -#define NRFX_COMP_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_COMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_COMP_CONFIG_DEBUG_COLOR -#define NRFX_COMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_GPIOTE_ENABLED - nrfx_gpiote - GPIOTE peripheral driver -//========================================================== -#ifndef NRFX_GPIOTE_ENABLED -#define NRFX_GPIOTE_ENABLED 0 -#endif -// NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins -#ifndef NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS -#define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1 -#endif - -// NRFX_GPIOTE_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_GPIOTE_CONFIG_IRQ_PRIORITY -#define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_GPIOTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_GPIOTE_CONFIG_LOG_ENABLED -#define NRFX_GPIOTE_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_GPIOTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_GPIOTE_CONFIG_LOG_LEVEL -#define NRFX_GPIOTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_GPIOTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_GPIOTE_CONFIG_INFO_COLOR -#define NRFX_GPIOTE_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_GPIOTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_GPIOTE_CONFIG_DEBUG_COLOR -#define NRFX_GPIOTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_I2S_ENABLED - nrfx_i2s - I2S peripheral driver -//========================================================== -#ifndef NRFX_I2S_ENABLED -#define NRFX_I2S_ENABLED 0 -#endif -// NRFX_I2S_CONFIG_SCK_PIN - SCK pin <0-31> - - -#ifndef NRFX_I2S_CONFIG_SCK_PIN -#define NRFX_I2S_CONFIG_SCK_PIN 31 -#endif - -// NRFX_I2S_CONFIG_LRCK_PIN - LRCK pin <1-31> - - -#ifndef NRFX_I2S_CONFIG_LRCK_PIN -#define NRFX_I2S_CONFIG_LRCK_PIN 30 -#endif - -// NRFX_I2S_CONFIG_MCK_PIN - MCK pin -#ifndef NRFX_I2S_CONFIG_MCK_PIN -#define NRFX_I2S_CONFIG_MCK_PIN 255 -#endif - -// NRFX_I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31> - - -#ifndef NRFX_I2S_CONFIG_SDOUT_PIN -#define NRFX_I2S_CONFIG_SDOUT_PIN 29 -#endif - -// NRFX_I2S_CONFIG_SDIN_PIN - SDIN pin <0-31> - - -#ifndef NRFX_I2S_CONFIG_SDIN_PIN -#define NRFX_I2S_CONFIG_SDIN_PIN 28 -#endif - -// NRFX_I2S_CONFIG_MASTER - Mode - -// <0=> Master -// <1=> Slave - -#ifndef NRFX_I2S_CONFIG_MASTER -#define NRFX_I2S_CONFIG_MASTER 0 -#endif - -// NRFX_I2S_CONFIG_FORMAT - Format - -// <0=> I2S -// <1=> Aligned - -#ifndef NRFX_I2S_CONFIG_FORMAT -#define NRFX_I2S_CONFIG_FORMAT 0 -#endif - -// NRFX_I2S_CONFIG_ALIGN - Alignment - -// <0=> Left -// <1=> Right - -#ifndef NRFX_I2S_CONFIG_ALIGN -#define NRFX_I2S_CONFIG_ALIGN 0 -#endif - -// NRFX_I2S_CONFIG_SWIDTH - Sample width (bits) - -// <0=> 8 -// <1=> 16 -// <2=> 24 - -#ifndef NRFX_I2S_CONFIG_SWIDTH -#define NRFX_I2S_CONFIG_SWIDTH 1 -#endif - -// NRFX_I2S_CONFIG_CHANNELS - Channels - -// <0=> Stereo -// <1=> Left -// <2=> Right - -#ifndef NRFX_I2S_CONFIG_CHANNELS -#define NRFX_I2S_CONFIG_CHANNELS 1 -#endif - -// NRFX_I2S_CONFIG_MCK_SETUP - MCK behavior - -// <0=> Disabled -// <2147483648=> 32MHz/2 -// <1342177280=> 32MHz/3 -// <1073741824=> 32MHz/4 -// <805306368=> 32MHz/5 -// <671088640=> 32MHz/6 -// <536870912=> 32MHz/8 -// <402653184=> 32MHz/10 -// <369098752=> 32MHz/11 -// <285212672=> 32MHz/15 -// <268435456=> 32MHz/16 -// <201326592=> 32MHz/21 -// <184549376=> 32MHz/23 -// <142606336=> 32MHz/30 -// <138412032=> 32MHz/31 -// <134217728=> 32MHz/32 -// <100663296=> 32MHz/42 -// <68157440=> 32MHz/63 -// <34340864=> 32MHz/125 - -#ifndef NRFX_I2S_CONFIG_MCK_SETUP -#define NRFX_I2S_CONFIG_MCK_SETUP 536870912 -#endif - -// NRFX_I2S_CONFIG_RATIO - MCK/LRCK ratio - -// <0=> 32x -// <1=> 48x -// <2=> 64x -// <3=> 96x -// <4=> 128x -// <5=> 192x -// <6=> 256x -// <7=> 384x -// <8=> 512x - -#ifndef NRFX_I2S_CONFIG_RATIO -#define NRFX_I2S_CONFIG_RATIO 2000 -#endif - -// NRFX_I2S_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_I2S_CONFIG_IRQ_PRIORITY -#define NRFX_I2S_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_I2S_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_I2S_CONFIG_LOG_ENABLED -#define NRFX_I2S_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_I2S_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_I2S_CONFIG_LOG_LEVEL -#define NRFX_I2S_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_I2S_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_I2S_CONFIG_INFO_COLOR -#define NRFX_I2S_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_I2S_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_I2S_CONFIG_DEBUG_COLOR -#define NRFX_I2S_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_LPCOMP_ENABLED - nrfx_lpcomp - LPCOMP peripheral driver -//========================================================== -#ifndef NRFX_LPCOMP_ENABLED -#define NRFX_LPCOMP_ENABLED 0 -#endif -// NRFX_LPCOMP_CONFIG_REFERENCE - Reference voltage - -// <0=> Supply 1/8 -// <1=> Supply 2/8 -// <2=> Supply 3/8 -// <3=> Supply 4/8 -// <4=> Supply 5/8 -// <5=> Supply 6/8 -// <6=> Supply 7/8 -// <8=> Supply 1/16 (nRF52) -// <9=> Supply 3/16 (nRF52) -// <10=> Supply 5/16 (nRF52) -// <11=> Supply 7/16 (nRF52) -// <12=> Supply 9/16 (nRF52) -// <13=> Supply 11/16 (nRF52) -// <14=> Supply 13/16 (nRF52) -// <15=> Supply 15/16 (nRF52) -// <7=> External Ref 0 -// <65543=> External Ref 1 - -#ifndef NRFX_LPCOMP_CONFIG_REFERENCE -#define NRFX_LPCOMP_CONFIG_REFERENCE 3 -#endif - -// NRFX_LPCOMP_CONFIG_DETECTION - Detection - -// <0=> Crossing -// <1=> Up -// <2=> Down - -#ifndef NRFX_LPCOMP_CONFIG_DETECTION -#define NRFX_LPCOMP_CONFIG_DETECTION 2 -#endif - -// NRFX_LPCOMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_LPCOMP_CONFIG_INPUT -#define NRFX_LPCOMP_CONFIG_INPUT 0 -#endif - -// NRFX_LPCOMP_CONFIG_HYST - Hysteresis - - -#ifndef NRFX_LPCOMP_CONFIG_HYST -#define NRFX_LPCOMP_CONFIG_HYST 0 -#endif - -// NRFX_LPCOMP_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_LPCOMP_CONFIG_IRQ_PRIORITY -#define NRFX_LPCOMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_LPCOMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_LPCOMP_CONFIG_LOG_ENABLED -#define NRFX_LPCOMP_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_LPCOMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_LPCOMP_CONFIG_LOG_LEVEL -#define NRFX_LPCOMP_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_LPCOMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_LPCOMP_CONFIG_INFO_COLOR -#define NRFX_LPCOMP_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_LPCOMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_LPCOMP_CONFIG_DEBUG_COLOR -#define NRFX_LPCOMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_NFCT_ENABLED - nrfx_nfct - NFCT peripheral driver -//========================================================== -#ifndef NRFX_NFCT_ENABLED -#define NRFX_NFCT_ENABLED 0 -#endif -// NRFX_NFCT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_NFCT_CONFIG_IRQ_PRIORITY -#define NRFX_NFCT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_NFCT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_NFCT_CONFIG_LOG_ENABLED -#define NRFX_NFCT_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_NFCT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_NFCT_CONFIG_LOG_LEVEL -#define NRFX_NFCT_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_NFCT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_NFCT_CONFIG_INFO_COLOR -#define NRFX_NFCT_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_NFCT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_NFCT_CONFIG_DEBUG_COLOR -#define NRFX_NFCT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_PDM_ENABLED - nrfx_pdm - PDM peripheral driver -//========================================================== -#ifndef NRFX_PDM_ENABLED -#define NRFX_PDM_ENABLED 0 -#endif -// NRFX_PDM_CONFIG_MODE - Mode - -// <0=> Stereo -// <1=> Mono - -#ifndef NRFX_PDM_CONFIG_MODE -#define NRFX_PDM_CONFIG_MODE 1 -#endif - -// NRFX_PDM_CONFIG_EDGE - Edge - -// <0=> Left falling -// <1=> Left rising - -#ifndef NRFX_PDM_CONFIG_EDGE -#define NRFX_PDM_CONFIG_EDGE 0 -#endif - -// NRFX_PDM_CONFIG_CLOCK_FREQ - Clock frequency - -// <134217728=> 1000k -// <138412032=> 1032k (default) -// <142606336=> 1067k - -#ifndef NRFX_PDM_CONFIG_CLOCK_FREQ -#define NRFX_PDM_CONFIG_CLOCK_FREQ 138412032 -#endif - -// NRFX_PDM_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_PDM_CONFIG_IRQ_PRIORITY -#define NRFX_PDM_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_PDM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_PDM_CONFIG_LOG_ENABLED -#define NRFX_PDM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_PDM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_PDM_CONFIG_LOG_LEVEL -#define NRFX_PDM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_PDM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PDM_CONFIG_INFO_COLOR -#define NRFX_PDM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_PDM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PDM_CONFIG_DEBUG_COLOR -#define NRFX_PDM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_POWER_ENABLED - nrfx_power - POWER peripheral driver -//========================================================== -#ifndef NRFX_POWER_ENABLED -#define NRFX_POWER_ENABLED 1 -#endif -// NRFX_POWER_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_POWER_CONFIG_IRQ_PRIORITY -#define NRFX_POWER_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCEN -#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 0 -#endif - -// NRFX_POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCENHV -#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0 -#endif - -// - -// NRFX_PPI_ENABLED - nrfx_ppi - PPI peripheral allocator -//========================================================== -#ifndef NRFX_PPI_ENABLED -#define NRFX_PPI_ENABLED 0 -#endif -// NRFX_PPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_PPI_CONFIG_LOG_ENABLED -#define NRFX_PPI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_PPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_PPI_CONFIG_LOG_LEVEL -#define NRFX_PPI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_PPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PPI_CONFIG_INFO_COLOR -#define NRFX_PPI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_PPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PPI_CONFIG_DEBUG_COLOR -#define NRFX_PPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_PWM_ENABLED - nrfx_pwm - PWM peripheral driver -//========================================================== -#ifndef NRFX_PWM_ENABLED -#define NRFX_PWM_ENABLED 0 -#endif -// NRFX_PWM0_ENABLED - Enable PWM0 instance - - -#ifndef NRFX_PWM0_ENABLED -#define NRFX_PWM0_ENABLED 0 -#endif - -// NRFX_PWM1_ENABLED - Enable PWM1 instance - - -#ifndef NRFX_PWM1_ENABLED -#define NRFX_PWM1_ENABLED 0 -#endif - -// NRFX_PWM2_ENABLED - Enable PWM2 instance - - -#ifndef NRFX_PWM2_ENABLED -#define NRFX_PWM2_ENABLED 0 -#endif - -// NRFX_PWM3_ENABLED - Enable PWM3 instance - - -#ifndef NRFX_PWM3_ENABLED -#define NRFX_PWM3_ENABLED 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK - Base clock - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz - -#ifndef NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK -#define NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK 4 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE - Count mode - -// <0=> Up -// <1=> Up and Down - -#ifndef NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE -#define NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE - Top value -#ifndef NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE -#define NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE 1000 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE - Load mode - -// <0=> Common -// <1=> Grouped -// <2=> Individual -// <3=> Waveform - -#ifndef NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE -#define NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_STEP_MODE - Step mode - -// <0=> Auto -// <1=> Triggered - -#ifndef NRFX_PWM_DEFAULT_CONFIG_STEP_MODE -#define NRFX_PWM_DEFAULT_CONFIG_STEP_MODE 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_PWM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_PWM_CONFIG_LOG_ENABLED -#define NRFX_PWM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_PWM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_PWM_CONFIG_LOG_LEVEL -#define NRFX_PWM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_PWM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PWM_CONFIG_INFO_COLOR -#define NRFX_PWM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_PWM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PWM_CONFIG_DEBUG_COLOR -#define NRFX_PWM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_QDEC_ENABLED - nrfx_qdec - QDEC peripheral driver -//========================================================== -#ifndef NRFX_QDEC_ENABLED -#define NRFX_QDEC_ENABLED 0 -#endif -// NRFX_QDEC_CONFIG_REPORTPER - Report period - -// <0=> 10 Samples -// <1=> 40 Samples -// <2=> 80 Samples -// <3=> 120 Samples -// <4=> 160 Samples -// <5=> 200 Samples -// <6=> 240 Samples -// <7=> 280 Samples - -#ifndef NRFX_QDEC_CONFIG_REPORTPER -#define NRFX_QDEC_CONFIG_REPORTPER 0 -#endif - -// NRFX_QDEC_CONFIG_SAMPLEPER - Sample period - -// <0=> 128 us -// <1=> 256 us -// <2=> 512 us -// <3=> 1024 us -// <4=> 2048 us -// <5=> 4096 us -// <6=> 8192 us -// <7=> 16384 us - -#ifndef NRFX_QDEC_CONFIG_SAMPLEPER -#define NRFX_QDEC_CONFIG_SAMPLEPER 7 -#endif - -// NRFX_QDEC_CONFIG_PIO_A - A pin <0-31> - - -#ifndef NRFX_QDEC_CONFIG_PIO_A -#define NRFX_QDEC_CONFIG_PIO_A 31 -#endif - -// NRFX_QDEC_CONFIG_PIO_B - B pin <0-31> - - -#ifndef NRFX_QDEC_CONFIG_PIO_B -#define NRFX_QDEC_CONFIG_PIO_B 31 -#endif - -// NRFX_QDEC_CONFIG_PIO_LED - LED pin <0-31> - - -#ifndef NRFX_QDEC_CONFIG_PIO_LED -#define NRFX_QDEC_CONFIG_PIO_LED 31 -#endif - -// NRFX_QDEC_CONFIG_LEDPRE - LED pre -#ifndef NRFX_QDEC_CONFIG_LEDPRE -#define NRFX_QDEC_CONFIG_LEDPRE 511 -#endif - -// NRFX_QDEC_CONFIG_LEDPOL - LED polarity - -// <0=> Active low -// <1=> Active high - -#ifndef NRFX_QDEC_CONFIG_LEDPOL -#define NRFX_QDEC_CONFIG_LEDPOL 1 -#endif - -// NRFX_QDEC_CONFIG_DBFEN - Debouncing enable - - -#ifndef NRFX_QDEC_CONFIG_DBFEN -#define NRFX_QDEC_CONFIG_DBFEN 0 -#endif - -// NRFX_QDEC_CONFIG_SAMPLE_INTEN - Sample ready interrupt enable - - -#ifndef NRFX_QDEC_CONFIG_SAMPLE_INTEN -#define NRFX_QDEC_CONFIG_SAMPLE_INTEN 0 -#endif - -// NRFX_QDEC_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_QDEC_CONFIG_IRQ_PRIORITY -#define NRFX_QDEC_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_QDEC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_QDEC_CONFIG_LOG_ENABLED -#define NRFX_QDEC_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_QDEC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_QDEC_CONFIG_LOG_LEVEL -#define NRFX_QDEC_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_QDEC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_QDEC_CONFIG_INFO_COLOR -#define NRFX_QDEC_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_QDEC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_QDEC_CONFIG_DEBUG_COLOR -#define NRFX_QDEC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_RNG_ENABLED - nrfx_rng - RNG peripheral driver -//========================================================== -#ifndef NRFX_RNG_ENABLED -#define NRFX_RNG_ENABLED 0 -#endif -// NRFX_RNG_CONFIG_ERROR_CORRECTION - Error correction - - -#ifndef NRFX_RNG_CONFIG_ERROR_CORRECTION -#define NRFX_RNG_CONFIG_ERROR_CORRECTION 1 -#endif - -// NRFX_RNG_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_RNG_CONFIG_IRQ_PRIORITY -#define NRFX_RNG_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_RNG_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_RNG_CONFIG_LOG_ENABLED -#define NRFX_RNG_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_RNG_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_RNG_CONFIG_LOG_LEVEL -#define NRFX_RNG_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_RNG_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RNG_CONFIG_INFO_COLOR -#define NRFX_RNG_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RNG_CONFIG_DEBUG_COLOR -#define NRFX_RNG_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_RTC_ENABLED - nrfx_rtc - RTC peripheral driver -//========================================================== -#ifndef NRFX_RTC_ENABLED -#define NRFX_RTC_ENABLED 0 -#endif -// NRFX_RTC0_ENABLED - Enable RTC0 instance - - -#ifndef NRFX_RTC0_ENABLED -#define NRFX_RTC0_ENABLED 0 -#endif - -// NRFX_RTC1_ENABLED - Enable RTC1 instance - - -#ifndef NRFX_RTC1_ENABLED -#define NRFX_RTC1_ENABLED 0 -#endif - -// NRFX_RTC2_ENABLED - Enable RTC2 instance - - -#ifndef NRFX_RTC2_ENABLED -#define NRFX_RTC2_ENABLED 0 -#endif - -// NRFX_RTC_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt -#ifndef NRFX_RTC_MAXIMUM_LATENCY_US -#define NRFX_RTC_MAXIMUM_LATENCY_US 2000 -#endif - -// NRFX_RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768> - - -#ifndef NRFX_RTC_DEFAULT_CONFIG_FREQUENCY -#define NRFX_RTC_DEFAULT_CONFIG_FREQUENCY 32768 -#endif - -// NRFX_RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering - - -#ifndef NRFX_RTC_DEFAULT_CONFIG_RELIABLE -#define NRFX_RTC_DEFAULT_CONFIG_RELIABLE 0 -#endif - -// NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_RTC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_RTC_CONFIG_LOG_ENABLED -#define NRFX_RTC_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_RTC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_RTC_CONFIG_LOG_LEVEL -#define NRFX_RTC_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_RTC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RTC_CONFIG_INFO_COLOR -#define NRFX_RTC_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RTC_CONFIG_DEBUG_COLOR -#define NRFX_RTC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SAADC_ENABLED - nrfx_saadc - SAADC peripheral driver -//========================================================== -#ifndef NRFX_SAADC_ENABLED -#define NRFX_SAADC_ENABLED 0 -#endif -// NRFX_SAADC_CONFIG_RESOLUTION - Resolution - -// <0=> 8 bit -// <1=> 10 bit -// <2=> 12 bit -// <3=> 14 bit - -#ifndef NRFX_SAADC_CONFIG_RESOLUTION -#define NRFX_SAADC_CONFIG_RESOLUTION 1 -#endif - -// NRFX_SAADC_CONFIG_OVERSAMPLE - Sample period - -// <0=> Disabled -// <1=> 2x -// <2=> 4x -// <3=> 8x -// <4=> 16x -// <5=> 32x -// <6=> 64x -// <7=> 128x -// <8=> 256x - -#ifndef NRFX_SAADC_CONFIG_OVERSAMPLE -#define NRFX_SAADC_CONFIG_OVERSAMPLE 0 -#endif - -// NRFX_SAADC_CONFIG_LP_MODE - Enabling low power mode - - -#ifndef NRFX_SAADC_CONFIG_LP_MODE -#define NRFX_SAADC_CONFIG_LP_MODE 0 -#endif - -// NRFX_SAADC_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SAADC_CONFIG_IRQ_PRIORITY -#define NRFX_SAADC_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SAADC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SAADC_CONFIG_LOG_ENABLED -#define NRFX_SAADC_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SAADC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SAADC_CONFIG_LOG_LEVEL -#define NRFX_SAADC_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SAADC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SAADC_CONFIG_INFO_COLOR -#define NRFX_SAADC_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SAADC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SAADC_CONFIG_DEBUG_COLOR -#define NRFX_SAADC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SPIM_ENABLED - nrfx_spim - SPIM peripheral driver -//========================================================== -#ifndef NRFX_SPIM_ENABLED -#define NRFX_SPIM_ENABLED 0 -#endif -// NRFX_SPIM0_ENABLED - Enable SPIM0 instance - - -#ifndef NRFX_SPIM0_ENABLED -#define NRFX_SPIM0_ENABLED 0 -#endif - -// NRFX_SPIM1_ENABLED - Enable SPIM1 instance - - -#ifndef NRFX_SPIM1_ENABLED -#define NRFX_SPIM1_ENABLED 0 -#endif - -// NRFX_SPIM2_ENABLED - Enable SPIM2 instance - - -#ifndef NRFX_SPIM2_ENABLED -#define NRFX_SPIM2_ENABLED 0 -#endif - -// NRFX_SPIM3_ENABLED - Enable SPIM3 instance - - -#ifndef NRFX_SPIM3_ENABLED -#define NRFX_SPIM3_ENABLED 0 -#endif - -// NRFX_SPIM_EXTENDED_ENABLED - Enable extended SPIM features - - -#ifndef NRFX_SPIM_EXTENDED_ENABLED -#define NRFX_SPIM_EXTENDED_ENABLED 0 -#endif - -// NRFX_SPIM_MISO_PULL_CFG - MISO pin pull configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP - -#ifndef NRFX_SPIM_MISO_PULL_CFG -#define NRFX_SPIM_MISO_PULL_CFG 1 -#endif - -// NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SPIM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SPIM_CONFIG_LOG_ENABLED -#define NRFX_SPIM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SPIM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SPIM_CONFIG_LOG_LEVEL -#define NRFX_SPIM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SPIM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIM_CONFIG_INFO_COLOR -#define NRFX_SPIM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SPIM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIM_CONFIG_DEBUG_COLOR -#define NRFX_SPIM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SPIS_ENABLED - nrfx_spis - SPIS peripheral driver -//========================================================== -#ifndef NRFX_SPIS_ENABLED -#define NRFX_SPIS_ENABLED 0 -#endif -// NRFX_SPIS0_ENABLED - Enable SPIS0 instance - - -#ifndef NRFX_SPIS0_ENABLED -#define NRFX_SPIS0_ENABLED 0 -#endif - -// NRFX_SPIS1_ENABLED - Enable SPIS1 instance - - -#ifndef NRFX_SPIS1_ENABLED -#define NRFX_SPIS1_ENABLED 0 -#endif - -// NRFX_SPIS2_ENABLED - Enable SPIS2 instance - - -#ifndef NRFX_SPIS2_ENABLED -#define NRFX_SPIS2_ENABLED 0 -#endif - -// NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SPIS_DEFAULT_DEF - SPIS default DEF character <0-255> - - -#ifndef NRFX_SPIS_DEFAULT_DEF -#define NRFX_SPIS_DEFAULT_DEF 255 -#endif - -// NRFX_SPIS_DEFAULT_ORC - SPIS default ORC character <0-255> - - -#ifndef NRFX_SPIS_DEFAULT_ORC -#define NRFX_SPIS_DEFAULT_ORC 255 -#endif - -// NRFX_SPIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SPIS_CONFIG_LOG_ENABLED -#define NRFX_SPIS_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SPIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SPIS_CONFIG_LOG_LEVEL -#define NRFX_SPIS_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SPIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIS_CONFIG_INFO_COLOR -#define NRFX_SPIS_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SPIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIS_CONFIG_DEBUG_COLOR -#define NRFX_SPIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SPI_ENABLED - nrfx_spi - SPI peripheral driver -//========================================================== -#ifndef NRFX_SPI_ENABLED -#define NRFX_SPI_ENABLED 0 -#endif -// NRFX_SPI0_ENABLED - Enable SPI0 instance - - -#ifndef NRFX_SPI0_ENABLED -#define NRFX_SPI0_ENABLED 0 -#endif - -// NRFX_SPI1_ENABLED - Enable SPI1 instance - - -#ifndef NRFX_SPI1_ENABLED -#define NRFX_SPI1_ENABLED 0 -#endif - -// NRFX_SPI2_ENABLED - Enable SPI2 instance - - -#ifndef NRFX_SPI2_ENABLED -#define NRFX_SPI2_ENABLED 0 -#endif - -// NRFX_SPI_MISO_PULL_CFG - MISO pin pull configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP - -#ifndef NRFX_SPI_MISO_PULL_CFG -#define NRFX_SPI_MISO_PULL_CFG 1 -#endif - -// NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SPI_CONFIG_LOG_ENABLED -#define NRFX_SPI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SPI_CONFIG_LOG_LEVEL -#define NRFX_SPI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPI_CONFIG_INFO_COLOR -#define NRFX_SPI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPI_CONFIG_DEBUG_COLOR -#define NRFX_SPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SWI_ENABLED - nrfx_swi - SWI/EGU peripheral allocator -//========================================================== -#ifndef NRFX_SWI_ENABLED -#define NRFX_SWI_ENABLED 0 -#endif -// NRFX_EGU_ENABLED - Enable EGU support - - -#ifndef NRFX_EGU_ENABLED -#define NRFX_EGU_ENABLED 0 -#endif - -// NRFX_SWI0_DISABLED - Exclude SWI0 from being utilized by the driver - - -#ifndef NRFX_SWI0_DISABLED -#define NRFX_SWI0_DISABLED 0 -#endif - -// NRFX_SWI1_DISABLED - Exclude SWI1 from being utilized by the driver - - -#ifndef NRFX_SWI1_DISABLED -#define NRFX_SWI1_DISABLED 0 -#endif - -// NRFX_SWI2_DISABLED - Exclude SWI2 from being utilized by the driver - - -#ifndef NRFX_SWI2_DISABLED -#define NRFX_SWI2_DISABLED 0 -#endif - -// NRFX_SWI3_DISABLED - Exclude SWI3 from being utilized by the driver - - -#ifndef NRFX_SWI3_DISABLED -#define NRFX_SWI3_DISABLED 0 -#endif - -// NRFX_SWI4_DISABLED - Exclude SWI4 from being utilized by the driver - - -#ifndef NRFX_SWI4_DISABLED -#define NRFX_SWI4_DISABLED 0 -#endif - -// NRFX_SWI5_DISABLED - Exclude SWI5 from being utilized by the driver - - -#ifndef NRFX_SWI5_DISABLED -#define NRFX_SWI5_DISABLED 0 -#endif - -// NRFX_SWI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SWI_CONFIG_LOG_ENABLED -#define NRFX_SWI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SWI_CONFIG_LOG_LEVEL -#define NRFX_SWI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SWI_CONFIG_INFO_COLOR -#define NRFX_SWI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SWI_CONFIG_DEBUG_COLOR -#define NRFX_SWI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver -//========================================================== -#ifndef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED 0 -#endif -// NRFX_TIMER0_ENABLED - Enable TIMER0 instance - - -#ifndef NRFX_TIMER0_ENABLED -#define NRFX_TIMER0_ENABLED 0 -#endif - -// NRFX_TIMER1_ENABLED - Enable TIMER1 instance - - -#ifndef NRFX_TIMER1_ENABLED -#define NRFX_TIMER1_ENABLED 0 -#endif - -// NRFX_TIMER2_ENABLED - Enable TIMER2 instance - - -#ifndef NRFX_TIMER2_ENABLED -#define NRFX_TIMER2_ENABLED 0 -#endif - -// NRFX_TIMER3_ENABLED - Enable TIMER3 instance - - -#ifndef NRFX_TIMER3_ENABLED -#define NRFX_TIMER3_ENABLED 0 -#endif - -// NRFX_TIMER4_ENABLED - Enable TIMER4 instance - - -#ifndef NRFX_TIMER4_ENABLED -#define NRFX_TIMER4_ENABLED 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz -// <8=> 62.5 kHz -// <9=> 31.25 kHz - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation - -// <0=> Timer -// <1=> Counter - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_MODE -#define NRFX_TIMER_DEFAULT_CONFIG_MODE 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width - -// <0=> 16 bit -// <1=> 8 bit -// <2=> 24 bit -// <3=> 32 bit - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH -#define NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TIMER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TIMER_CONFIG_LOG_ENABLED -#define NRFX_TIMER_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TIMER_CONFIG_LOG_LEVEL -#define NRFX_TIMER_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TIMER_CONFIG_INFO_COLOR -#define NRFX_TIMER_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TIMER_CONFIG_DEBUG_COLOR -#define NRFX_TIMER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TWIM_ENABLED - nrfx_twim - TWIM peripheral driver -//========================================================== -#ifndef NRFX_TWIM_ENABLED -#define NRFX_TWIM_ENABLED 0 -#endif -// NRFX_TWIM0_ENABLED - Enable TWIM0 instance - - -#ifndef NRFX_TWIM0_ENABLED -#define NRFX_TWIM0_ENABLED 0 -#endif - -// NRFX_TWIM1_ENABLED - Enable TWIM1 instance - - -#ifndef NRFX_TWIM1_ENABLED -#define NRFX_TWIM1_ENABLED 0 -#endif - -// NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k - -#ifndef NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY 26738688 -#endif - -// NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - - -#ifndef NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 -#endif - -// NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TWIM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TWIM_CONFIG_LOG_ENABLED -#define NRFX_TWIM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TWIM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TWIM_CONFIG_LOG_LEVEL -#define NRFX_TWIM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TWIM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIM_CONFIG_INFO_COLOR -#define NRFX_TWIM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TWIM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIM_CONFIG_DEBUG_COLOR -#define NRFX_TWIM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TWIS_ENABLED - nrfx_twis - TWIS peripheral driver -//========================================================== -#ifndef NRFX_TWIS_ENABLED -#define NRFX_TWIS_ENABLED 0 -#endif -// NRFX_TWIS0_ENABLED - Enable TWIS0 instance - - -#ifndef NRFX_TWIS0_ENABLED -#define NRFX_TWIS0_ENABLED 0 -#endif - -// NRFX_TWIS1_ENABLED - Enable TWIS1 instance - - -#ifndef NRFX_TWIS1_ENABLED -#define NRFX_TWIS1_ENABLED 0 -#endif - -// NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY - Assume that any instance would be initialized only once - - -// Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code. - -#ifndef NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 -#endif - -// NRFX_TWIS_NO_SYNC_MODE - Remove support for synchronous mode - - -// Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources. - -#ifndef NRFX_TWIS_NO_SYNC_MODE -#define NRFX_TWIS_NO_SYNC_MODE 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_ADDR0 - Address0 -#ifndef NRFX_TWIS_DEFAULT_CONFIG_ADDR0 -#define NRFX_TWIS_DEFAULT_CONFIG_ADDR0 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_ADDR1 - Address1 -#ifndef NRFX_TWIS_DEFAULT_CONFIG_ADDR1 -#define NRFX_TWIS_DEFAULT_CONFIG_ADDR1 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL -#define NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL -#define NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TWIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TWIS_CONFIG_LOG_ENABLED -#define NRFX_TWIS_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TWIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TWIS_CONFIG_LOG_LEVEL -#define NRFX_TWIS_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TWIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIS_CONFIG_INFO_COLOR -#define NRFX_TWIS_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TWIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIS_CONFIG_DEBUG_COLOR -#define NRFX_TWIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TWI_ENABLED - nrfx_twi - TWI peripheral driver -//========================================================== -#ifndef NRFX_TWI_ENABLED -#define NRFX_TWI_ENABLED 0 -#endif -// NRFX_TWI0_ENABLED - Enable TWI0 instance - - -#ifndef NRFX_TWI0_ENABLED -#define NRFX_TWI0_ENABLED 0 -#endif - -// NRFX_TWI1_ENABLED - Enable TWI1 instance - - -#ifndef NRFX_TWI1_ENABLED -#define NRFX_TWI1_ENABLED 0 -#endif - -// NRFX_TWI_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k - -#ifndef NRFX_TWI_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TWI_DEFAULT_CONFIG_FREQUENCY 26738688 -#endif - -// NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - - -#ifndef NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 -#endif - -// NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TWI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TWI_CONFIG_LOG_ENABLED -#define NRFX_TWI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TWI_CONFIG_LOG_LEVEL -#define NRFX_TWI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWI_CONFIG_INFO_COLOR -#define NRFX_TWI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWI_CONFIG_DEBUG_COLOR -#define NRFX_TWI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_UARTE_ENABLED - nrfx_uarte - UARTE peripheral driver -//========================================================== -#ifndef NRFX_UARTE_ENABLED -#define NRFX_UARTE_ENABLED 0 -#endif -// NRFX_UARTE0_ENABLED - Enable UARTE0 instance -#ifndef NRFX_UARTE0_ENABLED -#define NRFX_UARTE0_ENABLED 0 -#endif - -// NRFX_UARTE1_ENABLED - Enable UARTE1 instance -#ifndef NRFX_UARTE1_ENABLED -#define NRFX_UARTE1_ENABLED 0 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_HWFC -#define NRFX_UARTE_DEFAULT_CONFIG_HWFC 0 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_PARITY -#define NRFX_UARTE_DEFAULT_CONFIG_PARITY 0 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <8388608=> 31250 baud -// <10289152=> 38400 baud -// <15007744=> 56000 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE -#define NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE 30801920 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_UARTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_UARTE_CONFIG_LOG_ENABLED -#define NRFX_UARTE_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_UARTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_UARTE_CONFIG_LOG_LEVEL -#define NRFX_UARTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_UARTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UARTE_CONFIG_INFO_COLOR -#define NRFX_UARTE_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_UARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UARTE_CONFIG_DEBUG_COLOR -#define NRFX_UARTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_UART_ENABLED - nrfx_uart - UART peripheral driver -//========================================================== -#ifndef NRFX_UART_ENABLED -#define NRFX_UART_ENABLED 0 -#endif -// NRFX_UART0_ENABLED - Enable UART0 instance -#ifndef NRFX_UART0_ENABLED -#define NRFX_UART0_ENABLED 0 -#endif - -// NRFX_UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef NRFX_UART_DEFAULT_CONFIG_HWFC -#define NRFX_UART_DEFAULT_CONFIG_HWFC 0 -#endif - -// NRFX_UART_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included - -#ifndef NRFX_UART_DEFAULT_CONFIG_PARITY -#define NRFX_UART_DEFAULT_CONFIG_PARITY 0 -#endif - -// NRFX_UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3866624=> 14400 baud -// <5152768=> 19200 baud -// <7729152=> 28800 baud -// <8388608=> 31250 baud -// <10309632=> 38400 baud -// <15007744=> 56000 baud -// <15462400=> 57600 baud -// <20615168=> 76800 baud -// <30924800=> 115200 baud -// <61845504=> 230400 baud -// <67108864=> 250000 baud -// <123695104=> 460800 baud -// <247386112=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef NRFX_UART_DEFAULT_CONFIG_BAUDRATE -#define NRFX_UART_DEFAULT_CONFIG_BAUDRATE 30924800 -#endif - -// NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_UART_CONFIG_LOG_ENABLED -#define NRFX_UART_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_UART_CONFIG_LOG_LEVEL -#define NRFX_UART_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UART_CONFIG_INFO_COLOR -#define NRFX_UART_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UART_CONFIG_DEBUG_COLOR -#define NRFX_UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_USBD_ENABLED - nrfx_usbd - USBD peripheral driver -//========================================================== -#ifndef NRFX_USBD_ENABLED -#define NRFX_USBD_ENABLED 0 -#endif -// NRFX_USBD_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_USBD_CONFIG_IRQ_PRIORITY -#define NRFX_USBD_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_USBD_CONFIG_DMASCHEDULER_MODE - USBD DMA scheduler working scheme - -// <0=> Prioritized access -// <1=> Round Robin - -#ifndef NRFX_USBD_CONFIG_DMASCHEDULER_MODE -#define NRFX_USBD_CONFIG_DMASCHEDULER_MODE 0 -#endif - -// NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST - Give priority to isochronous transfers - - -// This option gives priority to isochronous transfers. -// Enabling it assures that isochronous transfers are always processed, -// even if multiple other transfers are pending. -// Isochronous endpoints are prioritized before the usbd_dma_scheduler_algorithm -// function is called, so the option is independent of the algorithm chosen. - -#ifndef NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST -#define NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1 -#endif - -// NRFX_USBD_CONFIG_ISO_IN_ZLP - Respond to an IN token on ISO IN endpoint with ZLP when no data is ready - - -// If set, ISO IN endpoint will respond to an IN token with ZLP when no data is ready to be sent. -// Else, there will be no response. - -#ifndef NRFX_USBD_CONFIG_ISO_IN_ZLP -#define NRFX_USBD_CONFIG_ISO_IN_ZLP 0 -#endif - -// - -// NRFX_WDT_ENABLED - nrfx_wdt - WDT peripheral driver -//========================================================== -#ifndef NRFX_WDT_ENABLED -#define NRFX_WDT_ENABLED 0 -#endif -// NRFX_WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode - -// <1=> Run in SLEEP, Pause in HALT -// <8=> Pause in SLEEP, Run in HALT -// <9=> Run in SLEEP and HALT -// <0=> Pause in SLEEP and HALT - -#ifndef NRFX_WDT_CONFIG_BEHAVIOUR -#define NRFX_WDT_CONFIG_BEHAVIOUR 1 -#endif - -// NRFX_WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> - - -#ifndef NRFX_WDT_CONFIG_RELOAD_VALUE -#define NRFX_WDT_CONFIG_RELOAD_VALUE 2000 -#endif - -// NRFX_WDT_CONFIG_NO_IRQ - Remove WDT IRQ handling from WDT driver - -// <0=> Include WDT IRQ handling -// <1=> Remove WDT IRQ handling - -#ifndef NRFX_WDT_CONFIG_NO_IRQ -#define NRFX_WDT_CONFIG_NO_IRQ 0 -#endif - -// NRFX_WDT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_WDT_CONFIG_IRQ_PRIORITY -#define NRFX_WDT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_WDT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_WDT_CONFIG_LOG_ENABLED -#define NRFX_WDT_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_WDT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_WDT_CONFIG_LOG_LEVEL -#define NRFX_WDT_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_WDT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_WDT_CONFIG_INFO_COLOR -#define NRFX_WDT_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_WDT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_WDT_CONFIG_DEBUG_COLOR -#define NRFX_WDT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRF_CLOCK_ENABLED - nrf_drv_clock - CLOCK peripheral driver - legacy layer -//========================================================== -#ifndef NRF_CLOCK_ENABLED -#define NRF_CLOCK_ENABLED 0 -#endif -// CLOCK_CONFIG_LF_SRC - LF Clock Source - -// <0=> RC -// <1=> XTAL -// <2=> Synth -// <131073=> External Low Swing -// <196609=> External Full Swing - -#ifndef CLOCK_CONFIG_LF_SRC -#define CLOCK_CONFIG_LF_SRC 1 -#endif - -// CLOCK_CONFIG_LF_CAL_ENABLED - Calibration enable for LF Clock Source - - -#ifndef CLOCK_CONFIG_LF_CAL_ENABLED -#define CLOCK_CONFIG_LF_CAL_ENABLED 0 -#endif - -// CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef CLOCK_CONFIG_IRQ_PRIORITY -#define CLOCK_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// PDM_ENABLED - nrf_drv_pdm - PDM peripheral driver - legacy layer -//========================================================== -#ifndef PDM_ENABLED -#define PDM_ENABLED 0 -#endif -// PDM_CONFIG_MODE - Mode - -// <0=> Stereo -// <1=> Mono - -#ifndef PDM_CONFIG_MODE -#define PDM_CONFIG_MODE 1 -#endif - -// PDM_CONFIG_EDGE - Edge - -// <0=> Left falling -// <1=> Left rising - -#ifndef PDM_CONFIG_EDGE -#define PDM_CONFIG_EDGE 0 -#endif - -// PDM_CONFIG_CLOCK_FREQ - Clock frequency - -// <134217728=> 1000k -// <138412032=> 1032k (default) -// <142606336=> 1067k - -#ifndef PDM_CONFIG_CLOCK_FREQ -#define PDM_CONFIG_CLOCK_FREQ 138412032 -#endif - -// PDM_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef PDM_CONFIG_IRQ_PRIORITY -#define PDM_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// POWER_ENABLED - nrf_drv_power - POWER peripheral driver - legacy layer -//========================================================== -#ifndef POWER_ENABLED -#define POWER_ENABLED 1 -#endif -// POWER_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef POWER_CONFIG_IRQ_PRIORITY -#define POWER_CONFIG_IRQ_PRIORITY 6 -#endif - -// POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef POWER_CONFIG_DEFAULT_DCDCEN -#define POWER_CONFIG_DEFAULT_DCDCEN 0 -#endif - -// POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef POWER_CONFIG_DEFAULT_DCDCENHV -#define POWER_CONFIG_DEFAULT_DCDCENHV 0 -#endif - -// - -// PPI_ENABLED - nrf_drv_ppi - PPI peripheral driver - legacy layer - - -#ifndef PPI_ENABLED -#define PPI_ENABLED 0 -#endif - -// PWM_ENABLED - nrf_drv_pwm - PWM peripheral driver - legacy layer -//========================================================== -#ifndef PWM_ENABLED -#define PWM_ENABLED 0 -#endif -// PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT0_PIN -#define PWM_DEFAULT_CONFIG_OUT0_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT1_PIN -#define PWM_DEFAULT_CONFIG_OUT1_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT2_PIN -#define PWM_DEFAULT_CONFIG_OUT2_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT3_PIN -#define PWM_DEFAULT_CONFIG_OUT3_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_BASE_CLOCK - Base clock - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz - -#ifndef PWM_DEFAULT_CONFIG_BASE_CLOCK -#define PWM_DEFAULT_CONFIG_BASE_CLOCK 4 -#endif - -// PWM_DEFAULT_CONFIG_COUNT_MODE - Count mode - -// <0=> Up -// <1=> Up and Down - -#ifndef PWM_DEFAULT_CONFIG_COUNT_MODE -#define PWM_DEFAULT_CONFIG_COUNT_MODE 0 -#endif - -// PWM_DEFAULT_CONFIG_TOP_VALUE - Top value -#ifndef PWM_DEFAULT_CONFIG_TOP_VALUE -#define PWM_DEFAULT_CONFIG_TOP_VALUE 1000 -#endif - -// PWM_DEFAULT_CONFIG_LOAD_MODE - Load mode - -// <0=> Common -// <1=> Grouped -// <2=> Individual -// <3=> Waveform - -#ifndef PWM_DEFAULT_CONFIG_LOAD_MODE -#define PWM_DEFAULT_CONFIG_LOAD_MODE 0 -#endif - -// PWM_DEFAULT_CONFIG_STEP_MODE - Step mode - -// <0=> Auto -// <1=> Triggered - -#ifndef PWM_DEFAULT_CONFIG_STEP_MODE -#define PWM_DEFAULT_CONFIG_STEP_MODE 0 -#endif - -// PWM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#define PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// PWM0_ENABLED - Enable PWM0 instance - - -#ifndef PWM0_ENABLED -#define PWM0_ENABLED 0 -#endif - -// PWM1_ENABLED - Enable PWM1 instance - - -#ifndef PWM1_ENABLED -#define PWM1_ENABLED 0 -#endif - -// PWM2_ENABLED - Enable PWM2 instance - - -#ifndef PWM2_ENABLED -#define PWM2_ENABLED 0 -#endif - -// PWM3_ENABLED - Enable PWM3 instance - - -#ifndef PWM3_ENABLED -#define PWM3_ENABLED 0 -#endif - -// - -// QDEC_ENABLED - nrf_drv_qdec - QDEC peripheral driver - legacy layer -//========================================================== -#ifndef QDEC_ENABLED -#define QDEC_ENABLED 0 -#endif -// QDEC_CONFIG_REPORTPER - Report period - -// <0=> 10 Samples -// <1=> 40 Samples -// <2=> 80 Samples -// <3=> 120 Samples -// <4=> 160 Samples -// <5=> 200 Samples -// <6=> 240 Samples -// <7=> 280 Samples - -#ifndef QDEC_CONFIG_REPORTPER -#define QDEC_CONFIG_REPORTPER 0 -#endif - -// QDEC_CONFIG_SAMPLEPER - Sample period - -// <0=> 128 us -// <1=> 256 us -// <2=> 512 us -// <3=> 1024 us -// <4=> 2048 us -// <5=> 4096 us -// <6=> 8192 us -// <7=> 16384 us - -#ifndef QDEC_CONFIG_SAMPLEPER -#define QDEC_CONFIG_SAMPLEPER 7 -#endif - -// QDEC_CONFIG_PIO_A - A pin <0-31> - - -#ifndef QDEC_CONFIG_PIO_A -#define QDEC_CONFIG_PIO_A 31 -#endif - -// QDEC_CONFIG_PIO_B - B pin <0-31> - - -#ifndef QDEC_CONFIG_PIO_B -#define QDEC_CONFIG_PIO_B 31 -#endif - -// QDEC_CONFIG_PIO_LED - LED pin <0-31> - - -#ifndef QDEC_CONFIG_PIO_LED -#define QDEC_CONFIG_PIO_LED 31 -#endif - -// QDEC_CONFIG_LEDPRE - LED pre -#ifndef QDEC_CONFIG_LEDPRE -#define QDEC_CONFIG_LEDPRE 511 -#endif - -// QDEC_CONFIG_LEDPOL - LED polarity - -// <0=> Active low -// <1=> Active high - -#ifndef QDEC_CONFIG_LEDPOL -#define QDEC_CONFIG_LEDPOL 1 -#endif - -// QDEC_CONFIG_DBFEN - Debouncing enable - - -#ifndef QDEC_CONFIG_DBFEN -#define QDEC_CONFIG_DBFEN 0 -#endif - -// QDEC_CONFIG_SAMPLE_INTEN - Sample ready interrupt enable - - -#ifndef QDEC_CONFIG_SAMPLE_INTEN -#define QDEC_CONFIG_SAMPLE_INTEN 0 -#endif - -// QDEC_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef QDEC_CONFIG_IRQ_PRIORITY -#define QDEC_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// QSPI_ENABLED - nrf_drv_qspi - QSPI peripheral driver - legacy layer -//========================================================== -#ifndef QSPI_ENABLED -#define QSPI_ENABLED 0 -#endif -// QSPI_CONFIG_SCK_DELAY - tSHSL, tWHSL and tSHWL in number of 16 MHz periods (62.5 ns). <0-255> - - -#ifndef QSPI_CONFIG_SCK_DELAY -#define QSPI_CONFIG_SCK_DELAY 1 -#endif - -// QSPI_CONFIG_XIP_OFFSET - Address offset in the external memory for Execute in Place operation. -#ifndef QSPI_CONFIG_XIP_OFFSET -#define QSPI_CONFIG_XIP_OFFSET 0 -#endif - -// QSPI_CONFIG_READOC - Number of data lines and opcode used for reading. - -// <0=> FastRead -// <1=> Read2O -// <2=> Read2IO -// <3=> Read4O -// <4=> Read4IO - -#ifndef QSPI_CONFIG_READOC -#define QSPI_CONFIG_READOC 0 -#endif - -// QSPI_CONFIG_WRITEOC - Number of data lines and opcode used for writing. - -// <0=> PP -// <1=> PP2O -// <2=> PP4O -// <3=> PP4IO - -#ifndef QSPI_CONFIG_WRITEOC -#define QSPI_CONFIG_WRITEOC 0 -#endif - -// QSPI_CONFIG_ADDRMODE - Addressing mode. - -// <0=> 24bit -// <1=> 32bit - -#ifndef QSPI_CONFIG_ADDRMODE -#define QSPI_CONFIG_ADDRMODE 0 -#endif - -// QSPI_CONFIG_MODE - SPI mode. - -// <0=> Mode 0 -// <1=> Mode 1 - -#ifndef QSPI_CONFIG_MODE -#define QSPI_CONFIG_MODE 0 -#endif - -// QSPI_CONFIG_FREQUENCY - Frequency divider. - -// <0=> 32MHz/1 -// <1=> 32MHz/2 -// <2=> 32MHz/3 -// <3=> 32MHz/4 -// <4=> 32MHz/5 -// <5=> 32MHz/6 -// <6=> 32MHz/7 -// <7=> 32MHz/8 -// <8=> 32MHz/9 -// <9=> 32MHz/10 -// <10=> 32MHz/11 -// <11=> 32MHz/12 -// <12=> 32MHz/13 -// <13=> 32MHz/14 -// <14=> 32MHz/15 -// <15=> 32MHz/16 - -#ifndef QSPI_CONFIG_FREQUENCY -#define QSPI_CONFIG_FREQUENCY 15 -#endif - -// QSPI_PIN_SCK - SCK pin value. -#ifndef QSPI_PIN_SCK -#define QSPI_PIN_SCK NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_CSN - CSN pin value. -#ifndef QSPI_PIN_CSN -#define QSPI_PIN_CSN NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO0 - IO0 pin value. -#ifndef QSPI_PIN_IO0 -#define QSPI_PIN_IO0 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO1 - IO1 pin value. -#ifndef QSPI_PIN_IO1 -#define QSPI_PIN_IO1 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO2 - IO2 pin value. -#ifndef QSPI_PIN_IO2 -#define QSPI_PIN_IO2 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO3 - IO3 pin value. -#ifndef QSPI_PIN_IO3 -#define QSPI_PIN_IO3 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef QSPI_CONFIG_IRQ_PRIORITY -#define QSPI_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// RNG_ENABLED - nrf_drv_rng - RNG peripheral driver - legacy layer -//========================================================== -#ifndef RNG_ENABLED -#define RNG_ENABLED 0 -#endif -// RNG_CONFIG_ERROR_CORRECTION - Error correction - - -#ifndef RNG_CONFIG_ERROR_CORRECTION -#define RNG_CONFIG_ERROR_CORRECTION 1 -#endif - -// RNG_CONFIG_POOL_SIZE - Pool size -#ifndef RNG_CONFIG_POOL_SIZE -#define RNG_CONFIG_POOL_SIZE 64 -#endif - -// RNG_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef RNG_CONFIG_IRQ_PRIORITY -#define RNG_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// RTC_ENABLED - nrf_drv_rtc - RTC peripheral driver - legacy layer -//========================================================== -#ifndef RTC_ENABLED -#define RTC_ENABLED 0 -#endif -// RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768> - - -#ifndef RTC_DEFAULT_CONFIG_FREQUENCY -#define RTC_DEFAULT_CONFIG_FREQUENCY 32768 -#endif - -// RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering - - -#ifndef RTC_DEFAULT_CONFIG_RELIABLE -#define RTC_DEFAULT_CONFIG_RELIABLE 0 -#endif - -// RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// RTC0_ENABLED - Enable RTC0 instance - - -#ifndef RTC0_ENABLED -#define RTC0_ENABLED 0 -#endif - -// RTC1_ENABLED - Enable RTC1 instance - - -#ifndef RTC1_ENABLED -#define RTC1_ENABLED 0 -#endif - -// RTC2_ENABLED - Enable RTC2 instance - - -#ifndef RTC2_ENABLED -#define RTC2_ENABLED 0 -#endif - -// NRF_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt -#ifndef NRF_MAXIMUM_LATENCY_US -#define NRF_MAXIMUM_LATENCY_US 2000 -#endif - -// - -// SAADC_ENABLED - nrf_drv_saadc - SAADC peripheral driver - legacy layer -//========================================================== -#ifndef SAADC_ENABLED -#define SAADC_ENABLED 0 -#endif -// SAADC_CONFIG_RESOLUTION - Resolution - -// <0=> 8 bit -// <1=> 10 bit -// <2=> 12 bit -// <3=> 14 bit - -#ifndef SAADC_CONFIG_RESOLUTION -#define SAADC_CONFIG_RESOLUTION 1 -#endif - -// SAADC_CONFIG_OVERSAMPLE - Sample period - -// <0=> Disabled -// <1=> 2x -// <2=> 4x -// <3=> 8x -// <4=> 16x -// <5=> 32x -// <6=> 64x -// <7=> 128x -// <8=> 256x - -#ifndef SAADC_CONFIG_OVERSAMPLE -#define SAADC_CONFIG_OVERSAMPLE 0 -#endif - -// SAADC_CONFIG_LP_MODE - Enabling low power mode - - -#ifndef SAADC_CONFIG_LP_MODE -#define SAADC_CONFIG_LP_MODE 0 -#endif - -// SAADC_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef SAADC_CONFIG_IRQ_PRIORITY -#define SAADC_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// SPIS_ENABLED - nrf_drv_spis - SPIS peripheral driver - legacy layer -//========================================================== -#ifndef SPIS_ENABLED -#define SPIS_ENABLED 0 -#endif -// SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// SPIS_DEFAULT_MODE - Mode - -// <0=> MODE_0 -// <1=> MODE_1 -// <2=> MODE_2 -// <3=> MODE_3 - -#ifndef SPIS_DEFAULT_MODE -#define SPIS_DEFAULT_MODE 0 -#endif - -// SPIS_DEFAULT_BIT_ORDER - SPIS default bit order - -// <0=> MSB first -// <1=> LSB first - -#ifndef SPIS_DEFAULT_BIT_ORDER -#define SPIS_DEFAULT_BIT_ORDER 0 -#endif - -// SPIS_DEFAULT_DEF - SPIS default DEF character <0-255> - - -#ifndef SPIS_DEFAULT_DEF -#define SPIS_DEFAULT_DEF 255 -#endif - -// SPIS_DEFAULT_ORC - SPIS default ORC character <0-255> - - -#ifndef SPIS_DEFAULT_ORC -#define SPIS_DEFAULT_ORC 255 -#endif - -// SPIS0_ENABLED - Enable SPIS0 instance - - -#ifndef SPIS0_ENABLED -#define SPIS0_ENABLED 0 -#endif - -// SPIS1_ENABLED - Enable SPIS1 instance - - -#ifndef SPIS1_ENABLED -#define SPIS1_ENABLED 0 -#endif - -// SPIS2_ENABLED - Enable SPIS2 instance - - -#ifndef SPIS2_ENABLED -#define SPIS2_ENABLED 0 -#endif - -// - -// SPI_ENABLED - nrf_drv_spi - SPI/SPIM peripheral driver - legacy layer -//========================================================== -#ifndef SPI_ENABLED -#define SPI_ENABLED 0 -#endif -// SPI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef SPI_DEFAULT_CONFIG_IRQ_PRIORITY -#define SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRF_SPI_DRV_MISO_PULLUP_CFG - MISO PIN pull-up configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP - -#ifndef NRF_SPI_DRV_MISO_PULLUP_CFG -#define NRF_SPI_DRV_MISO_PULLUP_CFG 1 -#endif - -// SPI0_ENABLED - Enable SPI0 instance -//========================================================== -#ifndef SPI0_ENABLED -#define SPI0_ENABLED 0 -#endif -// SPI0_USE_EASY_DMA - Use EasyDMA - - -#ifndef SPI0_USE_EASY_DMA -#define SPI0_USE_EASY_DMA 1 -#endif - -// - -// SPI1_ENABLED - Enable SPI1 instance -//========================================================== -#ifndef SPI1_ENABLED -#define SPI1_ENABLED 0 -#endif -// SPI1_USE_EASY_DMA - Use EasyDMA - - -#ifndef SPI1_USE_EASY_DMA -#define SPI1_USE_EASY_DMA 1 -#endif - -// - -// SPI2_ENABLED - Enable SPI2 instance -//========================================================== -#ifndef SPI2_ENABLED -#define SPI2_ENABLED 0 -#endif -// SPI2_USE_EASY_DMA - Use EasyDMA - - -#ifndef SPI2_USE_EASY_DMA -#define SPI2_USE_EASY_DMA 1 -#endif - -// - -// - -// TIMER_ENABLED - nrf_drv_timer - TIMER periperal driver - legacy layer -//========================================================== -#ifndef TIMER_ENABLED -#define TIMER_ENABLED 0 -#endif -// TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz -// <8=> 62.5 kHz -// <9=> 31.25 kHz - -#ifndef TIMER_DEFAULT_CONFIG_FREQUENCY -#define TIMER_DEFAULT_CONFIG_FREQUENCY 0 -#endif - -// TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation - -// <0=> Timer -// <1=> Counter - -#ifndef TIMER_DEFAULT_CONFIG_MODE -#define TIMER_DEFAULT_CONFIG_MODE 0 -#endif - -// TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width - -// <0=> 16 bit -// <1=> 8 bit -// <2=> 24 bit -// <3=> 32 bit - -#ifndef TIMER_DEFAULT_CONFIG_BIT_WIDTH -#define TIMER_DEFAULT_CONFIG_BIT_WIDTH 0 -#endif - -// TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// TIMER0_ENABLED - Enable TIMER0 instance - - -#ifndef TIMER0_ENABLED -#define TIMER0_ENABLED 0 -#endif - -// TIMER1_ENABLED - Enable TIMER1 instance - - -#ifndef TIMER1_ENABLED -#define TIMER1_ENABLED 0 -#endif - -// TIMER2_ENABLED - Enable TIMER2 instance - - -#ifndef TIMER2_ENABLED -#define TIMER2_ENABLED 0 -#endif - -// TIMER3_ENABLED - Enable TIMER3 instance - - -#ifndef TIMER3_ENABLED -#define TIMER3_ENABLED 0 -#endif - -// TIMER4_ENABLED - Enable TIMER4 instance - - -#ifndef TIMER4_ENABLED -#define TIMER4_ENABLED 0 -#endif - -// - -// TWIS_ENABLED - nrf_drv_twis - TWIS peripheral driver - legacy layer -//========================================================== -#ifndef TWIS_ENABLED -#define TWIS_ENABLED 0 -#endif -// TWIS0_ENABLED - Enable TWIS0 instance - - -#ifndef TWIS0_ENABLED -#define TWIS0_ENABLED 0 -#endif - -// TWIS1_ENABLED - Enable TWIS1 instance - - -#ifndef TWIS1_ENABLED -#define TWIS1_ENABLED 0 -#endif - -// TWIS_ASSUME_INIT_AFTER_RESET_ONLY - Assume that any instance would be initialized only once - - -// Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code. - -#ifndef TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#define TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 -#endif - -// TWIS_NO_SYNC_MODE - Remove support for synchronous mode - - -// Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources. - -#ifndef TWIS_NO_SYNC_MODE -#define TWIS_NO_SYNC_MODE 0 -#endif - -// TWIS_DEFAULT_CONFIG_ADDR0 - Address0 -#ifndef TWIS_DEFAULT_CONFIG_ADDR0 -#define TWIS_DEFAULT_CONFIG_ADDR0 0 -#endif - -// TWIS_DEFAULT_CONFIG_ADDR1 - Address1 -#ifndef TWIS_DEFAULT_CONFIG_ADDR1 -#define TWIS_DEFAULT_CONFIG_ADDR1 0 -#endif - -// TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef TWIS_DEFAULT_CONFIG_SCL_PULL -#define TWIS_DEFAULT_CONFIG_SCL_PULL 0 -#endif - -// TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef TWIS_DEFAULT_CONFIG_SDA_PULL -#define TWIS_DEFAULT_CONFIG_SDA_PULL 0 -#endif - -// TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// TWI_ENABLED - nrf_drv_twi - TWI/TWIM peripheral driver - legacy layer -//========================================================== -#ifndef TWI_ENABLED -#define TWI_ENABLED 0 -#endif -// TWI_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k - -#ifndef TWI_DEFAULT_CONFIG_FREQUENCY -#define TWI_DEFAULT_CONFIG_FREQUENCY 26738688 -#endif - -// TWI_DEFAULT_CONFIG_CLR_BUS_INIT - Enables bus clearing procedure during init - - -#ifndef TWI_DEFAULT_CONFIG_CLR_BUS_INIT -#define TWI_DEFAULT_CONFIG_CLR_BUS_INIT 0 -#endif - -// TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - - -#ifndef TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 -#endif - -// TWI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef TWI_DEFAULT_CONFIG_IRQ_PRIORITY -#define TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// TWI0_ENABLED - Enable TWI0 instance -//========================================================== -#ifndef TWI0_ENABLED -#define TWI0_ENABLED 0 -#endif -// TWI0_USE_EASY_DMA - Use EasyDMA (if present) - - -#ifndef TWI0_USE_EASY_DMA -#define TWI0_USE_EASY_DMA 0 -#endif - -// - -// TWI1_ENABLED - Enable TWI1 instance -//========================================================== -#ifndef TWI1_ENABLED -#define TWI1_ENABLED 0 -#endif -// TWI1_USE_EASY_DMA - Use EasyDMA (if present) - - -#ifndef TWI1_USE_EASY_DMA -#define TWI1_USE_EASY_DMA 0 -#endif - -// - -// - -// UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer -//========================================================== -#ifndef UART_ENABLED -#define UART_ENABLED 0 -#endif -// UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef UART_DEFAULT_CONFIG_HWFC -#define UART_DEFAULT_CONFIG_HWFC 0 -#endif - -// UART_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included - -#ifndef UART_DEFAULT_CONFIG_PARITY -#define UART_DEFAULT_CONFIG_PARITY 0 -#endif - -// UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef UART_DEFAULT_CONFIG_BAUDRATE -#define UART_DEFAULT_CONFIG_BAUDRATE 30801920 -#endif - -// UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef UART_DEFAULT_CONFIG_IRQ_PRIORITY -#define UART_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// UART_EASY_DMA_SUPPORT - Driver supporting EasyDMA - - -#ifndef UART_EASY_DMA_SUPPORT -#define UART_EASY_DMA_SUPPORT 1 -#endif - -// UART_LEGACY_SUPPORT - Driver supporting Legacy mode - - -#ifndef UART_LEGACY_SUPPORT -#define UART_LEGACY_SUPPORT 1 -#endif - -// UART0_ENABLED - Enable UART0 instance -//========================================================== -#ifndef UART0_ENABLED -#define UART0_ENABLED 0 -#endif -// UART0_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA - - -#ifndef UART0_CONFIG_USE_EASY_DMA -#define UART0_CONFIG_USE_EASY_DMA 1 -#endif - -// - -// UART1_ENABLED - Enable UART1 instance -//========================================================== -#ifndef UART1_ENABLED -#define UART1_ENABLED 0 -#endif -// - -// - -// USBD_ENABLED - nrf_drv_usbd - Software Component -//========================================================== -#ifndef USBD_ENABLED -#define USBD_ENABLED 0 -#endif -// USBD_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef USBD_CONFIG_IRQ_PRIORITY -#define USBD_CONFIG_IRQ_PRIORITY 6 -#endif - -// USBD_CONFIG_DMASCHEDULER_MODE - USBD SMA scheduler working scheme - -// <0=> Prioritized access -// <1=> Round Robin - -#ifndef USBD_CONFIG_DMASCHEDULER_MODE -#define USBD_CONFIG_DMASCHEDULER_MODE 0 -#endif - -// USBD_CONFIG_DMASCHEDULER_ISO_BOOST - Give priority to isochronous transfers - - -// This option gives priority to isochronous transfers. -// Enabling it assures that isochronous transfers are always processed, -// even if multiple other transfers are pending. -// Isochronous endpoints are prioritized before the usbd_dma_scheduler_algorithm -// function is called, so the option is independent of the algorithm chosen. - -#ifndef USBD_CONFIG_DMASCHEDULER_ISO_BOOST -#define USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1 -#endif - -// USBD_CONFIG_ISO_IN_ZLP - Respond to an IN token on ISO IN endpoint with ZLP when no data is ready - - -// If set, ISO IN endpoint will respond to an IN token with ZLP when no data is ready to be sent. -// Else, there will be no response. -// NOTE: This option does not work on Engineering A chip. - -#ifndef USBD_CONFIG_ISO_IN_ZLP -#define USBD_CONFIG_ISO_IN_ZLP 0 -#endif - -// - -// WDT_ENABLED - nrf_drv_wdt - WDT peripheral driver - legacy layer -//========================================================== -#ifndef WDT_ENABLED -#define WDT_ENABLED 0 -#endif -// WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode - -// <1=> Run in SLEEP, Pause in HALT -// <8=> Pause in SLEEP, Run in HALT -// <9=> Run in SLEEP and HALT -// <0=> Pause in SLEEP and HALT - -#ifndef WDT_CONFIG_BEHAVIOUR -#define WDT_CONFIG_BEHAVIOUR 1 -#endif - -// WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> - - -#ifndef WDT_CONFIG_RELOAD_VALUE -#define WDT_CONFIG_RELOAD_VALUE 2000 -#endif - -// WDT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef WDT_CONFIG_IRQ_PRIORITY -#define WDT_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// nrfx_qspi - QSPI peripheral driver - -//========================================================== -// -//========================================================== - -// -//========================================================== - -// nRF_Drivers_External - -//========================================================== -// NRF_TWI_SENSOR_ENABLED - nrf_twi_sensor - nRF TWI Sensor module - - -#ifndef NRF_TWI_SENSOR_ENABLED -#define NRF_TWI_SENSOR_ENABLED 0 -#endif - -// -//========================================================== - -// nRF_Libraries - -//========================================================== -// APP_GPIOTE_ENABLED - app_gpiote - GPIOTE events dispatcher - - -#ifndef APP_GPIOTE_ENABLED -#define APP_GPIOTE_ENABLED 0 -#endif - -// APP_PWM_ENABLED - app_pwm - PWM functionality - - -#ifndef APP_PWM_ENABLED -#define APP_PWM_ENABLED 0 -#endif - -// APP_SCHEDULER_ENABLED - app_scheduler - Events scheduler -//========================================================== -#ifndef APP_SCHEDULER_ENABLED -#define APP_SCHEDULER_ENABLED 0 -#endif -// APP_SCHEDULER_WITH_PAUSE - Enabling pause feature - - -#ifndef APP_SCHEDULER_WITH_PAUSE -#define APP_SCHEDULER_WITH_PAUSE 0 -#endif - -// APP_SCHEDULER_WITH_PROFILER - Enabling scheduler profiling - - -#ifndef APP_SCHEDULER_WITH_PROFILER -#define APP_SCHEDULER_WITH_PROFILER 0 -#endif - -// - -// APP_SDCARD_ENABLED - app_sdcard - SD/MMC card support using SPI -//========================================================== -#ifndef APP_SDCARD_ENABLED -#define APP_SDCARD_ENABLED 0 -#endif -// APP_SDCARD_SPI_INSTANCE - SPI instance used - -// <0=> 0 -// <1=> 1 -// <2=> 2 - -#ifndef APP_SDCARD_SPI_INSTANCE -#define APP_SDCARD_SPI_INSTANCE 0 -#endif - -// APP_SDCARD_FREQ_INIT - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz - -#ifndef APP_SDCARD_FREQ_INIT -#define APP_SDCARD_FREQ_INIT 67108864 -#endif - -// APP_SDCARD_FREQ_DATA - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz - -#ifndef APP_SDCARD_FREQ_DATA -#define APP_SDCARD_FREQ_DATA 1073741824 -#endif - -// - -// APP_TIMER_ENABLED - app_timer - Application timer functionality -//========================================================== -#ifndef APP_TIMER_ENABLED -#define APP_TIMER_ENABLED 0 -#endif -// APP_TIMER_CONFIG_RTC_FREQUENCY - Configure RTC prescaler. - -// <0=> 32768 Hz -// <1=> 16384 Hz -// <3=> 8192 Hz -// <7=> 4096 Hz -// <15=> 2048 Hz -// <31=> 1024 Hz - -#ifndef APP_TIMER_CONFIG_RTC_FREQUENCY -#define APP_TIMER_CONFIG_RTC_FREQUENCY 1 -#endif - -// APP_TIMER_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef APP_TIMER_CONFIG_IRQ_PRIORITY -#define APP_TIMER_CONFIG_IRQ_PRIORITY 6 -#endif - -// APP_TIMER_CONFIG_OP_QUEUE_SIZE - Capacity of timer requests queue. -// Size of the queue depends on how many timers are used -// in the system, how often timers are started and overall -// system latency. If queue size is too small app_timer calls -// will fail. - -#ifndef APP_TIMER_CONFIG_OP_QUEUE_SIZE -#define APP_TIMER_CONFIG_OP_QUEUE_SIZE 10 -#endif - -// APP_TIMER_CONFIG_USE_SCHEDULER - Enable scheduling app_timer events to app_scheduler - - -#ifndef APP_TIMER_CONFIG_USE_SCHEDULER -#define APP_TIMER_CONFIG_USE_SCHEDULER 0 -#endif - -// APP_TIMER_KEEPS_RTC_ACTIVE - Enable RTC always on - - -// If option is enabled RTC is kept running even if there is no active timers. -// This option can be used when app_timer is used for timestamping. - -#ifndef APP_TIMER_KEEPS_RTC_ACTIVE -#define APP_TIMER_KEEPS_RTC_ACTIVE 0 -#endif - -// APP_TIMER_SAFE_WINDOW_MS - Maximum possible latency (in milliseconds) of handling app_timer event. -// Maximum possible timeout that can be set is reduced by safe window. -// Example: RTC frequency 16384 Hz, maximum possible timeout 1024 seconds - APP_TIMER_SAFE_WINDOW_MS. -// Since RTC is not stopped when processor is halted in debugging session, this value -// must cover it if debugging is needed. It is possible to halt processor for APP_TIMER_SAFE_WINDOW_MS -// without corrupting app_timer behavior. - -#ifndef APP_TIMER_SAFE_WINDOW_MS -#define APP_TIMER_SAFE_WINDOW_MS 300000 -#endif - -// App Timer Legacy configuration - Legacy configuration. - -//========================================================== -// APP_TIMER_WITH_PROFILER - Enable app_timer profiling - - -#ifndef APP_TIMER_WITH_PROFILER -#define APP_TIMER_WITH_PROFILER 0 -#endif - -// APP_TIMER_CONFIG_SWI_NUMBER - Configure SWI instance used. - - -#ifndef APP_TIMER_CONFIG_SWI_NUMBER -#define APP_TIMER_CONFIG_SWI_NUMBER 0 -#endif - -// -//========================================================== - -// - -// APP_USBD_AUDIO_ENABLED - app_usbd_audio - USB AUDIO class - - -#ifndef APP_USBD_AUDIO_ENABLED -#define APP_USBD_AUDIO_ENABLED 0 -#endif - -// APP_USBD_ENABLED - app_usbd - USB Device library -//========================================================== -#ifndef APP_USBD_ENABLED -#define APP_USBD_ENABLED 0 -#endif -// APP_USBD_VID - Vendor ID. <0x0000-0xFFFF> - - -// Note: This value is not editable in Configuration Wizard. -// Vendor ID ordered from USB IF: http://www.usb.org/developers/vendor/ - -#ifndef APP_USBD_VID -#define APP_USBD_VID 0 -#endif - -// APP_USBD_PID - Product ID. <0x0000-0xFFFF> - - -// Note: This value is not editable in Configuration Wizard. -// Selected Product ID - -#ifndef APP_USBD_PID -#define APP_USBD_PID 0 -#endif - -// APP_USBD_DEVICE_VER_MAJOR - Major device version <0-99> - - -// Major device version, will be converted automatically to BCD notation. Use just decimal values. - -#ifndef APP_USBD_DEVICE_VER_MAJOR -#define APP_USBD_DEVICE_VER_MAJOR 1 -#endif - -// APP_USBD_DEVICE_VER_MINOR - Minor device version <0-9> - - -// Minor device version, will be converted automatically to BCD notation. Use just decimal values. - -#ifndef APP_USBD_DEVICE_VER_MINOR -#define APP_USBD_DEVICE_VER_MINOR 0 -#endif - -// APP_USBD_DEVICE_VER_SUB - Sub-minor device version <0-9> - - -// Sub-minor device version, will be converted automatically to BCD notation. Use just decimal values. - -#ifndef APP_USBD_DEVICE_VER_SUB -#define APP_USBD_DEVICE_VER_SUB 0 -#endif - -// APP_USBD_CONFIG_SELF_POWERED - Self-powered device, as opposed to bus-powered. - - -#ifndef APP_USBD_CONFIG_SELF_POWERED -#define APP_USBD_CONFIG_SELF_POWERED 1 -#endif - -// APP_USBD_CONFIG_MAX_POWER - MaxPower field in configuration descriptor in milliamps. <0-500> - - -#ifndef APP_USBD_CONFIG_MAX_POWER -#define APP_USBD_CONFIG_MAX_POWER 100 -#endif - -// APP_USBD_CONFIG_POWER_EVENTS_PROCESS - Process power events. - - -// Enable processing power events in USB event handler. - -#ifndef APP_USBD_CONFIG_POWER_EVENTS_PROCESS -#define APP_USBD_CONFIG_POWER_EVENTS_PROCESS 1 -#endif - -// APP_USBD_CONFIG_EVENT_QUEUE_ENABLE - Enable event queue. - -// This is the default configuration when all the events are placed into internal queue. -// Disable it when an external queue is used like app_scheduler or if you wish to process all events inside interrupts. -// Processing all events from the interrupt level adds requirement not to call any functions that modifies the USBD library state from the context higher than USB interrupt context. -// Functions that modify USBD state are functions for sleep, wakeup, start, stop, enable, and disable. -//========================================================== -#ifndef APP_USBD_CONFIG_EVENT_QUEUE_ENABLE -#define APP_USBD_CONFIG_EVENT_QUEUE_ENABLE 1 -#endif -// APP_USBD_CONFIG_EVENT_QUEUE_SIZE - The size of the event queue. <16-64> - - -// The size of the queue for the events that would be processed in the main loop. - -#ifndef APP_USBD_CONFIG_EVENT_QUEUE_SIZE -#define APP_USBD_CONFIG_EVENT_QUEUE_SIZE 32 -#endif - -// APP_USBD_CONFIG_SOF_HANDLING_MODE - Change SOF events handling mode. - - -// Normal queue - SOF events are pushed normally into the event queue. -// Compress queue - SOF events are counted and binded with other events or executed when the queue is empty. -// This prevents the queue from filling up with SOF events. -// Interrupt - SOF events are processed in interrupt. -// <0=> Normal queue -// <1=> Compress queue -// <2=> Interrupt - -#ifndef APP_USBD_CONFIG_SOF_HANDLING_MODE -#define APP_USBD_CONFIG_SOF_HANDLING_MODE 1 -#endif - -// - -// APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE - Provide a function that generates timestamps for logs based on the current SOF. - - -// The function app_usbd_sof_timestamp_get is implemented if the logger is enabled. -// Use it when initializing the logger. -// SOF processing is always enabled when this configuration parameter is active. -// Note: This option is configured outside of APP_USBD_CONFIG_LOG_ENABLED. -// This means that it works even if the logging in this very module is disabled. - -#ifndef APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE -#define APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE 0 -#endif - -// APP_USBD_CONFIG_DESC_STRING_SIZE - Maximum size of the NULL-terminated string of the string descriptor. <31-254> - - -// 31 characters can be stored in the internal USB buffer used for transfers. -// Any value higher than 31 creates an additional buffer just for descriptor strings. - -#ifndef APP_USBD_CONFIG_DESC_STRING_SIZE -#define APP_USBD_CONFIG_DESC_STRING_SIZE 31 -#endif - -// APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED - Enable UTF8 conversion. - - -// Enable UTF8-encoded characters. In normal processing, only ASCII characters are available. - -#ifndef APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED -#define APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED 0 -#endif - -// APP_USBD_STRINGS_LANGIDS - Supported languages identifiers. - -// Note: This value is not editable in Configuration Wizard. -// Comma-separated list of supported languages. -#ifndef APP_USBD_STRINGS_LANGIDS -#define APP_USBD_STRINGS_LANGIDS APP_USBD_LANG_AND_SUBLANG(APP_USBD_LANG_ENGLISH, APP_USBD_SUBLANG_ENGLISH_US) -#endif - -// APP_USBD_STRING_ID_MANUFACTURER - Define manufacturer string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_MANUFACTURER -#define APP_USBD_STRING_ID_MANUFACTURER 1 -#endif -// APP_USBD_STRINGS_MANUFACTURER_EXTERN - Define whether @ref APP_USBD_STRINGS_MANUFACTURER is created by macro or declared as a global variable. - - -#ifndef APP_USBD_STRINGS_MANUFACTURER_EXTERN -#define APP_USBD_STRINGS_MANUFACTURER_EXTERN 0 -#endif - -// APP_USBD_STRINGS_MANUFACTURER - String descriptor for the manufacturer name. - -// Note: This value is not editable in Configuration Wizard. -// Comma-separated list of manufacturer names for each defined language. -// Use @ref APP_USBD_STRING_DESC macro to create string descriptor from a NULL-terminated string. -// Use @ref APP_USBD_STRING_RAW8_DESC macro to create string descriptor from comma-separated uint8_t values. -// Use @ref APP_USBD_STRING_RAW16_DESC macro to create string descriptor from comma-separated uint16_t values. -// Alternatively, configure the macro to point to any internal variable pointer that already contains the descriptor. -// Setting string to NULL disables that string. -// The order of manufacturer names must be the same like in @ref APP_USBD_STRINGS_LANGIDS. -#ifndef APP_USBD_STRINGS_MANUFACTURER -#define APP_USBD_STRINGS_MANUFACTURER APP_USBD_STRING_DESC("Nordic Semiconductor") -#endif - -// - -// APP_USBD_STRING_ID_PRODUCT - Define product string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_PRODUCT -#define APP_USBD_STRING_ID_PRODUCT 2 -#endif -// APP_USBD_STRINGS_PRODUCT_EXTERN - Define whether @ref APP_USBD_STRINGS_PRODUCT is created by macro or declared as a global variable. - - -#ifndef APP_USBD_STRINGS_PRODUCT_EXTERN -#define APP_USBD_STRINGS_PRODUCT_EXTERN 0 -#endif - -// APP_USBD_STRINGS_PRODUCT - String descriptor for the product name. - -// Note: This value is not editable in Configuration Wizard. -// List of product names that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER. -#ifndef APP_USBD_STRINGS_PRODUCT -#define APP_USBD_STRINGS_PRODUCT APP_USBD_STRING_DESC("nRF52 USB Product") -#endif - -// - -// APP_USBD_STRING_ID_SERIAL - Define serial number string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_SERIAL -#define APP_USBD_STRING_ID_SERIAL 3 -#endif -// APP_USBD_STRING_SERIAL_EXTERN - Define whether @ref APP_USBD_STRING_SERIAL is created by macro or declared as a global variable. - - -#ifndef APP_USBD_STRING_SERIAL_EXTERN -#define APP_USBD_STRING_SERIAL_EXTERN 0 -#endif - -// APP_USBD_STRING_SERIAL - String descriptor for the serial number. - -// Note: This value is not editable in Configuration Wizard. -// Serial number that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER. -#ifndef APP_USBD_STRING_SERIAL -#define APP_USBD_STRING_SERIAL APP_USBD_STRING_DESC("000000000000") -#endif - -// - -// APP_USBD_STRING_ID_CONFIGURATION - Define configuration string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_CONFIGURATION -#define APP_USBD_STRING_ID_CONFIGURATION 4 -#endif -// APP_USBD_STRING_CONFIGURATION_EXTERN - Define whether @ref APP_USBD_STRINGS_CONFIGURATION is created by macro or declared as global variable. - - -#ifndef APP_USBD_STRING_CONFIGURATION_EXTERN -#define APP_USBD_STRING_CONFIGURATION_EXTERN 0 -#endif - -// APP_USBD_STRINGS_CONFIGURATION - String descriptor for the device configuration. - -// Note: This value is not editable in Configuration Wizard. -// Configuration string that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER. -#ifndef APP_USBD_STRINGS_CONFIGURATION -#define APP_USBD_STRINGS_CONFIGURATION APP_USBD_STRING_DESC("Default configuration") -#endif - -// - -// APP_USBD_STRINGS_USER - Default values for user strings. - -// Note: This value is not editable in Configuration Wizard. -// This value stores all application specific user strings with the default initialization. -// The setup is done by X-macros. -// Expected macro parameters: -// @code -// X(mnemonic, [=str_idx], ...) -// @endcode -// - @c mnemonic: Mnemonic of the string descriptor that would be added to -// @ref app_usbd_string_desc_idx_t enumerator. -// - @c str_idx : String index value, can be set or left empty. -// For example, WinUSB driver requires descriptor to be present on 0xEE index. -// Then use X(USBD_STRING_WINUSB, =0xEE, (APP_USBD_STRING_DESC(...))) -// - @c ... : List of string descriptors for each defined language. -#ifndef APP_USBD_STRINGS_USER -#define APP_USBD_STRINGS_USER X(APP_USER_1, , APP_USBD_STRING_DESC("User 1")) -#endif - -// - -// APP_USBD_HID_ENABLED - app_usbd_hid - USB HID class -//========================================================== -#ifndef APP_USBD_HID_ENABLED -#define APP_USBD_HID_ENABLED 0 -#endif -// APP_USBD_HID_DEFAULT_IDLE_RATE - Default idle rate for HID class. <0-255> - - -// 0 means indefinite duration, any other value is multiplied by 4 milliseconds. Refer to Chapter 7.2.4 of HID 1.11 Specification. - -#ifndef APP_USBD_HID_DEFAULT_IDLE_RATE -#define APP_USBD_HID_DEFAULT_IDLE_RATE 0 -#endif - -// APP_USBD_HID_REPORT_IDLE_TABLE_SIZE - Size of idle rate table. <1-255> - - -// Must be higher than the highest report ID used. - -#ifndef APP_USBD_HID_REPORT_IDLE_TABLE_SIZE -#define APP_USBD_HID_REPORT_IDLE_TABLE_SIZE 4 -#endif - -// - -// APP_USBD_HID_GENERIC_ENABLED - app_usbd_hid_generic - USB HID generic - - -#ifndef APP_USBD_HID_GENERIC_ENABLED -#define APP_USBD_HID_GENERIC_ENABLED 0 -#endif - -// APP_USBD_HID_KBD_ENABLED - app_usbd_hid_kbd - USB HID keyboard - - -#ifndef APP_USBD_HID_KBD_ENABLED -#define APP_USBD_HID_KBD_ENABLED 0 -#endif - -// APP_USBD_HID_MOUSE_ENABLED - app_usbd_hid_mouse - USB HID mouse - - -#ifndef APP_USBD_HID_MOUSE_ENABLED -#define APP_USBD_HID_MOUSE_ENABLED 0 -#endif - -// APP_USBD_MSC_ENABLED - app_usbd_msc - USB MSC class - - -#ifndef APP_USBD_MSC_ENABLED -#define APP_USBD_MSC_ENABLED 0 -#endif - -// CRC16_ENABLED - crc16 - CRC16 calculation routines - - -#ifndef CRC16_ENABLED -#define CRC16_ENABLED 0 -#endif - -// CRC32_ENABLED - crc32 - CRC32 calculation routines - - -#ifndef CRC32_ENABLED -#define CRC32_ENABLED 0 -#endif - -// ECC_ENABLED - ecc - Elliptic Curve Cryptography Library - - -#ifndef ECC_ENABLED -#define ECC_ENABLED 0 -#endif - -// FDS_ENABLED - fds - Flash data storage module -//========================================================== -#ifndef FDS_ENABLED -#define FDS_ENABLED 0 -#endif -// Pages - Virtual page settings - -// Configure the number of virtual pages to use and their size. -//========================================================== -// FDS_VIRTUAL_PAGES - Number of virtual flash pages to use. -// One of the virtual pages is reserved by the system for garbage collection. -// Therefore, the minimum is two virtual pages: one page to store data and one page to be used by the system for garbage collection. -// The total amount of flash memory that is used by FDS amounts to @ref FDS_VIRTUAL_PAGES * @ref FDS_VIRTUAL_PAGE_SIZE * 4 bytes. - -#ifndef FDS_VIRTUAL_PAGES -#define FDS_VIRTUAL_PAGES 3 -#endif - -// FDS_VIRTUAL_PAGE_SIZE - The size of a virtual flash page. - - -// Expressed in number of 4-byte words. -// By default, a virtual page is the same size as a physical page. -// The size of a virtual page must be a multiple of the size of a physical page. -// <1024=> 1024 -// <2048=> 2048 - -#ifndef FDS_VIRTUAL_PAGE_SIZE -#define FDS_VIRTUAL_PAGE_SIZE 1024 -#endif - -// FDS_VIRTUAL_PAGES_RESERVED - The number of virtual flash pages that are used by other modules. -// FDS module stores its data in the last pages of the flash memory. -// By setting this value, you can move flash end address used by the FDS. -// As a result the reserved space can be used by other modules. - -#ifndef FDS_VIRTUAL_PAGES_RESERVED -#define FDS_VIRTUAL_PAGES_RESERVED 0 -#endif - -// -//========================================================== - -// Backend - Backend configuration - -// Configure which nrf_fstorage backend is used by FDS to write to flash. -//========================================================== -// FDS_BACKEND - FDS flash backend. - - -// NRF_FSTORAGE_SD uses the nrf_fstorage_sd backend implementation using the SoftDevice API. Use this if you have a SoftDevice present. -// NRF_FSTORAGE_NVMC uses the nrf_fstorage_nvmc implementation. Use this setting if you don't use the SoftDevice. -// <1=> NRF_FSTORAGE_NVMC -// <2=> NRF_FSTORAGE_SD - -#ifndef FDS_BACKEND -#define FDS_BACKEND 2 -#endif - -// -//========================================================== - -// Queue - Queue settings - -//========================================================== -// FDS_OP_QUEUE_SIZE - Size of the internal queue. -// Increase this value if you frequently get synchronous FDS_ERR_NO_SPACE_IN_QUEUES errors. - -#ifndef FDS_OP_QUEUE_SIZE -#define FDS_OP_QUEUE_SIZE 4 -#endif - -// -//========================================================== - -// CRC - CRC functionality - -//========================================================== -// FDS_CRC_CHECK_ON_READ - Enable CRC checks. - -// Save a record's CRC when it is written to flash and check it when the record is opened. -// Records with an incorrect CRC can still be 'seen' by the user using FDS functions, but they cannot be opened. -// Additionally, they will not be garbage collected until they are deleted. -//========================================================== -#ifndef FDS_CRC_CHECK_ON_READ -#define FDS_CRC_CHECK_ON_READ 0 -#endif -// FDS_CRC_CHECK_ON_WRITE - Perform a CRC check on newly written records. - - -// Perform a CRC check on newly written records. -// This setting can be used to make sure that the record data was not altered while being written to flash. -// <1=> Enabled -// <0=> Disabled - -#ifndef FDS_CRC_CHECK_ON_WRITE -#define FDS_CRC_CHECK_ON_WRITE 0 -#endif - -// - -// -//========================================================== - -// Users - Number of users - -//========================================================== -// FDS_MAX_USERS - Maximum number of callbacks that can be registered. -#ifndef FDS_MAX_USERS -#define FDS_MAX_USERS 4 -#endif - -// -//========================================================== - -// - -// HARDFAULT_HANDLER_ENABLED - hardfault_default - HardFault default handler for debugging and release - - -#ifndef HARDFAULT_HANDLER_ENABLED -#define HARDFAULT_HANDLER_ENABLED 0 -#endif - -// HCI_MEM_POOL_ENABLED - hci_mem_pool - memory pool implementation used by HCI -//========================================================== -#ifndef HCI_MEM_POOL_ENABLED -#define HCI_MEM_POOL_ENABLED 0 -#endif -// HCI_TX_BUF_SIZE - TX buffer size in bytes. -#ifndef HCI_TX_BUF_SIZE -#define HCI_TX_BUF_SIZE 600 -#endif - -// HCI_RX_BUF_SIZE - RX buffer size in bytes. -#ifndef HCI_RX_BUF_SIZE -#define HCI_RX_BUF_SIZE 600 -#endif - -// HCI_RX_BUF_QUEUE_SIZE - RX buffer queue size. -#ifndef HCI_RX_BUF_QUEUE_SIZE -#define HCI_RX_BUF_QUEUE_SIZE 4 -#endif - -// - -// HCI_SLIP_ENABLED - hci_slip - SLIP protocol implementation used by HCI -//========================================================== -#ifndef HCI_SLIP_ENABLED -#define HCI_SLIP_ENABLED 0 -#endif -// HCI_UART_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef HCI_UART_BAUDRATE -#define HCI_UART_BAUDRATE 30801920 -#endif - -// HCI_UART_FLOW_CONTROL - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef HCI_UART_FLOW_CONTROL -#define HCI_UART_FLOW_CONTROL 0 -#endif - -// HCI_UART_RX_PIN - UART RX pin -#ifndef HCI_UART_RX_PIN -#define HCI_UART_RX_PIN 31 -#endif - -// HCI_UART_TX_PIN - UART TX pin -#ifndef HCI_UART_TX_PIN -#define HCI_UART_TX_PIN 31 -#endif - -// HCI_UART_RTS_PIN - UART RTS pin -#ifndef HCI_UART_RTS_PIN -#define HCI_UART_RTS_PIN 31 -#endif - -// HCI_UART_CTS_PIN - UART CTS pin -#ifndef HCI_UART_CTS_PIN -#define HCI_UART_CTS_PIN 31 -#endif - -// - -// HCI_TRANSPORT_ENABLED - hci_transport - HCI transport -//========================================================== -#ifndef HCI_TRANSPORT_ENABLED -#define HCI_TRANSPORT_ENABLED 0 -#endif -// HCI_MAX_PACKET_SIZE_IN_BITS - Maximum size of a single application packet in bits. -#ifndef HCI_MAX_PACKET_SIZE_IN_BITS -#define HCI_MAX_PACKET_SIZE_IN_BITS 8000 -#endif - -// - -// LED_SOFTBLINK_ENABLED - led_softblink - led_softblink module - - -#ifndef LED_SOFTBLINK_ENABLED -#define LED_SOFTBLINK_ENABLED 0 -#endif - -// LOW_POWER_PWM_ENABLED - low_power_pwm - low_power_pwm module - - -#ifndef LOW_POWER_PWM_ENABLED -#define LOW_POWER_PWM_ENABLED 0 -#endif - -// MEM_MANAGER_ENABLED - mem_manager - Dynamic memory allocator -//========================================================== -#ifndef MEM_MANAGER_ENABLED -#define MEM_MANAGER_ENABLED 0 -#endif -// MEMORY_MANAGER_SMALL_BLOCK_COUNT - Size of each memory blocks identified as 'small' block. <0-255> - - -#ifndef MEMORY_MANAGER_SMALL_BLOCK_COUNT -#define MEMORY_MANAGER_SMALL_BLOCK_COUNT 1 -#endif - -// MEMORY_MANAGER_SMALL_BLOCK_SIZE - Size of each memory blocks identified as 'small' block. -// Size of each memory blocks identified as 'small' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_SMALL_BLOCK_SIZE -#define MEMORY_MANAGER_SMALL_BLOCK_SIZE 32 -#endif - -// MEMORY_MANAGER_MEDIUM_BLOCK_COUNT - Size of each memory blocks identified as 'medium' block. <0-255> - - -#ifndef MEMORY_MANAGER_MEDIUM_BLOCK_COUNT -#define MEMORY_MANAGER_MEDIUM_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_MEDIUM_BLOCK_SIZE - Size of each memory blocks identified as 'medium' block. -// Size of each memory blocks identified as 'medium' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_MEDIUM_BLOCK_SIZE -#define MEMORY_MANAGER_MEDIUM_BLOCK_SIZE 256 -#endif - -// MEMORY_MANAGER_LARGE_BLOCK_COUNT - Size of each memory blocks identified as 'large' block. <0-255> - - -#ifndef MEMORY_MANAGER_LARGE_BLOCK_COUNT -#define MEMORY_MANAGER_LARGE_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_LARGE_BLOCK_SIZE - Size of each memory blocks identified as 'large' block. -// Size of each memory blocks identified as 'large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_LARGE_BLOCK_SIZE -#define MEMORY_MANAGER_LARGE_BLOCK_SIZE 256 -#endif - -// MEMORY_MANAGER_XLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra large' block. <0-255> - - -#ifndef MEMORY_MANAGER_XLARGE_BLOCK_COUNT -#define MEMORY_MANAGER_XLARGE_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra large' block. -// Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XLARGE_BLOCK_SIZE -#define MEMORY_MANAGER_XLARGE_BLOCK_SIZE 1320 -#endif - -// MEMORY_MANAGER_XXLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra large' block. <0-255> - - -#ifndef MEMORY_MANAGER_XXLARGE_BLOCK_COUNT -#define MEMORY_MANAGER_XXLARGE_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XXLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra large' block. -// Size of each memory blocks identified as 'extra extra large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XXLARGE_BLOCK_SIZE -#define MEMORY_MANAGER_XXLARGE_BLOCK_SIZE 3444 -#endif - -// MEMORY_MANAGER_XSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra small' block. <0-255> - - -#ifndef MEMORY_MANAGER_XSMALL_BLOCK_COUNT -#define MEMORY_MANAGER_XSMALL_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra small' block. -// Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XSMALL_BLOCK_SIZE -#define MEMORY_MANAGER_XSMALL_BLOCK_SIZE 64 -#endif - -// MEMORY_MANAGER_XXSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra small' block. <0-255> - - -#ifndef MEMORY_MANAGER_XXSMALL_BLOCK_COUNT -#define MEMORY_MANAGER_XXSMALL_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XXSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra small' block. -// Size of each memory blocks identified as 'extra extra small' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XXSMALL_BLOCK_SIZE -#define MEMORY_MANAGER_XXSMALL_BLOCK_SIZE 32 -#endif - -// MEM_MANAGER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef MEM_MANAGER_CONFIG_LOG_ENABLED -#define MEM_MANAGER_CONFIG_LOG_ENABLED 0 -#endif -// MEM_MANAGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef MEM_MANAGER_CONFIG_LOG_LEVEL -#define MEM_MANAGER_CONFIG_LOG_LEVEL 3 -#endif - -// MEM_MANAGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MEM_MANAGER_CONFIG_INFO_COLOR -#define MEM_MANAGER_CONFIG_INFO_COLOR 0 -#endif - -// MEM_MANAGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MEM_MANAGER_CONFIG_DEBUG_COLOR -#define MEM_MANAGER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// MEM_MANAGER_DISABLE_API_PARAM_CHECK - Disable API parameter checks in the module. - - -#ifndef MEM_MANAGER_DISABLE_API_PARAM_CHECK -#define MEM_MANAGER_DISABLE_API_PARAM_CHECK 0 -#endif - -// - -// NRF_BALLOC_ENABLED - nrf_balloc - Block allocator module -//========================================================== -#ifndef NRF_BALLOC_ENABLED -#define NRF_BALLOC_ENABLED 1 -#endif -// NRF_BALLOC_CONFIG_DEBUG_ENABLED - Enables debug mode in the module. -//========================================================== -#ifndef NRF_BALLOC_CONFIG_DEBUG_ENABLED -#define NRF_BALLOC_CONFIG_DEBUG_ENABLED 0 -#endif -// NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS - Number of words used as head guard. <0-255> - - -#ifndef NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS -#define NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS 1 -#endif - -// NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS - Number of words used as tail guard. <0-255> - - -#ifndef NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS -#define NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS 1 -#endif - -// NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED - Enables basic checks in this module. - - -#ifndef NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED -#define NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED 0 -#endif - -// NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED - Enables double memory free check in this module. - - -#ifndef NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED -#define NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED 0 -#endif - -// NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED - Enables free memory corruption check in this module. - - -#ifndef NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED -#define NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED 0 -#endif - -// NRF_BALLOC_CLI_CMDS - Enable CLI commands specific to the module - - -#ifndef NRF_BALLOC_CLI_CMDS -#define NRF_BALLOC_CLI_CMDS 0 -#endif - -// - -// - -// NRF_CSENSE_ENABLED - nrf_csense - Capacitive sensor module -//========================================================== -#ifndef NRF_CSENSE_ENABLED -#define NRF_CSENSE_ENABLED 0 -#endif -// NRF_CSENSE_PAD_HYSTERESIS - Minimum value of change required to determine that a pad was touched. -#ifndef NRF_CSENSE_PAD_HYSTERESIS -#define NRF_CSENSE_PAD_HYSTERESIS 15 -#endif - -// NRF_CSENSE_PAD_DEVIATION - Minimum value measured on a pad required to take it into account while calculating the step. -#ifndef NRF_CSENSE_PAD_DEVIATION -#define NRF_CSENSE_PAD_DEVIATION 70 -#endif - -// NRF_CSENSE_MIN_PAD_VALUE - Minimum normalized value on a pad required to take its value into account. -#ifndef NRF_CSENSE_MIN_PAD_VALUE -#define NRF_CSENSE_MIN_PAD_VALUE 20 -#endif - -// NRF_CSENSE_MAX_PADS_NUMBER - Maximum number of pads used for one instance. -#ifndef NRF_CSENSE_MAX_PADS_NUMBER -#define NRF_CSENSE_MAX_PADS_NUMBER 20 -#endif - -// NRF_CSENSE_MAX_VALUE - Maximum normalized value obtained from measurement. -#ifndef NRF_CSENSE_MAX_VALUE -#define NRF_CSENSE_MAX_VALUE 1000 -#endif - -// NRF_CSENSE_OUTPUT_PIN - Output pin used by the low-level module. -// This is used when capacitive sensor does not use COMP. - -#ifndef NRF_CSENSE_OUTPUT_PIN -#define NRF_CSENSE_OUTPUT_PIN 26 -#endif - -// - -// NRF_DRV_CSENSE_ENABLED - nrf_drv_csense - Capacitive sensor low-level module -//========================================================== -#ifndef NRF_DRV_CSENSE_ENABLED -#define NRF_DRV_CSENSE_ENABLED 0 -#endif -// USE_COMP - Use the comparator to implement the capacitive sensor driver. - -// Due to Anomaly 84, COMP I_SOURCE is not functional. It has too high a varation. -//========================================================== -#ifndef USE_COMP -#define USE_COMP 0 -#endif -// TIMER0_FOR_CSENSE - First TIMER instance used by the driver (not used on nRF51). -#ifndef TIMER0_FOR_CSENSE -#define TIMER0_FOR_CSENSE 1 -#endif - -// TIMER1_FOR_CSENSE - Second TIMER instance used by the driver (not used on nRF51). -#ifndef TIMER1_FOR_CSENSE -#define TIMER1_FOR_CSENSE 2 -#endif - -// MEASUREMENT_PERIOD - Single measurement period. -// Time of a single measurement can be calculated as -// T = (1/2)*MEASUREMENT_PERIOD*(1/f_OSC) where f_OSC = I_SOURCE / (2C*(VUP-VDOWN) ). -// I_SOURCE, VUP, and VDOWN are values used to initialize COMP and C is the capacitance of the used pad. - -#ifndef MEASUREMENT_PERIOD -#define MEASUREMENT_PERIOD 20 -#endif - -// - -// - -// NRF_FSTORAGE_ENABLED - nrf_fstorage - Flash abstraction library -//========================================================== -#ifndef NRF_FSTORAGE_ENABLED -#define NRF_FSTORAGE_ENABLED 0 -#endif -// nrf_fstorage - Common settings - -// Common settings to all fstorage implementations -//========================================================== -// NRF_FSTORAGE_PARAM_CHECK_DISABLED - Disable user input validation - - -// If selected, use ASSERT to validate user input. -// This effectively removes user input validation in production code. -// Recommended setting: OFF, only enable this setting if size is a major concern. - -#ifndef NRF_FSTORAGE_PARAM_CHECK_DISABLED -#define NRF_FSTORAGE_PARAM_CHECK_DISABLED 0 -#endif - -// -//========================================================== - -// nrf_fstorage_sd - Implementation using the SoftDevice - -// Configuration options for the fstorage implementation using the SoftDevice -//========================================================== -// NRF_FSTORAGE_SD_QUEUE_SIZE - Size of the internal queue of operations -// Increase this value if API calls frequently return the error @ref NRF_ERROR_NO_MEM. - -#ifndef NRF_FSTORAGE_SD_QUEUE_SIZE -#define NRF_FSTORAGE_SD_QUEUE_SIZE 4 -#endif - -// NRF_FSTORAGE_SD_MAX_RETRIES - Maximum number of attempts at executing an operation when the SoftDevice is busy -// Increase this value if events frequently return the @ref NRF_ERROR_TIMEOUT error. -// The SoftDevice might fail to schedule flash access due to high BLE activity. - -#ifndef NRF_FSTORAGE_SD_MAX_RETRIES -#define NRF_FSTORAGE_SD_MAX_RETRIES 8 -#endif - -// NRF_FSTORAGE_SD_MAX_WRITE_SIZE - Maximum number of bytes to be written to flash in a single operation -// This value must be a multiple of four. -// Lowering this value can increase the chances of the SoftDevice being able to execute flash operations in between radio activity. -// This value is bound by the maximum number of bytes that can be written to flash in a single call to @ref sd_flash_write. -// That is 1024 bytes for nRF51 ICs and 4096 bytes for nRF52 ICs. - -#ifndef NRF_FSTORAGE_SD_MAX_WRITE_SIZE -#define NRF_FSTORAGE_SD_MAX_WRITE_SIZE 4096 -#endif - -// -//========================================================== - -// - -// NRF_GFX_ENABLED - nrf_gfx - GFX module - - -#ifndef NRF_GFX_ENABLED -#define NRF_GFX_ENABLED 0 -#endif - -// NRF_MEMOBJ_ENABLED - nrf_memobj - Linked memory allocator module - - -#ifndef NRF_MEMOBJ_ENABLED -#define NRF_MEMOBJ_ENABLED 1 -#endif - -// NRF_PWR_MGMT_ENABLED - nrf_pwr_mgmt - Power management module -//========================================================== -#ifndef NRF_PWR_MGMT_ENABLED -#define NRF_PWR_MGMT_ENABLED 0 -#endif -// NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED - Enables pin debug in the module. - -// Selected pin will be set when CPU is in sleep mode. -//========================================================== -#ifndef NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED -#define NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED 0 -#endif -// NRF_PWR_MGMT_SLEEP_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected - -#ifndef NRF_PWR_MGMT_SLEEP_DEBUG_PIN -#define NRF_PWR_MGMT_SLEEP_DEBUG_PIN 31 -#endif - -// - -// NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED - Enables CPU usage monitor. - - -// Module will trace percentage of CPU usage in one second intervals. - -#ifndef NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED -#define NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED 0 -#endif - -// NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED - Enable standby timeout. -//========================================================== -#ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED -#define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED 0 -#endif -// NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S - Standby timeout (in seconds). -// Shutdown procedure will begin no earlier than after this number of seconds. - -#ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S -#define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S 3 -#endif - -// - -// NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED - Enables FPU event cleaning. - - -#ifndef NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED -#define NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED 0 -#endif - -// NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY - Blocked shutdown procedure will be retried every second. - - -#ifndef NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY -#define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 0 -#endif - -// NRF_PWR_MGMT_CONFIG_USE_SCHEDULER - Module will use @ref app_scheduler. - - -#ifndef NRF_PWR_MGMT_CONFIG_USE_SCHEDULER -#define NRF_PWR_MGMT_CONFIG_USE_SCHEDULER 0 -#endif - -// NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT - The number of priorities for module handlers. -// The number of stages of the shutdown process. - -#ifndef NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT -#define NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT 3 -#endif - -// - -// NRF_QUEUE_ENABLED - nrf_queue - Queue module -//========================================================== -#ifndef NRF_QUEUE_ENABLED -#define NRF_QUEUE_ENABLED 0 -#endif -// NRF_QUEUE_CLI_CMDS - Enable CLI commands specific to the module - - -#ifndef NRF_QUEUE_CLI_CMDS -#define NRF_QUEUE_CLI_CMDS 0 -#endif - -// - -// NRF_SECTION_ITER_ENABLED - nrf_section_iter - Section iterator - - -#ifndef NRF_SECTION_ITER_ENABLED -#define NRF_SECTION_ITER_ENABLED 1 -#endif - -// NRF_SORTLIST_ENABLED - nrf_sortlist - Sorted list - - -#ifndef NRF_SORTLIST_ENABLED -#define NRF_SORTLIST_ENABLED 1 -#endif - -// NRF_SPI_MNGR_ENABLED - nrf_spi_mngr - SPI transaction manager - - -#ifndef NRF_SPI_MNGR_ENABLED -#define NRF_SPI_MNGR_ENABLED 0 -#endif - -// NRF_STRERROR_ENABLED - nrf_strerror - Library for converting error code to string. - - -#ifndef NRF_STRERROR_ENABLED -#define NRF_STRERROR_ENABLED 1 -#endif - -// NRF_TWI_MNGR_ENABLED - nrf_twi_mngr - TWI transaction manager - - -#ifndef NRF_TWI_MNGR_ENABLED -#define NRF_TWI_MNGR_ENABLED 0 -#endif - -// SLIP_ENABLED - slip - SLIP encoding and decoding - - -#ifndef SLIP_ENABLED -#define SLIP_ENABLED 0 -#endif - -// TASK_MANAGER_ENABLED - task_manager - Task manager. -//========================================================== -#ifndef TASK_MANAGER_ENABLED -#define TASK_MANAGER_ENABLED 0 -#endif -// TASK_MANAGER_CLI_CMDS - Enable CLI commands specific to the module - - -#ifndef TASK_MANAGER_CLI_CMDS -#define TASK_MANAGER_CLI_CMDS 0 -#endif - -// TASK_MANAGER_CONFIG_MAX_TASKS - Maximum number of tasks which can be created -#ifndef TASK_MANAGER_CONFIG_MAX_TASKS -#define TASK_MANAGER_CONFIG_MAX_TASKS 2 -#endif - -// TASK_MANAGER_CONFIG_STACK_SIZE - Stack size for every task (power of 2) -#ifndef TASK_MANAGER_CONFIG_STACK_SIZE -#define TASK_MANAGER_CONFIG_STACK_SIZE 1024 -#endif - -// TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED - Enable stack profiling. - - -#ifndef TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED -#define TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED 1 -#endif - -// TASK_MANAGER_CONFIG_STACK_GUARD - Configures stack guard. - -// <0=> Disabled -// <4=> 32 bytes -// <5=> 64 bytes -// <6=> 128 bytes -// <7=> 256 bytes -// <8=> 512 bytes - -#ifndef TASK_MANAGER_CONFIG_STACK_GUARD -#define TASK_MANAGER_CONFIG_STACK_GUARD 7 -#endif - -// - -// app_button - buttons handling module - -//========================================================== -// BUTTON_ENABLED - Enables Button module - - -#ifndef BUTTON_ENABLED -#define BUTTON_ENABLED 0 -#endif - -// BUTTON_HIGH_ACCURACY_ENABLED - Enables GPIOTE high accuracy for buttons - - -#ifndef BUTTON_HIGH_ACCURACY_ENABLED -#define BUTTON_HIGH_ACCURACY_ENABLED 0 -#endif - -// -//========================================================== - -// app_usbd_cdc_acm - USB CDC ACM class - -//========================================================== -// APP_USBD_CDC_ACM_ENABLED - Enabling USBD CDC ACM Class library - - -#ifndef APP_USBD_CDC_ACM_ENABLED -#define APP_USBD_CDC_ACM_ENABLED 0 -#endif - -// APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE - Send ZLP on write with same size as endpoint - - -// If enabled, CDC ACM class will automatically send a zero length packet after transfer which has the same size as endpoint. -// This may limit throughput if a lot of binary data is sent, but in terminal mode operation it makes sure that the data is always displayed right after it is sent. - -#ifndef APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE -#define APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE 1 -#endif - -// -//========================================================== - -// nrf_cli - Command line interface - -//========================================================== -// NRF_CLI_ENABLED - Enable/disable the CLI module. - - -#ifndef NRF_CLI_ENABLED -#define NRF_CLI_ENABLED 0 -#endif - -// NRF_CLI_ARGC_MAX - Maximum number of parameters passed to the command handler. -#ifndef NRF_CLI_ARGC_MAX -#define NRF_CLI_ARGC_MAX 12 -#endif - -// NRF_CLI_BUILD_IN_CMDS_ENABLED - CLI built-in commands. - - -#ifndef NRF_CLI_BUILD_IN_CMDS_ENABLED -#define NRF_CLI_BUILD_IN_CMDS_ENABLED 1 -#endif - -// NRF_CLI_CMD_BUFF_SIZE - Maximum buffer size for a single command. -#ifndef NRF_CLI_CMD_BUFF_SIZE -#define NRF_CLI_CMD_BUFF_SIZE 128 -#endif - -// NRF_CLI_ECHO_STATUS - CLI echo status. If set, echo is ON. - - -#ifndef NRF_CLI_ECHO_STATUS -#define NRF_CLI_ECHO_STATUS 1 -#endif - -// NRF_CLI_WILDCARD_ENABLED - Enable wildcard functionality for CLI commands. - - -#ifndef NRF_CLI_WILDCARD_ENABLED -#define NRF_CLI_WILDCARD_ENABLED 0 -#endif - -// NRF_CLI_METAKEYS_ENABLED - Enable additional control keys for CLI commands like ctrl+a, ctrl+e, ctrl+w, ctrl+u - - -#ifndef NRF_CLI_METAKEYS_ENABLED -#define NRF_CLI_METAKEYS_ENABLED 0 -#endif - -// NRF_CLI_PRINTF_BUFF_SIZE - Maximum print buffer size. -#ifndef NRF_CLI_PRINTF_BUFF_SIZE -#define NRF_CLI_PRINTF_BUFF_SIZE 23 -#endif - -// NRF_CLI_HISTORY_ENABLED - Enable CLI history mode. -//========================================================== -#ifndef NRF_CLI_HISTORY_ENABLED -#define NRF_CLI_HISTORY_ENABLED 1 -#endif -// NRF_CLI_HISTORY_ELEMENT_SIZE - Size of one memory object reserved for CLI history. -#ifndef NRF_CLI_HISTORY_ELEMENT_SIZE -#define NRF_CLI_HISTORY_ELEMENT_SIZE 32 -#endif - -// NRF_CLI_HISTORY_ELEMENT_COUNT - Number of history memory objects. -#ifndef NRF_CLI_HISTORY_ELEMENT_COUNT -#define NRF_CLI_HISTORY_ELEMENT_COUNT 8 -#endif - -// - -// NRF_CLI_VT100_COLORS_ENABLED - CLI VT100 colors. - - -#ifndef NRF_CLI_VT100_COLORS_ENABLED -#define NRF_CLI_VT100_COLORS_ENABLED 1 -#endif - -// NRF_CLI_STATISTICS_ENABLED - Enable CLI statistics. - - -#ifndef NRF_CLI_STATISTICS_ENABLED -#define NRF_CLI_STATISTICS_ENABLED 1 -#endif - -// NRF_CLI_LOG_BACKEND - Enable logger backend interface. - - -#ifndef NRF_CLI_LOG_BACKEND -#define NRF_CLI_LOG_BACKEND 1 -#endif - -// NRF_CLI_USES_TASK_MANAGER_ENABLED - Enable CLI to use task_manager - - -#ifndef NRF_CLI_USES_TASK_MANAGER_ENABLED -#define NRF_CLI_USES_TASK_MANAGER_ENABLED 0 -#endif - -// -//========================================================== - -// nrf_fprintf - fprintf function. - -//========================================================== -// NRF_FPRINTF_ENABLED - Enable/disable fprintf module. - - -#ifndef NRF_FPRINTF_ENABLED -#define NRF_FPRINTF_ENABLED 1 -#endif - -// NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED - For each printed LF, function will add CR. - - -#ifndef NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED -#define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 1 -#endif - -// NRF_FPRINTF_DOUBLE_ENABLED - Enable IEEE-754 double precision formatting. - - -#ifndef NRF_FPRINTF_DOUBLE_ENABLED -#define NRF_FPRINTF_DOUBLE_ENABLED 0 -#endif - -// -//========================================================== - -// -//========================================================== - -// nRF_Log - -//========================================================== -// NRF_LOG_ENABLED - nrf_log - Logger -//========================================================== -#ifndef NRF_LOG_ENABLED -#define NRF_LOG_ENABLED 0 -#endif -// Log message pool - Configuration of log message pool - -//========================================================== -// NRF_LOG_MSGPOOL_ELEMENT_SIZE - Size of a single element in the pool of memory objects. -// If a small value is set, then performance of logs processing -// is degraded because data is fragmented. Bigger value impacts -// RAM memory utilization. The size is set to fit a message with -// a timestamp and up to 2 arguments in a single memory object. - -#ifndef NRF_LOG_MSGPOOL_ELEMENT_SIZE -#define NRF_LOG_MSGPOOL_ELEMENT_SIZE 20 -#endif - -// NRF_LOG_MSGPOOL_ELEMENT_COUNT - Number of elements in the pool of memory objects -// If a small value is set, then it may lead to a deadlock -// in certain cases if backend has high latency and holds -// multiple messages for long time. Bigger value impacts -// RAM memory usage. - -#ifndef NRF_LOG_MSGPOOL_ELEMENT_COUNT -#define NRF_LOG_MSGPOOL_ELEMENT_COUNT 8 -#endif - -// -//========================================================== - -// NRF_LOG_ALLOW_OVERFLOW - Configures behavior when circular buffer is full. - - -// If set then oldest logs are overwritten. Otherwise a -// marker is injected informing about overflow. - -#ifndef NRF_LOG_ALLOW_OVERFLOW -#define NRF_LOG_ALLOW_OVERFLOW 1 -#endif - -// NRF_LOG_BUFSIZE - Size of the buffer for storing logs (in bytes). - - -// Must be power of 2 and multiple of 4. -// If NRF_LOG_DEFERRED = 0 then buffer size can be reduced to minimum. -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 -// <2048=> 2048 -// <4096=> 4096 -// <8192=> 8192 -// <16384=> 16384 - -#ifndef NRF_LOG_BUFSIZE -#define NRF_LOG_BUFSIZE 1024 -#endif - -// NRF_LOG_CLI_CMDS - Enable CLI commands for the module. - - -#ifndef NRF_LOG_CLI_CMDS -#define NRF_LOG_CLI_CMDS 0 -#endif - -// NRF_LOG_DEFAULT_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_LOG_DEFAULT_LEVEL -#define NRF_LOG_DEFAULT_LEVEL 3 -#endif - -// NRF_LOG_DEFERRED - Enable deffered logger. - - -// Log data is buffered and can be processed in idle. - -#ifndef NRF_LOG_DEFERRED -#define NRF_LOG_DEFERRED 1 -#endif - -// NRF_LOG_FILTERS_ENABLED - Enable dynamic filtering of logs. - - -#ifndef NRF_LOG_FILTERS_ENABLED -#define NRF_LOG_FILTERS_ENABLED 0 -#endif - -// NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED - Enable use of critical region for non deffered mode when flushing logs. - - -// When enabled NRF_LOG_FLUSH is called from critical section when non deffered mode is used. -// Log output will never be corrupted as access to the log backend is exclusive -// but system will spend significant amount of time in critical section - -#ifndef NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED -#define NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED 0 -#endif - -// NRF_LOG_STR_PUSH_BUFFER_SIZE - Size of the buffer dedicated for strings stored using @ref NRF_LOG_PUSH. - -// <16=> 16 -// <32=> 32 -// <64=> 64 -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 - -#ifndef NRF_LOG_STR_PUSH_BUFFER_SIZE -#define NRF_LOG_STR_PUSH_BUFFER_SIZE 128 -#endif - -// NRF_LOG_STR_PUSH_BUFFER_SIZE - Size of the buffer dedicated for strings stored using @ref NRF_LOG_PUSH. - -// <16=> 16 -// <32=> 32 -// <64=> 64 -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 - -#ifndef NRF_LOG_STR_PUSH_BUFFER_SIZE -#define NRF_LOG_STR_PUSH_BUFFER_SIZE 128 -#endif - -// NRF_LOG_USES_COLORS - If enabled then ANSI escape code for colors is prefixed to every string -//========================================================== -#ifndef NRF_LOG_USES_COLORS -#define NRF_LOG_USES_COLORS 0 -#endif -// NRF_LOG_COLOR_DEFAULT - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LOG_COLOR_DEFAULT -#define NRF_LOG_COLOR_DEFAULT 0 -#endif - -// NRF_LOG_ERROR_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LOG_ERROR_COLOR -#define NRF_LOG_ERROR_COLOR 2 -#endif - -// NRF_LOG_WARNING_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LOG_WARNING_COLOR -#define NRF_LOG_WARNING_COLOR 4 -#endif - -// - -// NRF_LOG_USES_TIMESTAMP - Enable timestamping - -// Function for getting the timestamp is provided by the user -//========================================================== -#ifndef NRF_LOG_USES_TIMESTAMP -#define NRF_LOG_USES_TIMESTAMP 0 -#endif -// NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY - Default frequency of the timestamp (in Hz) or 0 to use app_timer frequency. -#ifndef NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY -#define NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY 0 -#endif - -// - -// nrf_log module configuration - -//========================================================== -// nrf_log in nRF_Core - -//========================================================== -// NRF_MPU_LIB_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_MPU_LIB_CONFIG_LOG_ENABLED -#define NRF_MPU_LIB_CONFIG_LOG_ENABLED 0 -#endif -// NRF_MPU_LIB_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_MPU_LIB_CONFIG_LOG_LEVEL -#define NRF_MPU_LIB_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_MPU_LIB_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MPU_LIB_CONFIG_INFO_COLOR -#define NRF_MPU_LIB_CONFIG_INFO_COLOR 0 -#endif - -// NRF_MPU_LIB_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MPU_LIB_CONFIG_DEBUG_COLOR -#define NRF_MPU_LIB_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_STACK_GUARD_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_STACK_GUARD_CONFIG_LOG_ENABLED -#define NRF_STACK_GUARD_CONFIG_LOG_ENABLED 0 -#endif -// NRF_STACK_GUARD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_STACK_GUARD_CONFIG_LOG_LEVEL -#define NRF_STACK_GUARD_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_STACK_GUARD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_STACK_GUARD_CONFIG_INFO_COLOR -#define NRF_STACK_GUARD_CONFIG_INFO_COLOR 0 -#endif - -// NRF_STACK_GUARD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_STACK_GUARD_CONFIG_DEBUG_COLOR -#define NRF_STACK_GUARD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TASK_MANAGER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TASK_MANAGER_CONFIG_LOG_ENABLED -#define TASK_MANAGER_CONFIG_LOG_ENABLED 0 -#endif -// TASK_MANAGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TASK_MANAGER_CONFIG_LOG_LEVEL -#define TASK_MANAGER_CONFIG_LOG_LEVEL 3 -#endif - -// TASK_MANAGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TASK_MANAGER_CONFIG_INFO_COLOR -#define TASK_MANAGER_CONFIG_INFO_COLOR 0 -#endif - -// TASK_MANAGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TASK_MANAGER_CONFIG_DEBUG_COLOR -#define TASK_MANAGER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// nrf_log in nRF_Drivers - -//========================================================== -// CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef CLOCK_CONFIG_LOG_ENABLED -#define CLOCK_CONFIG_LOG_ENABLED 0 -#endif -// CLOCK_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef CLOCK_CONFIG_LOG_LEVEL -#define CLOCK_CONFIG_LOG_LEVEL 3 -#endif - -// CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef CLOCK_CONFIG_INFO_COLOR -#define CLOCK_CONFIG_INFO_COLOR 0 -#endif - -// CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef CLOCK_CONFIG_DEBUG_COLOR -#define CLOCK_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// COMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef COMP_CONFIG_LOG_ENABLED -#define COMP_CONFIG_LOG_ENABLED 0 -#endif -// COMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef COMP_CONFIG_LOG_LEVEL -#define COMP_CONFIG_LOG_LEVEL 3 -#endif - -// COMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef COMP_CONFIG_INFO_COLOR -#define COMP_CONFIG_INFO_COLOR 0 -#endif - -// COMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef COMP_CONFIG_DEBUG_COLOR -#define COMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// GPIOTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef GPIOTE_CONFIG_LOG_ENABLED -#define GPIOTE_CONFIG_LOG_ENABLED 0 -#endif -// GPIOTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef GPIOTE_CONFIG_LOG_LEVEL -#define GPIOTE_CONFIG_LOG_LEVEL 3 -#endif - -// GPIOTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef GPIOTE_CONFIG_INFO_COLOR -#define GPIOTE_CONFIG_INFO_COLOR 0 -#endif - -// GPIOTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef GPIOTE_CONFIG_DEBUG_COLOR -#define GPIOTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// LPCOMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef LPCOMP_CONFIG_LOG_ENABLED -#define LPCOMP_CONFIG_LOG_ENABLED 0 -#endif -// LPCOMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef LPCOMP_CONFIG_LOG_LEVEL -#define LPCOMP_CONFIG_LOG_LEVEL 3 -#endif - -// LPCOMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef LPCOMP_CONFIG_INFO_COLOR -#define LPCOMP_CONFIG_INFO_COLOR 0 -#endif - -// LPCOMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef LPCOMP_CONFIG_DEBUG_COLOR -#define LPCOMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// MAX3421E_HOST_CONFIG_LOG_ENABLED - Enable logging in the module -//========================================================== -#ifndef MAX3421E_HOST_CONFIG_LOG_ENABLED -#define MAX3421E_HOST_CONFIG_LOG_ENABLED 0 -#endif -// MAX3421E_HOST_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef MAX3421E_HOST_CONFIG_LOG_LEVEL -#define MAX3421E_HOST_CONFIG_LOG_LEVEL 3 -#endif - -// MAX3421E_HOST_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MAX3421E_HOST_CONFIG_INFO_COLOR -#define MAX3421E_HOST_CONFIG_INFO_COLOR 0 -#endif - -// MAX3421E_HOST_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MAX3421E_HOST_CONFIG_DEBUG_COLOR -#define MAX3421E_HOST_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRFX_USBD_CONFIG_LOG_ENABLED - Enable logging in the module -//========================================================== -#ifndef NRFX_USBD_CONFIG_LOG_ENABLED -#define NRFX_USBD_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_USBD_CONFIG_LOG_LEVEL -#define NRFX_USBD_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_USBD_CONFIG_INFO_COLOR -#define NRFX_USBD_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_USBD_CONFIG_DEBUG_COLOR -#define NRFX_USBD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PDM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef PDM_CONFIG_LOG_ENABLED -#define PDM_CONFIG_LOG_ENABLED 0 -#endif -// PDM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PDM_CONFIG_LOG_LEVEL -#define PDM_CONFIG_LOG_LEVEL 3 -#endif - -// PDM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PDM_CONFIG_INFO_COLOR -#define PDM_CONFIG_INFO_COLOR 0 -#endif - -// PDM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PDM_CONFIG_DEBUG_COLOR -#define PDM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef PPI_CONFIG_LOG_ENABLED -#define PPI_CONFIG_LOG_ENABLED 0 -#endif -// PPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PPI_CONFIG_LOG_LEVEL -#define PPI_CONFIG_LOG_LEVEL 3 -#endif - -// PPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PPI_CONFIG_INFO_COLOR -#define PPI_CONFIG_INFO_COLOR 0 -#endif - -// PPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PPI_CONFIG_DEBUG_COLOR -#define PPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PWM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef PWM_CONFIG_LOG_ENABLED -#define PWM_CONFIG_LOG_ENABLED 0 -#endif -// PWM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PWM_CONFIG_LOG_LEVEL -#define PWM_CONFIG_LOG_LEVEL 3 -#endif - -// PWM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PWM_CONFIG_INFO_COLOR -#define PWM_CONFIG_INFO_COLOR 0 -#endif - -// PWM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PWM_CONFIG_DEBUG_COLOR -#define PWM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// QDEC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef QDEC_CONFIG_LOG_ENABLED -#define QDEC_CONFIG_LOG_ENABLED 0 -#endif -// QDEC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef QDEC_CONFIG_LOG_LEVEL -#define QDEC_CONFIG_LOG_LEVEL 3 -#endif - -// QDEC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef QDEC_CONFIG_INFO_COLOR -#define QDEC_CONFIG_INFO_COLOR 0 -#endif - -// QDEC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef QDEC_CONFIG_DEBUG_COLOR -#define QDEC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// RNG_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef RNG_CONFIG_LOG_ENABLED -#define RNG_CONFIG_LOG_ENABLED 0 -#endif -// RNG_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef RNG_CONFIG_LOG_LEVEL -#define RNG_CONFIG_LOG_LEVEL 3 -#endif - -// RNG_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RNG_CONFIG_INFO_COLOR -#define RNG_CONFIG_INFO_COLOR 0 -#endif - -// RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RNG_CONFIG_DEBUG_COLOR -#define RNG_CONFIG_DEBUG_COLOR 0 -#endif - -// RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED - Enables logging of random numbers. - - -#ifndef RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED -#define RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED 0 -#endif - -// - -// RTC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef RTC_CONFIG_LOG_ENABLED -#define RTC_CONFIG_LOG_ENABLED 0 -#endif -// RTC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef RTC_CONFIG_LOG_LEVEL -#define RTC_CONFIG_LOG_LEVEL 3 -#endif - -// RTC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RTC_CONFIG_INFO_COLOR -#define RTC_CONFIG_INFO_COLOR 0 -#endif - -// RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RTC_CONFIG_DEBUG_COLOR -#define RTC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// SAADC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SAADC_CONFIG_LOG_ENABLED -#define SAADC_CONFIG_LOG_ENABLED 0 -#endif -// SAADC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SAADC_CONFIG_LOG_LEVEL -#define SAADC_CONFIG_LOG_LEVEL 3 -#endif - -// SAADC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SAADC_CONFIG_INFO_COLOR -#define SAADC_CONFIG_INFO_COLOR 0 -#endif - -// SAADC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SAADC_CONFIG_DEBUG_COLOR -#define SAADC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// SPIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SPIS_CONFIG_LOG_ENABLED -#define SPIS_CONFIG_LOG_ENABLED 0 -#endif -// SPIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SPIS_CONFIG_LOG_LEVEL -#define SPIS_CONFIG_LOG_LEVEL 3 -#endif - -// SPIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPIS_CONFIG_INFO_COLOR -#define SPIS_CONFIG_INFO_COLOR 0 -#endif - -// SPIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPIS_CONFIG_DEBUG_COLOR -#define SPIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// SPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SPI_CONFIG_LOG_ENABLED -#define SPI_CONFIG_LOG_ENABLED 0 -#endif -// SPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SPI_CONFIG_LOG_LEVEL -#define SPI_CONFIG_LOG_LEVEL 3 -#endif - -// SPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPI_CONFIG_INFO_COLOR -#define SPI_CONFIG_INFO_COLOR 0 -#endif - -// SPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPI_CONFIG_DEBUG_COLOR -#define SPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TIMER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TIMER_CONFIG_LOG_ENABLED -#define TIMER_CONFIG_LOG_ENABLED 0 -#endif -// TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TIMER_CONFIG_LOG_LEVEL -#define TIMER_CONFIG_LOG_LEVEL 3 -#endif - -// TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TIMER_CONFIG_INFO_COLOR -#define TIMER_CONFIG_INFO_COLOR 0 -#endif - -// TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TIMER_CONFIG_DEBUG_COLOR -#define TIMER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TWIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TWIS_CONFIG_LOG_ENABLED -#define TWIS_CONFIG_LOG_ENABLED 0 -#endif -// TWIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TWIS_CONFIG_LOG_LEVEL -#define TWIS_CONFIG_LOG_LEVEL 3 -#endif - -// TWIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWIS_CONFIG_INFO_COLOR -#define TWIS_CONFIG_INFO_COLOR 0 -#endif - -// TWIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWIS_CONFIG_DEBUG_COLOR -#define TWIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TWI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TWI_CONFIG_LOG_ENABLED -#define TWI_CONFIG_LOG_ENABLED 0 -#endif -// TWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TWI_CONFIG_LOG_LEVEL -#define TWI_CONFIG_LOG_LEVEL 3 -#endif - -// TWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWI_CONFIG_INFO_COLOR -#define TWI_CONFIG_INFO_COLOR 0 -#endif - -// TWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWI_CONFIG_DEBUG_COLOR -#define TWI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef UART_CONFIG_LOG_ENABLED -#define UART_CONFIG_LOG_ENABLED 0 -#endif -// UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef UART_CONFIG_LOG_LEVEL -#define UART_CONFIG_LOG_LEVEL 3 -#endif - -// UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef UART_CONFIG_INFO_COLOR -#define UART_CONFIG_INFO_COLOR 0 -#endif - -// UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef UART_CONFIG_DEBUG_COLOR -#define UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// USBD_CONFIG_LOG_ENABLED - Enable logging in the module -//========================================================== -#ifndef USBD_CONFIG_LOG_ENABLED -#define USBD_CONFIG_LOG_ENABLED 0 -#endif -// USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef USBD_CONFIG_LOG_LEVEL -#define USBD_CONFIG_LOG_LEVEL 3 -#endif - -// USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef USBD_CONFIG_INFO_COLOR -#define USBD_CONFIG_INFO_COLOR 0 -#endif - -// USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef USBD_CONFIG_DEBUG_COLOR -#define USBD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// WDT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef WDT_CONFIG_LOG_ENABLED -#define WDT_CONFIG_LOG_ENABLED 0 -#endif -// WDT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef WDT_CONFIG_LOG_LEVEL -#define WDT_CONFIG_LOG_LEVEL 3 -#endif - -// WDT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef WDT_CONFIG_INFO_COLOR -#define WDT_CONFIG_INFO_COLOR 0 -#endif - -// WDT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef WDT_CONFIG_DEBUG_COLOR -#define WDT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// nrf_log in nRF_Libraries - -//========================================================== -// APP_BUTTON_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_BUTTON_CONFIG_LOG_ENABLED -#define APP_BUTTON_CONFIG_LOG_ENABLED 0 -#endif -// APP_BUTTON_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_BUTTON_CONFIG_LOG_LEVEL -#define APP_BUTTON_CONFIG_LOG_LEVEL 3 -#endif - -// APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled. - - -// If module generates a lot of logs, initial log level can -// be decreased to prevent flooding. Severity level can be -// increased on instance basis. -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL -#define APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL 3 -#endif - -// APP_BUTTON_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_BUTTON_CONFIG_INFO_COLOR -#define APP_BUTTON_CONFIG_INFO_COLOR 0 -#endif - -// APP_BUTTON_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_BUTTON_CONFIG_DEBUG_COLOR -#define APP_BUTTON_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_TIMER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_TIMER_CONFIG_LOG_ENABLED -#define APP_TIMER_CONFIG_LOG_ENABLED 0 -#endif -// APP_TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_TIMER_CONFIG_LOG_LEVEL -#define APP_TIMER_CONFIG_LOG_LEVEL 3 -#endif - -// APP_TIMER_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled. - - -// If module generates a lot of logs, initial log level can -// be decreased to prevent flooding. Severity level can be -// increased on instance basis. -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_TIMER_CONFIG_INITIAL_LOG_LEVEL -#define APP_TIMER_CONFIG_INITIAL_LOG_LEVEL 3 -#endif - -// APP_TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_TIMER_CONFIG_INFO_COLOR -#define APP_TIMER_CONFIG_INFO_COLOR 0 -#endif - -// APP_TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_TIMER_CONFIG_DEBUG_COLOR -#define APP_TIMER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED -#define APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL -#define APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_CDC_ACM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CDC_ACM_CONFIG_INFO_COLOR -#define APP_USBD_CDC_ACM_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR -#define APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_CONFIG_LOG_ENABLED - Enable logging in the module. -//========================================================== -#ifndef APP_USBD_CONFIG_LOG_ENABLED -#define APP_USBD_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_CONFIG_LOG_LEVEL -#define APP_USBD_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CONFIG_INFO_COLOR -#define APP_USBD_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CONFIG_DEBUG_COLOR -#define APP_USBD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_DUMMY_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_DUMMY_CONFIG_LOG_ENABLED -#define APP_USBD_DUMMY_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_DUMMY_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_DUMMY_CONFIG_LOG_LEVEL -#define APP_USBD_DUMMY_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_DUMMY_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_DUMMY_CONFIG_INFO_COLOR -#define APP_USBD_DUMMY_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_DUMMY_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_DUMMY_CONFIG_DEBUG_COLOR -#define APP_USBD_DUMMY_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_MSC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_MSC_CONFIG_LOG_ENABLED -#define APP_USBD_MSC_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_MSC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_MSC_CONFIG_LOG_LEVEL -#define APP_USBD_MSC_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_MSC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_MSC_CONFIG_INFO_COLOR -#define APP_USBD_MSC_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_MSC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_MSC_CONFIG_DEBUG_COLOR -#define APP_USBD_MSC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_ATFIFO_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_ATFIFO_CONFIG_LOG_ENABLED -#define NRF_ATFIFO_CONFIG_LOG_ENABLED 0 -#endif -// NRF_ATFIFO_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_ATFIFO_CONFIG_LOG_LEVEL -#define NRF_ATFIFO_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_ATFIFO_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_ATFIFO_CONFIG_INFO_COLOR -#define NRF_ATFIFO_CONFIG_INFO_COLOR 0 -#endif - -// NRF_ATFIFO_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_ATFIFO_CONFIG_DEBUG_COLOR -#define NRF_ATFIFO_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BALLOC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BALLOC_CONFIG_LOG_ENABLED -#define NRF_BALLOC_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BALLOC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BALLOC_CONFIG_LOG_LEVEL -#define NRF_BALLOC_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled. - - -// If module generates a lot of logs, initial log level can -// be decreased to prevent flooding. Severity level can be -// increased on instance basis. -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL -#define NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL 3 -#endif - -// NRF_BALLOC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BALLOC_CONFIG_INFO_COLOR -#define NRF_BALLOC_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BALLOC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BALLOC_CONFIG_DEBUG_COLOR -#define NRF_BALLOC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED -#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL -#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR -#define NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR -#define NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED -#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL -#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR -#define NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR -#define NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED -#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL -#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR -#define NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR -#define NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED -#define NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED 0 -#endif -// NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL -#define NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_CLI_BLE_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_BLE_UART_CONFIG_INFO_COLOR -#define NRF_CLI_BLE_UART_CONFIG_INFO_COLOR 0 -#endif - -// NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR -#define NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED -#define NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED 0 -#endif -// NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL -#define NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR -#define NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR 0 -#endif - -// NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR -#define NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_CLI_UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_CLI_UART_CONFIG_LOG_ENABLED -#define NRF_CLI_UART_CONFIG_LOG_ENABLED 0 -#endif -// NRF_CLI_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_CLI_UART_CONFIG_LOG_LEVEL -#define NRF_CLI_UART_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_CLI_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_UART_CONFIG_INFO_COLOR -#define NRF_CLI_UART_CONFIG_INFO_COLOR 0 -#endif - -// NRF_CLI_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_UART_CONFIG_DEBUG_COLOR -#define NRF_CLI_UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_LIBUARTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_LIBUARTE_CONFIG_LOG_ENABLED -#define NRF_LIBUARTE_CONFIG_LOG_ENABLED 0 -#endif -// NRF_LIBUARTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_LIBUARTE_CONFIG_LOG_LEVEL -#define NRF_LIBUARTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_LIBUARTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LIBUARTE_CONFIG_INFO_COLOR -#define NRF_LIBUARTE_CONFIG_INFO_COLOR 0 -#endif - -// NRF_LIBUARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LIBUARTE_CONFIG_DEBUG_COLOR -#define NRF_LIBUARTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_MEMOBJ_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_MEMOBJ_CONFIG_LOG_ENABLED -#define NRF_MEMOBJ_CONFIG_LOG_ENABLED 0 -#endif -// NRF_MEMOBJ_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_MEMOBJ_CONFIG_LOG_LEVEL -#define NRF_MEMOBJ_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_MEMOBJ_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MEMOBJ_CONFIG_INFO_COLOR -#define NRF_MEMOBJ_CONFIG_INFO_COLOR 0 -#endif - -// NRF_MEMOBJ_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MEMOBJ_CONFIG_DEBUG_COLOR -#define NRF_MEMOBJ_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_PWR_MGMT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_PWR_MGMT_CONFIG_LOG_ENABLED -#define NRF_PWR_MGMT_CONFIG_LOG_ENABLED 0 -#endif -// NRF_PWR_MGMT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_PWR_MGMT_CONFIG_LOG_LEVEL -#define NRF_PWR_MGMT_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_PWR_MGMT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_PWR_MGMT_CONFIG_INFO_COLOR -#define NRF_PWR_MGMT_CONFIG_INFO_COLOR 0 -#endif - -// NRF_PWR_MGMT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_PWR_MGMT_CONFIG_DEBUG_COLOR -#define NRF_PWR_MGMT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_QUEUE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_QUEUE_CONFIG_LOG_ENABLED -#define NRF_QUEUE_CONFIG_LOG_ENABLED 0 -#endif -// NRF_QUEUE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_QUEUE_CONFIG_LOG_LEVEL -#define NRF_QUEUE_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_QUEUE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_QUEUE_CONFIG_INFO_COLOR -#define NRF_QUEUE_CONFIG_INFO_COLOR 0 -#endif - -// NRF_QUEUE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_QUEUE_CONFIG_DEBUG_COLOR -#define NRF_QUEUE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_ANT_LOG_ENABLED - Enable logging in SoftDevice handler (ANT) module. -//========================================================== -#ifndef NRF_SDH_ANT_LOG_ENABLED -#define NRF_SDH_ANT_LOG_ENABLED 0 -#endif -// NRF_SDH_ANT_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_ANT_LOG_LEVEL -#define NRF_SDH_ANT_LOG_LEVEL 3 -#endif - -// NRF_SDH_ANT_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_ANT_INFO_COLOR -#define NRF_SDH_ANT_INFO_COLOR 0 -#endif - -// NRF_SDH_ANT_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_ANT_DEBUG_COLOR -#define NRF_SDH_ANT_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_BLE_LOG_ENABLED - Enable logging in SoftDevice handler (BLE) module. -//========================================================== -#ifndef NRF_SDH_BLE_LOG_ENABLED -#define NRF_SDH_BLE_LOG_ENABLED 1 -#endif -// NRF_SDH_BLE_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_BLE_LOG_LEVEL -#define NRF_SDH_BLE_LOG_LEVEL 3 -#endif - -// NRF_SDH_BLE_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_BLE_INFO_COLOR -#define NRF_SDH_BLE_INFO_COLOR 0 -#endif - -// NRF_SDH_BLE_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_BLE_DEBUG_COLOR -#define NRF_SDH_BLE_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_LOG_ENABLED - Enable logging in SoftDevice handler module. -//========================================================== -#ifndef NRF_SDH_LOG_ENABLED -#define NRF_SDH_LOG_ENABLED 1 -#endif -// NRF_SDH_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_LOG_LEVEL -#define NRF_SDH_LOG_LEVEL 3 -#endif - -// NRF_SDH_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_INFO_COLOR -#define NRF_SDH_INFO_COLOR 0 -#endif - -// NRF_SDH_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_DEBUG_COLOR -#define NRF_SDH_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_SOC_LOG_ENABLED - Enable logging in SoftDevice handler (SoC) module. -//========================================================== -#ifndef NRF_SDH_SOC_LOG_ENABLED -#define NRF_SDH_SOC_LOG_ENABLED 1 -#endif -// NRF_SDH_SOC_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_SOC_LOG_LEVEL -#define NRF_SDH_SOC_LOG_LEVEL 3 -#endif - -// NRF_SDH_SOC_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_SOC_INFO_COLOR -#define NRF_SDH_SOC_INFO_COLOR 0 -#endif - -// NRF_SDH_SOC_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_SOC_DEBUG_COLOR -#define NRF_SDH_SOC_DEBUG_COLOR 0 -#endif - -// - -// NRF_SORTLIST_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_SORTLIST_CONFIG_LOG_ENABLED -#define NRF_SORTLIST_CONFIG_LOG_ENABLED 0 -#endif -// NRF_SORTLIST_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SORTLIST_CONFIG_LOG_LEVEL -#define NRF_SORTLIST_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_SORTLIST_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SORTLIST_CONFIG_INFO_COLOR -#define NRF_SORTLIST_CONFIG_INFO_COLOR 0 -#endif - -// NRF_SORTLIST_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SORTLIST_CONFIG_DEBUG_COLOR -#define NRF_SORTLIST_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_TWI_SENSOR_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_TWI_SENSOR_CONFIG_LOG_ENABLED -#define NRF_TWI_SENSOR_CONFIG_LOG_ENABLED 0 -#endif -// NRF_TWI_SENSOR_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_TWI_SENSOR_CONFIG_LOG_LEVEL -#define NRF_TWI_SENSOR_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_TWI_SENSOR_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_TWI_SENSOR_CONFIG_INFO_COLOR -#define NRF_TWI_SENSOR_CONFIG_INFO_COLOR 0 -#endif - -// NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR -#define NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PM_LOG_ENABLED - Enable logging in Peer Manager and its submodules. -//========================================================== -#ifndef PM_LOG_ENABLED -#define PM_LOG_ENABLED 1 -#endif -// PM_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PM_LOG_LEVEL -#define PM_LOG_LEVEL 3 -#endif - -// PM_LOG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PM_LOG_INFO_COLOR -#define PM_LOG_INFO_COLOR 0 -#endif - -// PM_LOG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PM_LOG_DEBUG_COLOR -#define PM_LOG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// nrf_log in nRF_Serialization - -//========================================================== -// SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED -#define SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED 0 -#endif -// SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL -#define SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL 3 -#endif - -// SER_HAL_TRANSPORT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SER_HAL_TRANSPORT_CONFIG_INFO_COLOR -#define SER_HAL_TRANSPORT_CONFIG_INFO_COLOR 0 -#endif - -// SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR -#define SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// -//========================================================== - -// - -// NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED - nrf_log_str_formatter - Log string formatter - - -#ifndef NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED -#define NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED 1 -#endif - -// -//========================================================== - -// nRF_NFC - -//========================================================== -// NFC_AC_REC_ENABLED - nfc_ac_rec - NFC NDEF Alternative Carrier record encoder - - -#ifndef NFC_AC_REC_ENABLED -#define NFC_AC_REC_ENABLED 0 -#endif - -// NFC_AC_REC_PARSER_ENABLED - nfc_ac_rec_parser - Alternative Carrier record parser - - -#ifndef NFC_AC_REC_PARSER_ENABLED -#define NFC_AC_REC_PARSER_ENABLED 0 -#endif - -// NFC_BLE_OOB_ADVDATA_ENABLED - nfc_ble_oob_advdata - AD data for OOB pairing encoder -//========================================================== -#ifndef NFC_BLE_OOB_ADVDATA_ENABLED -#define NFC_BLE_OOB_ADVDATA_ENABLED 0 -#endif -// ADVANCED_ADVDATA_SUPPORT - Non-mandatory AD types for BLE OOB pairing are encoded inside the NDEF message (e.g. service UUIDs) - -// <1=> Enabled -// <0=> Disabled - -#ifndef ADVANCED_ADVDATA_SUPPORT -#define ADVANCED_ADVDATA_SUPPORT 0 -#endif - -// - -// NFC_BLE_OOB_ADVDATA_PARSER_ENABLED - nfc_ble_oob_advdata_parser - BLE OOB pairing AD data parser - - -#ifndef NFC_BLE_OOB_ADVDATA_PARSER_ENABLED -#define NFC_BLE_OOB_ADVDATA_PARSER_ENABLED 0 -#endif - -// NFC_BLE_PAIR_LIB_ENABLED - nfc_ble_pair_lib - Library parameters -//========================================================== -#ifndef NFC_BLE_PAIR_LIB_ENABLED -#define NFC_BLE_PAIR_LIB_ENABLED 0 -#endif -// NFC_BLE_PAIR_LIB_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_BLE_PAIR_LIB_LOG_ENABLED -#define NFC_BLE_PAIR_LIB_LOG_ENABLED 0 -#endif -// NFC_BLE_PAIR_LIB_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_BLE_PAIR_LIB_LOG_LEVEL -#define NFC_BLE_PAIR_LIB_LOG_LEVEL 3 -#endif - -// NFC_BLE_PAIR_LIB_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_BLE_PAIR_LIB_INFO_COLOR -#define NFC_BLE_PAIR_LIB_INFO_COLOR 0 -#endif - -// NFC_BLE_PAIR_LIB_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_BLE_PAIR_LIB_DEBUG_COLOR -#define NFC_BLE_PAIR_LIB_DEBUG_COLOR 0 -#endif - -// - -// NFC_BLE_PAIR_LIB_SECURITY_PARAMETERS - Common Peer Manager security parameters. - -//========================================================== -// BLE_NFC_SEC_PARAM_BOND - Enables device bonding. - -// If bonding is enabled at least one of the BLE_NFC_SEC_PARAM_KDIST options must be enabled. -//========================================================== -#ifndef BLE_NFC_SEC_PARAM_BOND -#define BLE_NFC_SEC_PARAM_BOND 1 -#endif -// BLE_NFC_SEC_PARAM_KDIST_OWN_ENC - Enables Long Term Key and Master Identification distribution by device. - - -#ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ENC -#define BLE_NFC_SEC_PARAM_KDIST_OWN_ENC 1 -#endif - -// BLE_NFC_SEC_PARAM_KDIST_OWN_ID - Enables Identity Resolving Key and Identity Address Information distribution by device. - - -#ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ID -#define BLE_NFC_SEC_PARAM_KDIST_OWN_ID 1 -#endif - -// BLE_NFC_SEC_PARAM_KDIST_PEER_ENC - Enables Long Term Key and Master Identification distribution by peer. - - -#ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ENC -#define BLE_NFC_SEC_PARAM_KDIST_PEER_ENC 1 -#endif - -// BLE_NFC_SEC_PARAM_KDIST_PEER_ID - Enables Identity Resolving Key and Identity Address Information distribution by peer. - - -#ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ID -#define BLE_NFC_SEC_PARAM_KDIST_PEER_ID 1 -#endif - -// - -// BLE_NFC_SEC_PARAM_MIN_KEY_SIZE - Minimal size of a security key. - -// <7=> 7 -// <8=> 8 -// <9=> 9 -// <10=> 10 -// <11=> 11 -// <12=> 12 -// <13=> 13 -// <14=> 14 -// <15=> 15 -// <16=> 16 - -#ifndef BLE_NFC_SEC_PARAM_MIN_KEY_SIZE -#define BLE_NFC_SEC_PARAM_MIN_KEY_SIZE 7 -#endif - -// BLE_NFC_SEC_PARAM_MAX_KEY_SIZE - Maximal size of a security key. - -// <7=> 7 -// <8=> 8 -// <9=> 9 -// <10=> 10 -// <11=> 11 -// <12=> 12 -// <13=> 13 -// <14=> 14 -// <15=> 15 -// <16=> 16 - -#ifndef BLE_NFC_SEC_PARAM_MAX_KEY_SIZE -#define BLE_NFC_SEC_PARAM_MAX_KEY_SIZE 16 -#endif - -// -//========================================================== - -// - -// NFC_BLE_PAIR_MSG_ENABLED - nfc_ble_pair_msg - NDEF message for OOB pairing encoder - - -#ifndef NFC_BLE_PAIR_MSG_ENABLED -#define NFC_BLE_PAIR_MSG_ENABLED 0 -#endif - -// NFC_CH_COMMON_ENABLED - nfc_ble_pair_common - OOB pairing common data - - -#ifndef NFC_CH_COMMON_ENABLED -#define NFC_CH_COMMON_ENABLED 0 -#endif - -// NFC_EP_OOB_REC_ENABLED - nfc_ep_oob_rec - EP record for BLE pairing encoder - - -#ifndef NFC_EP_OOB_REC_ENABLED -#define NFC_EP_OOB_REC_ENABLED 0 -#endif - -// NFC_HS_REC_ENABLED - nfc_hs_rec - Handover Select NDEF record encoder - - -#ifndef NFC_HS_REC_ENABLED -#define NFC_HS_REC_ENABLED 0 -#endif - -// NFC_LE_OOB_REC_ENABLED - nfc_le_oob_rec - LE record for BLE pairing encoder - - -#ifndef NFC_LE_OOB_REC_ENABLED -#define NFC_LE_OOB_REC_ENABLED 0 -#endif - -// NFC_LE_OOB_REC_PARSER_ENABLED - nfc_le_oob_rec_parser - LE record parser - - -#ifndef NFC_LE_OOB_REC_PARSER_ENABLED -#define NFC_LE_OOB_REC_PARSER_ENABLED 0 -#endif - -// NFC_NDEF_LAUNCHAPP_MSG_ENABLED - nfc_launchapp_msg - Encoding data for NDEF Application Launching message for NFC Tag - - -#ifndef NFC_NDEF_LAUNCHAPP_MSG_ENABLED -#define NFC_NDEF_LAUNCHAPP_MSG_ENABLED 0 -#endif - -// NFC_NDEF_LAUNCHAPP_REC_ENABLED - nfc_launchapp_rec - Encoding data for NDEF Application Launching record for NFC Tag - - -#ifndef NFC_NDEF_LAUNCHAPP_REC_ENABLED -#define NFC_NDEF_LAUNCHAPP_REC_ENABLED 0 -#endif - -// NFC_NDEF_MSG_ENABLED - nfc_ndef_msg - NFC NDEF Message generator module -//========================================================== -#ifndef NFC_NDEF_MSG_ENABLED -#define NFC_NDEF_MSG_ENABLED 0 -#endif -// NFC_NDEF_MSG_TAG_TYPE - NFC Tag Type - -// <2=> Type 2 Tag -// <4=> Type 4 Tag - -#ifndef NFC_NDEF_MSG_TAG_TYPE -#define NFC_NDEF_MSG_TAG_TYPE 2 -#endif - -// - -// NFC_NDEF_MSG_PARSER_ENABLED - nfc_ndef_msg_parser - NFC NDEF message parser module -//========================================================== -#ifndef NFC_NDEF_MSG_PARSER_ENABLED -#define NFC_NDEF_MSG_PARSER_ENABLED 0 -#endif -// NFC_NDEF_MSG_PARSER_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_NDEF_MSG_PARSER_LOG_ENABLED -#define NFC_NDEF_MSG_PARSER_LOG_ENABLED 0 -#endif -// NFC_NDEF_MSG_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_NDEF_MSG_PARSER_LOG_LEVEL -#define NFC_NDEF_MSG_PARSER_LOG_LEVEL 3 -#endif - -// NFC_NDEF_MSG_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_NDEF_MSG_PARSER_INFO_COLOR -#define NFC_NDEF_MSG_PARSER_INFO_COLOR 0 -#endif - -// - -// - -// NFC_NDEF_RECORD_ENABLED - nfc_ndef_record - NFC NDEF Record generator module - - -#ifndef NFC_NDEF_RECORD_ENABLED -#define NFC_NDEF_RECORD_ENABLED 0 -#endif - -// NFC_NDEF_RECORD_PARSER_ENABLED - nfc_ndef_record_parser - NFC NDEF Record parser module -//========================================================== -#ifndef NFC_NDEF_RECORD_PARSER_ENABLED -#define NFC_NDEF_RECORD_PARSER_ENABLED 0 -#endif -// NFC_NDEF_RECORD_PARSER_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_NDEF_RECORD_PARSER_LOG_ENABLED -#define NFC_NDEF_RECORD_PARSER_LOG_ENABLED 0 -#endif -// NFC_NDEF_RECORD_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_NDEF_RECORD_PARSER_LOG_LEVEL -#define NFC_NDEF_RECORD_PARSER_LOG_LEVEL 3 -#endif - -// NFC_NDEF_RECORD_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_NDEF_RECORD_PARSER_INFO_COLOR -#define NFC_NDEF_RECORD_PARSER_INFO_COLOR 0 -#endif - -// - -// - -// NFC_NDEF_TEXT_RECORD_ENABLED - nfc_text_rec - Encoding data for a text record for NFC Tag - - -#ifndef NFC_NDEF_TEXT_RECORD_ENABLED -#define NFC_NDEF_TEXT_RECORD_ENABLED 0 -#endif - -// NFC_NDEF_URI_MSG_ENABLED - nfc_uri_msg - Encoding data for NDEF message with URI record for NFC Tag - - -#ifndef NFC_NDEF_URI_MSG_ENABLED -#define NFC_NDEF_URI_MSG_ENABLED 0 -#endif - -// NFC_NDEF_URI_REC_ENABLED - nfc_uri_rec - Encoding data for a URI record for NFC Tag - - -#ifndef NFC_NDEF_URI_REC_ENABLED -#define NFC_NDEF_URI_REC_ENABLED 0 -#endif - -// NFC_PLATFORM_ENABLED - nfc_platform - NFC platform module for Clock control. -//========================================================== -#ifndef NFC_PLATFORM_ENABLED -#define NFC_PLATFORM_ENABLED 0 -#endif -// NFC_PLATFORM_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_PLATFORM_LOG_ENABLED -#define NFC_PLATFORM_LOG_ENABLED 0 -#endif -// NFC_PLATFORM_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_PLATFORM_LOG_LEVEL -#define NFC_PLATFORM_LOG_LEVEL 3 -#endif - -// NFC_PLATFORM_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_PLATFORM_INFO_COLOR -#define NFC_PLATFORM_INFO_COLOR 0 -#endif - -// NFC_PLATFORM_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_PLATFORM_DEBUG_COLOR -#define NFC_PLATFORM_DEBUG_COLOR 0 -#endif - -// - -// - -// NFC_T2T_PARSER_ENABLED - nfc_type_2_tag_parser - Parser for decoding Type 2 Tag data -//========================================================== -#ifndef NFC_T2T_PARSER_ENABLED -#define NFC_T2T_PARSER_ENABLED 0 -#endif -// NFC_T2T_PARSER_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_T2T_PARSER_LOG_ENABLED -#define NFC_T2T_PARSER_LOG_ENABLED 0 -#endif -// NFC_T2T_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_T2T_PARSER_LOG_LEVEL -#define NFC_T2T_PARSER_LOG_LEVEL 3 -#endif - -// NFC_T2T_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_T2T_PARSER_INFO_COLOR -#define NFC_T2T_PARSER_INFO_COLOR 0 -#endif - -// - -// - -// NFC_T4T_APDU_ENABLED - nfc_t4t_apdu - APDU encoder/decoder for Type 4 Tag -//========================================================== -#ifndef NFC_T4T_APDU_ENABLED -#define NFC_T4T_APDU_ENABLED 0 -#endif -// NFC_T4T_APDU_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_T4T_APDU_LOG_ENABLED -#define NFC_T4T_APDU_LOG_ENABLED 0 -#endif -// NFC_T4T_APDU_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_T4T_APDU_LOG_LEVEL -#define NFC_T4T_APDU_LOG_LEVEL 3 -#endif - -// NFC_T4T_APDU_LOG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_T4T_APDU_LOG_COLOR -#define NFC_T4T_APDU_LOG_COLOR 0 -#endif - -// - -// - -// NFC_T4T_CC_FILE_PARSER_ENABLED - nfc_t4t_cc_file - Capability Container file for Type 4 Tag -//========================================================== -#ifndef NFC_T4T_CC_FILE_PARSER_ENABLED -#define NFC_T4T_CC_FILE_PARSER_ENABLED 0 -#endif -// NFC_T4T_CC_FILE_PARSER_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_T4T_CC_FILE_PARSER_LOG_ENABLED -#define NFC_T4T_CC_FILE_PARSER_LOG_ENABLED 0 -#endif -// NFC_T4T_CC_FILE_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_T4T_CC_FILE_PARSER_LOG_LEVEL -#define NFC_T4T_CC_FILE_PARSER_LOG_LEVEL 3 -#endif - -// NFC_T4T_CC_FILE_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_T4T_CC_FILE_PARSER_INFO_COLOR -#define NFC_T4T_CC_FILE_PARSER_INFO_COLOR 0 -#endif - -// - -// - -// NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED - nfc_t4t_hl_detection_procedures - NDEF Detection Procedure for Type 4 Tag -//========================================================== -#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED -#define NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED 0 -#endif -// NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED -#define NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED 0 -#endif -// NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL -#define NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL 3 -#endif - -// NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR -#define NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR 0 -#endif - -// - -// APDU_BUFF_SIZE - Size (in bytes) of the buffer for APDU storage -#ifndef APDU_BUFF_SIZE -#define APDU_BUFF_SIZE 250 -#endif - -// CC_STORAGE_BUFF_SIZE - Size (in bytes) of the buffer for CC file storage -#ifndef CC_STORAGE_BUFF_SIZE -#define CC_STORAGE_BUFF_SIZE 64 -#endif - -// - -// NFC_T4T_TLV_BLOCK_PARSER_ENABLED - nfc_t4t_tlv_block - TLV block for Type 4 Tag -//========================================================== -#ifndef NFC_T4T_TLV_BLOCK_PARSER_ENABLED -#define NFC_T4T_TLV_BLOCK_PARSER_ENABLED 0 -#endif -// NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED -#define NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED 0 -#endif -// NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL -#define NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL 3 -#endif - -// NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR -#define NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR 0 -#endif - -// - -// - -// -//========================================================== - -// nRF_SoftDevice - -//========================================================== -// NRF_SDH_BLE_ENABLED - nrf_sdh_ble - SoftDevice BLE event handler -//========================================================== -#ifndef NRF_SDH_BLE_ENABLED -#define NRF_SDH_BLE_ENABLED 0 -#endif -// BLE Stack configuration - Stack configuration parameters - -// The SoftDevice handler will configure the stack with these parameters when calling @ref nrf_sdh_ble_default_cfg_set. -// Other libraries might depend on these values; keep them up-to-date even if you are not explicitely calling @ref nrf_sdh_ble_default_cfg_set. -//========================================================== -// NRF_SDH_BLE_GAP_DATA_LENGTH <27-251> - - -// Requested BLE GAP data length to be negotiated. - -#ifndef NRF_SDH_BLE_GAP_DATA_LENGTH -#define NRF_SDH_BLE_GAP_DATA_LENGTH 27 -#endif - -// NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. -#ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT -#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 0 -#endif - -// NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. -#ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT -#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0 -#endif - -// NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count. -// Maximum number of total concurrent connections using the default configuration. - -#ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT -#define NRF_SDH_BLE_TOTAL_LINK_COUNT 1 -#endif - -// NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length. -// The time set aside for this connection on every connection interval in 1.25 ms units. - -#ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH -#define NRF_SDH_BLE_GAP_EVENT_LENGTH 6 -#endif - -// NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. -#ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE -#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 23 -#endif - -// NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4. -#ifndef NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE -#define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408 -#endif - -// NRF_SDH_BLE_VS_UUID_COUNT - The number of vendor-specific UUIDs. -#ifndef NRF_SDH_BLE_VS_UUID_COUNT -#define NRF_SDH_BLE_VS_UUID_COUNT 0 -#endif - -// NRF_SDH_BLE_SERVICE_CHANGED - Include the Service Changed characteristic in the Attribute Table. - - -#ifndef NRF_SDH_BLE_SERVICE_CHANGED -#define NRF_SDH_BLE_SERVICE_CHANGED 0 -#endif - -// -//========================================================== - -// BLE Observers - Observers and priority levels - -//========================================================== -// NRF_SDH_BLE_OBSERVER_PRIO_LEVELS - Total number of priority levels for BLE observers. -// This setting configures the number of priority levels available for BLE event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_BLE_OBSERVER_PRIO_LEVELS -#define NRF_SDH_BLE_OBSERVER_PRIO_LEVELS 4 -#endif - -// BLE Observers priorities - Invididual priorities - -//========================================================== -// BLE_ADV_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Advertising module. - -#ifndef BLE_ADV_BLE_OBSERVER_PRIO -#define BLE_ADV_BLE_OBSERVER_PRIO 1 -#endif - -// BLE_ANCS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Apple Notification Service Client. - -#ifndef BLE_ANCS_C_BLE_OBSERVER_PRIO -#define BLE_ANCS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_ANS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Alert Notification Service Client. - -#ifndef BLE_ANS_C_BLE_OBSERVER_PRIO -#define BLE_ANS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_BAS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Battery Service. - -#ifndef BLE_BAS_BLE_OBSERVER_PRIO -#define BLE_BAS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_BAS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Battery Service Client. - -#ifndef BLE_BAS_C_BLE_OBSERVER_PRIO -#define BLE_BAS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_BPS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Blood Pressure Service. - -#ifndef BLE_BPS_BLE_OBSERVER_PRIO -#define BLE_BPS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_CONN_PARAMS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Connection parameters module. - -#ifndef BLE_CONN_PARAMS_BLE_OBSERVER_PRIO -#define BLE_CONN_PARAMS_BLE_OBSERVER_PRIO 1 -#endif - -// BLE_CONN_STATE_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Connection State module. - -#ifndef BLE_CONN_STATE_BLE_OBSERVER_PRIO -#define BLE_CONN_STATE_BLE_OBSERVER_PRIO 0 -#endif - -// BLE_CSCS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Cycling Speed and Cadence Service. - -#ifndef BLE_CSCS_BLE_OBSERVER_PRIO -#define BLE_CSCS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_CTS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Current Time Service Client. - -#ifndef BLE_CTS_C_BLE_OBSERVER_PRIO -#define BLE_CTS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_DB_DISC_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Database Discovery module. - -#ifndef BLE_DB_DISC_BLE_OBSERVER_PRIO -#define BLE_DB_DISC_BLE_OBSERVER_PRIO 1 -#endif - -// BLE_DFU_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the DFU Service. - -#ifndef BLE_DFU_BLE_OBSERVER_PRIO -#define BLE_DFU_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_DIS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Device Information Client. - -#ifndef BLE_DIS_C_BLE_OBSERVER_PRIO -#define BLE_DIS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_GLS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Glucose Service. - -#ifndef BLE_GLS_BLE_OBSERVER_PRIO -#define BLE_GLS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HIDS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Human Interface Device Service. - -#ifndef BLE_HIDS_BLE_OBSERVER_PRIO -#define BLE_HIDS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HRS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Heart Rate Service. - -#ifndef BLE_HRS_BLE_OBSERVER_PRIO -#define BLE_HRS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HRS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Heart Rate Service Client. - -#ifndef BLE_HRS_C_BLE_OBSERVER_PRIO -#define BLE_HRS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HTS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Health Thermometer Service. - -#ifndef BLE_HTS_BLE_OBSERVER_PRIO -#define BLE_HTS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_IAS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Immediate Alert Service. - -#ifndef BLE_IAS_BLE_OBSERVER_PRIO -#define BLE_IAS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_IAS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Immediate Alert Service Client. - -#ifndef BLE_IAS_C_BLE_OBSERVER_PRIO -#define BLE_IAS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LBS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the LED Button Service. - -#ifndef BLE_LBS_BLE_OBSERVER_PRIO -#define BLE_LBS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LBS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the LED Button Service Client. - -#ifndef BLE_LBS_C_BLE_OBSERVER_PRIO -#define BLE_LBS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LLS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Link Loss Service. - -#ifndef BLE_LLS_BLE_OBSERVER_PRIO -#define BLE_LLS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LNS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Location Navigation Service. - -#ifndef BLE_LNS_BLE_OBSERVER_PRIO -#define BLE_LNS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_NUS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the UART Service. - -#ifndef BLE_NUS_BLE_OBSERVER_PRIO -#define BLE_NUS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_NUS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the UART Central Service. - -#ifndef BLE_NUS_C_BLE_OBSERVER_PRIO -#define BLE_NUS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_OTS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Object transfer service. - -#ifndef BLE_OTS_BLE_OBSERVER_PRIO -#define BLE_OTS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_OTS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Object transfer service client. - -#ifndef BLE_OTS_C_BLE_OBSERVER_PRIO -#define BLE_OTS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_RSCS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Running Speed and Cadence Service. - -#ifndef BLE_RSCS_BLE_OBSERVER_PRIO -#define BLE_RSCS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_RSCS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Running Speed and Cadence Client. - -#ifndef BLE_RSCS_C_BLE_OBSERVER_PRIO -#define BLE_RSCS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_TPS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the TX Power Service. - -#ifndef BLE_TPS_BLE_OBSERVER_PRIO -#define BLE_TPS_BLE_OBSERVER_PRIO 2 -#endif - -// BSP_BTN_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Button Control module. - -#ifndef BSP_BTN_BLE_OBSERVER_PRIO -#define BSP_BTN_BLE_OBSERVER_PRIO 1 -#endif - -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the NFC pairing library. - -#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 -#endif - -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the NFC pairing library. - -#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 -#endif - -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the NFC pairing library. - -#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 -#endif - -// NRF_BLE_BMS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Bond Management Service. - -#ifndef NRF_BLE_BMS_BLE_OBSERVER_PRIO -#define NRF_BLE_BMS_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_CGMS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Contiuon Glucose Monitoring Service. - -#ifndef NRF_BLE_CGMS_BLE_OBSERVER_PRIO -#define NRF_BLE_CGMS_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_ES_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Eddystone module. - -#ifndef NRF_BLE_ES_BLE_OBSERVER_PRIO -#define NRF_BLE_ES_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the GATT Service Client. - -#ifndef NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO -#define NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_GATT_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the GATT module. - -#ifndef NRF_BLE_GATT_BLE_OBSERVER_PRIO -#define NRF_BLE_GATT_BLE_OBSERVER_PRIO 1 -#endif - -// NRF_BLE_GQ_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the GATT Queue module. - -#ifndef NRF_BLE_GQ_BLE_OBSERVER_PRIO -#define NRF_BLE_GQ_BLE_OBSERVER_PRIO 1 -#endif - -// NRF_BLE_QWR_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Queued writes module. - -#ifndef NRF_BLE_QWR_BLE_OBSERVER_PRIO -#define NRF_BLE_QWR_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_SCAN_OBSERVER_PRIO -// Priority for dispatching the BLE events to the Scanning Module. - -#ifndef NRF_BLE_SCAN_OBSERVER_PRIO -#define NRF_BLE_SCAN_OBSERVER_PRIO 1 -#endif - -// PM_BLE_OBSERVER_PRIO - Priority with which BLE events are dispatched to the Peer Manager module. -#ifndef PM_BLE_OBSERVER_PRIO -#define PM_BLE_OBSERVER_PRIO 1 -#endif - -// -//========================================================== - -// -//========================================================== - - -// - -// NRF_SDH_ENABLED - nrf_sdh - SoftDevice handler -//========================================================== -#ifndef NRF_SDH_ENABLED -#define NRF_SDH_ENABLED 0 -#endif -// Dispatch model - -// This setting configures how Stack events are dispatched to the application. -//========================================================== -// NRF_SDH_DISPATCH_MODEL - - -// NRF_SDH_DISPATCH_MODEL_INTERRUPT: SoftDevice events are passed to the application from the interrupt context. -// NRF_SDH_DISPATCH_MODEL_APPSH: SoftDevice events are scheduled using @ref app_scheduler. -// NRF_SDH_DISPATCH_MODEL_POLLING: SoftDevice events are to be fetched manually. -// <0=> NRF_SDH_DISPATCH_MODEL_INTERRUPT -// <1=> NRF_SDH_DISPATCH_MODEL_APPSH -// <2=> NRF_SDH_DISPATCH_MODEL_POLLING - -#ifndef NRF_SDH_DISPATCH_MODEL -#define NRF_SDH_DISPATCH_MODEL 0 -#endif - -// -//========================================================== - -// Clock - SoftDevice clock configuration - -//========================================================== -// NRF_SDH_CLOCK_LF_SRC - SoftDevice clock source. - -// <0=> NRF_CLOCK_LF_SRC_RC -// <1=> NRF_CLOCK_LF_SRC_XTAL -// <2=> NRF_CLOCK_LF_SRC_SYNTH - -#ifndef NRF_SDH_CLOCK_LF_SRC -#define NRF_SDH_CLOCK_LF_SRC 1 -#endif - -// NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. -#ifndef NRF_SDH_CLOCK_LF_RC_CTIV -#define NRF_SDH_CLOCK_LF_RC_CTIV 0 -#endif - -// NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. -// How often (in number of calibration intervals) the RC oscillator shall be calibrated -// if the temperature has not changed. - -#ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV -#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0 -#endif - -// NRF_SDH_CLOCK_LF_ACCURACY - External clock accuracy used in the LL to compute timing. - -// <0=> NRF_CLOCK_LF_ACCURACY_250_PPM -// <1=> NRF_CLOCK_LF_ACCURACY_500_PPM -// <2=> NRF_CLOCK_LF_ACCURACY_150_PPM -// <3=> NRF_CLOCK_LF_ACCURACY_100_PPM -// <4=> NRF_CLOCK_LF_ACCURACY_75_PPM -// <5=> NRF_CLOCK_LF_ACCURACY_50_PPM -// <6=> NRF_CLOCK_LF_ACCURACY_30_PPM -// <7=> NRF_CLOCK_LF_ACCURACY_20_PPM -// <8=> NRF_CLOCK_LF_ACCURACY_10_PPM -// <9=> NRF_CLOCK_LF_ACCURACY_5_PPM -// <10=> NRF_CLOCK_LF_ACCURACY_2_PPM -// <11=> NRF_CLOCK_LF_ACCURACY_1_PPM - -#ifndef NRF_SDH_CLOCK_LF_ACCURACY -#define NRF_SDH_CLOCK_LF_ACCURACY 7 -#endif - -// -//========================================================== - -// SDH Observers - Observers and priority levels - -//========================================================== -// NRF_SDH_REQ_OBSERVER_PRIO_LEVELS - Total number of priority levels for request observers. -// This setting configures the number of priority levels available for the SoftDevice request event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_REQ_OBSERVER_PRIO_LEVELS -#define NRF_SDH_REQ_OBSERVER_PRIO_LEVELS 2 -#endif - -// NRF_SDH_STATE_OBSERVER_PRIO_LEVELS - Total number of priority levels for state observers. -// This setting configures the number of priority levels available for the SoftDevice state event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_STATE_OBSERVER_PRIO_LEVELS -#define NRF_SDH_STATE_OBSERVER_PRIO_LEVELS 2 -#endif - -// NRF_SDH_STACK_OBSERVER_PRIO_LEVELS - Total number of priority levels for stack event observers. -// This setting configures the number of priority levels available for the SoftDevice stack event handlers (ANT, BLE, SoC). -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_STACK_OBSERVER_PRIO_LEVELS -#define NRF_SDH_STACK_OBSERVER_PRIO_LEVELS 2 -#endif - - -// State Observers priorities - Invididual priorities - -//========================================================== -// CLOCK_CONFIG_STATE_OBSERVER_PRIO -// Priority with which state events are dispatched to the Clock driver. - -#ifndef CLOCK_CONFIG_STATE_OBSERVER_PRIO -#define CLOCK_CONFIG_STATE_OBSERVER_PRIO 0 -#endif - -// POWER_CONFIG_STATE_OBSERVER_PRIO -// Priority with which state events are dispatched to the Power driver. - -#ifndef POWER_CONFIG_STATE_OBSERVER_PRIO -#define POWER_CONFIG_STATE_OBSERVER_PRIO 0 -#endif - -// RNG_CONFIG_STATE_OBSERVER_PRIO -// Priority with which state events are dispatched to this module. - -#ifndef RNG_CONFIG_STATE_OBSERVER_PRIO -#define RNG_CONFIG_STATE_OBSERVER_PRIO 0 -#endif - -// -//========================================================== - -// Stack Event Observers priorities - Invididual priorities - -//========================================================== -// NRF_SDH_ANT_STACK_OBSERVER_PRIO -// This setting configures the priority with which ANT events are processed with respect to other events coming from the stack. -// Modify this setting if you need to have ANT events dispatched before or after other stack events, such as BLE or SoC. -// Zero is the highest priority. - -#ifndef NRF_SDH_ANT_STACK_OBSERVER_PRIO -#define NRF_SDH_ANT_STACK_OBSERVER_PRIO 0 -#endif - -// NRF_SDH_BLE_STACK_OBSERVER_PRIO -// This setting configures the priority with which BLE events are processed with respect to other events coming from the stack. -// Modify this setting if you need to have BLE events dispatched before or after other stack events, such as ANT or SoC. -// Zero is the highest priority. - -#ifndef NRF_SDH_BLE_STACK_OBSERVER_PRIO -#define NRF_SDH_BLE_STACK_OBSERVER_PRIO 0 -#endif - -// NRF_SDH_SOC_STACK_OBSERVER_PRIO -// This setting configures the priority with which SoC events are processed with respect to other events coming from the stack. -// Modify this setting if you need to have SoC events dispatched before or after other stack events, such as ANT or BLE. -// Zero is the highest priority. - -#ifndef NRF_SDH_SOC_STACK_OBSERVER_PRIO -#define NRF_SDH_SOC_STACK_OBSERVER_PRIO 0 -#endif - -// -//========================================================== - -// -//========================================================== - - -// - -// NRF_SDH_SOC_ENABLED - nrf_sdh_soc - SoftDevice SoC event handler -//========================================================== -#ifndef NRF_SDH_SOC_ENABLED -#define NRF_SDH_SOC_ENABLED 0 -#endif -// SoC Observers - Observers and priority levels - -//========================================================== -// NRF_SDH_SOC_OBSERVER_PRIO_LEVELS - Total number of priority levels for SoC observers. -// This setting configures the number of priority levels available for the SoC event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_SOC_OBSERVER_PRIO_LEVELS -#define NRF_SDH_SOC_OBSERVER_PRIO_LEVELS 2 -#endif - -// SoC Observers priorities - Invididual priorities - -//========================================================== -// BLE_DFU_SOC_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the DFU Service. - -#ifndef BLE_DFU_SOC_OBSERVER_PRIO -#define BLE_DFU_SOC_OBSERVER_PRIO 1 -#endif - -// CLOCK_CONFIG_SOC_OBSERVER_PRIO -// Priority with which SoC events are dispatched to the Clock driver. - -#ifndef CLOCK_CONFIG_SOC_OBSERVER_PRIO -#define CLOCK_CONFIG_SOC_OBSERVER_PRIO 0 -#endif - -// POWER_CONFIG_SOC_OBSERVER_PRIO -// Priority with which SoC events are dispatched to the Power driver. - -#ifndef POWER_CONFIG_SOC_OBSERVER_PRIO -#define POWER_CONFIG_SOC_OBSERVER_PRIO 0 -#endif - -// -//========================================================== - -// -//========================================================== - - -// - -// -//========================================================== - -// <<< end of configuration section >>> -#endif //SDK_CONFIG_H - diff --git a/third_party/NordicSemiconductor/config/nrf52840/config/sdk_config.h b/third_party/NordicSemiconductor/config/nrf52840/config/sdk_config.h deleted file mode 100644 index 07e138733..000000000 --- a/third_party/NordicSemiconductor/config/nrf52840/config/sdk_config.h +++ /dev/null @@ -1,11698 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - - - -#ifndef SDK_CONFIG_H -#define SDK_CONFIG_H -// <<< Use Configuration Wizard in Context Menu >>>\n -#ifdef USE_APP_CONFIG -#include "app_config.h" -#endif -// nRF_BLE - -//========================================================== -// BLE_ADVERTISING_ENABLED - ble_advertising - Advertising module - - -#ifndef BLE_ADVERTISING_ENABLED -#define BLE_ADVERTISING_ENABLED 0 -#endif - -// BLE_DTM_ENABLED - ble_dtm - Module for testing RF/PHY using DTM commands - - -#ifndef BLE_DTM_ENABLED -#define BLE_DTM_ENABLED 0 -#endif - -// BLE_RACP_ENABLED - ble_racp - Record Access Control Point library - - -#ifndef BLE_RACP_ENABLED -#define BLE_RACP_ENABLED 0 -#endif - -// NRF_BLE_QWR_ENABLED - nrf_ble_qwr - Queued writes support module (prepare/execute write) -//========================================================== -#ifndef NRF_BLE_QWR_ENABLED -#define NRF_BLE_QWR_ENABLED 0 -#endif -// NRF_BLE_QWR_MAX_ATTR - Maximum number of attribute handles that can be registered. This number must be adjusted according to the number of attributes for which Queued Writes will be enabled. If it is zero, the module will reject all Queued Write requests. -#ifndef NRF_BLE_QWR_MAX_ATTR -#define NRF_BLE_QWR_MAX_ATTR 0 -#endif - -// - -// PEER_MANAGER_ENABLED - peer_manager - Peer Manager -//========================================================== -#ifndef PEER_MANAGER_ENABLED -#define PEER_MANAGER_ENABLED 0 -#endif -// PM_MAX_REGISTRANTS - Number of event handlers that can be registered. -#ifndef PM_MAX_REGISTRANTS -#define PM_MAX_REGISTRANTS 3 -#endif - -// PM_FLASH_BUFFERS - Number of internal buffers for flash operations. -// Decrease this value to lower RAM usage. - -#ifndef PM_FLASH_BUFFERS -#define PM_FLASH_BUFFERS 4 -#endif - -// PM_CENTRAL_ENABLED - Enable/disable central-specific Peer Manager functionality. - - -// Enable/disable central-specific Peer Manager functionality. - -#ifndef PM_CENTRAL_ENABLED -#define PM_CENTRAL_ENABLED 1 -#endif - -// PM_SERVICE_CHANGED_ENABLED - Enable/disable the service changed management for GATT server in Peer Manager. - - -// If not using a GATT server, or using a server wihout a service changed characteristic, -// disable this to save code space. - -#ifndef PM_SERVICE_CHANGED_ENABLED -#define PM_SERVICE_CHANGED_ENABLED 1 -#endif - -// PM_PEER_RANKS_ENABLED - Enable/disable the peer rank management in Peer Manager. - - -// Set this to false to save code space if not using the peer rank API. - -#ifndef PM_PEER_RANKS_ENABLED -#define PM_PEER_RANKS_ENABLED 1 -#endif - -// PM_LESC_ENABLED - Enable/disable LESC support in Peer Manager. - - -// If set to true, you need to call nrf_ble_lesc_request_handler() in the main loop to respond to LESC-related BLE events. If LESC support is not required, set this to false to save code space. - -#ifndef PM_LESC_ENABLED -#define PM_LESC_ENABLED 0 -#endif - -// PM_RA_PROTECTION_ENABLED - Enable/disable protection against repeated pairing attempts in Peer Manager. -//========================================================== -#ifndef PM_RA_PROTECTION_ENABLED -#define PM_RA_PROTECTION_ENABLED 0 -#endif -// PM_RA_PROTECTION_TRACKED_PEERS_NUM - Maximum number of peers whose authorization status can be tracked. -#ifndef PM_RA_PROTECTION_TRACKED_PEERS_NUM -#define PM_RA_PROTECTION_TRACKED_PEERS_NUM 8 -#endif - -// PM_RA_PROTECTION_MIN_WAIT_INTERVAL - Minimum waiting interval (in ms) before a new pairing attempt can be initiated. -#ifndef PM_RA_PROTECTION_MIN_WAIT_INTERVAL -#define PM_RA_PROTECTION_MIN_WAIT_INTERVAL 4000 -#endif - -// PM_RA_PROTECTION_MAX_WAIT_INTERVAL - Maximum waiting interval (in ms) before a new pairing attempt can be initiated. -#ifndef PM_RA_PROTECTION_MAX_WAIT_INTERVAL -#define PM_RA_PROTECTION_MAX_WAIT_INTERVAL 64000 -#endif - -// PM_RA_PROTECTION_REWARD_PERIOD - Reward period (in ms). -// The waiting interval is gradually decreased when no new failed pairing attempts are made during reward period. - -#ifndef PM_RA_PROTECTION_REWARD_PERIOD -#define PM_RA_PROTECTION_REWARD_PERIOD 10000 -#endif - -// - -// PM_HANDLER_SEC_DELAY_MS - Delay before starting security. -// This might be necessary for interoperability reasons, especially as peripheral. - -#ifndef PM_HANDLER_SEC_DELAY_MS -#define PM_HANDLER_SEC_DELAY_MS 0 -#endif - -// - -// -//========================================================== - -// nRF_BLE_Services - -//========================================================== -// BLE_ANCS_C_ENABLED - ble_ancs_c - Apple Notification Service Client - - -#ifndef BLE_ANCS_C_ENABLED -#define BLE_ANCS_C_ENABLED 0 -#endif - -// BLE_ANS_C_ENABLED - ble_ans_c - Alert Notification Service Client - - -#ifndef BLE_ANS_C_ENABLED -#define BLE_ANS_C_ENABLED 0 -#endif - -// BLE_BAS_C_ENABLED - ble_bas_c - Battery Service Client - - -#ifndef BLE_BAS_C_ENABLED -#define BLE_BAS_C_ENABLED 0 -#endif - -// BLE_BAS_ENABLED - ble_bas - Battery Service -//========================================================== -#ifndef BLE_BAS_ENABLED -#define BLE_BAS_ENABLED 0 -#endif -// BLE_BAS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef BLE_BAS_CONFIG_LOG_ENABLED -#define BLE_BAS_CONFIG_LOG_ENABLED 0 -#endif -// BLE_BAS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef BLE_BAS_CONFIG_LOG_LEVEL -#define BLE_BAS_CONFIG_LOG_LEVEL 3 -#endif - -// BLE_BAS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_BAS_CONFIG_INFO_COLOR -#define BLE_BAS_CONFIG_INFO_COLOR 0 -#endif - -// BLE_BAS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_BAS_CONFIG_DEBUG_COLOR -#define BLE_BAS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// BLE_CSCS_ENABLED - ble_cscs - Cycling Speed and Cadence Service - - -#ifndef BLE_CSCS_ENABLED -#define BLE_CSCS_ENABLED 0 -#endif - -// BLE_CTS_C_ENABLED - ble_cts_c - Current Time Service Client - - -#ifndef BLE_CTS_C_ENABLED -#define BLE_CTS_C_ENABLED 0 -#endif - -// BLE_DIS_ENABLED - ble_dis - Device Information Service - - -#ifndef BLE_DIS_ENABLED -#define BLE_DIS_ENABLED 0 -#endif - -// BLE_GLS_ENABLED - ble_gls - Glucose Service - - -#ifndef BLE_GLS_ENABLED -#define BLE_GLS_ENABLED 0 -#endif - -// BLE_HIDS_ENABLED - ble_hids - Human Interface Device Service - - -#ifndef BLE_HIDS_ENABLED -#define BLE_HIDS_ENABLED 0 -#endif - -// BLE_HRS_C_ENABLED - ble_hrs_c - Heart Rate Service Client - - -#ifndef BLE_HRS_C_ENABLED -#define BLE_HRS_C_ENABLED 0 -#endif - -// BLE_HRS_ENABLED - ble_hrs - Heart Rate Service - - -#ifndef BLE_HRS_ENABLED -#define BLE_HRS_ENABLED 0 -#endif - -// BLE_HTS_ENABLED - ble_hts - Health Thermometer Service - - -#ifndef BLE_HTS_ENABLED -#define BLE_HTS_ENABLED 0 -#endif - -// BLE_IAS_C_ENABLED - ble_ias_c - Immediate Alert Service Client - - -#ifndef BLE_IAS_C_ENABLED -#define BLE_IAS_C_ENABLED 0 -#endif - -// BLE_IAS_ENABLED - ble_ias - Immediate Alert Service -//========================================================== -#ifndef BLE_IAS_ENABLED -#define BLE_IAS_ENABLED 0 -#endif -// BLE_IAS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef BLE_IAS_CONFIG_LOG_ENABLED -#define BLE_IAS_CONFIG_LOG_ENABLED 0 -#endif -// BLE_IAS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef BLE_IAS_CONFIG_LOG_LEVEL -#define BLE_IAS_CONFIG_LOG_LEVEL 3 -#endif - -// BLE_IAS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_IAS_CONFIG_INFO_COLOR -#define BLE_IAS_CONFIG_INFO_COLOR 0 -#endif - -// BLE_IAS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_IAS_CONFIG_DEBUG_COLOR -#define BLE_IAS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// BLE_LBS_C_ENABLED - ble_lbs_c - Nordic LED Button Service Client - - -#ifndef BLE_LBS_C_ENABLED -#define BLE_LBS_C_ENABLED 0 -#endif - -// BLE_LBS_ENABLED - ble_lbs - LED Button Service - - -#ifndef BLE_LBS_ENABLED -#define BLE_LBS_ENABLED 0 -#endif - -// BLE_LLS_ENABLED - ble_lls - Link Loss Service - - -#ifndef BLE_LLS_ENABLED -#define BLE_LLS_ENABLED 0 -#endif - -// BLE_NUS_C_ENABLED - ble_nus_c - Nordic UART Central Service - - -#ifndef BLE_NUS_C_ENABLED -#define BLE_NUS_C_ENABLED 0 -#endif - -// BLE_NUS_ENABLED - ble_nus - Nordic UART Service -//========================================================== -#ifndef BLE_NUS_ENABLED -#define BLE_NUS_ENABLED 0 -#endif -// BLE_NUS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef BLE_NUS_CONFIG_LOG_ENABLED -#define BLE_NUS_CONFIG_LOG_ENABLED 0 -#endif -// BLE_NUS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef BLE_NUS_CONFIG_LOG_LEVEL -#define BLE_NUS_CONFIG_LOG_LEVEL 3 -#endif - -// BLE_NUS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_NUS_CONFIG_INFO_COLOR -#define BLE_NUS_CONFIG_INFO_COLOR 0 -#endif - -// BLE_NUS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef BLE_NUS_CONFIG_DEBUG_COLOR -#define BLE_NUS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// BLE_RSCS_C_ENABLED - ble_rscs_c - Running Speed and Cadence Client - - -#ifndef BLE_RSCS_C_ENABLED -#define BLE_RSCS_C_ENABLED 0 -#endif - -// BLE_RSCS_ENABLED - ble_rscs - Running Speed and Cadence Service - - -#ifndef BLE_RSCS_ENABLED -#define BLE_RSCS_ENABLED 0 -#endif - -// BLE_TPS_ENABLED - ble_tps - TX Power Service - - -#ifndef BLE_TPS_ENABLED -#define BLE_TPS_ENABLED 0 -#endif - -// -//========================================================== - -// nRF_Core - -//========================================================== -// NRF_MPU_LIB_ENABLED - nrf_mpu_lib - Module for MPU -//========================================================== -#ifndef NRF_MPU_LIB_ENABLED -#define NRF_MPU_LIB_ENABLED 0 -#endif -// NRF_MPU_LIB_CLI_CMDS - Enable CLI commands specific to the module. - - -#ifndef NRF_MPU_LIB_CLI_CMDS -#define NRF_MPU_LIB_CLI_CMDS 0 -#endif - -// - -// NRF_STACK_GUARD_ENABLED - nrf_stack_guard - Stack guard -//========================================================== -#ifndef NRF_STACK_GUARD_ENABLED -#define NRF_STACK_GUARD_ENABLED 0 -#endif -// NRF_STACK_GUARD_CONFIG_SIZE - Size of the stack guard. - -// <5=> 32 bytes -// <6=> 64 bytes -// <7=> 128 bytes -// <8=> 256 bytes -// <9=> 512 bytes -// <10=> 1024 bytes -// <11=> 2048 bytes -// <12=> 4096 bytes - -#ifndef NRF_STACK_GUARD_CONFIG_SIZE -#define NRF_STACK_GUARD_CONFIG_SIZE 7 -#endif - -// - -// -//========================================================== - -// nRF_Crypto - -//========================================================== -// NRF_CRYPTO_ENABLED - nrf_crypto - Cryptography library. -//========================================================== -#ifndef NRF_CRYPTO_ENABLED -#define NRF_CRYPTO_ENABLED 1 -#endif -// NRF_CRYPTO_ALLOCATOR - Memory allocator - - -// Choose memory allocator used by nrf_crypto. Default is alloca if possible or nrf_malloc otherwise. If 'User macros' are selected, the user has to create 'nrf_crypto_allocator.h' file that contains NRF_CRYPTO_ALLOC, NRF_CRYPTO_FREE, and NRF_CRYPTO_ALLOC_ON_STACK. -// <0=> Default -// <1=> User macros -// <2=> On stack (alloca) -// <3=> C dynamic memory (malloc) -// <4=> SDK Memory Manager (nrf_malloc) - -#ifndef NRF_CRYPTO_ALLOCATOR -#define NRF_CRYPTO_ALLOCATOR 0 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_ENABLED - Enable the ARM Cryptocell CC310 reduced backend. - -// The CC310 hardware-accelerated cryptography backend with reduced functionality and footprint (only available on nRF52840). -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED - Enable the secp224r1 elliptic curve support using CC310_BL. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED 0 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED - Enable the secp256r1 elliptic curve support using CC310_BL. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED - CC310_BL SHA-256 hash functionality. - - -// CC310_BL backend implementation for hardware-accelerated SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED - nrf_cc310_bl buffers to RAM before running hash operation - - -// Enabling this makes hashing of addresses in FLASH range possible. Size of buffer allocated for hashing is set by NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED 0 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE - nrf_cc310_bl hash outputs digests in little endian -// Makes the nrf_cc310_bl hash functions output digests in little endian format. Only for use in nRF SDK DFU! - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE -#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE 4096 -#endif - -// NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED - Enable Interrupts while support using CC310 bl. - - -// Select a library version compatible with the configuration. When interrupts are disable, a version named _noint must be used - -#ifndef NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_CC310_ENABLED - Enable the ARM Cryptocell CC310 backend. - -// The CC310 hardware-accelerated cryptography backend (only available on nRF52840). -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_CC310_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED - Enable the AES CBC mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED - Enable the AES CTR mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED - Enable the AES ECB mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED - Enable the AES CBC_MAC mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED - Enable the AES CMAC mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED - Enable the AES CCM mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED - Enable the AES CCM* mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED - Enable the CHACHA-POLY mode using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED - Enable the secp160r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED - Enable the secp160r2 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED - Enable the secp192r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED - Enable the secp224r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED - Enable the secp256r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED - Enable the secp384r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED - Enable the secp521r1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED - Enable the secp160k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED - Enable the secp192k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED - Enable the secp224k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED - Enable the secp256k1 elliptic curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED - Enable the Curve25519 curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED - Enable the Ed25519 curve support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED - CC310 SHA-256 hash functionality. - - -// CC310 backend implementation for hardware-accelerated SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED - CC310 SHA-512 hash functionality - - -// CC310 backend implementation for SHA-512 (in software). - -#ifndef NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED - CC310 HMAC using SHA-256 - - -// CC310 backend implementation for HMAC using hardware-accelerated SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED - CC310 HMAC using SHA-512 - - -// CC310 backend implementation for HMAC using SHA-512 (in software). - -#ifndef NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED - Enable RNG support using CC310. - - -#ifndef NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED - Enable Interrupts while support using CC310. - - -// Select a library version compatible with the configuration. When interrupts are disable, a version named _noint must be used - -#ifndef NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED -#define NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_CIFRA_ENABLED - Enable the Cifra backend. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_CIFRA_ENABLED -#define NRF_CRYPTO_BACKEND_CIFRA_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED - Enable the AES EAX mode using Cifra. - - -#ifndef NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED -#define NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED - Enable the mbed TLS backend. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED - Enable the AES CBC mode mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED - Enable the AES CTR mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED - Enable the AES CFB mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED - Enable the AES ECB mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED - Enable the AES CBC MAC mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED - Enable the AES CMAC mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED - Enable the AES CCM mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED - Enable the AES GCM mode using mbed TLS. - - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED - Enable secp192r1 (NIST 192-bit) curve - - -// Enable this setting if you need secp192r1 (NIST 192-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED - Enable secp224r1 (NIST 224-bit) curve - - -// Enable this setting if you need secp224r1 (NIST 224-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED - Enable secp256r1 (NIST 256-bit) curve - - -// Enable this setting if you need secp256r1 (NIST 256-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED - Enable secp384r1 (NIST 384-bit) curve - - -// Enable this setting if you need secp384r1 (NIST 384-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED - Enable secp521r1 (NIST 521-bit) curve - - -// Enable this setting if you need secp521r1 (NIST 521-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED - Enable secp192k1 (Koblitz 192-bit) curve - - -// Enable this setting if you need secp192k1 (Koblitz 192-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED - Enable secp224k1 (Koblitz 224-bit) curve - - -// Enable this setting if you need secp224k1 (Koblitz 224-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED - Enable secp256k1 (Koblitz 256-bit) curve - - -// Enable this setting if you need secp256k1 (Koblitz 256-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED - Enable bp256r1 (Brainpool 256-bit) curve - - -// Enable this setting if you need bp256r1 (Brainpool 256-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED - Enable bp384r1 (Brainpool 384-bit) curve - - -// Enable this setting if you need bp384r1 (Brainpool 384-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED - Enable bp512r1 (Brainpool 512-bit) curve - - -// Enable this setting if you need bp512r1 (Brainpool 512-bit) support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED - Enable Curve25519 curve - - -// Enable this setting if you need Curve25519 support using MBEDTLS - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED - Enable mbed TLS SHA-256 hash functionality. - - -// mbed TLS backend implementation for SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED - Enable mbed TLS SHA-512 hash functionality. - - -// mbed TLS backend implementation for SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED - Enable mbed TLS HMAC using SHA-256. - - -// mbed TLS backend implementation for HMAC using SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED - Enable mbed TLS HMAC using SHA-512. - - -// mbed TLS backend implementation for HMAC using SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED - Enable the micro-ecc backend. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED - Enable secp192r1 (NIST 192-bit) curve - - -// Enable this setting if you need secp192r1 (NIST 192-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED - Enable secp224r1 (NIST 224-bit) curve - - -// Enable this setting if you need secp224r1 (NIST 224-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED - Enable secp256r1 (NIST 256-bit) curve - - -// Enable this setting if you need secp256r1 (NIST 256-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED - Enable secp256k1 (Koblitz 256-bit) curve - - -// Enable this setting if you need secp256k1 (Koblitz 256-bit) support using micro-ecc - -#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED -#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED - Enable the nRF HW RNG backend. - -// The nRF HW backend provide access to RNG peripheral in nRF5x devices. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED - Enable mbed TLS CTR-DRBG algorithm. - - -// Enable mbed TLS CTR-DRBG standardized by NIST (NIST SP 800-90A Rev. 1). The nRF HW RNG is used as an entropy source for seeding. - -#ifndef NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_NRF_SW_ENABLED - Enable the legacy nRFx sw for crypto. - -// The nRF SW cryptography backend (only used in bootloader context). -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_NRF_SW_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_SW_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED - nRF SW hash backend support for SHA-256 - - -// The nRF SW backend provide access to nRF SDK legacy hash implementation of SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_OBERON_ENABLED - Enable the Oberon backend - -// The Oberon backend -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_OBERON_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED - Enable the CHACHA-POLY mode using Oberon. - - -#ifndef NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED - Enable secp256r1 curve - - -// Enable this setting if you need secp256r1 curve support using Oberon library - -#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED - Enable Curve25519 ECDH - - -// Enable this setting if you need Curve25519 ECDH support using Oberon library - -#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED - Enable Ed25519 signature scheme - - -// Enable this setting if you need Ed25519 support using Oberon library - -#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED - Oberon SHA-256 hash functionality - - -// Oberon backend implementation for SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED - Oberon SHA-512 hash functionality - - -// Oberon backend implementation for SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED - Oberon HMAC using SHA-256 - - -// Oberon backend implementation for HMAC using SHA-256. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED 1 -#endif - -// NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED - Oberon HMAC using SHA-512 - - -// Oberon backend implementation for HMAC using SHA-512. - -#ifndef NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED -#define NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_BACKEND_OPTIGA_ENABLED - Enable the nrf_crypto Optiga Trust X backend. - -// Enables the nrf_crypto backend for Optiga Trust X devices. -//========================================================== -#ifndef NRF_CRYPTO_BACKEND_OPTIGA_ENABLED -#define NRF_CRYPTO_BACKEND_OPTIGA_ENABLED 0 -#endif -// NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED - Optiga backend support for RNG - - -// The Optiga backend provide external chip RNG. - -#ifndef NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED -#define NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED 0 -#endif - -// NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED - Optiga backend support for ECC secp256r1 - - -// The Optiga backend provide external chip ECC using secp256r1. - -#ifndef NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED -#define NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED 1 -#endif - -// - -// NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED - Big-endian byte order in raw Curve25519 data - - -// Enable big-endian byte order in Curve25519 API, if set to 1. Use little-endian, if set to 0. - -#ifndef NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED -#define NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED 0 -#endif - -// - -// -//========================================================== - -// nRF_DFU - -//========================================================== -// ble_dfu - Device Firmware Update - -//========================================================== -// BLE_DFU_ENABLED - Enable DFU Service. - - -#ifndef BLE_DFU_ENABLED -#define BLE_DFU_ENABLED 0 -#endif - -// NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS - Buttonless DFU supports bonds. - - -#ifndef NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS -#define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 0 -#endif - -// -//========================================================== - -// -//========================================================== - -// nRF_Drivers - -//========================================================== -// COMP_ENABLED - nrf_drv_comp - COMP peripheral driver - legacy layer -//========================================================== -#ifndef COMP_ENABLED -#define COMP_ENABLED 0 -#endif -// COMP_CONFIG_REF - Reference voltage - -// <0=> Internal 1.2V -// <1=> Internal 1.8V -// <2=> Internal 2.4V -// <4=> VDD -// <7=> ARef - -#ifndef COMP_CONFIG_REF -#define COMP_CONFIG_REF 1 -#endif - -// COMP_CONFIG_MAIN_MODE - Main mode - -// <0=> Single ended -// <1=> Differential - -#ifndef COMP_CONFIG_MAIN_MODE -#define COMP_CONFIG_MAIN_MODE 0 -#endif - -// COMP_CONFIG_SPEED_MODE - Speed mode - -// <0=> Low power -// <1=> Normal -// <2=> High speed - -#ifndef COMP_CONFIG_SPEED_MODE -#define COMP_CONFIG_SPEED_MODE 2 -#endif - -// COMP_CONFIG_HYST - Hystheresis - -// <0=> No -// <1=> 50mV - -#ifndef COMP_CONFIG_HYST -#define COMP_CONFIG_HYST 0 -#endif - -// COMP_CONFIG_ISOURCE - Current Source - -// <0=> Off -// <1=> 2.5 uA -// <2=> 5 uA -// <3=> 10 uA - -#ifndef COMP_CONFIG_ISOURCE -#define COMP_CONFIG_ISOURCE 0 -#endif - -// COMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef COMP_CONFIG_INPUT -#define COMP_CONFIG_INPUT 0 -#endif - -// COMP_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef COMP_CONFIG_IRQ_PRIORITY -#define COMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// EGU_ENABLED - nrf_drv_swi - SWI(EGU) peripheral driver - legacy layer - - -#ifndef EGU_ENABLED -#define EGU_ENABLED 0 -#endif - -// GPIOTE_ENABLED - nrf_drv_gpiote - GPIOTE peripheral driver - legacy layer -//========================================================== -#ifndef GPIOTE_ENABLED -#define GPIOTE_ENABLED 0 -#endif -// GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins -#ifndef GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS -#define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1 -#endif - -// GPIOTE_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef GPIOTE_CONFIG_IRQ_PRIORITY -#define GPIOTE_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// I2S_ENABLED - nrf_drv_i2s - I2S peripheral driver - legacy layer -//========================================================== -#ifndef I2S_ENABLED -#define I2S_ENABLED 0 -#endif -// I2S_CONFIG_SCK_PIN - SCK pin <0-31> - - -#ifndef I2S_CONFIG_SCK_PIN -#define I2S_CONFIG_SCK_PIN 31 -#endif - -// I2S_CONFIG_LRCK_PIN - LRCK pin <1-31> - - -#ifndef I2S_CONFIG_LRCK_PIN -#define I2S_CONFIG_LRCK_PIN 30 -#endif - -// I2S_CONFIG_MCK_PIN - MCK pin -#ifndef I2S_CONFIG_MCK_PIN -#define I2S_CONFIG_MCK_PIN 255 -#endif - -// I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31> - - -#ifndef I2S_CONFIG_SDOUT_PIN -#define I2S_CONFIG_SDOUT_PIN 29 -#endif - -// I2S_CONFIG_SDIN_PIN - SDIN pin <0-31> - - -#ifndef I2S_CONFIG_SDIN_PIN -#define I2S_CONFIG_SDIN_PIN 28 -#endif - -// I2S_CONFIG_MASTER - Mode - -// <0=> Master -// <1=> Slave - -#ifndef I2S_CONFIG_MASTER -#define I2S_CONFIG_MASTER 0 -#endif - -// I2S_CONFIG_FORMAT - Format - -// <0=> I2S -// <1=> Aligned - -#ifndef I2S_CONFIG_FORMAT -#define I2S_CONFIG_FORMAT 0 -#endif - -// I2S_CONFIG_ALIGN - Alignment - -// <0=> Left -// <1=> Right - -#ifndef I2S_CONFIG_ALIGN -#define I2S_CONFIG_ALIGN 0 -#endif - -// I2S_CONFIG_SWIDTH - Sample width (bits) - -// <0=> 8 -// <1=> 16 -// <2=> 24 - -#ifndef I2S_CONFIG_SWIDTH -#define I2S_CONFIG_SWIDTH 1 -#endif - -// I2S_CONFIG_CHANNELS - Channels - -// <0=> Stereo -// <1=> Left -// <2=> Right - -#ifndef I2S_CONFIG_CHANNELS -#define I2S_CONFIG_CHANNELS 1 -#endif - -// I2S_CONFIG_MCK_SETUP - MCK behavior - -// <0=> Disabled -// <2147483648=> 32MHz/2 -// <1342177280=> 32MHz/3 -// <1073741824=> 32MHz/4 -// <805306368=> 32MHz/5 -// <671088640=> 32MHz/6 -// <536870912=> 32MHz/8 -// <402653184=> 32MHz/10 -// <369098752=> 32MHz/11 -// <285212672=> 32MHz/15 -// <268435456=> 32MHz/16 -// <201326592=> 32MHz/21 -// <184549376=> 32MHz/23 -// <142606336=> 32MHz/30 -// <138412032=> 32MHz/31 -// <134217728=> 32MHz/32 -// <100663296=> 32MHz/42 -// <68157440=> 32MHz/63 -// <34340864=> 32MHz/125 - -#ifndef I2S_CONFIG_MCK_SETUP -#define I2S_CONFIG_MCK_SETUP 536870912 -#endif - -// I2S_CONFIG_RATIO - MCK/LRCK ratio - -// <0=> 32x -// <1=> 48x -// <2=> 64x -// <3=> 96x -// <4=> 128x -// <5=> 192x -// <6=> 256x -// <7=> 384x -// <8=> 512x - -#ifndef I2S_CONFIG_RATIO -#define I2S_CONFIG_RATIO 2000 -#endif - -// I2S_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef I2S_CONFIG_IRQ_PRIORITY -#define I2S_CONFIG_IRQ_PRIORITY 6 -#endif - -// I2S_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef I2S_CONFIG_LOG_ENABLED -#define I2S_CONFIG_LOG_ENABLED 0 -#endif -// I2S_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef I2S_CONFIG_LOG_LEVEL -#define I2S_CONFIG_LOG_LEVEL 3 -#endif - -// I2S_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef I2S_CONFIG_INFO_COLOR -#define I2S_CONFIG_INFO_COLOR 0 -#endif - -// I2S_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef I2S_CONFIG_DEBUG_COLOR -#define I2S_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// LPCOMP_ENABLED - nrf_drv_lpcomp - LPCOMP peripheral driver - legacy layer -//========================================================== -#ifndef LPCOMP_ENABLED -#define LPCOMP_ENABLED 0 -#endif -// LPCOMP_CONFIG_REFERENCE - Reference voltage - -// <0=> Supply 1/8 -// <1=> Supply 2/8 -// <2=> Supply 3/8 -// <3=> Supply 4/8 -// <4=> Supply 5/8 -// <5=> Supply 6/8 -// <6=> Supply 7/8 -// <8=> Supply 1/16 (nRF52) -// <9=> Supply 3/16 (nRF52) -// <10=> Supply 5/16 (nRF52) -// <11=> Supply 7/16 (nRF52) -// <12=> Supply 9/16 (nRF52) -// <13=> Supply 11/16 (nRF52) -// <14=> Supply 13/16 (nRF52) -// <15=> Supply 15/16 (nRF52) -// <7=> External Ref 0 -// <65543=> External Ref 1 - -#ifndef LPCOMP_CONFIG_REFERENCE -#define LPCOMP_CONFIG_REFERENCE 3 -#endif - -// LPCOMP_CONFIG_DETECTION - Detection - -// <0=> Crossing -// <1=> Up -// <2=> Down - -#ifndef LPCOMP_CONFIG_DETECTION -#define LPCOMP_CONFIG_DETECTION 2 -#endif - -// LPCOMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef LPCOMP_CONFIG_INPUT -#define LPCOMP_CONFIG_INPUT 0 -#endif - -// LPCOMP_CONFIG_HYST - Hysteresis - - -#ifndef LPCOMP_CONFIG_HYST -#define LPCOMP_CONFIG_HYST 0 -#endif - -// LPCOMP_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef LPCOMP_CONFIG_IRQ_PRIORITY -#define LPCOMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// NRFX_CLOCK_ENABLED - nrfx_clock - CLOCK peripheral driver -//========================================================== -#ifndef NRFX_CLOCK_ENABLED -#define NRFX_CLOCK_ENABLED 0 -#endif -// NRFX_CLOCK_CONFIG_LF_SRC - LF Clock Source - -// <0=> RC -// <1=> XTAL -// <2=> Synth -// <131073=> External Low Swing -// <196609=> External Full Swing - -#ifndef NRFX_CLOCK_CONFIG_LF_SRC -#define NRFX_CLOCK_CONFIG_LF_SRC 1 -#endif - -// NRFX_CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_CLOCK_CONFIG_IRQ_PRIORITY -#define NRFX_CLOCK_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_CLOCK_CONFIG_LOG_ENABLED -#define NRFX_CLOCK_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_CLOCK_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_CLOCK_CONFIG_LOG_LEVEL -#define NRFX_CLOCK_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_CLOCK_CONFIG_INFO_COLOR -#define NRFX_CLOCK_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_CLOCK_CONFIG_DEBUG_COLOR -#define NRFX_CLOCK_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_COMP_ENABLED - nrfx_comp - COMP peripheral driver -//========================================================== -#ifndef NRFX_COMP_ENABLED -#define NRFX_COMP_ENABLED 0 -#endif -// NRFX_COMP_CONFIG_REF - Reference voltage - -// <0=> Internal 1.2V -// <1=> Internal 1.8V -// <2=> Internal 2.4V -// <4=> VDD -// <7=> ARef - -#ifndef NRFX_COMP_CONFIG_REF -#define NRFX_COMP_CONFIG_REF 1 -#endif - -// NRFX_COMP_CONFIG_MAIN_MODE - Main mode - -// <0=> Single ended -// <1=> Differential - -#ifndef NRFX_COMP_CONFIG_MAIN_MODE -#define NRFX_COMP_CONFIG_MAIN_MODE 0 -#endif - -// NRFX_COMP_CONFIG_SPEED_MODE - Speed mode - -// <0=> Low power -// <1=> Normal -// <2=> High speed - -#ifndef NRFX_COMP_CONFIG_SPEED_MODE -#define NRFX_COMP_CONFIG_SPEED_MODE 2 -#endif - -// NRFX_COMP_CONFIG_HYST - Hystheresis - -// <0=> No -// <1=> 50mV - -#ifndef NRFX_COMP_CONFIG_HYST -#define NRFX_COMP_CONFIG_HYST 0 -#endif - -// NRFX_COMP_CONFIG_ISOURCE - Current Source - -// <0=> Off -// <1=> 2.5 uA -// <2=> 5 uA -// <3=> 10 uA - -#ifndef NRFX_COMP_CONFIG_ISOURCE -#define NRFX_COMP_CONFIG_ISOURCE 0 -#endif - -// NRFX_COMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_COMP_CONFIG_INPUT -#define NRFX_COMP_CONFIG_INPUT 0 -#endif - -// NRFX_COMP_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_COMP_CONFIG_IRQ_PRIORITY -#define NRFX_COMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_COMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_COMP_CONFIG_LOG_ENABLED -#define NRFX_COMP_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_COMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_COMP_CONFIG_LOG_LEVEL -#define NRFX_COMP_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_COMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_COMP_CONFIG_INFO_COLOR -#define NRFX_COMP_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_COMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_COMP_CONFIG_DEBUG_COLOR -#define NRFX_COMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_GPIOTE_ENABLED - nrfx_gpiote - GPIOTE peripheral driver -//========================================================== -#ifndef NRFX_GPIOTE_ENABLED -#define NRFX_GPIOTE_ENABLED 0 -#endif -// NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins -#ifndef NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS -#define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1 -#endif - -// NRFX_GPIOTE_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_GPIOTE_CONFIG_IRQ_PRIORITY -#define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_GPIOTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_GPIOTE_CONFIG_LOG_ENABLED -#define NRFX_GPIOTE_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_GPIOTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_GPIOTE_CONFIG_LOG_LEVEL -#define NRFX_GPIOTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_GPIOTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_GPIOTE_CONFIG_INFO_COLOR -#define NRFX_GPIOTE_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_GPIOTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_GPIOTE_CONFIG_DEBUG_COLOR -#define NRFX_GPIOTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_I2S_ENABLED - nrfx_i2s - I2S peripheral driver -//========================================================== -#ifndef NRFX_I2S_ENABLED -#define NRFX_I2S_ENABLED 0 -#endif -// NRFX_I2S_CONFIG_SCK_PIN - SCK pin <0-31> - - -#ifndef NRFX_I2S_CONFIG_SCK_PIN -#define NRFX_I2S_CONFIG_SCK_PIN 31 -#endif - -// NRFX_I2S_CONFIG_LRCK_PIN - LRCK pin <1-31> - - -#ifndef NRFX_I2S_CONFIG_LRCK_PIN -#define NRFX_I2S_CONFIG_LRCK_PIN 30 -#endif - -// NRFX_I2S_CONFIG_MCK_PIN - MCK pin -#ifndef NRFX_I2S_CONFIG_MCK_PIN -#define NRFX_I2S_CONFIG_MCK_PIN 255 -#endif - -// NRFX_I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31> - - -#ifndef NRFX_I2S_CONFIG_SDOUT_PIN -#define NRFX_I2S_CONFIG_SDOUT_PIN 29 -#endif - -// NRFX_I2S_CONFIG_SDIN_PIN - SDIN pin <0-31> - - -#ifndef NRFX_I2S_CONFIG_SDIN_PIN -#define NRFX_I2S_CONFIG_SDIN_PIN 28 -#endif - -// NRFX_I2S_CONFIG_MASTER - Mode - -// <0=> Master -// <1=> Slave - -#ifndef NRFX_I2S_CONFIG_MASTER -#define NRFX_I2S_CONFIG_MASTER 0 -#endif - -// NRFX_I2S_CONFIG_FORMAT - Format - -// <0=> I2S -// <1=> Aligned - -#ifndef NRFX_I2S_CONFIG_FORMAT -#define NRFX_I2S_CONFIG_FORMAT 0 -#endif - -// NRFX_I2S_CONFIG_ALIGN - Alignment - -// <0=> Left -// <1=> Right - -#ifndef NRFX_I2S_CONFIG_ALIGN -#define NRFX_I2S_CONFIG_ALIGN 0 -#endif - -// NRFX_I2S_CONFIG_SWIDTH - Sample width (bits) - -// <0=> 8 -// <1=> 16 -// <2=> 24 - -#ifndef NRFX_I2S_CONFIG_SWIDTH -#define NRFX_I2S_CONFIG_SWIDTH 1 -#endif - -// NRFX_I2S_CONFIG_CHANNELS - Channels - -// <0=> Stereo -// <1=> Left -// <2=> Right - -#ifndef NRFX_I2S_CONFIG_CHANNELS -#define NRFX_I2S_CONFIG_CHANNELS 1 -#endif - -// NRFX_I2S_CONFIG_MCK_SETUP - MCK behavior - -// <0=> Disabled -// <2147483648=> 32MHz/2 -// <1342177280=> 32MHz/3 -// <1073741824=> 32MHz/4 -// <805306368=> 32MHz/5 -// <671088640=> 32MHz/6 -// <536870912=> 32MHz/8 -// <402653184=> 32MHz/10 -// <369098752=> 32MHz/11 -// <285212672=> 32MHz/15 -// <268435456=> 32MHz/16 -// <201326592=> 32MHz/21 -// <184549376=> 32MHz/23 -// <142606336=> 32MHz/30 -// <138412032=> 32MHz/31 -// <134217728=> 32MHz/32 -// <100663296=> 32MHz/42 -// <68157440=> 32MHz/63 -// <34340864=> 32MHz/125 - -#ifndef NRFX_I2S_CONFIG_MCK_SETUP -#define NRFX_I2S_CONFIG_MCK_SETUP 536870912 -#endif - -// NRFX_I2S_CONFIG_RATIO - MCK/LRCK ratio - -// <0=> 32x -// <1=> 48x -// <2=> 64x -// <3=> 96x -// <4=> 128x -// <5=> 192x -// <6=> 256x -// <7=> 384x -// <8=> 512x - -#ifndef NRFX_I2S_CONFIG_RATIO -#define NRFX_I2S_CONFIG_RATIO 2000 -#endif - -// NRFX_I2S_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_I2S_CONFIG_IRQ_PRIORITY -#define NRFX_I2S_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_I2S_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_I2S_CONFIG_LOG_ENABLED -#define NRFX_I2S_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_I2S_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_I2S_CONFIG_LOG_LEVEL -#define NRFX_I2S_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_I2S_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_I2S_CONFIG_INFO_COLOR -#define NRFX_I2S_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_I2S_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_I2S_CONFIG_DEBUG_COLOR -#define NRFX_I2S_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_LPCOMP_ENABLED - nrfx_lpcomp - LPCOMP peripheral driver -//========================================================== -#ifndef NRFX_LPCOMP_ENABLED -#define NRFX_LPCOMP_ENABLED 0 -#endif -// NRFX_LPCOMP_CONFIG_REFERENCE - Reference voltage - -// <0=> Supply 1/8 -// <1=> Supply 2/8 -// <2=> Supply 3/8 -// <3=> Supply 4/8 -// <4=> Supply 5/8 -// <5=> Supply 6/8 -// <6=> Supply 7/8 -// <8=> Supply 1/16 (nRF52) -// <9=> Supply 3/16 (nRF52) -// <10=> Supply 5/16 (nRF52) -// <11=> Supply 7/16 (nRF52) -// <12=> Supply 9/16 (nRF52) -// <13=> Supply 11/16 (nRF52) -// <14=> Supply 13/16 (nRF52) -// <15=> Supply 15/16 (nRF52) -// <7=> External Ref 0 -// <65543=> External Ref 1 - -#ifndef NRFX_LPCOMP_CONFIG_REFERENCE -#define NRFX_LPCOMP_CONFIG_REFERENCE 3 -#endif - -// NRFX_LPCOMP_CONFIG_DETECTION - Detection - -// <0=> Crossing -// <1=> Up -// <2=> Down - -#ifndef NRFX_LPCOMP_CONFIG_DETECTION -#define NRFX_LPCOMP_CONFIG_DETECTION 2 -#endif - -// NRFX_LPCOMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_LPCOMP_CONFIG_INPUT -#define NRFX_LPCOMP_CONFIG_INPUT 0 -#endif - -// NRFX_LPCOMP_CONFIG_HYST - Hysteresis - - -#ifndef NRFX_LPCOMP_CONFIG_HYST -#define NRFX_LPCOMP_CONFIG_HYST 0 -#endif - -// NRFX_LPCOMP_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_LPCOMP_CONFIG_IRQ_PRIORITY -#define NRFX_LPCOMP_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_LPCOMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_LPCOMP_CONFIG_LOG_ENABLED -#define NRFX_LPCOMP_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_LPCOMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_LPCOMP_CONFIG_LOG_LEVEL -#define NRFX_LPCOMP_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_LPCOMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_LPCOMP_CONFIG_INFO_COLOR -#define NRFX_LPCOMP_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_LPCOMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_LPCOMP_CONFIG_DEBUG_COLOR -#define NRFX_LPCOMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_NFCT_ENABLED - nrfx_nfct - NFCT peripheral driver -//========================================================== -#ifndef NRFX_NFCT_ENABLED -#define NRFX_NFCT_ENABLED 0 -#endif -// NRFX_NFCT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_NFCT_CONFIG_IRQ_PRIORITY -#define NRFX_NFCT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_NFCT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_NFCT_CONFIG_LOG_ENABLED -#define NRFX_NFCT_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_NFCT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_NFCT_CONFIG_LOG_LEVEL -#define NRFX_NFCT_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_NFCT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_NFCT_CONFIG_INFO_COLOR -#define NRFX_NFCT_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_NFCT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_NFCT_CONFIG_DEBUG_COLOR -#define NRFX_NFCT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_PDM_ENABLED - nrfx_pdm - PDM peripheral driver -//========================================================== -#ifndef NRFX_PDM_ENABLED -#define NRFX_PDM_ENABLED 0 -#endif -// NRFX_PDM_CONFIG_MODE - Mode - -// <0=> Stereo -// <1=> Mono - -#ifndef NRFX_PDM_CONFIG_MODE -#define NRFX_PDM_CONFIG_MODE 1 -#endif - -// NRFX_PDM_CONFIG_EDGE - Edge - -// <0=> Left falling -// <1=> Left rising - -#ifndef NRFX_PDM_CONFIG_EDGE -#define NRFX_PDM_CONFIG_EDGE 0 -#endif - -// NRFX_PDM_CONFIG_CLOCK_FREQ - Clock frequency - -// <134217728=> 1000k -// <138412032=> 1032k (default) -// <142606336=> 1067k - -#ifndef NRFX_PDM_CONFIG_CLOCK_FREQ -#define NRFX_PDM_CONFIG_CLOCK_FREQ 138412032 -#endif - -// NRFX_PDM_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_PDM_CONFIG_IRQ_PRIORITY -#define NRFX_PDM_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_PDM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_PDM_CONFIG_LOG_ENABLED -#define NRFX_PDM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_PDM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_PDM_CONFIG_LOG_LEVEL -#define NRFX_PDM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_PDM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PDM_CONFIG_INFO_COLOR -#define NRFX_PDM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_PDM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PDM_CONFIG_DEBUG_COLOR -#define NRFX_PDM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_POWER_ENABLED - nrfx_power - POWER peripheral driver -//========================================================== -#ifndef NRFX_POWER_ENABLED -#define NRFX_POWER_ENABLED 1 -#endif -// NRFX_POWER_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_POWER_CONFIG_IRQ_PRIORITY -#define NRFX_POWER_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCEN -#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 0 -#endif - -// NRFX_POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCENHV -#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0 -#endif - -// - -// NRFX_PPI_ENABLED - nrfx_ppi - PPI peripheral allocator -//========================================================== -#ifndef NRFX_PPI_ENABLED -#define NRFX_PPI_ENABLED 0 -#endif -// NRFX_PPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_PPI_CONFIG_LOG_ENABLED -#define NRFX_PPI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_PPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_PPI_CONFIG_LOG_LEVEL -#define NRFX_PPI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_PPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PPI_CONFIG_INFO_COLOR -#define NRFX_PPI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_PPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PPI_CONFIG_DEBUG_COLOR -#define NRFX_PPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_PWM_ENABLED - nrfx_pwm - PWM peripheral driver -//========================================================== -#ifndef NRFX_PWM_ENABLED -#define NRFX_PWM_ENABLED 0 -#endif -// NRFX_PWM0_ENABLED - Enable PWM0 instance - - -#ifndef NRFX_PWM0_ENABLED -#define NRFX_PWM0_ENABLED 0 -#endif - -// NRFX_PWM1_ENABLED - Enable PWM1 instance - - -#ifndef NRFX_PWM1_ENABLED -#define NRFX_PWM1_ENABLED 0 -#endif - -// NRFX_PWM2_ENABLED - Enable PWM2 instance - - -#ifndef NRFX_PWM2_ENABLED -#define NRFX_PWM2_ENABLED 0 -#endif - -// NRFX_PWM3_ENABLED - Enable PWM3 instance - - -#ifndef NRFX_PWM3_ENABLED -#define NRFX_PWM3_ENABLED 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31> - - -#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN 31 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK - Base clock - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz - -#ifndef NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK -#define NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK 4 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE - Count mode - -// <0=> Up -// <1=> Up and Down - -#ifndef NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE -#define NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE - Top value -#ifndef NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE -#define NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE 1000 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE - Load mode - -// <0=> Common -// <1=> Grouped -// <2=> Individual -// <3=> Waveform - -#ifndef NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE -#define NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_STEP_MODE - Step mode - -// <0=> Auto -// <1=> Triggered - -#ifndef NRFX_PWM_DEFAULT_CONFIG_STEP_MODE -#define NRFX_PWM_DEFAULT_CONFIG_STEP_MODE 0 -#endif - -// NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_PWM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_PWM_CONFIG_LOG_ENABLED -#define NRFX_PWM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_PWM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_PWM_CONFIG_LOG_LEVEL -#define NRFX_PWM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_PWM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PWM_CONFIG_INFO_COLOR -#define NRFX_PWM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_PWM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_PWM_CONFIG_DEBUG_COLOR -#define NRFX_PWM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_QDEC_ENABLED - nrfx_qdec - QDEC peripheral driver -//========================================================== -#ifndef NRFX_QDEC_ENABLED -#define NRFX_QDEC_ENABLED 0 -#endif -// NRFX_QDEC_CONFIG_REPORTPER - Report period - -// <0=> 10 Samples -// <1=> 40 Samples -// <2=> 80 Samples -// <3=> 120 Samples -// <4=> 160 Samples -// <5=> 200 Samples -// <6=> 240 Samples -// <7=> 280 Samples - -#ifndef NRFX_QDEC_CONFIG_REPORTPER -#define NRFX_QDEC_CONFIG_REPORTPER 0 -#endif - -// NRFX_QDEC_CONFIG_SAMPLEPER - Sample period - -// <0=> 128 us -// <1=> 256 us -// <2=> 512 us -// <3=> 1024 us -// <4=> 2048 us -// <5=> 4096 us -// <6=> 8192 us -// <7=> 16384 us - -#ifndef NRFX_QDEC_CONFIG_SAMPLEPER -#define NRFX_QDEC_CONFIG_SAMPLEPER 7 -#endif - -// NRFX_QDEC_CONFIG_PIO_A - A pin <0-31> - - -#ifndef NRFX_QDEC_CONFIG_PIO_A -#define NRFX_QDEC_CONFIG_PIO_A 31 -#endif - -// NRFX_QDEC_CONFIG_PIO_B - B pin <0-31> - - -#ifndef NRFX_QDEC_CONFIG_PIO_B -#define NRFX_QDEC_CONFIG_PIO_B 31 -#endif - -// NRFX_QDEC_CONFIG_PIO_LED - LED pin <0-31> - - -#ifndef NRFX_QDEC_CONFIG_PIO_LED -#define NRFX_QDEC_CONFIG_PIO_LED 31 -#endif - -// NRFX_QDEC_CONFIG_LEDPRE - LED pre -#ifndef NRFX_QDEC_CONFIG_LEDPRE -#define NRFX_QDEC_CONFIG_LEDPRE 511 -#endif - -// NRFX_QDEC_CONFIG_LEDPOL - LED polarity - -// <0=> Active low -// <1=> Active high - -#ifndef NRFX_QDEC_CONFIG_LEDPOL -#define NRFX_QDEC_CONFIG_LEDPOL 1 -#endif - -// NRFX_QDEC_CONFIG_DBFEN - Debouncing enable - - -#ifndef NRFX_QDEC_CONFIG_DBFEN -#define NRFX_QDEC_CONFIG_DBFEN 0 -#endif - -// NRFX_QDEC_CONFIG_SAMPLE_INTEN - Sample ready interrupt enable - - -#ifndef NRFX_QDEC_CONFIG_SAMPLE_INTEN -#define NRFX_QDEC_CONFIG_SAMPLE_INTEN 0 -#endif - -// NRFX_QDEC_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_QDEC_CONFIG_IRQ_PRIORITY -#define NRFX_QDEC_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_QDEC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_QDEC_CONFIG_LOG_ENABLED -#define NRFX_QDEC_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_QDEC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_QDEC_CONFIG_LOG_LEVEL -#define NRFX_QDEC_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_QDEC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_QDEC_CONFIG_INFO_COLOR -#define NRFX_QDEC_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_QDEC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_QDEC_CONFIG_DEBUG_COLOR -#define NRFX_QDEC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_QSPI_ENABLED - nrfx_qspi - QSPI peripheral driver -//========================================================== -#ifndef NRFX_QSPI_ENABLED -#define NRFX_QSPI_ENABLED 0 -#endif -// NRFX_QSPI_CONFIG_SCK_DELAY - tSHSL, tWHSL and tSHWL in number of 16 MHz periods (62.5 ns). <0-255> - - -#ifndef NRFX_QSPI_CONFIG_SCK_DELAY -#define NRFX_QSPI_CONFIG_SCK_DELAY 1 -#endif - -// NRFX_QSPI_CONFIG_XIP_OFFSET - Address offset in the external memory for Execute in Place operation. -#ifndef NRFX_QSPI_CONFIG_XIP_OFFSET -#define NRFX_QSPI_CONFIG_XIP_OFFSET 0 -#endif - -// NRFX_QSPI_CONFIG_READOC - Number of data lines and opcode used for reading. - -// <0=> FastRead -// <1=> Read2O -// <2=> Read2IO -// <3=> Read4O -// <4=> Read4IO - -#ifndef NRFX_QSPI_CONFIG_READOC -#define NRFX_QSPI_CONFIG_READOC 0 -#endif - -// NRFX_QSPI_CONFIG_WRITEOC - Number of data lines and opcode used for writing. - -// <0=> PP -// <1=> PP2O -// <2=> PP4O -// <3=> PP4IO - -#ifndef NRFX_QSPI_CONFIG_WRITEOC -#define NRFX_QSPI_CONFIG_WRITEOC 0 -#endif - -// NRFX_QSPI_CONFIG_ADDRMODE - Addressing mode. - -// <0=> 24bit -// <1=> 32bit - -#ifndef NRFX_QSPI_CONFIG_ADDRMODE -#define NRFX_QSPI_CONFIG_ADDRMODE 0 -#endif - -// NRFX_QSPI_CONFIG_MODE - SPI mode. - -// <0=> Mode 0 -// <1=> Mode 1 - -#ifndef NRFX_QSPI_CONFIG_MODE -#define NRFX_QSPI_CONFIG_MODE 0 -#endif - -// NRFX_QSPI_CONFIG_FREQUENCY - Frequency divider. - -// <0=> 32MHz/1 -// <1=> 32MHz/2 -// <2=> 32MHz/3 -// <3=> 32MHz/4 -// <4=> 32MHz/5 -// <5=> 32MHz/6 -// <6=> 32MHz/7 -// <7=> 32MHz/8 -// <8=> 32MHz/9 -// <9=> 32MHz/10 -// <10=> 32MHz/11 -// <11=> 32MHz/12 -// <12=> 32MHz/13 -// <13=> 32MHz/14 -// <14=> 32MHz/15 -// <15=> 32MHz/16 - -#ifndef NRFX_QSPI_CONFIG_FREQUENCY -#define NRFX_QSPI_CONFIG_FREQUENCY 15 -#endif - -// NRFX_QSPI_PIN_SCK - SCK pin value. -#ifndef NRFX_QSPI_PIN_SCK -#define NRFX_QSPI_PIN_SCK NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// NRFX_QSPI_PIN_CSN - CSN pin value. -#ifndef NRFX_QSPI_PIN_CSN -#define NRFX_QSPI_PIN_CSN NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// NRFX_QSPI_PIN_IO0 - IO0 pin value. -#ifndef NRFX_QSPI_PIN_IO0 -#define NRFX_QSPI_PIN_IO0 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// NRFX_QSPI_PIN_IO1 - IO1 pin value. -#ifndef NRFX_QSPI_PIN_IO1 -#define NRFX_QSPI_PIN_IO1 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// NRFX_QSPI_PIN_IO2 - IO2 pin value. -#ifndef NRFX_QSPI_PIN_IO2 -#define NRFX_QSPI_PIN_IO2 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// NRFX_QSPI_PIN_IO3 - IO3 pin value. -#ifndef NRFX_QSPI_PIN_IO3 -#define NRFX_QSPI_PIN_IO3 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// NRFX_QSPI_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_QSPI_CONFIG_IRQ_PRIORITY -#define NRFX_QSPI_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// NRFX_RNG_ENABLED - nrfx_rng - RNG peripheral driver -//========================================================== -#ifndef NRFX_RNG_ENABLED -#define NRFX_RNG_ENABLED 0 -#endif -// NRFX_RNG_CONFIG_ERROR_CORRECTION - Error correction - - -#ifndef NRFX_RNG_CONFIG_ERROR_CORRECTION -#define NRFX_RNG_CONFIG_ERROR_CORRECTION 1 -#endif - -// NRFX_RNG_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_RNG_CONFIG_IRQ_PRIORITY -#define NRFX_RNG_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_RNG_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_RNG_CONFIG_LOG_ENABLED -#define NRFX_RNG_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_RNG_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_RNG_CONFIG_LOG_LEVEL -#define NRFX_RNG_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_RNG_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RNG_CONFIG_INFO_COLOR -#define NRFX_RNG_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RNG_CONFIG_DEBUG_COLOR -#define NRFX_RNG_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_RTC_ENABLED - nrfx_rtc - RTC peripheral driver -//========================================================== -#ifndef NRFX_RTC_ENABLED -#define NRFX_RTC_ENABLED 0 -#endif -// NRFX_RTC0_ENABLED - Enable RTC0 instance - - -#ifndef NRFX_RTC0_ENABLED -#define NRFX_RTC0_ENABLED 0 -#endif - -// NRFX_RTC1_ENABLED - Enable RTC1 instance - - -#ifndef NRFX_RTC1_ENABLED -#define NRFX_RTC1_ENABLED 0 -#endif - -// NRFX_RTC2_ENABLED - Enable RTC2 instance - - -#ifndef NRFX_RTC2_ENABLED -#define NRFX_RTC2_ENABLED 0 -#endif - -// NRFX_RTC_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt -#ifndef NRFX_RTC_MAXIMUM_LATENCY_US -#define NRFX_RTC_MAXIMUM_LATENCY_US 2000 -#endif - -// NRFX_RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768> - - -#ifndef NRFX_RTC_DEFAULT_CONFIG_FREQUENCY -#define NRFX_RTC_DEFAULT_CONFIG_FREQUENCY 32768 -#endif - -// NRFX_RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering - - -#ifndef NRFX_RTC_DEFAULT_CONFIG_RELIABLE -#define NRFX_RTC_DEFAULT_CONFIG_RELIABLE 0 -#endif - -// NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_RTC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_RTC_CONFIG_LOG_ENABLED -#define NRFX_RTC_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_RTC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_RTC_CONFIG_LOG_LEVEL -#define NRFX_RTC_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_RTC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RTC_CONFIG_INFO_COLOR -#define NRFX_RTC_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_RTC_CONFIG_DEBUG_COLOR -#define NRFX_RTC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SAADC_ENABLED - nrfx_saadc - SAADC peripheral driver -//========================================================== -#ifndef NRFX_SAADC_ENABLED -#define NRFX_SAADC_ENABLED 0 -#endif -// NRFX_SAADC_CONFIG_RESOLUTION - Resolution - -// <0=> 8 bit -// <1=> 10 bit -// <2=> 12 bit -// <3=> 14 bit - -#ifndef NRFX_SAADC_CONFIG_RESOLUTION -#define NRFX_SAADC_CONFIG_RESOLUTION 1 -#endif - -// NRFX_SAADC_CONFIG_OVERSAMPLE - Sample period - -// <0=> Disabled -// <1=> 2x -// <2=> 4x -// <3=> 8x -// <4=> 16x -// <5=> 32x -// <6=> 64x -// <7=> 128x -// <8=> 256x - -#ifndef NRFX_SAADC_CONFIG_OVERSAMPLE -#define NRFX_SAADC_CONFIG_OVERSAMPLE 0 -#endif - -// NRFX_SAADC_CONFIG_LP_MODE - Enabling low power mode - - -#ifndef NRFX_SAADC_CONFIG_LP_MODE -#define NRFX_SAADC_CONFIG_LP_MODE 0 -#endif - -// NRFX_SAADC_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SAADC_CONFIG_IRQ_PRIORITY -#define NRFX_SAADC_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SAADC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SAADC_CONFIG_LOG_ENABLED -#define NRFX_SAADC_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SAADC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SAADC_CONFIG_LOG_LEVEL -#define NRFX_SAADC_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SAADC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SAADC_CONFIG_INFO_COLOR -#define NRFX_SAADC_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SAADC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SAADC_CONFIG_DEBUG_COLOR -#define NRFX_SAADC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SPIM_ENABLED - nrfx_spim - SPIM peripheral driver -//========================================================== -#ifndef NRFX_SPIM_ENABLED -#define NRFX_SPIM_ENABLED 0 -#endif -// NRFX_SPIM0_ENABLED - Enable SPIM0 instance - - -#ifndef NRFX_SPIM0_ENABLED -#define NRFX_SPIM0_ENABLED 0 -#endif - -// NRFX_SPIM1_ENABLED - Enable SPIM1 instance - - -#ifndef NRFX_SPIM1_ENABLED -#define NRFX_SPIM1_ENABLED 0 -#endif - -// NRFX_SPIM2_ENABLED - Enable SPIM2 instance - - -#ifndef NRFX_SPIM2_ENABLED -#define NRFX_SPIM2_ENABLED 0 -#endif - -// NRFX_SPIM3_ENABLED - Enable SPIM3 instance - - -#ifndef NRFX_SPIM3_ENABLED -#define NRFX_SPIM3_ENABLED 0 -#endif - -// NRFX_SPIM_EXTENDED_ENABLED - Enable extended SPIM features - - -#ifndef NRFX_SPIM_EXTENDED_ENABLED -#define NRFX_SPIM_EXTENDED_ENABLED 0 -#endif - -// NRFX_SPIM_MISO_PULL_CFG - MISO pin pull configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP - -#ifndef NRFX_SPIM_MISO_PULL_CFG -#define NRFX_SPIM_MISO_PULL_CFG 1 -#endif - -// NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SPIM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SPIM_CONFIG_LOG_ENABLED -#define NRFX_SPIM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SPIM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SPIM_CONFIG_LOG_LEVEL -#define NRFX_SPIM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SPIM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIM_CONFIG_INFO_COLOR -#define NRFX_SPIM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SPIM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIM_CONFIG_DEBUG_COLOR -#define NRFX_SPIM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SPIS_ENABLED - nrfx_spis - SPIS peripheral driver -//========================================================== -#ifndef NRFX_SPIS_ENABLED -#define NRFX_SPIS_ENABLED 0 -#endif -// NRFX_SPIS0_ENABLED - Enable SPIS0 instance - - -#ifndef NRFX_SPIS0_ENABLED -#define NRFX_SPIS0_ENABLED 0 -#endif - -// NRFX_SPIS1_ENABLED - Enable SPIS1 instance - - -#ifndef NRFX_SPIS1_ENABLED -#define NRFX_SPIS1_ENABLED 0 -#endif - -// NRFX_SPIS2_ENABLED - Enable SPIS2 instance - - -#ifndef NRFX_SPIS2_ENABLED -#define NRFX_SPIS2_ENABLED 0 -#endif - -// NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SPIS_DEFAULT_DEF - SPIS default DEF character <0-255> - - -#ifndef NRFX_SPIS_DEFAULT_DEF -#define NRFX_SPIS_DEFAULT_DEF 255 -#endif - -// NRFX_SPIS_DEFAULT_ORC - SPIS default ORC character <0-255> - - -#ifndef NRFX_SPIS_DEFAULT_ORC -#define NRFX_SPIS_DEFAULT_ORC 255 -#endif - -// NRFX_SPIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SPIS_CONFIG_LOG_ENABLED -#define NRFX_SPIS_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SPIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SPIS_CONFIG_LOG_LEVEL -#define NRFX_SPIS_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SPIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIS_CONFIG_INFO_COLOR -#define NRFX_SPIS_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SPIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPIS_CONFIG_DEBUG_COLOR -#define NRFX_SPIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SPI_ENABLED - nrfx_spi - SPI peripheral driver -//========================================================== -#ifndef NRFX_SPI_ENABLED -#define NRFX_SPI_ENABLED 0 -#endif -// NRFX_SPI0_ENABLED - Enable SPI0 instance - - -#ifndef NRFX_SPI0_ENABLED -#define NRFX_SPI0_ENABLED 0 -#endif - -// NRFX_SPI1_ENABLED - Enable SPI1 instance - - -#ifndef NRFX_SPI1_ENABLED -#define NRFX_SPI1_ENABLED 0 -#endif - -// NRFX_SPI2_ENABLED - Enable SPI2 instance - - -#ifndef NRFX_SPI2_ENABLED -#define NRFX_SPI2_ENABLED 0 -#endif - -// NRFX_SPI_MISO_PULL_CFG - MISO pin pull configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP - -#ifndef NRFX_SPI_MISO_PULL_CFG -#define NRFX_SPI_MISO_PULL_CFG 1 -#endif - -// NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_SPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SPI_CONFIG_LOG_ENABLED -#define NRFX_SPI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SPI_CONFIG_LOG_LEVEL -#define NRFX_SPI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPI_CONFIG_INFO_COLOR -#define NRFX_SPI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SPI_CONFIG_DEBUG_COLOR -#define NRFX_SPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_SWI_ENABLED - nrfx_swi - SWI/EGU peripheral allocator -//========================================================== -#ifndef NRFX_SWI_ENABLED -#define NRFX_SWI_ENABLED 0 -#endif -// NRFX_EGU_ENABLED - Enable EGU support - - -#ifndef NRFX_EGU_ENABLED -#define NRFX_EGU_ENABLED 0 -#endif - -// NRFX_SWI0_DISABLED - Exclude SWI0 from being utilized by the driver - - -#ifndef NRFX_SWI0_DISABLED -#define NRFX_SWI0_DISABLED 0 -#endif - -// NRFX_SWI1_DISABLED - Exclude SWI1 from being utilized by the driver - - -#ifndef NRFX_SWI1_DISABLED -#define NRFX_SWI1_DISABLED 0 -#endif - -// NRFX_SWI2_DISABLED - Exclude SWI2 from being utilized by the driver - - -#ifndef NRFX_SWI2_DISABLED -#define NRFX_SWI2_DISABLED 0 -#endif - -// NRFX_SWI3_DISABLED - Exclude SWI3 from being utilized by the driver - - -#ifndef NRFX_SWI3_DISABLED -#define NRFX_SWI3_DISABLED 0 -#endif - -// NRFX_SWI4_DISABLED - Exclude SWI4 from being utilized by the driver - - -#ifndef NRFX_SWI4_DISABLED -#define NRFX_SWI4_DISABLED 0 -#endif - -// NRFX_SWI5_DISABLED - Exclude SWI5 from being utilized by the driver - - -#ifndef NRFX_SWI5_DISABLED -#define NRFX_SWI5_DISABLED 0 -#endif - -// NRFX_SWI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_SWI_CONFIG_LOG_ENABLED -#define NRFX_SWI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_SWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_SWI_CONFIG_LOG_LEVEL -#define NRFX_SWI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_SWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SWI_CONFIG_INFO_COLOR -#define NRFX_SWI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_SWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_SWI_CONFIG_DEBUG_COLOR -#define NRFX_SWI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver -//========================================================== -#ifndef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED 0 -#endif -// NRFX_TIMER0_ENABLED - Enable TIMER0 instance - - -#ifndef NRFX_TIMER0_ENABLED -#define NRFX_TIMER0_ENABLED 0 -#endif - -// NRFX_TIMER1_ENABLED - Enable TIMER1 instance - - -#ifndef NRFX_TIMER1_ENABLED -#define NRFX_TIMER1_ENABLED 0 -#endif - -// NRFX_TIMER2_ENABLED - Enable TIMER2 instance - - -#ifndef NRFX_TIMER2_ENABLED -#define NRFX_TIMER2_ENABLED 0 -#endif - -// NRFX_TIMER3_ENABLED - Enable TIMER3 instance - - -#ifndef NRFX_TIMER3_ENABLED -#define NRFX_TIMER3_ENABLED 0 -#endif - -// NRFX_TIMER4_ENABLED - Enable TIMER4 instance - - -#ifndef NRFX_TIMER4_ENABLED -#define NRFX_TIMER4_ENABLED 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz -// <8=> 62.5 kHz -// <9=> 31.25 kHz - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation - -// <0=> Timer -// <1=> Counter - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_MODE -#define NRFX_TIMER_DEFAULT_CONFIG_MODE 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width - -// <0=> 16 bit -// <1=> 8 bit -// <2=> 24 bit -// <3=> 32 bit - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH -#define NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH 0 -#endif - -// NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TIMER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TIMER_CONFIG_LOG_ENABLED -#define NRFX_TIMER_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TIMER_CONFIG_LOG_LEVEL -#define NRFX_TIMER_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TIMER_CONFIG_INFO_COLOR -#define NRFX_TIMER_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TIMER_CONFIG_DEBUG_COLOR -#define NRFX_TIMER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TWIM_ENABLED - nrfx_twim - TWIM peripheral driver -//========================================================== -#ifndef NRFX_TWIM_ENABLED -#define NRFX_TWIM_ENABLED 0 -#endif -// NRFX_TWIM0_ENABLED - Enable TWIM0 instance - - -#ifndef NRFX_TWIM0_ENABLED -#define NRFX_TWIM0_ENABLED 0 -#endif - -// NRFX_TWIM1_ENABLED - Enable TWIM1 instance - - -#ifndef NRFX_TWIM1_ENABLED -#define NRFX_TWIM1_ENABLED 0 -#endif - -// NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k - -#ifndef NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY 26738688 -#endif - -// NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - - -#ifndef NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 -#endif - -// NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TWIM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TWIM_CONFIG_LOG_ENABLED -#define NRFX_TWIM_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TWIM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TWIM_CONFIG_LOG_LEVEL -#define NRFX_TWIM_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TWIM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIM_CONFIG_INFO_COLOR -#define NRFX_TWIM_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TWIM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIM_CONFIG_DEBUG_COLOR -#define NRFX_TWIM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TWIS_ENABLED - nrfx_twis - TWIS peripheral driver -//========================================================== -#ifndef NRFX_TWIS_ENABLED -#define NRFX_TWIS_ENABLED 0 -#endif -// NRFX_TWIS0_ENABLED - Enable TWIS0 instance - - -#ifndef NRFX_TWIS0_ENABLED -#define NRFX_TWIS0_ENABLED 0 -#endif - -// NRFX_TWIS1_ENABLED - Enable TWIS1 instance - - -#ifndef NRFX_TWIS1_ENABLED -#define NRFX_TWIS1_ENABLED 0 -#endif - -// NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY - Assume that any instance would be initialized only once - - -// Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code. - -#ifndef NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 -#endif - -// NRFX_TWIS_NO_SYNC_MODE - Remove support for synchronous mode - - -// Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources. - -#ifndef NRFX_TWIS_NO_SYNC_MODE -#define NRFX_TWIS_NO_SYNC_MODE 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_ADDR0 - Address0 -#ifndef NRFX_TWIS_DEFAULT_CONFIG_ADDR0 -#define NRFX_TWIS_DEFAULT_CONFIG_ADDR0 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_ADDR1 - Address1 -#ifndef NRFX_TWIS_DEFAULT_CONFIG_ADDR1 -#define NRFX_TWIS_DEFAULT_CONFIG_ADDR1 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL -#define NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL -#define NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL 0 -#endif - -// NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TWIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TWIS_CONFIG_LOG_ENABLED -#define NRFX_TWIS_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TWIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TWIS_CONFIG_LOG_LEVEL -#define NRFX_TWIS_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TWIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIS_CONFIG_INFO_COLOR -#define NRFX_TWIS_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TWIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWIS_CONFIG_DEBUG_COLOR -#define NRFX_TWIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_TWI_ENABLED - nrfx_twi - TWI peripheral driver -//========================================================== -#ifndef NRFX_TWI_ENABLED -#define NRFX_TWI_ENABLED 0 -#endif -// NRFX_TWI0_ENABLED - Enable TWI0 instance - - -#ifndef NRFX_TWI0_ENABLED -#define NRFX_TWI0_ENABLED 0 -#endif - -// NRFX_TWI1_ENABLED - Enable TWI1 instance - - -#ifndef NRFX_TWI1_ENABLED -#define NRFX_TWI1_ENABLED 0 -#endif - -// NRFX_TWI_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k - -#ifndef NRFX_TWI_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TWI_DEFAULT_CONFIG_FREQUENCY 26738688 -#endif - -// NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - - -#ifndef NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 -#endif - -// NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_TWI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_TWI_CONFIG_LOG_ENABLED -#define NRFX_TWI_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_TWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_TWI_CONFIG_LOG_LEVEL -#define NRFX_TWI_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_TWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWI_CONFIG_INFO_COLOR -#define NRFX_TWI_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_TWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_TWI_CONFIG_DEBUG_COLOR -#define NRFX_TWI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_UARTE_ENABLED - nrfx_uarte - UARTE peripheral driver -//========================================================== -#ifndef NRFX_UARTE_ENABLED -#define NRFX_UARTE_ENABLED 0 -#endif -// NRFX_UARTE0_ENABLED - Enable UARTE0 instance -#ifndef NRFX_UARTE0_ENABLED -#define NRFX_UARTE0_ENABLED 0 -#endif - -// NRFX_UARTE1_ENABLED - Enable UARTE1 instance -#ifndef NRFX_UARTE1_ENABLED -#define NRFX_UARTE1_ENABLED 0 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_HWFC -#define NRFX_UARTE_DEFAULT_CONFIG_HWFC 0 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_PARITY -#define NRFX_UARTE_DEFAULT_CONFIG_PARITY 0 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <8388608=> 31250 baud -// <10289152=> 38400 baud -// <15007744=> 56000 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE -#define NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE 30801920 -#endif - -// NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_UARTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_UARTE_CONFIG_LOG_ENABLED -#define NRFX_UARTE_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_UARTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_UARTE_CONFIG_LOG_LEVEL -#define NRFX_UARTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_UARTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UARTE_CONFIG_INFO_COLOR -#define NRFX_UARTE_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_UARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UARTE_CONFIG_DEBUG_COLOR -#define NRFX_UARTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_UART_ENABLED - nrfx_uart - UART peripheral driver -//========================================================== -#ifndef NRFX_UART_ENABLED -#define NRFX_UART_ENABLED 0 -#endif -// NRFX_UART0_ENABLED - Enable UART0 instance -#ifndef NRFX_UART0_ENABLED -#define NRFX_UART0_ENABLED 0 -#endif - -// NRFX_UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef NRFX_UART_DEFAULT_CONFIG_HWFC -#define NRFX_UART_DEFAULT_CONFIG_HWFC 0 -#endif - -// NRFX_UART_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included - -#ifndef NRFX_UART_DEFAULT_CONFIG_PARITY -#define NRFX_UART_DEFAULT_CONFIG_PARITY 0 -#endif - -// NRFX_UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3866624=> 14400 baud -// <5152768=> 19200 baud -// <7729152=> 28800 baud -// <8388608=> 31250 baud -// <10309632=> 38400 baud -// <15007744=> 56000 baud -// <15462400=> 57600 baud -// <20615168=> 76800 baud -// <30924800=> 115200 baud -// <61845504=> 230400 baud -// <67108864=> 250000 baud -// <123695104=> 460800 baud -// <247386112=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef NRFX_UART_DEFAULT_CONFIG_BAUDRATE -#define NRFX_UART_DEFAULT_CONFIG_BAUDRATE 30924800 -#endif - -// NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_UART_CONFIG_LOG_ENABLED -#define NRFX_UART_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_UART_CONFIG_LOG_LEVEL -#define NRFX_UART_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UART_CONFIG_INFO_COLOR -#define NRFX_UART_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_UART_CONFIG_DEBUG_COLOR -#define NRFX_UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRFX_USBD_ENABLED - nrfx_usbd - USBD peripheral driver -//========================================================== -#ifndef NRFX_USBD_ENABLED -#define NRFX_USBD_ENABLED 0 -#endif -// NRFX_USBD_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_USBD_CONFIG_IRQ_PRIORITY -#define NRFX_USBD_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_USBD_CONFIG_DMASCHEDULER_MODE - USBD DMA scheduler working scheme - -// <0=> Prioritized access -// <1=> Round Robin - -#ifndef NRFX_USBD_CONFIG_DMASCHEDULER_MODE -#define NRFX_USBD_CONFIG_DMASCHEDULER_MODE 0 -#endif - -// NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST - Give priority to isochronous transfers - - -// This option gives priority to isochronous transfers. -// Enabling it assures that isochronous transfers are always processed, -// even if multiple other transfers are pending. -// Isochronous endpoints are prioritized before the usbd_dma_scheduler_algorithm -// function is called, so the option is independent of the algorithm chosen. - -#ifndef NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST -#define NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1 -#endif - -// NRFX_USBD_CONFIG_ISO_IN_ZLP - Respond to an IN token on ISO IN endpoint with ZLP when no data is ready - - -// If set, ISO IN endpoint will respond to an IN token with ZLP when no data is ready to be sent. -// Else, there will be no response. - -#ifndef NRFX_USBD_CONFIG_ISO_IN_ZLP -#define NRFX_USBD_CONFIG_ISO_IN_ZLP 0 -#endif - -// - -// NRFX_WDT_ENABLED - nrfx_wdt - WDT peripheral driver -//========================================================== -#ifndef NRFX_WDT_ENABLED -#define NRFX_WDT_ENABLED 0 -#endif -// NRFX_WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode - -// <1=> Run in SLEEP, Pause in HALT -// <8=> Pause in SLEEP, Run in HALT -// <9=> Run in SLEEP and HALT -// <0=> Pause in SLEEP and HALT - -#ifndef NRFX_WDT_CONFIG_BEHAVIOUR -#define NRFX_WDT_CONFIG_BEHAVIOUR 1 -#endif - -// NRFX_WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> - - -#ifndef NRFX_WDT_CONFIG_RELOAD_VALUE -#define NRFX_WDT_CONFIG_RELOAD_VALUE 2000 -#endif - -// NRFX_WDT_CONFIG_NO_IRQ - Remove WDT IRQ handling from WDT driver - -// <0=> Include WDT IRQ handling -// <1=> Remove WDT IRQ handling - -#ifndef NRFX_WDT_CONFIG_NO_IRQ -#define NRFX_WDT_CONFIG_NO_IRQ 0 -#endif - -// NRFX_WDT_CONFIG_IRQ_PRIORITY - Interrupt priority - -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef NRFX_WDT_CONFIG_IRQ_PRIORITY -#define NRFX_WDT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRFX_WDT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRFX_WDT_CONFIG_LOG_ENABLED -#define NRFX_WDT_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_WDT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_WDT_CONFIG_LOG_LEVEL -#define NRFX_WDT_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_WDT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_WDT_CONFIG_INFO_COLOR -#define NRFX_WDT_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_WDT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_WDT_CONFIG_DEBUG_COLOR -#define NRFX_WDT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// - -// NRF_CLOCK_ENABLED - nrf_drv_clock - CLOCK peripheral driver - legacy layer -//========================================================== -#ifndef NRF_CLOCK_ENABLED -#define NRF_CLOCK_ENABLED 0 -#endif -// CLOCK_CONFIG_LF_SRC - LF Clock Source - -// <0=> RC -// <1=> XTAL -// <2=> Synth -// <131073=> External Low Swing -// <196609=> External Full Swing - -#ifndef CLOCK_CONFIG_LF_SRC -#define CLOCK_CONFIG_LF_SRC 1 -#endif - -// CLOCK_CONFIG_LF_CAL_ENABLED - Calibration enable for LF Clock Source - - -#ifndef CLOCK_CONFIG_LF_CAL_ENABLED -#define CLOCK_CONFIG_LF_CAL_ENABLED 0 -#endif - -// CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef CLOCK_CONFIG_IRQ_PRIORITY -#define CLOCK_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// PDM_ENABLED - nrf_drv_pdm - PDM peripheral driver - legacy layer -//========================================================== -#ifndef PDM_ENABLED -#define PDM_ENABLED 0 -#endif -// PDM_CONFIG_MODE - Mode - -// <0=> Stereo -// <1=> Mono - -#ifndef PDM_CONFIG_MODE -#define PDM_CONFIG_MODE 1 -#endif - -// PDM_CONFIG_EDGE - Edge - -// <0=> Left falling -// <1=> Left rising - -#ifndef PDM_CONFIG_EDGE -#define PDM_CONFIG_EDGE 0 -#endif - -// PDM_CONFIG_CLOCK_FREQ - Clock frequency - -// <134217728=> 1000k -// <138412032=> 1032k (default) -// <142606336=> 1067k - -#ifndef PDM_CONFIG_CLOCK_FREQ -#define PDM_CONFIG_CLOCK_FREQ 138412032 -#endif - -// PDM_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef PDM_CONFIG_IRQ_PRIORITY -#define PDM_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// POWER_ENABLED - nrf_drv_power - POWER peripheral driver - legacy layer -//========================================================== -#ifndef POWER_ENABLED -#define POWER_ENABLED 1 -#endif -// POWER_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef POWER_CONFIG_IRQ_PRIORITY -#define POWER_CONFIG_IRQ_PRIORITY 6 -#endif - -// POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef POWER_CONFIG_DEFAULT_DCDCEN -#define POWER_CONFIG_DEFAULT_DCDCEN 0 -#endif - -// POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator - - -// This settings means only that components for DCDC regulator are installed and it can be enabled. - -#ifndef POWER_CONFIG_DEFAULT_DCDCENHV -#define POWER_CONFIG_DEFAULT_DCDCENHV 0 -#endif - -// - -// PPI_ENABLED - nrf_drv_ppi - PPI peripheral driver - legacy layer - - -#ifndef PPI_ENABLED -#define PPI_ENABLED 0 -#endif - -// PWM_ENABLED - nrf_drv_pwm - PWM peripheral driver - legacy layer -//========================================================== -#ifndef PWM_ENABLED -#define PWM_ENABLED 0 -#endif -// PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT0_PIN -#define PWM_DEFAULT_CONFIG_OUT0_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT1_PIN -#define PWM_DEFAULT_CONFIG_OUT1_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT2_PIN -#define PWM_DEFAULT_CONFIG_OUT2_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31> - - -#ifndef PWM_DEFAULT_CONFIG_OUT3_PIN -#define PWM_DEFAULT_CONFIG_OUT3_PIN 31 -#endif - -// PWM_DEFAULT_CONFIG_BASE_CLOCK - Base clock - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz - -#ifndef PWM_DEFAULT_CONFIG_BASE_CLOCK -#define PWM_DEFAULT_CONFIG_BASE_CLOCK 4 -#endif - -// PWM_DEFAULT_CONFIG_COUNT_MODE - Count mode - -// <0=> Up -// <1=> Up and Down - -#ifndef PWM_DEFAULT_CONFIG_COUNT_MODE -#define PWM_DEFAULT_CONFIG_COUNT_MODE 0 -#endif - -// PWM_DEFAULT_CONFIG_TOP_VALUE - Top value -#ifndef PWM_DEFAULT_CONFIG_TOP_VALUE -#define PWM_DEFAULT_CONFIG_TOP_VALUE 1000 -#endif - -// PWM_DEFAULT_CONFIG_LOAD_MODE - Load mode - -// <0=> Common -// <1=> Grouped -// <2=> Individual -// <3=> Waveform - -#ifndef PWM_DEFAULT_CONFIG_LOAD_MODE -#define PWM_DEFAULT_CONFIG_LOAD_MODE 0 -#endif - -// PWM_DEFAULT_CONFIG_STEP_MODE - Step mode - -// <0=> Auto -// <1=> Triggered - -#ifndef PWM_DEFAULT_CONFIG_STEP_MODE -#define PWM_DEFAULT_CONFIG_STEP_MODE 0 -#endif - -// PWM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#define PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// PWM0_ENABLED - Enable PWM0 instance - - -#ifndef PWM0_ENABLED -#define PWM0_ENABLED 0 -#endif - -// PWM1_ENABLED - Enable PWM1 instance - - -#ifndef PWM1_ENABLED -#define PWM1_ENABLED 0 -#endif - -// PWM2_ENABLED - Enable PWM2 instance - - -#ifndef PWM2_ENABLED -#define PWM2_ENABLED 0 -#endif - -// PWM3_ENABLED - Enable PWM3 instance - - -#ifndef PWM3_ENABLED -#define PWM3_ENABLED 0 -#endif - -// - -// QDEC_ENABLED - nrf_drv_qdec - QDEC peripheral driver - legacy layer -//========================================================== -#ifndef QDEC_ENABLED -#define QDEC_ENABLED 0 -#endif -// QDEC_CONFIG_REPORTPER - Report period - -// <0=> 10 Samples -// <1=> 40 Samples -// <2=> 80 Samples -// <3=> 120 Samples -// <4=> 160 Samples -// <5=> 200 Samples -// <6=> 240 Samples -// <7=> 280 Samples - -#ifndef QDEC_CONFIG_REPORTPER -#define QDEC_CONFIG_REPORTPER 0 -#endif - -// QDEC_CONFIG_SAMPLEPER - Sample period - -// <0=> 128 us -// <1=> 256 us -// <2=> 512 us -// <3=> 1024 us -// <4=> 2048 us -// <5=> 4096 us -// <6=> 8192 us -// <7=> 16384 us - -#ifndef QDEC_CONFIG_SAMPLEPER -#define QDEC_CONFIG_SAMPLEPER 7 -#endif - -// QDEC_CONFIG_PIO_A - A pin <0-31> - - -#ifndef QDEC_CONFIG_PIO_A -#define QDEC_CONFIG_PIO_A 31 -#endif - -// QDEC_CONFIG_PIO_B - B pin <0-31> - - -#ifndef QDEC_CONFIG_PIO_B -#define QDEC_CONFIG_PIO_B 31 -#endif - -// QDEC_CONFIG_PIO_LED - LED pin <0-31> - - -#ifndef QDEC_CONFIG_PIO_LED -#define QDEC_CONFIG_PIO_LED 31 -#endif - -// QDEC_CONFIG_LEDPRE - LED pre -#ifndef QDEC_CONFIG_LEDPRE -#define QDEC_CONFIG_LEDPRE 511 -#endif - -// QDEC_CONFIG_LEDPOL - LED polarity - -// <0=> Active low -// <1=> Active high - -#ifndef QDEC_CONFIG_LEDPOL -#define QDEC_CONFIG_LEDPOL 1 -#endif - -// QDEC_CONFIG_DBFEN - Debouncing enable - - -#ifndef QDEC_CONFIG_DBFEN -#define QDEC_CONFIG_DBFEN 0 -#endif - -// QDEC_CONFIG_SAMPLE_INTEN - Sample ready interrupt enable - - -#ifndef QDEC_CONFIG_SAMPLE_INTEN -#define QDEC_CONFIG_SAMPLE_INTEN 0 -#endif - -// QDEC_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef QDEC_CONFIG_IRQ_PRIORITY -#define QDEC_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// QSPI_ENABLED - nrf_drv_qspi - QSPI peripheral driver - legacy layer -//========================================================== -#ifndef QSPI_ENABLED -#define QSPI_ENABLED 0 -#endif -// QSPI_CONFIG_SCK_DELAY - tSHSL, tWHSL and tSHWL in number of 16 MHz periods (62.5 ns). <0-255> - - -#ifndef QSPI_CONFIG_SCK_DELAY -#define QSPI_CONFIG_SCK_DELAY 1 -#endif - -// QSPI_CONFIG_XIP_OFFSET - Address offset in the external memory for Execute in Place operation. -#ifndef QSPI_CONFIG_XIP_OFFSET -#define QSPI_CONFIG_XIP_OFFSET 0 -#endif - -// QSPI_CONFIG_READOC - Number of data lines and opcode used for reading. - -// <0=> FastRead -// <1=> Read2O -// <2=> Read2IO -// <3=> Read4O -// <4=> Read4IO - -#ifndef QSPI_CONFIG_READOC -#define QSPI_CONFIG_READOC 0 -#endif - -// QSPI_CONFIG_WRITEOC - Number of data lines and opcode used for writing. - -// <0=> PP -// <1=> PP2O -// <2=> PP4O -// <3=> PP4IO - -#ifndef QSPI_CONFIG_WRITEOC -#define QSPI_CONFIG_WRITEOC 0 -#endif - -// QSPI_CONFIG_ADDRMODE - Addressing mode. - -// <0=> 24bit -// <1=> 32bit - -#ifndef QSPI_CONFIG_ADDRMODE -#define QSPI_CONFIG_ADDRMODE 0 -#endif - -// QSPI_CONFIG_MODE - SPI mode. - -// <0=> Mode 0 -// <1=> Mode 1 - -#ifndef QSPI_CONFIG_MODE -#define QSPI_CONFIG_MODE 0 -#endif - -// QSPI_CONFIG_FREQUENCY - Frequency divider. - -// <0=> 32MHz/1 -// <1=> 32MHz/2 -// <2=> 32MHz/3 -// <3=> 32MHz/4 -// <4=> 32MHz/5 -// <5=> 32MHz/6 -// <6=> 32MHz/7 -// <7=> 32MHz/8 -// <8=> 32MHz/9 -// <9=> 32MHz/10 -// <10=> 32MHz/11 -// <11=> 32MHz/12 -// <12=> 32MHz/13 -// <13=> 32MHz/14 -// <14=> 32MHz/15 -// <15=> 32MHz/16 - -#ifndef QSPI_CONFIG_FREQUENCY -#define QSPI_CONFIG_FREQUENCY 15 -#endif - -// QSPI_PIN_SCK - SCK pin value. -#ifndef QSPI_PIN_SCK -#define QSPI_PIN_SCK NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_CSN - CSN pin value. -#ifndef QSPI_PIN_CSN -#define QSPI_PIN_CSN NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO0 - IO0 pin value. -#ifndef QSPI_PIN_IO0 -#define QSPI_PIN_IO0 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO1 - IO1 pin value. -#ifndef QSPI_PIN_IO1 -#define QSPI_PIN_IO1 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO2 - IO2 pin value. -#ifndef QSPI_PIN_IO2 -#define QSPI_PIN_IO2 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_PIN_IO3 - IO3 pin value. -#ifndef QSPI_PIN_IO3 -#define QSPI_PIN_IO3 NRF_QSPI_PIN_NOT_CONNECTED -#endif - -// QSPI_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef QSPI_CONFIG_IRQ_PRIORITY -#define QSPI_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// RNG_ENABLED - nrf_drv_rng - RNG peripheral driver - legacy layer -//========================================================== -#ifndef RNG_ENABLED -#define RNG_ENABLED 0 -#endif -// RNG_CONFIG_ERROR_CORRECTION - Error correction - - -#ifndef RNG_CONFIG_ERROR_CORRECTION -#define RNG_CONFIG_ERROR_CORRECTION 1 -#endif - -// RNG_CONFIG_POOL_SIZE - Pool size -#ifndef RNG_CONFIG_POOL_SIZE -#define RNG_CONFIG_POOL_SIZE 64 -#endif - -// RNG_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef RNG_CONFIG_IRQ_PRIORITY -#define RNG_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// RTC_ENABLED - nrf_drv_rtc - RTC peripheral driver - legacy layer -//========================================================== -#ifndef RTC_ENABLED -#define RTC_ENABLED 0 -#endif -// RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768> - - -#ifndef RTC_DEFAULT_CONFIG_FREQUENCY -#define RTC_DEFAULT_CONFIG_FREQUENCY 32768 -#endif - -// RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering - - -#ifndef RTC_DEFAULT_CONFIG_RELIABLE -#define RTC_DEFAULT_CONFIG_RELIABLE 0 -#endif - -// RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// RTC0_ENABLED - Enable RTC0 instance - - -#ifndef RTC0_ENABLED -#define RTC0_ENABLED 0 -#endif - -// RTC1_ENABLED - Enable RTC1 instance - - -#ifndef RTC1_ENABLED -#define RTC1_ENABLED 0 -#endif - -// RTC2_ENABLED - Enable RTC2 instance - - -#ifndef RTC2_ENABLED -#define RTC2_ENABLED 0 -#endif - -// NRF_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt -#ifndef NRF_MAXIMUM_LATENCY_US -#define NRF_MAXIMUM_LATENCY_US 2000 -#endif - -// - -// SAADC_ENABLED - nrf_drv_saadc - SAADC peripheral driver - legacy layer -//========================================================== -#ifndef SAADC_ENABLED -#define SAADC_ENABLED 0 -#endif -// SAADC_CONFIG_RESOLUTION - Resolution - -// <0=> 8 bit -// <1=> 10 bit -// <2=> 12 bit -// <3=> 14 bit - -#ifndef SAADC_CONFIG_RESOLUTION -#define SAADC_CONFIG_RESOLUTION 1 -#endif - -// SAADC_CONFIG_OVERSAMPLE - Sample period - -// <0=> Disabled -// <1=> 2x -// <2=> 4x -// <3=> 8x -// <4=> 16x -// <5=> 32x -// <6=> 64x -// <7=> 128x -// <8=> 256x - -#ifndef SAADC_CONFIG_OVERSAMPLE -#define SAADC_CONFIG_OVERSAMPLE 0 -#endif - -// SAADC_CONFIG_LP_MODE - Enabling low power mode - - -#ifndef SAADC_CONFIG_LP_MODE -#define SAADC_CONFIG_LP_MODE 0 -#endif - -// SAADC_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef SAADC_CONFIG_IRQ_PRIORITY -#define SAADC_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// SPIS_ENABLED - nrf_drv_spis - SPIS peripheral driver - legacy layer -//========================================================== -#ifndef SPIS_ENABLED -#define SPIS_ENABLED 0 -#endif -// SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// SPIS_DEFAULT_MODE - Mode - -// <0=> MODE_0 -// <1=> MODE_1 -// <2=> MODE_2 -// <3=> MODE_3 - -#ifndef SPIS_DEFAULT_MODE -#define SPIS_DEFAULT_MODE 0 -#endif - -// SPIS_DEFAULT_BIT_ORDER - SPIS default bit order - -// <0=> MSB first -// <1=> LSB first - -#ifndef SPIS_DEFAULT_BIT_ORDER -#define SPIS_DEFAULT_BIT_ORDER 0 -#endif - -// SPIS_DEFAULT_DEF - SPIS default DEF character <0-255> - - -#ifndef SPIS_DEFAULT_DEF -#define SPIS_DEFAULT_DEF 255 -#endif - -// SPIS_DEFAULT_ORC - SPIS default ORC character <0-255> - - -#ifndef SPIS_DEFAULT_ORC -#define SPIS_DEFAULT_ORC 255 -#endif - -// SPIS0_ENABLED - Enable SPIS0 instance - - -#ifndef SPIS0_ENABLED -#define SPIS0_ENABLED 0 -#endif - -// SPIS1_ENABLED - Enable SPIS1 instance - - -#ifndef SPIS1_ENABLED -#define SPIS1_ENABLED 0 -#endif - -// SPIS2_ENABLED - Enable SPIS2 instance - - -#ifndef SPIS2_ENABLED -#define SPIS2_ENABLED 0 -#endif - -// - -// SPI_ENABLED - nrf_drv_spi - SPI/SPIM peripheral driver - legacy layer -//========================================================== -#ifndef SPI_ENABLED -#define SPI_ENABLED 0 -#endif -// SPI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef SPI_DEFAULT_CONFIG_IRQ_PRIORITY -#define SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// NRF_SPI_DRV_MISO_PULLUP_CFG - MISO PIN pull-up configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP - -#ifndef NRF_SPI_DRV_MISO_PULLUP_CFG -#define NRF_SPI_DRV_MISO_PULLUP_CFG 1 -#endif - -// SPI0_ENABLED - Enable SPI0 instance -//========================================================== -#ifndef SPI0_ENABLED -#define SPI0_ENABLED 0 -#endif -// SPI0_USE_EASY_DMA - Use EasyDMA - - -#ifndef SPI0_USE_EASY_DMA -#define SPI0_USE_EASY_DMA 1 -#endif - -// - -// SPI1_ENABLED - Enable SPI1 instance -//========================================================== -#ifndef SPI1_ENABLED -#define SPI1_ENABLED 0 -#endif -// SPI1_USE_EASY_DMA - Use EasyDMA - - -#ifndef SPI1_USE_EASY_DMA -#define SPI1_USE_EASY_DMA 1 -#endif - -// - -// SPI2_ENABLED - Enable SPI2 instance -//========================================================== -#ifndef SPI2_ENABLED -#define SPI2_ENABLED 0 -#endif -// SPI2_USE_EASY_DMA - Use EasyDMA - - -#ifndef SPI2_USE_EASY_DMA -#define SPI2_USE_EASY_DMA 1 -#endif - -// - -// - -// TIMER_ENABLED - nrf_drv_timer - TIMER periperal driver - legacy layer -//========================================================== -#ifndef TIMER_ENABLED -#define TIMER_ENABLED 0 -#endif -// TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz -// <8=> 62.5 kHz -// <9=> 31.25 kHz - -#ifndef TIMER_DEFAULT_CONFIG_FREQUENCY -#define TIMER_DEFAULT_CONFIG_FREQUENCY 0 -#endif - -// TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation - -// <0=> Timer -// <1=> Counter - -#ifndef TIMER_DEFAULT_CONFIG_MODE -#define TIMER_DEFAULT_CONFIG_MODE 0 -#endif - -// TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width - -// <0=> 16 bit -// <1=> 8 bit -// <2=> 24 bit -// <3=> 32 bit - -#ifndef TIMER_DEFAULT_CONFIG_BIT_WIDTH -#define TIMER_DEFAULT_CONFIG_BIT_WIDTH 0 -#endif - -// TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// TIMER0_ENABLED - Enable TIMER0 instance - - -#ifndef TIMER0_ENABLED -#define TIMER0_ENABLED 0 -#endif - -// TIMER1_ENABLED - Enable TIMER1 instance - - -#ifndef TIMER1_ENABLED -#define TIMER1_ENABLED 0 -#endif - -// TIMER2_ENABLED - Enable TIMER2 instance - - -#ifndef TIMER2_ENABLED -#define TIMER2_ENABLED 0 -#endif - -// TIMER3_ENABLED - Enable TIMER3 instance - - -#ifndef TIMER3_ENABLED -#define TIMER3_ENABLED 0 -#endif - -// TIMER4_ENABLED - Enable TIMER4 instance - - -#ifndef TIMER4_ENABLED -#define TIMER4_ENABLED 0 -#endif - -// - -// TWIS_ENABLED - nrf_drv_twis - TWIS peripheral driver - legacy layer -//========================================================== -#ifndef TWIS_ENABLED -#define TWIS_ENABLED 0 -#endif -// TWIS0_ENABLED - Enable TWIS0 instance - - -#ifndef TWIS0_ENABLED -#define TWIS0_ENABLED 0 -#endif - -// TWIS1_ENABLED - Enable TWIS1 instance - - -#ifndef TWIS1_ENABLED -#define TWIS1_ENABLED 0 -#endif - -// TWIS_ASSUME_INIT_AFTER_RESET_ONLY - Assume that any instance would be initialized only once - - -// Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code. - -#ifndef TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#define TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0 -#endif - -// TWIS_NO_SYNC_MODE - Remove support for synchronous mode - - -// Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources. - -#ifndef TWIS_NO_SYNC_MODE -#define TWIS_NO_SYNC_MODE 0 -#endif - -// TWIS_DEFAULT_CONFIG_ADDR0 - Address0 -#ifndef TWIS_DEFAULT_CONFIG_ADDR0 -#define TWIS_DEFAULT_CONFIG_ADDR0 0 -#endif - -// TWIS_DEFAULT_CONFIG_ADDR1 - Address1 -#ifndef TWIS_DEFAULT_CONFIG_ADDR1 -#define TWIS_DEFAULT_CONFIG_ADDR1 0 -#endif - -// TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef TWIS_DEFAULT_CONFIG_SCL_PULL -#define TWIS_DEFAULT_CONFIG_SCL_PULL 0 -#endif - -// TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up - -#ifndef TWIS_DEFAULT_CONFIG_SDA_PULL -#define TWIS_DEFAULT_CONFIG_SDA_PULL 0 -#endif - -// TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// TWI_ENABLED - nrf_drv_twi - TWI/TWIM peripheral driver - legacy layer -//========================================================== -#ifndef TWI_ENABLED -#define TWI_ENABLED 0 -#endif -// TWI_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k - -#ifndef TWI_DEFAULT_CONFIG_FREQUENCY -#define TWI_DEFAULT_CONFIG_FREQUENCY 26738688 -#endif - -// TWI_DEFAULT_CONFIG_CLR_BUS_INIT - Enables bus clearing procedure during init - - -#ifndef TWI_DEFAULT_CONFIG_CLR_BUS_INIT -#define TWI_DEFAULT_CONFIG_CLR_BUS_INIT 0 -#endif - -// TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - - -#ifndef TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 -#endif - -// TWI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef TWI_DEFAULT_CONFIG_IRQ_PRIORITY -#define TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// TWI0_ENABLED - Enable TWI0 instance -//========================================================== -#ifndef TWI0_ENABLED -#define TWI0_ENABLED 0 -#endif -// TWI0_USE_EASY_DMA - Use EasyDMA (if present) - - -#ifndef TWI0_USE_EASY_DMA -#define TWI0_USE_EASY_DMA 0 -#endif - -// - -// TWI1_ENABLED - Enable TWI1 instance -//========================================================== -#ifndef TWI1_ENABLED -#define TWI1_ENABLED 0 -#endif -// TWI1_USE_EASY_DMA - Use EasyDMA (if present) - - -#ifndef TWI1_USE_EASY_DMA -#define TWI1_USE_EASY_DMA 0 -#endif - -// - -// - -// UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer -//========================================================== -#ifndef UART_ENABLED -#define UART_ENABLED 0 -#endif -// UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef UART_DEFAULT_CONFIG_HWFC -#define UART_DEFAULT_CONFIG_HWFC 0 -#endif - -// UART_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included - -#ifndef UART_DEFAULT_CONFIG_PARITY -#define UART_DEFAULT_CONFIG_PARITY 0 -#endif - -// UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef UART_DEFAULT_CONFIG_BAUDRATE -#define UART_DEFAULT_CONFIG_BAUDRATE 30801920 -#endif - -// UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef UART_DEFAULT_CONFIG_IRQ_PRIORITY -#define UART_DEFAULT_CONFIG_IRQ_PRIORITY 6 -#endif - -// UART_EASY_DMA_SUPPORT - Driver supporting EasyDMA - - -#ifndef UART_EASY_DMA_SUPPORT -#define UART_EASY_DMA_SUPPORT 1 -#endif - -// UART_LEGACY_SUPPORT - Driver supporting Legacy mode - - -#ifndef UART_LEGACY_SUPPORT -#define UART_LEGACY_SUPPORT 1 -#endif - -// UART0_ENABLED - Enable UART0 instance -//========================================================== -#ifndef UART0_ENABLED -#define UART0_ENABLED 0 -#endif -// UART0_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA - - -#ifndef UART0_CONFIG_USE_EASY_DMA -#define UART0_CONFIG_USE_EASY_DMA 1 -#endif - -// - -// UART1_ENABLED - Enable UART1 instance -//========================================================== -#ifndef UART1_ENABLED -#define UART1_ENABLED 0 -#endif -// - -// - -// USBD_ENABLED - nrf_drv_usbd - Software Component -//========================================================== -#ifndef USBD_ENABLED -#define USBD_ENABLED 0 -#endif -// USBD_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef USBD_CONFIG_IRQ_PRIORITY -#define USBD_CONFIG_IRQ_PRIORITY 6 -#endif - -// USBD_CONFIG_DMASCHEDULER_MODE - USBD SMA scheduler working scheme - -// <0=> Prioritized access -// <1=> Round Robin - -#ifndef USBD_CONFIG_DMASCHEDULER_MODE -#define USBD_CONFIG_DMASCHEDULER_MODE 0 -#endif - -// USBD_CONFIG_DMASCHEDULER_ISO_BOOST - Give priority to isochronous transfers - - -// This option gives priority to isochronous transfers. -// Enabling it assures that isochronous transfers are always processed, -// even if multiple other transfers are pending. -// Isochronous endpoints are prioritized before the usbd_dma_scheduler_algorithm -// function is called, so the option is independent of the algorithm chosen. - -#ifndef USBD_CONFIG_DMASCHEDULER_ISO_BOOST -#define USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1 -#endif - -// USBD_CONFIG_ISO_IN_ZLP - Respond to an IN token on ISO IN endpoint with ZLP when no data is ready - - -// If set, ISO IN endpoint will respond to an IN token with ZLP when no data is ready to be sent. -// Else, there will be no response. -// NOTE: This option does not work on Engineering A chip. - -#ifndef USBD_CONFIG_ISO_IN_ZLP -#define USBD_CONFIG_ISO_IN_ZLP 0 -#endif - -// - -// WDT_ENABLED - nrf_drv_wdt - WDT peripheral driver - legacy layer -//========================================================== -#ifndef WDT_ENABLED -#define WDT_ENABLED 0 -#endif -// WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode - -// <1=> Run in SLEEP, Pause in HALT -// <8=> Pause in SLEEP, Run in HALT -// <9=> Run in SLEEP and HALT -// <0=> Pause in SLEEP and HALT - -#ifndef WDT_CONFIG_BEHAVIOUR -#define WDT_CONFIG_BEHAVIOUR 1 -#endif - -// WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> - - -#ifndef WDT_CONFIG_RELOAD_VALUE -#define WDT_CONFIG_RELOAD_VALUE 2000 -#endif - -// WDT_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef WDT_CONFIG_IRQ_PRIORITY -#define WDT_CONFIG_IRQ_PRIORITY 6 -#endif - -// - -// -//========================================================== - -// nRF_Drivers_External - -//========================================================== -// NRF_TWI_SENSOR_ENABLED - nrf_twi_sensor - nRF TWI Sensor module - - -#ifndef NRF_TWI_SENSOR_ENABLED -#define NRF_TWI_SENSOR_ENABLED 0 -#endif - -// -//========================================================== - -// nRF_Libraries - -//========================================================== -// APP_GPIOTE_ENABLED - app_gpiote - GPIOTE events dispatcher - - -#ifndef APP_GPIOTE_ENABLED -#define APP_GPIOTE_ENABLED 0 -#endif - -// APP_PWM_ENABLED - app_pwm - PWM functionality - - -#ifndef APP_PWM_ENABLED -#define APP_PWM_ENABLED 0 -#endif - -// APP_SCHEDULER_ENABLED - app_scheduler - Events scheduler -//========================================================== -#ifndef APP_SCHEDULER_ENABLED -#define APP_SCHEDULER_ENABLED 0 -#endif -// APP_SCHEDULER_WITH_PAUSE - Enabling pause feature - - -#ifndef APP_SCHEDULER_WITH_PAUSE -#define APP_SCHEDULER_WITH_PAUSE 0 -#endif - -// APP_SCHEDULER_WITH_PROFILER - Enabling scheduler profiling - - -#ifndef APP_SCHEDULER_WITH_PROFILER -#define APP_SCHEDULER_WITH_PROFILER 0 -#endif - -// - -// APP_SDCARD_ENABLED - app_sdcard - SD/MMC card support using SPI -//========================================================== -#ifndef APP_SDCARD_ENABLED -#define APP_SDCARD_ENABLED 0 -#endif -// APP_SDCARD_SPI_INSTANCE - SPI instance used - -// <0=> 0 -// <1=> 1 -// <2=> 2 - -#ifndef APP_SDCARD_SPI_INSTANCE -#define APP_SDCARD_SPI_INSTANCE 0 -#endif - -// APP_SDCARD_FREQ_INIT - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz - -#ifndef APP_SDCARD_FREQ_INIT -#define APP_SDCARD_FREQ_INIT 67108864 -#endif - -// APP_SDCARD_FREQ_DATA - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz - -#ifndef APP_SDCARD_FREQ_DATA -#define APP_SDCARD_FREQ_DATA 1073741824 -#endif - -// - -// APP_TIMER_ENABLED - app_timer - Application timer functionality -//========================================================== -#ifndef APP_TIMER_ENABLED -#define APP_TIMER_ENABLED 0 -#endif -// APP_TIMER_CONFIG_RTC_FREQUENCY - Configure RTC prescaler. - -// <0=> 32768 Hz -// <1=> 16384 Hz -// <3=> 8192 Hz -// <7=> 4096 Hz -// <15=> 2048 Hz -// <31=> 1024 Hz - -#ifndef APP_TIMER_CONFIG_RTC_FREQUENCY -#define APP_TIMER_CONFIG_RTC_FREQUENCY 1 -#endif - -// APP_TIMER_CONFIG_IRQ_PRIORITY - Interrupt priority - - -// Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 - -#ifndef APP_TIMER_CONFIG_IRQ_PRIORITY -#define APP_TIMER_CONFIG_IRQ_PRIORITY 6 -#endif - -// APP_TIMER_CONFIG_OP_QUEUE_SIZE - Capacity of timer requests queue. -// Size of the queue depends on how many timers are used -// in the system, how often timers are started and overall -// system latency. If queue size is too small app_timer calls -// will fail. - -#ifndef APP_TIMER_CONFIG_OP_QUEUE_SIZE -#define APP_TIMER_CONFIG_OP_QUEUE_SIZE 10 -#endif - -// APP_TIMER_CONFIG_USE_SCHEDULER - Enable scheduling app_timer events to app_scheduler - - -#ifndef APP_TIMER_CONFIG_USE_SCHEDULER -#define APP_TIMER_CONFIG_USE_SCHEDULER 0 -#endif - -// APP_TIMER_KEEPS_RTC_ACTIVE - Enable RTC always on - - -// If option is enabled RTC is kept running even if there is no active timers. -// This option can be used when app_timer is used for timestamping. - -#ifndef APP_TIMER_KEEPS_RTC_ACTIVE -#define APP_TIMER_KEEPS_RTC_ACTIVE 0 -#endif - -// APP_TIMER_SAFE_WINDOW_MS - Maximum possible latency (in milliseconds) of handling app_timer event. -// Maximum possible timeout that can be set is reduced by safe window. -// Example: RTC frequency 16384 Hz, maximum possible timeout 1024 seconds - APP_TIMER_SAFE_WINDOW_MS. -// Since RTC is not stopped when processor is halted in debugging session, this value -// must cover it if debugging is needed. It is possible to halt processor for APP_TIMER_SAFE_WINDOW_MS -// without corrupting app_timer behavior. - -#ifndef APP_TIMER_SAFE_WINDOW_MS -#define APP_TIMER_SAFE_WINDOW_MS 300000 -#endif - -// App Timer Legacy configuration - Legacy configuration. - -//========================================================== -// APP_TIMER_WITH_PROFILER - Enable app_timer profiling - - -#ifndef APP_TIMER_WITH_PROFILER -#define APP_TIMER_WITH_PROFILER 0 -#endif - -// APP_TIMER_CONFIG_SWI_NUMBER - Configure SWI instance used. - - -#ifndef APP_TIMER_CONFIG_SWI_NUMBER -#define APP_TIMER_CONFIG_SWI_NUMBER 0 -#endif - -// -//========================================================== - -// - -// APP_USBD_AUDIO_ENABLED - app_usbd_audio - USB AUDIO class - - -#ifndef APP_USBD_AUDIO_ENABLED -#define APP_USBD_AUDIO_ENABLED 0 -#endif - -// APP_USBD_ENABLED - app_usbd - USB Device library -//========================================================== -#ifndef APP_USBD_ENABLED -#define APP_USBD_ENABLED 0 -#endif -// APP_USBD_VID - Vendor ID. <0x0000-0xFFFF> - - -// Note: This value is not editable in Configuration Wizard. -// Vendor ID ordered from USB IF: http://www.usb.org/developers/vendor/ - -#ifndef APP_USBD_VID -#define APP_USBD_VID 0 -#endif - -// APP_USBD_PID - Product ID. <0x0000-0xFFFF> - - -// Note: This value is not editable in Configuration Wizard. -// Selected Product ID - -#ifndef APP_USBD_PID -#define APP_USBD_PID 0 -#endif - -// APP_USBD_DEVICE_VER_MAJOR - Major device version <0-99> - - -// Major device version, will be converted automatically to BCD notation. Use just decimal values. - -#ifndef APP_USBD_DEVICE_VER_MAJOR -#define APP_USBD_DEVICE_VER_MAJOR 1 -#endif - -// APP_USBD_DEVICE_VER_MINOR - Minor device version <0-9> - - -// Minor device version, will be converted automatically to BCD notation. Use just decimal values. - -#ifndef APP_USBD_DEVICE_VER_MINOR -#define APP_USBD_DEVICE_VER_MINOR 0 -#endif - -// APP_USBD_DEVICE_VER_SUB - Sub-minor device version <0-9> - - -// Sub-minor device version, will be converted automatically to BCD notation. Use just decimal values. - -#ifndef APP_USBD_DEVICE_VER_SUB -#define APP_USBD_DEVICE_VER_SUB 0 -#endif - -// APP_USBD_CONFIG_SELF_POWERED - Self-powered device, as opposed to bus-powered. - - -#ifndef APP_USBD_CONFIG_SELF_POWERED -#define APP_USBD_CONFIG_SELF_POWERED 1 -#endif - -// APP_USBD_CONFIG_MAX_POWER - MaxPower field in configuration descriptor in milliamps. <0-500> - - -#ifndef APP_USBD_CONFIG_MAX_POWER -#define APP_USBD_CONFIG_MAX_POWER 100 -#endif - -// APP_USBD_CONFIG_POWER_EVENTS_PROCESS - Process power events. - - -// Enable processing power events in USB event handler. - -#ifndef APP_USBD_CONFIG_POWER_EVENTS_PROCESS -#define APP_USBD_CONFIG_POWER_EVENTS_PROCESS 1 -#endif - -// APP_USBD_CONFIG_EVENT_QUEUE_ENABLE - Enable event queue. - -// This is the default configuration when all the events are placed into internal queue. -// Disable it when an external queue is used like app_scheduler or if you wish to process all events inside interrupts. -// Processing all events from the interrupt level adds requirement not to call any functions that modifies the USBD library state from the context higher than USB interrupt context. -// Functions that modify USBD state are functions for sleep, wakeup, start, stop, enable, and disable. -//========================================================== -#ifndef APP_USBD_CONFIG_EVENT_QUEUE_ENABLE -#define APP_USBD_CONFIG_EVENT_QUEUE_ENABLE 1 -#endif -// APP_USBD_CONFIG_EVENT_QUEUE_SIZE - The size of the event queue. <16-64> - - -// The size of the queue for the events that would be processed in the main loop. - -#ifndef APP_USBD_CONFIG_EVENT_QUEUE_SIZE -#define APP_USBD_CONFIG_EVENT_QUEUE_SIZE 32 -#endif - -// APP_USBD_CONFIG_SOF_HANDLING_MODE - Change SOF events handling mode. - - -// Normal queue - SOF events are pushed normally into the event queue. -// Compress queue - SOF events are counted and binded with other events or executed when the queue is empty. -// This prevents the queue from filling up with SOF events. -// Interrupt - SOF events are processed in interrupt. -// <0=> Normal queue -// <1=> Compress queue -// <2=> Interrupt - -#ifndef APP_USBD_CONFIG_SOF_HANDLING_MODE -#define APP_USBD_CONFIG_SOF_HANDLING_MODE 1 -#endif - -// - -// APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE - Provide a function that generates timestamps for logs based on the current SOF. - - -// The function app_usbd_sof_timestamp_get is implemented if the logger is enabled. -// Use it when initializing the logger. -// SOF processing is always enabled when this configuration parameter is active. -// Note: This option is configured outside of APP_USBD_CONFIG_LOG_ENABLED. -// This means that it works even if the logging in this very module is disabled. - -#ifndef APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE -#define APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE 0 -#endif - -// APP_USBD_CONFIG_DESC_STRING_SIZE - Maximum size of the NULL-terminated string of the string descriptor. <31-254> - - -// 31 characters can be stored in the internal USB buffer used for transfers. -// Any value higher than 31 creates an additional buffer just for descriptor strings. - -#ifndef APP_USBD_CONFIG_DESC_STRING_SIZE -#define APP_USBD_CONFIG_DESC_STRING_SIZE 31 -#endif - -// APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED - Enable UTF8 conversion. - - -// Enable UTF8-encoded characters. In normal processing, only ASCII characters are available. - -#ifndef APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED -#define APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED 0 -#endif - -// APP_USBD_STRINGS_LANGIDS - Supported languages identifiers. - -// Note: This value is not editable in Configuration Wizard. -// Comma-separated list of supported languages. -#ifndef APP_USBD_STRINGS_LANGIDS -#define APP_USBD_STRINGS_LANGIDS APP_USBD_LANG_AND_SUBLANG(APP_USBD_LANG_ENGLISH, APP_USBD_SUBLANG_ENGLISH_US) -#endif - -// APP_USBD_STRING_ID_MANUFACTURER - Define manufacturer string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_MANUFACTURER -#define APP_USBD_STRING_ID_MANUFACTURER 1 -#endif -// APP_USBD_STRINGS_MANUFACTURER_EXTERN - Define whether @ref APP_USBD_STRINGS_MANUFACTURER is created by macro or declared as a global variable. - - -#ifndef APP_USBD_STRINGS_MANUFACTURER_EXTERN -#define APP_USBD_STRINGS_MANUFACTURER_EXTERN 0 -#endif - -// APP_USBD_STRINGS_MANUFACTURER - String descriptor for the manufacturer name. - -// Note: This value is not editable in Configuration Wizard. -// Comma-separated list of manufacturer names for each defined language. -// Use @ref APP_USBD_STRING_DESC macro to create string descriptor from a NULL-terminated string. -// Use @ref APP_USBD_STRING_RAW8_DESC macro to create string descriptor from comma-separated uint8_t values. -// Use @ref APP_USBD_STRING_RAW16_DESC macro to create string descriptor from comma-separated uint16_t values. -// Alternatively, configure the macro to point to any internal variable pointer that already contains the descriptor. -// Setting string to NULL disables that string. -// The order of manufacturer names must be the same like in @ref APP_USBD_STRINGS_LANGIDS. -#ifndef APP_USBD_STRINGS_MANUFACTURER -#define APP_USBD_STRINGS_MANUFACTURER APP_USBD_STRING_DESC("Nordic Semiconductor") -#endif - -// - -// APP_USBD_STRING_ID_PRODUCT - Define product string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_PRODUCT -#define APP_USBD_STRING_ID_PRODUCT 2 -#endif -// APP_USBD_STRINGS_PRODUCT_EXTERN - Define whether @ref APP_USBD_STRINGS_PRODUCT is created by macro or declared as a global variable. - - -#ifndef APP_USBD_STRINGS_PRODUCT_EXTERN -#define APP_USBD_STRINGS_PRODUCT_EXTERN 0 -#endif - -// APP_USBD_STRINGS_PRODUCT - String descriptor for the product name. - -// Note: This value is not editable in Configuration Wizard. -// List of product names that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER. -#ifndef APP_USBD_STRINGS_PRODUCT -#define APP_USBD_STRINGS_PRODUCT APP_USBD_STRING_DESC("nRF52 USB Product") -#endif - -// - -// APP_USBD_STRING_ID_SERIAL - Define serial number string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_SERIAL -#define APP_USBD_STRING_ID_SERIAL 3 -#endif -// APP_USBD_STRING_SERIAL_EXTERN - Define whether @ref APP_USBD_STRING_SERIAL is created by macro or declared as a global variable. - - -#ifndef APP_USBD_STRING_SERIAL_EXTERN -#define APP_USBD_STRING_SERIAL_EXTERN 0 -#endif - -// APP_USBD_STRING_SERIAL - String descriptor for the serial number. - -// Note: This value is not editable in Configuration Wizard. -// Serial number that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER. -#ifndef APP_USBD_STRING_SERIAL -#define APP_USBD_STRING_SERIAL APP_USBD_STRING_DESC("000000000000") -#endif - -// - -// APP_USBD_STRING_ID_CONFIGURATION - Define configuration string ID. - -// Setting ID to 0 disables the string. -//========================================================== -#ifndef APP_USBD_STRING_ID_CONFIGURATION -#define APP_USBD_STRING_ID_CONFIGURATION 4 -#endif -// APP_USBD_STRING_CONFIGURATION_EXTERN - Define whether @ref APP_USBD_STRINGS_CONFIGURATION is created by macro or declared as global variable. - - -#ifndef APP_USBD_STRING_CONFIGURATION_EXTERN -#define APP_USBD_STRING_CONFIGURATION_EXTERN 0 -#endif - -// APP_USBD_STRINGS_CONFIGURATION - String descriptor for the device configuration. - -// Note: This value is not editable in Configuration Wizard. -// Configuration string that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER. -#ifndef APP_USBD_STRINGS_CONFIGURATION -#define APP_USBD_STRINGS_CONFIGURATION APP_USBD_STRING_DESC("Default configuration") -#endif - -// - -// APP_USBD_STRINGS_USER - Default values for user strings. - -// Note: This value is not editable in Configuration Wizard. -// This value stores all application specific user strings with the default initialization. -// The setup is done by X-macros. -// Expected macro parameters: -// @code -// X(mnemonic, [=str_idx], ...) -// @endcode -// - @c mnemonic: Mnemonic of the string descriptor that would be added to -// @ref app_usbd_string_desc_idx_t enumerator. -// - @c str_idx : String index value, can be set or left empty. -// For example, WinUSB driver requires descriptor to be present on 0xEE index. -// Then use X(USBD_STRING_WINUSB, =0xEE, (APP_USBD_STRING_DESC(...))) -// - @c ... : List of string descriptors for each defined language. -#ifndef APP_USBD_STRINGS_USER -#define APP_USBD_STRINGS_USER X(APP_USER_1, , APP_USBD_STRING_DESC("User 1")) -#endif - -// - -// APP_USBD_HID_ENABLED - app_usbd_hid - USB HID class -//========================================================== -#ifndef APP_USBD_HID_ENABLED -#define APP_USBD_HID_ENABLED 0 -#endif -// APP_USBD_HID_DEFAULT_IDLE_RATE - Default idle rate for HID class. <0-255> - - -// 0 means indefinite duration, any other value is multiplied by 4 milliseconds. Refer to Chapter 7.2.4 of HID 1.11 Specification. - -#ifndef APP_USBD_HID_DEFAULT_IDLE_RATE -#define APP_USBD_HID_DEFAULT_IDLE_RATE 0 -#endif - -// APP_USBD_HID_REPORT_IDLE_TABLE_SIZE - Size of idle rate table. <1-255> - - -// Must be higher than the highest report ID used. - -#ifndef APP_USBD_HID_REPORT_IDLE_TABLE_SIZE -#define APP_USBD_HID_REPORT_IDLE_TABLE_SIZE 4 -#endif - -// - -// APP_USBD_HID_GENERIC_ENABLED - app_usbd_hid_generic - USB HID generic - - -#ifndef APP_USBD_HID_GENERIC_ENABLED -#define APP_USBD_HID_GENERIC_ENABLED 0 -#endif - -// APP_USBD_HID_KBD_ENABLED - app_usbd_hid_kbd - USB HID keyboard - - -#ifndef APP_USBD_HID_KBD_ENABLED -#define APP_USBD_HID_KBD_ENABLED 0 -#endif - -// APP_USBD_HID_MOUSE_ENABLED - app_usbd_hid_mouse - USB HID mouse - - -#ifndef APP_USBD_HID_MOUSE_ENABLED -#define APP_USBD_HID_MOUSE_ENABLED 0 -#endif - -// APP_USBD_MSC_ENABLED - app_usbd_msc - USB MSC class - - -#ifndef APP_USBD_MSC_ENABLED -#define APP_USBD_MSC_ENABLED 0 -#endif - -// CRC16_ENABLED - crc16 - CRC16 calculation routines - - -#ifndef CRC16_ENABLED -#define CRC16_ENABLED 0 -#endif - -// CRC32_ENABLED - crc32 - CRC32 calculation routines - - -#ifndef CRC32_ENABLED -#define CRC32_ENABLED 0 -#endif - -// ECC_ENABLED - ecc - Elliptic Curve Cryptography Library - - -#ifndef ECC_ENABLED -#define ECC_ENABLED 0 -#endif - -// FDS_ENABLED - fds - Flash data storage module -//========================================================== -#ifndef FDS_ENABLED -#define FDS_ENABLED 0 -#endif -// Pages - Virtual page settings - -// Configure the number of virtual pages to use and their size. -//========================================================== -// FDS_VIRTUAL_PAGES - Number of virtual flash pages to use. -// One of the virtual pages is reserved by the system for garbage collection. -// Therefore, the minimum is two virtual pages: one page to store data and one page to be used by the system for garbage collection. -// The total amount of flash memory that is used by FDS amounts to @ref FDS_VIRTUAL_PAGES * @ref FDS_VIRTUAL_PAGE_SIZE * 4 bytes. - -#ifndef FDS_VIRTUAL_PAGES -#define FDS_VIRTUAL_PAGES 3 -#endif - -// FDS_VIRTUAL_PAGE_SIZE - The size of a virtual flash page. - - -// Expressed in number of 4-byte words. -// By default, a virtual page is the same size as a physical page. -// The size of a virtual page must be a multiple of the size of a physical page. -// <1024=> 1024 -// <2048=> 2048 - -#ifndef FDS_VIRTUAL_PAGE_SIZE -#define FDS_VIRTUAL_PAGE_SIZE 1024 -#endif - -// FDS_VIRTUAL_PAGES_RESERVED - The number of virtual flash pages that are used by other modules. -// FDS module stores its data in the last pages of the flash memory. -// By setting this value, you can move flash end address used by the FDS. -// As a result the reserved space can be used by other modules. - -#ifndef FDS_VIRTUAL_PAGES_RESERVED -#define FDS_VIRTUAL_PAGES_RESERVED 0 -#endif - -// -//========================================================== - -// Backend - Backend configuration - -// Configure which nrf_fstorage backend is used by FDS to write to flash. -//========================================================== -// FDS_BACKEND - FDS flash backend. - - -// NRF_FSTORAGE_SD uses the nrf_fstorage_sd backend implementation using the SoftDevice API. Use this if you have a SoftDevice present. -// NRF_FSTORAGE_NVMC uses the nrf_fstorage_nvmc implementation. Use this setting if you don't use the SoftDevice. -// <1=> NRF_FSTORAGE_NVMC -// <2=> NRF_FSTORAGE_SD - -#ifndef FDS_BACKEND -#define FDS_BACKEND 2 -#endif - -// -//========================================================== - -// Queue - Queue settings - -//========================================================== -// FDS_OP_QUEUE_SIZE - Size of the internal queue. -// Increase this value if you frequently get synchronous FDS_ERR_NO_SPACE_IN_QUEUES errors. - -#ifndef FDS_OP_QUEUE_SIZE -#define FDS_OP_QUEUE_SIZE 4 -#endif - -// -//========================================================== - -// CRC - CRC functionality - -//========================================================== -// FDS_CRC_CHECK_ON_READ - Enable CRC checks. - -// Save a record's CRC when it is written to flash and check it when the record is opened. -// Records with an incorrect CRC can still be 'seen' by the user using FDS functions, but they cannot be opened. -// Additionally, they will not be garbage collected until they are deleted. -//========================================================== -#ifndef FDS_CRC_CHECK_ON_READ -#define FDS_CRC_CHECK_ON_READ 0 -#endif -// FDS_CRC_CHECK_ON_WRITE - Perform a CRC check on newly written records. - - -// Perform a CRC check on newly written records. -// This setting can be used to make sure that the record data was not altered while being written to flash. -// <1=> Enabled -// <0=> Disabled - -#ifndef FDS_CRC_CHECK_ON_WRITE -#define FDS_CRC_CHECK_ON_WRITE 0 -#endif - -// - -// -//========================================================== - -// Users - Number of users - -//========================================================== -// FDS_MAX_USERS - Maximum number of callbacks that can be registered. -#ifndef FDS_MAX_USERS -#define FDS_MAX_USERS 4 -#endif - -// -//========================================================== - -// - -// HARDFAULT_HANDLER_ENABLED - hardfault_default - HardFault default handler for debugging and release - - -#ifndef HARDFAULT_HANDLER_ENABLED -#define HARDFAULT_HANDLER_ENABLED 0 -#endif - -// HCI_MEM_POOL_ENABLED - hci_mem_pool - memory pool implementation used by HCI -//========================================================== -#ifndef HCI_MEM_POOL_ENABLED -#define HCI_MEM_POOL_ENABLED 0 -#endif -// HCI_TX_BUF_SIZE - TX buffer size in bytes. -#ifndef HCI_TX_BUF_SIZE -#define HCI_TX_BUF_SIZE 600 -#endif - -// HCI_RX_BUF_SIZE - RX buffer size in bytes. -#ifndef HCI_RX_BUF_SIZE -#define HCI_RX_BUF_SIZE 600 -#endif - -// HCI_RX_BUF_QUEUE_SIZE - RX buffer queue size. -#ifndef HCI_RX_BUF_QUEUE_SIZE -#define HCI_RX_BUF_QUEUE_SIZE 4 -#endif - -// - -// HCI_SLIP_ENABLED - hci_slip - SLIP protocol implementation used by HCI -//========================================================== -#ifndef HCI_SLIP_ENABLED -#define HCI_SLIP_ENABLED 0 -#endif -// HCI_UART_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud - -#ifndef HCI_UART_BAUDRATE -#define HCI_UART_BAUDRATE 30801920 -#endif - -// HCI_UART_FLOW_CONTROL - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled - -#ifndef HCI_UART_FLOW_CONTROL -#define HCI_UART_FLOW_CONTROL 0 -#endif - -// HCI_UART_RX_PIN - UART RX pin -#ifndef HCI_UART_RX_PIN -#define HCI_UART_RX_PIN 31 -#endif - -// HCI_UART_TX_PIN - UART TX pin -#ifndef HCI_UART_TX_PIN -#define HCI_UART_TX_PIN 31 -#endif - -// HCI_UART_RTS_PIN - UART RTS pin -#ifndef HCI_UART_RTS_PIN -#define HCI_UART_RTS_PIN 31 -#endif - -// HCI_UART_CTS_PIN - UART CTS pin -#ifndef HCI_UART_CTS_PIN -#define HCI_UART_CTS_PIN 31 -#endif - -// - -// HCI_TRANSPORT_ENABLED - hci_transport - HCI transport -//========================================================== -#ifndef HCI_TRANSPORT_ENABLED -#define HCI_TRANSPORT_ENABLED 0 -#endif -// HCI_MAX_PACKET_SIZE_IN_BITS - Maximum size of a single application packet in bits. -#ifndef HCI_MAX_PACKET_SIZE_IN_BITS -#define HCI_MAX_PACKET_SIZE_IN_BITS 8000 -#endif - -// - -// LED_SOFTBLINK_ENABLED - led_softblink - led_softblink module - - -#ifndef LED_SOFTBLINK_ENABLED -#define LED_SOFTBLINK_ENABLED 0 -#endif - -// LOW_POWER_PWM_ENABLED - low_power_pwm - low_power_pwm module - - -#ifndef LOW_POWER_PWM_ENABLED -#define LOW_POWER_PWM_ENABLED 0 -#endif - -// MEM_MANAGER_ENABLED - mem_manager - Dynamic memory allocator -//========================================================== -#ifndef MEM_MANAGER_ENABLED -#define MEM_MANAGER_ENABLED 0 -#endif -// MEMORY_MANAGER_SMALL_BLOCK_COUNT - Size of each memory blocks identified as 'small' block. <0-255> - - -#ifndef MEMORY_MANAGER_SMALL_BLOCK_COUNT -#define MEMORY_MANAGER_SMALL_BLOCK_COUNT 1 -#endif - -// MEMORY_MANAGER_SMALL_BLOCK_SIZE - Size of each memory blocks identified as 'small' block. -// Size of each memory blocks identified as 'small' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_SMALL_BLOCK_SIZE -#define MEMORY_MANAGER_SMALL_BLOCK_SIZE 32 -#endif - -// MEMORY_MANAGER_MEDIUM_BLOCK_COUNT - Size of each memory blocks identified as 'medium' block. <0-255> - - -#ifndef MEMORY_MANAGER_MEDIUM_BLOCK_COUNT -#define MEMORY_MANAGER_MEDIUM_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_MEDIUM_BLOCK_SIZE - Size of each memory blocks identified as 'medium' block. -// Size of each memory blocks identified as 'medium' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_MEDIUM_BLOCK_SIZE -#define MEMORY_MANAGER_MEDIUM_BLOCK_SIZE 256 -#endif - -// MEMORY_MANAGER_LARGE_BLOCK_COUNT - Size of each memory blocks identified as 'large' block. <0-255> - - -#ifndef MEMORY_MANAGER_LARGE_BLOCK_COUNT -#define MEMORY_MANAGER_LARGE_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_LARGE_BLOCK_SIZE - Size of each memory blocks identified as 'large' block. -// Size of each memory blocks identified as 'large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_LARGE_BLOCK_SIZE -#define MEMORY_MANAGER_LARGE_BLOCK_SIZE 256 -#endif - -// MEMORY_MANAGER_XLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra large' block. <0-255> - - -#ifndef MEMORY_MANAGER_XLARGE_BLOCK_COUNT -#define MEMORY_MANAGER_XLARGE_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra large' block. -// Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XLARGE_BLOCK_SIZE -#define MEMORY_MANAGER_XLARGE_BLOCK_SIZE 1320 -#endif - -// MEMORY_MANAGER_XXLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra large' block. <0-255> - - -#ifndef MEMORY_MANAGER_XXLARGE_BLOCK_COUNT -#define MEMORY_MANAGER_XXLARGE_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XXLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra large' block. -// Size of each memory blocks identified as 'extra extra large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XXLARGE_BLOCK_SIZE -#define MEMORY_MANAGER_XXLARGE_BLOCK_SIZE 3444 -#endif - -// MEMORY_MANAGER_XSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra small' block. <0-255> - - -#ifndef MEMORY_MANAGER_XSMALL_BLOCK_COUNT -#define MEMORY_MANAGER_XSMALL_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra small' block. -// Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XSMALL_BLOCK_SIZE -#define MEMORY_MANAGER_XSMALL_BLOCK_SIZE 64 -#endif - -// MEMORY_MANAGER_XXSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra small' block. <0-255> - - -#ifndef MEMORY_MANAGER_XXSMALL_BLOCK_COUNT -#define MEMORY_MANAGER_XXSMALL_BLOCK_COUNT 0 -#endif - -// MEMORY_MANAGER_XXSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra small' block. -// Size of each memory blocks identified as 'extra extra small' block. Memory block are recommended to be word-sized. - -#ifndef MEMORY_MANAGER_XXSMALL_BLOCK_SIZE -#define MEMORY_MANAGER_XXSMALL_BLOCK_SIZE 32 -#endif - -// MEM_MANAGER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef MEM_MANAGER_CONFIG_LOG_ENABLED -#define MEM_MANAGER_CONFIG_LOG_ENABLED 0 -#endif -// MEM_MANAGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef MEM_MANAGER_CONFIG_LOG_LEVEL -#define MEM_MANAGER_CONFIG_LOG_LEVEL 3 -#endif - -// MEM_MANAGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MEM_MANAGER_CONFIG_INFO_COLOR -#define MEM_MANAGER_CONFIG_INFO_COLOR 0 -#endif - -// MEM_MANAGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MEM_MANAGER_CONFIG_DEBUG_COLOR -#define MEM_MANAGER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// MEM_MANAGER_DISABLE_API_PARAM_CHECK - Disable API parameter checks in the module. - - -#ifndef MEM_MANAGER_DISABLE_API_PARAM_CHECK -#define MEM_MANAGER_DISABLE_API_PARAM_CHECK 0 -#endif - -// - -// NRF_BALLOC_ENABLED - nrf_balloc - Block allocator module -//========================================================== -#ifndef NRF_BALLOC_ENABLED -#define NRF_BALLOC_ENABLED 1 -#endif -// NRF_BALLOC_CONFIG_DEBUG_ENABLED - Enables debug mode in the module. -//========================================================== -#ifndef NRF_BALLOC_CONFIG_DEBUG_ENABLED -#define NRF_BALLOC_CONFIG_DEBUG_ENABLED 0 -#endif -// NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS - Number of words used as head guard. <0-255> - - -#ifndef NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS -#define NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS 1 -#endif - -// NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS - Number of words used as tail guard. <0-255> - - -#ifndef NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS -#define NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS 1 -#endif - -// NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED - Enables basic checks in this module. - - -#ifndef NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED -#define NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED 0 -#endif - -// NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED - Enables double memory free check in this module. - - -#ifndef NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED -#define NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED 0 -#endif - -// NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED - Enables free memory corruption check in this module. - - -#ifndef NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED -#define NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED 0 -#endif - -// NRF_BALLOC_CLI_CMDS - Enable CLI commands specific to the module - - -#ifndef NRF_BALLOC_CLI_CMDS -#define NRF_BALLOC_CLI_CMDS 0 -#endif - -// - -// - -// NRF_CSENSE_ENABLED - nrf_csense - Capacitive sensor module -//========================================================== -#ifndef NRF_CSENSE_ENABLED -#define NRF_CSENSE_ENABLED 0 -#endif -// NRF_CSENSE_PAD_HYSTERESIS - Minimum value of change required to determine that a pad was touched. -#ifndef NRF_CSENSE_PAD_HYSTERESIS -#define NRF_CSENSE_PAD_HYSTERESIS 15 -#endif - -// NRF_CSENSE_PAD_DEVIATION - Minimum value measured on a pad required to take it into account while calculating the step. -#ifndef NRF_CSENSE_PAD_DEVIATION -#define NRF_CSENSE_PAD_DEVIATION 70 -#endif - -// NRF_CSENSE_MIN_PAD_VALUE - Minimum normalized value on a pad required to take its value into account. -#ifndef NRF_CSENSE_MIN_PAD_VALUE -#define NRF_CSENSE_MIN_PAD_VALUE 20 -#endif - -// NRF_CSENSE_MAX_PADS_NUMBER - Maximum number of pads used for one instance. -#ifndef NRF_CSENSE_MAX_PADS_NUMBER -#define NRF_CSENSE_MAX_PADS_NUMBER 20 -#endif - -// NRF_CSENSE_MAX_VALUE - Maximum normalized value obtained from measurement. -#ifndef NRF_CSENSE_MAX_VALUE -#define NRF_CSENSE_MAX_VALUE 1000 -#endif - -// NRF_CSENSE_OUTPUT_PIN - Output pin used by the low-level module. -// This is used when capacitive sensor does not use COMP. - -#ifndef NRF_CSENSE_OUTPUT_PIN -#define NRF_CSENSE_OUTPUT_PIN 26 -#endif - -// - -// NRF_DRV_CSENSE_ENABLED - nrf_drv_csense - Capacitive sensor low-level module -//========================================================== -#ifndef NRF_DRV_CSENSE_ENABLED -#define NRF_DRV_CSENSE_ENABLED 0 -#endif -// USE_COMP - Use the comparator to implement the capacitive sensor driver. - -// Due to Anomaly 84, COMP I_SOURCE is not functional. It has too high a varation. -//========================================================== -#ifndef USE_COMP -#define USE_COMP 0 -#endif -// TIMER0_FOR_CSENSE - First TIMER instance used by the driver (not used on nRF51). -#ifndef TIMER0_FOR_CSENSE -#define TIMER0_FOR_CSENSE 1 -#endif - -// TIMER1_FOR_CSENSE - Second TIMER instance used by the driver (not used on nRF51). -#ifndef TIMER1_FOR_CSENSE -#define TIMER1_FOR_CSENSE 2 -#endif - -// MEASUREMENT_PERIOD - Single measurement period. -// Time of a single measurement can be calculated as -// T = (1/2)*MEASUREMENT_PERIOD*(1/f_OSC) where f_OSC = I_SOURCE / (2C*(VUP-VDOWN) ). -// I_SOURCE, VUP, and VDOWN are values used to initialize COMP and C is the capacitance of the used pad. - -#ifndef MEASUREMENT_PERIOD -#define MEASUREMENT_PERIOD 20 -#endif - -// - -// - -// NRF_FSTORAGE_ENABLED - nrf_fstorage - Flash abstraction library -//========================================================== -#ifndef NRF_FSTORAGE_ENABLED -#define NRF_FSTORAGE_ENABLED 0 -#endif -// nrf_fstorage - Common settings - -// Common settings to all fstorage implementations -//========================================================== -// NRF_FSTORAGE_PARAM_CHECK_DISABLED - Disable user input validation - - -// If selected, use ASSERT to validate user input. -// This effectively removes user input validation in production code. -// Recommended setting: OFF, only enable this setting if size is a major concern. - -#ifndef NRF_FSTORAGE_PARAM_CHECK_DISABLED -#define NRF_FSTORAGE_PARAM_CHECK_DISABLED 0 -#endif - -// -//========================================================== - -// nrf_fstorage_sd - Implementation using the SoftDevice - -// Configuration options for the fstorage implementation using the SoftDevice -//========================================================== -// NRF_FSTORAGE_SD_QUEUE_SIZE - Size of the internal queue of operations -// Increase this value if API calls frequently return the error @ref NRF_ERROR_NO_MEM. - -#ifndef NRF_FSTORAGE_SD_QUEUE_SIZE -#define NRF_FSTORAGE_SD_QUEUE_SIZE 4 -#endif - -// NRF_FSTORAGE_SD_MAX_RETRIES - Maximum number of attempts at executing an operation when the SoftDevice is busy -// Increase this value if events frequently return the @ref NRF_ERROR_TIMEOUT error. -// The SoftDevice might fail to schedule flash access due to high BLE activity. - -#ifndef NRF_FSTORAGE_SD_MAX_RETRIES -#define NRF_FSTORAGE_SD_MAX_RETRIES 8 -#endif - -// NRF_FSTORAGE_SD_MAX_WRITE_SIZE - Maximum number of bytes to be written to flash in a single operation -// This value must be a multiple of four. -// Lowering this value can increase the chances of the SoftDevice being able to execute flash operations in between radio activity. -// This value is bound by the maximum number of bytes that can be written to flash in a single call to @ref sd_flash_write. -// That is 1024 bytes for nRF51 ICs and 4096 bytes for nRF52 ICs. - -#ifndef NRF_FSTORAGE_SD_MAX_WRITE_SIZE -#define NRF_FSTORAGE_SD_MAX_WRITE_SIZE 4096 -#endif - -// -//========================================================== - -// - -// NRF_GFX_ENABLED - nrf_gfx - GFX module - - -#ifndef NRF_GFX_ENABLED -#define NRF_GFX_ENABLED 0 -#endif - -// NRF_MEMOBJ_ENABLED - nrf_memobj - Linked memory allocator module - - -#ifndef NRF_MEMOBJ_ENABLED -#define NRF_MEMOBJ_ENABLED 1 -#endif - -// NRF_PWR_MGMT_ENABLED - nrf_pwr_mgmt - Power management module -//========================================================== -#ifndef NRF_PWR_MGMT_ENABLED -#define NRF_PWR_MGMT_ENABLED 0 -#endif -// NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED - Enables pin debug in the module. - -// Selected pin will be set when CPU is in sleep mode. -//========================================================== -#ifndef NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED -#define NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED 0 -#endif -// NRF_PWR_MGMT_SLEEP_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected - -#ifndef NRF_PWR_MGMT_SLEEP_DEBUG_PIN -#define NRF_PWR_MGMT_SLEEP_DEBUG_PIN 31 -#endif - -// - -// NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED - Enables CPU usage monitor. - - -// Module will trace percentage of CPU usage in one second intervals. - -#ifndef NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED -#define NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED 0 -#endif - -// NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED - Enable standby timeout. -//========================================================== -#ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED -#define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED 0 -#endif -// NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S - Standby timeout (in seconds). -// Shutdown procedure will begin no earlier than after this number of seconds. - -#ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S -#define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S 3 -#endif - -// - -// NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED - Enables FPU event cleaning. - - -#ifndef NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED -#define NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED 0 -#endif - -// NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY - Blocked shutdown procedure will be retried every second. - - -#ifndef NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY -#define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 0 -#endif - -// NRF_PWR_MGMT_CONFIG_USE_SCHEDULER - Module will use @ref app_scheduler. - - -#ifndef NRF_PWR_MGMT_CONFIG_USE_SCHEDULER -#define NRF_PWR_MGMT_CONFIG_USE_SCHEDULER 0 -#endif - -// NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT - The number of priorities for module handlers. -// The number of stages of the shutdown process. - -#ifndef NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT -#define NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT 3 -#endif - -// - -// NRF_QUEUE_ENABLED - nrf_queue - Queue module -//========================================================== -#ifndef NRF_QUEUE_ENABLED -#define NRF_QUEUE_ENABLED 0 -#endif -// NRF_QUEUE_CLI_CMDS - Enable CLI commands specific to the module - - -#ifndef NRF_QUEUE_CLI_CMDS -#define NRF_QUEUE_CLI_CMDS 0 -#endif - -// - -// NRF_SECTION_ITER_ENABLED - nrf_section_iter - Section iterator - - -#ifndef NRF_SECTION_ITER_ENABLED -#define NRF_SECTION_ITER_ENABLED 1 -#endif - -// NRF_SORTLIST_ENABLED - nrf_sortlist - Sorted list - - -#ifndef NRF_SORTLIST_ENABLED -#define NRF_SORTLIST_ENABLED 1 -#endif - -// NRF_SPI_MNGR_ENABLED - nrf_spi_mngr - SPI transaction manager - - -#ifndef NRF_SPI_MNGR_ENABLED -#define NRF_SPI_MNGR_ENABLED 0 -#endif - -// NRF_STRERROR_ENABLED - nrf_strerror - Library for converting error code to string. - - -#ifndef NRF_STRERROR_ENABLED -#define NRF_STRERROR_ENABLED 1 -#endif - -// NRF_TWI_MNGR_ENABLED - nrf_twi_mngr - TWI transaction manager - - -#ifndef NRF_TWI_MNGR_ENABLED -#define NRF_TWI_MNGR_ENABLED 0 -#endif - -// SLIP_ENABLED - slip - SLIP encoding and decoding - - -#ifndef SLIP_ENABLED -#define SLIP_ENABLED 0 -#endif - -// TASK_MANAGER_ENABLED - task_manager - Task manager. -//========================================================== -#ifndef TASK_MANAGER_ENABLED -#define TASK_MANAGER_ENABLED 0 -#endif -// TASK_MANAGER_CLI_CMDS - Enable CLI commands specific to the module - - -#ifndef TASK_MANAGER_CLI_CMDS -#define TASK_MANAGER_CLI_CMDS 0 -#endif - -// TASK_MANAGER_CONFIG_MAX_TASKS - Maximum number of tasks which can be created -#ifndef TASK_MANAGER_CONFIG_MAX_TASKS -#define TASK_MANAGER_CONFIG_MAX_TASKS 2 -#endif - -// TASK_MANAGER_CONFIG_STACK_SIZE - Stack size for every task (power of 2) -#ifndef TASK_MANAGER_CONFIG_STACK_SIZE -#define TASK_MANAGER_CONFIG_STACK_SIZE 1024 -#endif - -// TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED - Enable stack profiling. - - -#ifndef TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED -#define TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED 1 -#endif - -// TASK_MANAGER_CONFIG_STACK_GUARD - Configures stack guard. - -// <0=> Disabled -// <4=> 32 bytes -// <5=> 64 bytes -// <6=> 128 bytes -// <7=> 256 bytes -// <8=> 512 bytes - -#ifndef TASK_MANAGER_CONFIG_STACK_GUARD -#define TASK_MANAGER_CONFIG_STACK_GUARD 7 -#endif - -// - -// app_button - buttons handling module - -//========================================================== -// BUTTON_ENABLED - Enables Button module - - -#ifndef BUTTON_ENABLED -#define BUTTON_ENABLED 0 -#endif - -// BUTTON_HIGH_ACCURACY_ENABLED - Enables GPIOTE high accuracy for buttons - - -#ifndef BUTTON_HIGH_ACCURACY_ENABLED -#define BUTTON_HIGH_ACCURACY_ENABLED 0 -#endif - -// -//========================================================== - -// app_usbd_cdc_acm - USB CDC ACM class - -//========================================================== -// APP_USBD_CDC_ACM_ENABLED - Enabling USBD CDC ACM Class library - - -#ifndef APP_USBD_CDC_ACM_ENABLED -#define APP_USBD_CDC_ACM_ENABLED 0 -#endif - -// APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE - Send ZLP on write with same size as endpoint - - -// If enabled, CDC ACM class will automatically send a zero length packet after transfer which has the same size as endpoint. -// This may limit throughput if a lot of binary data is sent, but in terminal mode operation it makes sure that the data is always displayed right after it is sent. - -#ifndef APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE -#define APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE 1 -#endif - -// -//========================================================== - -// nrf_cli - Command line interface - -//========================================================== -// NRF_CLI_ENABLED - Enable/disable the CLI module. - - -#ifndef NRF_CLI_ENABLED -#define NRF_CLI_ENABLED 0 -#endif - -// NRF_CLI_ARGC_MAX - Maximum number of parameters passed to the command handler. -#ifndef NRF_CLI_ARGC_MAX -#define NRF_CLI_ARGC_MAX 12 -#endif - -// NRF_CLI_BUILD_IN_CMDS_ENABLED - CLI built-in commands. - - -#ifndef NRF_CLI_BUILD_IN_CMDS_ENABLED -#define NRF_CLI_BUILD_IN_CMDS_ENABLED 1 -#endif - -// NRF_CLI_CMD_BUFF_SIZE - Maximum buffer size for a single command. -#ifndef NRF_CLI_CMD_BUFF_SIZE -#define NRF_CLI_CMD_BUFF_SIZE 128 -#endif - -// NRF_CLI_ECHO_STATUS - CLI echo status. If set, echo is ON. - - -#ifndef NRF_CLI_ECHO_STATUS -#define NRF_CLI_ECHO_STATUS 1 -#endif - -// NRF_CLI_WILDCARD_ENABLED - Enable wildcard functionality for CLI commands. - - -#ifndef NRF_CLI_WILDCARD_ENABLED -#define NRF_CLI_WILDCARD_ENABLED 0 -#endif - -// NRF_CLI_METAKEYS_ENABLED - Enable additional control keys for CLI commands like ctrl+a, ctrl+e, ctrl+w, ctrl+u - - -#ifndef NRF_CLI_METAKEYS_ENABLED -#define NRF_CLI_METAKEYS_ENABLED 0 -#endif - -// NRF_CLI_PRINTF_BUFF_SIZE - Maximum print buffer size. -#ifndef NRF_CLI_PRINTF_BUFF_SIZE -#define NRF_CLI_PRINTF_BUFF_SIZE 23 -#endif - -// NRF_CLI_HISTORY_ENABLED - Enable CLI history mode. -//========================================================== -#ifndef NRF_CLI_HISTORY_ENABLED -#define NRF_CLI_HISTORY_ENABLED 1 -#endif -// NRF_CLI_HISTORY_ELEMENT_SIZE - Size of one memory object reserved for CLI history. -#ifndef NRF_CLI_HISTORY_ELEMENT_SIZE -#define NRF_CLI_HISTORY_ELEMENT_SIZE 32 -#endif - -// NRF_CLI_HISTORY_ELEMENT_COUNT - Number of history memory objects. -#ifndef NRF_CLI_HISTORY_ELEMENT_COUNT -#define NRF_CLI_HISTORY_ELEMENT_COUNT 8 -#endif - -// - -// NRF_CLI_VT100_COLORS_ENABLED - CLI VT100 colors. - - -#ifndef NRF_CLI_VT100_COLORS_ENABLED -#define NRF_CLI_VT100_COLORS_ENABLED 1 -#endif - -// NRF_CLI_STATISTICS_ENABLED - Enable CLI statistics. - - -#ifndef NRF_CLI_STATISTICS_ENABLED -#define NRF_CLI_STATISTICS_ENABLED 1 -#endif - -// NRF_CLI_LOG_BACKEND - Enable logger backend interface. - - -#ifndef NRF_CLI_LOG_BACKEND -#define NRF_CLI_LOG_BACKEND 1 -#endif - -// NRF_CLI_USES_TASK_MANAGER_ENABLED - Enable CLI to use task_manager - - -#ifndef NRF_CLI_USES_TASK_MANAGER_ENABLED -#define NRF_CLI_USES_TASK_MANAGER_ENABLED 0 -#endif - -// -//========================================================== - -// nrf_fprintf - fprintf function. - -//========================================================== -// NRF_FPRINTF_ENABLED - Enable/disable fprintf module. - - -#ifndef NRF_FPRINTF_ENABLED -#define NRF_FPRINTF_ENABLED 1 -#endif - -// NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED - For each printed LF, function will add CR. - - -#ifndef NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED -#define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 1 -#endif - -// NRF_FPRINTF_DOUBLE_ENABLED - Enable IEEE-754 double precision formatting. - - -#ifndef NRF_FPRINTF_DOUBLE_ENABLED -#define NRF_FPRINTF_DOUBLE_ENABLED 0 -#endif - -// -//========================================================== - -// -//========================================================== - -// nRF_Log - -//========================================================== -// NRF_LOG_ENABLED - nrf_log - Logger -//========================================================== -#ifndef NRF_LOG_ENABLED -#define NRF_LOG_ENABLED 0 -#endif -// Log message pool - Configuration of log message pool - -//========================================================== -// NRF_LOG_MSGPOOL_ELEMENT_SIZE - Size of a single element in the pool of memory objects. -// If a small value is set, then performance of logs processing -// is degraded because data is fragmented. Bigger value impacts -// RAM memory utilization. The size is set to fit a message with -// a timestamp and up to 2 arguments in a single memory object. - -#ifndef NRF_LOG_MSGPOOL_ELEMENT_SIZE -#define NRF_LOG_MSGPOOL_ELEMENT_SIZE 20 -#endif - -// NRF_LOG_MSGPOOL_ELEMENT_COUNT - Number of elements in the pool of memory objects -// If a small value is set, then it may lead to a deadlock -// in certain cases if backend has high latency and holds -// multiple messages for long time. Bigger value impacts -// RAM memory usage. - -#ifndef NRF_LOG_MSGPOOL_ELEMENT_COUNT -#define NRF_LOG_MSGPOOL_ELEMENT_COUNT 8 -#endif - -// -//========================================================== - -// NRF_LOG_ALLOW_OVERFLOW - Configures behavior when circular buffer is full. - - -// If set then oldest logs are overwritten. Otherwise a -// marker is injected informing about overflow. - -#ifndef NRF_LOG_ALLOW_OVERFLOW -#define NRF_LOG_ALLOW_OVERFLOW 1 -#endif - -// NRF_LOG_BUFSIZE - Size of the buffer for storing logs (in bytes). - - -// Must be power of 2 and multiple of 4. -// If NRF_LOG_DEFERRED = 0 then buffer size can be reduced to minimum. -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 -// <2048=> 2048 -// <4096=> 4096 -// <8192=> 8192 -// <16384=> 16384 - -#ifndef NRF_LOG_BUFSIZE -#define NRF_LOG_BUFSIZE 1024 -#endif - -// NRF_LOG_CLI_CMDS - Enable CLI commands for the module. - - -#ifndef NRF_LOG_CLI_CMDS -#define NRF_LOG_CLI_CMDS 0 -#endif - -// NRF_LOG_DEFAULT_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_LOG_DEFAULT_LEVEL -#define NRF_LOG_DEFAULT_LEVEL 3 -#endif - -// NRF_LOG_DEFERRED - Enable deffered logger. - - -// Log data is buffered and can be processed in idle. - -#ifndef NRF_LOG_DEFERRED -#define NRF_LOG_DEFERRED 1 -#endif - -// NRF_LOG_FILTERS_ENABLED - Enable dynamic filtering of logs. - - -#ifndef NRF_LOG_FILTERS_ENABLED -#define NRF_LOG_FILTERS_ENABLED 0 -#endif - -// NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED - Enable use of critical region for non deffered mode when flushing logs. - - -// When enabled NRF_LOG_FLUSH is called from critical section when non deffered mode is used. -// Log output will never be corrupted as access to the log backend is exclusive -// but system will spend significant amount of time in critical section - -#ifndef NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED -#define NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED 0 -#endif - -// NRF_LOG_STR_PUSH_BUFFER_SIZE - Size of the buffer dedicated for strings stored using @ref NRF_LOG_PUSH. - -// <16=> 16 -// <32=> 32 -// <64=> 64 -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 - -#ifndef NRF_LOG_STR_PUSH_BUFFER_SIZE -#define NRF_LOG_STR_PUSH_BUFFER_SIZE 128 -#endif - -// NRF_LOG_STR_PUSH_BUFFER_SIZE - Size of the buffer dedicated for strings stored using @ref NRF_LOG_PUSH. - -// <16=> 16 -// <32=> 32 -// <64=> 64 -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 - -#ifndef NRF_LOG_STR_PUSH_BUFFER_SIZE -#define NRF_LOG_STR_PUSH_BUFFER_SIZE 128 -#endif - -// NRF_LOG_USES_COLORS - If enabled then ANSI escape code for colors is prefixed to every string -//========================================================== -#ifndef NRF_LOG_USES_COLORS -#define NRF_LOG_USES_COLORS 0 -#endif -// NRF_LOG_COLOR_DEFAULT - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LOG_COLOR_DEFAULT -#define NRF_LOG_COLOR_DEFAULT 0 -#endif - -// NRF_LOG_ERROR_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LOG_ERROR_COLOR -#define NRF_LOG_ERROR_COLOR 2 -#endif - -// NRF_LOG_WARNING_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LOG_WARNING_COLOR -#define NRF_LOG_WARNING_COLOR 4 -#endif - -// - -// NRF_LOG_USES_TIMESTAMP - Enable timestamping - -// Function for getting the timestamp is provided by the user -//========================================================== -#ifndef NRF_LOG_USES_TIMESTAMP -#define NRF_LOG_USES_TIMESTAMP 0 -#endif -// NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY - Default frequency of the timestamp (in Hz) or 0 to use app_timer frequency. -#ifndef NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY -#define NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY 0 -#endif - -// - -// nrf_log module configuration - -//========================================================== -// nrf_log in nRF_Core - -//========================================================== -// NRF_MPU_LIB_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_MPU_LIB_CONFIG_LOG_ENABLED -#define NRF_MPU_LIB_CONFIG_LOG_ENABLED 0 -#endif -// NRF_MPU_LIB_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_MPU_LIB_CONFIG_LOG_LEVEL -#define NRF_MPU_LIB_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_MPU_LIB_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MPU_LIB_CONFIG_INFO_COLOR -#define NRF_MPU_LIB_CONFIG_INFO_COLOR 0 -#endif - -// NRF_MPU_LIB_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MPU_LIB_CONFIG_DEBUG_COLOR -#define NRF_MPU_LIB_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_STACK_GUARD_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_STACK_GUARD_CONFIG_LOG_ENABLED -#define NRF_STACK_GUARD_CONFIG_LOG_ENABLED 0 -#endif -// NRF_STACK_GUARD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_STACK_GUARD_CONFIG_LOG_LEVEL -#define NRF_STACK_GUARD_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_STACK_GUARD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_STACK_GUARD_CONFIG_INFO_COLOR -#define NRF_STACK_GUARD_CONFIG_INFO_COLOR 0 -#endif - -// NRF_STACK_GUARD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_STACK_GUARD_CONFIG_DEBUG_COLOR -#define NRF_STACK_GUARD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TASK_MANAGER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TASK_MANAGER_CONFIG_LOG_ENABLED -#define TASK_MANAGER_CONFIG_LOG_ENABLED 0 -#endif -// TASK_MANAGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TASK_MANAGER_CONFIG_LOG_LEVEL -#define TASK_MANAGER_CONFIG_LOG_LEVEL 3 -#endif - -// TASK_MANAGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TASK_MANAGER_CONFIG_INFO_COLOR -#define TASK_MANAGER_CONFIG_INFO_COLOR 0 -#endif - -// TASK_MANAGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TASK_MANAGER_CONFIG_DEBUG_COLOR -#define TASK_MANAGER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// nrf_log in nRF_Drivers - -//========================================================== -// CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef CLOCK_CONFIG_LOG_ENABLED -#define CLOCK_CONFIG_LOG_ENABLED 0 -#endif -// CLOCK_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef CLOCK_CONFIG_LOG_LEVEL -#define CLOCK_CONFIG_LOG_LEVEL 3 -#endif - -// CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef CLOCK_CONFIG_INFO_COLOR -#define CLOCK_CONFIG_INFO_COLOR 0 -#endif - -// CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef CLOCK_CONFIG_DEBUG_COLOR -#define CLOCK_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// COMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef COMP_CONFIG_LOG_ENABLED -#define COMP_CONFIG_LOG_ENABLED 0 -#endif -// COMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef COMP_CONFIG_LOG_LEVEL -#define COMP_CONFIG_LOG_LEVEL 3 -#endif - -// COMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef COMP_CONFIG_INFO_COLOR -#define COMP_CONFIG_INFO_COLOR 0 -#endif - -// COMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef COMP_CONFIG_DEBUG_COLOR -#define COMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// GPIOTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef GPIOTE_CONFIG_LOG_ENABLED -#define GPIOTE_CONFIG_LOG_ENABLED 0 -#endif -// GPIOTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef GPIOTE_CONFIG_LOG_LEVEL -#define GPIOTE_CONFIG_LOG_LEVEL 3 -#endif - -// GPIOTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef GPIOTE_CONFIG_INFO_COLOR -#define GPIOTE_CONFIG_INFO_COLOR 0 -#endif - -// GPIOTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef GPIOTE_CONFIG_DEBUG_COLOR -#define GPIOTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// LPCOMP_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef LPCOMP_CONFIG_LOG_ENABLED -#define LPCOMP_CONFIG_LOG_ENABLED 0 -#endif -// LPCOMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef LPCOMP_CONFIG_LOG_LEVEL -#define LPCOMP_CONFIG_LOG_LEVEL 3 -#endif - -// LPCOMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef LPCOMP_CONFIG_INFO_COLOR -#define LPCOMP_CONFIG_INFO_COLOR 0 -#endif - -// LPCOMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef LPCOMP_CONFIG_DEBUG_COLOR -#define LPCOMP_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// MAX3421E_HOST_CONFIG_LOG_ENABLED - Enable logging in the module -//========================================================== -#ifndef MAX3421E_HOST_CONFIG_LOG_ENABLED -#define MAX3421E_HOST_CONFIG_LOG_ENABLED 0 -#endif -// MAX3421E_HOST_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef MAX3421E_HOST_CONFIG_LOG_LEVEL -#define MAX3421E_HOST_CONFIG_LOG_LEVEL 3 -#endif - -// MAX3421E_HOST_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MAX3421E_HOST_CONFIG_INFO_COLOR -#define MAX3421E_HOST_CONFIG_INFO_COLOR 0 -#endif - -// MAX3421E_HOST_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef MAX3421E_HOST_CONFIG_DEBUG_COLOR -#define MAX3421E_HOST_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRFX_USBD_CONFIG_LOG_ENABLED - Enable logging in the module -//========================================================== -#ifndef NRFX_USBD_CONFIG_LOG_ENABLED -#define NRFX_USBD_CONFIG_LOG_ENABLED 0 -#endif -// NRFX_USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRFX_USBD_CONFIG_LOG_LEVEL -#define NRFX_USBD_CONFIG_LOG_LEVEL 3 -#endif - -// NRFX_USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_USBD_CONFIG_INFO_COLOR -#define NRFX_USBD_CONFIG_INFO_COLOR 0 -#endif - -// NRFX_USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRFX_USBD_CONFIG_DEBUG_COLOR -#define NRFX_USBD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PDM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef PDM_CONFIG_LOG_ENABLED -#define PDM_CONFIG_LOG_ENABLED 0 -#endif -// PDM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PDM_CONFIG_LOG_LEVEL -#define PDM_CONFIG_LOG_LEVEL 3 -#endif - -// PDM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PDM_CONFIG_INFO_COLOR -#define PDM_CONFIG_INFO_COLOR 0 -#endif - -// PDM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PDM_CONFIG_DEBUG_COLOR -#define PDM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef PPI_CONFIG_LOG_ENABLED -#define PPI_CONFIG_LOG_ENABLED 0 -#endif -// PPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PPI_CONFIG_LOG_LEVEL -#define PPI_CONFIG_LOG_LEVEL 3 -#endif - -// PPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PPI_CONFIG_INFO_COLOR -#define PPI_CONFIG_INFO_COLOR 0 -#endif - -// PPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PPI_CONFIG_DEBUG_COLOR -#define PPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PWM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef PWM_CONFIG_LOG_ENABLED -#define PWM_CONFIG_LOG_ENABLED 0 -#endif -// PWM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PWM_CONFIG_LOG_LEVEL -#define PWM_CONFIG_LOG_LEVEL 3 -#endif - -// PWM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PWM_CONFIG_INFO_COLOR -#define PWM_CONFIG_INFO_COLOR 0 -#endif - -// PWM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PWM_CONFIG_DEBUG_COLOR -#define PWM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// QDEC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef QDEC_CONFIG_LOG_ENABLED -#define QDEC_CONFIG_LOG_ENABLED 0 -#endif -// QDEC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef QDEC_CONFIG_LOG_LEVEL -#define QDEC_CONFIG_LOG_LEVEL 3 -#endif - -// QDEC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef QDEC_CONFIG_INFO_COLOR -#define QDEC_CONFIG_INFO_COLOR 0 -#endif - -// QDEC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef QDEC_CONFIG_DEBUG_COLOR -#define QDEC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// RNG_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef RNG_CONFIG_LOG_ENABLED -#define RNG_CONFIG_LOG_ENABLED 0 -#endif -// RNG_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef RNG_CONFIG_LOG_LEVEL -#define RNG_CONFIG_LOG_LEVEL 3 -#endif - -// RNG_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RNG_CONFIG_INFO_COLOR -#define RNG_CONFIG_INFO_COLOR 0 -#endif - -// RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RNG_CONFIG_DEBUG_COLOR -#define RNG_CONFIG_DEBUG_COLOR 0 -#endif - -// RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED - Enables logging of random numbers. - - -#ifndef RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED -#define RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED 0 -#endif - -// - -// RTC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef RTC_CONFIG_LOG_ENABLED -#define RTC_CONFIG_LOG_ENABLED 0 -#endif -// RTC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef RTC_CONFIG_LOG_LEVEL -#define RTC_CONFIG_LOG_LEVEL 3 -#endif - -// RTC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RTC_CONFIG_INFO_COLOR -#define RTC_CONFIG_INFO_COLOR 0 -#endif - -// RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef RTC_CONFIG_DEBUG_COLOR -#define RTC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// SAADC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SAADC_CONFIG_LOG_ENABLED -#define SAADC_CONFIG_LOG_ENABLED 0 -#endif -// SAADC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SAADC_CONFIG_LOG_LEVEL -#define SAADC_CONFIG_LOG_LEVEL 3 -#endif - -// SAADC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SAADC_CONFIG_INFO_COLOR -#define SAADC_CONFIG_INFO_COLOR 0 -#endif - -// SAADC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SAADC_CONFIG_DEBUG_COLOR -#define SAADC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// SPIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SPIS_CONFIG_LOG_ENABLED -#define SPIS_CONFIG_LOG_ENABLED 0 -#endif -// SPIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SPIS_CONFIG_LOG_LEVEL -#define SPIS_CONFIG_LOG_LEVEL 3 -#endif - -// SPIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPIS_CONFIG_INFO_COLOR -#define SPIS_CONFIG_INFO_COLOR 0 -#endif - -// SPIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPIS_CONFIG_DEBUG_COLOR -#define SPIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// SPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SPI_CONFIG_LOG_ENABLED -#define SPI_CONFIG_LOG_ENABLED 0 -#endif -// SPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SPI_CONFIG_LOG_LEVEL -#define SPI_CONFIG_LOG_LEVEL 3 -#endif - -// SPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPI_CONFIG_INFO_COLOR -#define SPI_CONFIG_INFO_COLOR 0 -#endif - -// SPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SPI_CONFIG_DEBUG_COLOR -#define SPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TIMER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TIMER_CONFIG_LOG_ENABLED -#define TIMER_CONFIG_LOG_ENABLED 0 -#endif -// TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TIMER_CONFIG_LOG_LEVEL -#define TIMER_CONFIG_LOG_LEVEL 3 -#endif - -// TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TIMER_CONFIG_INFO_COLOR -#define TIMER_CONFIG_INFO_COLOR 0 -#endif - -// TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TIMER_CONFIG_DEBUG_COLOR -#define TIMER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TWIS_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TWIS_CONFIG_LOG_ENABLED -#define TWIS_CONFIG_LOG_ENABLED 0 -#endif -// TWIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TWIS_CONFIG_LOG_LEVEL -#define TWIS_CONFIG_LOG_LEVEL 3 -#endif - -// TWIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWIS_CONFIG_INFO_COLOR -#define TWIS_CONFIG_INFO_COLOR 0 -#endif - -// TWIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWIS_CONFIG_DEBUG_COLOR -#define TWIS_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// TWI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef TWI_CONFIG_LOG_ENABLED -#define TWI_CONFIG_LOG_ENABLED 0 -#endif -// TWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef TWI_CONFIG_LOG_LEVEL -#define TWI_CONFIG_LOG_LEVEL 3 -#endif - -// TWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWI_CONFIG_INFO_COLOR -#define TWI_CONFIG_INFO_COLOR 0 -#endif - -// TWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef TWI_CONFIG_DEBUG_COLOR -#define TWI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef UART_CONFIG_LOG_ENABLED -#define UART_CONFIG_LOG_ENABLED 0 -#endif -// UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef UART_CONFIG_LOG_LEVEL -#define UART_CONFIG_LOG_LEVEL 3 -#endif - -// UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef UART_CONFIG_INFO_COLOR -#define UART_CONFIG_INFO_COLOR 0 -#endif - -// UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef UART_CONFIG_DEBUG_COLOR -#define UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// USBD_CONFIG_LOG_ENABLED - Enable logging in the module -//========================================================== -#ifndef USBD_CONFIG_LOG_ENABLED -#define USBD_CONFIG_LOG_ENABLED 0 -#endif -// USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef USBD_CONFIG_LOG_LEVEL -#define USBD_CONFIG_LOG_LEVEL 3 -#endif - -// USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef USBD_CONFIG_INFO_COLOR -#define USBD_CONFIG_INFO_COLOR 0 -#endif - -// USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef USBD_CONFIG_DEBUG_COLOR -#define USBD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// WDT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef WDT_CONFIG_LOG_ENABLED -#define WDT_CONFIG_LOG_ENABLED 0 -#endif -// WDT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef WDT_CONFIG_LOG_LEVEL -#define WDT_CONFIG_LOG_LEVEL 3 -#endif - -// WDT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef WDT_CONFIG_INFO_COLOR -#define WDT_CONFIG_INFO_COLOR 0 -#endif - -// WDT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef WDT_CONFIG_DEBUG_COLOR -#define WDT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// nrf_log in nRF_Libraries - -//========================================================== -// APP_BUTTON_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_BUTTON_CONFIG_LOG_ENABLED -#define APP_BUTTON_CONFIG_LOG_ENABLED 0 -#endif -// APP_BUTTON_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_BUTTON_CONFIG_LOG_LEVEL -#define APP_BUTTON_CONFIG_LOG_LEVEL 3 -#endif - -// APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled. - - -// If module generates a lot of logs, initial log level can -// be decreased to prevent flooding. Severity level can be -// increased on instance basis. -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL -#define APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL 3 -#endif - -// APP_BUTTON_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_BUTTON_CONFIG_INFO_COLOR -#define APP_BUTTON_CONFIG_INFO_COLOR 0 -#endif - -// APP_BUTTON_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_BUTTON_CONFIG_DEBUG_COLOR -#define APP_BUTTON_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_TIMER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_TIMER_CONFIG_LOG_ENABLED -#define APP_TIMER_CONFIG_LOG_ENABLED 0 -#endif -// APP_TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_TIMER_CONFIG_LOG_LEVEL -#define APP_TIMER_CONFIG_LOG_LEVEL 3 -#endif - -// APP_TIMER_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled. - - -// If module generates a lot of logs, initial log level can -// be decreased to prevent flooding. Severity level can be -// increased on instance basis. -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_TIMER_CONFIG_INITIAL_LOG_LEVEL -#define APP_TIMER_CONFIG_INITIAL_LOG_LEVEL 3 -#endif - -// APP_TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_TIMER_CONFIG_INFO_COLOR -#define APP_TIMER_CONFIG_INFO_COLOR 0 -#endif - -// APP_TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_TIMER_CONFIG_DEBUG_COLOR -#define APP_TIMER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED -#define APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL -#define APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_CDC_ACM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CDC_ACM_CONFIG_INFO_COLOR -#define APP_USBD_CDC_ACM_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR -#define APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_CONFIG_LOG_ENABLED - Enable logging in the module. -//========================================================== -#ifndef APP_USBD_CONFIG_LOG_ENABLED -#define APP_USBD_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_CONFIG_LOG_LEVEL -#define APP_USBD_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CONFIG_INFO_COLOR -#define APP_USBD_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_CONFIG_DEBUG_COLOR -#define APP_USBD_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_DUMMY_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_DUMMY_CONFIG_LOG_ENABLED -#define APP_USBD_DUMMY_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_DUMMY_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_DUMMY_CONFIG_LOG_LEVEL -#define APP_USBD_DUMMY_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_DUMMY_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_DUMMY_CONFIG_INFO_COLOR -#define APP_USBD_DUMMY_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_DUMMY_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_DUMMY_CONFIG_DEBUG_COLOR -#define APP_USBD_DUMMY_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_MSC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_MSC_CONFIG_LOG_ENABLED -#define APP_USBD_MSC_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_MSC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_MSC_CONFIG_LOG_LEVEL -#define APP_USBD_MSC_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_MSC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_MSC_CONFIG_INFO_COLOR -#define APP_USBD_MSC_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_MSC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_MSC_CONFIG_DEBUG_COLOR -#define APP_USBD_MSC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED 0 -#endif -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL 3 -#endif - -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR 0 -#endif - -// APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_ATFIFO_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_ATFIFO_CONFIG_LOG_ENABLED -#define NRF_ATFIFO_CONFIG_LOG_ENABLED 0 -#endif -// NRF_ATFIFO_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_ATFIFO_CONFIG_LOG_LEVEL -#define NRF_ATFIFO_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_ATFIFO_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_ATFIFO_CONFIG_INFO_COLOR -#define NRF_ATFIFO_CONFIG_INFO_COLOR 0 -#endif - -// NRF_ATFIFO_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_ATFIFO_CONFIG_DEBUG_COLOR -#define NRF_ATFIFO_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BALLOC_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BALLOC_CONFIG_LOG_ENABLED -#define NRF_BALLOC_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BALLOC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BALLOC_CONFIG_LOG_LEVEL -#define NRF_BALLOC_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled. - - -// If module generates a lot of logs, initial log level can -// be decreased to prevent flooding. Severity level can be -// increased on instance basis. -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL -#define NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL 3 -#endif - -// NRF_BALLOC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BALLOC_CONFIG_INFO_COLOR -#define NRF_BALLOC_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BALLOC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BALLOC_CONFIG_DEBUG_COLOR -#define NRF_BALLOC_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED -#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL -#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR -#define NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR -#define NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED -#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL -#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR -#define NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR -#define NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED -#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED 0 -#endif -// NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL -#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR -#define NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR 0 -#endif - -// NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR -#define NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED -#define NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED 0 -#endif -// NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL -#define NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_CLI_BLE_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_BLE_UART_CONFIG_INFO_COLOR -#define NRF_CLI_BLE_UART_CONFIG_INFO_COLOR 0 -#endif - -// NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR -#define NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED -#define NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED 0 -#endif -// NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL -#define NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR -#define NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR 0 -#endif - -// NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR -#define NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_CLI_UART_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_CLI_UART_CONFIG_LOG_ENABLED -#define NRF_CLI_UART_CONFIG_LOG_ENABLED 0 -#endif -// NRF_CLI_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_CLI_UART_CONFIG_LOG_LEVEL -#define NRF_CLI_UART_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_CLI_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_UART_CONFIG_INFO_COLOR -#define NRF_CLI_UART_CONFIG_INFO_COLOR 0 -#endif - -// NRF_CLI_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_CLI_UART_CONFIG_DEBUG_COLOR -#define NRF_CLI_UART_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_LIBUARTE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_LIBUARTE_CONFIG_LOG_ENABLED -#define NRF_LIBUARTE_CONFIG_LOG_ENABLED 0 -#endif -// NRF_LIBUARTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_LIBUARTE_CONFIG_LOG_LEVEL -#define NRF_LIBUARTE_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_LIBUARTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LIBUARTE_CONFIG_INFO_COLOR -#define NRF_LIBUARTE_CONFIG_INFO_COLOR 0 -#endif - -// NRF_LIBUARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_LIBUARTE_CONFIG_DEBUG_COLOR -#define NRF_LIBUARTE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_MEMOBJ_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_MEMOBJ_CONFIG_LOG_ENABLED -#define NRF_MEMOBJ_CONFIG_LOG_ENABLED 0 -#endif -// NRF_MEMOBJ_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_MEMOBJ_CONFIG_LOG_LEVEL -#define NRF_MEMOBJ_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_MEMOBJ_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MEMOBJ_CONFIG_INFO_COLOR -#define NRF_MEMOBJ_CONFIG_INFO_COLOR 0 -#endif - -// NRF_MEMOBJ_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_MEMOBJ_CONFIG_DEBUG_COLOR -#define NRF_MEMOBJ_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_PWR_MGMT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_PWR_MGMT_CONFIG_LOG_ENABLED -#define NRF_PWR_MGMT_CONFIG_LOG_ENABLED 0 -#endif -// NRF_PWR_MGMT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_PWR_MGMT_CONFIG_LOG_LEVEL -#define NRF_PWR_MGMT_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_PWR_MGMT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_PWR_MGMT_CONFIG_INFO_COLOR -#define NRF_PWR_MGMT_CONFIG_INFO_COLOR 0 -#endif - -// NRF_PWR_MGMT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_PWR_MGMT_CONFIG_DEBUG_COLOR -#define NRF_PWR_MGMT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_QUEUE_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_QUEUE_CONFIG_LOG_ENABLED -#define NRF_QUEUE_CONFIG_LOG_ENABLED 0 -#endif -// NRF_QUEUE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_QUEUE_CONFIG_LOG_LEVEL -#define NRF_QUEUE_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL -#define NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL 3 -#endif - -// NRF_QUEUE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_QUEUE_CONFIG_INFO_COLOR -#define NRF_QUEUE_CONFIG_INFO_COLOR 0 -#endif - -// NRF_QUEUE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_QUEUE_CONFIG_DEBUG_COLOR -#define NRF_QUEUE_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_ANT_LOG_ENABLED - Enable logging in SoftDevice handler (ANT) module. -//========================================================== -#ifndef NRF_SDH_ANT_LOG_ENABLED -#define NRF_SDH_ANT_LOG_ENABLED 0 -#endif -// NRF_SDH_ANT_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_ANT_LOG_LEVEL -#define NRF_SDH_ANT_LOG_LEVEL 3 -#endif - -// NRF_SDH_ANT_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_ANT_INFO_COLOR -#define NRF_SDH_ANT_INFO_COLOR 0 -#endif - -// NRF_SDH_ANT_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_ANT_DEBUG_COLOR -#define NRF_SDH_ANT_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_BLE_LOG_ENABLED - Enable logging in SoftDevice handler (BLE) module. -//========================================================== -#ifndef NRF_SDH_BLE_LOG_ENABLED -#define NRF_SDH_BLE_LOG_ENABLED 1 -#endif -// NRF_SDH_BLE_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_BLE_LOG_LEVEL -#define NRF_SDH_BLE_LOG_LEVEL 3 -#endif - -// NRF_SDH_BLE_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_BLE_INFO_COLOR -#define NRF_SDH_BLE_INFO_COLOR 0 -#endif - -// NRF_SDH_BLE_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_BLE_DEBUG_COLOR -#define NRF_SDH_BLE_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_LOG_ENABLED - Enable logging in SoftDevice handler module. -//========================================================== -#ifndef NRF_SDH_LOG_ENABLED -#define NRF_SDH_LOG_ENABLED 1 -#endif -// NRF_SDH_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_LOG_LEVEL -#define NRF_SDH_LOG_LEVEL 3 -#endif - -// NRF_SDH_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_INFO_COLOR -#define NRF_SDH_INFO_COLOR 0 -#endif - -// NRF_SDH_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_DEBUG_COLOR -#define NRF_SDH_DEBUG_COLOR 0 -#endif - -// - -// NRF_SDH_SOC_LOG_ENABLED - Enable logging in SoftDevice handler (SoC) module. -//========================================================== -#ifndef NRF_SDH_SOC_LOG_ENABLED -#define NRF_SDH_SOC_LOG_ENABLED 1 -#endif -// NRF_SDH_SOC_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SDH_SOC_LOG_LEVEL -#define NRF_SDH_SOC_LOG_LEVEL 3 -#endif - -// NRF_SDH_SOC_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_SOC_INFO_COLOR -#define NRF_SDH_SOC_INFO_COLOR 0 -#endif - -// NRF_SDH_SOC_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SDH_SOC_DEBUG_COLOR -#define NRF_SDH_SOC_DEBUG_COLOR 0 -#endif - -// - -// NRF_SORTLIST_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_SORTLIST_CONFIG_LOG_ENABLED -#define NRF_SORTLIST_CONFIG_LOG_ENABLED 0 -#endif -// NRF_SORTLIST_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_SORTLIST_CONFIG_LOG_LEVEL -#define NRF_SORTLIST_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_SORTLIST_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SORTLIST_CONFIG_INFO_COLOR -#define NRF_SORTLIST_CONFIG_INFO_COLOR 0 -#endif - -// NRF_SORTLIST_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_SORTLIST_CONFIG_DEBUG_COLOR -#define NRF_SORTLIST_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// NRF_TWI_SENSOR_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NRF_TWI_SENSOR_CONFIG_LOG_ENABLED -#define NRF_TWI_SENSOR_CONFIG_LOG_ENABLED 0 -#endif -// NRF_TWI_SENSOR_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NRF_TWI_SENSOR_CONFIG_LOG_LEVEL -#define NRF_TWI_SENSOR_CONFIG_LOG_LEVEL 3 -#endif - -// NRF_TWI_SENSOR_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_TWI_SENSOR_CONFIG_INFO_COLOR -#define NRF_TWI_SENSOR_CONFIG_INFO_COLOR 0 -#endif - -// NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR -#define NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// PM_LOG_ENABLED - Enable logging in Peer Manager and its submodules. -//========================================================== -#ifndef PM_LOG_ENABLED -#define PM_LOG_ENABLED 1 -#endif -// PM_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef PM_LOG_LEVEL -#define PM_LOG_LEVEL 3 -#endif - -// PM_LOG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PM_LOG_INFO_COLOR -#define PM_LOG_INFO_COLOR 0 -#endif - -// PM_LOG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef PM_LOG_DEBUG_COLOR -#define PM_LOG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// nrf_log in nRF_Serialization - -//========================================================== -// SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED -#define SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED 0 -#endif -// SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL -#define SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL 3 -#endif - -// SER_HAL_TRANSPORT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SER_HAL_TRANSPORT_CONFIG_INFO_COLOR -#define SER_HAL_TRANSPORT_CONFIG_INFO_COLOR 0 -#endif - -// SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR -#define SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR 0 -#endif - -// - -// -//========================================================== - -// -//========================================================== - -// - -// NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED - nrf_log_str_formatter - Log string formatter - - -#ifndef NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED -#define NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED 1 -#endif - -// -//========================================================== - -// nRF_NFC - -//========================================================== -// NFC_AC_REC_ENABLED - nfc_ac_rec - NFC NDEF Alternative Carrier record encoder - - -#ifndef NFC_AC_REC_ENABLED -#define NFC_AC_REC_ENABLED 0 -#endif - -// NFC_AC_REC_PARSER_ENABLED - nfc_ac_rec_parser - Alternative Carrier record parser - - -#ifndef NFC_AC_REC_PARSER_ENABLED -#define NFC_AC_REC_PARSER_ENABLED 0 -#endif - -// NFC_BLE_OOB_ADVDATA_ENABLED - nfc_ble_oob_advdata - AD data for OOB pairing encoder -//========================================================== -#ifndef NFC_BLE_OOB_ADVDATA_ENABLED -#define NFC_BLE_OOB_ADVDATA_ENABLED 0 -#endif -// ADVANCED_ADVDATA_SUPPORT - Non-mandatory AD types for BLE OOB pairing are encoded inside the NDEF message (e.g. service UUIDs) - -// <1=> Enabled -// <0=> Disabled - -#ifndef ADVANCED_ADVDATA_SUPPORT -#define ADVANCED_ADVDATA_SUPPORT 0 -#endif - -// - -// NFC_BLE_OOB_ADVDATA_PARSER_ENABLED - nfc_ble_oob_advdata_parser - BLE OOB pairing AD data parser - - -#ifndef NFC_BLE_OOB_ADVDATA_PARSER_ENABLED -#define NFC_BLE_OOB_ADVDATA_PARSER_ENABLED 0 -#endif - -// NFC_BLE_PAIR_LIB_ENABLED - nfc_ble_pair_lib - Library parameters -//========================================================== -#ifndef NFC_BLE_PAIR_LIB_ENABLED -#define NFC_BLE_PAIR_LIB_ENABLED 0 -#endif -// NFC_BLE_PAIR_LIB_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_BLE_PAIR_LIB_LOG_ENABLED -#define NFC_BLE_PAIR_LIB_LOG_ENABLED 0 -#endif -// NFC_BLE_PAIR_LIB_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_BLE_PAIR_LIB_LOG_LEVEL -#define NFC_BLE_PAIR_LIB_LOG_LEVEL 3 -#endif - -// NFC_BLE_PAIR_LIB_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_BLE_PAIR_LIB_INFO_COLOR -#define NFC_BLE_PAIR_LIB_INFO_COLOR 0 -#endif - -// NFC_BLE_PAIR_LIB_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_BLE_PAIR_LIB_DEBUG_COLOR -#define NFC_BLE_PAIR_LIB_DEBUG_COLOR 0 -#endif - -// - -// NFC_BLE_PAIR_LIB_SECURITY_PARAMETERS - Common Peer Manager security parameters. - -//========================================================== -// BLE_NFC_SEC_PARAM_BOND - Enables device bonding. - -// If bonding is enabled at least one of the BLE_NFC_SEC_PARAM_KDIST options must be enabled. -//========================================================== -#ifndef BLE_NFC_SEC_PARAM_BOND -#define BLE_NFC_SEC_PARAM_BOND 1 -#endif -// BLE_NFC_SEC_PARAM_KDIST_OWN_ENC - Enables Long Term Key and Master Identification distribution by device. - - -#ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ENC -#define BLE_NFC_SEC_PARAM_KDIST_OWN_ENC 1 -#endif - -// BLE_NFC_SEC_PARAM_KDIST_OWN_ID - Enables Identity Resolving Key and Identity Address Information distribution by device. - - -#ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ID -#define BLE_NFC_SEC_PARAM_KDIST_OWN_ID 1 -#endif - -// BLE_NFC_SEC_PARAM_KDIST_PEER_ENC - Enables Long Term Key and Master Identification distribution by peer. - - -#ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ENC -#define BLE_NFC_SEC_PARAM_KDIST_PEER_ENC 1 -#endif - -// BLE_NFC_SEC_PARAM_KDIST_PEER_ID - Enables Identity Resolving Key and Identity Address Information distribution by peer. - - -#ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ID -#define BLE_NFC_SEC_PARAM_KDIST_PEER_ID 1 -#endif - -// - -// BLE_NFC_SEC_PARAM_MIN_KEY_SIZE - Minimal size of a security key. - -// <7=> 7 -// <8=> 8 -// <9=> 9 -// <10=> 10 -// <11=> 11 -// <12=> 12 -// <13=> 13 -// <14=> 14 -// <15=> 15 -// <16=> 16 - -#ifndef BLE_NFC_SEC_PARAM_MIN_KEY_SIZE -#define BLE_NFC_SEC_PARAM_MIN_KEY_SIZE 7 -#endif - -// BLE_NFC_SEC_PARAM_MAX_KEY_SIZE - Maximal size of a security key. - -// <7=> 7 -// <8=> 8 -// <9=> 9 -// <10=> 10 -// <11=> 11 -// <12=> 12 -// <13=> 13 -// <14=> 14 -// <15=> 15 -// <16=> 16 - -#ifndef BLE_NFC_SEC_PARAM_MAX_KEY_SIZE -#define BLE_NFC_SEC_PARAM_MAX_KEY_SIZE 16 -#endif - -// -//========================================================== - -// - -// NFC_BLE_PAIR_MSG_ENABLED - nfc_ble_pair_msg - NDEF message for OOB pairing encoder - - -#ifndef NFC_BLE_PAIR_MSG_ENABLED -#define NFC_BLE_PAIR_MSG_ENABLED 0 -#endif - -// NFC_CH_COMMON_ENABLED - nfc_ble_pair_common - OOB pairing common data - - -#ifndef NFC_CH_COMMON_ENABLED -#define NFC_CH_COMMON_ENABLED 0 -#endif - -// NFC_EP_OOB_REC_ENABLED - nfc_ep_oob_rec - EP record for BLE pairing encoder - - -#ifndef NFC_EP_OOB_REC_ENABLED -#define NFC_EP_OOB_REC_ENABLED 0 -#endif - -// NFC_HS_REC_ENABLED - nfc_hs_rec - Handover Select NDEF record encoder - - -#ifndef NFC_HS_REC_ENABLED -#define NFC_HS_REC_ENABLED 0 -#endif - -// NFC_LE_OOB_REC_ENABLED - nfc_le_oob_rec - LE record for BLE pairing encoder - - -#ifndef NFC_LE_OOB_REC_ENABLED -#define NFC_LE_OOB_REC_ENABLED 0 -#endif - -// NFC_LE_OOB_REC_PARSER_ENABLED - nfc_le_oob_rec_parser - LE record parser - - -#ifndef NFC_LE_OOB_REC_PARSER_ENABLED -#define NFC_LE_OOB_REC_PARSER_ENABLED 0 -#endif - -// NFC_NDEF_LAUNCHAPP_MSG_ENABLED - nfc_launchapp_msg - Encoding data for NDEF Application Launching message for NFC Tag - - -#ifndef NFC_NDEF_LAUNCHAPP_MSG_ENABLED -#define NFC_NDEF_LAUNCHAPP_MSG_ENABLED 0 -#endif - -// NFC_NDEF_LAUNCHAPP_REC_ENABLED - nfc_launchapp_rec - Encoding data for NDEF Application Launching record for NFC Tag - - -#ifndef NFC_NDEF_LAUNCHAPP_REC_ENABLED -#define NFC_NDEF_LAUNCHAPP_REC_ENABLED 0 -#endif - -// NFC_NDEF_MSG_ENABLED - nfc_ndef_msg - NFC NDEF Message generator module -//========================================================== -#ifndef NFC_NDEF_MSG_ENABLED -#define NFC_NDEF_MSG_ENABLED 0 -#endif -// NFC_NDEF_MSG_TAG_TYPE - NFC Tag Type - -// <2=> Type 2 Tag -// <4=> Type 4 Tag - -#ifndef NFC_NDEF_MSG_TAG_TYPE -#define NFC_NDEF_MSG_TAG_TYPE 2 -#endif - -// - -// NFC_NDEF_MSG_PARSER_ENABLED - nfc_ndef_msg_parser - NFC NDEF message parser module -//========================================================== -#ifndef NFC_NDEF_MSG_PARSER_ENABLED -#define NFC_NDEF_MSG_PARSER_ENABLED 0 -#endif -// NFC_NDEF_MSG_PARSER_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_NDEF_MSG_PARSER_LOG_ENABLED -#define NFC_NDEF_MSG_PARSER_LOG_ENABLED 0 -#endif -// NFC_NDEF_MSG_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_NDEF_MSG_PARSER_LOG_LEVEL -#define NFC_NDEF_MSG_PARSER_LOG_LEVEL 3 -#endif - -// NFC_NDEF_MSG_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_NDEF_MSG_PARSER_INFO_COLOR -#define NFC_NDEF_MSG_PARSER_INFO_COLOR 0 -#endif - -// - -// - -// NFC_NDEF_RECORD_ENABLED - nfc_ndef_record - NFC NDEF Record generator module - - -#ifndef NFC_NDEF_RECORD_ENABLED -#define NFC_NDEF_RECORD_ENABLED 0 -#endif - -// NFC_NDEF_RECORD_PARSER_ENABLED - nfc_ndef_record_parser - NFC NDEF Record parser module -//========================================================== -#ifndef NFC_NDEF_RECORD_PARSER_ENABLED -#define NFC_NDEF_RECORD_PARSER_ENABLED 0 -#endif -// NFC_NDEF_RECORD_PARSER_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_NDEF_RECORD_PARSER_LOG_ENABLED -#define NFC_NDEF_RECORD_PARSER_LOG_ENABLED 0 -#endif -// NFC_NDEF_RECORD_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_NDEF_RECORD_PARSER_LOG_LEVEL -#define NFC_NDEF_RECORD_PARSER_LOG_LEVEL 3 -#endif - -// NFC_NDEF_RECORD_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_NDEF_RECORD_PARSER_INFO_COLOR -#define NFC_NDEF_RECORD_PARSER_INFO_COLOR 0 -#endif - -// - -// - -// NFC_NDEF_TEXT_RECORD_ENABLED - nfc_text_rec - Encoding data for a text record for NFC Tag - - -#ifndef NFC_NDEF_TEXT_RECORD_ENABLED -#define NFC_NDEF_TEXT_RECORD_ENABLED 0 -#endif - -// NFC_NDEF_URI_MSG_ENABLED - nfc_uri_msg - Encoding data for NDEF message with URI record for NFC Tag - - -#ifndef NFC_NDEF_URI_MSG_ENABLED -#define NFC_NDEF_URI_MSG_ENABLED 0 -#endif - -// NFC_NDEF_URI_REC_ENABLED - nfc_uri_rec - Encoding data for a URI record for NFC Tag - - -#ifndef NFC_NDEF_URI_REC_ENABLED -#define NFC_NDEF_URI_REC_ENABLED 0 -#endif - -// NFC_PLATFORM_ENABLED - nfc_platform - NFC platform module for Clock control. -//========================================================== -#ifndef NFC_PLATFORM_ENABLED -#define NFC_PLATFORM_ENABLED 0 -#endif -// NFC_PLATFORM_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_PLATFORM_LOG_ENABLED -#define NFC_PLATFORM_LOG_ENABLED 0 -#endif -// NFC_PLATFORM_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_PLATFORM_LOG_LEVEL -#define NFC_PLATFORM_LOG_LEVEL 3 -#endif - -// NFC_PLATFORM_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_PLATFORM_INFO_COLOR -#define NFC_PLATFORM_INFO_COLOR 0 -#endif - -// NFC_PLATFORM_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_PLATFORM_DEBUG_COLOR -#define NFC_PLATFORM_DEBUG_COLOR 0 -#endif - -// - -// - -// NFC_T2T_PARSER_ENABLED - nfc_type_2_tag_parser - Parser for decoding Type 2 Tag data -//========================================================== -#ifndef NFC_T2T_PARSER_ENABLED -#define NFC_T2T_PARSER_ENABLED 0 -#endif -// NFC_T2T_PARSER_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_T2T_PARSER_LOG_ENABLED -#define NFC_T2T_PARSER_LOG_ENABLED 0 -#endif -// NFC_T2T_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_T2T_PARSER_LOG_LEVEL -#define NFC_T2T_PARSER_LOG_LEVEL 3 -#endif - -// NFC_T2T_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_T2T_PARSER_INFO_COLOR -#define NFC_T2T_PARSER_INFO_COLOR 0 -#endif - -// - -// - -// NFC_T4T_APDU_ENABLED - nfc_t4t_apdu - APDU encoder/decoder for Type 4 Tag -//========================================================== -#ifndef NFC_T4T_APDU_ENABLED -#define NFC_T4T_APDU_ENABLED 0 -#endif -// NFC_T4T_APDU_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_T4T_APDU_LOG_ENABLED -#define NFC_T4T_APDU_LOG_ENABLED 0 -#endif -// NFC_T4T_APDU_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_T4T_APDU_LOG_LEVEL -#define NFC_T4T_APDU_LOG_LEVEL 3 -#endif - -// NFC_T4T_APDU_LOG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_T4T_APDU_LOG_COLOR -#define NFC_T4T_APDU_LOG_COLOR 0 -#endif - -// - -// - -// NFC_T4T_CC_FILE_PARSER_ENABLED - nfc_t4t_cc_file - Capability Container file for Type 4 Tag -//========================================================== -#ifndef NFC_T4T_CC_FILE_PARSER_ENABLED -#define NFC_T4T_CC_FILE_PARSER_ENABLED 0 -#endif -// NFC_T4T_CC_FILE_PARSER_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_T4T_CC_FILE_PARSER_LOG_ENABLED -#define NFC_T4T_CC_FILE_PARSER_LOG_ENABLED 0 -#endif -// NFC_T4T_CC_FILE_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_T4T_CC_FILE_PARSER_LOG_LEVEL -#define NFC_T4T_CC_FILE_PARSER_LOG_LEVEL 3 -#endif - -// NFC_T4T_CC_FILE_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_T4T_CC_FILE_PARSER_INFO_COLOR -#define NFC_T4T_CC_FILE_PARSER_INFO_COLOR 0 -#endif - -// - -// - -// NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED - nfc_t4t_hl_detection_procedures - NDEF Detection Procedure for Type 4 Tag -//========================================================== -#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED -#define NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED 0 -#endif -// NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED -#define NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED 0 -#endif -// NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL -#define NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL 3 -#endif - -// NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR -#define NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR 0 -#endif - -// - -// APDU_BUFF_SIZE - Size (in bytes) of the buffer for APDU storage -#ifndef APDU_BUFF_SIZE -#define APDU_BUFF_SIZE 250 -#endif - -// CC_STORAGE_BUFF_SIZE - Size (in bytes) of the buffer for CC file storage -#ifndef CC_STORAGE_BUFF_SIZE -#define CC_STORAGE_BUFF_SIZE 64 -#endif - -// - -// NFC_T4T_TLV_BLOCK_PARSER_ENABLED - nfc_t4t_tlv_block - TLV block for Type 4 Tag -//========================================================== -#ifndef NFC_T4T_TLV_BLOCK_PARSER_ENABLED -#define NFC_T4T_TLV_BLOCK_PARSER_ENABLED 0 -#endif -// NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED - Enables logging in the module. -//========================================================== -#ifndef NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED -#define NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED 0 -#endif -// NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug - -#ifndef NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL -#define NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL 3 -#endif - -// NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White - -#ifndef NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR -#define NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR 0 -#endif - -// - -// - -// -//========================================================== - -// nRF_SoftDevice - -//========================================================== -// NRF_SDH_BLE_ENABLED - nrf_sdh_ble - SoftDevice BLE event handler -//========================================================== -#ifndef NRF_SDH_BLE_ENABLED -#define NRF_SDH_BLE_ENABLED 0 -#endif -// BLE Stack configuration - Stack configuration parameters - -// The SoftDevice handler will configure the stack with these parameters when calling @ref nrf_sdh_ble_default_cfg_set. -// Other libraries might depend on these values; keep them up-to-date even if you are not explicitely calling @ref nrf_sdh_ble_default_cfg_set. -//========================================================== -// NRF_SDH_BLE_GAP_DATA_LENGTH <27-251> - - -// Requested BLE GAP data length to be negotiated. - -#ifndef NRF_SDH_BLE_GAP_DATA_LENGTH -#define NRF_SDH_BLE_GAP_DATA_LENGTH 27 -#endif - -// NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. -#ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT -#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 0 -#endif - -// NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. -#ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT -#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0 -#endif - -// NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count. -// Maximum number of total concurrent connections using the default configuration. - -#ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT -#define NRF_SDH_BLE_TOTAL_LINK_COUNT 1 -#endif - -// NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length. -// The time set aside for this connection on every connection interval in 1.25 ms units. - -#ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH -#define NRF_SDH_BLE_GAP_EVENT_LENGTH 6 -#endif - -// NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. -#ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE -#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 23 -#endif - -// NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4. -#ifndef NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE -#define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408 -#endif - -// NRF_SDH_BLE_VS_UUID_COUNT - The number of vendor-specific UUIDs. -#ifndef NRF_SDH_BLE_VS_UUID_COUNT -#define NRF_SDH_BLE_VS_UUID_COUNT 0 -#endif - -// NRF_SDH_BLE_SERVICE_CHANGED - Include the Service Changed characteristic in the Attribute Table. - - -#ifndef NRF_SDH_BLE_SERVICE_CHANGED -#define NRF_SDH_BLE_SERVICE_CHANGED 0 -#endif - -// -//========================================================== - -// BLE Observers - Observers and priority levels - -//========================================================== -// NRF_SDH_BLE_OBSERVER_PRIO_LEVELS - Total number of priority levels for BLE observers. -// This setting configures the number of priority levels available for BLE event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_BLE_OBSERVER_PRIO_LEVELS -#define NRF_SDH_BLE_OBSERVER_PRIO_LEVELS 4 -#endif - -// BLE Observers priorities - Invididual priorities - -//========================================================== -// BLE_ADV_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Advertising module. - -#ifndef BLE_ADV_BLE_OBSERVER_PRIO -#define BLE_ADV_BLE_OBSERVER_PRIO 1 -#endif - -// BLE_ANCS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Apple Notification Service Client. - -#ifndef BLE_ANCS_C_BLE_OBSERVER_PRIO -#define BLE_ANCS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_ANS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Alert Notification Service Client. - -#ifndef BLE_ANS_C_BLE_OBSERVER_PRIO -#define BLE_ANS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_BAS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Battery Service. - -#ifndef BLE_BAS_BLE_OBSERVER_PRIO -#define BLE_BAS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_BAS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Battery Service Client. - -#ifndef BLE_BAS_C_BLE_OBSERVER_PRIO -#define BLE_BAS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_BPS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Blood Pressure Service. - -#ifndef BLE_BPS_BLE_OBSERVER_PRIO -#define BLE_BPS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_CONN_PARAMS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Connection parameters module. - -#ifndef BLE_CONN_PARAMS_BLE_OBSERVER_PRIO -#define BLE_CONN_PARAMS_BLE_OBSERVER_PRIO 1 -#endif - -// BLE_CONN_STATE_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Connection State module. - -#ifndef BLE_CONN_STATE_BLE_OBSERVER_PRIO -#define BLE_CONN_STATE_BLE_OBSERVER_PRIO 0 -#endif - -// BLE_CSCS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Cycling Speed and Cadence Service. - -#ifndef BLE_CSCS_BLE_OBSERVER_PRIO -#define BLE_CSCS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_CTS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Current Time Service Client. - -#ifndef BLE_CTS_C_BLE_OBSERVER_PRIO -#define BLE_CTS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_DB_DISC_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Database Discovery module. - -#ifndef BLE_DB_DISC_BLE_OBSERVER_PRIO -#define BLE_DB_DISC_BLE_OBSERVER_PRIO 1 -#endif - -// BLE_DFU_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the DFU Service. - -#ifndef BLE_DFU_BLE_OBSERVER_PRIO -#define BLE_DFU_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_DIS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Device Information Client. - -#ifndef BLE_DIS_C_BLE_OBSERVER_PRIO -#define BLE_DIS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_GLS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Glucose Service. - -#ifndef BLE_GLS_BLE_OBSERVER_PRIO -#define BLE_GLS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HIDS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Human Interface Device Service. - -#ifndef BLE_HIDS_BLE_OBSERVER_PRIO -#define BLE_HIDS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HRS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Heart Rate Service. - -#ifndef BLE_HRS_BLE_OBSERVER_PRIO -#define BLE_HRS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HRS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Heart Rate Service Client. - -#ifndef BLE_HRS_C_BLE_OBSERVER_PRIO -#define BLE_HRS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_HTS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Health Thermometer Service. - -#ifndef BLE_HTS_BLE_OBSERVER_PRIO -#define BLE_HTS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_IAS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Immediate Alert Service. - -#ifndef BLE_IAS_BLE_OBSERVER_PRIO -#define BLE_IAS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_IAS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Immediate Alert Service Client. - -#ifndef BLE_IAS_C_BLE_OBSERVER_PRIO -#define BLE_IAS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LBS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the LED Button Service. - -#ifndef BLE_LBS_BLE_OBSERVER_PRIO -#define BLE_LBS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LBS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the LED Button Service Client. - -#ifndef BLE_LBS_C_BLE_OBSERVER_PRIO -#define BLE_LBS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LLS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Link Loss Service. - -#ifndef BLE_LLS_BLE_OBSERVER_PRIO -#define BLE_LLS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_LNS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Location Navigation Service. - -#ifndef BLE_LNS_BLE_OBSERVER_PRIO -#define BLE_LNS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_NUS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the UART Service. - -#ifndef BLE_NUS_BLE_OBSERVER_PRIO -#define BLE_NUS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_NUS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the UART Central Service. - -#ifndef BLE_NUS_C_BLE_OBSERVER_PRIO -#define BLE_NUS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_OTS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Object transfer service. - -#ifndef BLE_OTS_BLE_OBSERVER_PRIO -#define BLE_OTS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_OTS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Object transfer service client. - -#ifndef BLE_OTS_C_BLE_OBSERVER_PRIO -#define BLE_OTS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_RSCS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Running Speed and Cadence Service. - -#ifndef BLE_RSCS_BLE_OBSERVER_PRIO -#define BLE_RSCS_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_RSCS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Running Speed and Cadence Client. - -#ifndef BLE_RSCS_C_BLE_OBSERVER_PRIO -#define BLE_RSCS_C_BLE_OBSERVER_PRIO 2 -#endif - -// BLE_TPS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the TX Power Service. - -#ifndef BLE_TPS_BLE_OBSERVER_PRIO -#define BLE_TPS_BLE_OBSERVER_PRIO 2 -#endif - -// BSP_BTN_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Button Control module. - -#ifndef BSP_BTN_BLE_OBSERVER_PRIO -#define BSP_BTN_BLE_OBSERVER_PRIO 1 -#endif - -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the NFC pairing library. - -#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 -#endif - -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the NFC pairing library. - -#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 -#endif - -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the NFC pairing library. - -#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO -#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 -#endif - -// NRF_BLE_BMS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Bond Management Service. - -#ifndef NRF_BLE_BMS_BLE_OBSERVER_PRIO -#define NRF_BLE_BMS_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_CGMS_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Contiuon Glucose Monitoring Service. - -#ifndef NRF_BLE_CGMS_BLE_OBSERVER_PRIO -#define NRF_BLE_CGMS_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_ES_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Eddystone module. - -#ifndef NRF_BLE_ES_BLE_OBSERVER_PRIO -#define NRF_BLE_ES_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the GATT Service Client. - -#ifndef NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO -#define NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_GATT_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the GATT module. - -#ifndef NRF_BLE_GATT_BLE_OBSERVER_PRIO -#define NRF_BLE_GATT_BLE_OBSERVER_PRIO 1 -#endif - -// NRF_BLE_GQ_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the GATT Queue module. - -#ifndef NRF_BLE_GQ_BLE_OBSERVER_PRIO -#define NRF_BLE_GQ_BLE_OBSERVER_PRIO 1 -#endif - -// NRF_BLE_QWR_BLE_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the Queued writes module. - -#ifndef NRF_BLE_QWR_BLE_OBSERVER_PRIO -#define NRF_BLE_QWR_BLE_OBSERVER_PRIO 2 -#endif - -// NRF_BLE_SCAN_OBSERVER_PRIO -// Priority for dispatching the BLE events to the Scanning Module. - -#ifndef NRF_BLE_SCAN_OBSERVER_PRIO -#define NRF_BLE_SCAN_OBSERVER_PRIO 1 -#endif - -// PM_BLE_OBSERVER_PRIO - Priority with which BLE events are dispatched to the Peer Manager module. -#ifndef PM_BLE_OBSERVER_PRIO -#define PM_BLE_OBSERVER_PRIO 1 -#endif - -// -//========================================================== - -// -//========================================================== - - -// - -// NRF_SDH_ENABLED - nrf_sdh - SoftDevice handler -//========================================================== -#ifndef NRF_SDH_ENABLED -#define NRF_SDH_ENABLED 0 -#endif -// Dispatch model - -// This setting configures how Stack events are dispatched to the application. -//========================================================== -// NRF_SDH_DISPATCH_MODEL - - -// NRF_SDH_DISPATCH_MODEL_INTERRUPT: SoftDevice events are passed to the application from the interrupt context. -// NRF_SDH_DISPATCH_MODEL_APPSH: SoftDevice events are scheduled using @ref app_scheduler. -// NRF_SDH_DISPATCH_MODEL_POLLING: SoftDevice events are to be fetched manually. -// <0=> NRF_SDH_DISPATCH_MODEL_INTERRUPT -// <1=> NRF_SDH_DISPATCH_MODEL_APPSH -// <2=> NRF_SDH_DISPATCH_MODEL_POLLING - -#ifndef NRF_SDH_DISPATCH_MODEL -#define NRF_SDH_DISPATCH_MODEL 0 -#endif - -// -//========================================================== - -// Clock - SoftDevice clock configuration - -//========================================================== -// NRF_SDH_CLOCK_LF_SRC - SoftDevice clock source. - -// <0=> NRF_CLOCK_LF_SRC_RC -// <1=> NRF_CLOCK_LF_SRC_XTAL -// <2=> NRF_CLOCK_LF_SRC_SYNTH - -#ifndef NRF_SDH_CLOCK_LF_SRC -#define NRF_SDH_CLOCK_LF_SRC 1 -#endif - -// NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. -#ifndef NRF_SDH_CLOCK_LF_RC_CTIV -#define NRF_SDH_CLOCK_LF_RC_CTIV 0 -#endif - -// NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. -// How often (in number of calibration intervals) the RC oscillator shall be calibrated -// if the temperature has not changed. - -#ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV -#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0 -#endif - -// NRF_SDH_CLOCK_LF_ACCURACY - External clock accuracy used in the LL to compute timing. - -// <0=> NRF_CLOCK_LF_ACCURACY_250_PPM -// <1=> NRF_CLOCK_LF_ACCURACY_500_PPM -// <2=> NRF_CLOCK_LF_ACCURACY_150_PPM -// <3=> NRF_CLOCK_LF_ACCURACY_100_PPM -// <4=> NRF_CLOCK_LF_ACCURACY_75_PPM -// <5=> NRF_CLOCK_LF_ACCURACY_50_PPM -// <6=> NRF_CLOCK_LF_ACCURACY_30_PPM -// <7=> NRF_CLOCK_LF_ACCURACY_20_PPM -// <8=> NRF_CLOCK_LF_ACCURACY_10_PPM -// <9=> NRF_CLOCK_LF_ACCURACY_5_PPM -// <10=> NRF_CLOCK_LF_ACCURACY_2_PPM -// <11=> NRF_CLOCK_LF_ACCURACY_1_PPM - -#ifndef NRF_SDH_CLOCK_LF_ACCURACY -#define NRF_SDH_CLOCK_LF_ACCURACY 7 -#endif - -// -//========================================================== - -// SDH Observers - Observers and priority levels - -//========================================================== -// NRF_SDH_REQ_OBSERVER_PRIO_LEVELS - Total number of priority levels for request observers. -// This setting configures the number of priority levels available for the SoftDevice request event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_REQ_OBSERVER_PRIO_LEVELS -#define NRF_SDH_REQ_OBSERVER_PRIO_LEVELS 2 -#endif - -// NRF_SDH_STATE_OBSERVER_PRIO_LEVELS - Total number of priority levels for state observers. -// This setting configures the number of priority levels available for the SoftDevice state event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_STATE_OBSERVER_PRIO_LEVELS -#define NRF_SDH_STATE_OBSERVER_PRIO_LEVELS 2 -#endif - -// NRF_SDH_STACK_OBSERVER_PRIO_LEVELS - Total number of priority levels for stack event observers. -// This setting configures the number of priority levels available for the SoftDevice stack event handlers (ANT, BLE, SoC). -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_STACK_OBSERVER_PRIO_LEVELS -#define NRF_SDH_STACK_OBSERVER_PRIO_LEVELS 2 -#endif - - -// State Observers priorities - Invididual priorities - -//========================================================== -// CLOCK_CONFIG_STATE_OBSERVER_PRIO -// Priority with which state events are dispatched to the Clock driver. - -#ifndef CLOCK_CONFIG_STATE_OBSERVER_PRIO -#define CLOCK_CONFIG_STATE_OBSERVER_PRIO 0 -#endif - -// POWER_CONFIG_STATE_OBSERVER_PRIO -// Priority with which state events are dispatched to the Power driver. - -#ifndef POWER_CONFIG_STATE_OBSERVER_PRIO -#define POWER_CONFIG_STATE_OBSERVER_PRIO 0 -#endif - -// RNG_CONFIG_STATE_OBSERVER_PRIO -// Priority with which state events are dispatched to this module. - -#ifndef RNG_CONFIG_STATE_OBSERVER_PRIO -#define RNG_CONFIG_STATE_OBSERVER_PRIO 0 -#endif - -// -//========================================================== - -// Stack Event Observers priorities - Invididual priorities - -//========================================================== -// NRF_SDH_ANT_STACK_OBSERVER_PRIO -// This setting configures the priority with which ANT events are processed with respect to other events coming from the stack. -// Modify this setting if you need to have ANT events dispatched before or after other stack events, such as BLE or SoC. -// Zero is the highest priority. - -#ifndef NRF_SDH_ANT_STACK_OBSERVER_PRIO -#define NRF_SDH_ANT_STACK_OBSERVER_PRIO 0 -#endif - -// NRF_SDH_BLE_STACK_OBSERVER_PRIO -// This setting configures the priority with which BLE events are processed with respect to other events coming from the stack. -// Modify this setting if you need to have BLE events dispatched before or after other stack events, such as ANT or SoC. -// Zero is the highest priority. - -#ifndef NRF_SDH_BLE_STACK_OBSERVER_PRIO -#define NRF_SDH_BLE_STACK_OBSERVER_PRIO 0 -#endif - -// NRF_SDH_SOC_STACK_OBSERVER_PRIO -// This setting configures the priority with which SoC events are processed with respect to other events coming from the stack. -// Modify this setting if you need to have SoC events dispatched before or after other stack events, such as ANT or BLE. -// Zero is the highest priority. - -#ifndef NRF_SDH_SOC_STACK_OBSERVER_PRIO -#define NRF_SDH_SOC_STACK_OBSERVER_PRIO 0 -#endif - -// -//========================================================== - -// -//========================================================== - - -// - -// NRF_SDH_SOC_ENABLED - nrf_sdh_soc - SoftDevice SoC event handler -//========================================================== -#ifndef NRF_SDH_SOC_ENABLED -#define NRF_SDH_SOC_ENABLED 0 -#endif -// SoC Observers - Observers and priority levels - -//========================================================== -// NRF_SDH_SOC_OBSERVER_PRIO_LEVELS - Total number of priority levels for SoC observers. -// This setting configures the number of priority levels available for the SoC event handlers. -// The priority level of a handler determines the order in which it receives events, with respect to other handlers. - -#ifndef NRF_SDH_SOC_OBSERVER_PRIO_LEVELS -#define NRF_SDH_SOC_OBSERVER_PRIO_LEVELS 2 -#endif - -// SoC Observers priorities - Invididual priorities - -//========================================================== -// BLE_DFU_SOC_OBSERVER_PRIO -// Priority with which BLE events are dispatched to the DFU Service. - -#ifndef BLE_DFU_SOC_OBSERVER_PRIO -#define BLE_DFU_SOC_OBSERVER_PRIO 1 -#endif - -// CLOCK_CONFIG_SOC_OBSERVER_PRIO -// Priority with which SoC events are dispatched to the Clock driver. - -#ifndef CLOCK_CONFIG_SOC_OBSERVER_PRIO -#define CLOCK_CONFIG_SOC_OBSERVER_PRIO 0 -#endif - -// POWER_CONFIG_SOC_OBSERVER_PRIO -// Priority with which SoC events are dispatched to the Power driver. - -#ifndef POWER_CONFIG_SOC_OBSERVER_PRIO -#define POWER_CONFIG_SOC_OBSERVER_PRIO 0 -#endif - -// -//========================================================== - -// -//========================================================== - - -// - -// -//========================================================== - -// <<< end of configuration section >>> -#endif //SDK_CONFIG_H - diff --git a/third_party/NordicSemiconductor/dependencies/app_util.h b/third_party/NordicSemiconductor/dependencies/app_util.h deleted file mode 100644 index b21e25df5..000000000 --- a/third_party/NordicSemiconductor/dependencies/app_util.h +++ /dev/null @@ -1,1326 +0,0 @@ -/** - * Copyright (c) 2012 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/** @file - * - * @defgroup app_util Utility Functions and Definitions - * @{ - * @ingroup app_common - * - * @brief Various types and definitions available to all applications. - */ - -#ifndef APP_UTIL_H__ -#define APP_UTIL_H__ - -#include -#include -#include -#include "compiler_abstraction.h" -#include "nordic_common.h" -#include "nrf.h" - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @cond (NODOX) - */ -/*lint -save -e27 -e10 -e19 */ -#if defined (__LINT__) -#define STACK_BASE 0x1F000 // Arbitrary value. -#define STACK_TOP 0x20000 // Arbitrary value. - -#elif defined ( __CC_ARM ) -extern char STACK$$Base; -extern char STACK$$Length; -#define STACK_BASE &STACK$$Base -#define STACK_TOP ((void*)((uint32_t)STACK_BASE + (uint32_t)&STACK$$Length)) - -#elif defined ( __ICCARM__ ) -extern char CSTACK$$Base; -extern char CSTACK$$Length; -#define STACK_BASE &CSTACK$$Base -#define STACK_TOP ((void*)((uint32_t)STACK_BASE + (uint32_t)&CSTACK$$Length)) - -#elif defined ( __GNUC__ ) -extern uint32_t __StackTop; -extern uint32_t __StackLimit; -#define STACK_BASE &__StackLimit -#define STACK_TOP &__StackTop -#endif - -/* These macros are valid only when absolute placement is used for the application - * image. The macros are not compile time symbols. They cannot be used as a - * constant expression, for example, inside a static assert or linker script - * at-placement. */ -#if defined (__LINT__) -#define CODE_START (0) // Arbitrary value. -#define CODE_END (0x1000) // Arbitrary value. -#define CODE_SIZE (0x1000) // Arbitrary value. - -#elif defined ( __CC_ARM ) -extern char Load$$LR$$LR_IROM1$$Base; -extern char Load$$LR$$LR_IROM1$$Length; -extern char Load$$LR$$LR_IROM1$$Limit; -#define CODE_START ((uint32_t)&Load$$LR$$LR_IROM1$$Base) -#define CODE_END ((uint32_t)&Load$$LR$$LR_IROM1$$Limit) -#define CODE_SIZE ((uint32_t)&Load$$LR$$LR_IROM1$$Length) - -#elif defined ( __ICCARM__ ) -extern void * __vector_table; -extern char RO_END$$Base; -#define CODE_START ((uint32_t)&__vector_table) -#define CODE_END ((uint32_t)&RO_END$$Base) -#define CODE_SIZE (CODE_END - CODE_START) - -#elif defined(__SES_ARM) -extern uint32_t * _vectors; -extern uint32_t __FLASH_segment_used_end__; -#define CODE_START ((uint32_t)&_vectors) -#define CODE_END ((uint32_t)&__FLASH_segment_used_end__) -#define CODE_SIZE (CODE_END - CODE_START) - -#elif defined ( __GNUC__ ) -extern uint32_t __isr_vector; -extern uint32_t __etext; -#define CODE_START ((uint32_t)&__isr_vector) -#define CODE_END ((uint32_t)&__etext) -#define CODE_SIZE (CODE_END - CODE_START) -#endif -/** @} - * @endcond - */ -/* lint -restore */ - -#if defined(MBR_PRESENT) || defined(SOFTDEVICE_PRESENT) -#include "nrf_mbr.h" -#define BOOTLOADER_ADDRESS ((*(uint32_t *)MBR_BOOTLOADER_ADDR) == 0xFFFFFFFF ? *MBR_UICR_BOOTLOADER_ADDR : *(uint32_t *)MBR_BOOTLOADER_ADDR) /**< The currently configured start address of the bootloader. If 0xFFFFFFFF, no bootloader start address is configured. */ -#define MBR_PARAMS_PAGE_ADDRESS ((*(uint32_t *)MBR_PARAM_PAGE_ADDR) == 0xFFFFFFFF ? *MBR_UICR_PARAM_PAGE_ADDR : *(uint32_t *)MBR_PARAM_PAGE_ADDR) /**< The currently configured address of the MBR params page. If 0xFFFFFFFF, no MBR params page address is configured. */ -#else -#define BOOTLOADER_ADDRESS (NRF_UICR->NRFFW[0]) /**< Check UICR, just in case. */ -#define MBR_PARAMS_PAGE_ADDRESS (NRF_UICR->NRFFW[1]) /**< Check UICR, just in case. */ -#endif - -enum -{ - UNIT_0_625_MS = 625, /**< Number of microseconds in 0.625 milliseconds. */ - UNIT_1_25_MS = 1250, /**< Number of microseconds in 1.25 milliseconds. */ - UNIT_10_MS = 10000 /**< Number of microseconds in 10 milliseconds. */ -}; - -/** - * @brief Counts number of bits required for the given value - * - * The macro technically searches for the highest bit set. - * For value 0 it returns 0. - * - * @param val Value to be processed - * - * @return Number of bits required for the given value - */ -//lint -emacro(572,VBITS) -#define VBITS(val) VBITS_32(val) - -/** - * @def VBITS_1 - * @brief Internal macro used by @ref VBITS */ -/** - * @def VBITS_2 - * @brief Internal macro used by @ref VBITS */ -/** - * @def VBITS_4 - * @brief Internal macro used by @ref VBITS */ -/** - * @def VBITS_8 - * @brief Internal macro used by @ref VBITS */ -/** - * @def VBITS_16 - * @brief Internal macro used by @ref VBITS */ -/** - * @def VBITS_32 - * @brief Internal macro used by @ref VBITS */ -#define VBITS_1( v) ((((v) & (0x0001U << 0)) != 0) ? 1U : 0U) -#define VBITS_2( v) ((((v) & (0x0001U << 1)) != 0) ? VBITS_1 ((v) >> 1) + 1 : VBITS_1 (v)) -#define VBITS_4( v) ((((v) & (0x0003U << 2)) != 0) ? VBITS_2 ((v) >> 2) + 2 : VBITS_2 (v)) -#define VBITS_8( v) ((((v) & (0x000fU << 4)) != 0) ? VBITS_4 ((v) >> 4) + 4 : VBITS_4 (v)) -#define VBITS_16(v) ((((v) & (0x00ffU << 8)) != 0) ? VBITS_8 ((v) >> 8) + 8 : VBITS_8 (v)) -#define VBITS_32(v) ((((v) & (0xffffU << 16)) != 0) ? VBITS_16((v) >> 16) + 16 : VBITS_16(v)) - - -/*Segger embedded studio originally has offsetof macro which cannot be used in macros (like STATIC_ASSERT). - This redefinition is to allow using that. */ -#if defined(__SES_ARM) && defined(__GNUC__) -#undef offsetof -#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) -#endif - -/**@brief Implementation specific macro for delayed macro expansion used in string concatenation -* -* @param[in] lhs Left hand side in concatenation -* @param[in] rhs Right hand side in concatenation -*/ -#define STRING_CONCATENATE_IMPL(lhs, rhs) lhs ## rhs - - -/**@brief Macro used to concatenate string using delayed macro expansion -* -* @note This macro will delay concatenation until the expressions have been resolved -* -* @param[in] lhs Left hand side in concatenation -* @param[in] rhs Right hand side in concatenation -*/ -#define STRING_CONCATENATE(lhs, rhs) STRING_CONCATENATE_IMPL(lhs, rhs) - - -#ifndef __LINT__ - -#ifdef __GNUC__ -#ifdef __cplusplus -#define STATIC_ASSERT_SIMPLE(EXPR) extern char (*_do_assert(void)) [sizeof(char[1 - 2*!(EXPR)])] -#define STATIC_ASSERT_MSG(EXPR, MSG) extern char (*_do_assert(void)) [sizeof(char[1 - 2*!(EXPR)])] -#else -#define STATIC_ASSERT_SIMPLE(EXPR) _Static_assert(EXPR, "unspecified message") -#define STATIC_ASSERT_MSG(EXPR, MSG) _Static_assert(EXPR, MSG) -#endif -#endif - -#ifdef __CC_ARM -#define STATIC_ASSERT_SIMPLE(EXPR) extern char (*_do_assert(void)) [sizeof(char[1 - 2*!(EXPR)])] -#define STATIC_ASSERT_MSG(EXPR, MSG) extern char (*_do_assert(void)) [sizeof(char[1 - 2*!(EXPR)])] -#endif - -#ifdef __ICCARM__ -#define STATIC_ASSERT_SIMPLE(EXPR) static_assert(EXPR, "unspecified message") -#define STATIC_ASSERT_MSG(EXPR, MSG) static_assert(EXPR, MSG) -#endif - -#else // __LINT__ - -#define STATIC_ASSERT_SIMPLE(EXPR) extern char (*_ignore(void)) -#define STATIC_ASSERT_MSG(EXPR, MSG) extern char (*_ignore(void)) - -#endif - - -#define _SELECT_ASSERT_FUNC(x, EXPR, MSG, ASSERT_MACRO, ...) ASSERT_MACRO - -/** - * @brief Static (i.e. compile time) assert macro. - * - * @note The output of STATIC_ASSERT can be different across compilers. - * - * Usage: - * STATIC_ASSERT(expression); - * STATIC_ASSERT(expression, message); - * - * @hideinitializer - */ -//lint -save -esym(???, STATIC_ASSERT) -#define STATIC_ASSERT(...) \ - _SELECT_ASSERT_FUNC(x, ##__VA_ARGS__, \ - STATIC_ASSERT_MSG(__VA_ARGS__), \ - STATIC_ASSERT_SIMPLE(__VA_ARGS__)) -//lint -restore - - -/**@brief Implementation details for NUM_VAR_ARGS */ -#define NUM_VA_ARGS_IMPL( \ - _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ - _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, \ - _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, \ - _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, \ - _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, \ - _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, \ - _61, _62, N, ...) N - - -/**@brief Macro to get the number of arguments in a call variadic macro call - * - * param[in] ... List of arguments - * - * @retval Number of variadic arguments in the argument list - */ -#define NUM_VA_ARGS(...) NUM_VA_ARGS_IMPL(__VA_ARGS__, 63, 62, 61, \ - 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, \ - 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, \ - 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, \ - 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, \ - 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, \ - 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) - -/**@brief Implementation details for NUM_VAR_ARGS */ -#define NUM_VA_ARGS_LESS_1_IMPL( \ - _ignored, \ - _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, \ - _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, \ - _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, \ - _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, \ - _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, \ - _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, \ - _61, _62, N, ...) N - -/**@brief Macro to get the number of arguments in a call variadic macro call. - * First argument is not counted. - * - * param[in] ... List of arguments - * - * @retval Number of variadic arguments in the argument list - */ -#define NUM_VA_ARGS_LESS_1(...) NUM_VA_ARGS_LESS_1_IMPL(__VA_ARGS__, 63, 62, 61, \ - 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, \ - 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, \ - 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, \ - 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, \ - 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, \ - 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, ~) - - -/**@brief type for holding an encoded (i.e. little endian) 16 bit unsigned integer. */ -typedef uint8_t uint16_le_t[2]; - -/**@brief Type for holding an encoded (i.e. little endian) 32 bit unsigned integer. */ -typedef uint8_t uint32_le_t[4]; - -/**@brief Byte array type. */ -typedef struct -{ - uint16_t size; /**< Number of array entries. */ - uint8_t * p_data; /**< Pointer to array entries. */ -} uint8_array_t; - - -/**@brief Macro for performing rounded integer division (as opposed to truncating the result). - * - * @param[in] A Numerator. - * @param[in] B Denominator. - * - * @return Rounded (integer) result of dividing A by B. - */ -#define ROUNDED_DIV(A, B) (((A) + ((B) / 2)) / (B)) - - -/**@brief Macro for checking if an integer is a power of two. - * - * @param[in] A Number to be tested. - * - * @return true if value is power of two. - * @return false if value not power of two. - */ -#define IS_POWER_OF_TWO(A) ( ((A) != 0) && ((((A) - 1) & (A)) == 0) ) - - -/**@brief Macro for converting milliseconds to ticks. - * - * @param[in] TIME Number of milliseconds to convert. - * @param[in] RESOLUTION Unit to be converted to in [us/ticks]. - */ -#define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION)) - - -/**@brief Macro for performing integer division, making sure the result is rounded up. - * - * @details One typical use for this is to compute the number of objects with size B is needed to - * hold A number of bytes. - * - * @param[in] A Numerator. - * @param[in] B Denominator. - * - * @return Integer result of dividing A by B, rounded up. - */ -#define CEIL_DIV(A, B) \ - (((A) + (B) - 1) / (B)) - - -/**@brief Macro for creating a buffer aligned to 4 bytes. - * - * @param[in] NAME Name of the buffor. - * @param[in] MIN_SIZE Size of this buffor (it will be rounded up to multiples of 4 bytes). - */ -#define WORD_ALIGNED_MEM_BUFF(NAME, MIN_SIZE) static uint32_t NAME[CEIL_DIV(MIN_SIZE, sizeof(uint32_t))] - - -/**@brief Macro for calculating the number of words that are needed to hold a number of bytes. - * - * @details Adds 3 and divides by 4. - * - * @param[in] n_bytes The number of bytes. - * - * @return The number of words that @p n_bytes take up (rounded up). - */ -#define BYTES_TO_WORDS(n_bytes) (((n_bytes) + 3) >> 2) - - -/**@brief The number of bytes in a word. - */ -#define BYTES_PER_WORD (4) - - -/**@brief Macro for increasing a number to the nearest (larger) multiple of another number. - * - * @param[in] alignment The number to align to. - * @param[in] number The number to align (increase). - * - * @return The aligned (increased) @p number. - */ -#define ALIGN_NUM(alignment, number) (((number) - 1) + (alignment) - (((number) - 1) % (alignment))) - -/**@brief Macro for getting first of 2 parameters. - * - * @param[in] a1 First parameter. - * @param[in] a2 Second parameter. - */ -#define GET_ARG_1(a1, a2) a1 - -/**@brief Macro for getting second of 2 parameters. - * - * @param[in] a1 First parameter. - * @param[in] a2 Second parameter. - */ -#define GET_ARG_2(a1, a2) a2 - - -/**@brief Container of macro (borrowed from Linux kernel). - * - * This macro returns parent structure address basing on child member address. - * - * @param ptr Address of child type. - * @param type Type of parent structure. - * @param member Name of child field in parent structure. - * - * @return Parent structure address. - * */ -#define CONTAINER_OF(ptr, type, member) \ - (type *)((char *)ptr - offsetof(type, member)) - - -/** - * @brief Define Bit-field mask - * - * Macro that defined the mask with selected number of bits set, starting from - * provided bit number. - * - * @param[in] bcnt Number of bits in the bit-field - * @param[in] boff Lowest bit number - */ -#define BF_MASK(bcnt, boff) ( ((1U << (bcnt)) - 1U) << (boff) ) - -/** - * @brief Get bit-field - * - * Macro that extracts selected bit-field from provided value - * - * @param[in] val Value from which selected bit-field would be extracted - * @param[in] bcnt Number of bits in the bit-field - * @param[in] boff Lowest bit number - * - * @return Value of the selected bits - */ -#define BF_GET(val, bcnt, boff) ( ( (val) & BF_MASK((bcnt), (boff)) ) >> (boff) ) - -/** - * @brief Create bit-field value - * - * Value is masked and shifted to match given bit-field - * - * @param[in] val Value to set on bit-field - * @param[in] bcnt Number of bits for bit-field - * @param[in] boff Offset of bit-field - * - * @return Value positioned of given bit-field. - */ -#define BF_VAL(val, bcnt, boff) ( (((uint32_t)(val)) << (boff)) & BF_MASK(bcnt, boff) ) - -/** - * @name Configuration of complex bit-field - * - * @sa BF_CX - * @{ - */ -/** @brief Position of bit count in complex bit-field value */ -#define BF_CX_BCNT_POS 0U -/** @brief Mask of bit count in complex bit-field value */ -#define BF_CX_BCNT_MASK (0xffU << BF_CX_BCNT_POS) -/** @brief Position of bit position in complex bit-field value */ -#define BF_CX_BOFF_POS 8U -/** @brief Mask of bit position in complex bit-field value */ -#define BF_CX_BOFF_MASK (0xffU << BF_CX_BOFF_POS) -/** @} */ - -/** - * @brief Define complex bit-field - * - * Complex bit-field would contain its position and size in one number. - * @sa BF_CX_MASK - * @sa BF_CX_POS - * @sa BF_CX_GET - * - * @param[in] bcnt Number of bits in the bit-field - * @param[in] boff Lowest bit number - * - * @return The single number that describes the bit-field completely. - */ -#define BF_CX(bcnt, boff) ( ((((uint32_t)(bcnt)) << BF_CX_BCNT_POS) & BF_CX_BCNT_MASK) | ((((uint32_t)(boff)) << BF_CX_BOFF_POS) & BF_CX_BOFF_MASK) ) - -/** - * @brief Get number of bits in bit-field - * - * @sa BF_CX - * - * @param bf_cx Complex bit-field - * - * @return Number of bits in given bit-field - */ -#define BF_CX_BCNT(bf_cx) ( ((bf_cx) & BF_CX_BCNT_MASK) >> BF_CX_BCNT_POS ) - -/** - * @brief Get lowest bit number in the field - * - * @sa BF_CX - * - * @param[in] bf_cx Complex bit-field - * - * @return Lowest bit number in given bit-field - */ -#define BF_CX_BOFF(bf_cx) ( ((bf_cx) & BF_CX_BOFF_MASK) >> BF_CX_BOFF_POS ) - -/** - * @brief Get bit mask of the selected field - * - * @sa BF_CX - * - * @param[in] bf_cx Complex bit-field - * - * @return Mask of given bit-field - */ -#define BF_CX_MASK(bf_cx) BF_MASK(BF_CX_BCNT(bf_cx), BF_CX_BOFF(bf_cx)) - -/** - * @brief Get bit-field - * - * Macro that extracts selected bit-field from provided value. - * Bit-field is given as a complex value. - * - * @sa BF_CX - * @sa BF_GET - * - * @param[in] val Value from which selected bit-field would be extracted - * @param[in] bf_cx Complex bit-field - * - * @return Value of the selected bits. - */ -#define BF_CX_GET(val, bf_cx) BF_GET(val, BF_CX_BCNT(bf_cx), BF_CX_BOFF(bf_cx)) - -/** - * @brief Create bit-field value - * - * Value is masked and shifted to match given bit-field. - * - * @param[in] val Value to set on bit-field - * @param[in] bf_cx Complex bit-field - * - * @return Value positioned of given bit-field. - */ -#define BF_CX_VAL(val, bf_cx) BF_VAL(val, BF_CX_BCNT(bf_cx), BF_CX_BOFF(bf_cx)) - -/** - * @brief Extracting data from the brackets - * - * This macro get rid of brackets around the argument. - * It can be used to pass multiple arguments in logical one argument to a macro. - * Call it with arguments inside brackets: - * @code - * #define ARGUMENTS (a, b, c) - * BRACKET_EXTRACT(ARGUMENTS) - * @endcode - * It would produce: - * @code - * a, b, c - * @endcode - * - * @param a Argument with anything inside brackets - * @return Anything that appears inside the brackets of the argument - * - * @note - * The argument of the macro have to be inside brackets. - * In other case the compilation would fail. - */ -#define BRACKET_EXTRACT(a) BRACKET_EXTRACT_(a) -#define BRACKET_EXTRACT_(a) BRACKET_EXTRACT__ a -#define BRACKET_EXTRACT__(...) __VA_ARGS__ - - -/** - * @brief Check if number of parameters is more than 1 - * - * @param ... Arguments to count - * - * @return 0 If argument count is <= 1 - * @return 1 If argument count is > 1 - * - * @sa NUM_VA_ARGS - * @sa NUM_IS_MORE_THAN_1 - */ -#define NUM_VA_ARGS_IS_MORE_THAN_1(...) NUM_IS_MORE_THAN_1(NUM_VA_ARGS(__VA_ARGS__)) - -/** - * @brief Check if given numeric value is bigger than 1 - * - * This macro accepts numeric value, that may be the result of argument expansion. - * This numeric value is then converted to 0 if it is lover than 1 or to 1 if - * its value is higher than 1. - * The generated result can be used to glue it into other macro mnemonic name. - * - * @param N Numeric value to check - * - * @return 0 If argument is <= 1 - * @return 1 If argument is > 1 - * - * @note Any existing definition of a form NUM_IS_MORE_THAN_1_PROBE_[N] can - * broke the result of this macro - */ -#define NUM_IS_MORE_THAN_1(N) NUM_IS_MORE_THAN_1_(N) -#define NUM_IS_MORE_THAN_1_(N) NUM_IS_MORE_THAN_1_PROBE_(NUM_IS_MORE_THAN_1_PROBE_ ## N, 1) -#define NUM_IS_MORE_THAN_1_PROBE_(...) GET_VA_ARG_1(GET_ARGS_AFTER_1(__VA_ARGS__)) -#define NUM_IS_MORE_THAN_1_PROBE_0 ~, 0 -#define NUM_IS_MORE_THAN_1_PROBE_1 ~, 0 - -/** - * @brief Get the first argument - * - * @param ... Arguments to select - * - * @return First argument or empty if no arguments are provided - */ -#define GET_VA_ARG_1(...) GET_VA_ARG_1_(__VA_ARGS__, ) // Make sure that also for 1 argument it works -#define GET_VA_ARG_1_(a1, ...) a1 - -/** - * @brief Get all the arguments but the first one - * - * @param ... Arguments to select - * - * @return All arguments after the first one or empty if less than 2 arguments are provided - */ -#define GET_ARGS_AFTER_1(...) GET_ARGS_AFTER_1_(__VA_ARGS__, ) // Make sure that also for 1 argument it works -#define GET_ARGS_AFTER_1_(a1, ...) __VA_ARGS__ - -/** - * @brief Size of a field in declared structure - * - * Macro that returns the size of the structure field. - * @param struct_type Variable type to get the field size from - * @param field Field name to analyze. It can be even field inside field (field.somethingelse.and_another). - * - * @return Size of the field - */ -#define FIELD_SIZE(struct_type, field) sizeof(((struct struct_type*)NULL)->field) - -/** - * @brief Number of elements in field array in declared structure - * - * Macro that returns number of elementy in structure field. - * @param struct_type Variable type to get the field size from - * @param field Field name to analyze. - * - * @return Number of elements in field array - * - * @sa FIELD_SIZE - */ -#define FIELD_ARRAY_SIZE(struct_type, field) (FIELD_SIZE(struct_type, field) / FIELD_SIZE(struct_type, field[0])) - -/** - * @brief Mapping macro - * - * Macro that process all arguments using given macro - * - * @param ... Macro name to be used for argument processing followed by arguments to process. - * Macro should have following form: MACRO(argument) - * - * @return All arguments processed by given macro - */ -#define MACRO_MAP(...) MACRO_MAP_(__VA_ARGS__) -#define MACRO_MAP_(...) MACRO_MAP_N(NUM_VA_ARGS_LESS_1(__VA_ARGS__), __VA_ARGS__) // To make sure it works also for 2 arguments in total - -/** - * @brief Mapping macro, recursive version - * - * Can be used in @ref MACRO_MAP macro - */ -#define MACRO_MAP_REC(...) MACRO_MAP_REC_(__VA_ARGS__) -#define MACRO_MAP_REC_(...) MACRO_MAP_REC_N(NUM_VA_ARGS_LESS_1(__VA_ARGS__), __VA_ARGS__) // To make sure it works also for 2 arguments in total -/** - * @brief Mapping N arguments macro - * - * Macro similar to @ref MACRO_MAP but maps exact number of arguments. - * If there is more arguments given, the rest would be ignored. - * - * @param N Number of arguments to map - * @param ... Macro name to be used for argument processing followed by arguments to process. - * Macro should have following form: MACRO(argument) - * - * @return Selected number of arguments processed by given macro - */ -#define MACRO_MAP_N(N, ...) MACRO_MAP_N_(N, __VA_ARGS__) -#define MACRO_MAP_N_(N, ...) CONCAT_2(MACRO_MAP_, N)(__VA_ARGS__, ) - -/** - * @brief Mapping N arguments macro, recursive version - * - * Can be used in @ref MACRO_MAP_N macro - */ -#define MACRO_MAP_REC_N(N, ...) MACRO_MAP_REC_N_(N, __VA_ARGS__) -#define MACRO_MAP_REC_N_(N, ...) CONCAT_2(MACRO_MAP_REC_, N)(__VA_ARGS__, ) - -#define MACRO_MAP_0( ...) -#define MACRO_MAP_1( macro, a, ...) macro(a) -#define MACRO_MAP_2( macro, a, ...) macro(a) MACRO_MAP_1 (macro, __VA_ARGS__, ) -#define MACRO_MAP_3( macro, a, ...) macro(a) MACRO_MAP_2 (macro, __VA_ARGS__, ) -#define MACRO_MAP_4( macro, a, ...) macro(a) MACRO_MAP_3 (macro, __VA_ARGS__, ) -#define MACRO_MAP_5( macro, a, ...) macro(a) MACRO_MAP_4 (macro, __VA_ARGS__, ) -#define MACRO_MAP_6( macro, a, ...) macro(a) MACRO_MAP_5 (macro, __VA_ARGS__, ) -#define MACRO_MAP_7( macro, a, ...) macro(a) MACRO_MAP_6 (macro, __VA_ARGS__, ) -#define MACRO_MAP_8( macro, a, ...) macro(a) MACRO_MAP_7 (macro, __VA_ARGS__, ) -#define MACRO_MAP_9( macro, a, ...) macro(a) MACRO_MAP_8 (macro, __VA_ARGS__, ) -#define MACRO_MAP_10(macro, a, ...) macro(a) MACRO_MAP_9 (macro, __VA_ARGS__, ) -#define MACRO_MAP_11(macro, a, ...) macro(a) MACRO_MAP_10(macro, __VA_ARGS__, ) -#define MACRO_MAP_12(macro, a, ...) macro(a) MACRO_MAP_11(macro, __VA_ARGS__, ) -#define MACRO_MAP_13(macro, a, ...) macro(a) MACRO_MAP_12(macro, __VA_ARGS__, ) -#define MACRO_MAP_14(macro, a, ...) macro(a) MACRO_MAP_13(macro, __VA_ARGS__, ) -#define MACRO_MAP_15(macro, a, ...) macro(a) MACRO_MAP_14(macro, __VA_ARGS__, ) -#define MACRO_MAP_16(macro, a, ...) macro(a) MACRO_MAP_15(macro, __VA_ARGS__, ) -#define MACRO_MAP_17(macro, a, ...) macro(a) MACRO_MAP_16(macro, __VA_ARGS__, ) -#define MACRO_MAP_18(macro, a, ...) macro(a) MACRO_MAP_17(macro, __VA_ARGS__, ) -#define MACRO_MAP_19(macro, a, ...) macro(a) MACRO_MAP_18(macro, __VA_ARGS__, ) -#define MACRO_MAP_20(macro, a, ...) macro(a) MACRO_MAP_19(macro, __VA_ARGS__, ) -#define MACRO_MAP_21(macro, a, ...) macro(a) MACRO_MAP_20(macro, __VA_ARGS__, ) -#define MACRO_MAP_22(macro, a, ...) macro(a) MACRO_MAP_21(macro, __VA_ARGS__, ) -#define MACRO_MAP_23(macro, a, ...) macro(a) MACRO_MAP_22(macro, __VA_ARGS__, ) -#define MACRO_MAP_24(macro, a, ...) macro(a) MACRO_MAP_23(macro, __VA_ARGS__, ) -#define MACRO_MAP_25(macro, a, ...) macro(a) MACRO_MAP_24(macro, __VA_ARGS__, ) -#define MACRO_MAP_26(macro, a, ...) macro(a) MACRO_MAP_25(macro, __VA_ARGS__, ) -#define MACRO_MAP_27(macro, a, ...) macro(a) MACRO_MAP_26(macro, __VA_ARGS__, ) -#define MACRO_MAP_28(macro, a, ...) macro(a) MACRO_MAP_27(macro, __VA_ARGS__, ) -#define MACRO_MAP_29(macro, a, ...) macro(a) MACRO_MAP_28(macro, __VA_ARGS__, ) -#define MACRO_MAP_30(macro, a, ...) macro(a) MACRO_MAP_29(macro, __VA_ARGS__, ) -#define MACRO_MAP_31(macro, a, ...) macro(a) MACRO_MAP_30(macro, __VA_ARGS__, ) -#define MACRO_MAP_32(macro, a, ...) macro(a) MACRO_MAP_31(macro, __VA_ARGS__, ) - - -#define MACRO_MAP_REC_0( ...) -#define MACRO_MAP_REC_1( macro, a, ...) macro(a) -#define MACRO_MAP_REC_2( macro, a, ...) macro(a) MACRO_MAP_REC_1 (macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_3( macro, a, ...) macro(a) MACRO_MAP_REC_2 (macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_4( macro, a, ...) macro(a) MACRO_MAP_REC_3 (macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_5( macro, a, ...) macro(a) MACRO_MAP_REC_4 (macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_6( macro, a, ...) macro(a) MACRO_MAP_REC_5 (macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_7( macro, a, ...) macro(a) MACRO_MAP_REC_6 (macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_8( macro, a, ...) macro(a) MACRO_MAP_REC_7 (macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_9( macro, a, ...) macro(a) MACRO_MAP_REC_8 (macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_10(macro, a, ...) macro(a) MACRO_MAP_REC_9 (macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_11(macro, a, ...) macro(a) MACRO_MAP_REC_10(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_12(macro, a, ...) macro(a) MACRO_MAP_REC_11(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_13(macro, a, ...) macro(a) MACRO_MAP_REC_12(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_14(macro, a, ...) macro(a) MACRO_MAP_REC_13(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_15(macro, a, ...) macro(a) MACRO_MAP_REC_14(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_16(macro, a, ...) macro(a) MACRO_MAP_REC_15(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_17(macro, a, ...) macro(a) MACRO_MAP_REC_16(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_18(macro, a, ...) macro(a) MACRO_MAP_REC_17(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_19(macro, a, ...) macro(a) MACRO_MAP_REC_18(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_20(macro, a, ...) macro(a) MACRO_MAP_REC_19(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_21(macro, a, ...) macro(a) MACRO_MAP_REC_20(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_22(macro, a, ...) macro(a) MACRO_MAP_REC_21(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_23(macro, a, ...) macro(a) MACRO_MAP_REC_22(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_24(macro, a, ...) macro(a) MACRO_MAP_REC_23(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_25(macro, a, ...) macro(a) MACRO_MAP_REC_24(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_26(macro, a, ...) macro(a) MACRO_MAP_REC_25(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_27(macro, a, ...) macro(a) MACRO_MAP_REC_26(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_28(macro, a, ...) macro(a) MACRO_MAP_REC_27(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_29(macro, a, ...) macro(a) MACRO_MAP_REC_28(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_30(macro, a, ...) macro(a) MACRO_MAP_REC_29(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_31(macro, a, ...) macro(a) MACRO_MAP_REC_30(macro, __VA_ARGS__, ) -#define MACRO_MAP_REC_32(macro, a, ...) macro(a) MACRO_MAP_REC_31(macro, __VA_ARGS__, ) - - -/** - * @brief Mapping macro with current index - * - * Basically macro similar to @ref MACRO_MAP, but the processing function would get an argument - * and current argument index (beginning from 0). - * - * @param ... Macro name to be used for argument processing followed by arguments to process. - * Macro should have following form: MACRO(argument, index) - * @return All arguments processed by given macro - */ -#define MACRO_MAP_FOR(...) MACRO_MAP_FOR_(__VA_ARGS__) -#define MACRO_MAP_FOR_N_LIST 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, \ - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 -#define MACRO_MAP_FOR_(...) MACRO_MAP_FOR_N(NUM_VA_ARGS_LESS_1(__VA_ARGS__), __VA_ARGS__) - -/** - * @brief Mapping N arguments macro with current index - * - * Macro is similar to @ref MACRO_MAP_FOR but maps exact number of arguments. - * If there is more arguments given, the rest would be ignored. - * - * @param N Number of arguments to map - * @param ... Macro name to be used for argument processing followed by arguments to process. - * Macro should have following form: MACRO(argument, index) - * - * @return Selected number of arguments processed by given macro - */ -#define MACRO_MAP_FOR_N(N, ...) MACRO_MAP_FOR_N_(N, __VA_ARGS__) -#define MACRO_MAP_FOR_N_(N, ...) CONCAT_2(MACRO_MAP_FOR_, N)((MACRO_MAP_FOR_N_LIST), __VA_ARGS__, ) - -#define MACRO_MAP_FOR_0( n_list, ...) -#define MACRO_MAP_FOR_1( n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) -#define MACRO_MAP_FOR_2( n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_1 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_3( n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_2 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_4( n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_3 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_5( n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_4 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_6( n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_5 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_7( n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_6 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_8( n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_7 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_9( n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_8 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_10(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_9 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_11(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_10((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_12(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_11((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_13(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_12((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_14(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_13((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_15(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_14((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_16(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_15((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_17(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_16((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_18(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_17((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_19(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_18((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_20(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_19((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_21(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_20((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_22(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_21((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_23(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_22((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_24(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_23((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_25(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_24((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_26(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_25((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_27(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_26((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_28(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_27((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_29(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_28((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_30(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_29((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_31(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_30((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_32(n_list, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list))) MACRO_MAP_FOR_31((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__, ) - - -/** - * @brief Mapping macro with current index and parameter - * - * Version of @ref MACRO_MAP_FOR that passes also the same parameter to all macros. - * - * @param param Parameter that would be passed to each macro call during mapping. - * @param ... Macro name to be used for argument processing followed by arguments to process. - * Macro should have following form: MACRO(argument, index, param) - * - * @return All arguments processed by given macro - */ -#define MACRO_MAP_FOR_PARAM(param, ...) MACRO_MAP_FOR_PARAM_(param, __VA_ARGS__) -#define MACRO_MAP_FOR_PARAM_(param, ...) MACRO_MAP_FOR_PARAM_N(NUM_VA_ARGS_LESS_1(__VA_ARGS__), param, __VA_ARGS__) - -/** - * @brief Mapping N arguments macro with with current index and parameter - * - * @param N Number of arguments to map - * @param param Parameter that would be passed to each macro call during mapping. - * @param ... Macro name to be used for argument processing followed by arguments to process. - * Macro should have following form: MACRO(argument, index, param) - * - * @return All arguments processed by given macro - */ -#define MACRO_MAP_FOR_PARAM_N(N, param, ...) MACRO_MAP_FOR_PARAM_N_(N, param, __VA_ARGS__) -#define MACRO_MAP_FOR_PARAM_N_(N, param, ...) CONCAT_2(MACRO_MAP_FOR_PARAM_, N)((MACRO_MAP_FOR_N_LIST), param, __VA_ARGS__, ) - - -#define MACRO_MAP_FOR_PARAM_0( n_list, param, ...) -#define MACRO_MAP_FOR_PARAM_1( n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) -#define MACRO_MAP_FOR_PARAM_2( n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_1 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_3( n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_2 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_4( n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_3 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_5( n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_4 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_6( n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_5 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_7( n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_6 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_8( n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_7 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_9( n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_8 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_10(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_9 ((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_11(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_10((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_12(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_11((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_13(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_12((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_14(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_13((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_15(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_14((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_16(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_15((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_17(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_16((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_18(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_17((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_19(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_18((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_20(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_19((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_21(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_20((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_22(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_21((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_23(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_22((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_24(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_23((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_25(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_24((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_26(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_25((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_27(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_26((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_28(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_27((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_29(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_28((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_30(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_29((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_31(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_30((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) -#define MACRO_MAP_FOR_PARAM_32(n_list, param, macro, a, ...) macro(a, GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), param) MACRO_MAP_FOR_PARAM_31((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), param, macro, __VA_ARGS__, ) - - - -/** - * @brief Repeating macro. - * - * @param count Count of repeats. - * @param macro Macro must have the following form: MACRO(arguments). - * @param ... Arguments passed to the macro. - * - * @return All arguments processed by the given macro. - */ -#define MACRO_REPEAT(count, macro, ...) MACRO_REPEAT_(count, macro, __VA_ARGS__) -#define MACRO_REPEAT_(count, macro, ...) CONCAT_2(MACRO_REPEAT_, count)(macro, __VA_ARGS__) - -#define MACRO_REPEAT_0(macro, ...) -#define MACRO_REPEAT_1(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_0(macro, __VA_ARGS__) -#define MACRO_REPEAT_2(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_1(macro, __VA_ARGS__) -#define MACRO_REPEAT_3(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_2(macro, __VA_ARGS__) -#define MACRO_REPEAT_4(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_3(macro, __VA_ARGS__) -#define MACRO_REPEAT_5(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_4(macro, __VA_ARGS__) -#define MACRO_REPEAT_6(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_5(macro, __VA_ARGS__) -#define MACRO_REPEAT_7(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_6(macro, __VA_ARGS__) -#define MACRO_REPEAT_8(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_7(macro, __VA_ARGS__) -#define MACRO_REPEAT_9(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_8(macro, __VA_ARGS__) -#define MACRO_REPEAT_10(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_9(macro, __VA_ARGS__) -#define MACRO_REPEAT_11(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_10(macro, __VA_ARGS__) -#define MACRO_REPEAT_12(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_11(macro, __VA_ARGS__) -#define MACRO_REPEAT_13(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_12(macro, __VA_ARGS__) -#define MACRO_REPEAT_14(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_13(macro, __VA_ARGS__) -#define MACRO_REPEAT_15(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_14(macro, __VA_ARGS__) -#define MACRO_REPEAT_16(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_15(macro, __VA_ARGS__) -#define MACRO_REPEAT_17(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_16(macro, __VA_ARGS__) -#define MACRO_REPEAT_18(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_17(macro, __VA_ARGS__) -#define MACRO_REPEAT_19(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_18(macro, __VA_ARGS__) -#define MACRO_REPEAT_20(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_19(macro, __VA_ARGS__) -#define MACRO_REPEAT_21(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_20(macro, __VA_ARGS__) -#define MACRO_REPEAT_22(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_21(macro, __VA_ARGS__) -#define MACRO_REPEAT_23(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_22(macro, __VA_ARGS__) -#define MACRO_REPEAT_24(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_23(macro, __VA_ARGS__) -#define MACRO_REPEAT_25(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_24(macro, __VA_ARGS__) -#define MACRO_REPEAT_26(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_25(macro, __VA_ARGS__) -#define MACRO_REPEAT_27(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_26(macro, __VA_ARGS__) -#define MACRO_REPEAT_28(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_27(macro, __VA_ARGS__) -#define MACRO_REPEAT_29(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_28(macro, __VA_ARGS__) -#define MACRO_REPEAT_30(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_29(macro, __VA_ARGS__) -#define MACRO_REPEAT_31(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_30(macro, __VA_ARGS__) -#define MACRO_REPEAT_32(macro, ...) macro(__VA_ARGS__) MACRO_REPEAT_31(macro, __VA_ARGS__) - - -/** - * @brief Repeating macro with current index. - * - * Macro similar to @ref MACRO_REPEAT but the processing function gets the arguments - * and the current argument index (beginning from 0). - - * @param count Count of repeats. - * @param macro Macro must have the following form: MACRO(index, arguments). - * @param ... Arguments passed to the macro. - * - * @return All arguments processed by the given macro. - */ -#define MACRO_REPEAT_FOR(count, macro, ...) MACRO_REPEAT_FOR_(count, macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_(count, macro, ...) CONCAT_2(MACRO_REPEAT_FOR_, count)((MACRO_MAP_FOR_N_LIST), macro, __VA_ARGS__) - -#define MACRO_REPEAT_FOR_0(n_list, macro, ...) -#define MACRO_REPEAT_FOR_1(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_0((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_2(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_1((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_3(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_2((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_4(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_3((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_5(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_4((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_6(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_5((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_7(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_6((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_8(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_7((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_9(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_8((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_10(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_9((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_11(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_10((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_12(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_11((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_13(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_12((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_14(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_13((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_15(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_14((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_16(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_15((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_17(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_16((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_18(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_17((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_19(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_18((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_20(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_19((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_21(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_20((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_22(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_21((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_23(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_22((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_24(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_23((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_25(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_24((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_26(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_25((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_27(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_26((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_28(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_27((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_29(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_28((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_30(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_29((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_31(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_30((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) -#define MACRO_REPEAT_FOR_32(n_list, macro, ...) macro(GET_VA_ARG_1(BRACKET_EXTRACT(n_list)), __VA_ARGS__) MACRO_REPEAT_FOR_31((GET_ARGS_AFTER_1(BRACKET_EXTRACT(n_list))), macro, __VA_ARGS__) - - -/**@brief Adding curly brace to the macro parameter. - * - * Useful in array of structures initialization. - * - * @param p Parameter to put into the curly brace. */ -#define PARAM_CBRACE(p) { p }, - - -/**@brief Function for changing the value unit. - * - * @param[in] value Value to be rescaled. - * @param[in] old_unit_reversal Reversal of the incoming unit. - * @param[in] new_unit_reversal Reversal of the desired unit. - * - * @return Number of bytes written. - */ -static __INLINE uint64_t value_rescale(uint32_t value, uint32_t old_unit_reversal, uint16_t new_unit_reversal) -{ - return (uint64_t)ROUNDED_DIV((uint64_t)value * new_unit_reversal, old_unit_reversal); -} - -/**@brief Function for encoding a uint16 value. - * - * @param[in] value Value to be encoded. - * @param[out] p_encoded_data Buffer where the encoded data is to be written. - * - * @return Number of bytes written. - */ -static __INLINE uint8_t uint16_encode(uint16_t value, uint8_t * p_encoded_data) -{ - p_encoded_data[0] = (uint8_t) ((value & 0x00FF) >> 0); - p_encoded_data[1] = (uint8_t) ((value & 0xFF00) >> 8); - return sizeof(uint16_t); -} - -/**@brief Function for encoding a three-byte value. - * - * @param[in] value Value to be encoded. - * @param[out] p_encoded_data Buffer where the encoded data is to be written. - * - * @return Number of bytes written. - */ -static __INLINE uint8_t uint24_encode(uint32_t value, uint8_t * p_encoded_data) -{ - p_encoded_data[0] = (uint8_t) ((value & 0x000000FF) >> 0); - p_encoded_data[1] = (uint8_t) ((value & 0x0000FF00) >> 8); - p_encoded_data[2] = (uint8_t) ((value & 0x00FF0000) >> 16); - return 3; -} - -/**@brief Function for encoding a uint32 value. - * - * @param[in] value Value to be encoded. - * @param[out] p_encoded_data Buffer where the encoded data is to be written. - * - * @return Number of bytes written. - */ -static __INLINE uint8_t uint32_encode(uint32_t value, uint8_t * p_encoded_data) -{ - p_encoded_data[0] = (uint8_t) ((value & 0x000000FF) >> 0); - p_encoded_data[1] = (uint8_t) ((value & 0x0000FF00) >> 8); - p_encoded_data[2] = (uint8_t) ((value & 0x00FF0000) >> 16); - p_encoded_data[3] = (uint8_t) ((value & 0xFF000000) >> 24); - return sizeof(uint32_t); -} - -/**@brief Function for encoding a uint40 value. - * - * @param[in] value Value to be encoded. - * @param[out] p_encoded_data Buffer where the encoded data is to be written. - * - * @return Number of bytes written. - */ -static __INLINE uint8_t uint40_encode(uint64_t value, uint8_t * p_encoded_data) -{ - p_encoded_data[0] = (uint8_t) ((value & 0x00000000FF) >> 0); - p_encoded_data[1] = (uint8_t) ((value & 0x000000FF00) >> 8); - p_encoded_data[2] = (uint8_t) ((value & 0x0000FF0000) >> 16); - p_encoded_data[3] = (uint8_t) ((value & 0x00FF000000) >> 24); - p_encoded_data[4] = (uint8_t) ((value & 0xFF00000000) >> 32); - return 5; -} - -/**@brief Function for encoding a uint48 value. - * - * @param[in] value Value to be encoded. - * @param[out] p_encoded_data Buffer where the encoded data is to be written. - * - * @return Number of bytes written. - */ -static __INLINE uint8_t uint48_encode(uint64_t value, uint8_t * p_encoded_data) -{ - p_encoded_data[0] = (uint8_t) ((value & 0x0000000000FF) >> 0); - p_encoded_data[1] = (uint8_t) ((value & 0x00000000FF00) >> 8); - p_encoded_data[2] = (uint8_t) ((value & 0x000000FF0000) >> 16); - p_encoded_data[3] = (uint8_t) ((value & 0x0000FF000000) >> 24); - p_encoded_data[4] = (uint8_t) ((value & 0x00FF00000000) >> 32); - p_encoded_data[5] = (uint8_t) ((value & 0xFF0000000000) >> 40); - return 6; -} - -/**@brief Function for decoding a uint16 value. - * - * @param[in] p_encoded_data Buffer where the encoded data is stored. - * - * @return Decoded value. - */ -static __INLINE uint16_t uint16_decode(const uint8_t * p_encoded_data) -{ - return ( (((uint16_t)((uint8_t *)p_encoded_data)[0])) | - (((uint16_t)((uint8_t *)p_encoded_data)[1]) << 8 )); -} - -/**@brief Function for decoding a uint16 value in big-endian format. - * - * @param[in] p_encoded_data Buffer where the encoded data is stored. - * - * @return Decoded value. - */ -static __INLINE uint16_t uint16_big_decode(const uint8_t * p_encoded_data) -{ - return ( (((uint16_t)((uint8_t *)p_encoded_data)[0]) << 8 ) | - (((uint16_t)((uint8_t *)p_encoded_data)[1])) ); -} - -/**@brief Function for decoding a three-byte value. - * - * @param[in] p_encoded_data Buffer where the encoded data is stored. - * - * @return Decoded value (uint32_t). - */ -static __INLINE uint32_t uint24_decode(const uint8_t * p_encoded_data) -{ - return ( (((uint32_t)((uint8_t *)p_encoded_data)[0]) << 0) | - (((uint32_t)((uint8_t *)p_encoded_data)[1]) << 8) | - (((uint32_t)((uint8_t *)p_encoded_data)[2]) << 16)); -} - -/**@brief Function for decoding a uint32 value. - * - * @param[in] p_encoded_data Buffer where the encoded data is stored. - * - * @return Decoded value. - */ -static __INLINE uint32_t uint32_decode(const uint8_t * p_encoded_data) -{ - return ( (((uint32_t)((uint8_t *)p_encoded_data)[0]) << 0) | - (((uint32_t)((uint8_t *)p_encoded_data)[1]) << 8) | - (((uint32_t)((uint8_t *)p_encoded_data)[2]) << 16) | - (((uint32_t)((uint8_t *)p_encoded_data)[3]) << 24 )); -} - -/**@brief Function for decoding a uint32 value in big-endian format. - * - * @param[in] p_encoded_data Buffer where the encoded data is stored. - * - * @return Decoded value. - */ -static __INLINE uint32_t uint32_big_decode(const uint8_t * p_encoded_data) -{ - return ( (((uint32_t)((uint8_t *)p_encoded_data)[0]) << 24) | - (((uint32_t)((uint8_t *)p_encoded_data)[1]) << 16) | - (((uint32_t)((uint8_t *)p_encoded_data)[2]) << 8) | - (((uint32_t)((uint8_t *)p_encoded_data)[3]) << 0) ); -} - -/** - * @brief Function for encoding an uint16 value in big-endian format. - * - * @param[in] value Value to be encoded. - * @param[out] p_encoded_data Buffer where the encoded data will be written. - * - * @return Number of bytes written. - */ -static __INLINE uint8_t uint16_big_encode(uint16_t value, uint8_t * p_encoded_data) -{ - p_encoded_data[0] = (uint8_t) (value >> 8); - p_encoded_data[1] = (uint8_t) (value & 0xFF); - - return sizeof(uint16_t); -} - -/*lint -esym(526, __rev) */ -/*lint -esym(628, __rev) */ -/**@brief Function for encoding a uint32 value in big-endian format. - * - * @param[in] value Value to be encoded. - * @param[out] p_encoded_data Buffer where the encoded data will be written. - * The address pointed to must be word alligned. - * - * @return Number of bytes written. - */ -static __INLINE uint8_t uint32_big_encode(uint32_t value, uint8_t * p_encoded_data) -{ - *(uint32_t *)p_encoded_data = __REV(value); - return sizeof(uint32_t); -} - -/**@brief Function for decoding a uint40 value. - * - * @param[in] p_encoded_data Buffer where the encoded data is stored. - * - * @return Decoded value. (uint64_t) - */ -static __INLINE uint64_t uint40_decode(const uint8_t * p_encoded_data) -{ - return ( (((uint64_t)((uint8_t *)p_encoded_data)[0]) << 0) | - (((uint64_t)((uint8_t *)p_encoded_data)[1]) << 8) | - (((uint64_t)((uint8_t *)p_encoded_data)[2]) << 16) | - (((uint64_t)((uint8_t *)p_encoded_data)[3]) << 24) | - (((uint64_t)((uint8_t *)p_encoded_data)[4]) << 32 )); -} - -/**@brief Function for decoding a uint48 value. - * - * @param[in] p_encoded_data Buffer where the encoded data is stored. - * - * @return Decoded value. (uint64_t) - */ -static __INLINE uint64_t uint48_decode(const uint8_t * p_encoded_data) -{ - return ( (((uint64_t)((uint8_t *)p_encoded_data)[0]) << 0) | - (((uint64_t)((uint8_t *)p_encoded_data)[1]) << 8) | - (((uint64_t)((uint8_t *)p_encoded_data)[2]) << 16) | - (((uint64_t)((uint8_t *)p_encoded_data)[3]) << 24) | - (((uint64_t)((uint8_t *)p_encoded_data)[4]) << 32) | - (((uint64_t)((uint8_t *)p_encoded_data)[5]) << 40 )); -} - -/** @brief Function for converting the input voltage (in milli volts) into percentage of 3.0 Volts. - * - * @details The calculation is based on a linearized version of the battery's discharge - * curve. 3.0V returns 100% battery level. The limit for power failure is 2.1V and - * is considered to be the lower boundary. - * - * The discharge curve for CR2032 is non-linear. In this model it is split into - * 4 linear sections: - * - Section 1: 3.0V - 2.9V = 100% - 42% (58% drop on 100 mV) - * - Section 2: 2.9V - 2.74V = 42% - 18% (24% drop on 160 mV) - * - Section 3: 2.74V - 2.44V = 18% - 6% (12% drop on 300 mV) - * - Section 4: 2.44V - 2.1V = 6% - 0% (6% drop on 340 mV) - * - * These numbers are by no means accurate. Temperature and - * load in the actual application is not accounted for! - * - * @param[in] mvolts The voltage in mV - * - * @return Battery level in percent. -*/ -static __INLINE uint8_t battery_level_in_percent(const uint16_t mvolts) -{ - uint8_t battery_level; - - if (mvolts >= 3000) - { - battery_level = 100; - } - else if (mvolts > 2900) - { - battery_level = 100 - ((3000 - mvolts) * 58) / 100; - } - else if (mvolts > 2740) - { - battery_level = 42 - ((2900 - mvolts) * 24) / 160; - } - else if (mvolts > 2440) - { - battery_level = 18 - ((2740 - mvolts) * 12) / 300; - } - else if (mvolts > 2100) - { - battery_level = 6 - ((2440 - mvolts) * 6) / 340; - } - else - { - battery_level = 0; - } - - return battery_level; -} - -/**@brief Function for checking if a pointer value is aligned to a 4 byte boundary. - * - * @param[in] p Pointer value to be checked. - * - * @return TRUE if pointer is aligned to a 4 byte boundary, FALSE otherwise. - */ -static __INLINE bool is_word_aligned(void const* p) -{ - return (((uintptr_t)p & 0x03) == 0); -} - -/*lint -e{568, 685} */ -/** - * @brief Function for checking if provided address is located in stack space. - * - * @param[in] ptr Pointer to be checked. - * - * @return true if address is in stack space, false otherwise. - */ -static __INLINE bool is_address_from_stack(void * ptr) -{ - if (((uint32_t)ptr >= (uint32_t)STACK_BASE) && - ((uint32_t)ptr < (uint32_t)STACK_TOP) ) - { - return true; - } - else - { - return false; - } -} - -#ifdef __cplusplus -} -#endif - -#endif // APP_UTIL_H__ - -/** @} */ diff --git a/third_party/NordicSemiconductor/dependencies/app_util_platform.c b/third_party/NordicSemiconductor/dependencies/app_util_platform.c deleted file mode 100644 index 8e4f121e4..000000000 --- a/third_party/NordicSemiconductor/dependencies/app_util_platform.c +++ /dev/null @@ -1,129 +0,0 @@ -/** - * Copyright (c) 2014 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include "app_util_platform.h" - -#ifdef SOFTDEVICE_PRESENT -/* Global nvic state instance, required by nrf_nvic.h */ -nrf_nvic_state_t nrf_nvic_state; -#endif - -static uint32_t m_in_critical_region = 0; - -void app_util_disable_irq(void) -{ - __disable_irq(); - m_in_critical_region++; -} - -void app_util_enable_irq(void) -{ - m_in_critical_region--; - if (m_in_critical_region == 0) - { - __enable_irq(); - } -} - -void app_util_critical_region_enter(uint8_t *p_nested) -{ -#if __CORTEX_M == (0x04U) - ASSERT(APP_LEVEL_PRIVILEGED == privilege_level_get()) -#endif - -#if defined(SOFTDEVICE_PRESENT) - /* return value can be safely ignored */ - (void) sd_nvic_critical_region_enter(p_nested); -#else - UNUSED_PARAMETER(p_nested); - app_util_disable_irq(); -#endif -} - -void app_util_critical_region_exit(uint8_t nested) -{ -#if __CORTEX_M == (0x04U) - ASSERT(APP_LEVEL_PRIVILEGED == privilege_level_get()) -#endif - -#if defined(SOFTDEVICE_PRESENT) - /* return value can be safely ignored */ - (void) sd_nvic_critical_region_exit(nested); -#else - UNUSED_PARAMETER(nested); - app_util_enable_irq(); -#endif -} - - -uint8_t privilege_level_get(void) -{ -#if __CORTEX_M == (0x00U) || defined(_WIN32) || defined(__unix) || defined(__APPLE__) - /* the Cortex-M0 has no concept of privilege */ - return APP_LEVEL_PRIVILEGED; -#elif __CORTEX_M == (0x04U) - uint32_t isr_vector_num = __get_IPSR() & IPSR_ISR_Msk ; - if (0 == isr_vector_num) - { - /* Thread Mode, check nPRIV */ - int32_t control = __get_CONTROL(); - return control & CONTROL_nPRIV_Msk ? APP_LEVEL_UNPRIVILEGED : APP_LEVEL_PRIVILEGED; - } - else - { - /* Handler Mode, always privileged */ - return APP_LEVEL_PRIVILEGED; - } -#endif -} - - -uint8_t current_int_priority_get(void) -{ - uint32_t isr_vector_num = __get_IPSR() & IPSR_ISR_Msk ; - if (isr_vector_num > 0) - { - int32_t irq_type = ((int32_t)isr_vector_num - EXTERNAL_INT_VECTOR_OFFSET); - return (NVIC_GetPriority((IRQn_Type)irq_type) & 0xFF); - } - else - { - return APP_IRQ_PRIORITY_THREAD; - } -} diff --git a/third_party/NordicSemiconductor/dependencies/app_util_platform.h b/third_party/NordicSemiconductor/dependencies/app_util_platform.h deleted file mode 100644 index dd41339ac..000000000 --- a/third_party/NordicSemiconductor/dependencies/app_util_platform.h +++ /dev/null @@ -1,281 +0,0 @@ -/** - * Copyright (c) 2014 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/**@file - * - * @defgroup app_util_platform Utility Functions and Definitions (Platform) - * @{ - * @ingroup app_common - * - * @brief Various types and definitions available to all applications when using SoftDevice. - */ - -#ifndef APP_UTIL_PLATFORM_H__ -#define APP_UTIL_PLATFORM_H__ - -#include -#include "compiler_abstraction.h" -#include "nrf.h" -#ifdef SOFTDEVICE_PRESENT -#include "nrf_soc.h" -#include "nrf_nvic.h" -#endif -#include "nrf_assert.h" -#include "app_error.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if __CORTEX_M == (0x00U) -#define _PRIO_SD_HIGH 0 -#define _PRIO_APP_HIGH 1 -#define _PRIO_APP_MID 1 -#define _PRIO_SD_LOW 2 -#define _PRIO_APP_LOW_MID 3 -#define _PRIO_APP_LOW 3 -#define _PRIO_APP_LOWEST 3 -#define _PRIO_THREAD 4 -#elif __CORTEX_M == (0x04U) -#define _PRIO_SD_HIGH 0 -#define _PRIO_SD_MID 1 -#define _PRIO_APP_HIGH 2 -#define _PRIO_APP_MID 3 -#define _PRIO_SD_LOW 4 -#define _PRIO_APP_LOW_MID 5 -#define _PRIO_APP_LOW 6 -#define _PRIO_APP_LOWEST 7 -#define _PRIO_THREAD 15 -#else - #error "No platform defined" -#endif - - -//lint -save -e113 -e452 -/**@brief The interrupt priorities available to the application while the SoftDevice is active. */ -typedef enum -{ -#ifndef SOFTDEVICE_PRESENT - APP_IRQ_PRIORITY_HIGHEST = _PRIO_SD_HIGH, -#else - APP_IRQ_PRIORITY_HIGHEST = _PRIO_APP_HIGH, -#endif - APP_IRQ_PRIORITY_HIGH = _PRIO_APP_HIGH, -#ifndef SOFTDEVICE_PRESENT - APP_IRQ_PRIORITY_MID = _PRIO_SD_LOW, -#else - APP_IRQ_PRIORITY_MID = _PRIO_APP_MID, -#endif - APP_IRQ_PRIORITY_LOW_MID = _PRIO_APP_LOW_MID, - APP_IRQ_PRIORITY_LOW = _PRIO_APP_LOW, - APP_IRQ_PRIORITY_LOWEST = _PRIO_APP_LOWEST, - APP_IRQ_PRIORITY_THREAD = _PRIO_THREAD /**< "Interrupt level" when running in Thread Mode. */ -} app_irq_priority_t; -//lint -restore - - -/*@brief The privilege levels available to applications in Thread Mode */ -typedef enum -{ - APP_LEVEL_UNPRIVILEGED, - APP_LEVEL_PRIVILEGED -} app_level_t; - -/**@cond NO_DOXYGEN */ -#define EXTERNAL_INT_VECTOR_OFFSET 16 -/**@endcond */ - -/**@brief Macro for setting a breakpoint. - */ -#if defined(__GNUC__) -#define NRF_BREAKPOINT __asm__("BKPT 0"); -#else -#define NRF_BREAKPOINT __BKPT(0) -#endif - -/** @brief Macro for setting a breakpoint. - * - * If it is possible to detect debugger presence then it is set only in that case. - * - */ -#if __CORTEX_M == 0x04 -#define NRF_BREAKPOINT_COND do { \ - /* C_DEBUGEN == 1 -> Debugger Connected */ \ - if (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) \ - { \ - /* Generate breakpoint if debugger is connected */ \ - NRF_BREAKPOINT; \ - } \ - }while (0) -#else -#define NRF_BREAKPOINT_COND NRF_BREAKPOINT -#endif // __CORTEX_M == 0x04 - -#if defined ( __CC_ARM ) -#define PACKED(TYPE) __packed TYPE -#define PACKED_STRUCT PACKED(struct) -#elif defined ( __GNUC__ ) -#define PACKED __attribute__((packed)) -#define PACKED_STRUCT struct PACKED -#elif defined (__ICCARM__) -#define PACKED_STRUCT __packed struct -#endif - -#if defined ( __CC_ARM ) -#define PRAGMA_OPTIMIZATION_FORCE_START _Pragma ("push") \ - _Pragma ("O3") -#define PRAGMA_OPTIMIZATION_FORCE_END _Pragma ("pop") -#elif defined ( __GNUC__ ) -#define PRAGMA_OPTIMIZATION_FORCE_START _Pragma("GCC push_options") \ - _Pragma ("GCC optimize (\"Os\")") -#define PRAGMA_OPTIMIZATION_FORCE_END _Pragma ("GCC pop_options") -#elif defined (__ICCARM__) -#define PRAGMA_OPTIMIZATION_FORCE_START _Pragma ("optimize=high z") -#define PRAGMA_OPTIMIZATION_FORCE_END -#endif - - -void app_util_critical_region_enter (uint8_t *p_nested); -void app_util_critical_region_exit (uint8_t nested); - -/**@brief Macro for entering a critical region. - * - * @note Due to implementation details, there must exist one and only one call to - * CRITICAL_REGION_EXIT() for each call to CRITICAL_REGION_ENTER(), and they must be located - * in the same scope. - */ -#ifdef SOFTDEVICE_PRESENT -#define CRITICAL_REGION_ENTER() \ - { \ - uint8_t __CR_NESTED = 0; \ - app_util_critical_region_enter(&__CR_NESTED); -#else -#define CRITICAL_REGION_ENTER() app_util_critical_region_enter(NULL) -#endif - -/**@brief Macro for leaving a critical region. - * - * @note Due to implementation details, there must exist one and only one call to - * CRITICAL_REGION_EXIT() for each call to CRITICAL_REGION_ENTER(), and they must be located - * in the same scope. - */ -#ifdef SOFTDEVICE_PRESENT -#define CRITICAL_REGION_EXIT() \ - app_util_critical_region_exit(__CR_NESTED); \ - } -#else -#define CRITICAL_REGION_EXIT() app_util_critical_region_exit(0) -#endif - -/* Workaround for Keil 4 */ -#ifndef IPSR_ISR_Msk -#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ -#endif - - - -/**@brief Macro to enable anonymous unions from a certain point in the code. - */ -#if defined(__CC_ARM) - #define ANON_UNIONS_ENABLE _Pragma("push") \ - _Pragma("anon_unions") \ - struct semicolon_swallower -#elif defined(__ICCARM__) - #define ANON_UNIONS_ENABLE _Pragma("language=extended") \ - struct semicolon_swallower -#else - #define ANON_UNIONS_ENABLE struct semicolon_swallower - // No action will be taken. - // For GCC anonymous unions are enabled by default. -#endif - -/**@brief Macro to disable anonymous unions from a certain point in the code. - * @note Call only after first calling @ref ANON_UNIONS_ENABLE. - */ -#if defined(__CC_ARM) - #define ANON_UNIONS_DISABLE _Pragma("pop") \ - struct semicolon_swallower -#elif defined(__ICCARM__) - #define ANON_UNIONS_DISABLE struct semicolon_swallower - // for IAR leave anonymous unions enabled -#else - #define ANON_UNIONS_DISABLE struct semicolon_swallower - // No action will be taken. - // For GCC anonymous unions are enabled by default. -#endif - -/**@brief Macro for adding pragma directive only for GCC. - */ -#ifdef __GNUC__ -#define GCC_PRAGMA(v) _Pragma(v) -#else -#define GCC_PRAGMA(v) -#endif - -/* Workaround for Keil 4 */ -#ifndef CONTROL_nPRIV_Msk -#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ -#endif - -/**@brief Function for finding the current interrupt level. - * - * @return Current interrupt level. - * @retval APP_IRQ_PRIORITY_HIGH We are running in Application High interrupt level. - * @retval APP_IRQ_PRIORITY_LOW We are running in Application Low interrupt level. - * @retval APP_IRQ_PRIORITY_THREAD We are running in Thread Mode. - */ -uint8_t current_int_priority_get(void); - - -/**@brief Function for finding out the current privilege level. - * - * @return Current privilege level. - * @retval APP_LEVEL_UNPRIVILEGED We are running in unprivileged level. - * @retval APP_LEVEL_PRIVILEGED We are running in privileged level. - */ -uint8_t privilege_level_get(void); - - -#ifdef __cplusplus -} -#endif - -#endif // APP_UTIL_PLATFORM_H__ - -/** @} */ diff --git a/third_party/NordicSemiconductor/dependencies/legacy/apply_old_config.h b/third_party/NordicSemiconductor/dependencies/legacy/apply_old_config.h deleted file mode 100644 index b371852cf..000000000 --- a/third_party/NordicSemiconductor/dependencies/legacy/apply_old_config.h +++ /dev/null @@ -1,1391 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - - -#ifndef APPLY_OLD_CONFIG_H__ -#define APPLY_OLD_CONFIG_H__ - -//------------------------------------------------------------------------------ -// Peripheral Resource Sharing (PRS) - -#if defined(PERIPHERAL_RESOURCE_SHARING_ENABLED) - -#define NRFX_PRS_ENABLED PERIPHERAL_RESOURCE_SHARING_ENABLED -#define NRFX_PRS_BOX_0_ENABLED PERIPHERAL_RESOURCE_SHARING_ENABLED -#define NRFX_PRS_BOX_1_ENABLED PERIPHERAL_RESOURCE_SHARING_ENABLED -#define NRFX_PRS_BOX_2_ENABLED PERIPHERAL_RESOURCE_SHARING_ENABLED -#define NRFX_PRS_BOX_3_ENABLED PERIPHERAL_RESOURCE_SHARING_ENABLED -#define NRFX_PRS_BOX_4_ENABLED PERIPHERAL_RESOURCE_SHARING_ENABLED - -#if defined(COMMON_CONFIG_LOG_ENABLED) -#undef NRFX_PRS_CONFIG_LOG_ENABLED -#define NRFX_PRS_CONFIG_LOG_ENABLED COMMON_CONFIG_LOG_ENABLED -#endif -#if defined(COMMON_CONFIG_LOG_LEVEL) -#undef NRFX_PRS_CONFIG_LOG_LEVEL -#define NRFX_PRS_CONFIG_LOG_LEVEL COMMON_CONFIG_LOG_LEVEL -#endif -#if defined(COMMON_CONFIG_INFO_COLOR) -#undef NRFX_PRS_CONFIG_INFO_COLOR -#define NRFX_PRS_CONFIG_INFO_COLOR COMMON_CONFIG_INFO_COLOR -#endif -#if defined(COMMON_CONFIG_DEBUG_COLOR) -#undef NRFX_PRS_CONFIG_DEBUG_COLOR -#define NRFX_PRS_CONFIG_DEBUG_COLOR COMMON_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(PERIPHERAL_RESOURCE_SHARING_ENABLED) - -//------------------------------------------------------------------------------ -// CLOCK - -#if defined(NRF_CLOCK_ENABLED) - -#if defined(CLOCK_CONFIG_LF_CAL_ENABLED) && defined(CLOCK_CONFIG_LF_SRC) -#if (CLOCK_CONFIG_LF_SRC == CLOCK_LFCLKSRC_SRC_RC) -#define NRFX_CLOCK_CONFIG_LF_CAL_ENABLED 1 -#endif -#endif - -#undef NRFX_CLOCK_ENABLED -#define NRFX_CLOCK_ENABLED NRF_CLOCK_ENABLED - -#if defined(CLOCK_CONFIG_LF_SRC) -#undef NRFX_CLOCK_CONFIG_LF_SRC -#define NRFX_CLOCK_CONFIG_LF_SRC CLOCK_CONFIG_LF_SRC -#endif -#if defined(CLOCK_CONFIG_IRQ_PRIORITY) -#undef NRFX_CLOCK_CONFIG_IRQ_PRIORITY -#define NRFX_CLOCK_CONFIG_IRQ_PRIORITY CLOCK_CONFIG_IRQ_PRIORITY -#endif - -#if defined(CLOCK_CONFIG_LOG_ENABLED) -#undef NRFX_CLOCK_CONFIG_LOG_ENABLED -#define NRFX_CLOCK_CONFIG_LOG_ENABLED CLOCK_CONFIG_LOG_ENABLED -#endif -#if defined(CLOCK_CONFIG_LOG_LEVEL) -#undef NRFX_CLOCK_CONFIG_LOG_LEVEL -#define NRFX_CLOCK_CONFIG_LOG_LEVEL CLOCK_CONFIG_LOG_LEVEL -#endif -#if defined(CLOCK_CONFIG_INFO_COLOR) -#undef NRFX_CLOCK_CONFIG_INFO_COLOR -#define NRFX_CLOCK_CONFIG_INFO_COLOR CLOCK_CONFIG_INFO_COLOR -#endif -#if defined(CLOCK_CONFIG_DEBUG_COLOR) -#undef NRFX_CLOCK_CONFIG_DEBUG_COLOR -#define NRFX_CLOCK_CONFIG_DEBUG_COLOR CLOCK_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(NRF_CLOCK_ENABLED) - -//------------------------------------------------------------------------------ -// COMP - -#if defined(COMP_ENABLED) - -#undef NRFX_COMP_ENABLED -#define NRFX_COMP_ENABLED COMP_ENABLED - -#if defined(COMP_CONFIG_REF) -#undef NRFX_COMP_CONFIG_REF -#define NRFX_COMP_CONFIG_REF COMP_CONFIG_REF -#endif -#if defined(COMP_CONFIG_MAIN_MODE) -#undef NRFX_COMP_CONFIG_MAIN_MODE -#define NRFX_COMP_CONFIG_MAIN_MODE COMP_CONFIG_MAIN_MODE -#endif -#if defined(COMP_CONFIG_SPEED_MODE) -#undef NRFX_COMP_CONFIG_SPEED_MODE -#define NRFX_COMP_CONFIG_SPEED_MODE COMP_CONFIG_SPEED_MODE -#endif -#if defined(COMP_CONFIG_HYST) -#undef NRFX_COMP_CONFIG_HYST -#define NRFX_COMP_CONFIG_HYST COMP_CONFIG_HYST -#endif -#if defined(COMP_CONFIG_ISOURCE) -#undef NRFX_COMP_CONFIG_ISOURCE -#define NRFX_COMP_CONFIG_ISOURCE COMP_CONFIG_ISOURCE -#endif -#if defined(COMP_CONFIG_INPUT) -#undef NRFX_COMP_CONFIG_INPUT -#define NRFX_COMP_CONFIG_INPUT COMP_CONFIG_INPUT -#endif -#if defined(COMP_CONFIG_IRQ_PRIORITY) -#undef NRFX_COMP_CONFIG_IRQ_PRIORITY -#define NRFX_COMP_CONFIG_IRQ_PRIORITY COMP_CONFIG_IRQ_PRIORITY -#endif - -#if defined(COMP_CONFIG_LOG_ENABLED) -#undef NRFX_COMP_CONFIG_LOG_ENABLED -#define NRFX_COMP_CONFIG_LOG_ENABLED COMP_CONFIG_LOG_ENABLED -#endif -#if defined(COMP_CONFIG_LOG_LEVEL) -#undef NRFX_COMP_CONFIG_LOG_LEVEL -#define NRFX_COMP_CONFIG_LOG_LEVEL COMP_CONFIG_LOG_LEVEL -#endif -#if defined(COMP_CONFIG_INFO_COLOR) -#undef NRFX_COMP_CONFIG_INFO_COLOR -#define NRFX_COMP_CONFIG_INFO_COLOR COMP_CONFIG_INFO_COLOR -#endif -#if defined(COMP_CONFIG_DEBUG_COLOR) -#undef NRFX_COMP_CONFIG_DEBUG_COLOR -#define NRFX_COMP_CONFIG_DEBUG_COLOR COMP_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(COMP_ENABLED) - -//------------------------------------------------------------------------------ -// GPIOTE - -#if defined(GPIOTE_ENABLED) - -#undef NRFX_GPIOTE_ENABLED -#define NRFX_GPIOTE_ENABLED GPIOTE_ENABLED - -#if defined(GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS) -#undef NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS -#define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS -#endif - -#if defined(GPIOTE_CONFIG_IRQ_PRIORITY) -#undef NRFX_GPIOTE_CONFIG_IRQ_PRIORITY -#define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY GPIOTE_CONFIG_IRQ_PRIORITY -#endif - -#if defined(GPIOTE_CONFIG_LOG_ENABLED) -#undef NRFX_GPIOTE_CONFIG_LOG_ENABLED -#define NRFX_GPIOTE_CONFIG_LOG_ENABLED GPIOTE_CONFIG_LOG_ENABLED -#endif -#if defined(GPIOTE_CONFIG_LOG_LEVEL) -#undef NRFX_GPIOTE_CONFIG_LOG_LEVEL -#define NRFX_GPIOTE_CONFIG_LOG_LEVEL GPIOTE_CONFIG_LOG_LEVEL -#endif -#if defined(GPIOTE_CONFIG_INFO_COLOR) -#undef NRFX_GPIOTE_CONFIG_INFO_COLOR -#define NRFX_GPIOTE_CONFIG_INFO_COLOR GPIOTE_CONFIG_INFO_COLOR -#endif -#if defined(GPIOTE_CONFIG_DEBUG_COLOR) -#undef NRFX_GPIOTE_CONFIG_DEBUG_COLOR -#define NRFX_GPIOTE_CONFIG_DEBUG_COLOR GPIOTE_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(GPIOTE_ENABLED) - -//------------------------------------------------------------------------------ -// I2S - -#if defined(I2S_ENABLED) - -#undef NRFX_I2S_ENABLED -#define NRFX_I2S_ENABLED I2S_ENABLED - -#if defined(I2S_CONFIG_SCK_PIN) -#undef NRFX_I2S_CONFIG_SCK_PIN -#define NRFX_I2S_CONFIG_SCK_PIN I2S_CONFIG_SCK_PIN -#endif -#if defined(I2S_CONFIG_LRCK_PIN) -#undef NRFX_I2S_CONFIG_LRCK_PIN -#define NRFX_I2S_CONFIG_LRCK_PIN I2S_CONFIG_LRCK_PIN -#endif -#if defined(I2S_CONFIG_MCK_PIN) -#undef NRFX_I2S_CONFIG_MCK_PIN -#define NRFX_I2S_CONFIG_MCK_PIN I2S_CONFIG_MCK_PIN -#endif -#if defined(I2S_CONFIG_SDOUT_PIN) -#undef NRFX_I2S_CONFIG_SDOUT_PIN -#define NRFX_I2S_CONFIG_SDOUT_PIN I2S_CONFIG_SDOUT_PIN -#endif -#if defined(I2S_CONFIG_SDIN_PIN) -#undef NRFX_I2S_CONFIG_SDIN_PIN -#define NRFX_I2S_CONFIG_SDIN_PIN I2S_CONFIG_SDIN_PIN -#endif - -#if defined(I2S_CONFIG_MASTER) -#undef NRFX_I2S_CONFIG_MASTER -#define NRFX_I2S_CONFIG_MASTER I2S_CONFIG_MASTER -#endif -#if defined(I2S_CONFIG_FORMAT) -#undef NRFX_I2S_CONFIG_FORMAT -#define NRFX_I2S_CONFIG_FORMAT I2S_CONFIG_FORMAT -#endif -#if defined(I2S_CONFIG_ALIGN) -#undef NRFX_I2S_CONFIG_ALIGN -#define NRFX_I2S_CONFIG_ALIGN I2S_CONFIG_ALIGN -#endif -#if defined(I2S_CONFIG_SWIDTH) -#undef NRFX_I2S_CONFIG_SWIDTH -#define NRFX_I2S_CONFIG_SWIDTH I2S_CONFIG_SWIDTH -#endif -#if defined(I2S_CONFIG_CHANNELS) -#undef NRFX_I2S_CONFIG_CHANNELS -#define NRFX_I2S_CONFIG_CHANNELS I2S_CONFIG_CHANNELS -#endif -#if defined(I2S_CONFIG_MCK_SETUP) -#undef NRFX_I2S_CONFIG_MCK_SETUP -#define NRFX_I2S_CONFIG_MCK_SETUP I2S_CONFIG_MCK_SETUP -#endif -#if defined(I2S_CONFIG_RATIO) -#undef NRFX_I2S_CONFIG_RATIO -#define NRFX_I2S_CONFIG_RATIO I2S_CONFIG_RATIO -#endif -#if defined(I2S_CONFIG_IRQ_PRIORITY) -#undef NRFX_I2S_CONFIG_IRQ_PRIORITY -#define NRFX_I2S_CONFIG_IRQ_PRIORITY I2S_CONFIG_IRQ_PRIORITY -#endif - -#if defined(I2S_CONFIG_LOG_ENABLED) -#undef NRFX_I2S_CONFIG_LOG_ENABLED -#define NRFX_I2S_CONFIG_LOG_ENABLED I2S_CONFIG_LOG_ENABLED -#endif -#if defined(I2S_CONFIG_LOG_LEVEL) -#undef NRFX_I2S_CONFIG_LOG_LEVEL -#define NRFX_I2S_CONFIG_LOG_LEVEL I2S_CONFIG_LOG_LEVEL -#endif -#if defined(I2S_CONFIG_INFO_COLOR) -#undef NRFX_I2S_CONFIG_INFO_COLOR -#define NRFX_I2S_CONFIG_INFO_COLOR I2S_CONFIG_INFO_COLOR -#endif -#if defined(I2S_CONFIG_DEBUG_COLOR) -#undef NRFX_I2S_CONFIG_DEBUG_COLOR -#define NRFX_I2S_CONFIG_DEBUG_COLOR I2S_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(I2S_ENABLED) - -//------------------------------------------------------------------------------ -// LPCOMP - -#if defined(LPCOMP_ENABLED) - -#undef NRFX_LPCOMP_ENABLED -#define NRFX_LPCOMP_ENABLED LPCOMP_ENABLED - -#if defined(LPCOMP_CONFIG_REFERENCE) -#undef NRFX_LPCOMP_CONFIG_REFERENCE -#define NRFX_LPCOMP_CONFIG_REFERENCE LPCOMP_CONFIG_REFERENCE -#endif -#if defined(LPCOMP_CONFIG_DETECTION) -#undef NRFX_LPCOMP_CONFIG_DETECTION -#define NRFX_LPCOMP_CONFIG_DETECTION LPCOMP_CONFIG_DETECTION -#endif -#if defined(LPCOMP_CONFIG_INPUT) -#undef NRFX_LPCOMP_CONFIG_INPUT -#define NRFX_LPCOMP_CONFIG_INPUT LPCOMP_CONFIG_INPUT -#endif -#if defined(LPCOMP_CONFIG_HYST) -#undef NRFX_LPCOMP_CONFIG_HYST -#define NRFX_LPCOMP_CONFIG_HYST LPCOMP_CONFIG_HYST -#endif -#if defined(LPCOMP_CONFIG_IRQ_PRIORITY) -#undef NRFX_LPCOMP_CONFIG_IRQ_PRIORITY -#define NRFX_LPCOMP_CONFIG_IRQ_PRIORITY LPCOMP_CONFIG_IRQ_PRIORITY -#endif - -#if defined(LPCOMP_CONFIG_LOG_ENABLED) -#undef NRFX_LPCOMP_CONFIG_LOG_ENABLED -#define NRFX_LPCOMP_CONFIG_LOG_ENABLED LPCOMP_CONFIG_LOG_ENABLED -#endif -#if defined(LPCOMP_CONFIG_LOG_LEVEL) -#undef NRFX_LPCOMP_CONFIG_LOG_LEVEL -#define NRFX_LPCOMP_CONFIG_LOG_LEVEL LPCOMP_CONFIG_LOG_LEVEL -#endif -#if defined(LPCOMP_CONFIG_INFO_COLOR) -#undef NRFX_LPCOMP_CONFIG_INFO_COLOR -#define NRFX_LPCOMP_CONFIG_INFO_COLOR LPCOMP_CONFIG_INFO_COLOR -#endif -#if defined(LPCOMP_CONFIG_DEBUG_COLOR) -#undef NRFX_LPCOMP_CONFIG_DEBUG_COLOR -#define NRFX_LPCOMP_CONFIG_DEBUG_COLOR LPCOMP_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(LPCOMP_ENABLED) - -//------------------------------------------------------------------------------ -// PDM - -#if defined(PDM_ENABLED) - -#undef NRFX_PDM_ENABLED -#define NRFX_PDM_ENABLED PDM_ENABLED - -#if defined(PDM_CONFIG_MODE) -#undef NRFX_PDM_CONFIG_MODE -#define NRFX_PDM_CONFIG_MODE PDM_CONFIG_MODE -#endif -#if defined(PDM_CONFIG_EDGE) -#undef NRFX_PDM_CONFIG_EDGE -#define NRFX_PDM_CONFIG_EDGE PDM_CONFIG_EDGE -#endif -#if defined(PDM_CONFIG_CLOCK_FREQ) -#undef NRFX_PDM_CONFIG_CLOCK_FREQ -#define NRFX_PDM_CONFIG_CLOCK_FREQ PDM_CONFIG_CLOCK_FREQ -#endif -#if defined(PDM_CONFIG_IRQ_PRIORITY) -#undef NRFX_PDM_CONFIG_IRQ_PRIORITY -#define NRFX_PDM_CONFIG_IRQ_PRIORITY PDM_CONFIG_IRQ_PRIORITY -#endif - -#if defined(PDM_CONFIG_LOG_ENABLED) -#undef NRFX_PDM_CONFIG_LOG_ENABLED -#define NRFX_PDM_CONFIG_LOG_ENABLED PDM_CONFIG_LOG_ENABLED -#endif -#if defined(PDM_CONFIG_LOG_LEVEL) -#undef NRFX_PDM_CONFIG_LOG_LEVEL -#define NRFX_PDM_CONFIG_LOG_LEVEL PDM_CONFIG_LOG_LEVEL -#endif -#if defined(PDM_CONFIG_INFO_COLOR) -#undef NRFX_PDM_CONFIG_INFO_COLOR -#define NRFX_PDM_CONFIG_INFO_COLOR PDM_CONFIG_INFO_COLOR -#endif -#if defined(PDM_CONFIG_DEBUG_COLOR) -#undef NRFX_PDM_CONFIG_DEBUG_COLOR -#define NRFX_PDM_CONFIG_DEBUG_COLOR PDM_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(PDM_ENABLED) - -//------------------------------------------------------------------------------ -// POWER - -#if defined(POWER_ENABLED) - -#undef NRFX_POWER_ENABLED -#define NRFX_POWER_ENABLED POWER_ENABLED - -#if defined(POWER_CONFIG_IRQ_PRIORITY) -#undef NRFX_POWER_CONFIG_IRQ_PRIORITY -#define NRFX_POWER_CONFIG_IRQ_PRIORITY POWER_CONFIG_IRQ_PRIORITY -#endif - -#if defined(POWER_CONFIG_DEFAULT_DCDCEN) -#undef NRFX_POWER_CONFIG_DEFAULT_DCDCEN -#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN POWER_CONFIG_DEFAULT_DCDCEN -#endif -#if defined(POWER_CONFIG_DEFAULT_DCDCENHV) -#undef NRFX_POWER_CONFIG_DEFAULT_DCDCENHV -#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV POWER_CONFIG_DEFAULT_DCDCENHV -#endif - -#endif // defined(POWER_ENABLED) - -//------------------------------------------------------------------------------ -// PPI - -#if defined(PPI_ENABLED) - -#undef NRFX_PPI_ENABLED -#define NRFX_PPI_ENABLED PPI_ENABLED - -#if defined(PPI_CONFIG_LOG_ENABLED) -#undef NRFX_PPI_CONFIG_LOG_ENABLED -#define NRFX_PPI_CONFIG_LOG_ENABLED PPI_CONFIG_LOG_ENABLED -#endif -#if defined(PPI_CONFIG_LOG_LEVEL) -#undef NRFX_PPI_CONFIG_LOG_LEVEL -#define NRFX_PPI_CONFIG_LOG_LEVEL PPI_CONFIG_LOG_LEVEL -#endif -#if defined(PPI_CONFIG_INFO_COLOR) -#undef NRFX_PPI_CONFIG_INFO_COLOR -#define NRFX_PPI_CONFIG_INFO_COLOR PPI_CONFIG_INFO_COLOR -#endif -#if defined(PPI_CONFIG_DEBUG_COLOR) -#undef NRFX_PPI_CONFIG_DEBUG_COLOR -#define NRFX_PPI_CONFIG_DEBUG_COLOR PPI_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(PPI_ENABLED) - -//------------------------------------------------------------------------------ -// PWM - -#if defined(PWM_ENABLED) - -#undef NRFX_PWM_ENABLED -#define NRFX_PWM_ENABLED PWM_ENABLED - -#if defined(PWM0_ENABLED) -#undef NRFX_PWM0_ENABLED -#define NRFX_PWM0_ENABLED PWM0_ENABLED -#endif -#if defined(PWM1_ENABLED) -#undef NRFX_PWM1_ENABLED -#define NRFX_PWM1_ENABLED PWM1_ENABLED -#endif -#if defined(PWM2_ENABLED) -#undef NRFX_PWM2_ENABLED -#define NRFX_PWM2_ENABLED PWM2_ENABLED -#endif -#if defined(PWM3_ENABLED) -#undef NRFX_PWM3_ENABLED -#define NRFX_PWM3_ENABLED PWM3_ENABLED -#endif - -#if defined(PWM_DEFAULT_CONFIG_OUT0_PIN) -#undef NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN PWM_DEFAULT_CONFIG_OUT0_PIN -#endif -#if defined(PWM_DEFAULT_CONFIG_OUT1_PIN) -#undef NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN PWM_DEFAULT_CONFIG_OUT1_PIN -#endif -#if defined(PWM_DEFAULT_CONFIG_OUT2_PIN) -#undef NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN PWM_DEFAULT_CONFIG_OUT2_PIN -#endif -#if defined(PWM_DEFAULT_CONFIG_OUT3_PIN) -#undef NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN -#define NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN PWM_DEFAULT_CONFIG_OUT3_PIN -#endif -#if defined(PWM_DEFAULT_CONFIG_BASE_CLOCK) -#undef NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK -#define NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK PWM_DEFAULT_CONFIG_BASE_CLOCK -#endif -#if defined(PWM_DEFAULT_CONFIG_COUNT_MODE) -#undef NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE -#define NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE PWM_DEFAULT_CONFIG_COUNT_MODE -#endif -#if defined(PWM_DEFAULT_CONFIG_TOP_VALUE) -#undef NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE -#define NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE PWM_DEFAULT_CONFIG_TOP_VALUE -#endif -#if defined(PWM_DEFAULT_CONFIG_LOAD_MODE) -#undef NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE -#define NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE PWM_DEFAULT_CONFIG_LOAD_MODE -#endif -#if defined(PWM_DEFAULT_CONFIG_STEP_MODE) -#undef NRFX_PWM_DEFAULT_CONFIG_STEP_MODE -#define NRFX_PWM_DEFAULT_CONFIG_STEP_MODE PWM_DEFAULT_CONFIG_STEP_MODE -#endif -#if defined(PWM_DEFAULT_CONFIG_IRQ_PRIORITY) -#undef NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY PWM_DEFAULT_CONFIG_IRQ_PRIORITY -#endif - -#if defined(PWM_CONFIG_LOG_ENABLED) -#undef NRFX_PWM_CONFIG_LOG_ENABLED -#define NRFX_PWM_CONFIG_LOG_ENABLED PWM_CONFIG_LOG_ENABLED -#endif -#if defined(PWM_CONFIG_LOG_LEVEL) -#undef NRFX_PWM_CONFIG_LOG_LEVEL -#define NRFX_PWM_CONFIG_LOG_LEVEL PWM_CONFIG_LOG_LEVEL -#endif -#if defined(PWM_CONFIG_INFO_COLOR) -#undef NRFX_PWM_CONFIG_INFO_COLOR -#define NRFX_PWM_CONFIG_INFO_COLOR PWM_CONFIG_INFO_COLOR -#endif -#if defined(PWM_CONFIG_DEBUG_COLOR) -#undef NRFX_PWM_CONFIG_DEBUG_COLOR -#define NRFX_PWM_CONFIG_DEBUG_COLOR PWM_CONFIG_DEBUG_COLOR -#endif - -#if defined(PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED) -#undef NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED -#define NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED -#endif -#if defined(PWM_NRF52_ANOMALY_109_EGU_INSTANCE) -#undef NRFX_PWM_NRF52_ANOMALY_109_EGU_INSTANCE -#define NRFX_PWM_NRF52_ANOMALY_109_EGU_INSTANCE PWM_NRF52_ANOMALY_109_EGU_INSTANCE -#endif - -#endif // defined(PWM_ENABLED) - -//------------------------------------------------------------------------------ -// QDEC - -#if defined(QDEC_ENABLED) - -#undef NRFX_QDEC_ENABLED -#define NRFX_QDEC_ENABLED QDEC_ENABLED - -#if defined(QDEC_CONFIG_REPORTPER) -#undef NRFX_QDEC_CONFIG_REPORTPER -#define NRFX_QDEC_CONFIG_REPORTPER QDEC_CONFIG_REPORTPER -#endif -#if defined(QDEC_CONFIG_SAMPLEPER) -#undef NRFX_QDEC_CONFIG_SAMPLEPER -#define NRFX_QDEC_CONFIG_SAMPLEPER QDEC_CONFIG_SAMPLEPER -#endif -#if defined(QDEC_CONFIG_PIO_A) -#undef NRFX_QDEC_CONFIG_PIO_A -#define NRFX_QDEC_CONFIG_PIO_A QDEC_CONFIG_PIO_A -#endif -#if defined(QDEC_CONFIG_PIO_B) -#undef NRFX_QDEC_CONFIG_PIO_B -#define NRFX_QDEC_CONFIG_PIO_B QDEC_CONFIG_PIO_B -#endif -#if defined(QDEC_CONFIG_PIO_LED) -#undef NRFX_QDEC_CONFIG_PIO_LED -#define NRFX_QDEC_CONFIG_PIO_LED QDEC_CONFIG_PIO_LED -#endif -#if defined(QDEC_CONFIG_LEDPRE) -#undef NRFX_QDEC_CONFIG_LEDPRE -#define NRFX_QDEC_CONFIG_LEDPRE QDEC_CONFIG_LEDPRE -#endif -#if defined(QDEC_CONFIG_LEDPOL) -#undef NRFX_QDEC_CONFIG_LEDPOL -#define NRFX_QDEC_CONFIG_LEDPOL QDEC_CONFIG_LEDPOL -#endif -#if defined(QDEC_CONFIG_DBFEN) -#undef NRFX_QDEC_CONFIG_DBFEN -#define NRFX_QDEC_CONFIG_DBFEN QDEC_CONFIG_DBFEN -#endif -#if defined(QDEC_CONFIG_SAMPLE_INTEN) -#undef NRFX_QDEC_CONFIG_SAMPLE_INTEN -#define NRFX_QDEC_CONFIG_SAMPLE_INTEN QDEC_CONFIG_SAMPLE_INTEN -#endif -#if defined(QDEC_CONFIG_IRQ_PRIORITY) -#undef NRFX_QDEC_CONFIG_IRQ_PRIORITY -#define NRFX_QDEC_CONFIG_IRQ_PRIORITY QDEC_CONFIG_IRQ_PRIORITY -#endif - -#if defined(QDEC_CONFIG_LOG_ENABLED) -#undef NRFX_QDEC_CONFIG_LOG_ENABLED -#define NRFX_QDEC_CONFIG_LOG_ENABLED QDEC_CONFIG_LOG_ENABLED -#endif -#if defined(QDEC_CONFIG_LOG_LEVEL) -#undef NRFX_QDEC_CONFIG_LOG_LEVEL -#define NRFX_QDEC_CONFIG_LOG_LEVEL QDEC_CONFIG_LOG_LEVEL -#endif -#if defined(QDEC_CONFIG_INFO_COLOR) -#undef NRFX_QDEC_CONFIG_INFO_COLOR -#define NRFX_QDEC_CONFIG_INFO_COLOR QDEC_CONFIG_INFO_COLOR -#endif -#if defined(QDEC_CONFIG_DEBUG_COLOR) -#undef NRFX_QDEC_CONFIG_DEBUG_COLOR -#define NRFX_QDEC_CONFIG_DEBUG_COLOR QDEC_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(QDEC_ENABLED) - -//------------------------------------------------------------------------------ -// QSPI - -#if defined(QSPI_ENABLED) - -#undef NRFX_QSPI_ENABLED -#define NRFX_QSPI_ENABLED QSPI_ENABLED - -#if defined(QSPI_CONFIG_SCK_DELAY) -#undef NRFX_QSPI_CONFIG_SCK_DELAY -#define NRFX_QSPI_CONFIG_SCK_DELAY QSPI_CONFIG_SCK_DELAY -#endif -#if defined(QSPI_CONFIG_XIP_OFFSET) -#undef NRFX_QSPI_CONFIG_XIP_OFFSET -#define NRFX_QSPI_CONFIG_XIP_OFFSET QSPI_CONFIG_XIP_OFFSET -#endif -#if defined(QSPI_CONFIG_READOC) -#undef NRFX_QSPI_CONFIG_READOC -#define NRFX_QSPI_CONFIG_READOC QSPI_CONFIG_READOC -#endif -#if defined(QSPI_CONFIG_WRITEOC) -#undef NRFX_QSPI_CONFIG_WRITEOC -#define NRFX_QSPI_CONFIG_WRITEOC QSPI_CONFIG_WRITEOC -#endif -#if defined(QSPI_CONFIG_ADDRMODE) -#undef NRFX_QSPI_CONFIG_ADDRMODE -#define NRFX_QSPI_CONFIG_ADDRMODE QSPI_CONFIG_ADDRMODE -#endif -#if defined(QSPI_CONFIG_MODE) -#undef NRFX_QSPI_CONFIG_MODE -#define NRFX_QSPI_CONFIG_MODE QSPI_CONFIG_MODE -#endif -#if defined(QSPI_CONFIG_FREQUENCY) -#undef NRFX_QSPI_CONFIG_FREQUENCY -#define NRFX_QSPI_CONFIG_FREQUENCY QSPI_CONFIG_FREQUENCY -#endif -#if defined(QSPI_CONFIG_IRQ_PRIORITY) -#undef NRFX_QSPI_CONFIG_IRQ_PRIORITY -#define NRFX_QSPI_CONFIG_IRQ_PRIORITY QSPI_CONFIG_IRQ_PRIORITY -#endif - -#if defined(QSPI_PIN_SCK) -#undef NRFX_QSPI_PIN_SCK -#define NRFX_QSPI_PIN_SCK QSPI_PIN_SCK -#endif -#if defined(QSPI_PIN_CSN) -#undef NRFX_QSPI_PIN_CSN -#define NRFX_QSPI_PIN_CSN QSPI_PIN_CSN -#endif -#if defined(QSPI_PIN_IO0) -#undef NRFX_QSPI_PIN_IO0 -#define NRFX_QSPI_PIN_IO0 QSPI_PIN_IO0 -#endif -#if defined(QSPI_PIN_IO0) -#undef NRFX_QSPI_PIN_IO0 -#define NRFX_QSPI_PIN_IO0 QSPI_PIN_IO0 -#endif -#if defined(QSPI_PIN_IO1) -#undef NRFX_QSPI_PIN_IO1 -#define NRFX_QSPI_PIN_IO1 QSPI_PIN_IO1 -#endif -#if defined(QSPI_PIN_IO2) -#undef NRFX_QSPI_PIN_IO2 -#define NRFX_QSPI_PIN_IO2 QSPI_PIN_IO2 -#endif -#if defined(QSPI_PIN_IO3) -#undef NRFX_QSPI_PIN_IO3 -#define NRFX_QSPI_PIN_IO3 QSPI_PIN_IO3 -#endif - -#endif // defined(QSPI_ENABLED) - -//------------------------------------------------------------------------------ -// RNG - -#if defined(RNG_ENABLED) - -#undef NRFX_RNG_ENABLED -#define NRFX_RNG_ENABLED RNG_ENABLED - -#if defined(RNG_CONFIG_ERROR_CORRECTION) -#undef NRFX_RNG_CONFIG_ERROR_CORRECTION -#define NRFX_RNG_CONFIG_ERROR_CORRECTION RNG_CONFIG_ERROR_CORRECTION -#endif - -#if defined(RNG_CONFIG_IRQ_PRIORITY) -#undef NRFX_RNG_CONFIG_IRQ_PRIORITY -#define NRFX_RNG_CONFIG_IRQ_PRIORITY RNG_CONFIG_IRQ_PRIORITY -#endif - -#if defined(RNG_CONFIG_LOG_ENABLED) -#undef NRFX_RNG_CONFIG_LOG_ENABLED -#define NRFX_RNG_CONFIG_LOG_ENABLED RNG_CONFIG_LOG_ENABLED -#endif -#if defined(RNG_CONFIG_LOG_LEVEL) -#undef NRFX_RNG_CONFIG_LOG_LEVEL -#define NRFX_RNG_CONFIG_LOG_LEVEL RNG_CONFIG_LOG_LEVEL -#endif -#if defined(RNG_CONFIG_INFO_COLOR) -#undef NRFX_RNG_CONFIG_INFO_COLOR -#define NRFX_RNG_CONFIG_INFO_COLOR RNG_CONFIG_INFO_COLOR -#endif -#if defined(RNG_CONFIG_DEBUG_COLOR) -#undef NRFX_RNG_CONFIG_DEBUG_COLOR -#define NRFX_RNG_CONFIG_DEBUG_COLOR RNG_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(RNG_ENABLED) - -//------------------------------------------------------------------------------ -// RTC - -#if defined(RTC_ENABLED) - -#undef NRFX_RTC_ENABLED -#define NRFX_RTC_ENABLED RTC_ENABLED - -#if defined(RTC0_ENABLED) -#undef NRFX_RTC0_ENABLED -#define NRFX_RTC0_ENABLED RTC0_ENABLED -#endif -#if defined(RTC1_ENABLED) -#undef NRFX_RTC1_ENABLED -#define NRFX_RTC1_ENABLED RTC1_ENABLED -#endif -#if defined(RTC2_ENABLED) -#undef NRFX_RTC2_ENABLED -#define NRFX_RTC2_ENABLED RTC2_ENABLED -#endif - -#if defined(RTC_DEFAULT_CONFIG_FREQUENCY) -#undef NRFX_RTC_DEFAULT_CONFIG_FREQUENCY -#define NRFX_RTC_DEFAULT_CONFIG_FREQUENCY RTC_DEFAULT_CONFIG_FREQUENCY -#endif -#if defined(RTC_DEFAULT_CONFIG_RELIABLE) -#undef NRFX_RTC_DEFAULT_CONFIG_RELIABLE -#define NRFX_RTC_DEFAULT_CONFIG_RELIABLE RTC_DEFAULT_CONFIG_RELIABLE -#endif -#if defined(RTC_DEFAULT_CONFIG_IRQ_PRIORITY) -#undef NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY RTC_DEFAULT_CONFIG_IRQ_PRIORITY -#endif - -#if defined(NRF_MAXIMUM_LATENCY_US) -#undef NRFX_RTC_MAXIMUM_LATENCY_US -#define NRFX_RTC_MAXIMUM_LATENCY_US NRF_MAXIMUM_LATENCY_US -#endif - -#if defined(RTC_CONFIG_LOG_ENABLED) -#undef NRFX_RTC_CONFIG_LOG_ENABLED -#define NRFX_RTC_CONFIG_LOG_ENABLED RTC_CONFIG_LOG_ENABLED -#endif -#if defined(RTC_CONFIG_LOG_LEVEL) -#undef NRFX_RTC_CONFIG_LOG_LEVEL -#define NRFX_RTC_CONFIG_LOG_LEVEL RTC_CONFIG_LOG_LEVEL -#endif -#if defined(RTC_CONFIG_INFO_COLOR) -#undef NRFX_RTC_CONFIG_INFO_COLOR -#define NRFX_RTC_CONFIG_INFO_COLOR RTC_CONFIG_INFO_COLOR -#endif -#if defined(RTC_CONFIG_DEBUG_COLOR) -#undef NRFX_RTC_CONFIG_DEBUG_COLOR -#define NRFX_RTC_CONFIG_DEBUG_COLOR RTC_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(RTC_ENABLED) - -//------------------------------------------------------------------------------ -// SAADC - -#if defined(SAADC_ENABLED) - -#undef NRFX_SAADC_ENABLED -#define NRFX_SAADC_ENABLED SAADC_ENABLED - -#if defined(SAADC_CONFIG_RESOLUTION) -#undef NRFX_SAADC_CONFIG_RESOLUTION -#define NRFX_SAADC_CONFIG_RESOLUTION SAADC_CONFIG_RESOLUTION -#endif -#if defined(SAADC_CONFIG_OVERSAMPLE) -#undef NRFX_SAADC_CONFIG_OVERSAMPLE -#define NRFX_SAADC_CONFIG_OVERSAMPLE SAADC_CONFIG_OVERSAMPLE -#endif -#if defined(SAADC_CONFIG_LP_MODE) -#undef NRFX_SAADC_CONFIG_LP_MODE -#define NRFX_SAADC_CONFIG_LP_MODE SAADC_CONFIG_LP_MODE -#endif -#if defined(SAADC_CONFIG_IRQ_PRIORITY) -#undef NRFX_SAADC_CONFIG_IRQ_PRIORITY -#define NRFX_SAADC_CONFIG_IRQ_PRIORITY SAADC_CONFIG_IRQ_PRIORITY -#endif - -#if defined(SAADC_CONFIG_LOG_ENABLED) -#undef NRFX_SAADC_CONFIG_LOG_ENABLED -#define NRFX_SAADC_CONFIG_LOG_ENABLED SAADC_CONFIG_LOG_ENABLED -#endif -#if defined(SAADC_CONFIG_LOG_LEVEL) -#undef NRFX_SAADC_CONFIG_LOG_LEVEL -#define NRFX_SAADC_CONFIG_LOG_LEVEL SAADC_CONFIG_LOG_LEVEL -#endif -#if defined(SAADC_CONFIG_INFO_COLOR) -#undef NRFX_SAADC_CONFIG_INFO_COLOR -#define NRFX_SAADC_CONFIG_INFO_COLOR SAADC_CONFIG_INFO_COLOR -#endif -#if defined(SAADC_CONFIG_DEBUG_COLOR) -#undef NRFX_SAADC_CONFIG_DEBUG_COLOR -#define NRFX_SAADC_CONFIG_DEBUG_COLOR SAADC_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(SAADC_ENABLED) - -//------------------------------------------------------------------------------ -// SPI - -#if defined(SPI_ENABLED) - -#undef NRFX_SPI_ENABLED -#define NRFX_SPI_ENABLED \ - (SPI_ENABLED && (NRFX_SPI0_ENABLED || NRFX_SPI1_ENABLED || NRFX_SPI2_ENABLED)) -#undef NRFX_SPIM_ENABLED -#define NRFX_SPIM_ENABLED \ - (SPI_ENABLED && (NRFX_SPIM0_ENABLED || NRFX_SPIM1_ENABLED || NRFX_SPIM2_ENABLED)) - -#if defined(SPI_PRESENT) && !defined(SPIM_PRESENT) - -#undef NRFX_SPI0_ENABLED -#define NRFX_SPI0_ENABLED SPI0_ENABLED -#undef NRFX_SPIM0_ENABLED -#define NRFX_SPIM0_ENABLED 0 - -#undef NRFX_SPI1_ENABLED -#define NRFX_SPI1_ENABLED SPI1_ENABLED -#undef NRFX_SPIM1_ENABLED -#define NRFX_SPIM1_ENABLED 0 - -#undef NRFX_SPI2_ENABLED -#define NRFX_SPI2_ENABLED SPI2_ENABLED -#undef NRFX_SPIM2_ENABLED -#define NRFX_SPIM2_ENABLED 0 - -#elif !defined(SPI_PRESENT) && defined(SPIM_PRESENT) - -#undef NRFX_SPI0_ENABLED -#define NRFX_SPI0_ENABLED 0 -#undef NRFX_SPIM0_ENABLED -#define NRFX_SPIM0_ENABLED SPI0_ENABLED - -#undef NRFX_SPI1_ENABLED -#define NRFX_SPI1_ENABLED 0 -#undef NRFX_SPIM1_ENABLED -#define NRFX_SPIM1_ENABLED SPI1_ENABLED - -#undef NRFX_SPI2_ENABLED -#define NRFX_SPI2_ENABLED 0 -#undef NRFX_SPIM2_ENABLED -#define NRFX_SPIM2_ENABLED SPI2_ENABLED - -#else // -> defined(SPI_PRESENT) && defined(SPIM_PRESENT) - -#undef NRFX_SPI0_ENABLED -#define NRFX_SPI0_ENABLED (SPI0_ENABLED && !SPI0_USE_EASY_DMA) -#undef NRFX_SPIM0_ENABLED -#define NRFX_SPIM0_ENABLED (SPI0_ENABLED && SPI0_USE_EASY_DMA) - -#undef NRFX_SPI1_ENABLED -#define NRFX_SPI1_ENABLED (SPI1_ENABLED && !SPI1_USE_EASY_DMA) -#undef NRFX_SPIM1_ENABLED -#define NRFX_SPIM1_ENABLED (SPI1_ENABLED && SPI1_USE_EASY_DMA) - -#undef NRFX_SPI2_ENABLED -#define NRFX_SPI2_ENABLED (SPI2_ENABLED && !SPI2_USE_EASY_DMA) -#undef NRFX_SPIM2_ENABLED -#define NRFX_SPIM2_ENABLED (SPI2_ENABLED && SPI2_USE_EASY_DMA) - -#endif // -> defined(SPI_PRESENT) && defined(SPIM_PRESENT) - -#if defined(NRF_SPI_DRV_MISO_PULLUP_CFG) -#undef NRFX_SPI_MISO_PULL_CFG -#define NRFX_SPI_MISO_PULL_CFG NRF_SPI_DRV_MISO_PULLUP_CFG -#undef NRFX_SPIM_MISO_PULL_CFG -#define NRFX_SPIM_MISO_PULL_CFG NRF_SPI_DRV_MISO_PULLUP_CFG -#endif - -#if defined(SPI_DEFAULT_CONFIG_IRQ_PRIORITY) -#undef NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY SPI_DEFAULT_CONFIG_IRQ_PRIORITY -#undef NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY SPI_DEFAULT_CONFIG_IRQ_PRIORITY -#endif - -#if defined(SPI_CONFIG_LOG_ENABLED) -#undef NRFX_SPI_CONFIG_LOG_ENABLED -#define NRFX_SPI_CONFIG_LOG_ENABLED SPI_CONFIG_LOG_ENABLED -#undef NRFX_SPIM_CONFIG_LOG_ENABLED -#define NRFX_SPIM_CONFIG_LOG_ENABLED SPI_CONFIG_LOG_ENABLED -#endif -#if defined(SPI_CONFIG_LOG_LEVEL) -#undef NRFX_SPI_CONFIG_LOG_LEVEL -#define NRFX_SPI_CONFIG_LOG_LEVEL SPI_CONFIG_LOG_LEVEL -#undef NRFX_SPIM_CONFIG_LOG_LEVEL -#define NRFX_SPIM_CONFIG_LOG_LEVEL SPI_CONFIG_LOG_LEVEL -#endif -#if defined(SPI_CONFIG_INFO_COLOR) -#undef NRFX_SPI_CONFIG_INFO_COLOR -#define NRFX_SPI_CONFIG_INFO_COLOR SPI_CONFIG_INFO_COLOR -#undef NRFX_SPIM_CONFIG_INFO_COLOR -#define NRFX_SPIM_CONFIG_INFO_COLOR SPI_CONFIG_INFO_COLOR -#endif -#if defined(SPI_CONFIG_DEBUG_COLOR) -#undef NRFX_SPI_CONFIG_DEBUG_COLOR -#define NRFX_SPI_CONFIG_DEBUG_COLOR SPI_CONFIG_DEBUG_COLOR -#undef NRFX_SPIM_CONFIG_DEBUG_COLOR -#define NRFX_SPIM_CONFIG_DEBUG_COLOR SPI_CONFIG_DEBUG_COLOR -#endif - -#if defined(SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED) -#undef NRFX_SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED -#define NRFX_SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED -#endif - -#endif // defined(SPI_ENABLED) - -//------------------------------------------------------------------------------ -// SPIS - -#if defined(SPIS_ENABLED) - -#undef NRFX_SPIS_ENABLED -#define NRFX_SPIS_ENABLED SPIS_ENABLED - -#if defined(SPIS0_ENABLED) -#undef NRFX_SPIS0_ENABLED -#define NRFX_SPIS0_ENABLED SPIS0_ENABLED -#endif -#if defined(SPIS1_ENABLED) -#undef NRFX_SPIS1_ENABLED -#define NRFX_SPIS1_ENABLED SPIS1_ENABLED -#endif -#if defined(SPIS2_ENABLED) -#undef NRFX_SPIS2_ENABLED -#define NRFX_SPIS2_ENABLED SPIS2_ENABLED -#endif - -#if defined(SPIS_DEFAULT_CONFIG_IRQ_PRIORITY) -#undef NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY SPIS_DEFAULT_CONFIG_IRQ_PRIORITY -#endif -#if defined(SPIS_DEFAULT_MODE) -#undef NRFX_SPIS_DEFAULT_MODE -#define NRFX_SPIS_DEFAULT_MODE SPIS_DEFAULT_MODE -#endif -#if defined(SPIS_DEFAULT_BIT_ORDER) -#undef NRFX_SPIS_DEFAULT_BIT_ORDER -#define NRFX_SPIS_DEFAULT_BIT_ORDER SPIS_DEFAULT_BIT_ORDER -#endif -#if defined(SPIS_DEFAULT_DEF) -#undef NRFX_SPIS_DEFAULT_DEF -#define NRFX_SPIS_DEFAULT_DEF SPIS_DEFAULT_DEF -#endif -#if defined(SPIS_DEFAULT_ORC) -#undef NRFX_SPIS_DEFAULT_ORC -#define NRFX_SPIS_DEFAULT_ORC SPIS_DEFAULT_ORC -#endif - -#if defined(SPIS_CONFIG_LOG_ENABLED) -#undef NRFX_SPIS_CONFIG_LOG_ENABLED -#define NRFX_SPIS_CONFIG_LOG_ENABLED SPIS_CONFIG_LOG_ENABLED -#endif -#if defined(SPIS_CONFIG_LOG_LEVEL) -#undef NRFX_SPIS_CONFIG_LOG_LEVEL -#define NRFX_SPIS_CONFIG_LOG_LEVEL SPIS_CONFIG_LOG_LEVEL -#endif -#if defined(SPIS_CONFIG_INFO_COLOR) -#undef NRFX_SPIS_CONFIG_INFO_COLOR -#define NRFX_SPIS_CONFIG_INFO_COLOR SPIS_CONFIG_INFO_COLOR -#endif -#if defined(SPIS_CONFIG_DEBUG_COLOR) -#undef NRFX_SPIS_CONFIG_DEBUG_COLOR -#define NRFX_SPIS_CONFIG_DEBUG_COLOR SPIS_CONFIG_DEBUG_COLOR -#endif - -#if defined(SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED) -#undef NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED -#define NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED -#endif - -#endif // defined(SPIS_ENABLED) - -//------------------------------------------------------------------------------ -// SWI - -#if defined(SWI_DISABLE0) -#undef NRFX_SWI0_DISABLED -#define NRFX_SWI0_DISABLED 1 -#endif -#if defined(SWI_DISABLE1) -#undef NRFX_SWI1_DISABLED -#define NRFX_SWI1_DISABLED 1 -#endif -#if defined(SWI_DISABLE2) -#undef NRFX_SWI2_DISABLED -#define NRFX_SWI2_DISABLED 1 -#endif -#if defined(SWI_DISABLE3) -#undef NRFX_SWI3_DISABLED -#define NRFX_SWI3_DISABLED 1 -#endif -#if defined(SWI_DISABLE4) -#undef NRFX_SWI4_DISABLED -#define NRFX_SWI4_DISABLED 1 -#endif -#if defined(SWI_DISABLE5) -#undef NRFX_SWI5_DISABLED -#define NRFX_SWI5_DISABLED 1 -#endif - -#if defined(EGU_ENABLED) -#undef NRFX_EGU_ENABLED -#define NRFX_EGU_ENABLED EGU_ENABLED -#endif - -#if defined(SWI_CONFIG_LOG_ENABLED) -#undef NRFX_SWI_CONFIG_LOG_ENABLED -#define NRFX_SWI_CONFIG_LOG_ENABLED SWI_CONFIG_LOG_ENABLED -#endif -#if defined(SWI_CONFIG_LOG_LEVEL) -#undef NRFX_SWI_CONFIG_LOG_LEVEL -#define NRFX_SWI_CONFIG_LOG_LEVEL SWI_CONFIG_LOG_LEVEL -#endif -#if defined(SWI_CONFIG_INFO_COLOR) -#undef NRFX_SWI_CONFIG_INFO_COLOR -#define NRFX_SWI_CONFIG_INFO_COLOR SWI_CONFIG_INFO_COLOR -#endif -#if defined(SWI_CONFIG_DEBUG_COLOR) -#undef NRFX_SWI_CONFIG_DEBUG_COLOR -#define NRFX_SWI_CONFIG_DEBUG_COLOR SWI_CONFIG_DEBUG_COLOR -#endif - -//------------------------------------------------------------------------------ -// SysTick - -#if defined(SYSTICK_ENABLED) - -#undef NRFX_SYSTICK_ENABLED -#define NRFX_SYSTICK_ENABLED SYSTICK_ENABLED - -#endif // defined(SYSTICK_ENABLED) - -//------------------------------------------------------------------------------ -// TIMER - -#if defined(TIMER_ENABLED) - -#undef NRFX_TIMER_ENABLED -#define NRFX_TIMER_ENABLED TIMER_ENABLED - -#if defined(TIMER0_ENABLED) -#undef NRFX_TIMER0_ENABLED -#define NRFX_TIMER0_ENABLED TIMER0_ENABLED -#endif -#if defined(TIMER1_ENABLED) -#undef NRFX_TIMER1_ENABLED -#define NRFX_TIMER1_ENABLED TIMER1_ENABLED -#endif -#if defined(TIMER2_ENABLED) -#undef NRFX_TIMER2_ENABLED -#define NRFX_TIMER2_ENABLED TIMER2_ENABLED -#endif -#if defined(TIMER3_ENABLED) -#undef NRFX_TIMER3_ENABLED -#define NRFX_TIMER3_ENABLED TIMER3_ENABLED -#endif -#if defined(TIMER4_ENABLED) -#undef NRFX_TIMER4_ENABLED -#define NRFX_TIMER4_ENABLED TIMER4_ENABLED -#endif - -#if defined(TIMER_DEFAULT_CONFIG_FREQUENCY) -#undef NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY TIMER_DEFAULT_CONFIG_FREQUENCY -#endif -#if defined(TIMER_DEFAULT_CONFIG_MODE) -#undef NRFX_TIMER_DEFAULT_CONFIG_MODE -#define NRFX_TIMER_DEFAULT_CONFIG_MODE TIMER_DEFAULT_CONFIG_MODE -#endif -#if defined(TIMER_DEFAULT_CONFIG_BIT_WIDTH) -#undef NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH -#define NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH TIMER_DEFAULT_CONFIG_BIT_WIDTH -#endif -#if defined(TIMER_DEFAULT_CONFIG_IRQ_PRIORITY) -#undef NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY TIMER_DEFAULT_CONFIG_IRQ_PRIORITY -#endif - -#if defined(TIMER_CONFIG_LOG_ENABLED) -#undef NRFX_TIMER_CONFIG_LOG_ENABLED -#define NRFX_TIMER_CONFIG_LOG_ENABLED TIMER_CONFIG_LOG_ENABLED -#endif -#if defined(TIMER_CONFIG_LOG_LEVEL) -#undef NRFX_TIMER_CONFIG_LOG_LEVEL -#define NRFX_TIMER_CONFIG_LOG_LEVEL TIMER_CONFIG_LOG_LEVEL -#endif -#if defined(TIMER_CONFIG_INFO_COLOR) -#undef NRFX_TIMER_CONFIG_INFO_COLOR -#define NRFX_TIMER_CONFIG_INFO_COLOR TIMER_CONFIG_INFO_COLOR -#endif -#if defined(TIMER_CONFIG_DEBUG_COLOR) -#undef NRFX_TIMER_CONFIG_DEBUG_COLOR -#define NRFX_TIMER_CONFIG_DEBUG_COLOR TIMER_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(TIMER_ENABLED) - -//------------------------------------------------------------------------------ -// TWI -#define TWI_ONLY ( defined(TWI_PRESENT) && !defined(TWIM_PRESENT)) -#define TWIM_ONLY (!defined(TWI_PRESENT) && defined(TWIM_PRESENT)) -#define TWI_AND_TWIM ( defined(TWI_PRESENT) && defined(TWIM_PRESENT)) - -#if defined(TWI_ENABLED) - -#undef NRFX_TWI_ENABLED -#define NRFX_TWI_ENABLED (TWI_ENABLED && (NRFX_TWI0_ENABLED || NRFX_TWI1_ENABLED)) -#undef NRFX_TWIM_ENABLED -#define NRFX_TWIM_ENABLED (TWI_ENABLED && (NRFX_TWIM0_ENABLED || NRFX_TWIM1_ENABLED)) - -#if defined(TWI_PRESENT) && !defined(TWIM_PRESENT) - -#undef NRFX_TWI0_ENABLED -#define NRFX_TWI0_ENABLED TWI0_ENABLED -#undef NRFX_TWIM0_ENABLED -#define NRFX_TWIM0_ENABLED 0 - -#undef NRFX_TWI1_ENABLED -#define NRFX_TWI1_ENABLED TWI1_ENABLED -#undef NRFX_TWIM1_ENABLED -#define NRFX_TWIM1_ENABLED 0 - -#elif !defined(TWI_PRESENT) && defined(TWIM_PRESENT) - -#undef NRFX_TWI0_ENABLED -#define NRFX_TWI0_ENABLED 0 -#undef NRFX_TWIM0_ENABLED -#define NRFX_TWIM0_ENABLED TWI0_ENABLED - -#undef NRFX_TWI1_ENABLED -#define NRFX_TWI1_ENABLED 0 -#undef NRFX_TWIM1_ENABLED -#define NRFX_TWIM1_ENABLED TWI1_ENABLED - -#else // -> defined(TWI_PRESENT) && defined(TWIM_PRESENT) - -#undef NRFX_TWI0_ENABLED -#define NRFX_TWI0_ENABLED (TWI0_ENABLED && !TWI0_USE_EASY_DMA) -#undef NRFX_TWIM0_ENABLED -#define NRFX_TWIM0_ENABLED (TWI0_ENABLED && TWI0_USE_EASY_DMA) - -#undef NRFX_TWI1_ENABLED -#define NRFX_TWI1_ENABLED (TWI1_ENABLED && !TWI1_USE_EASY_DMA) -#undef NRFX_TWIM1_ENABLED -#define NRFX_TWIM1_ENABLED (TWI1_ENABLED && TWI1_USE_EASY_DMA) - -#endif // -> defined(TWI_PRESENT) && defined(TWIM_PRESENT) - -#if defined(TWI_DEFAULT_CONFIG_FREQUENCY) -#undef NRFX_TWI_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TWI_DEFAULT_CONFIG_FREQUENCY TWI_DEFAULT_CONFIG_FREQUENCY -#undef NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY -#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY TWI_DEFAULT_CONFIG_FREQUENCY -#endif -#if defined(TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT) -#undef NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#undef NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT -#endif -#if defined(TWI_DEFAULT_CONFIG_IRQ_PRIORITY) -#undef NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY TWI_DEFAULT_CONFIG_IRQ_PRIORITY -#undef NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY TWI_DEFAULT_CONFIG_IRQ_PRIORITY -#endif - -#if defined(TWI_CONFIG_LOG_ENABLED) -#undef NRFX_TWI_CONFIG_LOG_ENABLED -#define NRFX_TWI_CONFIG_LOG_ENABLED TWI_CONFIG_LOG_ENABLED -#undef NRFX_TWIM_CONFIG_LOG_ENABLED -#define NRFX_TWIM_CONFIG_LOG_ENABLED TWI_CONFIG_LOG_ENABLED -#endif -#if defined(TWI_CONFIG_LOG_LEVEL) -#undef NRFX_TWI_CONFIG_LOG_LEVEL -#define NRFX_TWI_CONFIG_LOG_LEVEL TWI_CONFIG_LOG_LEVEL -#undef NRFX_TWIM_CONFIG_LOG_LEVEL -#define NRFX_TWIM_CONFIG_LOG_LEVEL TWI_CONFIG_LOG_LEVEL -#endif -#if defined(TWI_CONFIG_INFO_COLOR) -#undef NRFX_TWI_CONFIG_INFO_COLOR -#define NRFX_TWI_CONFIG_INFO_COLOR TWI_CONFIG_INFO_COLOR -#undef NRFX_TWIM_CONFIG_INFO_COLOR -#define NRFX_TWIM_CONFIG_INFO_COLOR TWI_CONFIG_INFO_COLOR -#endif -#if defined(TWI_CONFIG_DEBUG_COLOR) -#undef NRFX_TWI_CONFIG_DEBUG_COLOR -#define NRFX_TWI_CONFIG_DEBUG_COLOR TWI_CONFIG_DEBUG_COLOR -#undef NRFX_TWIM_CONFIG_DEBUG_COLOR -#define NRFX_TWIM_CONFIG_DEBUG_COLOR TWI_CONFIG_DEBUG_COLOR -#endif - -#if defined(TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED) -#undef NRFX_TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED -#define NRFX_TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED -#endif - -#endif // defined(TWI_ENABLED) - -//------------------------------------------------------------------------------ -// TWIS - -#if defined(TWIS_ENABLED) - -#undef NRFX_TWIS_ENABLED -#define NRFX_TWIS_ENABLED TWIS_ENABLED - -#if defined(TWIS0_ENABLED) -#undef NRFX_TWIS0_ENABLED -#define NRFX_TWIS0_ENABLED TWIS0_ENABLED -#endif -#if defined(TWIS1_ENABLED) -#undef NRFX_TWIS1_ENABLED -#define NRFX_TWIS1_ENABLED TWIS1_ENABLED -#endif - -#if defined(TWIS_ASSUME_INIT_AFTER_RESET_ONLY) -#undef NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY TWIS_ASSUME_INIT_AFTER_RESET_ONLY -#endif -#if defined(TWIS_NO_SYNC_MODE) -#undef NRFX_TWIS_NO_SYNC_MODE -#define NRFX_TWIS_NO_SYNC_MODE TWIS_NO_SYNC_MODE -#endif - -#if defined(TWIS_DEFAULT_CONFIG_ADDR0) -#undef NRFX_TWIS_DEFAULT_CONFIG_ADDR0 -#define NRFX_TWIS_DEFAULT_CONFIG_ADDR0 TWIS_DEFAULT_CONFIG_ADDR0 -#endif -#if defined(TWIS_DEFAULT_CONFIG_ADDR1) -#undef NRFX_TWIS_DEFAULT_CONFIG_ADDR1 -#define NRFX_TWIS_DEFAULT_CONFIG_ADDR1 TWIS_DEFAULT_CONFIG_ADDR1 -#endif -#if defined(TWIS_DEFAULT_CONFIG_SCL_PULL) -#undef NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL -#define NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL TWIS_DEFAULT_CONFIG_SCL_PULL -#endif -#if defined(TWIS_DEFAULT_CONFIG_SDA_PULL) -#undef NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL -#define NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL TWIS_DEFAULT_CONFIG_SDA_PULL -#endif -#if defined(TWIS_DEFAULT_CONFIG_IRQ_PRIORITY) -#undef NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY TWIS_DEFAULT_CONFIG_IRQ_PRIORITY -#endif - -#if defined(TWIS_CONFIG_LOG_ENABLED) -#undef NRFX_TWIS_CONFIG_LOG_ENABLED -#define NRFX_TWIS_CONFIG_LOG_ENABLED TWIS_CONFIG_LOG_ENABLED -#endif -#if defined(TWIS_CONFIG_LOG_LEVEL) -#undef NRFX_TWIS_CONFIG_LOG_LEVEL -#define NRFX_TWIS_CONFIG_LOG_LEVEL TWIS_CONFIG_LOG_LEVEL -#endif -#if defined(TWIS_CONFIG_INFO_COLOR) -#undef NRFX_TWIS_CONFIG_INFO_COLOR -#define NRFX_TWIS_CONFIG_INFO_COLOR TWIS_CONFIG_INFO_COLOR -#endif -#if defined(TWIS_CONFIG_DEBUG_COLOR) -#undef NRFX_TWIS_CONFIG_DEBUG_COLOR -#define NRFX_TWIS_CONFIG_DEBUG_COLOR TWIS_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(TWIS_ENABLED) - -//------------------------------------------------------------------------------ -// UART - -#if defined(UART_ENABLED) - -#undef NRFX_UART_ENABLED -#define NRFX_UART_ENABLED (UART_ENABLED && NRFX_UART0_ENABLED) -#undef NRFX_UARTE_ENABLED -#define NRFX_UARTE_ENABLED (UART_ENABLED && (NRFX_UARTE0_ENABLED || NRFX_UARTE1_ENABLED)) - -#if defined(UART0_ENABLED) -#undef NRFX_UART0_ENABLED -#define NRFX_UART0_ENABLED (UART0_ENABLED && UART_LEGACY_SUPPORT) -#undef NRFX_UARTE0_ENABLED -#define NRFX_UARTE0_ENABLED (UART0_ENABLED && UART_EASY_DMA_SUPPORT) -#endif -#if defined(UART1_ENABLED) -#undef NRFX_UARTE1_ENABLED -#define NRFX_UARTE1_ENABLED (UART1_ENABLED && UART_EASY_DMA_SUPPORT) -#endif - -#if defined(UART_DEFAULT_CONFIG_HWFC) -#undef NRFX_UART_DEFAULT_CONFIG_HWFC -#define NRFX_UART_DEFAULT_CONFIG_HWFC UART_DEFAULT_CONFIG_HWFC -#undef NRFX_UARTE_DEFAULT_CONFIG_HWFC -#define NRFX_UARTE_DEFAULT_CONFIG_HWFC UART_DEFAULT_CONFIG_HWFC -#endif -#if defined(UART_DEFAULT_CONFIG_PARITY) -#undef NRFX_UART_DEFAULT_CONFIG_PARITY -#define NRFX_UART_DEFAULT_CONFIG_PARITY UART_DEFAULT_CONFIG_PARITY -#undef NRFX_UARTE_DEFAULT_CONFIG_PARITY -#define NRFX_UARTE_DEFAULT_CONFIG_PARITY UART_DEFAULT_CONFIG_PARITY -#endif -#if defined(UART_DEFAULT_CONFIG_BAUDRATE) -#undef NRFX_UART_DEFAULT_CONFIG_BAUDRATE -#define NRFX_UART_DEFAULT_CONFIG_BAUDRATE UART_DEFAULT_CONFIG_BAUDRATE -#undef NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE -#define NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE UART_DEFAULT_CONFIG_BAUDRATE -#endif -#if defined(UART_DEFAULT_CONFIG_IRQ_PRIORITY) -#undef NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY UART_DEFAULT_CONFIG_IRQ_PRIORITY -#undef NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY -#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY UART_DEFAULT_CONFIG_IRQ_PRIORITY -#endif - -#if defined(UART_CONFIG_LOG_ENABLED) -#undef NRFX_UART_CONFIG_LOG_ENABLED -#define NRFX_UART_CONFIG_LOG_ENABLED UART_CONFIG_LOG_ENABLED -#undef NRFX_UARTE_CONFIG_LOG_ENABLED -#define NRFX_UARTE_CONFIG_LOG_ENABLED UART_CONFIG_LOG_ENABLED -#endif -#if defined(UART_CONFIG_LOG_LEVEL) -#undef NRFX_UART_CONFIG_LOG_LEVEL -#define NRFX_UART_CONFIG_LOG_LEVEL UART_CONFIG_LOG_LEVEL -#undef NRFX_UARTE_CONFIG_LOG_LEVEL -#define NRFX_UARTE_CONFIG_LOG_LEVEL UART_CONFIG_LOG_LEVEL -#endif -#if defined(UART_CONFIG_INFO_COLOR) -#undef NRFX_UART_CONFIG_INFO_COLOR -#define NRFX_UART_CONFIG_INFO_COLOR UART_CONFIG_INFO_COLOR -#undef NRFX_UARTE_CONFIG_INFO_COLOR -#define NRFX_UARTE_CONFIG_INFO_COLOR UART_CONFIG_INFO_COLOR -#endif -#if defined(UART_CONFIG_DEBUG_COLOR) -#undef NRFX_UART_CONFIG_DEBUG_COLOR -#define NRFX_UART_CONFIG_DEBUG_COLOR UART_CONFIG_DEBUG_COLOR -#undef NRFX_UARTE_CONFIG_DEBUG_COLOR -#define NRFX_UARTE_CONFIG_DEBUG_COLOR UART_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(UART_ENABLED) - -//------------------------------------------------------------------------------ -// WDT - -#if defined(WDT_ENABLED) - -#undef NRFX_WDT_ENABLED -#define NRFX_WDT_ENABLED WDT_ENABLED - -#if defined(WDT_CONFIG_BEHAVIOUR) -#undef NRFX_WDT_CONFIG_BEHAVIOUR -#define NRFX_WDT_CONFIG_BEHAVIOUR WDT_CONFIG_BEHAVIOUR -#endif -#if defined(WDT_CONFIG_RELOAD_VALUE) -#undef NRFX_WDT_CONFIG_RELOAD_VALUE -#define NRFX_WDT_CONFIG_RELOAD_VALUE WDT_CONFIG_RELOAD_VALUE -#endif -#if defined(WDT_CONFIG_IRQ_PRIORITY) -#undef NRFX_WDT_CONFIG_IRQ_PRIORITY -#define NRFX_WDT_CONFIG_IRQ_PRIORITY WDT_CONFIG_IRQ_PRIORITY -#endif - -#if defined(WDT_CONFIG_LOG_ENABLED) -#undef NRFX_WDT_CONFIG_LOG_ENABLED -#define NRFX_WDT_CONFIG_LOG_ENABLED WDT_CONFIG_LOG_ENABLED -#endif -#if defined(WDT_CONFIG_LOG_LEVEL) -#undef NRFX_WDT_CONFIG_LOG_LEVEL -#define NRFX_WDT_CONFIG_LOG_LEVEL WDT_CONFIG_LOG_LEVEL -#endif -#if defined(WDT_CONFIG_INFO_COLOR) -#undef NRFX_WDT_CONFIG_INFO_COLOR -#define NRFX_WDT_CONFIG_INFO_COLOR WDT_CONFIG_INFO_COLOR -#endif -#if defined(WDT_CONFIG_DEBUG_COLOR) -#undef NRFX_WDT_CONFIG_DEBUG_COLOR -#define NRFX_WDT_CONFIG_DEBUG_COLOR WDT_CONFIG_DEBUG_COLOR -#endif - -#endif // defined(WDT_ENABLED) - -#endif // APPLY_OLD_CONFIG_H__ diff --git a/third_party/NordicSemiconductor/dependencies/nordic_common.h b/third_party/NordicSemiconductor/dependencies/nordic_common.h deleted file mode 100644 index 8fcaf5d4a..000000000 --- a/third_party/NordicSemiconductor/dependencies/nordic_common.h +++ /dev/null @@ -1,215 +0,0 @@ -/** - * Copyright (c) 2008 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/** @file - * @brief Common defines and macros for firmware developed by Nordic Semiconductor. - */ - -#ifndef NORDIC_COMMON_H__ -#define NORDIC_COMMON_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Check if selected module is enabled - * - * This is save function for driver enable checking. - * Correct from Lint point of view (not using default of undefined value). - * - * Usage: - * @code - #if NRF_MODULE_ENABLED(UART) - ... - #endif - * @endcode - * - * @param module The module name. - * - * @retval 1 The macro _ENABLE is defined and is non-zero. - * @retval 0 The macro _ENABLE is not defined or it equals zero. - * - * @note - * This macro intentionally does not implement second expansion level. - * The name of the module to be checked has to be given directly as a parameter. - * And given parameter would be connected with @c _ENABLED postfix directly - * without evaluating its value. - */ -//lint -emacro(491,NRF_MODULE_ENABLED) // Suppers warning 491 "non-standard use of 'defined' preprocessor operator" -#ifdef NRF_MODULE_ENABLE_ALL -#warning "Do not use NRF_MODULE_ENABLE_ALL for real builds." -#define NRF_MODULE_ENABLED(module) 1 -#else -#define NRF_MODULE_ENABLED(module) \ - ((defined(module ## _ENABLED) && (module ## _ENABLED)) ? 1 : 0) -#endif -/** The upper 8 bits of a 32 bit value */ -//lint -emacro(572,MSB_32) // Suppress warning 572 "Excessive shift value" -#define MSB_32(a) (((a) & 0xFF000000) >> 24) -/** The lower 8 bits (of a 32 bit value) */ -#define LSB_32(a) ((a) & 0x000000FF) - -/** The upper 8 bits of a 16 bit value */ -//lint -emacro(572,MSB_16) // Suppress warning 572 "Excessive shift value" -#define MSB_16(a) (((a) & 0xFF00) >> 8) -/** The lower 8 bits (of a 16 bit value) */ -#define LSB_16(a) ((a) & 0x00FF) - -/** Leaves the minimum of the two 32-bit arguments */ -/*lint -emacro(506, MIN) */ /* Suppress "Constant value Boolean */ -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -/** Leaves the maximum of the two 32-bit arguments */ -/*lint -emacro(506, MAX) */ /* Suppress "Constant value Boolean */ -#define MAX(a, b) ((a) < (b) ? (b) : (a)) - -/**@brief Concatenates two parameters. - * - * It realizes two level expansion to make it sure that all the parameters - * are actually expanded before gluing them together. - * - * @param p1 First parameter to concatenating - * @param p2 Second parameter to concatenating - * - * @return Two parameters glued together. - * They have to create correct C mnemonic in other case - * preprocessor error would be generated. - * - * @sa CONCAT_3 - */ -#define CONCAT_2(p1, p2) CONCAT_2_(p1, p2) -/** Auxiliary macro used by @ref CONCAT_2 */ -#define CONCAT_2_(p1, p2) p1##p2 - -/**@brief Concatenates three parameters. - * - * It realizes two level expansion to make it sure that all the parameters - * are actually expanded before gluing them together. - * - * @param p1 First parameter to concatenating - * @param p2 Second parameter to concatenating - * @param p3 Third parameter to concatenating - * - * @return Three parameters glued together. - * They have to create correct C mnemonic in other case - * preprocessor error would be generated. - * - * @sa CONCAT_2 - */ -#define CONCAT_3(p1, p2, p3) CONCAT_3_(p1, p2, p3) -/** Auxiliary macro used by @ref CONCAT_3 */ -#define CONCAT_3_(p1, p2, p3) p1##p2##p3 - -#define STRINGIFY_(val) #val -/** Converts a macro argument into a character constant. - */ -#define STRINGIFY(val) STRINGIFY_(val) - -/** Counts number of elements inside the array - */ -#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) - -/**@brief Set a bit in the uint32 word. - * - * @param[in] W Word whose bit is being set. - * @param[in] B Bit number in the word to be set. - */ -#define SET_BIT(W, B) ((W) |= (uint32_t)(1U << (B))) - - -/**@brief Clears a bit in the uint32 word. - * - * @param[in] W Word whose bit is to be cleared. - * @param[in] B Bit number in the word to be cleared. - */ -#define CLR_BIT(W, B) ((W) &= (~(uint32_t)(1U << (B)))) - - -/**@brief Checks if a bit is set. - * - * @param[in] W Word whose bit is to be checked. - * @param[in] B Bit number in the word to be checked. - * - * @retval 1 if bit is set. - * @retval 0 if bit is not set. - */ -#define IS_SET(W, B) (((W) >> (B)) & 1) - -#define BIT_0 0x01 /**< The value of bit 0 */ -#define BIT_1 0x02 /**< The value of bit 1 */ -#define BIT_2 0x04 /**< The value of bit 2 */ -#define BIT_3 0x08 /**< The value of bit 3 */ -#define BIT_4 0x10 /**< The value of bit 4 */ -#define BIT_5 0x20 /**< The value of bit 5 */ -#define BIT_6 0x40 /**< The value of bit 6 */ -#define BIT_7 0x80 /**< The value of bit 7 */ -#define BIT_8 0x0100 /**< The value of bit 8 */ -#define BIT_9 0x0200 /**< The value of bit 9 */ -#define BIT_10 0x0400 /**< The value of bit 10 */ -#define BIT_11 0x0800 /**< The value of bit 11 */ -#define BIT_12 0x1000 /**< The value of bit 12 */ -#define BIT_13 0x2000 /**< The value of bit 13 */ -#define BIT_14 0x4000 /**< The value of bit 14 */ -#define BIT_15 0x8000 /**< The value of bit 15 */ -#define BIT_16 0x00010000 /**< The value of bit 16 */ -#define BIT_17 0x00020000 /**< The value of bit 17 */ -#define BIT_18 0x00040000 /**< The value of bit 18 */ -#define BIT_19 0x00080000 /**< The value of bit 19 */ -#define BIT_20 0x00100000 /**< The value of bit 20 */ -#define BIT_21 0x00200000 /**< The value of bit 21 */ -#define BIT_22 0x00400000 /**< The value of bit 22 */ -#define BIT_23 0x00800000 /**< The value of bit 23 */ -#define BIT_24 0x01000000 /**< The value of bit 24 */ -#define BIT_25 0x02000000 /**< The value of bit 25 */ -#define BIT_26 0x04000000 /**< The value of bit 26 */ -#define BIT_27 0x08000000 /**< The value of bit 27 */ -#define BIT_28 0x10000000 /**< The value of bit 28 */ -#define BIT_29 0x20000000 /**< The value of bit 29 */ -#define BIT_30 0x40000000 /**< The value of bit 30 */ -#define BIT_31 0x80000000 /**< The value of bit 31 */ - -#define UNUSED_VARIABLE(X) ((void)(X)) -#define UNUSED_PARAMETER(X) UNUSED_VARIABLE(X) -#define UNUSED_RETURN_VALUE(X) UNUSED_VARIABLE(X) - -#ifdef __cplusplus -} -#endif - -#endif // NORDIC_COMMON_H__ diff --git a/third_party/NordicSemiconductor/dependencies/nrf_assert.h b/third_party/NordicSemiconductor/dependencies/nrf_assert.h deleted file mode 100644 index 86853622a..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrf_assert.h +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Copyright (c) 2006 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/** @file - * @brief Utilities for verifying program logic - */ - -#ifndef NRF_ASSERT_H_ -#define NRF_ASSERT_H_ - -#include -#include "nrf.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @brief Function for handling assertions. - * - * - * @note - * This function is called when an assertion has triggered. - * - * @note - * This function is deprecated and will be removed in future releases. - * Use app_error_fault_handler instead. - * - * - * @post - * All hardware is put into an idle non-emitting state (in particular the radio is highly - * important to switch off since the radio might be in a state that makes it send - * packets continiously while a typical final infinit ASSERT loop is executing). - * - * - * @param line_num The line number where the assertion is called - * @param file_name Pointer to the file name - */ -//lint -save -esym(14, assert_nrf_callback) -void assert_nrf_callback(uint16_t line_num, const uint8_t *file_name); -//lint -restore - -#if (defined(DEBUG_NRF) || defined(DEBUG_NRF_USER)) -#define NRF_ASSERT_PRESENT 1 -#else -#define NRF_ASSERT_PRESENT 0 -#endif - -//#if defined(DEBUG_NRF) || defined(DEBUG_NRF_USER) - -/*lint -emacro(506, ASSERT) */ /* Suppress "Constant value Boolean */ -/*lint -emacro(774, ASSERT) */ /* Suppress "Boolean within 'if' always evaluates to True" */ \ - -/** @brief Function for checking intended for production code. - * - * Check passes if "expr" evaluates to true. */ - -#ifdef _lint -#define ASSERT(expr) \ -if (expr) \ -{ \ -} \ -else \ -{ \ - while (1); \ -} -#else //_lint -#define ASSERT(expr) \ -if (NRF_ASSERT_PRESENT) \ -{ \ - if (expr) \ - { \ - } \ - else \ - { \ - assert_nrf_callback((uint16_t)__LINE__, (uint8_t *)__FILE__); \ - } \ -} - -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_ASSERT_H_ */ diff --git a/third_party/NordicSemiconductor/dependencies/nrf_error.h b/third_party/NordicSemiconductor/dependencies/nrf_error.h deleted file mode 100644 index c673beb10..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrf_error.h +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright (c) 2012 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/* Header guard */ - -#ifndef SOFTDEVICE_PRESENT - -/** - @defgroup nrf_error Global Error Codes - @{ - - @brief Global Error definitions -*/ - -#ifndef NRF_ERROR_H__ -#define NRF_ERROR_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** @defgroup NRF_ERRORS_BASE Error Codes Base number definitions - * @{ */ -#define NRF_ERROR_BASE_NUM (0x0) ///< Global error base -#define NRF_ERROR_SDM_BASE_NUM (0x1000) ///< SDM error base -#define NRF_ERROR_SOC_BASE_NUM (0x2000) ///< SoC error base -#define NRF_ERROR_STK_BASE_NUM (0x3000) ///< STK error base -/** @} */ - -#define NRF_SUCCESS (NRF_ERROR_BASE_NUM + 0) ///< Successful command -#define NRF_ERROR_SVC_HANDLER_MISSING (NRF_ERROR_BASE_NUM + 1) ///< SVC handler is missing -#define NRF_ERROR_SOFTDEVICE_NOT_ENABLED (NRF_ERROR_BASE_NUM + 2) ///< SoftDevice has not been enabled -#define NRF_ERROR_INTERNAL (NRF_ERROR_BASE_NUM + 3) ///< Internal Error -#define NRF_ERROR_NO_MEM (NRF_ERROR_BASE_NUM + 4) ///< No Memory for operation -#define NRF_ERROR_NOT_FOUND (NRF_ERROR_BASE_NUM + 5) ///< Not found -#define NRF_ERROR_NOT_SUPPORTED (NRF_ERROR_BASE_NUM + 6) ///< Not supported -#define NRF_ERROR_INVALID_PARAM (NRF_ERROR_BASE_NUM + 7) ///< Invalid Parameter -#define NRF_ERROR_INVALID_STATE (NRF_ERROR_BASE_NUM + 8) ///< Invalid state, operation disallowed in this state -#define NRF_ERROR_INVALID_LENGTH (NRF_ERROR_BASE_NUM + 9) ///< Invalid Length -#define NRF_ERROR_INVALID_FLAGS (NRF_ERROR_BASE_NUM + 10) ///< Invalid Flags -#define NRF_ERROR_INVALID_DATA (NRF_ERROR_BASE_NUM + 11) ///< Invalid Data -#define NRF_ERROR_DATA_SIZE (NRF_ERROR_BASE_NUM + 12) ///< Data size exceeds limit -#define NRF_ERROR_TIMEOUT (NRF_ERROR_BASE_NUM + 13) ///< Operation timed out -#define NRF_ERROR_NULL (NRF_ERROR_BASE_NUM + 14) ///< Null Pointer -#define NRF_ERROR_FORBIDDEN (NRF_ERROR_BASE_NUM + 15) ///< Forbidden Operation -#define NRF_ERROR_INVALID_ADDR (NRF_ERROR_BASE_NUM + 16) ///< Bad Memory Address -#define NRF_ERROR_BUSY (NRF_ERROR_BASE_NUM + 17) ///< Busy - -#ifdef __cplusplus -} -#endif - -#endif // NRF_ERROR_H__ - -/** - @} -*/ - -#endif // SOFTDEVICE_PRESENT diff --git a/third_party/NordicSemiconductor/dependencies/nrf_log.h b/third_party/NordicSemiconductor/dependencies/nrf_log.h deleted file mode 100644 index d709d23f7..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrf_log.h +++ /dev/null @@ -1,291 +0,0 @@ -/** - * Copyright (c) 2016 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/**@file - * - * @defgroup nrf_log Logger module - * @{ - * @ingroup app_common - * - * @brief The nrf_log module interface. - */ - -#ifndef NRF_LOG_H_ -#define NRF_LOG_H_ - -#include "sdk_common.h" -#include "nrf_section.h" -#if NRF_MODULE_ENABLED(NRF_LOG) -#include "nrf_strerror.h" -#define NRF_LOG_ERROR_STRING_GET(code) nrf_strerror_get(code) -#else -#define NRF_LOG_ERROR_STRING_GET(code) "" -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -/** @brief Severity level for the module. - * - * The severity level can be defined in a module to override the default. - */ -#ifndef NRF_LOG_LEVEL - #define NRF_LOG_LEVEL NRF_LOG_DEFAULT_LEVEL -#endif - -/** @brief Initial severity if filtering is enabled. - */ -#ifndef NRF_LOG_INITIAL_LEVEL - #define NRF_LOG_INITIAL_LEVEL NRF_LOG_LEVEL -#endif - - -#include "nrf_log_internal.h" - -/** @def NRF_LOG_ERROR - * @brief Macro for logging error messages. It takes a printf-like, formatted - * string with up to seven arguments. - * - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes error logs. - */ - -/** @def NRF_LOG_WARNING - * @brief Macro for logging error messages. It takes a printf-like, formatted - * string with up to seven arguments. - * - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes warning logs. - */ - -/** @def NRF_LOG_INFO - * @brief Macro for logging error messages. It takes a printf-like, formatted - * string with up to seven arguments. - * - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes info logs. - */ - -/** @def NRF_LOG_DEBUG - * @brief Macro for logging error messages. It takes a printf-like, formatted - * string with up to seven arguments. - * - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes debug logs. - */ - -#define NRF_LOG_ERROR(...) NRF_LOG_INTERNAL_ERROR(__VA_ARGS__) -#define NRF_LOG_WARNING(...) NRF_LOG_INTERNAL_WARNING( __VA_ARGS__) -#define NRF_LOG_INFO(...) NRF_LOG_INTERNAL_INFO( __VA_ARGS__) -#define NRF_LOG_DEBUG(...) NRF_LOG_INTERNAL_DEBUG( __VA_ARGS__) - -/** @def NRF_LOG_INST_ERROR - * @brief Macro for logging error messages for a given module instance. It takes a printf-like, formatted - * string with up to seven arguments. - * - * @param p_inst Pointer to the instance with logging support. - * - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes error logs. - */ - -/** @def NRF_LOG_INST_WARNING - * @brief Macro for logging error messages for a given module instance. It takes a printf-like, formatted - * string with up to seven arguments. - * - * @param p_inst Pointer to the instance with logging support. - * - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes error logs. - */ - -/** @def NRF_LOG_INST_INFO - * @brief Macro for logging error messages for a given module instance. It takes a printf-like, formatted - * string with up to seven arguments. - * - * @param p_inst Pointer to the instance with logging support. - * - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes error logs. - */ - -/** @def NRF_LOG_INST_DEBUG - * @brief Macro for logging error messages for given module instance. It takes a printf-like, formatted - * string with up to seven arguments. - * - * @param p_inst Pointer to the instance with logging support. - * - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes error logs. - */ -#define NRF_LOG_INST_ERROR(p_inst,...) NRF_LOG_INTERNAL_INST_ERROR(p_inst,__VA_ARGS__) -#define NRF_LOG_INST_WARNING(p_inst,...) NRF_LOG_INTERNAL_INST_WARNING(p_inst,__VA_ARGS__) -#define NRF_LOG_INST_INFO(p_inst,...) NRF_LOG_INTERNAL_INST_INFO(p_inst, __VA_ARGS__) -#define NRF_LOG_INST_DEBUG(p_inst,...) NRF_LOG_INTERNAL_INST_DEBUG(p_inst, __VA_ARGS__) - -/** - * @brief Macro for logging a formatted string without any prefix or timestamp. - */ -#define NRF_LOG_RAW_INFO(...) NRF_LOG_INTERNAL_RAW_INFO( __VA_ARGS__) - -/** @def NRF_LOG_HEXDUMP_ERROR - * @brief Macro for logging raw bytes. - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes error logs. - * - * @param p_data Pointer to data. - * @param len Data length in bytes. - */ -/** @def NRF_LOG_HEXDUMP_WARNING - * @brief Macro for logging raw bytes. - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes warning logs. - * - * @param p_data Pointer to data. - * @param len Data length in bytes. - */ -/** @def NRF_LOG_HEXDUMP_INFO - * @brief Macro for logging raw bytes. - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes info logs. - * - * @param p_data Pointer to data. - * @param len Data length in bytes. - */ -/** @def NRF_LOG_HEXDUMP_DEBUG - * @brief Macro for logging raw bytes. - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes debug logs. - * - * @param p_data Pointer to data. - * @param len Data length in bytes. - */ -#define NRF_LOG_HEXDUMP_ERROR(p_data, len) NRF_LOG_INTERNAL_HEXDUMP_ERROR(p_data, len) -#define NRF_LOG_HEXDUMP_WARNING(p_data, len) NRF_LOG_INTERNAL_HEXDUMP_WARNING(p_data, len) -#define NRF_LOG_HEXDUMP_INFO(p_data, len) NRF_LOG_INTERNAL_HEXDUMP_INFO(p_data, len) -#define NRF_LOG_HEXDUMP_DEBUG(p_data, len) NRF_LOG_INTERNAL_HEXDUMP_DEBUG(p_data, len) - -/** @def NRF_LOG_HEXDUMP_INST_ERROR - * @brief Macro for logging raw bytes for a specific module instance. - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes error logs. - * - * @param p_inst Pointer to the instance with logging support. - * @param p_data Pointer to data. - * @param len Data length in bytes. - */ -/** @def NRF_LOG_HEXDUMP_INST_WARNING - * @brief Macro for logging raw bytes for a specific module instance. - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes error logs. - * - * @param p_inst Pointer to the instance with logging support. - * @param p_data Pointer to data. - * @param len Data length in bytes. - */ -/** @def NRF_LOG_HEXDUMP_INST_INFO - * @brief Macro for logging raw bytes for a specific module instance. - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes error logs. - * - * @param p_inst Pointer to the instance with logging support. - * @param p_data Pointer to data. - * @param len Data length in bytes. - */ -/** @def NRF_LOG_HEXDUMP_INST_DEBUG - * @brief Macro for logging raw bytes for a specific module instance. - * @details This macro is compiled only if @ref NRF_LOG_LEVEL includes error logs. - * - * @param p_inst Pointer to the instance with logging support. - * @param p_data Pointer to data. - * @param len Data length in bytes. - */ -#define NRF_LOG_HEXDUMP_INST_ERROR(p_inst, p_data, len) NRF_LOG_INTERNAL_HEXDUMP_INST_ERROR(p_inst, p_data, len) -#define NRF_LOG_HEXDUMP_INST_WARNING(p_inst, p_data, len) NRF_LOG_INTERNAL_HEXDUMP_INST_WARNING(p_inst, p_data, len) -#define NRF_LOG_HEXDUMP_INST_INFO(p_inst, p_data, len) NRF_LOG_INTERNAL_HEXDUMP_INST_INFO(p_inst, p_data, len) -#define NRF_LOG_HEXDUMP_INST_DEBUG(p_inst, p_data, len) NRF_LOG_INTERNAL_HEXDUMP_INST_DEBUG(p_inst, p_data, len) - -/** - * @brief Macro for logging hexdump without any prefix or timestamp. - */ -#define NRF_LOG_RAW_HEXDUMP_INFO(p_data, len) NRF_LOG_INTERNAL_RAW_HEXDUMP_INFO(p_data, len) - - -/** - * @brief Macro for copying a string to internal logger buffer if logs are deferred. - * - * @param _str String. - */ -#define NRF_LOG_PUSH(_str) NRF_LOG_INTERNAL_LOG_PUSH(_str) - -/** - * @brief Function for copying a string to the internal logger buffer if logs are deferred. - * - * Use this function to store a string that is volatile (for example allocated - * on stack) or that may change before the deferred logs are processed. Such string is copied - * into the internal logger buffer and is persistent until the log is processed. - * - * @note If the logs are not deferred, then this function returns the input parameter. - * - * @param p_str Pointer to the user string. - * - * @return Address to the location where the string is stored in the internal logger buffer. - */ -uint32_t nrf_log_push(char * const p_str); - -/** - * @brief Macro to be used in a formatted string to a pass float number to the log. - * - * Use this macro in a formatted string instead of the %f specifier together with - * @ref NRF_LOG_FLOAT macro. - * Example: NRF_LOG_INFO("My float number" NRF_LOG_FLOAT_MARKER "\r\n", NRF_LOG_FLOAT(f))) - */ -#define NRF_LOG_FLOAT_MARKER "%s%d.%02d" - -/** - * @brief Macro for dissecting a float number into two numbers (integer and residuum). - */ -#define NRF_LOG_FLOAT(val) (uint32_t)(((val) < 0 && (val) > -1.0) ? "-" : ""), \ - (int32_t)(val), \ - (int32_t)((((val) > 0) ? (val) - (int32_t)(val) \ - : (int32_t)(val) - (val))*100) - - -/** - * @brief Macro for registering an independent module. - * - * Registration creates set of dynamic (RAM) and constant variables associated with the module. - */ -#define NRF_LOG_MODULE_REGISTER() NRF_LOG_INTERNAL_MODULE_REGISTER() - - -#ifdef __cplusplus -} -#endif - -#endif // NRF_LOG_H_ - -/** @} */ diff --git a/third_party/NordicSemiconductor/dependencies/nrf_log_ctrl.h b/third_party/NordicSemiconductor/dependencies/nrf_log_ctrl.h deleted file mode 100755 index a78d2dcb5..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrf_log_ctrl.h +++ /dev/null @@ -1,252 +0,0 @@ -/** - * Copyright (c) 2016 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_LOG_CTRL_H -#define NRF_LOG_CTRL_H - -/**@file - * @addtogroup nrf_log Logger module - * @ingroup app_common - * - * @defgroup nrf_log_ctrl Functions for controlling nrf_log - * @{ - * @ingroup nrf_log - * @brief The nrf_log control interface. - */ - -#include "sdk_config.h" -#include "sdk_errors.h" -#include -#include -#include "nrf_log_types.h" -#include "nrf_log_ctrl_internal.h" - -/* Different backends currently not supported. */ -#define LOG_BACKEND 0 - -#if LOG_BACKEND -#include "nrf_log_backend_interface.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Timestamp function prototype. - * - * @return Timestamp value. - */ -typedef uint32_t (*nrf_log_timestamp_func_t)(void); - - -/**@brief Macro for initializing the logs. - * - * Macro has one or two parameters. First parameter (obligatory) is the timestamp function (@ref nrf_log_timestamp_func_t). - * Additionally, as the second parameter timestamp frequency in Hz can be provided. If not provided then default - * frequency is used (@ref NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY). Frequency is used to format timestamp prefix if - * @ref NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED is set. - * - * @return NRF_SUCCESS after successful initialization, otherwise an error code. - */ -#define NRF_LOG_INIT(...) NRF_LOG_INTERNAL_INIT(__VA_ARGS__) - - -/**@brief Macro for processing a single log entry from a queue of deferred logs. - * - * You can call this macro from the main context or from the error handler to process - * log entries one by one. - * - * @note If logs are not deferred, this call has no use and is defined as 'false'. - * - * @retval true There are more logs to process in the buffer. - * @retval false No more logs in the buffer. - */ -#define NRF_LOG_PROCESS() NRF_LOG_INTERNAL_PROCESS() - -/** @brief Macro for processing all log entries from the buffer. - * It blocks until all buffered entries are processed by the backend. - * - * @note If logs are not deferred, this call has no use and is empty. - */ -#define NRF_LOG_FLUSH() NRF_LOG_INTERNAL_FLUSH() - -/** @brief Macro for flushing log data before reset. - * - * @note If logs are not deferred, this call has no use and is empty. - * - * @note If RTT is used, then a breakpoint is hit once flushed. - */ -#define NRF_LOG_FINAL_FLUSH() NRF_LOG_INTERNAL_FINAL_FLUSH() - -/** - * @brief Function for initializing the frontend and the default backend. - * - * @ref NRF_LOG_INIT calls this function to initialize the frontend and the backend. - * If custom backend is used, then @ref NRF_LOG_INIT should not be called. - * Instead, frontend and user backend should be verbosely initialized. - * - * @param timestamp_func Function for getting a 32-bit timestamp. - * @param timestamp_freq Frequency of the timestamp. - * - * @return Error status. - * - */ -ret_code_t nrf_log_init(nrf_log_timestamp_func_t timestamp_func, uint32_t timestamp_freq); - -#if LOG_BACKEND -/** - * @brief Function for adding new backend interface to the logger. - * - * @param p_backend Pointer to the backend interface. - * @param severity Initial value of severity level for each module forwarded to the backend. This - * option is only applicable if @ref NRF_LOG_FILTERS_ENABLED is set. - * @return -1 if backend cannot be added or positive number (backend ID). - */ -int32_t nrf_log_backend_add(nrf_log_backend_t const * p_backend, nrf_log_severity_t severity); - -/** - * @brief Function for removing backend from the logger. - * - * @param p_backend Pointer to the backend interface. - * - */ -void nrf_log_backend_remove(nrf_log_backend_t const * p_backend); -#endif /* LOG_BACKEND */ - -/** - * @brief Function for setting logger backends into panic mode. - * - * When this function is called all attached backends are informed about panic state of the system. - * It is up to the backend to react properly (hold or process logs in blocking mode, etc.) - */ -void nrf_log_panic(void); - -/** - * @brief Function for handling a single log entry. - * - * Use this function only if the logs are buffered. It takes a single entry from the - * buffer and attempts to process it. - * - * @retval true If there are more entries to process. - * @retval false If there are no more entries to process. - */ -bool nrf_log_frontend_dequeue(void); - -/** - * @brief Function for getting number of independent log modules registered into the logger. - * - * @return Number of registered modules. - */ -uint32_t nrf_log_module_cnt_get(void); - -/** - * @brief Function for getting module name. - * - * @param module_id Module ID. - * @param is_ordered_idx Module ID is given is index in alphabetically sorted list of modules. - * @return Pointer to string with module name. - */ -const char * nrf_log_module_name_get(uint32_t module_id, bool is_ordered_idx); - -/** - * @brief Function for getting coloring of specific logs. - * - * @param module_id Module ID. - * @param severity Log severity. - * - * @return ID of the color. - */ -uint8_t nrf_log_color_id_get(uint32_t module_id, nrf_log_severity_t severity); - -/** - * @brief Function for configuring filtering ofs logs in the module. - * - * Filtering of logs in modules is independent for each backend. - * - * @param backend_id Backend ID which want to chenge its configuration. - * @param module_id Module ID which logs will be reconfigured. - * @param severity New severity filter. - */ -void nrf_log_module_filter_set(uint32_t backend_id, - uint32_t module_id, - nrf_log_severity_t severity); - -/** - * @brief Function for getting module severity level. - * - * @param backend_id Backend ID. - * @param module_id Module ID. - * @param is_ordered_idx Module ID is given is index in alphabetically sorted list of modules. - * @param dynamic It true current filter for given backend is returned. If false then - * compiled-in level is returned (maximum available). If this parameter is - * false then backend_id parameter is not used. - * - * @return Severity. - */ -nrf_log_severity_t nrf_log_module_filter_get(uint32_t backend_id, - uint32_t module_id, - bool is_ordered_idx, - bool dynamic); - -/** - * @brief Function stores current filtering configuration into non-volatile memory using @ref fds module. - * - * @return NRF_SUCCESS or @ref fds error code. - */ -ret_code_t nrf_log_config_store(void); - -/** - * @brief Function loads configuration from non-volatile memory using @ref fds module. - * - * @retval NRF_SUCCESS On successful loading. - * @retval NRF_ERROR_NOT_FOUND Configuration file not found. - * @retval NRF_ERROR_INTERNAL Other @ref fds error on reading configuration file. - */ -ret_code_t nrf_log_config_load(void); - -#ifdef __cplusplus -} -#endif - -#endif // NRF_LOG_CTRL_H - -/** - *@} - **/ diff --git a/third_party/NordicSemiconductor/dependencies/nrf_log_ctrl_internal.h b/third_party/NordicSemiconductor/dependencies/nrf_log_ctrl_internal.h deleted file mode 100755 index 912f63457..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrf_log_ctrl_internal.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Copyright (c) 2016 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_LOG_CTRL_INTERNAL_H -#define NRF_LOG_CTRL_INTERNAL_H -/** - * @cond (NODOX) - * @defgroup nrf_log_ctrl_internal Auxiliary internal types declarations - * @{ - * @internal - */ - -#include "sdk_common.h" -#if NRF_MODULE_ENABLED(NRF_LOG) - -#define NRF_LOG_LFCLK_FREQ 32768 - -#ifdef APP_TIMER_CONFIG_RTC_FREQUENCY -#define LOG_TIMESTAMP_DEFAULT_FREQUENCY ((NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY == 0) ? \ - (NRF_LOG_LFCLK_FREQ/(APP_TIMER_CONFIG_RTC_FREQUENCY + 1)) : \ - NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY) -#else -#define LOG_TIMESTAMP_DEFAULT_FREQUENCY NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY -#endif - -#define NRF_LOG_INTERNAL_INIT(...) \ - nrf_log_init(GET_VA_ARG_1(__VA_ARGS__), \ - GET_VA_ARG_1(GET_ARGS_AFTER_1(__VA_ARGS__, LOG_TIMESTAMP_DEFAULT_FREQUENCY))) - -#define NRF_LOG_INTERNAL_PROCESS() nrf_log_frontend_dequeue() -#define NRF_LOG_INTERNAL_FLUSH() \ - do { \ - while (NRF_LOG_INTERNAL_PROCESS()); \ - } while (0) - -#define NRF_LOG_INTERNAL_FINAL_FLUSH() \ - do { \ - nrf_log_panic(); \ - NRF_LOG_INTERNAL_FLUSH(); \ - } while (0) - - -#else // NRF_MODULE_ENABLED(NRF_LOG) -#define NRF_LOG_INTERNAL_PROCESS() false -#define NRF_LOG_INTERNAL_FLUSH() -#define NRF_LOG_INTERNAL_INIT(timestamp_func) NRF_SUCCESS -#define NRF_LOG_INTERNAL_HANDLERS_SET(default_handler, bytes_handler) \ - UNUSED_PARAMETER(default_handler); UNUSED_PARAMETER(bytes_handler) -#define NRF_LOG_INTERNAL_FINAL_FLUSH() -#endif // NRF_MODULE_ENABLED(NRF_LOG) - -/** @} - * @endcond - */ -#endif // NRF_LOG_CTRL_INTERNAL_H diff --git a/third_party/NordicSemiconductor/dependencies/nrf_log_instance.h b/third_party/NordicSemiconductor/dependencies/nrf_log_instance.h deleted file mode 100644 index 9b707365a..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrf_log_instance.h +++ /dev/null @@ -1,135 +0,0 @@ -/** - * Copyright (c) 2018 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_LOG_INSTANCE_H -#define NRF_LOG_INSTANCE_H - -#include "sdk_config.h" -#include "nrf_section.h" -#include "nrf_log_types.h" -#include -/* - * For GCC, sections are sorted in the group by the linker. For IAR and KEIL, it is assumed that linker will sort - * dynamic and const section in the same order (but in different locations). Proper message formatting - * is based on that assumption. - */ -#if defined(__GNUC__) -#define NRF_LOG_DYNAMIC_SECTION_NAME(_module_name) CONCAT_2(log_dynamic_data_,_module_name) -#define NRF_LOG_CONST_SECTION_NAME(_module_name) CONCAT_2(log_const_data_,_module_name) -#else -#define NRF_LOG_DYNAMIC_SECTION_NAME(_module_name) log_dynamic_data -#define NRF_LOG_CONST_SECTION_NAME(_module_name) log_const_data -#endif - -#define NRF_LOG_ITEM_DATA(_name) CONCAT_3(m_nrf_log_,_name,_logs_data) -#define NRF_LOG_ITEM_DATA_DYNAMIC(_name) CONCAT_2(NRF_LOG_ITEM_DATA(_name),_dynamic) -#define NRF_LOG_ITEM_DATA_CONST(_name) CONCAT_2(NRF_LOG_ITEM_DATA(_name),_const) - -#ifdef UNIT_TEST -#define _CONST -#else -#define _CONST const -#endif - -#if NRF_LOG_FILTERS_ENABLED -#define NRF_LOG_DYNAMIC_STRUCT_NAME nrf_log_module_dynamic_data_t -#else -#define NRF_LOG_DYNAMIC_STRUCT_NAME nrf_log_module_reduced_dynamic_data_t -#endif - -#define NRF_LOG_INTERNAL_ITEM_REGISTER( \ - _name, _str_name, _info_color, _debug_color, _initial_lvl, _compiled_lvl) \ - NRF_SECTION_ITEM_REGISTER(NRF_LOG_CONST_SECTION_NAME(_name), \ - _CONST nrf_log_module_const_data_t NRF_LOG_ITEM_DATA_CONST(_name)) = { \ - .p_module_name = _str_name, \ - .info_color_id = _info_color, \ - .debug_color_id = _debug_color, \ - .compiled_lvl = (nrf_log_severity_t)_compiled_lvl, \ - .initial_lvl = (nrf_log_severity_t)_initial_lvl, \ - }; \ - NRF_SECTION_ITEM_REGISTER(NRF_LOG_DYNAMIC_SECTION_NAME(_name), \ - NRF_LOG_DYNAMIC_STRUCT_NAME NRF_LOG_ITEM_DATA_DYNAMIC(_name)) - -/**@file - * - * @defgroup nrf_log_instance Macros for logging on instance level - * @{ - * @ingroup nrf_log - * - * @brief Macros for logging on instance level - */ - -/** @def NRF_LOG_INSTANCE_PTR_DECLARE - * @brief Macro for declaring a logger instance pointer in the module stucture. - */ - -/** @def NRF_LOG_INSTANCE_REGISTER - * @brief Macro for creating an independent module instance. - * - * Module instance provides filtering of logs on instance level instead of module level. - */ - -/** @def NRF_LOG_INSTANCE_PTR_INIT - * @brief Macro for initializing a pointer to the logger instance. - */ - - - /** @} */ -#if NRF_LOG_ENABLED -#define NRF_LOG_INSTANCE_PTR_DECLARE(_p_name) NRF_LOG_DYNAMIC_STRUCT_NAME * _p_name; - -#define NRF_LOG_INSTANCE_REGISTER( \ - _module_name, _inst_name, _info_color, _debug_color, _initial_lvl, _compiled_lvl) \ - NRF_LOG_INTERNAL_ITEM_REGISTER(CONCAT_3(_module_name,_,_inst_name), \ - STRINGIFY(_module_name._inst_name), \ - _info_color, \ - _debug_color, \ - _initial_lvl, \ - _compiled_lvl) - -#define NRF_LOG_INSTANCE_PTR_INIT(_p_name, _module_name, _inst_name) \ - ._p_name = &NRF_LOG_ITEM_DATA_DYNAMIC(CONCAT_3(_module_name,_,_inst_name)), - -#else -#define NRF_LOG_INSTANCE_PTR_DECLARE(_p_name) -#define NRF_LOG_INSTANCE_REGISTER(_module_name, _inst_name, info_color, debug_color, _initial_lvl, compiled_lvl) -#define NRF_LOG_INSTANCE_PTR_INIT(_p_name, _module_name, _inst_name) -#endif - -#endif //NRF_LOG_INSTANCE_H diff --git a/third_party/NordicSemiconductor/dependencies/nrf_log_internal.h b/third_party/NordicSemiconductor/dependencies/nrf_log_internal.h deleted file mode 100644 index 1f74a7eac..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrf_log_internal.h +++ /dev/null @@ -1,528 +0,0 @@ -/** - * Copyright (c) 2016 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_LOG_INTERNAL_H__ -#define NRF_LOG_INTERNAL_H__ -#include "sdk_common.h" -#include "nrf.h" -#include "nrf_error.h" -#include "app_util.h" -#include -#include -#include "nrf_log_instance.h" -#include "nrf_log_types.h" - -#ifndef NRF_LOG_ERROR_COLOR - #define NRF_LOG_ERROR_COLOR NRF_LOG_COLOR_DEFAULT -#endif - -#ifndef NRF_LOG_WARNING_COLOR - #define NRF_LOG_WARNING_COLOR NRF_LOG_COLOR_DEFAULT -#endif - -#ifndef NRF_LOG_INFO_COLOR - #define NRF_LOG_INFO_COLOR NRF_LOG_COLOR_DEFAULT -#endif - -#ifndef NRF_LOG_DEBUG_COLOR - #define NRF_LOG_DEBUG_COLOR NRF_LOG_COLOR_DEFAULT -#endif - - -#ifndef NRF_LOG_COLOR_DEFAULT -#define NRF_LOG_COLOR_DEFAULT 0 -#endif - -#ifndef NRF_LOG_DEFAULT_LEVEL -#define NRF_LOG_DEFAULT_LEVEL 0 -#endif - -#ifndef NRF_LOG_USES_COLORS -#define NRF_LOG_USES_COLORS 0 -#endif - -#ifndef NRF_LOG_USES_TIMESTAMP -#define NRF_LOG_USES_TIMESTAMP 0 -#endif - -#ifndef NRF_LOG_FILTERS_ENABLED -#define NRF_LOG_FILTERS_ENABLED 0 -#endif - -#ifndef NRF_LOG_MODULE_NAME - #define NRF_LOG_MODULE_NAME app -#endif - -#define NRF_LOG_LEVEL_BITS 3 -#define NRF_LOG_LEVEL_MASK ((1UL << NRF_LOG_LEVEL_BITS) - 1) -#define NRF_LOG_MODULE_ID_BITS 16 -#define NRF_LOG_MODULE_ID_POS 16 - - -#define NRF_LOG_MAX_NUM_OF_ARGS 6 - - -#if NRF_LOG_FILTERS_ENABLED && NRF_LOG_ENABLED - #define NRF_LOG_FILTER NRF_LOG_ITEM_DATA_DYNAMIC(NRF_LOG_MODULE_NAME).filter - #define NRF_LOG_INST_FILTER(p_inst) (p_inst)->filter -#else - #undef NRF_LOG_FILTER - #define NRF_LOG_FILTER NRF_LOG_SEVERITY_DEBUG - #define NRF_LOG_INST_FILTER(p_inst) NRF_LOG_SEVERITY_DEBUG -#endif - -#if NRF_LOG_ENABLED -#define NRF_LOG_MODULE_ID NRF_LOG_ITEM_DATA_DYNAMIC(NRF_LOG_MODULE_NAME).module_id -#define NRF_LOG_INST_ID(p_inst) (p_inst)->module_id -#else -#define NRF_LOG_MODULE_ID 0 -#define NRF_LOG_INST_ID(p_inst) 0 -#endif - - -#define LOG_INTERNAL_X(N, ...) CONCAT_2(LOG_INTERNAL_, N) (__VA_ARGS__) -#define LOG_INTERNAL(type, ...) LOG_INTERNAL_X(NUM_VA_ARGS_LESS_1( \ - __VA_ARGS__), type, __VA_ARGS__) -#if NRF_LOG_ENABLED -#define NRF_LOG_INTERNAL_LOG_PUSH(_str) nrf_log_push(_str) -#define LOG_INTERNAL_0(type, str) \ - nrf_log_frontend_std_0(type, str) -#define LOG_INTERNAL_1(type, str, arg0) \ - /*lint -save -e571*/nrf_log_frontend_std_1(type, str, (uint32_t)(arg0))/*lint -restore*/ -#define LOG_INTERNAL_2(type, str, arg0, arg1) \ - /*lint -save -e571*/nrf_log_frontend_std_2(type, str, (uint32_t)(arg0), \ - (uint32_t)(arg1))/*lint -restore*/ -#define LOG_INTERNAL_3(type, str, arg0, arg1, arg2) \ - /*lint -save -e571*/nrf_log_frontend_std_3(type, str, (uint32_t)(arg0), \ - (uint32_t)(arg1), (uint32_t)(arg2))/*lint -restore*/ -#define LOG_INTERNAL_4(type, str, arg0, arg1, arg2, arg3) \ - /*lint -save -e571*/nrf_log_frontend_std_4(type, str, (uint32_t)(arg0), \ - (uint32_t)(arg1), (uint32_t)(arg2), (uint32_t)(arg3))/*lint -restore*/ -#define LOG_INTERNAL_5(type, str, arg0, arg1, arg2, arg3, arg4) \ - /*lint -save -e571*/nrf_log_frontend_std_5(type, str, (uint32_t)(arg0), \ - (uint32_t)(arg1), (uint32_t)(arg2), (uint32_t)(arg3), (uint32_t)(arg4))/*lint -restore*/ -#define LOG_INTERNAL_6(type, str, arg0, arg1, arg2, arg3, arg4, arg5) \ - /*lint -save -e571*/nrf_log_frontend_std_6(type, str, (uint32_t)(arg0), \ - (uint32_t)(arg1), (uint32_t)(arg2), (uint32_t)(arg3), (uint32_t)(arg4), (uint32_t)(arg5))/*lint -restore*/ - - -#else //NRF_LOG_ENABLED -#define NRF_LOG_INTERNAL_LOG_PUSH(_str) (void)(_str) -#define LOG_INTERNAL_0(_type, _str) \ - (void)(_type); (void)(_str) -#define LOG_INTERNAL_1(_type, _str, _arg0) \ - (void)(_type); (void)(_str); (void)(_arg0) -#define LOG_INTERNAL_2(_type, _str, _arg0, _arg1) \ - (void)(_type); (void)(_str); (void)(_arg0); (void)(_arg1) -#define LOG_INTERNAL_3(_type, _str, _arg0, _arg1, _arg2) \ - (void)(_type); (void)(_str); (void)(_arg0); (void)(_arg1); (void)(_arg2) -#define LOG_INTERNAL_4(_type, _str, _arg0, _arg1, _arg2, _arg3) \ - (void)(_type); (void)(_str); (void)(_arg0); (void)(_arg1); (void)(_arg2); (void)(_arg3) -#define LOG_INTERNAL_5(_type, _str, _arg0, _arg1, _arg2, _arg3, _arg4) \ - (void)(_type); (void)(_str); (void)(_arg0); (void)(_arg1); (void)(_arg2); (void)(_arg3); (void)(_arg4) -#define LOG_INTERNAL_6(_type, _str, _arg0, _arg1, _arg2, _arg3, _arg4, _arg5) \ - (void)(_type); (void)(_str); (void)(_arg0); (void)(_arg1); (void)(_arg2); (void)(_arg3); (void)(_arg4); (void)(_arg5) -#endif //NRF_LOG_ENABLED - -#define LOG_SEVERITY_MOD_ID(severity) ((severity) | NRF_LOG_MODULE_ID << NRF_LOG_MODULE_ID_POS) -#define LOG_SEVERITY_INST_ID(severity,p_inst) ((severity) | NRF_LOG_INST_ID(p_inst) << NRF_LOG_MODULE_ID_POS) - -#if NRF_LOG_ENABLED -#define LOG_HEXDUMP(_severity, _p_data, _length) \ - nrf_log_frontend_hexdump((_severity), (_p_data), (_length)) -#else -#define LOG_HEXDUMP(_severity, _p_data, _length) \ - (void)(_severity); (void)(_p_data); (void)_length -#endif - -#define NRF_LOG_INTERNAL_INST(level, level_id, p_inst, ...) \ - if (NRF_LOG_ENABLED && (NRF_LOG_LEVEL >= level) && \ - (level <= NRF_LOG_DEFAULT_LEVEL)) \ - { \ - if (NRF_LOG_INST_FILTER(p_inst) >= level) \ - { \ - LOG_INTERNAL(LOG_SEVERITY_INST_ID(level_id, p_inst), __VA_ARGS__); \ - } \ - } - -#define NRF_LOG_INTERNAL_MODULE(level, level_id, ...) \ - if (NRF_LOG_ENABLED && (NRF_LOG_LEVEL >= level) && \ - (level <= NRF_LOG_DEFAULT_LEVEL)) \ - { \ - if (NRF_LOG_FILTER >= level) \ - { \ - LOG_INTERNAL(LOG_SEVERITY_MOD_ID(level_id), __VA_ARGS__); \ - } \ - } - -#define NRF_LOG_INTERNAL_HEXDUMP_INST(level, level_id, p_inst, p_data, len) \ - if (NRF_LOG_ENABLED && (NRF_LOG_LEVEL >= level) && \ - (level <= NRF_LOG_DEFAULT_LEVEL)) \ - { \ - if (NRF_LOG_INST_FILTER(p_inst) >= level) \ - { \ - LOG_HEXDUMP(LOG_SEVERITY_INST_ID(level_id, p_inst), \ - (p_data), (len)); \ - } \ - } - -#define NRF_LOG_INTERNAL_HEXDUMP_MODULE(level, level_id, p_data, len) \ - if (NRF_LOG_ENABLED && (NRF_LOG_LEVEL >= level) && \ - (level <= NRF_LOG_DEFAULT_LEVEL)) \ - { \ - if (NRF_LOG_FILTER >= level) \ - { \ - LOG_HEXDUMP(LOG_SEVERITY_MOD_ID(level_id), \ - (p_data), (len)); \ - } \ - } - -#define NRF_LOG_INTERNAL_INST_ERROR(p_inst, ...) \ - NRF_LOG_INTERNAL_INST(NRF_LOG_SEVERITY_ERROR, NRF_LOG_SEVERITY_ERROR, p_inst, __VA_ARGS__) - -#define NRF_LOG_INTERNAL_ERROR(...) \ - NRF_LOG_INTERNAL_MODULE(NRF_LOG_SEVERITY_ERROR, NRF_LOG_SEVERITY_ERROR,__VA_ARGS__) - -#define NRF_LOG_INTERNAL_HEXDUMP_INST_ERROR(p_inst, p_data, len) \ - NRF_LOG_INTERNAL_HEXDUMP_INST(NRF_LOG_SEVERITY_ERROR, NRF_LOG_SEVERITY_ERROR, p_inst, p_data, len) - -#define NRF_LOG_INTERNAL_HEXDUMP_ERROR(p_data, len) \ - NRF_LOG_INTERNAL_HEXDUMP_MODULE(NRF_LOG_SEVERITY_ERROR, NRF_LOG_SEVERITY_ERROR, p_data, len) - -#define NRF_LOG_INTERNAL_INST_WARNING(p_inst, ...) \ - NRF_LOG_INTERNAL_INST(NRF_LOG_SEVERITY_WARNING, NRF_LOG_SEVERITY_WARNING, p_inst, __VA_ARGS__) - -#define NRF_LOG_INTERNAL_WARNING(...) \ - NRF_LOG_INTERNAL_MODULE(NRF_LOG_SEVERITY_WARNING, NRF_LOG_SEVERITY_WARNING,__VA_ARGS__) - -#define NRF_LOG_INTERNAL_HEXDUMP_INST_WARNING(p_inst, p_data, len) \ - NRF_LOG_INTERNAL_HEXDUMP_INST(NRF_LOG_SEVERITY_WARNING, NRF_LOG_SEVERITY_WARNING, p_inst, p_data, len) - -#define NRF_LOG_INTERNAL_HEXDUMP_WARNING(p_data, len) \ - NRF_LOG_INTERNAL_HEXDUMP_(NRF_LOG_SEVERITY_WARNING, NRF_LOG_SEVERITY_WARNING, p_data, len) - -#define NRF_LOG_INTERNAL_INST_INFO(p_inst, ...) \ - NRF_LOG_INTERNAL_INST(NRF_LOG_SEVERITY_INFO, NRF_LOG_SEVERITY_INFO, p_inst, __VA_ARGS__) - -#define NRF_LOG_INTERNAL_INFO(...) \ - NRF_LOG_INTERNAL_MODULE(NRF_LOG_SEVERITY_INFO, NRF_LOG_SEVERITY_INFO, __VA_ARGS__) - -#define NRF_LOG_INTERNAL_HEXDUMP_INST_INFO(p_inst, p_data, len) \ - NRF_LOG_INTERNAL_HEXDUMP_INST(NRF_LOG_SEVERITY_INFO, NRF_LOG_SEVERITY_INFO, p_inst, p_data, len) - -#define NRF_LOG_INTERNAL_HEXDUMP_INFO(p_data, len) \ - NRF_LOG_INTERNAL_HEXDUMP_MODULE(NRF_LOG_SEVERITY_INFO, NRF_LOG_SEVERITY_INFO, p_data, len) - -#define NRF_LOG_INTERNAL_RAW_INFO(...) \ - NRF_LOG_INTERNAL_MODULE(NRF_LOG_SEVERITY_INFO, NRF_LOG_SEVERITY_INFO_RAW, __VA_ARGS__) - -#define NRF_LOG_INTERNAL_RAW_HEXDUMP_INFO(p_data, len) \ - NRF_LOG_INTERNAL_HEXDUMP_MODULE(NRF_LOG_SEVERITY_INFO, NRF_LOG_SEVERITY_INFO_RAW, p_data, len) - -#define NRF_LOG_INTERNAL_INST_DEBUG(p_inst, ...) \ - NRF_LOG_INTERNAL_INST(NRF_LOG_SEVERITY_DEBUG, NRF_LOG_SEVERITY_DEBUG, p_inst, __VA_ARGS__) - -#define NRF_LOG_INTERNAL_DEBUG(...) \ - NRF_LOG_INTERNAL_MODULE(NRF_LOG_SEVERITY_DEBUG, NRF_LOG_SEVERITY_DEBUG, __VA_ARGS__) - -#define NRF_LOG_INTERNAL_HEXDUMP_INST_DEBUG(p_inst, p_data, len) \ - NRF_LOG_INTERNAL_HEXDUMP_INST(NRF_LOG_SEVERITY_DEBUG, NRF_LOG_SEVERITY_DEBUG, p_inst, p_data, len) - -#define NRF_LOG_INTERNAL_HEXDUMP_DEBUG(p_data, len) \ - NRF_LOG_INTERNAL_HEXDUMP_MODULE(NRF_LOG_SEVERITY_DEBUG, NRF_LOG_SEVERITY_DEBUG, p_data, len) - - -#if NRF_LOG_ENABLED - -#ifdef UNIT_TEST -#define COMPILED_LOG_LEVEL 4 -#else -#define COMPILED_LOG_LEVEL NRF_LOG_LEVEL -#endif - - -#define NRF_LOG_INTERNAL_MODULE_REGISTER() \ - NRF_LOG_INTERNAL_ITEM_REGISTER(NRF_LOG_MODULE_NAME, \ - STRINGIFY(NRF_LOG_MODULE_NAME), \ - NRF_LOG_INFO_COLOR, \ - NRF_LOG_DEBUG_COLOR, \ - NRF_LOG_INITIAL_LEVEL, \ - COMPILED_LOG_LEVEL) - -#else -#define NRF_LOG_INTERNAL_MODULE_REGISTER() /*lint -save -e19*/ /*lint -restore*/ -#endif - -extern NRF_LOG_DYNAMIC_STRUCT_NAME NRF_LOG_ITEM_DATA_DYNAMIC(NRF_LOG_MODULE_NAME); - -/** - * Set of macros for encoding and decoding header for log entries. - * There are 3 types of entries: - * 1. Standard entry (STD) - * An entry consists of header, pointer to string and values. Header contains - * severity leveland determines number of arguments and thus size of the entry. - * Since flash address space starts from 0x00000000 and is limited to kB rather - * than MB 22 bits are used to store the address (4MB). It is used that way to - * save one RAM memory. - * - * -------------------------------- - * |TYPE|SEVERITY|NARGS| P_STR | - * |------------------------------| - * | Module_ID (optional) | - * |------------------------------| - * | TIMESTAMP (optional) | - * |------------------------------| - * | ARG0 | - * |------------------------------| - * | .... | - * |------------------------------| - * | ARG(nargs-1) | - * -------------------------------- - * - * 2. Hexdump entry (HEXDUMP) is used for dumping raw data. An entry consists of - * header, optional timestamp, pointer to string and data. A header contains - * length (10bit) and offset which is updated after backend processes part of - * data. - * - * -------------------------------- - * |TYPE|SEVERITY|NARGS|OFFSET|LEN| - * |------------------------------| - * | Module_ID (optional) | - * |------------------------------| - * | TIMESTAMP (optional) | - * |------------------------------| - * | P_STR | - * |------------------------------| - * | data | - * |------------------------------| - * | data | dummy | - * -------------------------------- - * - * 3. Pushed string. If string is pushed into the logger internal buffer it is - * stored as PUSHED entry. It consists of header, unused data (optional) and - * string. Unused data is present if string does not not fit into a buffer - * without wrapping (and string cannot be wrapped). In that case header - * contains information about offset. - * - * -------------------------------- - * |TYPE| OFFSET | LEN | - * |------------------------------| - * | OFFSET | - * |------------------------------| - * end| OFFSET | - * 0|------------------------------| - * | STRING | - * |------------------------------| - * | STRING | dummy | - * -------------------------------- - */ - -#define STD_ADDR_MASK ((uint32_t)(1U << 22) - 1U) -#define HEADER_TYPE_STD 1U -#define HEADER_TYPE_HEXDUMP 2U -#define HEADER_TYPE_PUSHED 0U -#define HEADER_TYPE_INVALID 3U - -typedef struct -{ - uint32_t type : 2; - uint32_t in_progress: 1; - uint32_t data : 29; -} nrf_log_generic_header_t; - -typedef struct -{ - uint32_t type : 2; - uint32_t in_progress: 1; - uint32_t severity : 3; - uint32_t nargs : 4; - uint32_t addr : 22; -} nrf_log_std_header_t; - -typedef struct -{ - uint32_t type : 2; - uint32_t in_progress: 1; - uint32_t severity : 3; - uint32_t offset : 10; - uint32_t reserved : 6; - uint32_t len : 10; -} nrf_log_hexdump_header_t; - -typedef struct -{ - uint32_t type : 2; - uint32_t reserved0 : 4; - uint32_t offset : 10; - uint32_t reserved1 : 6; - uint32_t len : 10; -} nrf_log_pushed_header_t; - -typedef union -{ - nrf_log_generic_header_t generic; - nrf_log_std_header_t std; - nrf_log_hexdump_header_t hexdump; - nrf_log_pushed_header_t pushed; - uint32_t raw; -} nrf_log_main_header_t; - -typedef struct -{ - nrf_log_main_header_t base; - uint32_t module_id; - uint32_t timestamp; -} nrf_log_header_t; - -#define HEADER_SIZE (sizeof(nrf_log_header_t)/sizeof(uint32_t) - \ - (NRF_LOG_USES_TIMESTAMP ? 0 : 1)) - -#define PUSHED_HEADER_SIZE (sizeof(nrf_log_pushed_header_t)/sizeof(uint32_t)) - -//Implementation assumes that pushed header has one word. -STATIC_ASSERT(PUSHED_HEADER_SIZE == 1); -/** - * @brief A function for logging raw string. - * - * @param severity_mid Severity. - * @param p_str A pointer to a string. - */ -void nrf_log_frontend_std_0(uint32_t severity_mid, char const * const p_str); - -/** - * @brief A function for logging a formatted string with one argument. - * - * @param severity_mid Severity. - * @param p_str A pointer to a formatted string. - * @param val0 An argument. - */ -void nrf_log_frontend_std_1(uint32_t severity_mid, - char const * const p_str, - uint32_t val0); - -/** - * @brief A function for logging a formatted string with 2 arguments. - * - * @param severity_mid Severity. - * @param p_str A pointer to a formatted string. - * @param val0, val1 Arguments for formatting string. - */ -void nrf_log_frontend_std_2(uint32_t severity_mid, - char const * const p_str, - uint32_t val0, - uint32_t val1); - -/** - * @brief A function for logging a formatted string with 3 arguments. - * - * @param severity_mid Severity. - * @param p_str A pointer to a formatted string. - * @param val0, val1, val2 Arguments for formatting string. - */ -void nrf_log_frontend_std_3(uint32_t severity_mid, - char const * const p_str, - uint32_t val0, - uint32_t val1, - uint32_t val2); - -/** - * @brief A function for logging a formatted string with 4 arguments. - * - * @param severity_mid Severity. - * @param p_str A pointer to a formatted string. - * @param val0, val1, val2, val3 Arguments for formatting string. - */ -void nrf_log_frontend_std_4(uint32_t severity_mid, - char const * const p_str, - uint32_t val0, - uint32_t val1, - uint32_t val2, - uint32_t val3); - -/** - * @brief A function for logging a formatted string with 5 arguments. - * - * @param severity_mid Severity. - * @param p_str A pointer to a formatted string. - * @param val0, val1, val2, val3, val4 Arguments for formatting string. - */ -void nrf_log_frontend_std_5(uint32_t severity_mid, - char const * const p_str, - uint32_t val0, - uint32_t val1, - uint32_t val2, - uint32_t val3, - uint32_t val4); - -/** - * @brief A function for logging a formatted string with 6 arguments. - * - * @param severity_mid Severity. - * @param p_str A pointer to a formatted string. - * @param val0, val1, val2, val3, val4, val5 Arguments for formatting string. - */ -void nrf_log_frontend_std_6(uint32_t severity_mid, - char const * const p_str, - uint32_t val0, - uint32_t val1, - uint32_t val2, - uint32_t val3, - uint32_t val4, - uint32_t val5); - -/** - * @brief A function for logging raw data. - * - * @param severity_mid Severity. - * @param p_str A pointer to a string which is prefixing the data. - * @param p_data A pointer to data to be dumped. - * @param length Length of data (in bytes). - * - */ -void nrf_log_frontend_hexdump(uint32_t severity_mid, - const void * const p_data, - uint16_t length); - -/** - * @brief A function for reading a byte from log backend. - * - * @return Byte. - */ -uint8_t nrf_log_getchar(void); -#endif // NRF_LOG_INTERNAL_H__ diff --git a/third_party/NordicSemiconductor/dependencies/nrf_log_types.h b/third_party/NordicSemiconductor/dependencies/nrf_log_types.h deleted file mode 100644 index 2ae08d303..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrf_log_types.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Copyright (c) 2018 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_LOG_TYPES_H -#define NRF_LOG_TYPES_H - -#include - -/** - * @brief Logger severity levels. - */ -typedef enum -{ - NRF_LOG_SEVERITY_NONE, - NRF_LOG_SEVERITY_ERROR, - NRF_LOG_SEVERITY_WARNING, - NRF_LOG_SEVERITY_INFO, - NRF_LOG_SEVERITY_DEBUG, - NRF_LOG_SEVERITY_INFO_RAW, /* Artificial level to pass information about skipping string postprocessing.*/ -} nrf_log_severity_t; - -/** - * @brief Structure holding dynamic data associated with a module or instance if filtering is enabled (@ref NRF_LOG_FILTERS_ENABLED). - * - * See @ref NRF_LOG_MODULE_REGISTER and @ref NRF_LOG_INSTANCE_REGISTER. - */ -typedef struct -{ - uint16_t module_id; ///< Module ID assigned during initialization. - uint16_t order_idx; ///< Ordered index of the module (used for auto-completion). - uint32_t filter; ///< Current highest severity level accepted (redundant to @ref nrf_log_module_dynamic_data_t::filter_lvls, used for optimization) - uint32_t filter_lvls; ///< Current severity levels for each backend (3 bits per backend). -} nrf_log_module_dynamic_data_t; - -/** - * @brief Structure holding dynamic data associated with a module or instance if filtering is disabled (@ref NRF_LOG_FILTERS_ENABLED). - * - * See @ref NRF_LOG_MODULE_REGISTER and @ref NRF_LOG_INSTANCE_REGISTER. - */ -typedef struct -{ - uint16_t module_id; ///< Module ID assigned during initialization. - uint16_t padding; ///< Padding to fit in word. -} nrf_log_module_reduced_dynamic_data_t; - - -/** - * @brief Structure holding constant data associated with a module or instance. - * - * See @ref NRF_LOG_MODULE_REGISTER and @ref NRF_LOG_INSTANCE_REGISTER. - */ -typedef struct -{ - const char * p_module_name; ///< Module or instance name. - uint8_t info_color_id; ///< Color code of info messages. - uint8_t debug_color_id; ///< Color code of debug messages. - nrf_log_severity_t compiled_lvl; ///< Compiled highest severity level. - nrf_log_severity_t initial_lvl; ///< Severity level for given module or instance set on backend initialization. -} nrf_log_module_const_data_t; - -#endif //NRF_LOG_TYPES_H diff --git a/third_party/NordicSemiconductor/dependencies/nrf_section.h b/third_party/NordicSemiconductor/dependencies/nrf_section.h deleted file mode 100644 index a482be0f5..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrf_section.h +++ /dev/null @@ -1,191 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_SECTION_H__ -#define NRF_SECTION_H__ - -#include "nordic_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup section_vars Section variables - * @ingroup app_common - * @{ - * - * @brief Section variables. - */ - -//lint -save -e27 -esym(526,*) - -#if defined(__ICCARM__) -// Enable IAR language extensions -#pragma language=extended -#endif - -/**@brief Macro for obtaining the address of the beginning of a section. - * - * param[in] section_name Name of the section. - * @hideinitializer - */ -#if defined(__CC_ARM) -#define NRF_SECTION_START_ADDR(section_name) &CONCAT_2(section_name, $$Base) - -#elif defined(__GNUC__) -#define NRF_SECTION_START_ADDR(section_name) &CONCAT_2(__start_, section_name) - -#elif defined(__ICCARM__) -#define NRF_SECTION_START_ADDR(section_name) __section_begin(STRINGIFY(section_name)) -#endif - - -/**@brief Macro for obtaining the address of the end of a section. - * - * @param[in] section_name Name of the section. - * @hideinitializer - */ -#if defined(__CC_ARM) -#define NRF_SECTION_END_ADDR(section_name) &CONCAT_2(section_name, $$Limit) - -#elif defined(__GNUC__) -#define NRF_SECTION_END_ADDR(section_name) &CONCAT_2(__stop_, section_name) - -#elif defined(__ICCARM__) -#define NRF_SECTION_END_ADDR(section_name) __section_end(STRINGIFY(section_name)) -#endif - - -/**@brief Macro for retrieving the length of a given section, in bytes. - * - * @param[in] section_name Name of the section. - * @hideinitializer - */ -#define NRF_SECTION_LENGTH(section_name) \ - ((size_t)NRF_SECTION_END_ADDR(section_name) - \ - (size_t)NRF_SECTION_START_ADDR(section_name)) - - -/**@brief Macro for creating a section. - * - * @param[in] section_name Name of the section. - * @param[in] data_type Data type of the variables to be registered in the section. - * - * @warning Data type must be word aligned to prevent padding. - * @hideinitializer - */ -#if defined(__CC_ARM) -#define NRF_SECTION_DEF(section_name, data_type) \ - extern data_type * CONCAT_2(section_name, $$Base); \ - extern void * CONCAT_2(section_name, $$Limit) - -#elif defined(__GNUC__) -#define NRF_SECTION_DEF(section_name, data_type) \ - extern data_type * CONCAT_2(__start_, section_name); \ - extern void * CONCAT_2(__stop_, section_name) - -#elif defined(__ICCARM__) -#define NRF_SECTION_DEF(section_name, data_type) \ - _Pragma(STRINGIFY(section = STRINGIFY(section_name))); - -#endif - - -/**@brief Macro for declaring a variable and registering it in a section. - * - * @details Declares a variable and registers it in a named section. This macro ensures that the - * variable is not stripped away when using optimizations. - * - * @note The order in which variables are placed in a section is dependent on the order in - * which the linker script encounters the variables during linking. - * - * @param[in] section_name Name of the section. - * @param[in] section_var Variable to register in the given section. - * @hideinitializer - */ -#if defined(__CC_ARM) -#define NRF_SECTION_ITEM_REGISTER(section_name, section_var) \ - section_var __attribute__ ((section(STRINGIFY(section_name)))) __attribute__((used)) - -#elif defined(__GNUC__) -#define NRF_SECTION_ITEM_REGISTER(section_name, section_var) \ - section_var __attribute__ ((section("." STRINGIFY(section_name)))) __attribute__((used)) - -#elif defined(__ICCARM__) -#define NRF_SECTION_ITEM_REGISTER(section_name, section_var) \ - __root section_var @ STRINGIFY(section_name) -#endif - - -/**@brief Macro for retrieving a variable from a section. - * - * @warning The stored symbol can only be resolved using this macro if the - * type of the data is word aligned. The operation of acquiring - * the stored symbol relies on the size of the stored type. No - * padding can exist in the named section in between individual - * stored items or this macro will fail. - * - * @param[in] section_name Name of the section. - * @param[in] data_type Data type of the variable. - * @param[in] i Index of the variable in section. - * @hideinitializer - */ -#define NRF_SECTION_ITEM_GET(section_name, data_type, i) \ - ((data_type*)NRF_SECTION_START_ADDR(section_name) + (i)) - - -/**@brief Macro for getting the number of variables in a section. - * - * @param[in] section_name Name of the section. - * @param[in] data_type Data type of the variables in the section. - * @hideinitializer - */ -#define NRF_SECTION_ITEM_COUNT(section_name, data_type) \ - NRF_SECTION_LENGTH(section_name) / sizeof(data_type) - -/** @} */ - -//lint -restore - -#ifdef __cplusplus -} -#endif - -#endif // NRF_SECTION_H__ diff --git a/third_party/NordicSemiconductor/dependencies/nrfx_config.h b/third_party/NordicSemiconductor/dependencies/nrfx_config.h deleted file mode 100644 index b006b6bcd..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrfx_config.h +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRFX_CONFIG_H__ -#define NRFX_CONFIG_H__ - -// TODO - temporary redirection -#include - -#endif // NRFX_CONFIG_H__ diff --git a/third_party/NordicSemiconductor/dependencies/nrfx_glue.h b/third_party/NordicSemiconductor/dependencies/nrfx_glue.h deleted file mode 100644 index 20c5fbdcb..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrfx_glue.h +++ /dev/null @@ -1,338 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRFX_GLUE_H__ -#define NRFX_GLUE_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrfx_glue nrfx_glue.h - * @{ - * @ingroup nrfx - * - * @brief This file contains macros that should be implemented according to - * the needs of the host environment into which @em nrfx is integrated. - */ - -#include - -#include - -//------------------------------------------------------------------------------ - -#include -/** - * @brief Macro for placing a runtime assertion. - * - * @param expression Expression to evaluate. - */ -#define NRFX_ASSERT(expression) ASSERT(expression) - -#include -/** - * @brief Macro for placing a compile time assertion. - * - * @param expression Expression to evaluate. - */ -#define NRFX_STATIC_ASSERT(expression) STATIC_ASSERT(expression) - -//------------------------------------------------------------------------------ - -#ifdef NRF51 -#ifdef SOFTDEVICE_PRESENT -#define INTERRUPT_PRIORITY_IS_VALID(pri) (((pri) == 1) || ((pri) == 3)) -#else -#define INTERRUPT_PRIORITY_IS_VALID(pri) ((pri) < 4) -#endif //SOFTDEVICE_PRESENT -#else -#ifdef SOFTDEVICE_PRESENT -#define INTERRUPT_PRIORITY_IS_VALID(pri) ((((pri) > 1) && ((pri) < 4)) || \ - (((pri) > 4) && ((pri) < 8))) -#else -#define INTERRUPT_PRIORITY_IS_VALID(pri) ((pri) < 8) -#endif //SOFTDEVICE_PRESENT -#endif //NRF52 - -/** - * @brief Macro for setting the priority of a specific IRQ. - * - * @param irq_number IRQ number. - * @param priority Priority to set. - */ -#define NRFX_IRQ_PRIORITY_SET(irq_number, priority) \ - _NRFX_IRQ_PRIORITY_SET(irq_number, priority) -static inline void _NRFX_IRQ_PRIORITY_SET(IRQn_Type irq_number, - uint8_t priority) -{ - ASSERT(INTERRUPT_PRIORITY_IS_VALID(priority)); - NVIC_SetPriority(irq_number, priority); -} - -/** - * @brief Macro for enabling a specific IRQ. - * - * @param irq_number IRQ number. - */ -#define NRFX_IRQ_ENABLE(irq_number) _NRFX_IRQ_ENABLE(irq_number) -static inline void _NRFX_IRQ_ENABLE(IRQn_Type irq_number) -{ - NVIC_EnableIRQ(irq_number); -} - -/** - * @brief Macro for checking if a specific IRQ is enabled. - * - * @param irq_number IRQ number. - * - * @retval true If the IRQ is enabled. - * @retval false Otherwise. - */ -#define NRFX_IRQ_IS_ENABLED(irq_number) _NRFX_IRQ_IS_ENABLED(irq_number) -static inline bool _NRFX_IRQ_IS_ENABLED(IRQn_Type irq_number) -{ - return 0 != (NVIC->ISER[irq_number / 32] & (1UL << (irq_number % 32))); -} - -/** - * @brief Macro for disabling a specific IRQ. - * - * @param irq_number IRQ number. - */ -#define NRFX_IRQ_DISABLE(irq_number) _NRFX_IRQ_DISABLE(irq_number) -static inline void _NRFX_IRQ_DISABLE(IRQn_Type irq_number) -{ - NVIC_DisableIRQ(irq_number); -} - -/** - * @brief Macro for setting a specific IRQ as pending. - * - * @param irq_number IRQ number. - */ -#define NRFX_IRQ_PENDING_SET(irq_number) _NRFX_IRQ_PENDING_SET(irq_number) -static inline void _NRFX_IRQ_PENDING_SET(IRQn_Type irq_number) -{ - NVIC_SetPendingIRQ(irq_number); -} - -/** - * @brief Macro for clearing the pending status of a specific IRQ. - * - * @param irq_number IRQ number. - */ -#define NRFX_IRQ_PENDING_CLEAR(irq_number) _NRFX_IRQ_PENDING_CLEAR(irq_number) -static inline void _NRFX_IRQ_PENDING_CLEAR(IRQn_Type irq_number) -{ - NVIC_ClearPendingIRQ(irq_number); -} - -/** - * @brief Macro for checking the pending status of a specific IRQ. - * - * @retval true If the IRQ is pending. - * @retval false Otherwise. - */ -#define NRFX_IRQ_IS_PENDING(irq_number) _NRFX_IRQ_IS_PENDING(irq_number) -static inline bool _NRFX_IRQ_IS_PENDING(IRQn_Type irq_number) -{ - return (NVIC_GetPendingIRQ(irq_number) == 1); -} - -#include -#include -/** - * @brief Macro for entering into a critical section. - */ -#define NRFX_CRITICAL_SECTION_ENTER() CRITICAL_REGION_ENTER() - -/** - * @brief Macro for exiting from a critical section. - */ -#define NRFX_CRITICAL_SECTION_EXIT() CRITICAL_REGION_EXIT() - -//------------------------------------------------------------------------------ - -/** - * @brief When set to a non-zero value, this macro specifies that - * @ref nrfx_coredep_delay_us uses a precise DWT-based solution. - * A compilation error is generated if the DWT unit is not present - * in the SoC used. - */ -#define NRFX_DELAY_DWT_BASED 0 - -#include - -#define NRFX_DELAY_US(us_time) nrfx_coredep_delay_us(us_time) - -//------------------------------------------------------------------------------ - -#include - -/** - * @brief Atomic 32 bit unsigned type. - */ -#define nrfx_atomic_t nrfx_atomic_u32_t - -/** - * @brief Stores value to an atomic object and returns previously stored value. - * - * @param[in] p_data Atomic memory pointer. - * @param[in] value Value to store. - * - * @return Old value stored into atomic object. - */ -#define NRFX_ATOMIC_FETCH_STORE(p_data, value) nrfx_atomic_u32_fetch_store(p_data, value) - -/** - * @brief Performs logical OR operation on an atomic object and returns previously stored value. - * - * @param[in] p_data Atomic memory pointer. - * @param[in] value Value of second operand of OR operation. - * - * @return Old value stored into atomic object. - */ -#define NRFX_ATOMIC_FETCH_OR(p_data, value) nrfx_atomic_u32_fetch_or(p_data, value) - -/** - * @brief Performs logical AND operation on an atomic object and returns previously stored value. - * - * @param[in] p_data Atomic memory pointer. - * @param[in] value Value of second operand of AND operation. - * - * @return Old value stored into atomic object. - */ -#define NRFX_ATOMIC_FETCH_AND(p_data, value) nrfx_atomic_u32_fetch_and(p_data, value) - -/** - * @brief Performs logical XOR operation on an atomic object and returns previously stored value. - * - * @param[in] p_data Atomic memory pointer. - * @param[in] value Value of second operand of XOR operation. - * - * @return Old value stored into atomic object. - */ -#define NRFX_ATOMIC_FETCH_XOR(p_data, value) nrfx_atomic_u32_fetch_xor(p_data, value) - -/** - * @brief Performs logical ADD operation on an atomic object and returns previously stored value. - * - * @param[in] p_data Atomic memory pointer. - * @param[in] value Value of second operand of ADD operation. - * - * @return Old value stored into atomic object. - */ -#define NRFX_ATOMIC_FETCH_ADD(p_data, value) nrfx_atomic_u32_fetch_add(p_data, value) - -/** - * @brief Performs logical SUB operation on an atomic object and returns previously stored value. - * - * @param[in] p_data Atomic memory pointer. - * @param[in] value Value of second operand of SUB operation. - * - * @return Old value stored into atomic object. - */ -#define NRFX_ATOMIC_FETCH_SUB(p_data, value) nrfx_atomic_u32_fetch_sub(p_data, value) - -//------------------------------------------------------------------------------ -#ifndef NRFX_CUSTOM_ERROR_CODES - -#include -/** - * @brief When set to a non-zero value, this macro specifies that the - * @ref nrfx_error_codes and the @ref ret_code_t type itself are defined - * in a customized way and the default definitions from @c - * should not be used. - */ -#define NRFX_CUSTOM_ERROR_CODES 1 - -typedef ret_code_t nrfx_err_t; - -#define NRFX_SUCCESS NRF_SUCCESS -#define NRFX_ERROR_INTERNAL NRF_ERROR_INTERNAL -#define NRFX_ERROR_NO_MEM NRF_ERROR_NO_MEM -#define NRFX_ERROR_NOT_SUPPORTED NRF_ERROR_NOT_SUPPORTED -#define NRFX_ERROR_INVALID_PARAM NRF_ERROR_INVALID_PARAM -#define NRFX_ERROR_INVALID_STATE NRF_ERROR_INVALID_STATE -#define NRFX_ERROR_INVALID_LENGTH NRF_ERROR_INVALID_LENGTH -#define NRFX_ERROR_TIMEOUT NRF_ERROR_TIMEOUT -#define NRFX_ERROR_FORBIDDEN NRF_ERROR_FORBIDDEN -#define NRFX_ERROR_NULL NRF_ERROR_NULL -#define NRFX_ERROR_INVALID_ADDR NRF_ERROR_INVALID_ADDR -#define NRFX_ERROR_BUSY NRF_ERROR_BUSY -#define NRFX_ERROR_ALREADY_INITIALIZED NRF_ERROR_MODULE_ALREADY_INITIALIZED - -#define NRFX_ERROR_DRV_TWI_ERR_OVERRUN NRF_ERROR_DRV_TWI_ERR_OVERRUN -#define NRFX_ERROR_DRV_TWI_ERR_ANACK NRF_ERROR_DRV_TWI_ERR_ANACK -#define NRFX_ERROR_DRV_TWI_ERR_DNACK NRF_ERROR_DRV_TWI_ERR_DNACK - -#endif // NRFX_CUSTOM_ERROR_CODES -//------------------------------------------------------------------------------ - -#include -/** - * @brief Bitmask defining PPI channels reserved to be used outside of nrfx. - */ -#define NRFX_PPI_CHANNELS_USED NRF_PPI_CHANNELS_USED - -/** - * @brief Bitmask defining PPI groups reserved to be used outside of nrfx. - */ -#define NRFX_PPI_GROUPS_USED NRF_PPI_GROUPS_USED - -/** - * @brief Bitmask defining SWI instances reserved to be used outside of nrfx. - */ -#define NRFX_SWI_USED NRF_SWI_USED - -/** - * @brief Bitmask defining TIMER instances reserved to be used outside of nrfx. - */ -#define NRFX_TIMERS_USED NRF_TIMERS_USED - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif // NRFX_GLUE_H__ diff --git a/third_party/NordicSemiconductor/dependencies/nrfx_log.h b/third_party/NordicSemiconductor/dependencies/nrfx_log.h deleted file mode 100644 index c4d81a70e..000000000 --- a/third_party/NordicSemiconductor/dependencies/nrfx_log.h +++ /dev/null @@ -1,152 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRFX_LOG_H__ -#define NRFX_LOG_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(NRFX_LOG_MODULE) -#define NRF_LOG_MODULE_NAME NRFX_LOG_MODULE - -#define NRFX_CONFIG_ENTRY(x) CONCAT_3(NRFX_, NRFX_LOG_MODULE, x) - -#if NRFX_CHECK(NRFX_CONFIG_ENTRY(_CONFIG_LOG_ENABLED)) -#define NRF_LOG_LEVEL NRFX_CONFIG_ENTRY(_CONFIG_LOG_LEVEL) -#define NRF_LOG_INFO_COLOR NRFX_CONFIG_ENTRY(_CONFIG_INFO_COLOR) -#define NRF_LOG_DEBUG_COLOR NRFX_CONFIG_ENTRY(_CONFIG_DEBUG_COLOR) -#else -#define NRF_LOG_LEVEL 0 -#endif -#endif // defined(NRFX_LOG_MODULE) - -#include - -#if defined(NRFX_LOG_MODULE) -NRF_LOG_MODULE_REGISTER(); -#endif - -#define TEST_MACRO_INFO(...) NRF_LOG_INFO(__VA_ARGS__) -/** - * @defgroup nrfx_log nrfx_log.h - * @{ - * @ingroup nrfx - * - * @brief This file contains macros that should be implemented according to - * the needs of the host environment into which @em nrfx is integrated. - */ - -/** - * @brief Macro for logging a message with the severity level ERROR. - */ -#define NRFX_LOG_ERROR(...) NRF_LOG_ERROR(__VA_ARGS__) - -/** - * @brief Macro for logging a message with the severity level WARNING. - */ -#define NRFX_LOG_WARNING(...) NRF_LOG_WARNING(__VA_ARGS__) - -/** - * @brief Macro for logging a message with the severity level INFO. - */ -#define NRFX_LOG_INFO(...) TEST_MACRO_INFO(__VA_ARGS__) - -/** - * @brief Macro for logging a message with the severity level DEBUG. - */ -#define NRFX_LOG_DEBUG(...) NRF_LOG_DEBUG(__VA_ARGS__) - - -/** - * @brief Macro for logging a memory dump with the severity level ERROR. - * - * @param[in] p_memory Pointer to the memory region to be dumped. - * @param[in] length Length of the memory region in bytes. - */ -#define NRFX_LOG_HEXDUMP_ERROR(p_memory, length) \ - NRF_LOG_HEXDUMP_ERROR(p_memory, length) - -/** - * @brief Macro for logging a memory dump with the severity level WARNING. - * - * @param[in] p_memory Pointer to the memory region to be dumped. - * @param[in] length Length of the memory region in bytes. - */ -#define NRFX_LOG_HEXDUMP_WARNING(p_memory, length) \ - NRF_LOG_HEXDUMP_WARNING(p_memory, length) - -/** - * @brief Macro for logging a memory dump with the severity level INFO. - * - * @param[in] p_memory Pointer to the memory region to be dumped. - * @param[in] length Length of the memory region in bytes. - */ -#define NRFX_LOG_HEXDUMP_INFO(p_memory, length) \ - NRF_LOG_HEXDUMP_INFO(p_memory, length) - -/** - * @brief Macro for logging a memory dump with the severity level DEBUG. - * - * @param[in] p_memory Pointer to the memory region to be dumped. - * @param[in] length Length of the memory region in bytes. - */ -#define NRFX_LOG_HEXDUMP_DEBUG(p_memory, length) \ - NRF_LOG_HEXDUMP_DEBUG(p_memory, length) - - -/** - * @brief Macro for getting the textual representation of a given error code. - * - * @param[in] error_code Error code. - * - * @return String containing the textual representation of the error code. - */ -#define NRFX_LOG_ERROR_STRING_GET(error_code) \ - NRF_LOG_ERROR_STRING_GET(error_code) - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif // NRFX_LOG_H__ diff --git a/third_party/NordicSemiconductor/dependencies/sdk_common.h b/third_party/NordicSemiconductor/dependencies/sdk_common.h deleted file mode 100644 index 29b200b70..000000000 --- a/third_party/NordicSemiconductor/dependencies/sdk_common.h +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Copyright (c) 2013 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/** @cond */ -/**@file - * - * @ingroup experimental_api - * @defgroup sdk_common SDK Common Header - * @brief All common headers needed for SDK examples will be included here so that application - * developer does not have to include headers on him/herself. - * @{ - */ - -#ifndef SDK_COMMON_H__ -#define SDK_COMMON_H__ - -#include -#include -#include -#include "sdk_config.h" -#include "nordic_common.h" -#include "compiler_abstraction.h" -#include "sdk_os.h" -#include "sdk_errors.h" -#include "app_util.h" -#include "sdk_macros.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/** @} */ -/** @endcond */ - -#ifdef __cplusplus -} -#endif - -#endif // SDK_COMMON_H__ - diff --git a/third_party/NordicSemiconductor/dependencies/sdk_errors.h b/third_party/NordicSemiconductor/dependencies/sdk_errors.h deleted file mode 100644 index 7d3a96b49..000000000 --- a/third_party/NordicSemiconductor/dependencies/sdk_errors.h +++ /dev/null @@ -1,168 +0,0 @@ -/** - * Copyright (c) 2013 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/**@file - * - * @defgroup sdk_error SDK Error codes - * @{ - * @ingroup app_common - * @{ - * @details Error codes are 32-bit unsigned integers with the most significant 16-bit reserved for - * identifying the module where the error occurred while the least least significant LSB - * are used to provide the cause or nature of error. Each module is assigned a 16-bit - * unsigned integer. Which it will use to identify all errors that occurred in it. 16-bit - * LSB range is with module id as the MSB in the 32-bit error code is reserved for the - * module. As an example, if 0x8800 identifies a certain SDK module, all values from - * 0x88000000 - 0x8800FFFF are reserved for this module. - * It should be noted that common error reasons have been assigned values to make it - * possible to decode error reason easily. As an example, lets module uninitialized has - * been assigned an error code 0x000A0. Then, if application encounters an error code - * 0xZZZZ00A0, it knows that it accessing a certain module without initializing it. - * Apart from this, each module is allowed to define error codes that are not covered by - * the common ones, however, these values are defined in a range that does not conflict - * with common error values. For module, specific error however, it is possible that the - * same error value is used by two different modules to indicated errors of very different - * nature. If error is already defined by the NRF common error codes, these are reused. - * A range is reserved for application as well, it can use this range for defining - * application specific errors. - * - * @note Success code, NRF_SUCCESS, does not include any module identifier. - - */ - -#ifndef SDK_ERRORS_H__ -#define SDK_ERRORS_H__ - -#include -#include "nrf_error.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup sdk_err_base Base defined for SDK Modules - * @{ - */ -#define NRF_ERROR_SDK_ERROR_BASE (NRF_ERROR_BASE_NUM + 0x8000) /**< Base value defined for SDK module identifiers. */ -#define NRF_ERROR_SDK_COMMON_ERROR_BASE (NRF_ERROR_BASE_NUM + 0x0080) /**< Base error value to be used for SDK error values. */ -/** @} */ - -/** - * @defgroup sdk_module_codes Codes reserved as identification for module where the error occurred. - * @{ - */ -#define NRF_ERROR_MEMORY_MANAGER_ERR_BASE (0x8100) /**< Base address for Memory Manager related errors. */ -#define NRF_ERROR_PERIPH_DRIVERS_ERR_BASE (0x8200) /**< Base address for Peripheral drivers related errors. */ -#define NRF_ERROR_GAZELLE_ERR_BASE (0x8300) /**< Base address for Gazelle related errors. */ -#define NRF_ERROR_BLE_IPSP_ERR_BASE (0x8400) /**< Base address for BLE IPSP related errors. */ -#define NRF_ERROR_CRYPTO_ERR_BASE (0x8500) /**< Base address for crypto related errors. */ -#define NRF_ERROR_FDS_ERR_BASE (0x8600) /**< Base address for FDS related errors. */ -/** @} */ - - -/** - * @defgroup sdk_iot_errors Codes reserved as identification for IoT errors. - * @{ - */ -#define NRF_ERROR_IOT_ERR_BASE_START (0xA000) -#define NRF_ERROR_IOT_ERR_BASE_STOP (0xAFFF) -/** @} */ - - -/** - * @defgroup sdk_common_errors Codes reserved as identification for common errors. - * @{ - */ -#define NRF_ERROR_MODULE_NOT_INITIALIZED (NRF_ERROR_SDK_COMMON_ERROR_BASE + 0x0000) ///< Module not initialized -#define NRF_ERROR_MUTEX_INIT_FAILED (NRF_ERROR_SDK_COMMON_ERROR_BASE + 0x0001) ///< Mutex initialization failed -#define NRF_ERROR_MUTEX_LOCK_FAILED (NRF_ERROR_SDK_COMMON_ERROR_BASE + 0x0002) ///< Mutex lock failed -#define NRF_ERROR_MUTEX_UNLOCK_FAILED (NRF_ERROR_SDK_COMMON_ERROR_BASE + 0x0003) ///< Mutex unlock failed -#define NRF_ERROR_MUTEX_COND_INIT_FAILED (NRF_ERROR_SDK_COMMON_ERROR_BASE + 0x0004) ///< Mutex conditional initialization failed -#define NRF_ERROR_MODULE_ALREADY_INITIALIZED (NRF_ERROR_SDK_COMMON_ERROR_BASE + 0x0005) ///< Module already initialized -#define NRF_ERROR_STORAGE_FULL (NRF_ERROR_SDK_COMMON_ERROR_BASE + 0x0006) ///< Storage full -#define NRF_ERROR_API_NOT_IMPLEMENTED (NRF_ERROR_SDK_COMMON_ERROR_BASE + 0x0010) ///< API not implemented -#define NRF_ERROR_FEATURE_NOT_ENABLED (NRF_ERROR_SDK_COMMON_ERROR_BASE + 0x0011) ///< Feature not enabled -#define NRF_ERROR_IO_PENDING (NRF_ERROR_SDK_COMMON_ERROR_BASE + 0x0012) ///< Input/Output pending -/** @} */ - - -/** - * @defgroup drv_specific_errors Error / status codes specific to drivers. - * @{ - */ -#define NRF_ERROR_DRV_TWI_ERR_OVERRUN (NRF_ERROR_PERIPH_DRIVERS_ERR_BASE + 0x0000) -#define NRF_ERROR_DRV_TWI_ERR_ANACK (NRF_ERROR_PERIPH_DRIVERS_ERR_BASE + 0x0001) -#define NRF_ERROR_DRV_TWI_ERR_DNACK (NRF_ERROR_PERIPH_DRIVERS_ERR_BASE + 0x0002) -/** @} */ - - -/** - * @defgroup ble_ipsp_errors IPSP codes - * @brief Error and status codes specific to IPSP. - * @{ - */ -#define NRF_ERROR_BLE_IPSP_RX_PKT_TRUNCATED (NRF_ERROR_BLE_IPSP_ERR_BASE + 0x0000) -#define NRF_ERROR_BLE_IPSP_CHANNEL_ALREADY_EXISTS (NRF_ERROR_BLE_IPSP_ERR_BASE + 0x0001) -#define NRF_ERROR_BLE_IPSP_LINK_DISCONNECTED (NRF_ERROR_BLE_IPSP_ERR_BASE + 0x0002) -#define NRF_ERROR_BLE_IPSP_PEER_REJECTED (NRF_ERROR_BLE_IPSP_ERR_BASE + 0x0003) -/* @} */ - - -/** - * @brief API Result. - * - * @details Indicates success or failure of an API procedure. In case of failure, a comprehensive - * error code indicating cause or reason for failure is provided. - * - * Though called an API result, it could used in Asynchronous notifications callback along - * with asynchronous callback as event result. This mechanism is employed when an event - * marks the end of procedure initiated using API. API result, in this case, will only be - * an indicative of whether the procedure has been requested successfully. - */ -typedef uint32_t ret_code_t; - -/** @} */ -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif // SDK_ERRORS_H__ diff --git a/third_party/NordicSemiconductor/dependencies/sdk_macros.h b/third_party/NordicSemiconductor/dependencies/sdk_macros.h deleted file mode 100644 index 4a0b2e9d9..000000000 --- a/third_party/NordicSemiconductor/dependencies/sdk_macros.h +++ /dev/null @@ -1,224 +0,0 @@ -/** - * Copyright (c) 2013 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/**@file - * - - * @defgroup sdk_common_macros SDK Common Header - * @ingroup app_common - * @brief Macros for parameter checking and similar tasks - * @{ - */ - -#ifndef SDK_MACROS_H__ -#define SDK_MACROS_H__ - -#include "nrf_assert.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/**@brief Macro for parameter checking. - * - * If @p _cond evaluates to true, does nothing. Otherwise, - * if @p _module ## _PARAM_CHECK_DISABLED is @e not set (default), prints an error message - * if @p _printfn is provided, and returns from the calling function context with code @p _err. - * If @p _module ## _PARAM_CHECK_DISABLED is set, behaves like the ASSERT macro. - * - * Parameter checking implemented using this macro can be optionally turned off for release code. - * Only disable runtime parameter checks if size if a major concern. - * - * @param _module The module name. - * @param _cond The condition to be evaluated. - * @param _err The error to be returned. - * @param _printfn A printf-compatible function used to log the error. - * Leave empty if no logging is needed. - * - * @hideinitializer - */ -/*lint -esym(666, NRF_PARAM_CHECK*) : Expression with side effects passed to macro */ -#define NRF_PARAM_CHECK(_module, _cond, _err, _printfn) \ - do \ - { \ - if ((_cond)) \ - { \ - /* Do nothing. */ \ - } \ - else if (!(_module ## _PARAM_CHECK_DISABLED)) \ - { \ - _printfn("%s check failed in %s() with value 0x%x.", #_cond, __func__, _err); \ - return (_err); \ - } \ - else \ - { \ - ASSERT((_cond)); \ - } \ - } while (0); - - -/**@brief Macro for verifying statement to be true. It will cause the exterior function to return - * err_code if the statement is not true. - * - * @param[in] statement Statement to test. - * @param[in] err_code Error value to return if test was invalid. - * - * @retval nothing, but will cause the exterior function to return @p err_code if @p statement - * is false. - */ -#define VERIFY_TRUE(statement, err_code) \ -do \ -{ \ - if (!(statement)) \ - { \ - return err_code; \ - } \ -} while (0) - - -/**@brief Macro for verifying statement to be true. It will cause the exterior function to return - * if the statement is not true. - * - * @param[in] statement Statement to test. - */ -#define VERIFY_TRUE_VOID(statement) VERIFY_TRUE((statement), ) - - -/**@brief Macro for verifying statement to be false. It will cause the exterior function to return - * err_code if the statement is not false. - * - * @param[in] statement Statement to test. - * @param[in] err_code Error value to return if test was invalid. - * - * @retval nothing, but will cause the exterior function to return @p err_code if @p statement - * is true. - */ -#define VERIFY_FALSE(statement, err_code) \ -do \ -{ \ - if ((statement)) \ - { \ - return err_code; \ - } \ -} while (0) - - -/**@brief Macro for verifying statement to be false. It will cause the exterior function to return - * if the statement is not false. - * - * @param[in] statement Statement to test. - */ -#define VERIFY_FALSE_VOID(statement) VERIFY_FALSE((statement), ) - - -/**@brief Macro for verifying that a function returned NRF_SUCCESS. It will cause the exterior - * function to return error code of statement if it is not @ref NRF_SUCCESS. - * - * @param[in] statement Statement to check against NRF_SUCCESS. - */ -#define VERIFY_SUCCESS(statement) \ -do \ -{ \ - uint32_t _err_code = (uint32_t) (statement); \ - if (_err_code != NRF_SUCCESS) \ - { \ - return _err_code; \ - } \ -} while(0) - - -/**@brief Macro for verifying that a function returned NRF_SUCCESS. It will cause the exterior - * function to return if the err_code is not @ref NRF_SUCCESS. - * - * @param[in] err_code The error code to check. - */ -#define VERIFY_SUCCESS_VOID(err_code) VERIFY_TRUE_VOID((err_code) == NRF_SUCCESS) - - -/**@brief Macro for verifying that the module is initialized. It will cause the exterior function to - * return @ref NRF_ERROR_INVALID_STATE if not. - * - * @note MODULE_INITIALIZED must be defined in each module using this macro. MODULE_INITIALIZED - * should be true if the module is initialized, false if not. - */ -#define VERIFY_MODULE_INITIALIZED() VERIFY_TRUE((MODULE_INITIALIZED), NRF_ERROR_INVALID_STATE) - - -/**@brief Macro for verifying that the module is initialized. It will cause the exterior function to - * return if not. - * - * @note MODULE_INITIALIZED must be defined in each module using this macro. MODULE_INITIALIZED - * should be true if the module is initialized, false if not. - */ -#define VERIFY_MODULE_INITIALIZED_VOID() VERIFY_TRUE_VOID((MODULE_INITIALIZED)) - - -/**@brief Macro for verifying that the module is initialized. It will cause the exterior function to - * return false if not. - * - * @note MODULE_INITIALIZED must be defined in each module using this macro. MODULE_INITIALIZED - * should be true if the module is initialized, false if not. - */ -#define VERIFY_MODULE_INITIALIZED_BOOL() VERIFY_TRUE((MODULE_INITIALIZED), false) - - -/**@brief Macro for verifying that the module is initialized. It will cause the exterior function to - * return if not. - * - * @param[in] param The variable to check if is NULL. - */ -#define VERIFY_PARAM_NOT_NULL(param) VERIFY_FALSE(((param) == NULL), NRF_ERROR_NULL) - - -/**@brief Macro for verifying that the module is initialized. It will cause the exterior function to - * return if not. - * - * @param[in] param The variable to check if is NULL. - */ -#define VERIFY_PARAM_NOT_NULL_VOID(param) VERIFY_FALSE_VOID(((param) == NULL)) - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif // SDK_MACROS_H__ - diff --git a/third_party/NordicSemiconductor/dependencies/sdk_os.h b/third_party/NordicSemiconductor/dependencies/sdk_os.h deleted file mode 100644 index b75954c08..000000000 --- a/third_party/NordicSemiconductor/dependencies/sdk_os.h +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2013 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/** @cond */ -/**@file - * - * @defgroup sdk_os SDK OS Abstraction - * @ingroup experimental_api - * @details In order to made SDK modules independent of use of an embedded OS, and permit - * application with varied task architecture, SDK abstracts the OS specific - * elements here in order to make all other modules agnostic to the OS or task - * architecture. - * @{ - */ - -#ifndef SDK_OS_H__ -#define SDK_OS_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#define SDK_MUTEX_DEFINE(X) -#define SDK_MUTEX_INIT(X) -#define SDK_MUTEX_LOCK(X) -#define SDK_MUTEX_UNLOCK(X) - -/** - * @defgroup os_data_type Data types. - */ - -/** @} */ -/** @endcond */ - -#ifdef __cplusplus -} -#endif - -#endif // SDK_OS_H__ - diff --git a/third_party/NordicSemiconductor/dependencies/sdk_resources.h b/third_party/NordicSemiconductor/dependencies/sdk_resources.h deleted file mode 100644 index c066b1741..000000000 --- a/third_party/NordicSemiconductor/dependencies/sdk_resources.h +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Copyright (c) 2015 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/** @file - * @brief Definition file for resource usage by SoftDevice, ESB and Gazell. - */ - -#ifndef SDK_RESOURCES_H__ -#define SDK_RESOURCES_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(SOFTDEVICE_PRESENT) || defined (BLE_STACK_SUPPORT_REQD) || defined (ANT_STACK_SUPPORT_REQD) - #include "nrf_sd_def.h" -#else - #define SD_PPI_RESTRICTED 0uL /**< 1 if PPI peripheral is restricted, 0 otherwise. */ - #define SD_PPI_CHANNELS_USED 0uL /**< PPI channels utilized by SotfDevice (not available to th spplication). */ - #define SD_PPI_GROUPS_USED 0uL /**< PPI groups utilized by SotfDevice (not available to th spplication). */ - #define SD_TIMERS_USED 0uL /**< Timers used by SoftDevice. */ - #define SD_SWI_USED 0uL /**< Software interrupts used by SoftDevice. */ -#endif - -#ifdef GAZELL_PRESENT - #include "nrf_gzll_resources.h" -#else - #define GZLL_PPI_CHANNELS_USED 0uL /**< PPI channels utilized by Gazell (not available to th spplication). */ - #define GZLL_TIMERS_USED 0uL /**< Timers used by Gazell. */ - #define GZLL_SWI_USED 0uL /**< Software interrupts used by Gazell */ -#endif - -#ifdef ESB_PRESENT - #include "nrf_esb_resources.h" -#else - #define ESB_PPI_CHANNELS_USED 0uL /**< PPI channels utilized by ESB (not available to th spplication). */ - #define ESB_TIMERS_USED 0uL /**< Timers used by ESB. */ - #define ESB_SWI_USED 0uL /**< Software interrupts used by ESB */ -#endif - -#define NRF_PPI_CHANNELS_USED (SD_PPI_CHANNELS_USED | GZLL_PPI_CHANNELS_USED | ESB_PPI_CHANNELS_USED) -#define NRF_PPI_GROUPS_USED (SD_PPI_GROUPS_USED) -#define NRF_SWI_USED (SD_SWI_USED | GZLL_SWI_USED | ESB_SWI_USED) -#define NRF_TIMERS_USED (SD_TIMERS_USED | GZLL_TIMERS_USED | ESB_TIMERS_USED) - -#ifdef __cplusplus -} -#endif - -#endif // SDK_RESOURCES_H__ diff --git a/third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.c b/third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.c deleted file mode 100644 index cc3a07cfe..000000000 --- a/third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.c +++ /dev/null @@ -1,605 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include "nrf_drv_clock.h" - -#if NRF_MODULE_ENABLED(NRF_CLOCK) - -#ifdef SOFTDEVICE_PRESENT -#include "nrf_sdh.h" -#include "nrf_sdh_soc.h" -#endif - -#define NRF_LOG_MODULE_NAME clock -#if CLOCK_CONFIG_LOG_ENABLED - #define NRF_LOG_LEVEL CLOCK_CONFIG_LOG_LEVEL - #define NRF_LOG_INFO_COLOR CLOCK_CONFIG_INFO_COLOR - #define NRF_LOG_DEBUG_COLOR CLOCK_CONFIG_DEBUG_COLOR -#else //CLOCK_CONFIG_LOG_ENABLED - #define NRF_LOG_LEVEL 0 -#endif //CLOCK_CONFIG_LOG_ENABLED -#include "nrf_log.h" -NRF_LOG_MODULE_REGISTER(); - -#define EVT_TO_STR(event) \ - (event == NRF_CLOCK_EVENT_HFCLKSTARTED ? "NRF_CLOCK_EVENT_HFCLKSTARTED" : \ - (event == NRF_CLOCK_EVENT_LFCLKSTARTED ? "NRF_CLOCK_EVENT_LFCLKSTARTED" : \ - (event == NRF_CLOCK_EVENT_DONE ? "NRF_CLOCK_EVENT_DONE" : \ - (event == NRF_CLOCK_EVENT_CTTO ? "NRF_CLOCK_EVENT_CTTO" : \ - "UNKNOWN EVENT")))) - - -/*lint -save -e652 */ -#define NRF_CLOCK_LFCLK_RC CLOCK_LFCLKSRC_SRC_RC -#define NRF_CLOCK_LFCLK_Xtal CLOCK_LFCLKSRC_SRC_Xtal -#define NRF_CLOCK_LFCLK_Synth CLOCK_LFCLKSRC_SRC_Synth -/*lint -restore */ - -#if (CLOCK_CONFIG_LF_SRC == NRF_CLOCK_LFCLK_RC) && !defined(SOFTDEVICE_PRESENT) -#define CALIBRATION_SUPPORT 1 -#else -#define CALIBRATION_SUPPORT 0 -#endif -typedef enum -{ - CAL_STATE_IDLE, - CAL_STATE_CT, - CAL_STATE_HFCLK_REQ, - CAL_STATE_CAL, - CAL_STATE_ABORT, -} nrf_drv_clock_cal_state_t; - -/**@brief CLOCK control block. */ -typedef struct -{ - bool module_initialized; /*< Indicate the state of module */ - volatile bool hfclk_on; /*< High-frequency clock state. */ - volatile bool lfclk_on; /*< Low-frequency clock state. */ - volatile uint32_t hfclk_requests; /*< High-frequency clock request counter. */ - volatile nrf_drv_clock_handler_item_t * p_hf_head; - volatile uint32_t lfclk_requests; /*< Low-frequency clock request counter. */ - volatile nrf_drv_clock_handler_item_t * p_lf_head; -#if CALIBRATION_SUPPORT - nrf_drv_clock_handler_item_t cal_hfclk_started_handler_item; - nrf_drv_clock_event_handler_t cal_done_handler; - volatile nrf_drv_clock_cal_state_t cal_state; -#endif // CALIBRATION_SUPPORT -} nrf_drv_clock_cb_t; - -static nrf_drv_clock_cb_t m_clock_cb; - -static void clock_irq_handler(nrfx_clock_evt_type_t evt); - -static void lfclk_stop(void) -{ -#if CALIBRATION_SUPPORT - nrfx_clock_calibration_timer_stop(); -#endif - -#ifdef SOFTDEVICE_PRESENT - // If LFCLK is requested to stop while SD is still enabled, - // it indicates an error in the application. - // Enabling SD should increment the LFCLK request. - ASSERT(!nrf_sdh_is_enabled()); -#endif // SOFTDEVICE_PRESENT - - nrfx_clock_lfclk_stop(); - m_clock_cb.lfclk_on = false; -} - -static void hfclk_start(void) -{ -#ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) - { - (void)sd_clock_hfclk_request(); - return; - } -#endif // SOFTDEVICE_PRESENT - - nrfx_clock_hfclk_start(); -} - -static void hfclk_stop(void) -{ -#ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) - { - (void)sd_clock_hfclk_release(); - m_clock_cb.hfclk_on = false; - return; - } -#endif // SOFTDEVICE_PRESENT - - nrfx_clock_hfclk_stop(); - m_clock_cb.hfclk_on = false; -} - -bool nrf_drv_clock_init_check(void) -{ - return m_clock_cb.module_initialized; -} - -ret_code_t nrf_drv_clock_init(void) -{ - ret_code_t err_code = NRF_SUCCESS; - if (m_clock_cb.module_initialized) - { - err_code = NRF_ERROR_MODULE_ALREADY_INITIALIZED; - } - else - { - m_clock_cb.p_hf_head = NULL; - m_clock_cb.hfclk_requests = 0; - m_clock_cb.p_lf_head = NULL; - m_clock_cb.lfclk_requests = 0; - err_code = nrfx_clock_init(clock_irq_handler); -#ifdef SOFTDEVICE_PRESENT - if (!nrf_sdh_is_enabled()) -#endif - { - nrfx_clock_enable(); - } - -#if CALIBRATION_SUPPORT - m_clock_cb.cal_state = CAL_STATE_IDLE; -#endif - - m_clock_cb.module_initialized = true; - } - - NRF_LOG_INFO("Function: %s, error code: %s.", - (uint32_t)__func__, - (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code)); - return err_code; -} - -void nrf_drv_clock_uninit(void) -{ - ASSERT(m_clock_cb.module_initialized); - nrfx_clock_disable(); - nrfx_clock_uninit(); - - m_clock_cb.module_initialized = false; -} - -static void item_enqueue(nrf_drv_clock_handler_item_t ** p_head, - nrf_drv_clock_handler_item_t * p_item) -{ - nrf_drv_clock_handler_item_t * p_next = *p_head; - while (p_next) - { - if (p_next == p_item) - { - return; - } - p_next = p_next->p_next; - } - - p_item->p_next = (*p_head ? *p_head : NULL); - *p_head = p_item; -} - -static nrf_drv_clock_handler_item_t * item_dequeue(nrf_drv_clock_handler_item_t ** p_head) -{ - nrf_drv_clock_handler_item_t * p_item = *p_head; - if (p_item) - { - *p_head = p_item->p_next; - } - return p_item; -} - -void nrf_drv_clock_lfclk_request(nrf_drv_clock_handler_item_t * p_handler_item) -{ - ASSERT(m_clock_cb.module_initialized); - - if (m_clock_cb.lfclk_on) - { - if (p_handler_item) - { - p_handler_item->event_handler(NRF_DRV_CLOCK_EVT_LFCLK_STARTED); - } - CRITICAL_REGION_ENTER(); - ++(m_clock_cb.lfclk_requests); - CRITICAL_REGION_EXIT(); - } - else - { - CRITICAL_REGION_ENTER(); - if (p_handler_item) - { - item_enqueue((nrf_drv_clock_handler_item_t **)&m_clock_cb.p_lf_head, - p_handler_item); - } - if (m_clock_cb.lfclk_requests == 0) - { - nrfx_clock_lfclk_start(); - } - ++(m_clock_cb.lfclk_requests); - CRITICAL_REGION_EXIT(); - } - - ASSERT(m_clock_cb.lfclk_requests > 0); -} - -void nrf_drv_clock_lfclk_release(void) -{ - ASSERT(m_clock_cb.module_initialized); - ASSERT(m_clock_cb.lfclk_requests > 0); - - CRITICAL_REGION_ENTER(); - --(m_clock_cb.lfclk_requests); - if (m_clock_cb.lfclk_requests == 0) - { - lfclk_stop(); - } - CRITICAL_REGION_EXIT(); -} - -bool nrf_drv_clock_lfclk_is_running(void) -{ - ASSERT(m_clock_cb.module_initialized); - -#ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) - { - return true; - } -#endif // SOFTDEVICE_PRESENT - - return nrfx_clock_lfclk_is_running(); -} - -void nrf_drv_clock_hfclk_request(nrf_drv_clock_handler_item_t * p_handler_item) -{ - ASSERT(m_clock_cb.module_initialized); - - if (m_clock_cb.hfclk_on) - { - if (p_handler_item) - { - p_handler_item->event_handler(NRF_DRV_CLOCK_EVT_HFCLK_STARTED); - } - CRITICAL_REGION_ENTER(); - ++(m_clock_cb.hfclk_requests); - CRITICAL_REGION_EXIT(); - } - else - { - CRITICAL_REGION_ENTER(); - if (p_handler_item) - { - item_enqueue((nrf_drv_clock_handler_item_t **)&m_clock_cb.p_hf_head, - p_handler_item); - } - if (m_clock_cb.hfclk_requests == 0) - { - hfclk_start(); - } - ++(m_clock_cb.hfclk_requests); - CRITICAL_REGION_EXIT(); - } - - ASSERT(m_clock_cb.hfclk_requests > 0); -} - -void nrf_drv_clock_hfclk_release(void) -{ - ASSERT(m_clock_cb.module_initialized); - ASSERT(m_clock_cb.hfclk_requests > 0); - - CRITICAL_REGION_ENTER(); - --(m_clock_cb.hfclk_requests); - if (m_clock_cb.hfclk_requests == 0) - { - hfclk_stop(); - } - CRITICAL_REGION_EXIT(); -} - -bool nrf_drv_clock_hfclk_is_running(void) -{ - ASSERT(m_clock_cb.module_initialized); - -#ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) - { - uint32_t is_running; - UNUSED_VARIABLE(sd_clock_hfclk_is_running(&is_running)); - return (is_running ? true : false); - } -#endif // SOFTDEVICE_PRESENT - - return nrfx_clock_hfclk_is_running(); -} - -#if CALIBRATION_SUPPORT -static void clock_calibration_hf_started(nrf_drv_clock_evt_type_t event) -{ - if (m_clock_cb.cal_state == CAL_STATE_ABORT) - { - nrf_drv_clock_hfclk_release(); - m_clock_cb.cal_state = CAL_STATE_IDLE; - if (m_clock_cb.cal_done_handler) - { - m_clock_cb.cal_done_handler(NRF_DRV_CLOCK_EVT_CAL_ABORTED); - } - } - else - { - ASSERT(event == NRF_DRV_CLOCK_EVT_HFCLK_STARTED); - if (nrfx_clock_calibration_start() != NRFX_SUCCESS) - { - ASSERT(false); - } - } -} -#endif // CALIBRATION_SUPPORT - -ret_code_t nrf_drv_clock_calibration_start(uint8_t interval, nrf_drv_clock_event_handler_t handler) -{ - ret_code_t err_code = NRF_SUCCESS; -#if CALIBRATION_SUPPORT - ASSERT(m_clock_cb.cal_state == CAL_STATE_IDLE); - if (m_clock_cb.lfclk_on == false) - { - err_code = NRF_ERROR_INVALID_STATE; - } - else if (m_clock_cb.cal_state == CAL_STATE_IDLE) - { - m_clock_cb.cal_done_handler = handler; - m_clock_cb.cal_hfclk_started_handler_item.event_handler = clock_calibration_hf_started; - if (interval == 0) - { - m_clock_cb.cal_state = CAL_STATE_HFCLK_REQ; - nrf_drv_clock_hfclk_request(&m_clock_cb.cal_hfclk_started_handler_item); - } - else - { - m_clock_cb.cal_state = CAL_STATE_CT; - nrfx_clock_calibration_timer_start(interval); - } - } - else - { - err_code = NRF_ERROR_BUSY; - } - NRF_LOG_WARNING("Function: %s, error code: %s.", - (uint32_t)__func__, - (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code)); - return err_code; -#else - UNUSED_PARAMETER(interval); - UNUSED_PARAMETER(handler); - err_code = NRF_ERROR_FORBIDDEN; - NRF_LOG_WARNING("Function: %s, error code: %s.", - (uint32_t)__func__, - (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code)); - return err_code; -#endif // CALIBRATION_SUPPORT -} - -ret_code_t nrf_drv_clock_calibration_abort(void) -{ - ret_code_t err_code = NRF_SUCCESS; -#if CALIBRATION_SUPPORT - CRITICAL_REGION_ENTER(); - switch (m_clock_cb.cal_state) - { - case CAL_STATE_CT: - nrfx_clock_calibration_timer_stop(); - m_clock_cb.cal_state = CAL_STATE_IDLE; - if (m_clock_cb.cal_done_handler) - { - m_clock_cb.cal_done_handler(NRF_DRV_CLOCK_EVT_CAL_ABORTED); - } - break; - case CAL_STATE_HFCLK_REQ: - /* fall through. */ - case CAL_STATE_CAL: - m_clock_cb.cal_state = CAL_STATE_ABORT; - break; - default: - break; - } - CRITICAL_REGION_EXIT(); - - NRF_LOG_INFO("Function: %s, error code: %s.", - (uint32_t)__func__, - (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code)); - return err_code; -#else - err_code = NRF_ERROR_FORBIDDEN; - NRF_LOG_WARNING("Function: %s, error code: %s.", - (uint32_t)__func__, - (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code)); - return err_code; -#endif // CALIBRATION_SUPPORT -} - -ret_code_t nrf_drv_clock_is_calibrating(bool * p_is_calibrating) -{ - ret_code_t err_code = NRF_SUCCESS; -#if CALIBRATION_SUPPORT - ASSERT(m_clock_cb.module_initialized); - *p_is_calibrating = (m_clock_cb.cal_state != CAL_STATE_IDLE); - NRF_LOG_INFO("Function: %s, error code: %s.", - (uint32_t)__func__, - (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code)); - return err_code; -#else - UNUSED_PARAMETER(p_is_calibrating); - err_code = NRF_ERROR_FORBIDDEN; - NRF_LOG_WARNING("Function: %s, error code: %s.", - (uint32_t)__func__, - (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code)); - return err_code; -#endif // CALIBRATION_SUPPORT -} - -__STATIC_INLINE void clock_clk_started_notify(nrf_drv_clock_evt_type_t evt_type) -{ - nrf_drv_clock_handler_item_t **p_head; - if (evt_type == NRF_DRV_CLOCK_EVT_HFCLK_STARTED) - { - p_head = (nrf_drv_clock_handler_item_t **)&m_clock_cb.p_hf_head; - } - else - { - p_head = (nrf_drv_clock_handler_item_t **)&m_clock_cb.p_lf_head; - } - - while (1) - { - nrf_drv_clock_handler_item_t * p_item = item_dequeue(p_head); - if (!p_item) - { - break; - } - - p_item->event_handler(evt_type); - } -} - -static void clock_irq_handler(nrfx_clock_evt_type_t evt) -{ - if (evt == NRFX_CLOCK_EVT_HFCLK_STARTED) - { - m_clock_cb.hfclk_on = true; - clock_clk_started_notify(NRF_DRV_CLOCK_EVT_HFCLK_STARTED); - } - if (evt == NRFX_CLOCK_EVT_LFCLK_STARTED) - { - m_clock_cb.lfclk_on = true; - clock_clk_started_notify(NRF_DRV_CLOCK_EVT_LFCLK_STARTED); - } -#if CALIBRATION_SUPPORT - if (evt == NRFX_CLOCK_EVT_CTTO) - { - nrf_drv_clock_hfclk_request(&m_clock_cb.cal_hfclk_started_handler_item); - } - - if (evt == NRFX_CLOCK_EVT_CAL_DONE) - { - nrf_drv_clock_hfclk_release(); - bool aborted = (m_clock_cb.cal_state == CAL_STATE_ABORT); - m_clock_cb.cal_state = CAL_STATE_IDLE; - if (m_clock_cb.cal_done_handler) - { - m_clock_cb.cal_done_handler(aborted ? - NRF_DRV_CLOCK_EVT_CAL_ABORTED : NRF_DRV_CLOCK_EVT_CAL_DONE); - } - } -#endif // CALIBRATION_SUPPORT -} - -#ifdef SOFTDEVICE_PRESENT -/** - * @brief SoftDevice SoC event handler. - * - * @param[in] evt_id SoC event. - * @param[in] p_context Context. - */ -static void soc_evt_handler(uint32_t evt_id, void * p_context) -{ - if (evt_id == NRF_EVT_HFCLKSTARTED) - { - m_clock_cb.hfclk_on = true; - clock_clk_started_notify(NRF_DRV_CLOCK_EVT_HFCLK_STARTED); - } -} -NRF_SDH_SOC_OBSERVER(m_soc_evt_observer, CLOCK_CONFIG_SOC_OBSERVER_PRIO, soc_evt_handler, NULL); - -/** - * @brief SoftDevice enable/disable state handler. - * - * @param[in] state State. - * @param[in] p_context Context. - */ -static void sd_state_evt_handler(nrf_sdh_state_evt_t state, void * p_context) -{ - switch (state) - { - case NRF_SDH_EVT_STATE_ENABLE_PREPARE: - NVIC_DisableIRQ(POWER_CLOCK_IRQn); - break; - - case NRF_SDH_EVT_STATE_ENABLED: - CRITICAL_REGION_ENTER(); - /* Make sure that nrf_drv_clock module is initialized */ - if (!m_clock_cb.module_initialized) - { - (void)nrf_drv_clock_init(); - } - /* SD is one of the LFCLK requesters, but it will enable it by itself. */ - ++(m_clock_cb.lfclk_requests); - m_clock_cb.lfclk_on = true; - CRITICAL_REGION_EXIT(); - break; - - case NRF_SDH_EVT_STATE_DISABLED: - /* Reinit interrupts */ - ASSERT(m_clock_cb.module_initialized); - nrfx_clock_enable(); - - /* SD leaves LFCLK enabled - disable it if it is no longer required. */ - nrf_drv_clock_lfclk_release(); - break; - - default: - break; - } -} - -NRF_SDH_STATE_OBSERVER(m_sd_state_observer, CLOCK_CONFIG_STATE_OBSERVER_PRIO) = -{ - .handler = sd_state_evt_handler, - .p_context = NULL, -}; - -#endif // SOFTDEVICE_PRESENT - -#undef NRF_CLOCK_LFCLK_RC -#undef NRF_CLOCK_LFCLK_Xtal -#undef NRF_CLOCK_LFCLK_Synth - -#endif // NRF_MODULE_ENABLED(NRF_CLOCK) diff --git a/third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.h b/third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.h deleted file mode 100644 index 53c0ec84d..000000000 --- a/third_party/NordicSemiconductor/drivers/clock/nrf_drv_clock.h +++ /dev/null @@ -1,297 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_DRV_CLOCK_H__ -#define NRF_DRV_CLOCK_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_drv_clock Clock driver - legacy layer - * @{ - * @ingroup nrf_clock - * - * @brief Layer providing compatibility with the former API. - */ - -/** - * @brief Clock events. - */ -typedef enum -{ - NRF_DRV_CLOCK_EVT_HFCLK_STARTED, ///< HFCLK has been started. - NRF_DRV_CLOCK_EVT_LFCLK_STARTED, ///< LFCLK has been started. - NRF_DRV_CLOCK_EVT_CAL_DONE, ///< Calibration is done. - NRF_DRV_CLOCK_EVT_CAL_ABORTED, ///< Calibration has been aborted. -} nrf_drv_clock_evt_type_t; - -/** - * @brief Clock event handler. - * - * @param[in] event Event. - */ -typedef void (*nrf_drv_clock_event_handler_t)(nrf_drv_clock_evt_type_t event); - -// Forward declaration of the nrf_drv_clock_handler_item_t type. -typedef struct nrf_drv_clock_handler_item_s nrf_drv_clock_handler_item_t; - -struct nrf_drv_clock_handler_item_s -{ - nrf_drv_clock_handler_item_t * p_next; ///< A pointer to the next handler that should be called when the clock is started. - nrf_drv_clock_event_handler_t event_handler; ///< Function to be called when the clock is started. -}; - -/** - * @brief Function for checking if driver is already initialized - * - * @retval true Driver is initialized - * @retval false Driver is uninitialized - */ -bool nrf_drv_clock_init_check(void); - -/** - * @brief Function for initializing the nrf_drv_clock module. - * - * After initialization, the module is in power off state (clocks are not requested). - * - * @retval NRF_SUCCESS If the procedure was successful. - * @retval NRF_ERROR_MODULE_ALREADY_INITIALIZED If the driver was already initialized. - */ -ret_code_t nrf_drv_clock_init(void); - -/** - * @brief Function for uninitializing the clock module. - * - */ -void nrf_drv_clock_uninit(void); - -/** - * @brief Function for requesting the LFCLK. - * - * The low-frequency clock can be requested by different modules - * or contexts. The driver ensures that the clock will be started only when it is requested - * the first time. If the clock is not ready but it was already started, the handler item that is - * provided as an input parameter is added to the list of handlers that will be notified - * when the clock is started. If the clock is already enabled, user callback is called from the - * current context. - * - * The first request will start the selected LFCLK source. If an event handler is - * provided, it will be called once the LFCLK is started. If the LFCLK was already started at this - * time, the event handler will be called from the context of this function. Additionally, - * the @ref nrf_drv_clock_lfclk_is_running function can be polled to check if the clock has started. - * - * @note When a SoftDevice is enabled, the LFCLK is always running and the driver cannot control it. - * - * @note The handler item provided by the user cannot be an automatic variable. - * - * @param[in] p_handler_item A pointer to the event handler structure. - */ -void nrf_drv_clock_lfclk_request(nrf_drv_clock_handler_item_t * p_handler_item); - -/** - * @brief Function for releasing the LFCLK. - * - * If there are no more requests, the LFCLK source will be stopped. - * - * @note When a SoftDevice is enabled, the LFCLK is always running. - */ -void nrf_drv_clock_lfclk_release(void); - -/** - * @brief Function for checking the LFCLK state. - * - * @retval true If the LFCLK is running. - * @retval false If the LFCLK is not running. - */ -bool nrf_drv_clock_lfclk_is_running(void); - -/** - * @brief Function for requesting the high-accuracy source HFCLK. - * - * The high-accuracy source - * can be requested by different modules or contexts. The driver ensures that the high-accuracy - * clock will be started only when it is requested the first time. If the clock is not ready - * but it was already started, the handler item that is provided as an input parameter is added - * to the list of handlers that will be notified when the clock is started. - * - * If an event handler is provided, it will be called once the clock is started. If the clock was already - * started at this time, the event handler will be called from the context of this function. Additionally, - * the @ref nrf_drv_clock_hfclk_is_running function can be polled to check if the clock has started. - * - * @note If a SoftDevice is running, the clock is managed by the SoftDevice and all requests are handled by - * the SoftDevice. This function cannot be called from all interrupt priority levels in that case. - * @note The handler item provided by the user cannot be an automatic variable. - * - * @param[in] p_handler_item A pointer to the event handler structure. - */ -void nrf_drv_clock_hfclk_request(nrf_drv_clock_handler_item_t * p_handler_item); - -/** - * @brief Function for releasing the high-accuracy source HFCLK. - * - * If there are no more requests, the high-accuracy source will be released. - */ -void nrf_drv_clock_hfclk_release(void); - -/** - * @brief Function for checking the HFCLK state. - * - * @retval true If the HFCLK is running (for \nRFXX XTAL source). - * @retval false If the HFCLK is not running. - */ -bool nrf_drv_clock_hfclk_is_running(void); - -/** - * @brief Function for starting a single calibration process. - * - * This function can also delay the start of calibration by a user-specified value. The delay will use - * a low-power timer that is part of the CLOCK module. @ref nrf_drv_clock_is_calibrating can be called to - * check if calibration is still in progress. If a handler is provided, the user can be notified when - * calibration is completed. The ext calibration can be started from the handler context. - * - * The calibration process consists of three phases: - * - Delay (optional) - * - Requesting the high-accuracy HFCLK - * - Hardware-supported calibration - * - * @param[in] delay Time after which the calibration will be started (in 0.25 s units). - * @param[in] handler NULL or user function to be called when calibration is completed or aborted. - * - * @retval NRF_SUCCESS If the procedure was successful. - * @retval NRF_ERROR_FORBIDDEN If a SoftDevice is present or the selected LFCLK source is not an RC oscillator. - * @retval NRF_ERROR_INVALID_STATE If the low-frequency clock is off. - * @retval NRF_ERROR_BUSY If calibration is in progress. - */ -ret_code_t nrf_drv_clock_calibration_start(uint8_t delay, nrf_drv_clock_event_handler_t handler); - -/** - * @brief Function for aborting calibration. - * - * This function aborts on-going calibration. If calibration was started, it cannot be stopped. If a handler - * was provided by @ref nrf_drv_clock_calibration_start, this handler will be called once - * aborted calibration is completed. @ref nrf_drv_clock_is_calibrating can also be used to check - * if the system is calibrating. - * - * @retval NRF_SUCCESS If the procedure was successful. - * @retval NRF_ERROR_FORBIDDEN If a SoftDevice is present or the selected LFCLK source is not an RC oscillator. - */ -ret_code_t nrf_drv_clock_calibration_abort(void); - -/** - * @brief Function for checking if calibration is in progress. - * - * This function indicates that the system is - * in calibration if it is in any of the calibration process phases (see @ref nrf_drv_clock_calibration_start). - * - * @param[out] p_is_calibrating True if calibration is in progress, false if not. - * - * @retval NRF_SUCCESS If the procedure was successful. - * @retval NRF_ERROR_FORBIDDEN If a SoftDevice is present or the selected LFCLK source is not an RC oscillator. - */ -ret_code_t nrf_drv_clock_is_calibrating(bool * p_is_calibrating); - -/**@brief Function for returning a requested task address for the clock driver module. - * - * @param[in] task One of the peripheral tasks. - * - * @return Task address. - */ -__STATIC_INLINE uint32_t nrf_drv_clock_ppi_task_addr(nrf_clock_task_t task); - -/**@brief Function for returning a requested event address for the clock driver module. - * - * @param[in] event One of the peripheral events. - * - * @return Event address. - */ -__STATIC_INLINE uint32_t nrf_drv_clock_ppi_event_addr(nrf_clock_event_t event); - - -#ifdef SOFTDEVICE_PRESENT -/** - * @brief Function called by the SoftDevice handler if an @ref NRF_SOC_EVTS event is received from the SoftDevice. - * - * @param[in] evt_id One of NRF_SOC_EVTS values. - */ -void nrf_drv_clock_on_soc_event(uint32_t evt_id); - -/** - * @brief Function called by the SoftDevice handler when the SoftDevice has been enabled. - * - * This function is called just after the SoftDevice has been properly enabled. - * Its main purpose is to mark that LFCLK has been requested by SD. - */ -void nrf_drv_clock_on_sd_enable(void); - -/** - * @brief Function called by the SoftDevice handler when the SoftDevice has been disabled. - * - * This function is called just after the SoftDevice has been properly disabled. - * It has two purposes: - * 1. Releases the LFCLK from the SD. - * 2. Reinitializes an interrupt after the SD releases POWER_CLOCK_IRQ. - */ -void nrf_drv_clock_on_sd_disable(void); - -#endif -/** - *@} - **/ - -#ifndef SUPPRESS_INLINE_IMPLEMENTATION -__STATIC_INLINE uint32_t nrf_drv_clock_ppi_task_addr(nrf_clock_task_t task) -{ - return nrf_clock_task_address_get(task); -} - -__STATIC_INLINE uint32_t nrf_drv_clock_ppi_event_addr(nrf_clock_event_t event) -{ - return nrf_clock_event_address_get(event); -} -#endif //SUPPRESS_INLINE_IMPLEMENTATION - -#ifdef __cplusplus -} -#endif - -#endif // NRF_DRV_CLOCK_H__ diff --git a/third_party/NordicSemiconductor/drivers/common/nrf_drv_common.h b/third_party/NordicSemiconductor/drivers/common/nrf_drv_common.h deleted file mode 100644 index 909562f14..000000000 --- a/third_party/NordicSemiconductor/drivers/common/nrf_drv_common.h +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Copyright (c) 2015 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_DRV_COMMON_H__ -#define NRF_DRV_COMMON_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define INTERRUPT_PRIORITY_VALIDATION(pri) STATIC_ASSERT(INTERRUPT_PRIORITY_IS_VALID((pri))) -#define INTERRUPT_PRIORITY_ASSERT(pri) ASSERT(INTERRUPT_PRIORITY_IS_VALID((pri))) - -#define nrf_drv_irq_handler_t nrfx_irq_handler_t -#define nrf_drv_bitpos_to_event nrfx_bitpos_to_event -#define nrf_drv_event_to_bitpos nrfx_event_to_bitpos -#define nrf_drv_get_IRQn nrfx_get_irq_number -#define nrf_drv_is_in_RAM nrfx_is_in_ram - -#ifdef __cplusplus -} -#endif - -#endif // NRF_DRV_COMMON_H__ diff --git a/third_party/NordicSemiconductor/drivers/power/nrf_drv_power.c b/third_party/NordicSemiconductor/drivers/power/nrf_drv_power.c deleted file mode 100644 index 5141ec4e4..000000000 --- a/third_party/NordicSemiconductor/drivers/power/nrf_drv_power.c +++ /dev/null @@ -1,417 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "sdk_common.h" -#if NRF_MODULE_ENABLED(POWER) -#include "nrf_drv_power.h" -#include -#ifdef SOFTDEVICE_PRESENT -#include "nrf_sdh.h" -#include "nrf_sdh_soc.h" -#endif - -#include - -// The structure with default configuration data. -static const nrfx_power_config_t m_drv_power_config_default = -{ - .dcdcen = NRFX_POWER_CONFIG_DEFAULT_DCDCEN, -#if NRF_POWER_HAS_VDDH - .dcdcenhv = NRFX_POWER_CONFIG_DEFAULT_DCDCENHV, -#endif -}; - -static bool m_initialized; - -bool nrf_drv_power_init_check(void) -{ - return m_initialized; -} - -ret_code_t nrf_drv_power_init(nrf_drv_power_config_t const * p_config) -{ - if (m_initialized) - { - return NRF_ERROR_MODULE_ALREADY_INITIALIZED; - } - -#ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) - { - return NRF_ERROR_INVALID_STATE; - } -#endif - if (p_config == NULL) - { - p_config = &m_drv_power_config_default; - } - - ret_code_t err_code = nrfx_power_init(p_config); - if (err_code == NRFX_SUCCESS) - { - m_initialized = true; - } - return err_code; -} - -void nrf_drv_power_uninit() -{ - nrfx_power_uninit(); - nrf_drv_power_pof_uninit(); -#if NRF_POWER_HAS_SLEEPEVT - nrf_drv_power_sleepevt_uninit(); -#endif -#if NRF_POWER_HAS_USBREG - nrf_drv_power_usbevt_uninit(); -#endif - m_initialized = false; -} - -ret_code_t nrf_drv_power_pof_init(nrf_drv_power_pofwarn_config_t const * p_config) -{ - ret_code_t err_code = NRF_SUCCESS; - nrfx_power_pof_init(p_config); -#ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) - { - /* Currently when SD is enabled - the configuration can be changed - * in very limited range. - * It is the SoftDevice limitation. - */ -#if NRF_POWER_HAS_VDDH - if (p_config->thrvddh != nrf_power_pofcon_vddh_get()) - { - /* Cannot change THRVDDH with current SD API */ - return NRF_ERROR_INVALID_STATE; - } -#endif - if (p_config->thr != nrf_power_pofcon_get(NULL)) - { - /* Only limited number of THR values are supported and - * the values taken by SD is different than the one in hardware - */ - uint8_t thr; - switch(p_config->thr) - { - case NRF_POWER_POFTHR_V21: - thr = NRF_POWER_THRESHOLD_V21; - break; - case NRF_POWER_POFTHR_V23: - thr = NRF_POWER_THRESHOLD_V23; - break; - case NRF_POWER_POFTHR_V25: - thr = NRF_POWER_THRESHOLD_V25; - break; - case NRF_POWER_POFTHR_V27: - thr = NRF_POWER_THRESHOLD_V27; - break; - default: - /* Cannot configure */ - nrfx_power_pof_uninit(); - return NRF_ERROR_INVALID_STATE; - } - err_code = sd_power_pof_threshold_set(thr); - if (err_code != NRF_SUCCESS) - { - return err_code; - } - } - err_code = sd_power_pof_enable(true); - } - else -#endif /* SOFTDEVICE_PRESENT */ - { - nrfx_power_pof_enable(p_config); - } - return err_code; -} - -void nrf_drv_power_pof_uninit() -{ -#ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) - { - ret_code_t err_code = sd_power_pof_enable(false); - ASSERT(err_code == NRF_SUCCESS); - UNUSED_VARIABLE(err_code); //handle no-debug case - } - else -#endif - { - nrfx_power_pof_disable(); - } - nrfx_power_pof_uninit(); -} - -#if NRF_POWER_HAS_SLEEPEVT -ret_code_t nrf_drv_power_sleepevt_init(nrf_drv_power_sleepevt_config_t const * p_config) -{ - if (p_config->handler != NULL) - { -#ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) - { - if ((p_config->en_enter) || (p_config->en_exit)) - { - return NRF_ERROR_INVALID_STATE; - } - } - else -#endif - { - nrfx_power_sleepevt_enable(p_config); - } - } - return NRF_SUCCESS; -} - -void nrf_drv_power_sleepevt_uninit(void) -{ -#ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) - { - /* Nothing to do */ - } - else -#endif - { - nrfx_power_sleepevt_disable(); - } - nrfx_power_sleepevt_uninit(); -} -#endif /* NRF_POWER_HAS_SLEEPEVT */ - -#if NRF_POWER_HAS_USBREG - -#ifdef SOFTDEVICE_PRESENT -static ret_code_t nrf_drv_power_sd_usbevt_enable(bool enable) -{ - ret_code_t err_code; - err_code = sd_power_usbdetected_enable(enable); - ASSERT(err_code == NRF_SUCCESS); - if (err_code != NRF_SUCCESS) - { - return err_code; - } - - err_code = sd_power_usbpwrrdy_enable(enable); - ASSERT(err_code == NRF_SUCCESS); - if (err_code != NRF_SUCCESS) - { - return err_code; - } - - err_code = sd_power_usbremoved_enable(enable); - ASSERT(err_code == NRF_SUCCESS); - return err_code; -} -#endif // SOFTDEVICE_PRESENT - -ret_code_t nrf_drv_power_usbevt_init(nrf_drv_power_usbevt_config_t const * p_config) -{ - nrf_drv_power_usbevt_uninit(); - nrfx_power_usbevt_init(p_config); -#ifdef SOFTDEVICE_PRESENT - if (nrf_sdh_is_enabled()) - { - ret_code_t err_code = nrf_drv_power_sd_usbevt_enable(true); - ASSERT(err_code == NRF_SUCCESS); - if (err_code != NRF_SUCCESS) - { - return err_code; - } - - uint32_t regstatus; - err_code = sd_power_usbregstatus_get(®status); - ASSERT(err_code == NRF_SUCCESS); - if (err_code != NRF_SUCCESS) - { - return err_code; - } - - if (regstatus & POWER_USBREGSTATUS_VBUSDETECT_Msk) - { - nrfx_power_usb_event_handler_t usbevt_handler = nrfx_power_usb_handler_get(); - ASSERT(usbevt_handler != NULL); - usbevt_handler(NRFX_POWER_USB_EVT_DETECTED); - } - } - else -#endif - { - nrfx_power_usbevt_enable(); - } - return NRF_SUCCESS; -} - -void nrf_drv_power_usbevt_uninit(void) -{ -#ifdef SOFTDEVICE_PRESENT - CRITICAL_REGION_ENTER(); - if (nrf_sdh_is_enabled()) - { - ret_code_t err_code = nrf_drv_power_sd_usbevt_enable(false); - ASSERT(err_code == NRF_SUCCESS); - UNUSED_VARIABLE(err_code); - } - else -#endif - { - nrfx_power_usbevt_disable(); - } -#ifdef SOFTDEVICE_PRESENT - CRITICAL_REGION_EXIT(); -#endif - nrfx_power_usbevt_uninit(); -} -#endif /* NRF_POWER_HAS_USBREG */ - -#ifdef SOFTDEVICE_PRESENT -static void nrf_drv_power_sdh_soc_evt_handler(uint32_t evt_id, void * p_context); -static void nrf_drv_power_sdh_state_evt_handler(nrf_sdh_state_evt_t state, void * p_context); - -NRF_SDH_SOC_OBSERVER(m_soc_observer, POWER_CONFIG_SOC_OBSERVER_PRIO, - nrf_drv_power_sdh_soc_evt_handler, NULL); - -NRF_SDH_STATE_OBSERVER(m_sd_observer, POWER_CONFIG_STATE_OBSERVER_PRIO) = -{ - .handler = nrf_drv_power_sdh_state_evt_handler, - .p_context = NULL -}; - -static void nrf_drv_power_sdh_soc_evt_handler(uint32_t evt_id, void * p_context) -{ - if (evt_id == NRF_EVT_POWER_FAILURE_WARNING) - { - nrfx_power_pofwarn_event_handler_t pofwarn_handler = nrfx_power_pof_handler_get(); - /* Cannot be null if event is enabled */ - ASSERT(pofwarn_handler != NULL); - pofwarn_handler(); - } - -#if NRF_POWER_HAS_USBREG - nrfx_power_usb_event_handler_t usbevt_handler = nrfx_power_usb_handler_get(); - if (usbevt_handler != NULL) - { - switch (evt_id) - { - case NRF_EVT_POWER_USB_POWER_READY: - usbevt_handler(NRFX_POWER_USB_EVT_READY); - break; - - case NRF_EVT_POWER_USB_DETECTED: - usbevt_handler(NRFX_POWER_USB_EVT_DETECTED); - break; - - case NRF_EVT_POWER_USB_REMOVED: - usbevt_handler(NRFX_POWER_USB_EVT_REMOVED); - break; - - default: - break; - - } - } -#endif -} - -static void nrf_drv_power_on_sd_enable(void) -{ - ASSERT(m_initialized); /* This module has to be enabled first */ - CRITICAL_REGION_ENTER(); - if (nrfx_power_pof_handler_get() != NULL) - { - ret_code_t err_code = sd_power_pof_enable(true); - ASSERT(err_code == NRF_SUCCESS); - UNUSED_VARIABLE(err_code); //handle no-debug case - } - CRITICAL_REGION_EXIT(); - -#if NRF_POWER_HAS_USBREG - if (nrfx_power_usb_handler_get() != NULL) - { - ret_code_t err_code = nrf_drv_power_sd_usbevt_enable(true); - ASSERT(err_code == NRF_SUCCESS); - UNUSED_VARIABLE(err_code); //handle no-debug case - } -#endif -} - -static void nrf_drv_power_on_sd_disable(void) -{ - /* Reinit interrupts */ - ASSERT(m_initialized); - NRFX_IRQ_PRIORITY_SET(POWER_CLOCK_IRQn, CLOCK_CONFIG_IRQ_PRIORITY); - NRFX_IRQ_ENABLE(POWER_CLOCK_IRQn); - if (nrfx_power_pof_handler_get() != NULL) - { - nrf_power_int_enable(NRF_POWER_INT_POFWARN_MASK); - } - -#if NRF_POWER_HAS_USBREG - if (nrfx_power_usb_handler_get() != NULL) - { - nrf_power_int_enable( - NRF_POWER_INT_USBDETECTED_MASK | - NRF_POWER_INT_USBREMOVED_MASK | - NRF_POWER_INT_USBPWRRDY_MASK); - } -#endif -} - -static void nrf_drv_power_sdh_state_evt_handler(nrf_sdh_state_evt_t state, void * p_context) -{ - switch (state) - { - case NRF_SDH_EVT_STATE_ENABLED: - nrf_drv_power_on_sd_enable(); - break; - - case NRF_SDH_EVT_STATE_DISABLED: - nrf_drv_power_on_sd_disable(); - break; - - default: - break; - } -} - -#endif // SOFTDEVICE_PRESENT -#endif //POWER_ENABLED diff --git a/third_party/NordicSemiconductor/drivers/power/nrf_drv_power.h b/third_party/NordicSemiconductor/drivers/power/nrf_drv_power.h deleted file mode 100644 index 105dda27b..000000000 --- a/third_party/NordicSemiconductor/drivers/power/nrf_drv_power.h +++ /dev/null @@ -1,232 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_DRV_POWER_H__ -#define NRF_DRV_POWER_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_drv_power POWER driver - legacy layer - * @{ - * @ingroup nrf_power - * - * @brief Layer providing compatibility with the former API. - */ - -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_power_config_t nrf_drv_power_config_t; -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_power_pofwarn_config_t nrf_drv_power_pofwarn_config_t; -#if NRF_POWER_HAS_SLEEPEVT || defined(__SDK_DOXYGEN__) -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_power_sleepevt_config_t nrf_drv_power_sleepevt_config_t; -#endif -#if NRF_POWER_HAS_USBREG || defined(__SDK_DOXYGEN__) -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_power_usbevt_config_t nrf_drv_power_usbevt_config_t; -#endif - -/** @brief Macro for forwarding the new implementation. */ -#define NRF_DRV_POWER_MODE_CONSTLAT NRFX_POWER_MODE_CONSTLAT -/** @brief Macro for forwarding the new implementation. */ -#define NRF_DRV_POWER_MODE_LOWPWR NRFX_POWER_MODE_LOWPWR -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_power_mode_t nrfx_power_mode_t -/** @brief Macro for forwarding the new implementation. */ -#define NRF_DRV_POWER_SLEEP_EVT_ENTER NRFX_POWER_SLEEP_EVT_ENTER -/** @brief Macro for forwarding the new implementation. */ -#define NRF_DRV_POWER_SLEEP_EVT_EXIT NRFX_POWER_SLEEP_EVT_EXIT -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_power_sleep_evt_t nrfx_power_sleep_evt_t -/** @brief Macro for forwarding the new implementation. */ -#define NRF_DRV_POWER_USB_EVT_DETECTED NRFX_POWER_USB_EVT_DETECTED -/** @brief Macro for forwarding the new implementation. */ -#define NRF_DRV_POWER_USB_EVT_REMOVED NRFX_POWER_USB_EVT_REMOVED -/** @brief Macro for forwarding the new implementation. */ -#define NRF_DRV_POWER_USB_EVT_READY NRFX_POWER_USB_EVT_READY -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_power_usb_evt_t nrfx_power_usb_evt_t -/** @brief Macro for forwarding the new implementation. */ -#define NRF_DRV_POWER_USB_STATE_DISCONNECTED NRFX_POWER_USB_STATE_DISCONNECTED -/** @brief Macro for forwarding the new implementation. */ -#define NRF_DRV_POWER_USB_STATE_CONNECTED NRFX_POWER_USB_STATE_CONNECTED -/** @brief Macro for forwarding the new implementation. */ -#define NRF_DRV_POWER_USB_STATE_READY NRFX_POWER_USB_STATE_READY -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_power_usb_state_t nrfx_power_usb_state_t -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_power_pofwarn_event_handler_t nrfx_power_pofwarn_event_handler_t -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_power_sleep_event_handler_t nrfx_power_sleep_event_handler_t -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_power_usb_event_handler_t nrfx_power_usb_event_handler_t - -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_power_usbstatus_get nrfx_power_usbstatus_get - -/** - * @brief Function for checking if driver is already initialized - * - * This function is used to check whether common POWER_CLOCK interrupt - * should be disabled or not if @ref nrf_drv_clock tries to disable the interrupt. - * - * @retval true Driver is initialized - * @retval false Driver is uninitialized - * - * @sa nrf_drv_power_uninit - */ -bool nrf_drv_power_init_check(void); - -/** - * @brief Initialize power module driver - * - * Enabled power module driver would process all the interrupts from power system. - * - * @param[in] p_config Driver configuration. Can be NULL - the default configuration - * from @em sdk_config.h file would be used then. - * - * @retval NRF_ERROR_INVALID_STATE Power driver has to be enabled - * before SoftDevice. - * @retval NRF_ERROR_MODULE_ALREADY_INITIALIZED Module is initialized already. - * @retval NRF_SUCCESS Successfully initialized. - */ -ret_code_t nrf_drv_power_init(nrf_drv_power_config_t const * p_config); - -/** - * @brief Unintialize power module driver - * - * Disables all the interrupt handling in the module. - * - * @sa nrf_drv_power_init - */ -void nrf_drv_power_uninit(void); - -/** - * @brief Initialize power failure comparator - * - * Configures and setups the power failure comparator and enables it. - * - * @param[in] p_config Configuration with values and event handler. - * If event handler is set to NULL, interrupt would be disabled. - * - * @retval NRF_ERROR_INVALID_STATE POF is initialized when SD is enabled and - * the configuration differs from the old one and - * is not possible to be set using SD interface. - * @retval NRF_SUCCESS Successfully initialized and configured. - */ -ret_code_t nrf_drv_power_pof_init(nrf_drv_power_pofwarn_config_t const * p_config); - -/** - * @brief Turn off the power failure comparator - * - * Disables and clears the settings of the power failure comparator. - */ -void nrf_drv_power_pof_uninit(void); - -#if NRF_POWER_HAS_SLEEPEVT || defined(__SDK_DOXYGEN__) - -/** - * @brief Initialize sleep entering and exiting events processing - * - * Configures and setups the sleep event processing. - * - * @param[in] p_config Configuration with values and event handler. - * - * @sa nrf_drv_power_sleepevt_uninit - * - * @note Sleep events are not available when SoftDevice is enabled. - * @note If sleep event is enabled when SoftDevice is initialized, sleep events - * would be automatically disabled - it is the limitation of the - * SoftDevice itself. - * - * @retval NRF_ERROR_INVALID_STATE This event cannot be initialized - * when SD is enabled. - * @retval NRF_SUCCESS Successfully initialized and configured. - */ -ret_code_t nrf_drv_power_sleepevt_init(nrf_drv_power_sleepevt_config_t const * p_config); - -/** - * @brief Uninitialize sleep entering and exiting events processing - * - * @sa nrf_drv_power_sleepevt_init - */ -void nrf_drv_power_sleepevt_uninit(void); - -#endif // NRF_POWER_HAS_SLEEPEVT || defined(__SDK_DOXYGEN__) - -#if NRF_POWER_HAS_USBREG || defined(__SDK_DOXYGEN__) - -/** - * @brief Initialize USB power event processing - * - * Configures and setups the USB power event processing. - * - * @param[in] p_config Configuration with values and event handler. - * - * @sa nrf_drv_power_usbevt_uninit - * - * @retval NRF_ERROR_INVALID_STATE This event cannot be initialized - * when SD is enabled and SD does not support - * USB power events. - * @retval NRF_SUCCESS Successfully initialized and configured. - */ -ret_code_t nrf_drv_power_usbevt_init(nrf_drv_power_usbevt_config_t const * p_config); - -/** - * @brief Uninitalize USB power event processing - * - * @sa nrf_drv_power_usbevt_init - */ -void nrf_drv_power_usbevt_uninit(void); - -#endif // NRF_POWER_HAS_USBREG || defined(__SDK_DOXYGEN__) - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif // NRF_DRV_POWER_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/fal/nrf_802154_fal.c b/third_party/NordicSemiconductor/drivers/radio/fal/nrf_802154_fal.c deleted file mode 100644 index 7a2352456..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/fal/nrf_802154_fal.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Copyright (c) 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file contains implementation of the nRF 802.15.4 FEM abstraction layer. - * - */ - -#include - -#include "compiler_abstraction.h" -#include "nrf_802154_fal.h" - -__WEAK int8_t nrf_802154_fal_tx_power_get(const uint8_t channel, const int8_t power) -{ - (void)channel; - - return power; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/fal/nrf_802154_fal.h b/third_party/NordicSemiconductor/drivers/radio/fal/nrf_802154_fal.h deleted file mode 100644 index bbd9e5f7d..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/fal/nrf_802154_fal.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief This module defines the nRF 802.15.4 Frontend Module abstraction layer. - * - */ - -#ifndef NRF_802154_FAL_H_ -#define NRF_802154_FAL_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Returns 'power' value. - * - * @note This is a stub implementation used when MPSL is not linked. - * - * @param[in] channel Ignored. - * @param[in] power TX power in dbm. - * - * @returns Value of 'power' argument. - */ -int8_t nrf_802154_fal_tx_power_get(const uint8_t channel, const int8_t power); - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_FAL_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/none/nrf_fem_config.h b/third_party/NordicSemiconductor/drivers/radio/fem/none/nrf_fem_config.h deleted file mode 100644 index e8daf6c7f..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/fem/none/nrf_fem_config.h +++ /dev/null @@ -1,61 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_FEM_CONFIG_H_ -#define NRF_FEM_CONFIG_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Configuration parameters for pins that enable or disable (or both) either Power Amplifier (PA) or Low Noise Amplifier (LNA). - */ -typedef struct -{ - -} nrf_fem_gpiote_pin_config_t; - -/** - * @brief Configuration parameters for the PA/LNA interface. - */ -typedef struct -{ - -} nrf_fem_interface_config_t; - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_FEM_CONFIG_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_config.h b/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_config.h deleted file mode 100644 index 6c93bba9e..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_control_config.h +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_FEM_CONTROL_CONFIG_H_ -#define NRF_FEM_CONTROL_CONFIG_H_ - -#if ENABLE_FEM -#include "nrf_fem_config.h" -#endif // ENABLE_FEM - -#include -#include - -#include "nrf_error.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @section Configuration - */ - -#if ENABLE_FEM - -/** - * @brief Configures the PA and LNA device interface. - * - * This function sets device interface parameters for the PA/LNA module. - * The module can then be used to control a power amplifier or a low noise amplifier (or both) through the given interface and resources. - * - * The function also sets the PPI and GPIOTE channels to be configured for the PA/LNA interface. - * - * @param[in] p_config Pointer to the interface parameters for the PA/LNA device. - * - * @retval ::NRF_SUCCESS PA/LNA control successfully configured. - * @retval ::NRF_ERROR_NOT_SUPPORTED PA/LNA is not available. - * - */ -int32_t nrf_fem_interface_configuration_set(nrf_fem_interface_config_t const * const p_config); - -/** - * @brief Retrieves the configuration of PA and LNA device interface. - * - * This function gets device interface parameters for the PA/LNA module. - * The module can then be used to control a power amplifier or a low noise amplifier (or both) through the given interface and resources. - * - * - * @param[in] p_config Pointer to the interface parameters for the PA/LNA device to be populated. - * - * @retval ::NRF_SUCCESS PA/LNA control successfully configured. - * @retval ::NRF_ERROR_NOT_SUPPORTED PA/LNA is not available. - * - */ -int32_t nrf_fem_interface_configuration_get(nrf_fem_interface_config_t * p_config); - -#else // ENABLE_FEM - -typedef void nrf_fem_interface_config_t; - -static inline int32_t nrf_fem_interface_configuration_set( - nrf_fem_interface_config_t const * const p_config) -{ - (void)p_config; - return NRF_ERROR_NOT_SUPPORTED; -} - -static inline int32_t nrf_fem_interface_configuration_get(nrf_fem_interface_config_t * p_config) -{ - (void)p_config; - return NRF_ERROR_NOT_SUPPORTED; -} - -#endif // ENABLE_FEM - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_FEM_CONTROL_CONFIG_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_protocol_api.h b/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_protocol_api.h deleted file mode 100644 index 3c835471b..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_protocol_api.h +++ /dev/null @@ -1,303 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Protocol interface for Power Amplifier (PA) and Low Noise Amplifier (LNA). - * - * This module enables toggling of GPIO pins before and after the radio transmission and the radio reception - * in order to control a Power Amplifier or a Low Noise Amplifier, or both. - * - * The application must first provide PA and LNA device-specific configuration parameters to this module. - * The protocol must then provide PA and LNA protocol configuration parameters before it can use the functionality. - * - * When the PA/LNA module is configured, the stack can call the provided enable functions before radio activity - * to enable the PA or LNA timer configurations for the upcoming radio activity. - * By default, PA/LNA is automatically deactivated on the radio DISABLED event. - * This can be disabled, so that a manual deactivation can be performed instead. - */ - -#ifndef NRF_FEM_PROTOCOL_API_H__ -#define NRF_FEM_PROTOCOL_API_H__ - -#include "nrf_fem_control_config.h" -#include "nrf_fem_protocol_legacy_api.h" - -#include "nrf_error.h" -#include "nrf_ppi.h" -#include "nrf_timer.h" - -typedef enum -{ - NRF_802154_FAL_PA = 1 << 0, - NRF_802154_FAL_LNA = 1 << 1, - NRF_802154_FAL_ALL = NRF_802154_FAL_PA | NRF_802154_FAL_LNA -} nrf_fal_functionality_t; - -/** - * @brief PA and LNA activation event types. - */ -typedef enum -{ - NRF_802154_FAL_EVENT_TYPE_TIMER, - NRF_802154_FAL_EVENT_TYPE_GENERIC, - NRF_802154_FAL_EVENT_TYPE_PPI, -} nrf_802154_fal_event_type_t; - -/** - * @brief Frontend Abstraction Layer event. - * - * The event can be a Timer Compare event or an Any event. - * Register value is only used for the Timer Compare event and should only contain the timer value relative to the Timer Compare event. - */ -typedef struct -{ - union - { - struct - { - NRF_TIMER_Type * p_timer_instance; /* Pointer to a 1-us resolution timer instance. */ - uint32_t counter_value; /* Timer value when the radio activity starts. */ - uint8_t compare_channel_mask; /* Mask of the compare channels that can be used by the FEM to schedule its own tasks. */ - } timer; - struct - { - uint32_t register_address; /* Address of event register. */ - } generic; - struct - { - uint8_t ch_id; /* Number of the PPI which was provided. */ - } ppi; - } event; - bool override_ppi; /* False to ignore the PPI channel below and use the one set by application. True to use the PPI channel below. */ - uint8_t ppi_ch_id; /* PPI channel to be used for this event. */ - nrf_802154_fal_event_type_t type; /* Type of event source. */ -} nrf_802154_fal_event_t; - -#if ENABLE_FEM - -/** - * @brief Sets up PA using the provided events for the upcoming radio transmission. - * - * Multiple configurations can be provided by repeating calls to this function (that is, you can set the activate and the deactivate events in multiple calls, - * and the configuration is preserved between calls). - * - * If a NRF_802154_PA_LNA_EVENT_TYPE_TIMER timer event is provided, the PA will be configured to activate or deactivate at the application-configured time gap - * before the timer instance reaches the given register_value. The time gap is set via @ref nrf_fem_interface_configuration_set. - * - * If a NRF_802154_PA_LNA_EVENT_TYPE_GENERIC event is provided, the PA will be configured to activate or deactivate when an event occurs. - * - * The function sets up the PPIs and the GPIOTE channel to activate PA for the upcoming radio transmission. - * The PA pin will be active until deactivated, which can happen either by encountering a configured deactivation event or by using @ref nrf_802154_fal_deactivate_now. - * - * @param[in] p_activate_event Pointer to the activation event structure. - * @param[in] p_deactivate_event Pointer to the deactivation event structure. - * - * @pre To activate PA, nrf_fem_interface_configuration_set() must have been called first. - * - * @note If a timer event is provided, the caller of this function is responsible for starting the timer and its shorts. - * Moreover, the caller is responsible for stopping the timer no earlier than the provided compare channel expires. - * - * @retval ::NRF_SUCCESS PA activate setup is successful. - * @retval ::NRF_ERROR_FORBIDDEN PA is currently disabled. - * @retval ::NRF_ERROR_INVALID_STATE PA activate setup could not be performed due to invalid or missing configuration parameters - * in p_activate_event or p_deactivate_event, or both. - */ -int32_t nrf_802154_fal_pa_configuration_set(const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event); - -/** - * @brief Clears up the configuration provided by the @ref nrf_802154_fal_pa_configuration_set function. - * - * @param[in] p_activate_event Pointer to the activation event structure. - * @param[in] p_deactivate_event Pointer to the deactivation event structure. - * - * @retval ::NRF_SUCCESS PA activate setup purge is successful. - * @retval ::NRF_ERROR_FORBIDDEN PA is currently disabled. - * @retval ::NRF_ERROR_INVALID_STATE PA activate setup purge could not be performed due to invalid or missing configuration parameters - * in p_activate_event or p_deactivate_event, or both. - */ -int32_t nrf_802154_fal_pa_configuration_clear(const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event); - -/** - * @brief Sets up LNA using the provided event for the upcoming radio reception. - * - * Multiple configurations can be provided by repeating calls to this function (that is, you can set the activate and the deactivate event in multiple calls, - * and the configuration is preserved between calls). - * - * If a NRF_802154_PA_LNA_EVENT_TYPE_TIMER timer event is provided, the LNA will be configured to activate or deactivate at the application-configured time gap - * before the timer instance reaches the given register_value. The time gap is set via @ref nrf_fem_interface_configuration_set. - * - * If a NRF_802154_PA_LNA_EVENT_TYPE_GENERIC event is provided, the LNA will be configured to activate or deactivate when an event occurs. - * - * The function sets up the PPIs and the GPIOTE channel to activate LNA for the upcoming radio transmission. - * The LNA pin will be active until deactivated, which can happen either by encountering a configured deactivation event or by using @ref nrf_802154_fal_deactivate_now. - * - * @param[in] p_activate_event Pointer to the activation event structure. - * @param[in] p_deactivate_event Pointer to the deactivation event structure. - * - * @pre To activate LNA, nrf_fem_interface_configuration_set() must have been called first. - * - * @note If a timer event is provided, the caller of this function is responsible for starting the timer and its shorts. - * Moreover, the caller is responsible for stopping the timer no earlier than the provided compare channel expires. - * - * @retval ::NRF_SUCCESS LNA activate setup is successful. - * @retval ::NRF_ERROR_FORBIDDEN LNA is currently disabled. - * @retval ::NRF_ERROR_INVALID_STATE LNA activate setup could not be performed due to invalid or missing configuration parameters - * in p_activate_event or p_deactivate_event, or both. - */ -int32_t nrf_802154_fal_lna_configuration_set(const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event); - -/** - * @brief Clears up the configuration provided by the @ref nrf_802154_fal_lna_configuration_set function. - * - * @param[in] p_activate_event Pointer to the activation event structure. - * @param[in] p_deactivate_event Pointer to the deactivation event structure. - * - * @retval ::NRF_SUCCESS LNA activate setup purge is successful. - * @retval ::NRF_ERROR_FORBIDDEN LNA is currently disabled. - * @retval ::NRF_ERROR_INVALID_STATE LNA activate setup purge could not be performed due to invalid or missing configuration parameters - * in p_activate_event or p_deactivate_event, or both. - */ -int32_t nrf_802154_fal_lna_configuration_clear( - const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event); - -/** - * @brief Deactivates PA/LNA pins with immediate effect. - */ -void nrf_802154_fal_deactivate_now(nrf_fal_functionality_t type); - -/** - * @brief Cleans up the configured PA/LNA timer/radio instance and resources of PPI and GPIOTE. - * The function resets the hardware that has been set up for the PA/LNA activation. The PA and LNA module control configuration parameters are not deleted. - * The function is intended to be called after the radio disable signal. - */ -void nrf_802154_fal_cleanup(void); - -/** - * @brief Checks if the PA signaling is configured and enabled, and gets the configured gain in dB. - * - * @param[out] p_gain The configured gain in dB if PA is configured and enabled. - If there is no PA present or the PA does not affect the signal gain, returns 0 dB. - * - */ -void nrf_802154_fal_pa_is_configured(int8_t * const p_gain); - -/** - * @brief Prepares the FEM module to switch to the Power Down state. - * - * @param[in] p_instance Timer instance that is used to schedule the transition to the Power Down state. - * @param[in] compare_channel Compare channel to hold a value for the timer. - * @param[in] ppi_id ID of the PPI channel used to switch to the Power Down state. - * - * @return bool Whether the scheduling of the transition was successful or not. - * - */ -bool nrf_fem_prepare_powerdown(NRF_TIMER_Type * p_instance, - uint32_t compare_channel, - nrf_ppi_channel_t ppi_id); - -#else // ENABLE_FEM - -static inline int32_t nrf_802154_fal_pa_configuration_set( - const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - (void)p_activate_event; - (void)p_deactivate_event; - return NRF_ERROR_FORBIDDEN; -} - -static inline int32_t nrf_802154_fal_pa_configuration_clear( - const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - (void)p_activate_event; - (void)p_deactivate_event; - return NRF_ERROR_FORBIDDEN; -} - -static inline int32_t nrf_802154_fal_lna_configuration_set( - const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - (void)p_activate_event; - (void)p_deactivate_event; - return NRF_ERROR_FORBIDDEN; -} - -static inline int32_t nrf_802154_fal_lna_configuration_clear( - const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - (void)p_activate_event; - (void)p_deactivate_event; - return NRF_ERROR_FORBIDDEN; -} - -static inline void nrf_802154_fal_deactivate_now(nrf_fal_functionality_t type) -{ - (void)type; -} - -static inline void nrf_802154_fal_cleanup(void) -{ - -} - -static inline bool nrf_fem_prepare_powerdown(NRF_TIMER_Type * p_instance, - uint32_t compare_channel, - nrf_ppi_channel_t ppi_id) -{ - (void)p_instance; - (void)compare_channel; - (void)ppi_id; - return false; -} - -static inline void nrf_802154_fal_pa_is_configured(int8_t * const p_gain) -{ - *p_gain = 0; -} - -#define NRF_802154_FEM_PINS_USED_MASK 0 -#define NRF_802154_FEM_PPI_CHANNELS_USED_MASK 0 -#define NRF_802154_FEM_GPIOTE_CHANNELS_USED_MASK 0 - -#endif // ENABLE_FEM - -#endif // NRF_FEM_PROTOCOL_API_H__ - -/** - @} - @} - */ diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_protocol_legacy_api.h b/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_protocol_legacy_api.h deleted file mode 100644 index 0411577b6..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/fem/nrf_fem_protocol_legacy_api.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include - -/** - * @brief Configuration parameters for PA and LNA. - */ -typedef struct -{ - uint8_t enable : 1; /**< Enable toggling for this amplifier. */ - uint8_t active_high : 1; /**< Set the pin to be active high. */ - uint8_t gpio_pin : 6; /**< The GPIO pin to be toggled for this amplifier. */ -} nrf_fem_control_pa_lna_cfg_t; - -/** - * @brief PA and LNA GPIO toggle configuration. - * - * This option configures the nRF 802.15.4 radio driver to toggle pins when the radio - * is active and ready for use with a Power Amplifier (PA) or a Low Noise Amplifier (LNA), or both. - * - * Pins can be toggled by using two PPI channels and a GPIOTE channel. The hardware channel IDs are provided - * by the application and are to be regarded as reserved for as long as there is no PA/LNA toggling enabled. - * - * @note Avoid changing this configuration while the radio is in use, as this can lead to undefined consequences. - * - */ -typedef struct -{ - nrf_fem_control_pa_lna_cfg_t pa_cfg; /**< Power Amplifier configuration. */ - nrf_fem_control_pa_lna_cfg_t lna_cfg; /**< Low Noise Amplifier configuration. */ - uint8_t pa_gpiote_ch_id; /**< GPIOTE channel used for Power Amplifier pin toggling. */ - uint8_t lna_gpiote_ch_id; /**< GPIOTE channel used for Low Noise Amplifier pin toggling. */ - uint8_t ppi_ch_id_set; /**< PPI channel used for radio Power Amplifier and Low Noise Amplifier pins setting. */ - uint8_t ppi_ch_id_clr; /**< PPI channel used for radio pin clearing. */ -} nrf_fem_control_cfg_t; diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio/nrf_fem_config.h b/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio/nrf_fem_config.h deleted file mode 100644 index aa16f067a..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio/nrf_fem_config.h +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_FEM_CONFIG_H_ -#define NRF_FEM_CONFIG_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Configuration parameters for pins that enable or disable (or both) either Power Amplifier (PA) or Low Noise Amplifier (LNA). - */ -typedef struct -{ - bool enable; /* Enable toggling for this pin. */ - bool active_high; /* If true, the pin will be active high. Otherwise, the pin will be active low. */ - uint8_t gpio_pin; /* GPIO pin number for the pin. */ - uint8_t gpiote_ch_id; /* GPIOTE channel to be used for toggling pins. */ -} nrf_fem_gpiote_pin_config_t; - -/** - * @brief Configuration parameters for the PA/LNA interface. - */ -typedef struct -{ - struct - { - uint32_t pa_time_gap_us; /* Time between the activation of the PA pin and the start of the radio transmission. */ - uint32_t lna_time_gap_us; /* Time between the activation of the LNA pin and the start of the radio reception. */ - int8_t pa_gain_db; /* Configurable PA gain. Ignored if the amplifier is not supporting this feature. */ - int8_t lna_gain_db; /* Configurable LNA gain. Ignored if the amplifier is not supporting this feature. */ - } fem_config; - - nrf_fem_gpiote_pin_config_t pa_pin_config; /* Power Amplifier pin configuration. */ - nrf_fem_gpiote_pin_config_t lna_pin_config; /* Low Noise Amplifier pin configuration. */ - - uint8_t ppi_ch_id_set; /* PPI channel to be used for setting pins. */ - uint8_t ppi_ch_id_clr; /* PPI channel to be used for clearing pins. */ -} nrf_fem_interface_config_t; - -/** - * @section Timings. - */ - -/** Time in microseconds when PA GPIO is activated before the radio is ready for transmission. */ -#define NRF_FEM_PA_TIME_IN_ADVANCE_US 23 - -/** Time in microseconds when LNA GPIO is activated before the radio is ready for reception. */ -#define NRF_FEM_LNA_TIME_IN_ADVANCE_US 5 - -#ifdef NRF52811_XXAA -/** Default Power Amplifier pin. */ -#define NRF_FEM_CONTROL_DEFAULT_PA_PIN 19 - -/** Default Low Noise Amplifier pin. */ -#define NRF_FEM_CONTROL_DEFAULT_LNA_PIN 20 - -#else - -/** Default Power Amplifier pin. */ -#define NRF_FEM_CONTROL_DEFAULT_PA_PIN 15 - -/** Default Low Noise Amplifier pin. */ -#define NRF_FEM_CONTROL_DEFAULT_LNA_PIN 16 -#endif - -/** Default PPI channel for pin setting. */ -#define NRF_FEM_CONTROL_DEFAULT_SET_PPI_CHANNEL 15 - -/** Default PPI channel for pin clearing. */ -#define NRF_FEM_CONTROL_DEFAULT_CLR_PPI_CHANNEL 16 - -/** Default GPIOTE channel for FEM control. */ -#define NRF_FEM_CONTROL_DEFAULT_LNA_GPIOTE_CHANNEL 6 - -/** Default GPIOTE channel for FEM control. */ -#define NRF_FEM_CONTROL_DEFAULT_PA_GPIOTE_CHANNEL 7 - -/** Mask of GPIO pins used for FEM control. */ -#define NRF_802154_FEM_PINS_USED_MASK ((1 << NRF_FEM_CONTROL_DEFAULT_PA_PIN) | \ - (1 << NRF_FEM_CONTROL_DEFAULT_LNA_PIN)) - -/** Mask of PPI channels used for FEM control. */ -#define NRF_802154_FEM_PPI_CHANNELS_USED_MASK ((1 << NRF_FEM_CONTROL_DEFAULT_SET_PPI_CHANNEL) | \ - (1 << NRF_FEM_CONTROL_DEFAULT_CLR_PPI_CHANNEL)) - -/** Mask of GPIOTE channels used for FEM control. */ -#define NRF_802154_FEM_GPIOTE_CHANNELS_USED_MASK ( \ - (1 << NRF_FEM_CONTROL_DEFAULT_LNA_GPIOTE_CHANNEL) | \ - (1 << NRF_FEM_CONTROL_DEFAULT_PA_GPIOTE_CHANNEL)) - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_FEM_CONFIG_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio/nrf_fem_simple_gpio.c b/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio/nrf_fem_simple_gpio.c deleted file mode 100644 index 62ba56c47..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/fem/simple_gpio/nrf_fem_simple_gpio.c +++ /dev/null @@ -1,470 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements common function for Front End Module control of the nRF 802.15.4 radio driver. - * - */ -#include "nrf_fem_protocol_api.h" - -#include -#include -#include - -#include "compiler_abstraction.h" -#include "nrf_802154_config.h" -#include "nrf.h" -#include "nrf_error.h" -#include "nrf_gpio.h" -#include "nrf_gpiote.h" -#include "nrf_ppi.h" -#include "nrf_radio.h" -#include "nrf_timer.h" - -#if ENABLE_FEM - -#define PPI_INVALID_CHANNEL 0xFF /**< Default value for the PPI holder variable. */ - -static nrf_fem_interface_config_t m_nrf_fem_interface_config = /**< FEM controller configuration. */ -{ - .fem_config = - { - .pa_time_gap_us = NRF_FEM_PA_TIME_IN_ADVANCE_US, - .lna_time_gap_us = NRF_FEM_LNA_TIME_IN_ADVANCE_US - }, - .pa_pin_config = - { - .enable = 1, - .active_high = 1, - .gpio_pin = NRF_FEM_CONTROL_DEFAULT_PA_PIN, - .gpiote_ch_id = NRF_FEM_CONTROL_DEFAULT_PA_GPIOTE_CHANNEL - }, - .lna_pin_config = - { - .enable = 1, - .active_high = 1, - .gpio_pin = NRF_FEM_CONTROL_DEFAULT_LNA_PIN, - .gpiote_ch_id = NRF_FEM_CONTROL_DEFAULT_LNA_GPIOTE_CHANNEL - }, - .ppi_ch_id_set = NRF_FEM_CONTROL_DEFAULT_SET_PPI_CHANNEL, - .ppi_ch_id_clr = NRF_FEM_CONTROL_DEFAULT_CLR_PPI_CHANNEL -}; -static uint8_t m_ppi_channel_ext = PPI_INVALID_CHANNEL; /**< PPI channel provided by the `override_ppi = true` functionality. */ - -/** Map the mask bits with the Compare Channels. */ -static uint32_t get_first_available_compare_channel(uint8_t mask) -{ - if (mask & (1 << 0)) - return NRF_TIMER_CC_CHANNEL0; - if (mask & (1 << 1)) - return NRF_TIMER_CC_CHANNEL1; - if (mask & (1 << 2)) - return NRF_TIMER_CC_CHANNEL2; - if (mask & (1 << 3)) - return NRF_TIMER_CC_CHANNEL3; - assert(false); - return 0; -} - -/** Configure GPIOTE module. */ -static void gpiote_configure(void) -{ - if (m_nrf_fem_interface_config.pa_pin_config.enable) - { - nrf_gpiote_task_configure(m_nrf_fem_interface_config.pa_pin_config.gpiote_ch_id, - m_nrf_fem_interface_config.pa_pin_config.gpio_pin, - (nrf_gpiote_polarity_t)GPIOTE_CONFIG_POLARITY_None, - (nrf_gpiote_outinit_t) !m_nrf_fem_interface_config.pa_pin_config.active_high); - - nrf_gpiote_task_enable(m_nrf_fem_interface_config.pa_pin_config.gpiote_ch_id); - } - - if (m_nrf_fem_interface_config.lna_pin_config.enable) - { - nrf_gpiote_task_configure(m_nrf_fem_interface_config.lna_pin_config.gpiote_ch_id, - m_nrf_fem_interface_config.lna_pin_config.gpio_pin, - (nrf_gpiote_polarity_t)GPIOTE_CONFIG_POLARITY_None, - (nrf_gpiote_outinit_t) !m_nrf_fem_interface_config.lna_pin_config.active_high); - - nrf_gpiote_task_enable(m_nrf_fem_interface_config.lna_pin_config.gpiote_ch_id); - } -} - -/** Configure the event with the provided values. */ -static int32_t event_configuration_set(const nrf_802154_fal_event_t * const p_event, - nrf_fem_gpiote_pin_config_t * p_pin_config, - bool activate, - uint32_t time_delay) -{ - uint32_t task_addr; - uint8_t ppi_ch; - - assert(p_event); - assert(p_pin_config); - - if (p_event->override_ppi) - { - assert(p_event->ppi_ch_id != PPI_INVALID_CHANNEL); - if (m_ppi_channel_ext == PPI_INVALID_CHANNEL) - { - /* External PPI channel placeholder is free. */ - m_ppi_channel_ext = ppi_ch = p_event->ppi_ch_id; - } - else if ((m_ppi_channel_ext == p_event->ppi_ch_id) && - (!NRF_PPI->FORK[(uint32_t)m_ppi_channel_ext].TEP)) - { - /* PPI is equal to the already set, but the one set has a free fork endpoint. */ - ppi_ch = p_event->ppi_ch_id; - } - else - { - return NRF_ERROR_INVALID_STATE; - } - } - else - { - ppi_ch = - activate ? m_nrf_fem_interface_config.ppi_ch_id_set : m_nrf_fem_interface_config. - ppi_ch_id_clr; - } - - if (p_pin_config->active_high ^ activate) - { - task_addr = (uint32_t)(&NRF_GPIOTE->TASKS_CLR[p_pin_config->gpiote_ch_id]); - } - else - { - task_addr = (uint32_t)(&NRF_GPIOTE->TASKS_SET[p_pin_config->gpiote_ch_id]); - } - - switch (p_event->type) - { - case NRF_802154_FAL_EVENT_TYPE_GENERIC: - { - if (NRF_PPI->CH[(uint32_t)ppi_ch].TEP) - { - nrf_ppi_fork_endpoint_setup((nrf_ppi_channel_t)ppi_ch, task_addr); - } - else - { - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)ppi_ch, - p_event->event.generic.register_address, - task_addr); - } - - nrf_ppi_channel_enable((nrf_ppi_channel_t)ppi_ch); - } - break; - - case NRF_802154_FAL_EVENT_TYPE_TIMER: - { - assert(p_event->event.timer.compare_channel_mask); - - uint32_t compare_channel = get_first_available_compare_channel( - p_event->event.timer.compare_channel_mask); - - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)ppi_ch, - (uint32_t)(&(p_event->event.timer.p_timer_instance-> - EVENTS_COMPARE[compare_channel])), - task_addr); - nrf_ppi_channel_enable((nrf_ppi_channel_t)ppi_ch); - - nrf_timer_cc_write(p_event->event.timer.p_timer_instance, - (nrf_timer_cc_channel_t)compare_channel, - p_event->event.timer.counter_value - time_delay); - } - break; - - default: - assert(false); - break; - } - - return NRF_SUCCESS; -} - -/** Deconfigure the event with the provided values. */ -static int32_t event_configuration_clear(const nrf_802154_fal_event_t * const p_event, - bool activate) -{ - uint8_t ppi_ch; - - assert(p_event); - - if (p_event->override_ppi) - { - ppi_ch = p_event->ppi_ch_id; - } - else - { - ppi_ch = - activate ? m_nrf_fem_interface_config.ppi_ch_id_set : m_nrf_fem_interface_config. - ppi_ch_id_clr; - } - - nrf_ppi_channel_disable((nrf_ppi_channel_t)ppi_ch); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)ppi_ch, 0, 0); - nrf_ppi_fork_endpoint_setup((nrf_ppi_channel_t)ppi_ch, 0); - - switch (p_event->type) - { - case NRF_802154_FAL_EVENT_TYPE_GENERIC: - break; - - case NRF_802154_FAL_EVENT_TYPE_TIMER: - break; - - default: - assert(false); - break; - } - - return NRF_SUCCESS; -} - -int32_t nrf_802154_fal_pa_configuration_set(const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - int32_t ret_code; - - if (!m_nrf_fem_interface_config.pa_pin_config.enable) - { - return NRF_ERROR_FORBIDDEN; - } - - if (p_activate_event) - { - ret_code = event_configuration_set(p_activate_event, - &m_nrf_fem_interface_config.pa_pin_config, - true, - m_nrf_fem_interface_config.fem_config.pa_time_gap_us); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - if (p_deactivate_event) - { - ret_code = event_configuration_set(p_deactivate_event, - &m_nrf_fem_interface_config.pa_pin_config, - false, - m_nrf_fem_interface_config.fem_config.pa_time_gap_us); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - return NRF_SUCCESS; -} - -int32_t nrf_802154_fal_lna_configuration_set(const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - int32_t ret_code; - - if (!m_nrf_fem_interface_config.lna_pin_config.enable) - { - return NRF_ERROR_FORBIDDEN; - } - - if (p_activate_event) - { - ret_code = event_configuration_set(p_activate_event, - &m_nrf_fem_interface_config.lna_pin_config, - true, - m_nrf_fem_interface_config.fem_config.lna_time_gap_us); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - if (p_deactivate_event) - { - ret_code = event_configuration_set(p_deactivate_event, - &m_nrf_fem_interface_config.lna_pin_config, - false, - m_nrf_fem_interface_config.fem_config.lna_time_gap_us); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - return NRF_SUCCESS; -} - -int32_t nrf_802154_fal_pa_configuration_clear(const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - int32_t ret_code; - - if (!m_nrf_fem_interface_config.pa_pin_config.enable) - { - return NRF_ERROR_FORBIDDEN; - } - - if (p_activate_event) - { - ret_code = event_configuration_clear(p_activate_event, true); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - if (p_deactivate_event) - { - ret_code = event_configuration_clear(p_deactivate_event, false); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - return NRF_SUCCESS; -} - -int32_t nrf_802154_fal_lna_configuration_clear( - const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - int32_t ret_code; - - if (!m_nrf_fem_interface_config.lna_pin_config.enable) - { - return NRF_ERROR_FORBIDDEN; - } - - if (p_activate_event) - { - ret_code = event_configuration_clear(p_activate_event, true); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - if (p_deactivate_event) - { - ret_code = event_configuration_clear(p_deactivate_event, false); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - return NRF_SUCCESS; -} - -void nrf_802154_fal_deactivate_now(nrf_fal_functionality_t type) -{ - if (m_nrf_fem_interface_config.pa_pin_config.enable && (type & NRF_802154_FAL_PA)) - { - if (m_nrf_fem_interface_config.pa_pin_config.active_high) - { - nrf_gpiote_task_force(m_nrf_fem_interface_config.pa_pin_config.gpiote_ch_id, - NRF_GPIOTE_INITIAL_VALUE_LOW); - } - else - { - nrf_gpiote_task_force(m_nrf_fem_interface_config.pa_pin_config.gpiote_ch_id, - NRF_GPIOTE_INITIAL_VALUE_HIGH); - } - } - - if (m_nrf_fem_interface_config.lna_pin_config.enable && (type & NRF_802154_FAL_LNA)) - { - if (m_nrf_fem_interface_config.lna_pin_config.active_high) - { - nrf_gpiote_task_force(m_nrf_fem_interface_config.lna_pin_config.gpiote_ch_id, - NRF_GPIOTE_INITIAL_VALUE_LOW); - } - else - { - nrf_gpiote_task_force(m_nrf_fem_interface_config.lna_pin_config.gpiote_ch_id, - NRF_GPIOTE_INITIAL_VALUE_HIGH); - } - } -} - -int32_t nrf_fem_interface_configuration_set(nrf_fem_interface_config_t const * const p_config) -{ - m_nrf_fem_interface_config = *p_config; - - if (m_nrf_fem_interface_config.pa_pin_config.enable || - m_nrf_fem_interface_config.lna_pin_config.enable) - { - gpiote_configure(); - } - - return NRF_SUCCESS; -} - -int32_t nrf_fem_interface_configuration_get(nrf_fem_interface_config_t * p_config) -{ - *p_config = m_nrf_fem_interface_config; - - return NRF_SUCCESS; -} - -void nrf_802154_fal_cleanup(void) -{ - nrf_ppi_channel_disable((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_set); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_set, 0, - 0); - nrf_ppi_fork_endpoint_setup((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_set, 0); - nrf_ppi_channel_disable((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_clr); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_clr, 0, - 0); - nrf_ppi_fork_endpoint_setup((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_clr, 0); - if (m_ppi_channel_ext != PPI_INVALID_CHANNEL) - { - nrf_ppi_channel_disable((nrf_ppi_channel_t)m_ppi_channel_ext); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)m_ppi_channel_ext, 0, 0); - nrf_ppi_fork_endpoint_setup((nrf_ppi_channel_t)m_ppi_channel_ext, 0); - m_ppi_channel_ext = PPI_INVALID_CHANNEL; - } -} - -bool nrf_fem_prepare_powerdown(NRF_TIMER_Type * p_instance, - uint32_t compare_channel, - nrf_ppi_channel_t ppi_id) -{ - (void)p_instance; - (void)compare_channel; - (void)ppi_id; - return false; -} - -#endif // ENABLE_FEM diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio/nrf_fem_config.h b/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio/nrf_fem_config.h deleted file mode 100644 index 80cff2034..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio/nrf_fem_config.h +++ /dev/null @@ -1,149 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_FEM_CONFIG_H_ -#define NRF_FEM_CONFIG_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Configuration parameters for pins that enable or disable (or both) either Power Amplifier (PA) or Low Noise Amplifier (LNA). - */ -typedef struct -{ - bool enable; /* Enable toggling for this pin. */ - bool active_high; /* If true, the pin will be active high. Otherwise, the pin will be active low. */ - uint8_t gpio_pin; /* GPIO pin number for the pin. */ - uint8_t gpiote_ch_id; /* GPIOTE channel to be used for toggling pins. */ -} nrf_fem_gpiote_pin_config_t; - -/** - * @brief Configuration parameters for the PA/LNA interface. - */ -typedef struct -{ - struct - { - uint32_t pa_time_gap_us; /* Time between the activation of the PA pin and the start of the radio transmission. */ - uint32_t lna_time_gap_us; /* Time between the activation of the LNA pin and the start of the radio reception. */ - uint32_t pdn_settle_us; /* The time between activating the PDN and asserting the PA/LNA pin. */ - uint32_t trx_hold_us; /* The time between deasserting the PA/LNA pin and deactivating PDN. */ - int8_t pa_gain_db; /* Configurable PA gain. Ignored if the amplifier is not supporting this feature. */ - int8_t lna_gain_db; /* Configurable LNA gain. Ignored if the amplifier is not supporting this feature. */ - } fem_config; - - nrf_fem_gpiote_pin_config_t pa_pin_config; /* Power Amplifier pin configuration. */ - nrf_fem_gpiote_pin_config_t lna_pin_config; /* Low Noise Amplifier pin configuration. */ - nrf_fem_gpiote_pin_config_t pdn_pin_config; /* Power Down pin configuration. */ - - uint8_t ppi_ch_id_set; /* PPI channel to be used for setting pins. */ - uint8_t ppi_ch_id_clr; /* PPI channel to be used for clearing pins. */ - uint8_t ppi_ch_id_pdn; /* PPI channel to handle PDN pin. */ -} nrf_fem_interface_config_t; - -/** - * @section Timings. - */ - -/** Time in microseconds when PA GPIO is activated before the radio is ready for transmission. */ -#define NRF_FEM_PA_TIME_IN_ADVANCE_US 13 - -/** Time in microseconds when LNA GPIO is activated before the radio is ready for reception. */ -#define NRF_FEM_LNA_TIME_IN_ADVANCE_US 13 - -/** The time between activating the PDN and asserting the RX_EN/TX_EN. */ -#define NRF_FEM_PDN_SETTLE_US 18 - -/** The time between deasserting the RX_EN/TX_EN and deactivating PDN. */ -#define NRF_FEM_TRX_HOLD_US 5 - -#ifdef NRF52811_XXAA -/** Default Power Amplifier pin. */ -#define NRF_FEM_CONTROL_DEFAULT_PA_PIN 19 - -/** Default Low Noise Amplifier pin. */ -#define NRF_FEM_CONTROL_DEFAULT_LNA_PIN 20 - -#else - -/** Default Power Amplifier pin. */ -#define NRF_FEM_CONTROL_DEFAULT_PA_PIN 15 - -/** Default Low Noise Amplifier pin. */ -#define NRF_FEM_CONTROL_DEFAULT_LNA_PIN 16 -#endif - -/** Default Eagle PDN pin. */ -#define NRF_FEM_CONTROL_DEFAULT_PDN_PIN 24 - -/** Default PPI channel for pin setting. */ -#define NRF_FEM_CONTROL_DEFAULT_SET_PPI_CHANNEL 15 - -/** Default PPI channel for pin clearing. */ -#define NRF_FEM_CONTROL_DEFAULT_CLR_PPI_CHANNEL 16 - -/** Default PPI channel for PDN pin handling. */ -#define NRF_FEM_CONTROL_DEFAULT_PDN_PPI_CHANNEL 5 - -/** Default GPIOTE channel for PDN control. */ -#define NRF_FEM_CONTROL_DEFAULT_PDN_GPIOTE_CHANNEL 5 - -/** Default GPIOTE channel for LNA control. */ -#define NRF_FEM_CONTROL_DEFAULT_LNA_GPIOTE_CHANNEL 6 - -/** Default GPIOTE channel for PA control. */ -#define NRF_FEM_CONTROL_DEFAULT_PA_GPIOTE_CHANNEL 7 - -/** Mask of GPIO pins used for FEM control. */ -#define NRF_802154_FEM_PINS_USED_MASK ((1 << NRF_FEM_CONTROL_DEFAULT_PA_PIN) | \ - (1 << NRF_FEM_CONTROL_DEFAULT_LNA_PIN) | \ - (1 << NRF_FEM_CONTROL_DEFAULT_PDN_PIN)) - -/** Mask of PPI channels used for FEM control. */ -#define NRF_802154_FEM_PPI_CHANNELS_USED_MASK ((1 << NRF_FEM_CONTROL_DEFAULT_SET_PPI_CHANNEL) | \ - (1 << NRF_FEM_CONTROL_DEFAULT_CLR_PPI_CHANNEL) | \ - (1 << NRF_FEM_CONTROL_DEFAULT_PDN_PPI_CHANNEL)) - -/** Mask of GPIOTE channels used for FEM control. */ -#define NRF_802154_FEM_GPIOTE_CHANNELS_USED_MASK ( \ - (1 << NRF_FEM_CONTROL_DEFAULT_PDN_GPIOTE_CHANNEL) | \ - (1 << NRF_FEM_CONTROL_DEFAULT_LNA_GPIOTE_CHANNEL) | \ - (1 << NRF_FEM_CONTROL_DEFAULT_PA_GPIOTE_CHANNEL)) - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_FEM_CONFIG_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio/nrf_fem_three_pin_gpio.c b/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio/nrf_fem_three_pin_gpio.c deleted file mode 100644 index 68bad9d7f..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/fem/three_pin_gpio/nrf_fem_three_pin_gpio.c +++ /dev/null @@ -1,575 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements common function for Front End Module control of the nRF 802.15.4 radio driver. - * - */ -#include "nrf_fem_protocol_api.h" - -#include -#include -#include - -#include "compiler_abstraction.h" -#include "nrf_802154_config.h" -#include "nrf.h" -#include "nrf_error.h" -#include "nrf_gpio.h" -#include "nrf_gpiote.h" -#include "nrf_ppi.h" -#include "nrf_radio.h" -#include "nrf_timer.h" - -#if ENABLE_FEM - -#define PPI_INVALID_CHANNEL 0xFF /**< Default value for the PPI holder variable. */ - -static nrf_fem_interface_config_t m_nrf_fem_interface_config = /**< FEM controller configuration. */ -{ - .fem_config = - { - .pa_time_gap_us = NRF_FEM_PA_TIME_IN_ADVANCE_US, - .lna_time_gap_us = NRF_FEM_LNA_TIME_IN_ADVANCE_US, - .pdn_settle_us = NRF_FEM_PDN_SETTLE_US, - .trx_hold_us = NRF_FEM_TRX_HOLD_US, - }, - .pa_pin_config = - { - .enable = 1, - .active_high = 1, - .gpio_pin = NRF_FEM_CONTROL_DEFAULT_PA_PIN, - .gpiote_ch_id = NRF_FEM_CONTROL_DEFAULT_PA_GPIOTE_CHANNEL - }, - .lna_pin_config = - { - .enable = 1, - .active_high = 1, - .gpio_pin = NRF_FEM_CONTROL_DEFAULT_LNA_PIN, - .gpiote_ch_id = NRF_FEM_CONTROL_DEFAULT_LNA_GPIOTE_CHANNEL - }, - .pdn_pin_config = - { - .enable = 1, - .gpio_pin = NRF_FEM_CONTROL_DEFAULT_PDN_PIN, - .active_high = 1, - .gpiote_ch_id = NRF_FEM_CONTROL_DEFAULT_PDN_GPIOTE_CHANNEL - }, - .ppi_ch_id_set = NRF_FEM_CONTROL_DEFAULT_SET_PPI_CHANNEL, - .ppi_ch_id_clr = NRF_FEM_CONTROL_DEFAULT_CLR_PPI_CHANNEL, - .ppi_ch_id_pdn = NRF_FEM_CONTROL_DEFAULT_PDN_PPI_CHANNEL -}; -static uint8_t m_ppi_channel_ext = PPI_INVALID_CHANNEL; /**< PPI channel provided by the `override_ppi = true` functionality. */ - -/** Map the mask bits with the Compare Channels. */ -static uint32_t get_available_compare_channel(uint8_t mask, uint32_t number) -{ - uint32_t i; - - for (i = 0; i < 4; i++) - { - if (mask & (1 << i)) - { - if (number == 0) - { - break; - } - else - { - number--; - } - } - } - - if (i == 0) - return NRF_TIMER_CC_CHANNEL0; - if (i == 1) - return NRF_TIMER_CC_CHANNEL1; - if (i == 2) - return NRF_TIMER_CC_CHANNEL2; - if (i == 3) - return NRF_TIMER_CC_CHANNEL3; - assert(false); - return 0; -} - -/** Configure GPIOTE module. */ -static void gpiote_configure(void) -{ - if (m_nrf_fem_interface_config.pa_pin_config.enable) - { - nrf_gpiote_task_configure(m_nrf_fem_interface_config.pa_pin_config.gpiote_ch_id, - m_nrf_fem_interface_config.pa_pin_config.gpio_pin, - (nrf_gpiote_polarity_t)GPIOTE_CONFIG_POLARITY_None, - (nrf_gpiote_outinit_t) !m_nrf_fem_interface_config.pa_pin_config.active_high); - - nrf_gpiote_task_enable(m_nrf_fem_interface_config.pa_pin_config.gpiote_ch_id); - } - - if (m_nrf_fem_interface_config.lna_pin_config.enable) - { - nrf_gpiote_task_configure(m_nrf_fem_interface_config.lna_pin_config.gpiote_ch_id, - m_nrf_fem_interface_config.lna_pin_config.gpio_pin, - (nrf_gpiote_polarity_t)GPIOTE_CONFIG_POLARITY_None, - (nrf_gpiote_outinit_t) !m_nrf_fem_interface_config.lna_pin_config.active_high); - - nrf_gpiote_task_enable(m_nrf_fem_interface_config.lna_pin_config.gpiote_ch_id); - } - - if (m_nrf_fem_interface_config.pdn_pin_config.enable) - { - nrf_gpiote_task_configure(m_nrf_fem_interface_config.pdn_pin_config.gpiote_ch_id, - m_nrf_fem_interface_config.pdn_pin_config.gpio_pin, - (nrf_gpiote_polarity_t)GPIOTE_CONFIG_POLARITY_None, - (nrf_gpiote_outinit_t) !m_nrf_fem_interface_config.pdn_pin_config.active_high); - - nrf_gpiote_task_enable(m_nrf_fem_interface_config.pdn_pin_config.gpiote_ch_id); - } -} - -/** Configure the event with the provided values. */ -static int32_t event_configuration_set(const nrf_802154_fal_event_t * const p_event, - nrf_fem_gpiote_pin_config_t * p_pin_config, - bool activate, - uint32_t time_delay) -{ - uint32_t task_addr; - uint8_t ppi_ch; - - assert(p_event); - assert(p_pin_config); - - if (p_event->override_ppi) - { - assert(p_event->ppi_ch_id != PPI_INVALID_CHANNEL); - if (m_ppi_channel_ext == PPI_INVALID_CHANNEL) - { - /* External PPI channel placeholder is free. */ - m_ppi_channel_ext = ppi_ch = p_event->ppi_ch_id; - } - else if ((m_ppi_channel_ext == p_event->ppi_ch_id) && - (!NRF_PPI->FORK[(uint32_t)m_ppi_channel_ext].TEP)) - { - /* PPI is equal to the already set, but the one set has a free fork endpoint. */ - ppi_ch = p_event->ppi_ch_id; - } - else - { - return NRF_ERROR_INVALID_STATE; - } - } - else - { - ppi_ch = - activate ? m_nrf_fem_interface_config.ppi_ch_id_set : m_nrf_fem_interface_config. - ppi_ch_id_clr; - } - - if (p_pin_config->active_high ^ activate) - { - task_addr = (uint32_t)(&NRF_GPIOTE->TASKS_CLR[p_pin_config->gpiote_ch_id]); - } - else - { - task_addr = (uint32_t)(&NRF_GPIOTE->TASKS_SET[p_pin_config->gpiote_ch_id]); - } - - switch (p_event->type) - { - case NRF_802154_FAL_EVENT_TYPE_GENERIC: - { - if (NRF_PPI->CH[(uint32_t)ppi_ch].TEP) - { - nrf_ppi_fork_endpoint_setup((nrf_ppi_channel_t)ppi_ch, task_addr); - } - else - { - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)ppi_ch, - p_event->event.generic.register_address, - task_addr); - } - - nrf_ppi_channel_enable((nrf_ppi_channel_t)ppi_ch); - } - break; - - case NRF_802154_FAL_EVENT_TYPE_TIMER: - { - assert(p_event->event.timer.compare_channel_mask); - - uint32_t compare_channel; - uint32_t pdn_task_addr; - - /* EN pin */ - compare_channel = get_available_compare_channel( - p_event->event.timer.compare_channel_mask, - 0); - - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)ppi_ch, - (uint32_t)(&(p_event->event.timer.p_timer_instance-> - EVENTS_COMPARE[compare_channel])), - task_addr); - nrf_ppi_channel_enable((nrf_ppi_channel_t)ppi_ch); - - nrf_timer_cc_write(p_event->event.timer.p_timer_instance, - (nrf_timer_cc_channel_t)compare_channel, - p_event->event.timer.counter_value - time_delay); - - /* PDN pin */ - if (m_nrf_fem_interface_config.pdn_pin_config.active_high) - { - pdn_task_addr = - (uint32_t)(&NRF_GPIOTE->TASKS_SET[m_nrf_fem_interface_config.pdn_pin_config. - gpiote_ch_id]); - } - else - { - pdn_task_addr = - (uint32_t)(&NRF_GPIOTE->TASKS_CLR[m_nrf_fem_interface_config.pdn_pin_config. - gpiote_ch_id]); - } - - compare_channel = get_available_compare_channel( - p_event->event.timer.compare_channel_mask, - 1); - - nrf_ppi_channel_endpoint_setup( - (nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_pdn, - (uint32_t)(&(p_event->event.timer.p_timer_instance-> - EVENTS_COMPARE[compare_channel])), - pdn_task_addr); - - nrf_ppi_channel_enable((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_pdn); - - nrf_timer_cc_write(p_event->event.timer.p_timer_instance, - (nrf_timer_cc_channel_t)compare_channel, - p_event->event.timer.counter_value - time_delay - - m_nrf_fem_interface_config.fem_config.pdn_settle_us); - break; - } - - default: - assert(false); - break; - } - - return NRF_SUCCESS; -} - -/** Deconfigure the event with the provided values. */ -static int32_t event_configuration_clear(const nrf_802154_fal_event_t * const p_event, - bool activate) -{ - uint8_t ppi_ch; - - assert(p_event); - - if (p_event->override_ppi) - { - ppi_ch = p_event->ppi_ch_id; - } - else - { - ppi_ch = - activate ? m_nrf_fem_interface_config.ppi_ch_id_set : m_nrf_fem_interface_config. - ppi_ch_id_clr; - } - - nrf_ppi_channel_disable((nrf_ppi_channel_t)ppi_ch); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)ppi_ch, 0, 0); - nrf_ppi_fork_endpoint_setup((nrf_ppi_channel_t)ppi_ch, 0); - - switch (p_event->type) - { - case NRF_802154_FAL_EVENT_TYPE_GENERIC: - case NRF_802154_FAL_EVENT_TYPE_TIMER: - break; - - default: - assert(false); - break; - } - - return NRF_SUCCESS; -} - -int32_t nrf_802154_fal_pa_configuration_set(const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - int32_t ret_code; - - if (!m_nrf_fem_interface_config.pa_pin_config.enable) - { - return NRF_ERROR_FORBIDDEN; - } - - if (p_activate_event) - { - ret_code = event_configuration_set(p_activate_event, - &m_nrf_fem_interface_config.pa_pin_config, - true, - m_nrf_fem_interface_config.fem_config.pa_time_gap_us); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - if (p_deactivate_event) - { - ret_code = event_configuration_set(p_deactivate_event, - &m_nrf_fem_interface_config.pa_pin_config, - false, - m_nrf_fem_interface_config.fem_config.pa_time_gap_us); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - return NRF_SUCCESS; -} - -int32_t nrf_802154_fal_lna_configuration_set(const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - int32_t ret_code; - - if (!m_nrf_fem_interface_config.lna_pin_config.enable) - { - return NRF_ERROR_FORBIDDEN; - } - - if (p_activate_event) - { - ret_code = event_configuration_set(p_activate_event, - &m_nrf_fem_interface_config.lna_pin_config, - true, - m_nrf_fem_interface_config.fem_config.lna_time_gap_us); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - if (p_deactivate_event) - { - ret_code = event_configuration_set(p_deactivate_event, - &m_nrf_fem_interface_config.lna_pin_config, - false, - m_nrf_fem_interface_config.fem_config.lna_time_gap_us); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - return NRF_SUCCESS; -} - -int32_t nrf_802154_fal_pa_configuration_clear(const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - int32_t ret_code; - - if (!m_nrf_fem_interface_config.pa_pin_config.enable) - { - return NRF_ERROR_FORBIDDEN; - } - - if (p_activate_event) - { - ret_code = event_configuration_clear(p_activate_event, true); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - if (p_deactivate_event) - { - ret_code = event_configuration_clear(p_deactivate_event, false); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - return NRF_SUCCESS; -} - -int32_t nrf_802154_fal_lna_configuration_clear( - const nrf_802154_fal_event_t * const p_activate_event, - const nrf_802154_fal_event_t * const p_deactivate_event) -{ - int32_t ret_code; - - if (!m_nrf_fem_interface_config.lna_pin_config.enable) - { - return NRF_ERROR_FORBIDDEN; - } - - if (p_activate_event) - { - ret_code = event_configuration_clear(p_activate_event, true); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - if (p_deactivate_event) - { - ret_code = event_configuration_clear(p_deactivate_event, false); - if (ret_code != NRF_SUCCESS) - { - return ret_code; - } - } - - return NRF_SUCCESS; -} - -void nrf_802154_fal_deactivate_now(nrf_fal_functionality_t type) -{ - if (m_nrf_fem_interface_config.pa_pin_config.enable && (type & NRF_802154_FAL_PA)) - { - if (m_nrf_fem_interface_config.pa_pin_config.active_high) - { - nrf_gpiote_task_force(m_nrf_fem_interface_config.pa_pin_config.gpiote_ch_id, - NRF_GPIOTE_INITIAL_VALUE_LOW); - } - else - { - nrf_gpiote_task_force(m_nrf_fem_interface_config.pa_pin_config.gpiote_ch_id, - NRF_GPIOTE_INITIAL_VALUE_HIGH); - } - } - - if (m_nrf_fem_interface_config.lna_pin_config.enable && (type & NRF_802154_FAL_LNA)) - { - if (m_nrf_fem_interface_config.lna_pin_config.active_high) - { - nrf_gpiote_task_force(m_nrf_fem_interface_config.lna_pin_config.gpiote_ch_id, - NRF_GPIOTE_INITIAL_VALUE_LOW); - } - else - { - nrf_gpiote_task_force(m_nrf_fem_interface_config.lna_pin_config.gpiote_ch_id, - NRF_GPIOTE_INITIAL_VALUE_HIGH); - } - } -} - -int32_t nrf_fem_interface_configuration_set(nrf_fem_interface_config_t const * const p_config) -{ - m_nrf_fem_interface_config = *p_config; - - if (m_nrf_fem_interface_config.pa_pin_config.enable || - m_nrf_fem_interface_config.lna_pin_config.enable) - { - gpiote_configure(); - } - - return NRF_SUCCESS; -} - -int32_t nrf_fem_interface_configuration_get(nrf_fem_interface_config_t * p_config) -{ - *p_config = m_nrf_fem_interface_config; - - return NRF_SUCCESS; -} - -void nrf_802154_fal_cleanup(void) -{ - nrf_ppi_channel_disable((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_set); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_set, 0, - 0); - nrf_ppi_fork_endpoint_setup((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_set, 0); - nrf_ppi_channel_disable((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_clr); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_clr, 0, - 0); - nrf_ppi_fork_endpoint_setup((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_clr, 0); - if (m_ppi_channel_ext != PPI_INVALID_CHANNEL) - { - nrf_ppi_channel_disable((nrf_ppi_channel_t)m_ppi_channel_ext); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)m_ppi_channel_ext, 0, 0); - nrf_ppi_fork_endpoint_setup((nrf_ppi_channel_t)m_ppi_channel_ext, 0); - m_ppi_channel_ext = PPI_INVALID_CHANNEL; - } -} - -bool nrf_fem_prepare_powerdown(NRF_TIMER_Type * p_instance, - uint32_t compare_channel, - nrf_ppi_channel_t ppi_id) -{ - uint32_t pdn_task_addr; - - if (!m_nrf_fem_interface_config.pdn_pin_config.enable) - { - return false; - } - - if (m_nrf_fem_interface_config.pdn_pin_config.active_high) - { - pdn_task_addr = - (uint32_t)(&NRF_GPIOTE->TASKS_CLR[m_nrf_fem_interface_config.pdn_pin_config.gpiote_ch_id - ]); - } - else - { - pdn_task_addr = - (uint32_t)(&NRF_GPIOTE->TASKS_SET[m_nrf_fem_interface_config.pdn_pin_config.gpiote_ch_id - ]); - } - - nrf_timer_cc_write(p_instance, - (nrf_timer_cc_channel_t)compare_channel, - m_nrf_fem_interface_config.fem_config.trx_hold_us + 1); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)m_nrf_fem_interface_config.ppi_ch_id_pdn, - (uint32_t)(&(p_instance->EVENTS_COMPARE[compare_channel])), - pdn_task_addr); - - uint32_t event_addr = (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_DISABLED); - uint32_t task_addr = (uint32_t)nrf_timer_task_address_get(p_instance, NRF_TIMER_TASK_START); - - nrf_timer_shorts_enable(p_instance, NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - nrf_ppi_channel_endpoint_setup(ppi_id, event_addr, task_addr); - nrf_ppi_fork_endpoint_setup(ppi_id, 0); - nrf_ppi_channel_enable(ppi_id); - - nrf_timer_event_clear(p_instance, NRF_TIMER_EVENT_COMPARE0); - - return true; -} - -#endif // ENABLE_FEM diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.c b/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.c deleted file mode 100644 index e4d449fd5..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.c +++ /dev/null @@ -1,742 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements procedures to set pending bit and 802.15.4-2015 information - * elements in nRF 802.15.4 radio driver. - * - */ - -#include "nrf_802154_ack_data.h" - -#include -#include - -#include "mac_features/nrf_802154_frame_parser.h" -#include "nrf_802154_config.h" -#include "nrf_802154_const.h" - -/// Maximum number of Short Addresses of nodes for which there is ACK data to set. -#define NUM_SHORT_ADDRESSES NRF_802154_PENDING_SHORT_ADDRESSES -/// Maximum number of Extended Addresses of nodes for which there is ACK data to set. -#define NUM_EXTENDED_ADDRESSES NRF_802154_PENDING_EXTENDED_ADDRESSES - -/// Structure representing pending bit setting variables. -typedef struct -{ - bool enabled; /// If setting pending bit is enabled. - uint8_t short_addr[NUM_SHORT_ADDRESSES][SHORT_ADDRESS_SIZE]; /// Array of short addresses of nodes for which there is pending data in the buffer. - uint8_t extended_addr[NUM_EXTENDED_ADDRESSES][EXTENDED_ADDRESS_SIZE]; /// Array of extended addresses of nodes for which there is pending data in the buffer. - uint32_t num_of_short_addr; /// Current number of short addresses of nodes for which there is pending data in the buffer. - uint32_t num_of_ext_addr; /// Current number of extended addresses of nodes for which there is pending data in the buffer. -} pending_bit_arrays_t; - -// Structure representing a single IE record. -typedef struct -{ - uint8_t p_data[NRF_802154_MAX_ACK_IE_SIZE]; /// Pointer to IE data buffer. - uint8_t len; /// Length of the buffer. -} ie_data_t; - -// Structure representing IE records sent in an ACK message to a given short address. -typedef struct -{ - uint8_t addr[SHORT_ADDRESS_SIZE]; /// Short address of peer node. - ie_data_t ie_data; /// Pointer to IE records. -} ack_short_ie_data_t; - -// Structure representing IE records sent in an ACK message to a given extended address. -typedef struct -{ - uint8_t addr[EXTENDED_ADDRESS_SIZE]; /// Extended address of peer node. - ie_data_t ie_data; /// Pointer to IE records. -} ack_ext_ie_data_t; - -// Structure representing IE data setting variables. -typedef struct -{ - ack_short_ie_data_t short_data[NUM_SHORT_ADDRESSES]; /// Array of short addresses and IE records sent to these addresses. - ack_ext_ie_data_t ext_data[NUM_EXTENDED_ADDRESSES]; /// Array of extended addresses and IE records sent to these addresses. - uint32_t num_of_short_data; /// Current number of short addresses stored in @p short_data. - uint32_t num_of_ext_data; /// Current number of extended addresses stored in @p ext_data. -} ie_arrays_t; - -// TODO: Combine below arrays to perform binary search only once per Ack generation. -static pending_bit_arrays_t m_pending_bit; -static ie_arrays_t m_ie; -static nrf_802154_src_addr_match_t m_src_matching_method; - -/*************************************************************************************************** - * @section Array handling helper functions - **************************************************************************************************/ - -/** - * @brief Compare two extended addresses. - * - * @param[in] p_first_addr Pointer to a first address that should be compared. - * @param[in] p_second_addr Pointer to a second address that should be compared. - * - * @retval -1 First address is less than the second address. - * @retval 0 First address is equal to the second address. - * @retval 1 First address is greater than the second address. - */ -static int8_t extended_addr_compare(const uint8_t * p_first_addr, const uint8_t * p_second_addr) -{ - uint32_t first_addr; - uint32_t second_addr; - - // Compare extended address in two steps to prevent unaligned access error. - for (uint32_t i = 0; i < EXTENDED_ADDRESS_SIZE / sizeof(uint32_t); i++) - { - first_addr = *(uint32_t *)(p_first_addr + (i * sizeof(uint32_t))); - second_addr = *(uint32_t *)(p_second_addr + (i * sizeof(uint32_t))); - - if (first_addr < second_addr) - { - return -1; - } - else if (first_addr > second_addr) - { - return 1; - } - } - - return 0; -} - -/** - * @brief Compare two short addresses. - * - * @param[in] p_first_addr Pointer to a first address that should be compared. - * @param[in] p_second_addr Pointer to a second address that should be compared. - * - * @retval -1 First address is less than the second address. - * @retval 0 First address is equal to the second address. - * @retval 1 First address is greater than the second address. - */ -static int8_t short_addr_compare(const uint8_t * p_first_addr, const uint8_t * p_second_addr) -{ - uint16_t first_addr = *(uint16_t *)(p_first_addr); - uint16_t second_addr = *(uint16_t *)(p_second_addr); - - if (first_addr < second_addr) - { - return -1; - } - else if (first_addr > second_addr) - { - return 1; - } - else - { - return 0; - } -} - -/** - * @brief Compare two addresses. - * - * @param[in] p_first_addr Pointer to a first address that should be compared. - * @param[in] p_second_addr Pointer to a second address that should be compared. - * @param[in] extended Indication if @p p_first_addr and @p p_second_addr are extended or short addresses. - * - * @retval -1 First address is less than the second address. - * @retval 0 First address is equal to the second address. - * @retval 1 First address is greater than the second address. - */ -static int8_t addr_compare(const uint8_t * p_first_addr, - const uint8_t * p_second_addr, - bool extended) -{ - if (extended) - { - return extended_addr_compare(p_first_addr, p_second_addr); - } - else - { - return short_addr_compare(p_first_addr, p_second_addr); - } -} - -/** - * @brief Perform a binary search for an address in a list of addresses. - * - * @param[in] p_addr Pointer to an address that is searched for. - * @param[in] p_addr_array Pointer to a list of addresses to be searched. - * @param[out] p_location If the address @p p_addr appears in the list, this is its index in the address list. - * Otherwise, it is the index which @p p_addr would have if it was placed in the list - * (ascending order assumed). - * @param[in] extended Indication if @p p_addr is an extended or a short addresses. - * - * @retval true Address @p p_addr is in the list. - * @retval false Address @p p_addr is not in the list. - */ -static bool addr_binary_search(const uint8_t * p_addr, - const uint8_t * p_addr_array, - uint32_t * p_location, - uint8_t data_type, - bool extended) -{ - uint32_t addr_array_len = 0; - uint8_t entry_size = 0; - - switch (data_type) - { - case NRF_802154_ACK_DATA_PENDING_BIT: - entry_size = extended ? EXTENDED_ADDRESS_SIZE : SHORT_ADDRESS_SIZE; - addr_array_len = extended ? - m_pending_bit.num_of_ext_addr : m_pending_bit.num_of_short_addr; - break; - - case NRF_802154_ACK_DATA_IE: - entry_size = extended ? sizeof(ack_ext_ie_data_t) : sizeof(ack_short_ie_data_t); - addr_array_len = extended ? m_ie.num_of_ext_data : m_ie.num_of_short_data; - break; - - default: - assert(false); - break; - } - - // The actual algorithm - int32_t low = 0; - uint32_t midpoint = 0; - int32_t high = addr_array_len; - - while (high >= low) - { - midpoint = (uint32_t)(low + (high - low) / 2); - - if (midpoint >= addr_array_len) - { - break; - } - - switch (addr_compare(p_addr, p_addr_array + entry_size * midpoint, extended)) - { - case -1: - high = (int32_t)(midpoint - 1); - break; - - case 0: - *p_location = midpoint; - return true; - - case 1: - low = (int32_t)(midpoint + 1); - break; - - default: - break; - } - } - - /* If in the last iteration of the loop the last case was utilized, it means that the midpoint - * found by the algorithm is less than the address to be added. The midpoint should be therefore - * shifted to the next position. As a simplified example, a { 1, 3, 4 } array can be considered. - * Suppose that a number equal to 2 is about to be added to the array. At the beginning of the - * last iteration, midpoint is equal to 1 and low and high are equal to 0. Midpoint is then set - * to 0 and with last case being utilized, low is set to 1. However, midpoint equal to 0 is - * incorrect, as in the last iteration first element of the array proves to be less than the - * element to be added to the array. With the below code, midpoint is then shifted to 1. */ - if ((uint32_t)low == midpoint + 1) - { - midpoint++; - } - - *p_location = midpoint; - return false; -} - -/** - * @brief Find an address in a list of addresses. - * - * @param[in] p_addr Pointer to an address that is searched for. - * @param[out] p_location If the address @p p_addr appears in the list, this is its index in the address list. - * Otherwise, it is the index which @p p_addr would have if it was placed in the list - * (ascending order assumed). - * @param[in] extended Indication if @p p_addr is an extended or a short addresses. - * - * @retval true Address @p p_addr is in the list. - * @retval false Address @p p_addr is not in the list. - */ -static bool addr_index_find(const uint8_t * p_addr, - uint32_t * p_location, - uint8_t data_type, - bool extended) -{ - uint8_t * p_addr_array; - bool valid_data_type = true; - - switch (data_type) - { - case NRF_802154_ACK_DATA_PENDING_BIT: - p_addr_array = extended ? (uint8_t *)m_pending_bit.extended_addr : - (uint8_t *)m_pending_bit.short_addr; - break; - - case NRF_802154_ACK_DATA_IE: - p_addr_array = extended ? (uint8_t *)m_ie.ext_data : (uint8_t *)m_ie.short_data; - break; - - default: - valid_data_type = false; - assert(false); - break; - } - - if (!valid_data_type) - { - return false; - } - - return addr_binary_search(p_addr, p_addr_array, p_location, data_type, extended); -} - -/** - * @brief Thread implementation of the address matching algorithm. - * - * @param[in] p_frame Pointer to the frame for which the ACK frame is being prepared. - * - * @retval true Pending bit is to be set. - * @retval false Pending bit is to be cleared. - */ -static bool addr_match_thread(const uint8_t * p_frame) -{ - bool extended; - uint32_t location; - const uint8_t * p_src_addr = nrf_802154_frame_parser_src_addr_get(p_frame, &extended); - - // The pending bit is set by default. - if (!m_pending_bit.enabled || (NULL == p_src_addr)) - { - return true; - } - - return addr_index_find(p_src_addr, &location, NRF_802154_ACK_DATA_PENDING_BIT, extended); -} - -/** - * @brief Zigbee implementation of the address matching algorithm. - * - * @param[in] p_frame Pointer to the frame for which the ACK frame is being prepared. - * - * @retval true Pending bit is to be set. - * @retval false Pending bit is to be cleared. - */ -static bool addr_match_zigbee(const uint8_t * p_frame) -{ - uint8_t frame_type; - nrf_802154_frame_parser_mhr_data_t mhr_fields; - uint32_t location; - const uint8_t * p_cmd = p_frame; - bool ret = false; - - // If ack data generator module is disabled do not perform check, return true by default. - if (!m_pending_bit.enabled) - { - return true; - } - - // Check the frame type. - frame_type = (p_frame[FRAME_TYPE_OFFSET] & FRAME_TYPE_MASK); - - // Parse the MAC header and retrieve the command type. - if (nrf_802154_frame_parser_mhr_parse(p_frame, &mhr_fields)) - { - // Note: Security header is not included in the offset. - // If security is to be used at any point, additional calculation - // in nrf_802154_frame_parser_mhr_parse needs to be implemented. - p_cmd += mhr_fields.addressing_end_offset; - } - else - { - // If invalid source or destination addressing mode is detected, assume unknown device. - // Command type cannot be checked, as addressing_end_offset value will be invalid. - return true; - } - - // Check frame type and command type. - if ((frame_type == FRAME_TYPE_COMMAND) && (*p_cmd == MAC_CMD_DATA_REQ)) - { - // Check addressing type - in long case address, pb should always be 1. - if (mhr_fields.src_addr_size == SHORT_ADDRESS_SIZE) - { - // Return true if address is not found on the m_pending_bits list. - ret = !addr_index_find(mhr_fields.p_src_addr, - &location, - NRF_802154_ACK_DATA_PENDING_BIT, - false); - } - else - { - ret = true; - } - } - - return ret; -} - -/** - * @brief Standard-compliant implementation of the address matching algorithm. - * - * Function always returns true. It is IEEE 802.15.4 compliant, as per 6.7.3. - * Higher layer should ensure empty data frame with no AR is sent afterwards. - * - * @param[in] p_frame Pointer to the frame for which the ACK frame is being prepared. - * - * @retval true Pending bit is to be set. - */ -static bool addr_match_standard_compliant(const uint8_t * p_frame) -{ - (void)p_frame; - return true; -} - -/** - * @brief Add an address to the address list in ascending order. - * - * @param[in] p_addr Pointer to the address to be added. - * @param[in] location Index of the location where @p p_addr should be added. - * @param[in] extended Indication if @p p_addr is an extended or a short addresses. - * - * @retval true Address @p p_addr has been added to the list successfully. - * @retval false Address @p p_addr could not be added to the list. - */ -static bool addr_add(const uint8_t * p_addr, uint32_t location, uint8_t data_type, bool extended) -{ - uint32_t * p_addr_array_len; - uint32_t max_addr_array_len; - uint8_t * p_addr_array; - uint8_t entry_size; - bool valid_data_type = true; - - switch (data_type) - { - case NRF_802154_ACK_DATA_PENDING_BIT: - if (extended) - { - p_addr_array = (uint8_t *)m_pending_bit.extended_addr; - max_addr_array_len = NUM_EXTENDED_ADDRESSES; - p_addr_array_len = &m_pending_bit.num_of_ext_addr; - entry_size = EXTENDED_ADDRESS_SIZE; - } - else - { - p_addr_array = (uint8_t *)m_pending_bit.short_addr; - max_addr_array_len = NUM_SHORT_ADDRESSES; - p_addr_array_len = &m_pending_bit.num_of_short_addr; - entry_size = SHORT_ADDRESS_SIZE; - } - break; - - case NRF_802154_ACK_DATA_IE: - if (extended) - { - p_addr_array = (uint8_t *)m_ie.ext_data; - max_addr_array_len = NUM_EXTENDED_ADDRESSES; - p_addr_array_len = &m_ie.num_of_ext_data; - entry_size = sizeof(ack_ext_ie_data_t); - } - else - { - p_addr_array = (uint8_t *)m_ie.short_data; - max_addr_array_len = NUM_SHORT_ADDRESSES; - p_addr_array_len = &m_ie.num_of_short_data; - entry_size = sizeof(ack_short_ie_data_t); - } - break; - - default: - valid_data_type = false; - assert(false); - break; - } - - if (!valid_data_type || (*p_addr_array_len == max_addr_array_len)) - { - return false; - } - - memmove(p_addr_array + entry_size * (location + 1), - p_addr_array + entry_size * (location), - (*p_addr_array_len - location) * entry_size); - - memcpy(p_addr_array + entry_size * location, - p_addr, - extended ? EXTENDED_ADDRESS_SIZE : SHORT_ADDRESS_SIZE); - - (*p_addr_array_len)++; - - return true; -} - -/** - * @brief Remove an address from the address list keeping it in ascending order. - * - * @param[in] location Index of the element to be removed from the list. - * @param[in] extended Indication if address to remove is an extended or a short address. - * - * @retval true Address @p p_addr has been removed from the list successfully. - * @retval false Address @p p_addr could not removed from the list. - */ -static bool addr_remove(uint32_t location, uint8_t data_type, bool extended) -{ - uint32_t * p_addr_array_len; - uint8_t * p_addr_array; - uint8_t entry_size; - bool valid_data_type = true; - - switch (data_type) - { - case NRF_802154_ACK_DATA_PENDING_BIT: - if (extended) - { - p_addr_array = (uint8_t *)m_pending_bit.extended_addr; - p_addr_array_len = &m_pending_bit.num_of_ext_addr; - entry_size = EXTENDED_ADDRESS_SIZE; - } - else - { - p_addr_array = (uint8_t *)m_pending_bit.short_addr; - p_addr_array_len = &m_pending_bit.num_of_short_addr; - entry_size = SHORT_ADDRESS_SIZE; - } - break; - - case NRF_802154_ACK_DATA_IE: - if (extended) - { - p_addr_array = (uint8_t *)m_ie.ext_data; - p_addr_array_len = &m_ie.num_of_ext_data; - entry_size = sizeof(ack_ext_ie_data_t); - } - else - { - p_addr_array = (uint8_t *)m_ie.short_data; - p_addr_array_len = &m_ie.num_of_short_data; - entry_size = sizeof(ack_short_ie_data_t); - } - break; - - default: - valid_data_type = false; - assert(false); - break; - } - - if (!valid_data_type || (*p_addr_array_len == 0)) - { - return false; - } - - memmove(p_addr_array + entry_size * location, - p_addr_array + entry_size * (location + 1), - (*p_addr_array_len - location - 1) * entry_size); - - (*p_addr_array_len)--; - - return true; -} - -static void ie_data_add(uint32_t location, bool extended, const uint8_t * p_data, uint8_t data_len) -{ - if (extended) - { - memcpy(m_ie.ext_data[location].ie_data.p_data, p_data, data_len); - m_ie.ext_data[location].ie_data.len = data_len; - } - else - { - memcpy(m_ie.short_data[location].ie_data.p_data, p_data, data_len); - m_ie.short_data[location].ie_data.len = data_len; - } -} - -/*************************************************************************************************** - * @section Public API - **************************************************************************************************/ - -void nrf_802154_ack_data_init(void) -{ - memset(&m_pending_bit, 0, sizeof(m_pending_bit)); - memset(&m_ie, 0, sizeof(m_ie)); - - m_pending_bit.enabled = true; - m_src_matching_method = NRF_802154_SRC_ADDR_MATCH_THREAD; -} - -void nrf_802154_ack_data_enable(bool enabled) -{ - m_pending_bit.enabled = enabled; -} - -bool nrf_802154_ack_data_for_addr_set(const uint8_t * p_addr, - bool extended, - uint8_t data_type, - const void * p_data, - uint8_t data_len) -{ - uint32_t location = 0; - - if (addr_index_find(p_addr, &location, data_type, extended) || - addr_add(p_addr, location, data_type, extended)) - { - if (data_type == NRF_802154_ACK_DATA_IE) - { - ie_data_add(location, extended, p_data, data_len); - } - - return true; - } - else - { - return false; - } -} - -bool nrf_802154_ack_data_for_addr_clear(const uint8_t * p_addr, bool extended, uint8_t data_type) -{ - uint32_t location = 0; - - if (addr_index_find(p_addr, &location, data_type, extended)) - { - return addr_remove(location, data_type, extended); - } - else - { - return false; - } -} - -void nrf_802154_ack_data_reset(bool extended, uint8_t data_type) -{ - switch (data_type) - { - case NRF_802154_ACK_DATA_PENDING_BIT: - if (extended) - { - m_pending_bit.num_of_ext_addr = 0; - } - else - { - m_pending_bit.num_of_short_addr = 0; - } - break; - - case NRF_802154_ACK_DATA_IE: - if (extended) - { - m_ie.num_of_ext_data = 0; - } - else - { - m_ie.num_of_short_data = 0; - } - break; - - default: - break; - } -} - -void nrf_802154_ack_data_src_addr_matching_method_set(nrf_802154_src_addr_match_t match_method) -{ - switch (match_method) - { - case NRF_802154_SRC_ADDR_MATCH_THREAD: - case NRF_802154_SRC_ADDR_MATCH_ZIGBEE: - case NRF_802154_SRC_ADDR_MATCH_ALWAYS_1: - m_src_matching_method = match_method; - break; - - default: - assert(false); - } - -} - -bool nrf_802154_ack_data_pending_bit_should_be_set(const uint8_t * p_frame) -{ - bool ret; - - switch (m_src_matching_method) - { - case NRF_802154_SRC_ADDR_MATCH_THREAD: - ret = addr_match_thread(p_frame); - break; - - case NRF_802154_SRC_ADDR_MATCH_ZIGBEE: - ret = addr_match_zigbee(p_frame); - break; - - case NRF_802154_SRC_ADDR_MATCH_ALWAYS_1: - ret = addr_match_standard_compliant(p_frame); - break; - - default: - assert(false); - ret = false; - } - - return ret; -} - -const uint8_t * nrf_802154_ack_data_ie_get(const uint8_t * p_src_addr, - bool src_addr_extended, - uint8_t * p_ie_length) -{ - uint32_t location; - - if (NULL == p_src_addr) - { - return NULL; - } - - if (addr_index_find(p_src_addr, &location, NRF_802154_ACK_DATA_IE, src_addr_extended)) - { - if (src_addr_extended) - { - *p_ie_length = m_ie.ext_data[location].ie_data.len; - return m_ie.ext_data[location].ie_data.p_data; - } - else - { - *p_ie_length = m_ie.short_data[location].ie_data.len; - return m_ie.short_data[location].ie_data.p_data; - } - } - else - { - *p_ie_length = 0; - return NULL; - } -} diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.h b/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.h deleted file mode 100644 index 355959bdc..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_data.h +++ /dev/null @@ -1,140 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains an ACK data generator for the nRF 802.15.4 radio driver. - * - * @note The current implementation supports setting pending bit and IEs in 802.15.4-2015 Enh-Ack frames. - */ - -#ifndef NRF_802154_ACK_DATA_H -#define NRF_802154_ACK_DATA_H - -#include -#include - -#include "nrf_802154_types.h" - -/** - * @brief Initializes the ACK data generator module. - */ -void nrf_802154_ack_data_init(void); - -/** - * @brief Enables or disables the ACK data generator module. - * - * @param[in] enabled True if the module is to be enabled. False otherwise. - */ -void nrf_802154_ack_data_enable(bool enabled); - -/** - * @brief Adds an address to the ACK data list. - * - * ACK frames sent in response to frames with the source address matching any address from the ACK data list - * will have the appropriate data set. If the source address does not match any of the addresses in the - * list, the ACK frame will not have the data set. - * - * @param[in] p_addr Pointer to the address that is to be added to the list. - * @param[in] extended Indication if @p p_addr is an extended address or a short address. - * @param[in] data_type Type of data to be set. Refer to the @ref nrf_802154_ack_data_t type. - * @param[in] p_data Pointer to the data to be set. - * @param[in] data_len Length of the @p p_data buffer. - * - * @retval true Address successfully added to the list. - * @retval false Address not added to the list (list is full). - */ -bool nrf_802154_ack_data_for_addr_set(const uint8_t * p_addr, - bool extended, - uint8_t data_type, - const void * p_data, - uint8_t data_len); - -/** - * @brief Removes an address from the ACK data list. - * - * ACK frames sent in response to frames with the source address matching any address from - * the ACK data list will have the appropriate data set. If the source address does not match - * any of the addresses in the list, the ACK frame will not have the data set. - * - * @param[in] p_addr Pointer to the address that is to be removed from the list. - * @param[in] extended Indication if @p p_addr is an extended address or a short address. - * @param[in] data_type Type of data that is to be cleared for @p p_addr. - * - * @retval true Address successfully removed from the list. - * @retval false Address not removed from the list (address is missing from the list). - */ -bool nrf_802154_ack_data_for_addr_clear(const uint8_t * p_addr, bool extended, uint8_t data_type); - -/** - * @brief Removes all addresses of a given length from the ACK data list. - * - * @param[in] extended Indication if all extended addresses or all short addresses are - * to be removed from the list. - * @param[in] data_type Type of data that is to be cleared for all addresses of a given length. - */ -void nrf_802154_ack_data_reset(bool extended, uint8_t data_type); - -/** - * @brief Select the source matching algorithm. - * - * @note This function is to be called after the driver initialization, but before the transceiver is enabled. - * - * When calling @ref nrf_802154_ack_data_pending_bit_should_be_set, one of several algorithms - * for source address matching will be chosen. To ensure a specific algorithm is selected, - * call this function before @ref rf_802154_ack_data_pending_bit_should_be_set. - * - * @param[in] match_method Source matching method to be used. - */ -void nrf_802154_ack_data_src_addr_matching_method_set(nrf_802154_src_addr_match_t match_method); - -/** - * @brief Checks if a pending bit is to be set in the ACK frame sent in response to a given frame. - * - * @param[in] p_frame Pointer to the frame for which the ACK frame is being prepared. - * - * @retval true Pending bit is to be set. - * @retval false Pending bit is to be cleared. - */ -bool nrf_802154_ack_data_pending_bit_should_be_set(const uint8_t * p_frame); - -/** - * @brief Gets the IE data stored in the list for the source address of the provided frame. - * - * @param[in] p_src_addr Pointer to the source address to search for in the list. - * @param[in] src_addr_ext If the source address is extended. - * @param[out] p_ie_length Length of the IE data. - * - * @returns Either pointer to the stored IE data or NULL if the IE data is not to be set. - */ -const uint8_t * nrf_802154_ack_data_ie_get(const uint8_t * p_src_addr, - bool src_addr_ext, - uint8_t * p_ie_length); - -#endif // NRF_802154_ACK_DATA_H diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.c b/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.c deleted file mode 100644 index 54545f5d3..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.c +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This module implements an acknowledgement generator for 802.15.4 radio driver. - * - */ - -#include "nrf_802154_ack_generator.h" - -#include -#include - -#include "nrf_802154_const.h" -#include "nrf_802154_enh_ack_generator.h" -#include "nrf_802154_imm_ack_generator.h" - -typedef enum -{ - FRAME_VERSION_BELOW_2015, - FRAME_VERSION_2015_OR_ABOVE, - FRAME_VERSION_INVALID -} frame_version_t; - -static frame_version_t frame_version_is_2015_or_above(const uint8_t * p_frame) -{ - switch (p_frame[FRAME_VERSION_OFFSET] & FRAME_VERSION_MASK) - { - case FRAME_VERSION_0: - case FRAME_VERSION_1: - return FRAME_VERSION_BELOW_2015; - - case FRAME_VERSION_2: - return FRAME_VERSION_2015_OR_ABOVE; - - default: - return FRAME_VERSION_INVALID; - } -} - -void nrf_802154_ack_generator_init(void) -{ - // Both generators are initialized to enable sending both Imm-Acks and Enh-Acks. - nrf_802154_imm_ack_generator_init(); - nrf_802154_enh_ack_generator_init(); -} - -uint8_t * nrf_802154_ack_generator_create(const uint8_t * p_frame) -{ - // This function should not be called if ACK is not requested. - assert(p_frame[ACK_REQUEST_OFFSET] & ACK_REQUEST_BIT); - - switch (frame_version_is_2015_or_above(p_frame)) - { - case FRAME_VERSION_BELOW_2015: - return nrf_802154_imm_ack_generator_create(p_frame); - - case FRAME_VERSION_2015_OR_ABOVE: - return nrf_802154_enh_ack_generator_create(p_frame); - - default: - return NULL; - } -} diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.h b/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.h deleted file mode 100644 index 059a19feb..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_ack_generator.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains an acknowledgement generator for the 802.15.4 radio driver. - * - */ - -#ifndef NRF_802154_ACK_GENERATOR_H -#define NRF_802154_ACK_GENERATOR_H - -#include - -/** Initializes the ACK generator module. */ -void nrf_802154_ack_generator_init(void); - -/** Creates an ACK in response to the provided frame and inserts it into a radio buffer. - * - * @param [in] p_frame Pointer to the buffer that contains PHR and PSDU of the frame - * to respond to. - * - * @returns Either pointer to a constant buffer that contains PHR and PSDU - * of the created ACK frame, or NULL in case of an invalid frame. - */ -uint8_t * nrf_802154_ack_generator_create(const uint8_t * p_frame); - -#endif // NRF_802154_ACK_GENERATOR_H diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.c b/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.c deleted file mode 100644 index c4410665a..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.c +++ /dev/null @@ -1,379 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements an enhanced acknowledgement (Enh-Ack) generator for 802.15.4 radio driver. - * - */ - -#include "nrf_802154_enh_ack_generator.h" - -#include -#include - -#include "mac_features/nrf_802154_frame_parser.h" -#include "nrf_802154_ack_data.h" -#include "nrf_802154_const.h" -#include "nrf_802154_pib.h" - -#define ENH_ACK_MAX_SIZE MAX_PACKET_SIZE - -static uint8_t m_ack_data[ENH_ACK_MAX_SIZE + PHR_SIZE]; - -static void ack_buffer_clear(void) -{ - memset(m_ack_data, 0, FCF_SIZE + PHR_SIZE); -} - -static void sequence_number_set(const uint8_t * p_frame) -{ - if (!nrf_802154_frame_parser_dsn_suppress_bit_is_set(p_frame)) - { - m_ack_data[DSN_OFFSET] = p_frame[DSN_OFFSET]; - } -} - -/*************************************************************************************************** - * @section Frame control field functions - **************************************************************************************************/ - -static void fcf_frame_type_set(void) -{ - m_ack_data[FRAME_TYPE_OFFSET] |= FRAME_TYPE_ACK; -} - -static void fcf_security_enabled_set(const uint8_t * p_frame) -{ - m_ack_data[SECURITY_ENABLED_OFFSET] |= - (p_frame[SECURITY_ENABLED_OFFSET] & SECURITY_ENABLED_BIT); -} - -static void fcf_frame_pending_set(const uint8_t * p_frame) -{ - if (nrf_802154_ack_data_pending_bit_should_be_set(p_frame)) - { - m_ack_data[FRAME_PENDING_OFFSET] |= FRAME_PENDING_BIT; - } -} - -static void fcf_panid_compression_set(const uint8_t * p_frame) -{ - if (p_frame[PAN_ID_COMPR_OFFSET] & PAN_ID_COMPR_MASK) - { - m_ack_data[PAN_ID_COMPR_OFFSET] |= PAN_ID_COMPR_MASK; - } -} - -static void fcf_sequence_number_suppression_set(const uint8_t * p_frame) -{ - if (nrf_802154_frame_parser_dsn_suppress_bit_is_set(p_frame)) - { - m_ack_data[DSN_SUPPRESS_OFFSET] |= DSN_SUPPRESS_BIT; - } -} - -static void fcf_ie_present_set(const uint8_t * p_frame, const uint8_t * p_ie_data) -{ - if (p_ie_data != NULL) - { - m_ack_data[IE_PRESENT_OFFSET] |= IE_PRESENT_BIT; - } -} - -static void fcf_dst_addressing_mode_set(const uint8_t * p_frame) -{ - if (nrf_802154_frame_parser_src_addr_is_extended(p_frame)) - { - m_ack_data[DEST_ADDR_TYPE_OFFSET] |= DEST_ADDR_TYPE_EXTENDED; - } - else if (nrf_802154_frame_parser_src_addr_is_short(p_frame)) - { - m_ack_data[DEST_ADDR_TYPE_OFFSET] |= DEST_ADDR_TYPE_SHORT; - } - else - { - m_ack_data[DEST_ADDR_TYPE_OFFSET] |= DEST_ADDR_TYPE_NONE; - } -} - -static void fcf_src_addressing_mode_set(const uint8_t * p_frame) -{ - m_ack_data[SRC_ADDR_TYPE_OFFSET] |= SRC_ADDR_TYPE_NONE; -} - -static void fcf_frame_version_set(void) -{ - m_ack_data[FRAME_VERSION_OFFSET] |= FRAME_VERSION_2; -} - -static void frame_control_set(const uint8_t * p_frame, - const uint8_t * p_ie_data, - nrf_802154_frame_parser_mhr_data_t * p_ack_offsets) -{ - bool parse_results; - - fcf_frame_type_set(); - fcf_security_enabled_set(p_frame); - fcf_frame_pending_set(p_frame); - fcf_panid_compression_set(p_frame); - fcf_sequence_number_suppression_set(p_frame); - fcf_ie_present_set(p_frame, p_ie_data); - fcf_dst_addressing_mode_set(p_frame); - fcf_frame_version_set(); - fcf_src_addressing_mode_set(p_frame); - - parse_results = nrf_802154_frame_parser_mhr_parse(m_ack_data, p_ack_offsets); - assert(parse_results); - (void)parse_results; - - m_ack_data[PHR_OFFSET] = p_ack_offsets->addressing_end_offset - PHR_SIZE + FCS_SIZE; -} - -/*************************************************************************************************** - * @section Addressing fields functions - **************************************************************************************************/ - -static void destination_set(const nrf_802154_frame_parser_mhr_data_t * p_frame, - const nrf_802154_frame_parser_mhr_data_t * p_ack) -{ - // Fill the Ack destination PAN ID field. - if (p_ack->p_dst_panid != NULL) - { - const uint8_t * p_dst_panid; - - if (p_frame->p_src_panid != NULL) - { - p_dst_panid = p_frame->p_src_panid; - } - else if (p_frame->p_dst_panid != NULL) - { - p_dst_panid = p_frame->p_dst_panid; - } - else - { - p_dst_panid = nrf_802154_pib_pan_id_get(); - } - - memcpy((uint8_t *)p_ack->p_dst_panid, p_dst_panid, PAN_ID_SIZE); - } - - // Fill the Ack destination address field. - if (p_frame->p_src_addr != NULL) - { - assert(p_ack->p_dst_addr != NULL); - assert(p_ack->dst_addr_size == p_frame->src_addr_size); - - memcpy((uint8_t *)p_ack->p_dst_addr, p_frame->p_src_addr, p_frame->src_addr_size); - } -} - -static void source_set(const uint8_t * p_frame) -{ - // Intentionally empty: source address type is None. -} - -/*************************************************************************************************** - * @section Auxiliary security header functions - **************************************************************************************************/ - -static void security_control_set(const nrf_802154_frame_parser_mhr_data_t * p_frame, - const nrf_802154_frame_parser_mhr_data_t * p_ack) -{ - assert(p_frame->p_sec_ctrl != NULL); - - // All the bits in the security control byte can be copied. - *(uint8_t *)p_ack->p_sec_ctrl = *p_frame->p_sec_ctrl; - - m_ack_data[PHR_OFFSET] += SECURITY_CONTROL_SIZE; -} - -static void security_key_id_set(const nrf_802154_frame_parser_mhr_data_t * p_frame, - const nrf_802154_frame_parser_mhr_data_t * p_ack, - bool fc_suppresed, - const uint8_t ** p_sec_end) -{ - const uint8_t * p_frame_key_id; - const uint8_t * p_ack_key_id; - uint8_t key_id_mode_size = 0; - - p_frame_key_id = p_frame->p_sec_ctrl + SECURITY_CONTROL_SIZE; - p_ack_key_id = p_ack->p_sec_ctrl + SECURITY_CONTROL_SIZE; - - if (!fc_suppresed) - { - p_frame_key_id += FRAME_COUNTER_SIZE; - p_ack_key_id += FRAME_COUNTER_SIZE; - } - - switch ((*p_ack->p_sec_ctrl) & KEY_ID_MODE_MASK) - { - case KEY_ID_MODE_1: - key_id_mode_size = KEY_ID_MODE_1_SIZE; - break; - - case KEY_ID_MODE_2: - key_id_mode_size = KEY_ID_MODE_2_SIZE; - break; - - case KEY_ID_MODE_3: - key_id_mode_size = KEY_ID_MODE_3_SIZE; - break; - - default: - break; - } - - if (0 != key_id_mode_size) - { - memcpy((uint8_t *)p_ack_key_id, p_frame_key_id, key_id_mode_size); - m_ack_data[PHR_OFFSET] += key_id_mode_size; - } - - switch (*(p_ack->p_sec_ctrl) & SECURITY_LEVEL_MASK) - { - case SECURITY_LEVEL_MIC_32: - case SECURITY_LEVEL_ENC_MIC_32: - m_ack_data[PHR_OFFSET] += MIC_32_SIZE; - break; - - case SECURITY_LEVEL_MIC_64: - case SECURITY_LEVEL_ENC_MIC_64: - m_ack_data[PHR_OFFSET] += MIC_64_SIZE; - break; - - case SECURITY_LEVEL_MIC_128: - case SECURITY_LEVEL_ENC_MIC_128: - m_ack_data[PHR_OFFSET] += MIC_128_SIZE; - break; - - default: - break; - } - - *p_sec_end = p_ack_key_id + key_id_mode_size; -} - -static void security_header_set(const nrf_802154_frame_parser_mhr_data_t * p_frame, - const nrf_802154_frame_parser_mhr_data_t * p_ack, - const uint8_t ** p_sec_end) -{ - bool fc_suppressed; - - if (p_ack->p_sec_ctrl == NULL) - { - *p_sec_end = &m_ack_data[p_ack->addressing_end_offset]; - return; - } - - security_control_set(p_frame, p_ack); - - // Frame counter is set by MAC layer when the frame is encrypted. - fc_suppressed = ((*p_ack->p_sec_ctrl) & FRAME_COUNTER_SUPPRESS_BIT); - - if (!fc_suppressed) - { - m_ack_data[PHR_OFFSET] += FRAME_COUNTER_SIZE; - } - - security_key_id_set(p_frame, p_ack, fc_suppressed, p_sec_end); -} - -/*************************************************************************************************** - * @section Information Elements - **************************************************************************************************/ - -static void ie_header_set(const uint8_t * p_ie_data, uint8_t ie_data_len, const uint8_t * p_sec_end) -{ - uint8_t * p_ack_ie = (uint8_t *)p_sec_end; - - if (p_ie_data == NULL) - { - return; - } - - assert(p_ack_ie != NULL); - - memcpy(p_ack_ie, p_ie_data, ie_data_len); - m_ack_data[PHR_OFFSET] += ie_data_len; -} - -/*************************************************************************************************** - * @section Public API implementation - **************************************************************************************************/ - -void nrf_802154_enh_ack_generator_init(void) -{ - // Intentionally empty. -} - -uint8_t * nrf_802154_enh_ack_generator_create(const uint8_t * p_frame) -{ - - nrf_802154_frame_parser_mhr_data_t frame_offsets; - nrf_802154_frame_parser_mhr_data_t ack_offsets; - const uint8_t * p_sec_end = NULL; - bool parse_result = nrf_802154_frame_parser_mhr_parse(p_frame, - &frame_offsets); - - if (!parse_result) - { - return NULL; - } - - uint8_t ie_data_len; - const uint8_t * p_ie_data = nrf_802154_ack_data_ie_get( - frame_offsets.p_src_addr, - frame_offsets.src_addr_size == EXTENDED_ADDRESS_SIZE, - &ie_data_len); - - // Clear previously created ACK. - ack_buffer_clear(); - - // Set Frame Control field bits. - frame_control_set(p_frame, p_ie_data, &ack_offsets); - - // Set valid sequence number in ACK frame. - sequence_number_set(p_frame); - - // Set destination address and PAN ID. - destination_set(&frame_offsets, &ack_offsets); - - // Set source address and PAN ID. - source_set(p_frame); - - // Set auxiliary security header. - security_header_set(&frame_offsets, &ack_offsets, &p_sec_end); - - // Set IE header. - ie_header_set(p_ie_data, ie_data_len, p_sec_end); - - return m_ack_data; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.h b/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.h deleted file mode 100644 index 91e812d11..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_enh_ack_generator.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains an enhanced acknowledgement (Enh-Ack) generator - * for the 802.15.4 radio driver. - * - */ - -#ifndef NRF_802154_ENH_ACK_GENERATOR_H -#define NRF_802154_ENH_ACK_GENERATOR_H - -#include -#include - -/** Initializes the Enhanced ACK generator module. */ -void nrf_802154_enh_ack_generator_init(void); - -/** Creates an Enhanced ACK in response to the provided frame. - * - * This function creates an Enhanced ACK frame and inserts it into a radio buffer. - * - * @param [in] p_frame Pointer to the buffer that contains PHR and PSDU of the frame - * to respond to. - * - * @returns Pointer to a constant buffer that contains PHR and PSDU - * of the created Enhanced ACK frame. - */ -uint8_t * nrf_802154_enh_ack_generator_create(const uint8_t * p_frame); - -#endif // NRF_802154_ENH_ACK_GENERATOR_H diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.c b/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.c deleted file mode 100644 index bc2605022..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.c +++ /dev/null @@ -1,72 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements an immediate acknowledgement (Imm-Ack) generator for 802.15.4 radio driver. - * - */ - -#include "nrf_802154_imm_ack_generator.h" - -#include -#include - -#include "nrf_802154_ack_data.h" -#include "nrf_802154_const.h" - -#define IMM_ACK_INITIALIZER {0x05, ACK_HEADER_WITH_PENDING, 0x00, 0x00, 0x00, 0x00} - -static uint8_t m_ack_data[IMM_ACK_LENGTH + PHR_SIZE]; - -void nrf_802154_imm_ack_generator_init(void) -{ - const uint8_t ack_data[] = IMM_ACK_INITIALIZER; - - memcpy(m_ack_data, ack_data, sizeof(ack_data)); -} - -uint8_t * nrf_802154_imm_ack_generator_create(const uint8_t * p_frame) -{ - // Set valid sequence number in ACK frame. - m_ack_data[DSN_OFFSET] = p_frame[DSN_OFFSET]; - - // Set pending bit in ACK frame. - if (nrf_802154_ack_data_pending_bit_should_be_set(p_frame)) - { - m_ack_data[FRAME_PENDING_OFFSET] = ACK_HEADER_WITH_PENDING; - } - else - { - m_ack_data[FRAME_PENDING_OFFSET] = ACK_HEADER_WITHOUT_PENDING; - } - - return m_ack_data; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.h b/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.h deleted file mode 100644 index db6be61eb..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/ack_generator/nrf_802154_imm_ack_generator.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains an immediate acknowledgement (Imm-Ack) generator - * for the 802.15.4 radio driver. - * - */ - -#ifndef NRF_802154_IMM_ACK_GENERATOR_H -#define NRF_802154_IMM_ACK_GENERATOR_H - -#include -#include - -/** Initializes the Immediate ACK generator module. */ -void nrf_802154_imm_ack_generator_init(void); - -/** Creates an Immediate ACK in response to the provided frame. - * - * This function creates an Immediate ACK frame and inserts it into a radio buffer. - * - * @param [in] p_frame Pointer to the buffer that contains PHR and PSDU of the frame - * to respond to. - * - * @returns Pointer to a constant buffer that contains PHR and PSDU of the created - * Immediate ACK frame. - */ -uint8_t * nrf_802154_imm_ack_generator_create(const uint8_t * p_frame); - -#endif // NRF_802154_IMM_ACK_GENERATOR_H diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.c b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.c deleted file mode 100644 index 90ac9a595..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.c +++ /dev/null @@ -1,173 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements ACK timeout procedure for the 802.15.4 driver. - * - */ - -#include "nrf_802154_ack_timeout.h" - -#include -#include -#include - -#include "../nrf_802154_debug.h" -#include "nrf_802154_notification.h" -#include "nrf_802154_request.h" -#include "timer_scheduler/nrf_802154_timer_sched.h" - -#define RETRY_DELAY 500 ///< Procedure is delayed by this time if cannot be performed at the moment. -#define MAX_RETRY_DELAY 1000000 ///< Maximal allowed delay of procedure retry. - -static void timeout_timer_retry(void); - -static uint32_t m_timeout = NRF_802154_ACK_TIMEOUT_DEFAULT_TIMEOUT; ///< ACK timeout in us. -static nrf_802154_timer_t m_timer; ///< Timer used to notify when we are waiting too long for ACK. -static volatile bool m_procedure_is_active; -static const uint8_t * mp_frame; - -static void notify_tx_error(bool result) -{ - if (result) - { - nrf_802154_notify_transmit_failed(mp_frame, NRF_802154_TX_ERROR_NO_ACK); - } -} - -static void timeout_timer_fired(void * p_context) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_ACK_TIMEOUT_FIRED); - - (void)p_context; - - if (m_procedure_is_active) - { - if (nrf_802154_request_receive(NRF_802154_TERM_802154, - REQ_ORIG_ACK_TIMEOUT, - notify_tx_error, - false)) - { - m_procedure_is_active = false; - } - else - { - timeout_timer_retry(); - } - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_ACK_TIMEOUT_FIRED); -} - -static void timeout_timer_retry(void) -{ - m_timer.dt += RETRY_DELAY; - assert(m_timer.dt <= MAX_RETRY_DELAY); - - nrf_802154_timer_sched_add(&m_timer, true); -} - -static void timeout_timer_start(void) -{ - m_timer.callback = timeout_timer_fired; - m_timer.p_context = NULL; - m_timer.t0 = nrf_802154_timer_sched_time_get(); - m_timer.dt = m_timeout; - - m_procedure_is_active = true; - - nrf_802154_timer_sched_add(&m_timer, true); -} - -static void timeout_timer_stop(void) -{ - m_procedure_is_active = false; - - // To make sure `timeout_timer_fired()` detects that procedure is being stopped if it preempts - // this function. - __DMB(); - - nrf_802154_timer_sched_remove(&m_timer); -} - -void nrf_802154_ack_timeout_time_set(uint32_t time) -{ - m_timeout = time; -} - -bool nrf_802154_ack_timeout_tx_started_hook(const uint8_t * p_frame) -{ - mp_frame = p_frame; - timeout_timer_start(); - - return true; -} - -bool nrf_802154_ack_timeout_abort(nrf_802154_term_t term_lvl, req_originator_t req_orig) -{ - bool result; - - if (!m_procedure_is_active || req_orig == REQ_ORIG_ACK_TIMEOUT) - { - // Ignore if procedure is not running or self-request. - result = true; - } - else if (term_lvl >= NRF_802154_TERM_802154) - { - // Stop procedure only if termination level is high enough. - timeout_timer_stop(); - - result = true; - } - else - { - result = false; - } - - return result; -} - -void nrf_802154_ack_timeout_transmitted_hook(const uint8_t * p_frame) -{ - assert((p_frame == mp_frame) || (!m_procedure_is_active)); - - timeout_timer_stop(); -} - -bool nrf_802154_ack_timeout_tx_failed_hook(const uint8_t * p_frame, nrf_802154_tx_error_t error) -{ - (void)error; - assert((p_frame == mp_frame) || (!m_procedure_is_active)); - - timeout_timer_stop(); - - return true; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.h b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.h deleted file mode 100644 index 51a627de7..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_ack_timeout.h +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_ACK_TIMEOUT_H__ -#define NRF_802154_ACK_TIMEOUT_H__ - -#include -#include - -#include "nrf_802154_const.h" -#include "nrf_802154_types.h" - -/** - * @defgroup nrf_802154_csma_ca 802.15.4 driver ACK timeout support - * @{ - * @ingroup nrf_802154 - * @brief ACK timeout feature. - */ - -/** - * @brief Sets the timeout time for the ACK timeout feature. - * - * @param[in] time Timeout time in microseconds. - * The default value is defined in nrf_802154_config.h. - */ -void nrf_802154_ack_timeout_time_set(uint32_t time); - -/** - * @brief Aborts a started ACK timeout procedure. - * - * @param[in] term_lvl Termination level set by the request for aborting the ongoing operation. - * @param[in] req_orig Module that originates the abort request. - * - * If the ACK timeout procedure is not running during the call, this function does nothing. - * - * @retval true ACK timeout procedure han been stopped. - */ -bool nrf_802154_ack_timeout_abort(nrf_802154_term_t term_lvl, req_originator_t req_orig); - -/** - * @brief Handles a transmitted event. - * - * @param[in] p_frame Pointer to the buffer that contains the transmitted frame. - */ -void nrf_802154_ack_timeout_transmitted_hook(const uint8_t * p_frame); - -/** - * @brief Handles a TX failed event. - * - * @param[in] p_frame Pointer to the buffer that contains a frame that was not transmitted. - * @param[in] error Cause of failed transmission. - * - * @retval true TX failed event is to be propagated to the MAC layer. - * @retval false TX failed event is not to be propagated to the MAC layer. It is handled - * internally in the ACK timeout module. - */ -bool nrf_802154_ack_timeout_tx_failed_hook(const uint8_t * p_frame, nrf_802154_tx_error_t error); - -/** - * @brief Handles a TX started event. - * - * @param[in] p_frame Pointer to the buffer that contains a frame being transmitted. - * - * @retval true TX started event is to be propagated to the MAC layer. - * @retval false TX started event is not to be propagated to the MAC layer. It is handled - * internally in the ACK timeout module. - */ -bool nrf_802154_ack_timeout_tx_started_hook(const uint8_t * p_frame); - -/** - * @brief Handles a RX ACK started event. - * - */ -void nrf_802154_ack_timeout_rx_ack_started_hook(void); - -/** - *@} - **/ - -#endif // NRF_802154_CSMA_CA_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.c b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.c deleted file mode 100644 index d8a55841a..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.c +++ /dev/null @@ -1,258 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements CSMA-CA procedure for the 802.15.4 driver. - * - */ - -#include "nrf_802154_csma_ca.h" - -#include -#include -#include -#include - -#include "nrf_802154_config.h" -#include "nrf_802154_const.h" -#include "../nrf_802154_debug.h" -#include "nrf_802154_notification.h" -#include "nrf_802154_request.h" -#include "platform/random/nrf_802154_random.h" -#include "timer_scheduler/nrf_802154_timer_sched.h" - -#if NRF_802154_CSMA_CA_ENABLED - -static uint8_t m_nb; ///< The number of times the CSMA-CA algorithm was required to back off while attempting the current transmission. -static uint8_t m_be; ///< Backoff exponent, which is related to how many backoff periods a device shall wait before attempting to assess a channel. - -static const uint8_t * mp_data; ///< Pointer to a buffer containing PHR and PSDU of the frame being transmitted. -static nrf_802154_timer_t m_timer; ///< Timer used to back off during CSMA-CA procedure. -static bool m_is_running; ///< Indicates if CSMA-CA procedure is running. - -/** - * @brief Perform appropriate actions for busy channel conditions. - * - * According to CSMA-CA description in 802.15.4 specification, when channel is busy NB and BE shall - * be incremented and the device shall wait random delay before next CCA procedure. If NB reaches - * macMaxCsmaBackoffs procedure fails. - * - * @retval true Procedure failed and TX failure should be notified to the next higher layer. - * @retval false Procedure is still ongoing and TX failure should be handled internally. - */ -static bool channel_busy(void); - -/** - * @brief Check if CSMA-CA is ongoing. - * - * @retval true CSMA-CA is running. - * @retval false CSMA-CA is not running currently. - */ -static bool procedure_is_running(void) -{ - return m_is_running; -} - -/** - * @brief Stop CSMA-CA procedure. - */ -static void procedure_stop(void) -{ - m_is_running = false; -} - -/** - * Notify MAC layer that channel is busy if tx request failed and there are no retries left. - * - * @param[in] result Result of TX request. - */ -static void notify_busy_channel(bool result) -{ - if (!result && (m_nb >= (NRF_802154_CSMA_CA_MAX_CSMA_BACKOFFS - 1))) - { - nrf_802154_notify_transmit_failed(mp_data, NRF_802154_TX_ERROR_BUSY_CHANNEL); - } -} - -/** - * @brief Perform CCA procedure followed by frame transmission. - * - * If transmission is requested, CSMA-CA module waits for notification from the FSM module. - * If transmission request fails, CSMA-CA module performs procedure for busy channel condition - * @sa channel_busy(). - * - * @param[in] p_context Unused variable passed from the Timer Scheduler module. - */ -static void frame_transmit(void * p_context) -{ - (void)p_context; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CSMA_FRAME_TRANSMIT); - - if (procedure_is_running()) - { - if (!nrf_802154_request_transmit(NRF_802154_TERM_NONE, - REQ_ORIG_CSMA_CA, - mp_data, - true, - NRF_802154_CSMA_CA_WAIT_FOR_TIMESLOT ? false : true, - notify_busy_channel)) - { - (void)channel_busy(); - } - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CSMA_FRAME_TRANSMIT); -} - -/** - * @brief Delay CCA procedure for random (2^BE - 1) unit backoff periods. - */ -static void random_backoff_start(void) -{ - uint8_t backoff_periods = nrf_802154_random_get() % (1 << m_be); - - m_timer.callback = frame_transmit; - m_timer.p_context = NULL; - m_timer.t0 = nrf_802154_timer_sched_time_get(); - m_timer.dt = backoff_periods * UNIT_BACKOFF_PERIOD; - - nrf_802154_timer_sched_add(&m_timer, false); -} - -static bool channel_busy(void) -{ - bool result = true; - - if (procedure_is_running()) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CSMA_CHANNEL_BUSY); - - m_nb++; - - if (m_be < NRF_802154_CSMA_CA_MAX_BE) - { - m_be++; - } - - if (m_nb < NRF_802154_CSMA_CA_MAX_CSMA_BACKOFFS) - { - random_backoff_start(); - result = false; - } - else - { - procedure_stop(); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CSMA_CHANNEL_BUSY); - } - - return result; -} - -void nrf_802154_csma_ca_start(const uint8_t * p_data) -{ - assert(!procedure_is_running()); - - mp_data = p_data; - m_nb = 0; - m_be = NRF_802154_CSMA_CA_MIN_BE; - m_is_running = true; - - random_backoff_start(); -} - -bool nrf_802154_csma_ca_abort(nrf_802154_term_t term_lvl, req_originator_t req_orig) -{ - bool result = false; - - // Stop CSMA-CA only if request by the core or the higher layer. - if ((req_orig != REQ_ORIG_CORE) && (req_orig != REQ_ORIG_HIGHER_LAYER)) - { - return true; - } - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CSMA_ABORT); - - if (term_lvl >= NRF_802154_TERM_802154) - { - // Stop CSMA-CA if termination level is high enough. - nrf_802154_timer_sched_remove(&m_timer, NULL); - procedure_stop(); - - result = true; - } - else if (!procedure_is_running()) - { - // Return success in case procedure is already stopped. - result = true; - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CSMA_ABORT); - - return result; -} - -bool nrf_802154_csma_ca_tx_failed_hook(const uint8_t * p_frame, nrf_802154_tx_error_t error) -{ - (void)error; - - bool result = true; - - if (p_frame == mp_data) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CSMA_TX_FAILED); - - result = channel_busy(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CSMA_TX_FAILED); - } - - return result; -} - -bool nrf_802154_csma_ca_tx_started_hook(const uint8_t * p_frame) -{ - if (p_frame == mp_data) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CSMA_TX_STARTED); - - assert(!nrf_802154_timer_sched_is_running(&m_timer)); - procedure_stop(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CSMA_TX_STARTED); - } - - return true; -} - -#endif // NRF_802154_CSMA_CA_ENABLED diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.h b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.h deleted file mode 100644 index 58df07c96..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_csma_ca.h +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_CSMA_CA_H__ -#define NRF_802154_CSMA_CA_H__ - -#include -#include - -#include "nrf_802154_const.h" -#include "nrf_802154_types.h" - -/** - * @defgroup nrf_802154_csma_ca 802.15.4 driver CSMA-CA support - * @{ - * @ingroup nrf_802154 - * @brief CSMA-CA procedure. - */ - -/** - * @brief Starts the CSMA-CA procedure for the transmission of a given frame. - * - * If the CSMA-CA procedure is successful and the frame is transmitted, - * the @ref nrf_802154_tx_started() function is called. If the procedure failed and the frame - * cannot be transmitted due to busy channel, the @ref nrf_802154_transmit_failed() function - * is called. - * - * @note CSMA-CA does not time out automatically when waiting for ACK. Waiting for ACK must be - * timed out by the next layer. The ACK timeout timer must start when - * the @ref nrf_802154_tx_started() function is called. - * - * @param[in] p_data Pointer to a buffer the contains PHR and PSDU of the frame - * that is to be transmitted. - */ -void nrf_802154_csma_ca_start(const uint8_t * p_data); - -/** - * @brief Aborts the ongoing CSMA-CA procedure. - * - * @note Do not call this function during the execution of @ref nrf_802154_csma_ca_start - * (from ISR with higher priority), as it will result in an unrecoverable runtime error. - * - * If CSMA-CA is not running during the call, this function does nothing and returns true. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] req_orig Module that originates this request. - - * @retval true CSMA-CA procedure is not running anymore. - * @retval false CSMA-CA cannot be stopped because of a too low termination level. - */ -bool nrf_802154_csma_ca_abort(nrf_802154_term_t term_lvl, req_originator_t req_orig); - -/** - * @brief Handles a TX failed event. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame - * that was not transmitted. - * @param[in] error Cause of failed transmission. - * - * @retval true TX failed event is to be propagated to the MAC layer. - * @retval false TX failed event is not to be propagated to the MAC layer. It is handled - * internally in the CSMA-CA module. - */ -bool nrf_802154_csma_ca_tx_failed_hook(const uint8_t * p_frame, nrf_802154_tx_error_t error); - -/** - * @brief Handles a TX started event. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame - * that is being transmitted. - * - * @retval true TX started event is to be propagated to the MAC layer. - * @retval false TX started event is not to be propagated to the MAC layer. It is handled - * internally in the CSMA-CA module. - */ -bool nrf_802154_csma_ca_tx_started_hook(const uint8_t * p_frame); - -/** - *@} - **/ - -#endif // NRF_802154_CSMA_CA_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_delayed_trx.c b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_delayed_trx.c deleted file mode 100644 index 566d09ace..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_delayed_trx.c +++ /dev/null @@ -1,539 +0,0 @@ -/* Copyright (c) 2018 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements delayed transmission and reception features. - * - */ - -#include "nrf_802154_delayed_trx.h" - -#include -#include -#include - -#include "../nrf_802154_debug.h" -#include "nrf_802154_config.h" -#include "nrf_802154_const.h" -#include "nrf_802154_frame_parser.h" -#include "nrf_802154_notification.h" -#include "nrf_802154_pib.h" -#include "nrf_802154_procedures_duration.h" -#include "nrf_802154_request.h" -#include "rsch/nrf_802154_rsch.h" -#include "timer_scheduler/nrf_802154_timer_sched.h" - -/* The following time is the sum of 70us RTC_IRQHandler processing time, 40us of time that elapses - * from the moment a board starts transmission to the moment other boards (e.g. sniffer) are able - * to detect that frame and in case of TX - 50us that accounts for a delay of yet unknown origin. - */ -#define TX_SETUP_TIME 160u ///< Time needed to prepare TX procedure [us]. It does not include TX ramp-up time. -#define RX_SETUP_TIME 110u ///< Time needed to prepare RX procedure [us]. It does not include RX ramp-up time. - -/** - * @brief States of delayed operations. - */ -typedef enum -{ - DELAYED_TRX_OP_STATE_STOPPED, ///< Delayed operation stopped. - DELAYED_TRX_OP_STATE_PENDING, ///< Delayed operation scheduled and waiting for timeslot. - DELAYED_TRX_OP_STATE_ONGOING, ///< Delayed operation ongoing (during timeslot). - DELAYED_TRX_OP_STATE_NB ///< Number of delayed operation states. -} delayed_trx_op_state_t; - -/** - * @brief RX delayed operation frame data. - */ -typedef struct -{ - uint32_t sof_timestamp; ///< Timestamp of last start of frame notification received in RX window. - uint8_t psdu_length; ///< Length in bytes of the frame to be received in RX window. - bool ack_requested; ///< Flag indicating if Ack for the frame to be received in RX window is requested. -} delayed_rx_frame_data_t; - -/** - * @brief TX delayed operation configuration. - */ -static const uint8_t * mp_tx_data; ///< Pointer to a buffer containing PHR and PSDU of the frame requested to be transmitted. -static bool m_tx_cca; ///< If CCA should be performed prior to transmission. -static uint8_t m_tx_channel; ///< Channel number on which transmission should be performed. - -/** - * @brief RX delayed operation configuration. - */ -static nrf_802154_timer_t m_timeout_timer; ///< Timer for delayed RX timeout handling. -static uint8_t m_rx_channel; ///< Channel number on which reception should be performed. - -/** - * @brief State of delayed operations. - */ -static volatile delayed_trx_op_state_t m_dly_op_state[RSCH_DLY_TS_NUM]; - -/** - * @brief RX delayed operation frame data. - */ -static volatile delayed_rx_frame_data_t m_dly_rx_frame; - -/** - * Set state of a delayed operation. - * - * @param[in] expected_dly_rx_state Delayed RX current expected state. - * @param[in] new_dly_rx_state Delayed RX new state to be set. - * - * @retval true Successfully set the new state. - * @retval false Failed to set the new state. - */ -static bool dly_rx_state_set(delayed_trx_op_state_t expected_dly_rx_state, - delayed_trx_op_state_t new_dly_rx_state) -{ - volatile delayed_trx_op_state_t current_dly_rx_state; - - do - { - current_dly_rx_state = - (delayed_trx_op_state_t)__LDREXB((uint8_t *)&m_dly_op_state[RSCH_DLY_RX]); - - if (current_dly_rx_state != expected_dly_rx_state) - { - __CLREX(); - return false; - } - - } - while (__STREXB((uint8_t)new_dly_rx_state, (uint8_t *)&m_dly_op_state[RSCH_DLY_RX])); - - __DMB(); - - return true; -} - -/** - * Get state of a delayed operation. - * - * @param[in] dly_ts_id Delayed timeslot ID. - * - * @retval State of delayed operation. - */ -static delayed_trx_op_state_t dly_op_state_get(rsch_dly_ts_id_t dly_ts_id) -{ - assert(dly_ts_id < RSCH_DLY_TS_NUM); - - return m_dly_op_state[dly_ts_id]; -} - -/** - * Set state of a delayed operation. - * - * @param[in] dly_ts_id Delayed timeslot ID. - * @param[in] expected_state Expected delayed operation state prior state transition. - * @param[in] new_state Delayed operation state to enter. - */ -static void dly_op_state_set(rsch_dly_ts_id_t dly_ts_id, - delayed_trx_op_state_t expected_state, - delayed_trx_op_state_t new_state) -{ - assert(new_state < DELAYED_TRX_OP_STATE_NB); - - switch (dly_ts_id) - { - case RSCH_DLY_TX: - { - assert(m_dly_op_state[RSCH_DLY_TX] == expected_state); - m_dly_op_state[RSCH_DLY_TX] = new_state; - break; - } - - case RSCH_DLY_RX: - { - bool result = dly_rx_state_set(expected_state, new_state); - - assert(result); - (void)result; - break; - } - - default: - { - assert(false); - break; - } - } -} - -/** - * Start delayed operation. - * - * @param[in] t0 Base time of the timestamp of the timeslot start [us]. - * @param[in] dt Time delta between @p t0 and the timestamp of the timeslot start [us]. - * @param[in] length Requested radio timeslot length [us]. - * @param[in] dly_ts Delayed timeslot ID. - */ -static bool dly_op_request(uint32_t t0, - uint32_t dt, - uint32_t length, - rsch_dly_ts_id_t dly_ts_id) -{ - bool result; - - // Set PENDING state before timeslot request, in case timeslot starts - // immediatly and interrupts current function execution. - dly_op_state_set(dly_ts_id, DELAYED_TRX_OP_STATE_STOPPED, DELAYED_TRX_OP_STATE_PENDING); - - result = nrf_802154_rsch_delayed_timeslot_request(t0, - dt, - length, - RSCH_PRIO_MAX, - dly_ts_id); - - if (!result) - { - dly_op_state_set(dly_ts_id, DELAYED_TRX_OP_STATE_PENDING, DELAYED_TRX_OP_STATE_STOPPED); - } - - return result; -} - -/** - * Notify MAC layer that no frame was received before timeout. - * - * @param[in] p_context Not used. - */ -static void notify_rx_timeout(void * p_context) -{ - (void)p_context; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_DTRX_RX_TIMEOUT); - - assert(dly_op_state_get(RSCH_DLY_RX) != DELAYED_TRX_OP_STATE_PENDING); - - if (dly_op_state_get(RSCH_DLY_RX) == DELAYED_TRX_OP_STATE_ONGOING) - { - uint32_t now = nrf_802154_timer_sched_time_get(); - uint32_t sof_timestamp = m_dly_rx_frame.sof_timestamp; - - // Make sure that the timestamp has been latched safely. If frame reception preempts the code - // after executing this line, the RX window will not be extended. - __DMB(); - uint8_t psdu_length = m_dly_rx_frame.psdu_length; - bool ack_requested = m_dly_rx_frame.ack_requested; - uint32_t frame_length = nrf_802154_rx_duration_get(psdu_length, ack_requested); - - if (nrf_802154_timer_sched_time_is_in_future(now, sof_timestamp, frame_length)) - { - // @TODO protect against infinite extensions - allow only one timer extension - m_timeout_timer.t0 = sof_timestamp; - m_timeout_timer.dt = frame_length; - - nrf_802154_timer_sched_add(&m_timeout_timer, true); - } - else - { - if (dly_rx_state_set(DELAYED_TRX_OP_STATE_ONGOING, DELAYED_TRX_OP_STATE_STOPPED)) - { - nrf_802154_notify_receive_failed(NRF_802154_RX_ERROR_DELAYED_TIMEOUT); - } - - // even if the set operation failed, the delayed RX state - // should be set to STOPPED from other context anyway - assert(dly_op_state_get(RSCH_DLY_RX) == DELAYED_TRX_OP_STATE_STOPPED); - } - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_DTRX_RX_TIMEOUT); -} - -/** - * Transmit request result callback. - * - * @param[in] result Result of TX request. - */ -static void tx_timeslot_started_callback(bool result) -{ - (void)result; - - // To avoid attaching to every possible transmit hook, in order to be able - // to switch from ONGOING to STOPPED state, ONGOING state is not used at all - // and state is changed to STOPPED right after transmit request. - m_dly_op_state[RSCH_DLY_TX] = DELAYED_TRX_OP_STATE_STOPPED; - - if (!result) - { - nrf_802154_notify_transmit_failed(mp_tx_data, NRF_802154_TX_ERROR_TIMESLOT_DENIED); - } -} - -/** - * Receive request result callback. - * - * @param[in] result Result of RX request. - */ -static void rx_timeslot_started_callback(bool result) -{ - if (result) - { - uint32_t now; - - dly_op_state_set(RSCH_DLY_RX, DELAYED_TRX_OP_STATE_PENDING, DELAYED_TRX_OP_STATE_ONGOING); - - now = nrf_802154_timer_sched_time_get(); - - m_timeout_timer.t0 = now; - m_dly_rx_frame.sof_timestamp = now; - m_dly_rx_frame.psdu_length = 0; - m_dly_rx_frame.ack_requested = false; - - nrf_802154_timer_sched_add(&m_timeout_timer, true); - } - else - { - dly_op_state_set(RSCH_DLY_RX, DELAYED_TRX_OP_STATE_PENDING, DELAYED_TRX_OP_STATE_STOPPED); - - nrf_802154_notify_receive_failed(NRF_802154_RX_ERROR_DELAYED_TIMESLOT_DENIED); - } -} - -/** - * Handle TX timeslot start. - */ -static void tx_timeslot_started_callout(void) -{ - bool result; - - nrf_802154_pib_channel_set(m_tx_channel); - result = nrf_802154_request_channel_update(); - - if (result) - { - (void)nrf_802154_request_transmit(NRF_802154_TERM_802154, - REQ_ORIG_DELAYED_TRX, - mp_tx_data, - m_tx_cca, - true, - tx_timeslot_started_callback); - } - else - { - tx_timeslot_started_callback(result); - } -} - -/** - * Handle RX timeslot start. - */ -static void rx_timeslot_started_callout(void) -{ - bool result; - - nrf_802154_pib_channel_set(m_rx_channel); - result = nrf_802154_request_channel_update(); - - if (result) - { - (void)nrf_802154_request_receive(NRF_802154_TERM_802154, - REQ_ORIG_DELAYED_TRX, - rx_timeslot_started_callback, - true); - } - else - { - rx_timeslot_started_callback(result); - } -} - -bool nrf_802154_delayed_trx_transmit(const uint8_t * p_data, - bool cca, - uint32_t t0, - uint32_t dt, - uint8_t channel) -{ - bool result; - uint16_t timeslot_length; - bool ack; - - result = dly_op_state_get(RSCH_DLY_TX) == DELAYED_TRX_OP_STATE_STOPPED; - - if (result) - { - dt -= TX_SETUP_TIME; - dt -= TX_RAMP_UP_TIME; - - if (cca) - { - dt -= nrf_802154_cca_before_tx_duration_get(); - } - - ack = p_data[ACK_REQUEST_OFFSET] & ACK_REQUEST_BIT; - timeslot_length = nrf_802154_tx_duration_get(p_data[0], cca, ack); - - mp_tx_data = p_data; - m_tx_cca = cca; - m_tx_channel = channel; - - result = dly_op_request(t0, dt, timeslot_length, RSCH_DLY_TX); - } - - return result; -} - -bool nrf_802154_delayed_trx_receive(uint32_t t0, - uint32_t dt, - uint32_t timeout, - uint8_t channel) -{ - bool result; - uint16_t timeslot_length; - - result = dly_op_state_get(RSCH_DLY_RX) == DELAYED_TRX_OP_STATE_STOPPED; - - if (result) - { - - dt -= RX_SETUP_TIME; - dt -= RX_RAMP_UP_TIME; - - timeslot_length = timeout + nrf_802154_rx_duration_get(MAX_PACKET_SIZE, true); - - m_timeout_timer.dt = timeout + RX_RAMP_UP_TIME; - m_timeout_timer.callback = notify_rx_timeout; - m_timeout_timer.p_context = NULL; - - m_rx_channel = channel; - - // remove timer in case it was left after abort operation - nrf_802154_timer_sched_remove(&m_timeout_timer, NULL); - - result = dly_op_request(t0, dt, timeslot_length, RSCH_DLY_RX); - } - - return result; -} - -static inline void timeslot_started_callout(rsch_dly_ts_id_t dly_ts_id) -{ - switch (dly_ts_id) - { - case RSCH_DLY_TX: - tx_timeslot_started_callout(); - break; - - case RSCH_DLY_RX: - rx_timeslot_started_callout(); - break; - - default: - assert(false); - break; - } -} - -void nrf_802154_rsch_delayed_timeslot_started(rsch_dly_ts_id_t dly_ts_id) -{ - switch (dly_op_state_get(dly_ts_id)) - { - case DELAYED_TRX_OP_STATE_PENDING: - timeslot_started_callout(dly_ts_id); - break; - - case DELAYED_TRX_OP_STATE_STOPPED: - /* Intentionally do nothing */ - break; - - default: - assert(false); - } -} - -bool nrf_802154_delayed_trx_transmit_cancel(void) -{ - bool result; - - result = nrf_802154_rsch_delayed_timeslot_cancel(RSCH_DLY_TX); - m_dly_op_state[RSCH_DLY_TX] = DELAYED_TRX_OP_STATE_STOPPED; - - return result; -} - -bool nrf_802154_delayed_trx_receive_cancel(void) -{ - bool result; - - result = nrf_802154_rsch_delayed_timeslot_cancel(RSCH_DLY_RX); - - bool was_running; - - nrf_802154_timer_sched_remove(&m_timeout_timer, &was_running); - - m_dly_op_state[RSCH_DLY_RX] = DELAYED_TRX_OP_STATE_STOPPED; - - result = result || was_running; - - return result; -} - -bool nrf_802154_delayed_trx_abort(nrf_802154_term_t term_lvl, req_originator_t req_orig) -{ - bool result = true; - - if (req_orig == REQ_ORIG_DELAYED_TRX) - { - // Ignore if self-request. - } - else if (dly_op_state_get(RSCH_DLY_RX) == DELAYED_TRX_OP_STATE_ONGOING) - { - if (term_lvl >= NRF_802154_TERM_802154) - { - if (dly_rx_state_set(DELAYED_TRX_OP_STATE_ONGOING, DELAYED_TRX_OP_STATE_STOPPED)) - { - nrf_802154_notify_receive_failed(NRF_802154_RX_ERROR_DELAYED_ABORTED); - } - - // even if the set operation failed, the delayed RX state - // should be set to STOPPED from other context anyway - assert(dly_op_state_get(RSCH_DLY_RX) == DELAYED_TRX_OP_STATE_STOPPED); - } - else - { - result = false; - } - } - - return result; -} - -void nrf_802154_delayed_trx_rx_started_hook(const uint8_t * p_frame) -{ - if (dly_op_state_get(RSCH_DLY_RX) == DELAYED_TRX_OP_STATE_ONGOING) - { - m_dly_rx_frame.sof_timestamp = nrf_802154_timer_sched_time_get(); - m_dly_rx_frame.psdu_length = p_frame[PHR_OFFSET]; - m_dly_rx_frame.ack_requested = nrf_802154_frame_parser_ar_bit_is_set(p_frame); - } -} diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_delayed_trx.h b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_delayed_trx.h deleted file mode 100644 index 45d94fe02..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_delayed_trx.h +++ /dev/null @@ -1,147 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_DELAYED_TRX_H__ -#define NRF_802154_DELAYED_TRX_H__ - -#include -#include - -#include "nrf_802154_const.h" -#include "nrf_802154_types.h" - -/** - * @defgroup nrf_802154_delayed_trx Delayed transmission and reception window features - * @{ - * @ingroup nrf_802154 - * @brief Delayed transmission or receive window. - * - * This module implements delayed transmission and receive window features used in the CSL and TSCH - * modes. - */ - -/** - * @brief Requests transmission of a frame at a given time. - * - * If the requested transmission is successful and the frame is transmitted, the - * @ref nrf_802154_tx_started function is called. If the requested frame cannot be transmitted - * at the given time, the @ref nrf_802154_transmit_failed function is called. - * - * @note The delayed transmission does not time out automatically when waiting for ACK. - * Waiting for ACK must be timed out by the next higher layer or the ACK timeout module. - * The ACK timeout timer must start when the @ref nrf_802154_tx_started function is called. - * - * @param[in] p_data Pointer to a buffer containing PHR and PSDU of the frame to be transmitted. - * @param[in] cca If the driver is to perform the CCA procedure before the transmission. - * @param[in] t0 Base of delay time in microseconds. - * @param[in] dt Delta of the delay time from @p t0 in microseconds. - * @param[in] channel Number of the channel on which the frame is to be transmitted. - */ -bool nrf_802154_delayed_trx_transmit(const uint8_t * p_data, - bool cca, - uint32_t t0, - uint32_t dt, - uint8_t channel); - -/** - * @brief Cancels a transmission scheduled by a call to @ref nrf_802154_delayed_trx_transmit. - * - * This function does not cancel transmission if the transmission is already ongoing. - * - * @retval true Successfully cancelled a scheduled transmission. - * @retval false No delayed transmission was scheduled. - */ -bool nrf_802154_delayed_trx_transmit_cancel(void); - -/** - *@} - **/ - -/** - * @brief Requests the reception of a frame at a given time. - * - * If the request is accepted and a frame is received during the defined time slot, - * the @ref nrf_802154_received function is called. If the request is rejected due - * to a denied timeslot request or the reception timeout expires, - * the @ref nrf_802154_receive_failed function is called. - * - * @param[in] t0 Base of delay time in microseconds. - * @param[in] dt Delta of delay time from @p t0 in microseconds. - * @param[in] timeout Reception timeout (counted from @p t0 + @p dt) in microseconds. - * @param[in] channel Number of the channel on which the frame is to be received. - */ -bool nrf_802154_delayed_trx_receive(uint32_t t0, - uint32_t dt, - uint32_t timeout, - uint8_t channel); - -/** - * @brief Cancels a reception scheduled by a call to @ref nrf_802154_delayed_trx_receive. - * - * After a call to this function, no reception timeout event will be notified. - * - * @retval true Successfully cancelled a scheduled transmission. - * @retval false No delayed reception was scheduled. - */ -bool nrf_802154_delayed_trx_receive_cancel(void); - -/** - * @brief Aborts an ongoing delayed reception procedure. - * - * @param[in] term_lvl Termination level set by the request to abort the ongoing operation. - * @param[in] req_orig Module that originates this request. - * - * If the delayed transmission/reception procedures are not running during the call, - * this function does nothing. - * - * @retval true Transmission/reception procedures have been stopped. - * @retval false Transmission/reception procedures were not running. - * - */ -bool nrf_802154_delayed_trx_abort(nrf_802154_term_t term_lvl, req_originator_t req_orig); - -/** - * @brief Extends the timeout timer when the reception start is detected and there is not enough - * time left for a delayed RX operation. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame - * that is being received. - * - * If the delayed transmission/reception procedures are not running during call, - * this function does nothing. - * - */ -void nrf_802154_delayed_trx_rx_started_hook(const uint8_t * p_frame); - -/** - *@} - **/ - -#endif // NRF_802154_DELAYED_TRX_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.c b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.c deleted file mode 100644 index 3060766b6..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.c +++ /dev/null @@ -1,476 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements incoming frame filtering according to 3 and 4 levels of filtering. - * - * Filtering details are specified in 802.15.4-2015: 6.7.2. - * 1st and 2nd filtering level is performed by FSM module depending on promiscuous mode, when FCS is - * received. - */ - -#include "nrf_802154_filter.h" - -#include -#include -#include -#include - -#include "nrf_802154_const.h" -#include "nrf_802154_frame_parser.h" -#include "nrf_802154_pib.h" - -#define FCF_CHECK_OFFSET (PHR_SIZE + FCF_SIZE) -#define PANID_CHECK_OFFSET (DEST_ADDR_OFFSET) -#define SHORT_ADDR_CHECK_OFFSET (DEST_ADDR_OFFSET + SHORT_ADDRESS_SIZE) -#define EXTENDED_ADDR_CHECK_OFFSET (DEST_ADDR_OFFSET + EXTENDED_ADDRESS_SIZE) - -/** - * @brief Check if given frame version is allowed for given frame type. - * - * @param[in] frame_type Type of incoming frame. - * @param[in] frame_version Version of incoming frame. - * - * @retval true Given frame version is allowed for given frame type. - * @retval false Given frame version is not allowed for given frame type. - */ -static bool frame_type_and_version_filter(uint8_t frame_type, uint8_t frame_version) -{ - bool result; - - switch (frame_type) - { - case FRAME_TYPE_BEACON: - case FRAME_TYPE_DATA: - case FRAME_TYPE_ACK: - case FRAME_TYPE_COMMAND: - result = (frame_version != FRAME_VERSION_3); - break; - - case FRAME_TYPE_MULTIPURPOSE: - result = (frame_version == FRAME_VERSION_0); - break; - - case FRAME_TYPE_FRAGMENT: - case FRAME_TYPE_EXTENDED: - result = true; - break; - - default: - result = false; - } - - return result; -} - -/** - * @brief Check if given frame type may include destination address fields. - * - * @note Actual presence of destination address fields in the frame is indicated by FCF. - * - * @param[in] frame_type Type of incoming frame. - * - * @retval true Given frame type may include addressing fields. - * @retval false Given frame type may not include addressing fields. - */ -static bool dst_addressing_may_be_present(uint8_t frame_type) -{ - bool result; - - switch (frame_type) - { - case FRAME_TYPE_BEACON: - case FRAME_TYPE_DATA: - case FRAME_TYPE_ACK: - case FRAME_TYPE_COMMAND: - case FRAME_TYPE_MULTIPURPOSE: - result = true; - break; - - case FRAME_TYPE_FRAGMENT: - case FRAME_TYPE_EXTENDED: - result = false; - break; - - default: - result = false; - } - - return result; -} - -/** - * @brief Get offset of end of addressing fields for given frame assuming its version is 2006. - * - * If given frame contains errors that prevent getting offset, this function returns false. If there - * are no destination address fields in given frame, this function returns true and does not modify - * @p p_num_bytes. If there is destination address in given frame, this function returns true and - * inserts offset of addressing fields end to @p p_num_bytes. - * - * @param[in] p_data Pointer to a buffer containing PHR and PSDU of the incoming frame. - * @param[out] p_num_bytes Offset of addressing fields end. - * @param[in] frame_type Type of incoming frame. - * - * @retval NRF_802154_RX_ERROR_NONE No errors in given frame were detected - it may be - * further processed. - * @retval NRF_802154_RX_ERROR_INVALID_DEST_ADDR The frame is valid but addressed to another node. - * @retval NRF_802154_RX_ERROR_INVALID_FRAME Detected an error in given frame - it should be - * discarded. - */ -static nrf_802154_rx_error_t dst_addressing_end_offset_get_2006(const uint8_t * p_data, - uint8_t * p_num_bytes, - uint8_t frame_type) -{ - nrf_802154_rx_error_t result; - - switch (p_data[DEST_ADDR_TYPE_OFFSET] & DEST_ADDR_TYPE_MASK) - { - case DEST_ADDR_TYPE_SHORT: - *p_num_bytes = SHORT_ADDR_CHECK_OFFSET; - result = NRF_802154_RX_ERROR_NONE; - break; - - case DEST_ADDR_TYPE_EXTENDED: - *p_num_bytes = EXTENDED_ADDR_CHECK_OFFSET; - result = NRF_802154_RX_ERROR_NONE; - break; - - case DEST_ADDR_TYPE_NONE: - if (nrf_802154_pib_pan_coord_get() || (frame_type == FRAME_TYPE_BEACON)) - { - switch (p_data[SRC_ADDR_TYPE_OFFSET] & SRC_ADDR_TYPE_MASK) - { - case SRC_ADDR_TYPE_SHORT: - case SRC_ADDR_TYPE_EXTENDED: - *p_num_bytes = PANID_CHECK_OFFSET; - result = NRF_802154_RX_ERROR_NONE; - break; - - default: - result = NRF_802154_RX_ERROR_INVALID_FRAME; - } - } - else - { - result = NRF_802154_RX_ERROR_INVALID_DEST_ADDR; - } - - break; - - default: - result = NRF_802154_RX_ERROR_INVALID_FRAME; - } - - return result; -} - -/** - * @brief Get offset of end of addressing fields for given frame assuming its version is 2015. - * - * If given frame contains errors that prevent getting offset, this function returns false. If there - * are no destination address fields in given frame, this function returns true and does not modify - * @p p_num_bytes. If there is destination address in given frame, this function returns true and - * inserts offset of addressing fields end to @p p_num_bytes. - * - * @param[in] p_data Pointer to a buffer containing PHR and PSDU of the incoming frame. - * @param[out] p_num_bytes Offset of addressing fields end. - * @param[in] frame_type Type of incoming frame. - * - * @retval NRF_802154_RX_ERROR_NONE No errors in given frame were detected - it may be - * further processed. - * @retval NRF_802154_RX_ERROR_INVALID_DEST_ADDR The frame is valid but addressed to another node. - * @retval NRF_802154_RX_ERROR_INVALID_FRAME Detected an error in given frame - it should be - * discarded. - */ -static nrf_802154_rx_error_t dst_addressing_end_offset_get_2015(const uint8_t * p_data, - uint8_t * p_num_bytes, - uint8_t frame_type) -{ - nrf_802154_rx_error_t result; - - switch (frame_type) - { - case FRAME_TYPE_BEACON: - case FRAME_TYPE_DATA: - case FRAME_TYPE_ACK: - case FRAME_TYPE_COMMAND: - { - uint8_t end_offset = nrf_802154_frame_parser_dst_addr_end_offset_get(p_data); - - if (end_offset == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - result = NRF_802154_RX_ERROR_INVALID_FRAME; - } - else - { - *p_num_bytes = end_offset; - result = NRF_802154_RX_ERROR_NONE; - } - } - break; - - case FRAME_TYPE_MULTIPURPOSE: - // TODO: Implement dst addressing filtering according to 2015 spec - result = NRF_802154_RX_ERROR_INVALID_FRAME; - break; - - case FRAME_TYPE_FRAGMENT: - case FRAME_TYPE_EXTENDED: - // No addressing data - result = NRF_802154_RX_ERROR_NONE; - break; - - default: - result = NRF_802154_RX_ERROR_INVALID_FRAME; - } - - return result; -} - -/** - * @brief Get offset of end of addressing fields for given frame. - * - * If given frame contains errors that prevent getting offset, this function returns false. If there - * are no destination address fields in given frame, this function returns true and does not modify - * @p p_num_bytes. If there is destination address in given frame, this function returns true and - * inserts offset of addressing fields end to @p p_num_bytes. - * - * @param[in] p_data Pointer to a buffer containing PHR and PSDU of the incoming frame. - * @param[out] p_num_bytes Offset of addressing fields end. - * @param[in] frame_type Type of incoming frame. - * - * @retval NRF_802154_RX_ERROR_NONE No errors in given frame were detected - it may be - * further processed. - * @retval NRF_802154_RX_ERROR_INVALID_DEST_ADDR The frame is valid but addressed to another node. - * @retval NRF_802154_RX_ERROR_INVALID_FRAME Detected an error in given frame - it should be - * discarded. - */ -static nrf_802154_rx_error_t dst_addressing_end_offset_get(const uint8_t * p_data, - uint8_t * p_num_bytes, - uint8_t frame_type, - uint8_t frame_version) -{ - nrf_802154_rx_error_t result; - - switch (frame_version) - { - case FRAME_VERSION_0: - case FRAME_VERSION_1: - result = dst_addressing_end_offset_get_2006(p_data, p_num_bytes, frame_type); - break; - - case FRAME_VERSION_2: - result = dst_addressing_end_offset_get_2015(p_data, p_num_bytes, frame_type); - break; - - default: - result = NRF_802154_RX_ERROR_INVALID_FRAME; - } - - return result; -} - -/** - * Verify if destination PAN Id of incoming frame allows processing by this node. - * - * @param[in] p_panid Pointer of PAN ID of incoming frame. - * @param[in] frame_type Type of the frame being filtered. - * - * @retval true PAN Id of incoming frame allows further processing of the frame. - * @retval false PAN Id of incoming frame does not allow further processing. - */ -static bool dst_pan_id_check(const uint8_t * p_panid, uint8_t frame_type) -{ - bool result; - - if ((0 == memcmp(p_panid, nrf_802154_pib_pan_id_get(), PAN_ID_SIZE)) || - (0 == memcmp(p_panid, BROADCAST_ADDRESS, PAN_ID_SIZE))) - { - result = true; - } - else if ((FRAME_TYPE_BEACON == frame_type) && - (0 == memcmp(nrf_802154_pib_pan_id_get(), BROADCAST_ADDRESS, PAN_ID_SIZE))) - { - result = true; - } - else - { - result = false; - } - - return result; -} - -/** - * Verify if destination short address of incoming frame allows processing by this node. - * - * @param[in] p_dst_addr Pointer of destination address of incoming frame. - * @param[in] frame_type Type of the frame being filtered. - * - * @retval true Destination address of incoming frame allows further processing of the frame. - * @retval false Destination address of incoming frame does not allow further processing. - */ -static bool dst_short_addr_check(const uint8_t * p_dst_addr, uint8_t frame_type) -{ - bool result; - - if ((0 == memcmp(p_dst_addr, nrf_802154_pib_short_address_get(), SHORT_ADDRESS_SIZE)) || - (0 == memcmp(p_dst_addr, BROADCAST_ADDRESS, SHORT_ADDRESS_SIZE))) - { - result = true; - } - else - { - result = false; - } - - return result; -} - -/** - * Verify if destination extended address of incoming frame allows processing by this node. - * - * @param[in] p_dst_addr Pointer of destination address of incoming frame. - * @param[in] frame_type Type of the frame being filtered. - * - * @retval true Destination address of incoming frame allows further processing of the frame. - * @retval false Destination address of incoming frame does not allow further processing. - */ -static bool dst_extended_addr_check(const uint8_t * p_dst_addr, uint8_t frame_type) -{ - bool result; - - if (0 == memcmp(p_dst_addr, nrf_802154_pib_extended_address_get(), EXTENDED_ADDRESS_SIZE)) - { - result = true; - } - else - { - result = false; - } - - return result; -} - -/** - * Verify if destination addressing of incoming frame allows processing by this node. - * This function checks addressing according to IEEE 802.15.4-2015. - * - * @param[in] p_data Pointer to a buffer containing PHR and PSDU of the incoming frame. - * - * @retval NRF_802154_RX_ERROR_NONE Destination address of incoming frame allows further processing of the frame. - * @retval NRF_802154_RX_ERROR_INVALID_FRAME Received frame is invalid. - * @retval NRF_802154_RX_ERROR_INVALID_DEST_ADDR Destination address of incoming frame does not allow further processing. - */ -static nrf_802154_rx_error_t dst_addr_check(const uint8_t * p_data, uint8_t frame_type) -{ - bool result; - nrf_802154_frame_parser_mhr_data_t mhr_data; - - result = nrf_802154_frame_parser_mhr_parse(p_data, &mhr_data); - - if (!result) - { - return NRF_802154_RX_ERROR_INVALID_FRAME; - } - - if (mhr_data.p_dst_panid != NULL) - { - if (!dst_pan_id_check(mhr_data.p_dst_panid, frame_type)) - { - return NRF_802154_RX_ERROR_INVALID_DEST_ADDR; - } - } - - switch (mhr_data.dst_addr_size) - { - case SHORT_ADDRESS_SIZE: - return dst_short_addr_check(mhr_data.p_dst_addr, - frame_type) ? NRF_802154_RX_ERROR_NONE : - NRF_802154_RX_ERROR_INVALID_DEST_ADDR; - - case EXTENDED_ADDRESS_SIZE: - return dst_extended_addr_check(mhr_data.p_dst_addr, - frame_type) ? NRF_802154_RX_ERROR_NONE : - NRF_802154_RX_ERROR_INVALID_DEST_ADDR; - - case 0: - // Allow frames destined to the Pan Coordinator without destination address or - // beacon frames without destination address - return (nrf_802154_pib_pan_coord_get() || - (frame_type == - FRAME_TYPE_BEACON)) ? NRF_802154_RX_ERROR_NONE : - NRF_802154_RX_ERROR_INVALID_DEST_ADDR; - - default: - assert(false); - } - - return NRF_802154_RX_ERROR_INVALID_FRAME; -} - -nrf_802154_rx_error_t nrf_802154_filter_frame_part(const uint8_t * p_data, uint8_t * p_num_bytes) -{ - nrf_802154_rx_error_t result = NRF_802154_RX_ERROR_INVALID_FRAME; - uint8_t frame_type = p_data[FRAME_TYPE_OFFSET] & FRAME_TYPE_MASK; - uint8_t frame_version = p_data[FRAME_VERSION_OFFSET] & FRAME_VERSION_MASK; - - switch (*p_num_bytes) - { - case FCF_CHECK_OFFSET: - if (p_data[0] < IMM_ACK_LENGTH || p_data[0] > MAX_PACKET_SIZE) - { - result = NRF_802154_RX_ERROR_INVALID_LENGTH; - break; - } - - if (!frame_type_and_version_filter(frame_type, frame_version)) - { - result = NRF_802154_RX_ERROR_INVALID_FRAME; - break; - } - - if (!dst_addressing_may_be_present(frame_type)) - { - result = NRF_802154_RX_ERROR_NONE; - break; - } - - result = dst_addressing_end_offset_get(p_data, p_num_bytes, frame_type, frame_version); - break; - - default: - result = dst_addr_check(p_data, frame_type); - break; - } - - return result; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.h b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.h deleted file mode 100644 index 0796a9013..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_filter.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that implements the incoming frame filter API. - * - */ - -#ifndef NRF_802154_FILTER_H_ -#define NRF_802154_FILTER_H_ - -#include -#include - -#include "nrf_802154_types.h" - -/** - * @defgroup nrf_802154_filter Incoming frame filter API - * @{ - * @ingroup nrf_802154 - * @brief Procedures used to discard the incoming frames that contain unexpected data in PHR or MHR. - */ - -/** - * @brief Verifies if the given part of the frame is valid. - * - * This function is called a few times for each received frame. The first call is after the FCF - * is received (PSDU length is 2 and @p p_num_bytes value is 3). The subsequent calls are performed - * when the number of bytes requested by the previous call is available. The iteration ends - * when the function does not request any more bytes to check. - * If the verified part of the function is correct, this function returns true and sets - * @p p_num_bytes to the number of bytes that should be available in PSDU during the next iteration. - * If the frame is correct and there is nothing more to check, this function returns true - * and does not modify the @p p_num_bytes value. If the verified frame is incorrect, this function - * returns false and the @p p_num_bytes value is undefined. - * - * @param[in] p_data Pointer to a buffer that contains PHR and PSDU of the incoming frame. - * @param[inout] p_num_bytes Number of bytes available in @p p_data buffer. This value is either - * set to the requested number of bytes for the next iteration or remains - * unchanged if no more iterations are to be performed during - * the filtering of the given frame. - * - * @retval NRF_802154_RX_ERROR_NONE Verified part of the incoming frame is valid. - * @retval NRF_802154_RX_ERROR_INVALID_FRAME Verified part of the incoming frame is invalid. - * @retval NRF_802154_RX_ERROR_INVALID_DEST_ADDR Incoming frame has destination address that - * mismatches the address of this node. - */ -nrf_802154_rx_error_t nrf_802154_filter_frame_part(const uint8_t * p_data, uint8_t * p_num_bytes); - -#endif /* NRF_802154_FILTER_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_frame_parser.c b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_frame_parser.c deleted file mode 100644 index 0ad70e2ba..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_frame_parser.c +++ /dev/null @@ -1,682 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements frame parsing utilities for 802.15.4 radio driver. - * - * @note This module is based on following assumptions: - * a. All received frames contain both source and destination address. - * b. All received frames contain destination PAN ID field. - * Frames that don't meet these assumptions are dropped. - */ - -#include "nrf_802154_frame_parser.h" - -#include - -#include "nrf_802154_const.h" - -/*************************************************************************************************** - * @section Helper functions - **************************************************************************************************/ - -// Version -static uint8_t frame_version_get(const uint8_t * p_frame) -{ - return p_frame[FRAME_VERSION_OFFSET] & FRAME_VERSION_MASK; -} - -// Addressing - -static uint8_t addressing_offset_get(const uint8_t * p_frame) -{ - if ((frame_version_get(p_frame) >= FRAME_VERSION_2) && - nrf_802154_frame_parser_dsn_suppress_bit_is_set(p_frame)) - { - return PHR_SIZE + FCF_SIZE; - } - else - { - return PHR_SIZE + FCF_SIZE + DSN_SIZE; - } -} - -static bool src_addr_is_present(const uint8_t * p_frame) -{ - return (p_frame[SRC_ADDR_TYPE_OFFSET] & SRC_ADDR_TYPE_MASK) != SRC_ADDR_TYPE_NONE; -} - -static bool dst_addr_is_present(const uint8_t * p_frame) -{ - return (p_frame[DEST_ADDR_TYPE_OFFSET] & DEST_ADDR_TYPE_MASK) != DEST_ADDR_TYPE_NONE; -} - -static uint8_t src_addr_size_get(const uint8_t * p_frame) -{ - switch (p_frame[SRC_ADDR_TYPE_OFFSET] & SRC_ADDR_TYPE_MASK) - { - case SRC_ADDR_TYPE_NONE: - return 0; - - case SRC_ADDR_TYPE_SHORT: - return SHORT_ADDRESS_SIZE; - - case SRC_ADDR_TYPE_EXTENDED: - return EXTENDED_ADDRESS_SIZE; - - default: - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } -} - -static uint8_t dst_addr_size_get(const uint8_t * p_frame) -{ - switch (p_frame[DEST_ADDR_TYPE_OFFSET] & DEST_ADDR_TYPE_MASK) - { - case DEST_ADDR_TYPE_NONE: - return 0; - - case DEST_ADDR_TYPE_SHORT: - return SHORT_ADDRESS_SIZE; - - case DEST_ADDR_TYPE_EXTENDED: - return EXTENDED_ADDRESS_SIZE; - - default: - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } -} - -// PAN ID -static bool dst_panid_is_present(const uint8_t * p_frame) -{ - bool panid_compression = (p_frame[PAN_ID_COMPR_OFFSET] & PAN_ID_COMPR_MASK) ? true : false; - - switch (frame_version_get(p_frame)) - { - case FRAME_VERSION_0: - case FRAME_VERSION_1: - if (!dst_addr_is_present(p_frame)) - { - return false; - } - - return true; - - case FRAME_VERSION_2: - default: - if (nrf_802154_frame_parser_dst_addr_is_extended(p_frame) && - nrf_802154_frame_parser_src_addr_is_extended(p_frame)) - { - return panid_compression ? false : true; - } - - if (src_addr_is_present(p_frame) && dst_addr_is_present(p_frame)) - { - return true; - } - - if (src_addr_is_present(p_frame)) - { - return false; - } - - if (dst_addr_is_present(p_frame)) - { - return panid_compression ? false : true; - } - - return panid_compression ? true : false; - } -} - -static bool src_panid_is_present(const uint8_t * p_frame) -{ - bool panid_compression = (p_frame[PAN_ID_COMPR_OFFSET] & PAN_ID_COMPR_MASK) ? true : false; - - switch (frame_version_get(p_frame)) - { - case FRAME_VERSION_0: - case FRAME_VERSION_1: - if (!src_addr_is_present(p_frame)) - { - return false; - } - - return panid_compression ? false : true; - - case FRAME_VERSION_2: - default: - if (nrf_802154_frame_parser_dst_addr_is_extended(p_frame) && - nrf_802154_frame_parser_src_addr_is_extended(p_frame)) - { - return false; - } - - if (src_addr_is_present(p_frame) && dst_addr_is_present(p_frame)) - { - return panid_compression ? false : true; - } - - if (src_addr_is_present(p_frame)) - { - return panid_compression ? false : true; - } - - if (dst_addr_is_present(p_frame)) - { - return false; - } - - return false; - } -} - -static bool src_panid_is_compressed(const uint8_t * p_frame) -{ - return dst_panid_is_present(p_frame) && !src_panid_is_present(p_frame); -} - -// Security -static bool security_is_enabled(const uint8_t * p_frame) -{ - return p_frame[SECURITY_ENABLED_OFFSET] & SECURITY_ENABLED_BIT ? true : false; -} - -static uint8_t security_offset_get(const uint8_t * p_frame) -{ - uint8_t dst_addr_offset = nrf_802154_frame_parser_dst_addr_offset_get(p_frame); - uint8_t dst_panid_offset = nrf_802154_frame_parser_dst_panid_offset_get(p_frame); - uint8_t dst_addr_size = dst_addr_size_get(p_frame); - uint8_t src_addr_offset = nrf_802154_frame_parser_src_addr_offset_get(p_frame); - uint8_t src_panid_offset = nrf_802154_frame_parser_src_panid_offset_get(p_frame); - uint8_t src_addr_size = src_addr_size_get(p_frame); - - if (src_addr_is_present(p_frame)) - { - if ((src_addr_size == NRF_802154_FRAME_PARSER_INVALID_OFFSET) || - (src_addr_offset == NRF_802154_FRAME_PARSER_INVALID_OFFSET)) - { - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } - - return src_addr_offset + src_addr_size; - } - else if (src_panid_is_present(p_frame)) - { - if (src_panid_offset == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } - - return src_panid_offset + PAN_ID_SIZE; - } - else if (dst_addr_offset) - { - if (dst_addr_size == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } - - return dst_addr_offset + dst_addr_size; - } - else if (dst_panid_offset) - { - return dst_panid_offset + PAN_ID_SIZE; - } - else - { - return addressing_offset_get(p_frame); - } -} - -static uint8_t key_id_size_get(const uint8_t * p_frame) -{ - switch (*nrf_802154_frame_parser_sec_ctrl_get(p_frame) & KEY_ID_MODE_MASK) - { - case KEY_ID_MODE_1: - return KEY_ID_MODE_1_SIZE; - - case KEY_ID_MODE_2: - return KEY_ID_MODE_2_SIZE; - - case KEY_ID_MODE_3: - return KEY_ID_MODE_3_SIZE; - - default: - return 0; - } -} - -// IEs - -static uint8_t ie_offset_get(const uint8_t * p_frame) -{ - uint8_t security_offset = security_offset_get(p_frame); - uint8_t key_id_offset = nrf_802154_frame_parser_key_id_offset_get(p_frame); - - if (!security_is_enabled(p_frame)) - { - if (security_offset == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } - - return security_offset; - } - else - { - if (key_id_offset == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } - - return key_id_offset + key_id_size_get(p_frame); - } -} - -/*************************************************************************************************** - * @section Frame format functions - **************************************************************************************************/ - -bool nrf_802154_frame_parser_dst_addr_is_extended(const uint8_t * p_frame) -{ - return (p_frame[DEST_ADDR_TYPE_OFFSET] & DEST_ADDR_TYPE_MASK) == DEST_ADDR_TYPE_EXTENDED; -} - -bool nrf_802154_frame_parser_src_addr_is_extended(const uint8_t * p_frame) -{ - return (p_frame[SRC_ADDR_TYPE_OFFSET] & SRC_ADDR_TYPE_MASK) == SRC_ADDR_TYPE_EXTENDED; -} - -bool nrf_802154_frame_parser_src_addr_is_short(const uint8_t * p_frame) -{ - return (p_frame[SRC_ADDR_TYPE_OFFSET] & SRC_ADDR_TYPE_MASK) == SRC_ADDR_TYPE_SHORT; -} - -bool nrf_802154_frame_parser_dsn_suppress_bit_is_set(const uint8_t * p_frame) -{ - return (p_frame[DSN_SUPPRESS_OFFSET] & DSN_SUPPRESS_BIT) ? true : false; -} - -bool nrf_802154_frame_parser_ie_present_bit_is_set(const uint8_t * p_frame) -{ - return (p_frame[IE_PRESENT_OFFSET] & IE_PRESENT_BIT) ? true : false; -} - -bool nrf_802154_frame_parser_ar_bit_is_set(const uint8_t * p_frame) -{ - return (p_frame[ACK_REQUEST_OFFSET] & ACK_REQUEST_BIT) ? true : false; -} - -/*************************************************************************************************** - * @section Offset functions - **************************************************************************************************/ - -uint8_t nrf_802154_frame_parser_dst_panid_offset_get(const uint8_t * p_frame) -{ - if (dst_panid_is_present(p_frame)) - { - return addressing_offset_get(p_frame); - } - else - { - return 0; - } -} - -uint8_t nrf_802154_frame_parser_dst_addr_offset_get(const uint8_t * p_frame) -{ - uint8_t dst_panid_offset = nrf_802154_frame_parser_dst_panid_offset_get(p_frame); - - if (dst_addr_is_present(p_frame)) - { - return 0 == - dst_panid_offset ? addressing_offset_get(p_frame) : dst_panid_offset + PAN_ID_SIZE; - } - else - { - return 0; - } -} - -uint8_t nrf_802154_frame_parser_dst_addr_end_offset_get(const uint8_t * p_frame) -{ - uint8_t offset = addressing_offset_get(p_frame); - uint8_t dst_addr_size = dst_addr_size_get(p_frame); - - if (dst_addr_size == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } - - if (dst_panid_is_present(p_frame)) - { - offset += PAN_ID_SIZE; - } - - offset += dst_addr_size; - - return offset; -} - -uint8_t nrf_802154_frame_parser_src_panid_offset_get(const uint8_t * p_frame) -{ - uint8_t dst_addr_offset = nrf_802154_frame_parser_dst_addr_offset_get(p_frame); - uint8_t dst_panid_offset = nrf_802154_frame_parser_dst_panid_offset_get(p_frame); - uint8_t dst_addr_size = dst_addr_size_get(p_frame); - - if (src_panid_is_present(p_frame)) - { - if (dst_addr_offset) - { - if (dst_addr_size == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } - - return dst_addr_offset + dst_addr_size; - } - else if (dst_panid_offset) - { - return dst_panid_offset + PAN_ID_SIZE; - } - else - { - return addressing_offset_get(p_frame); - } - } - else if (src_panid_is_compressed(p_frame)) - { - return nrf_802154_frame_parser_dst_panid_offset_get(p_frame); - } - else - { - return 0; - } -} - -uint8_t nrf_802154_frame_parser_src_addr_offset_get(const uint8_t * p_frame) -{ - uint8_t dst_addr_offset = nrf_802154_frame_parser_dst_addr_offset_get(p_frame); - uint8_t dst_panid_offset = nrf_802154_frame_parser_dst_panid_offset_get(p_frame); - uint8_t dst_addr_size = dst_addr_size_get(p_frame); - uint8_t src_panid_offset = nrf_802154_frame_parser_src_panid_offset_get(p_frame); - - if (src_addr_is_present(p_frame)) - { - if (src_panid_is_present(p_frame)) - { - if (src_panid_offset == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } - - return src_panid_offset + PAN_ID_SIZE; - } - else if (dst_addr_offset) - { - if (dst_addr_size == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } - - return dst_addr_offset + dst_addr_size; - } - else if (dst_panid_offset) - { - return dst_panid_offset + PAN_ID_SIZE; - } - else - { - return addressing_offset_get(p_frame); - } - } - else - { - return 0; - } -} - -uint8_t nrf_802154_frame_parser_addressing_end_offset_get(const uint8_t * p_frame) -{ - return security_offset_get(p_frame); -} - -uint8_t nrf_802154_frame_parser_sec_ctrl_offset_get(const uint8_t * p_frame) -{ - if (!security_is_enabled(p_frame)) - { - return 0; - } - else - { - return security_offset_get(p_frame); - } -} - -uint8_t nrf_802154_frame_parser_key_id_offset_get(const uint8_t * p_frame) -{ - uint8_t sec_ctrl_offset = nrf_802154_frame_parser_sec_ctrl_offset_get(p_frame); - - if (0 == sec_ctrl_offset) - { - return 0; - } - - if (NRF_802154_FRAME_PARSER_INVALID_OFFSET == sec_ctrl_offset) - { - return NRF_802154_FRAME_PARSER_INVALID_OFFSET; - } - - if (p_frame[sec_ctrl_offset] & FRAME_COUNTER_SUPPRESS_BIT) - { - return sec_ctrl_offset + SECURITY_CONTROL_SIZE; - } - else - { - return sec_ctrl_offset + SECURITY_CONTROL_SIZE + FRAME_COUNTER_SIZE; - } -} - -uint8_t nrf_802154_frame_parser_ie_header_offset_get(const uint8_t * p_frame) -{ - if (!nrf_802154_frame_parser_ie_present_bit_is_set(p_frame)) - { - return 0; - } - else - { - return ie_offset_get(p_frame); - } -} - -/*************************************************************************************************** - * @section Get functions - **************************************************************************************************/ - -const uint8_t * nrf_802154_frame_parser_dst_addr_get(const uint8_t * p_frame, - bool * p_dst_addr_extended) -{ - uint8_t dst_addr_offset = nrf_802154_frame_parser_dst_addr_offset_get(p_frame); - - if ((0 == dst_addr_offset) || (NRF_802154_FRAME_PARSER_INVALID_OFFSET == dst_addr_offset)) - { - *p_dst_addr_extended = false; - return NULL; - } - else - { - *p_dst_addr_extended = nrf_802154_frame_parser_dst_addr_is_extended(p_frame); - return &p_frame[dst_addr_offset]; - } -} - -const uint8_t * nrf_802154_frame_parser_dst_panid_get(const uint8_t * p_frame) -{ - uint8_t dst_panid_offset = nrf_802154_frame_parser_dst_panid_offset_get(p_frame); - - return ((0 == dst_panid_offset) || (NRF_802154_FRAME_PARSER_INVALID_OFFSET == dst_panid_offset)) - ? NULL : &p_frame[dst_panid_offset]; -} - -const uint8_t * nrf_802154_frame_parser_src_panid_get(const uint8_t * p_frame) -{ - uint8_t src_panid_offset = nrf_802154_frame_parser_src_panid_offset_get(p_frame); - - return ((0 == src_panid_offset) || (NRF_802154_FRAME_PARSER_INVALID_OFFSET == src_panid_offset)) - ? NULL : &p_frame[src_panid_offset]; -} - -const uint8_t * nrf_802154_frame_parser_src_addr_get(const uint8_t * p_frame, - bool * p_src_addr_extended) -{ - uint8_t src_addr_offset = nrf_802154_frame_parser_src_addr_offset_get(p_frame); - - if ((0 == src_addr_offset) || (NRF_802154_FRAME_PARSER_INVALID_OFFSET == src_addr_offset)) - { - *p_src_addr_extended = false; - return NULL; - } - else - { - *p_src_addr_extended = nrf_802154_frame_parser_src_addr_is_extended(p_frame); - return &p_frame[src_addr_offset]; - } -} - -bool nrf_802154_frame_parser_mhr_parse(const uint8_t * p_frame, - nrf_802154_frame_parser_mhr_data_t * p_fields) -{ - uint8_t offset = addressing_offset_get(p_frame); - bool is_dst_panid_present = dst_panid_is_present(p_frame); - bool is_src_panid_present = src_panid_is_present(p_frame); - - if (is_dst_panid_present) - { - p_fields->p_dst_panid = &p_frame[offset]; - offset += PAN_ID_SIZE; - } - else - { - p_fields->p_dst_panid = NULL; - } - - if (dst_addr_is_present(p_frame)) - { - p_fields->p_dst_addr = &p_frame[offset]; - p_fields->dst_addr_size = dst_addr_size_get(p_frame); - offset += (p_fields->dst_addr_size); - - if (p_fields->dst_addr_size == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - return false; - } - } - else - { - p_fields->p_dst_addr = NULL; - p_fields->dst_addr_size = 0; - } - - if (is_src_panid_present) - { - p_fields->p_src_panid = &p_frame[offset]; - offset += PAN_ID_SIZE; - } - else if (is_dst_panid_present) - { - p_fields->p_src_panid = p_fields->p_dst_panid; - } - else - { - p_fields->p_src_panid = NULL; - } - - if (src_addr_is_present(p_frame)) - { - p_fields->p_src_addr = &p_frame[offset]; - p_fields->src_addr_size = src_addr_size_get(p_frame); - offset += (p_fields->src_addr_size); - - if (p_fields->src_addr_size == NRF_802154_FRAME_PARSER_INVALID_OFFSET) - { - return false; - } - } - else - { - p_fields->p_src_addr = NULL; - p_fields->src_addr_size = 0; - } - - p_fields->addressing_end_offset = offset; - - if (security_is_enabled(p_frame)) - { - p_fields->p_sec_ctrl = &p_frame[offset]; - // TODO increment offset... - } - else - { - p_fields->p_sec_ctrl = NULL; - } - - return true; -} - -const uint8_t * nrf_802154_frame_parser_sec_ctrl_get(const uint8_t * p_frame) -{ - uint8_t sec_ctrl_offset = nrf_802154_frame_parser_sec_ctrl_offset_get(p_frame); - - return ((0 == sec_ctrl_offset) || (NRF_802154_FRAME_PARSER_INVALID_OFFSET == sec_ctrl_offset)) ? - NULL : &p_frame[sec_ctrl_offset]; -} - -const uint8_t * nrf_802154_frame_parser_key_id_get(const uint8_t * p_frame) -{ - uint8_t key_id_offset = nrf_802154_frame_parser_key_id_offset_get(p_frame); - - return ((0 == key_id_offset) || (NRF_802154_FRAME_PARSER_INVALID_OFFSET == key_id_offset)) ? - NULL : &p_frame[key_id_offset]; -} - -const uint8_t * nrf_802154_frame_parser_ie_header_get(const uint8_t * p_frame) -{ - uint8_t ie_header_offset = nrf_802154_frame_parser_ie_header_offset_get(p_frame); - - if ((0 == ie_header_offset) || (NRF_802154_FRAME_PARSER_INVALID_OFFSET == ie_header_offset)) - { - return NULL; - } - - return &p_frame[ie_header_offset]; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_frame_parser.h b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_frame_parser.h deleted file mode 100644 index 0b216d309..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_frame_parser.h +++ /dev/null @@ -1,317 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains frame parsing utilities for the 802.15.4 radio driver. - * - */ - -#ifndef NRF_802154_FRAME_PARSER_H -#define NRF_802154_FRAME_PARSER_H - -#include -#include - -#define NRF_802154_FRAME_PARSER_INVALID_OFFSET 0xff - -/** - * @biref Structure that contains pointers to parts of MHR and details of MHR structure. - */ -typedef struct -{ - const uint8_t * p_dst_panid; ///< Pointer to the destination PAN ID field, or NULL if missing. - const uint8_t * p_dst_addr; ///< Pointer to the destination address field, or NULL if missing. - const uint8_t * p_src_panid; ///< Pointer to the source PAN ID field, or NULL if missing. - const uint8_t * p_src_addr; ///< Pointer to the source address field, or NULL if missing. - const uint8_t * p_sec_ctrl; ///< Pointer to the security control field, or NULL if missing. - uint8_t dst_addr_size; ///< Size of the destination address field. - uint8_t src_addr_size; ///< Size of the source address field. - uint8_t addressing_end_offset; ///< Offset of the first byte following addressing fields. -} nrf_802154_frame_parser_mhr_data_t; - -/** - * @brief Determines if the destination address is extended. - * - * @param[in] p_frame Pointer to a frame to be checked. - * - * @retval true Destination address is extended. - * @retval false Destination address is not extended. - */ -bool nrf_802154_frame_parser_dst_addr_is_extended(const uint8_t * p_frame); - -/** - * @brief Gets the destination address from the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * @param[out] p_dst_addr_extended Pointer to a value, which is true if the destination address - * is extended. Otherwise, it is false. - * - * @returns Pointer to the first byte of the destination address in @p p_frame. - * NULL if the destination address cannot be retrieved. - */ -const uint8_t * nrf_802154_frame_parser_dst_addr_get(const uint8_t * p_frame, - bool * p_dst_addr_extended); - -/** - * @brief Gets the offset of the destination address field in the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Offset in bytes of the destination address field, including one byte - * of the frame length. - * @returns Zero if the destination address cannot be retrieved. - * - */ -uint8_t nrf_802154_frame_parser_dst_addr_offset_get(const uint8_t * p_frame); - -/** - * @brief Gets the destination PAN ID from the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Pointer to the first byte of the destination PAN ID in @p p_frame. - * @returns NULL if the destination PAN ID cannot be retrieved. - * - */ -const uint8_t * nrf_802154_frame_parser_dst_panid_get(const uint8_t * p_frame); - -/** - * @brief Gets the offset of the destination PAN ID field in the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Offset in bytes of the destination PAN ID field, including one byte - * of the frame length. - * @returns Zero in case the destination PAN ID cannot be retrieved. - * - */ -uint8_t nrf_802154_frame_parser_dst_panid_offset_get(const uint8_t * p_frame); - -/** - * @brief Gets the offset of the end of the destination address fields. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Offset of the first byte following the destination addressing fields in the MHR. - */ -uint8_t nrf_802154_frame_parser_dst_addr_end_offset_get(const uint8_t * p_frame); - -/** - * @brief Determines if the source address is extended. - * - * @param[in] p_frame Pointer to a frame to check. - * - * @retval true The source address is extended. - * @retval false The source address is not extended. - * - */ -bool nrf_802154_frame_parser_src_addr_is_extended(const uint8_t * p_frame); - -/** - * @brief Determines if the source address is short. - * - * @param[in] p_frame Pointer to a frame to check. - * - * @retval true The source address is short. - * @retval false The source address is not short. - * - */ -bool nrf_802154_frame_parser_src_addr_is_short(const uint8_t * p_frame); - -/** - * @brief Gets the source address from the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * @param[out] p_src_addr_extended Pointer to a value, which is true if source address is extended. - * Otherwise, it is false. - * - * @returns Pointer to the first byte of the source address in @p p_frame. - * @returns NULL if the source address cannot be retrieved. - * - */ -const uint8_t * nrf_802154_frame_parser_src_addr_get(const uint8_t * p_frame, - bool * p_src_addr_extended); - -/** - * @brief Gets the offset of the source address field in the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Offset in bytes of the source address field, including one byte of the frame length. - * @returns Zero if the source address cannot be retrieved. - * - */ -uint8_t nrf_802154_frame_parser_src_addr_offset_get(const uint8_t * p_frame); - -/** - * @brief Gets the source PAN ID from the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Pointer to the first byte of the source PAN ID in @p p_frame. - * @returns NULL if the source PAN ID cannot be retrieved or if it is compressed. - * - */ -const uint8_t * nrf_802154_frame_parser_src_panid_get(const uint8_t * p_frame); - -/** - * @brief Gets the offset of the source PAN ID field in the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Offset in bytes of the source PAN ID field, including one byte of the frame length. - * @returns Zero if the source PAN ID cannot be retrieved or is compressed. - * - */ -uint8_t nrf_802154_frame_parser_src_panid_offset_get(const uint8_t * p_frame); - -/** - * @brief Gets the pointer and the details of MHR parts of a given frame. - * - * @param[in] p_frame Pointer to a frame to parse. - * @param[out] p_fields Pointer to a structure that contains pointers and details - * of the parsed frame. - * - * @retval true Frame parsed correctly. - * @retval false Parse error. @p p_fields values are invalid. - * - */ -bool nrf_802154_frame_parser_mhr_parse(const uint8_t * p_frame, - nrf_802154_frame_parser_mhr_data_t * p_fields); - -/** - * @brief Gets the security control field in the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Pointer to the first byte of the security control field in @p p_frame. - * @returns NULL if the security control cannot be retrieved (that is, security is not enabled). - * - */ -const uint8_t * nrf_802154_frame_parser_sec_ctrl_get(const uint8_t * p_frame); - -/** - * @brief Gets the offset of the first byte after the addressing fields in MHR. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Offset in bytes of the first byte after the addressing fields in MHR. - */ -uint8_t nrf_802154_frame_parser_addressing_end_offset_get(const uint8_t * p_frame); - -/** - * @brief Gets the offset of the security control field in the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Offset in bytes of the security control field, including one byte of the frame length. - * @returns Zero if the security control cannot be retrieved (that is, security is not enabled). - * - */ -uint8_t nrf_802154_frame_parser_sec_ctrl_offset_get(const uint8_t * p_frame); - -/** - * @brief Gets the key identifier field in the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Pointer to the first byte of the key identifier field in @p p_frame. - * @returns NULL if the key identifier cannot be retrieved (that is, security is not enabled). - * - */ -const uint8_t * nrf_802154_frame_parser_key_id_get(const uint8_t * p_frame); - -/** - * @brief Gets the offset of the key identifier field in the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Offset in bytes of the key identifier field, including one byte of the frame length. - * @returns Zero if the key identifier cannot be retrieved (that is, security is not enabled). - * - */ -uint8_t nrf_802154_frame_parser_key_id_offset_get(const uint8_t * p_frame); - -/** - * @brief Determines if the sequence number suppression bit is set. - * - * @param[in] p_frame Pointer to a frame. - * - * @retval true Sequence number suppression bit is set. - * @retval false Sequence number suppression bit is not set. - * - */ -bool nrf_802154_frame_parser_dsn_suppress_bit_is_set(const uint8_t * p_frame); - -/** - * @brief Determines if the IE present bit is set. - * - * @param[in] p_frame Pointer to a frame. - * - * @retval true IE present bit is set. - * @retval false IE present bit is not set. - * - */ -bool nrf_802154_frame_parser_ie_present_bit_is_set(const uint8_t * p_frame); - -/** - * @brief Determines if the Ack Request (AR) bit is set. - * - * @param[in] p_frame Pointer to a frame. - * - * @retval true AR bit is set. - * @retval false AR bit is not set. - * - */ -bool nrf_802154_frame_parser_ar_bit_is_set(const uint8_t * p_frame); - -/** - * @brief Gets the IE header field in the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Pointer to the first byte of the IE header field in @p p_frame. - * @returns NULL if the IE header cannot be retrieved (that is, the IE header is not present). - * - */ -const uint8_t * nrf_802154_frame_parser_ie_header_get(const uint8_t * p_frame); - -/** - * @brief Gets the offset of the IE header field in the provided frame. - * - * @param[in] p_frame Pointer to a frame. - * - * @returns Offset in bytes of the IE header field, including one byte of the frame length. - * @returns Zero if the IE header cannot be retrieved (that is, the IE header is not present). - * - */ -uint8_t nrf_802154_frame_parser_ie_header_offset_get(const uint8_t * p_frame); - -#endif // NRF_802154_FRAME_PARSER_H diff --git a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_precise_ack_timeout.c b/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_precise_ack_timeout.c deleted file mode 100644 index 629d640f4..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/mac_features/nrf_802154_precise_ack_timeout.c +++ /dev/null @@ -1,183 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements ACK timeout procedure for the 802.15.4 driver. - * - */ - -#include "nrf_802154_ack_timeout.h" - -#include -#include -#include - -#include "../nrf_802154_debug.h" -#include "nrf_802154_notification.h" -#include "nrf_802154_procedures_duration.h" -#include "nrf_802154_request.h" -#include "timer_scheduler/nrf_802154_timer_sched.h" - -#define RETRY_DELAY 500 ///< Procedure is delayed by this time if it cannot be performed at the moment [us]. -#define MAX_RETRY_DELAY 1000000 ///< Maximum allowed delay of procedure retry [us]. - -static void timeout_timer_retry(void); - -static uint32_t m_timeout = NRF_802154_PRECISE_ACK_TIMEOUT_DEFAULT_TIMEOUT; ///< ACK timeout in us. -static nrf_802154_timer_t m_timer; ///< Timer used to notify when the ACK frama is not received for too long. -static volatile bool m_procedure_is_active; -static const uint8_t * mp_frame; - -static void notify_tx_error(bool result) -{ - if (result) - { - nrf_802154_notify_transmit_failed(mp_frame, NRF_802154_TX_ERROR_NO_ACK); - } -} - -static void timeout_timer_fired(void * p_context) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_ACK_TIMEOUT_FIRED); - - (void)p_context; - - if (m_procedure_is_active) - { - if (nrf_802154_request_receive(NRF_802154_TERM_802154, - REQ_ORIG_ACK_TIMEOUT, - notify_tx_error, - false)) - { - m_procedure_is_active = false; - } - else - { - timeout_timer_retry(); - } - } - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_ACK_TIMEOUT_FIRED); -} - -static void timeout_timer_retry(void) -{ - m_timer.dt += RETRY_DELAY; - assert(m_timer.dt <= MAX_RETRY_DELAY); - - nrf_802154_timer_sched_add(&m_timer, true); -} - -static void timeout_timer_start(void) -{ - m_timer.callback = timeout_timer_fired; - m_timer.p_context = NULL; - m_timer.t0 = nrf_802154_timer_sched_time_get(); - m_timer.dt = m_timeout + - IMM_ACK_DURATION + - nrf_802154_frame_duration_get(mp_frame[0], false, true); - - m_procedure_is_active = true; - - nrf_802154_timer_sched_add(&m_timer, true); -} - -static void timeout_timer_stop(void) -{ - m_procedure_is_active = false; - - // To make sure `timeout_timer_fired()` detects that procedure is being stopped if it preempts - // this function. - __DMB(); - - nrf_802154_timer_sched_remove(&m_timer, NULL); -} - -void nrf_802154_ack_timeout_time_set(uint32_t time) -{ - m_timeout = time; -} - -bool nrf_802154_ack_timeout_tx_started_hook(const uint8_t * p_frame) -{ - mp_frame = p_frame; - timeout_timer_start(); - - return true; -} - -bool nrf_802154_ack_timeout_abort(nrf_802154_term_t term_lvl, req_originator_t req_orig) -{ - bool result; - - if (!m_procedure_is_active || req_orig == REQ_ORIG_ACK_TIMEOUT) - { - // Ignore if procedure is not running or self-request. - result = true; - } - else if (term_lvl >= NRF_802154_TERM_802154) - { - // Stop procedure only if termination level is high enough. - timeout_timer_stop(); - - result = true; - } - else - { - result = false; - } - - return result; -} - -void nrf_802154_ack_timeout_transmitted_hook(const uint8_t * p_frame) -{ - assert((p_frame == mp_frame) || (!m_procedure_is_active)); - - timeout_timer_stop(); -} - -void nrf_802154_ack_timeout_rx_ack_started_hook(void) -{ - assert(m_procedure_is_active); - - timeout_timer_stop(); -} - -bool nrf_802154_ack_timeout_tx_failed_hook(const uint8_t * p_frame, nrf_802154_tx_error_t error) -{ - (void)error; - assert((p_frame == mp_frame) || (!m_procedure_is_active)); - - timeout_timer_stop(); - - return true; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154.c deleted file mode 100644 index d61f6f357..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154.c +++ /dev/null @@ -1,844 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the nrf 802.15.4 radio driver. - * - */ - -#include "nrf_802154.h" - -#include -#include -#include -#include -#include - -#include "nrf_802154_config.h" -#include "nrf_802154_const.h" -#include "nrf_802154_core.h" -#include "nrf_802154_critical_section.h" -#include "nrf_802154_debug.h" -#include "nrf_802154_notification.h" -#include "nrf_802154_pib.h" -#include "nrf_802154_priority_drop.h" -#include "nrf_802154_request.h" -#include "nrf_802154_rssi.h" -#include "nrf_802154_rx_buffer.h" -#include "nrf_802154_timer_coord.h" -#include "nrf_radio.h" -#include "platform/clock/nrf_802154_clock.h" -#include "platform/lp_timer/nrf_802154_lp_timer.h" -#include "platform/random/nrf_802154_random.h" -#include "platform/temperature/nrf_802154_temperature.h" -#include "rsch/nrf_802154_rsch.h" -#include "rsch/nrf_802154_rsch_crit_sect.h" -#include "timer_scheduler/nrf_802154_timer_sched.h" - -#include "mac_features/nrf_802154_ack_timeout.h" -#include "mac_features/nrf_802154_csma_ca.h" -#include "mac_features/nrf_802154_delayed_trx.h" -#include "mac_features/ack_generator/nrf_802154_ack_data.h" - -#if ENABLE_FEM -#include "fem/nrf_fem_protocol_api.h" -#endif - -#define RAW_LENGTH_OFFSET 0 -#define RAW_PAYLOAD_OFFSET 1 - -#if !NRF_802154_USE_RAW_API -/** Static transmit buffer used by @sa nrf_802154_transmit() family of functions. - * - * If none of functions using this buffer is called and link time optimization is enabled, this - * buffer should be removed by linker. - */ -static uint8_t m_tx_buffer[RAW_PAYLOAD_OFFSET + MAX_PACKET_SIZE]; - -/** - * @brief Fill transmit buffer with given data. - * - * @param[in] p_data Pointer to array containing payload of a data to transmit. The array - * should exclude PHR or FCS fields of 802.15.4 frame. - * @param[in] length Length of given frame. This value shall exclude PHR and FCS fields from - * the given frame (exact size of buffer pointed by @p p_data). - */ -static void tx_buffer_fill(const uint8_t * p_data, uint8_t length) -{ - assert(length <= MAX_PACKET_SIZE - FCS_SIZE); - - m_tx_buffer[RAW_LENGTH_OFFSET] = length + FCS_SIZE; - memcpy(&m_tx_buffer[RAW_PAYLOAD_OFFSET], p_data, length); -} - -#endif // !NRF_802154_USE_RAW_API - -/** - * @brief Get timestamp of the last received frame. - * - * @note This function increments the returned value by 1 us if the timestamp is equal to the - * @ref NRF_802154_NO_TIMESTAMP value to indicate that the timestamp is available. - * - * @returns Timestamp [us] of the last received frame or @ref NRF_802154_NO_TIMESTAMP if - * the timestamp is inaccurate. - */ -static uint32_t last_rx_frame_timestamp_get(void) -{ -#if NRF_802154_FRAME_TIMESTAMP_ENABLED - uint32_t timestamp; - bool timestamp_received = nrf_802154_timer_coord_timestamp_get(×tamp); - - if (!timestamp_received) - { - timestamp = NRF_802154_NO_TIMESTAMP; - } - else - { - if (timestamp == NRF_802154_NO_TIMESTAMP) - { - timestamp++; - } - } - - return timestamp; -#else // NRF_802154_FRAME_TIMESTAMP_ENABLED - return NRF_802154_NO_TIMESTAMP; -#endif // NRF_802154_FRAME_TIMESTAMP_ENABLED -} - -void nrf_802154_channel_set(uint8_t channel) -{ - bool changed = nrf_802154_pib_channel_get() != channel; - - nrf_802154_pib_channel_set(channel); - - if (changed) - { - nrf_802154_request_channel_update(); - } -} - -uint8_t nrf_802154_channel_get(void) -{ - return nrf_802154_pib_channel_get(); -} - -void nrf_802154_tx_power_set(int8_t power) -{ - nrf_802154_pib_tx_power_set(power); -} - -int8_t nrf_802154_tx_power_get(void) -{ - return nrf_802154_pib_tx_power_get(); -} - -void nrf_802154_temperature_changed(void) -{ - nrf_802154_request_cca_cfg_update(); -} - -void nrf_802154_pan_id_set(const uint8_t * p_pan_id) -{ - nrf_802154_pib_pan_id_set(p_pan_id); -} - -void nrf_802154_extended_address_set(const uint8_t * p_extended_address) -{ - nrf_802154_pib_extended_address_set(p_extended_address); -} - -void nrf_802154_short_address_set(const uint8_t * p_short_address) -{ - nrf_802154_pib_short_address_set(p_short_address); -} - -int8_t nrf_802154_dbm_from_energy_level_calculate(uint8_t energy_level) -{ - return ED_MIN_DBM + (energy_level / ED_RESULT_FACTOR); -} - -uint8_t nrf_802154_ccaedthres_from_dbm_calculate(int8_t dbm) -{ - return dbm - ED_MIN_DBM; -} - -uint32_t nrf_802154_first_symbol_timestamp_get(uint32_t end_timestamp, uint8_t psdu_length) -{ - uint32_t frame_symbols = PHY_SHR_SYMBOLS; - - frame_symbols += (PHR_SIZE + psdu_length) * PHY_SYMBOLS_PER_OCTET; - - return end_timestamp - (frame_symbols * PHY_US_PER_SYMBOL); -} - -void nrf_802154_init(void) -{ - nrf_802154_ack_data_init(); - nrf_802154_core_init(); - nrf_802154_clock_init(); - nrf_802154_critical_section_init(); - nrf_802154_debug_init(); - nrf_802154_notification_init(); - nrf_802154_lp_timer_init(); - nrf_802154_pib_init(); - nrf_802154_priority_drop_init(); - nrf_802154_random_init(); - nrf_802154_request_init(); - nrf_802154_rsch_crit_sect_init(); - nrf_802154_rsch_init(); - nrf_802154_rx_buffer_init(); - nrf_802154_temperature_init(); - nrf_802154_timer_coord_init(); - nrf_802154_timer_sched_init(); -} - -void nrf_802154_deinit(void) -{ - nrf_802154_timer_sched_deinit(); - nrf_802154_timer_coord_uninit(); - nrf_802154_temperature_deinit(); - nrf_802154_rsch_uninit(); - nrf_802154_random_deinit(); - nrf_802154_lp_timer_deinit(); - nrf_802154_clock_deinit(); - nrf_802154_core_deinit(); -} - -#if !NRF_802154_INTERNAL_RADIO_IRQ_HANDLING -void nrf_802154_radio_irq_handler(void) -{ - nrf_802154_core_irq_handler(); -} - -#endif // !NRF_802154_INTERNAL_RADIO_IRQ_HANDLING - -#if ENABLE_FEM -void nrf_802154_fem_control_cfg_set(nrf_802154_fem_control_cfg_t const * const p_cfg) -{ - nrf_fem_interface_config_t config; - - nrf_fem_interface_configuration_get(&config); - - config.lna_pin_config.active_high = p_cfg->lna_cfg.active_high; - config.lna_pin_config.enable = p_cfg->lna_cfg.enable; - config.lna_pin_config.gpio_pin = p_cfg->lna_cfg.gpio_pin; - config.lna_pin_config.gpiote_ch_id = p_cfg->lna_gpiote_ch_id; - - config.pa_pin_config.active_high = p_cfg->pa_cfg.active_high; - config.pa_pin_config.enable = p_cfg->pa_cfg.enable; - config.pa_pin_config.gpio_pin = p_cfg->pa_cfg.gpio_pin; - config.pa_pin_config.gpiote_ch_id = p_cfg->pa_gpiote_ch_id; - - config.ppi_ch_id_set = p_cfg->ppi_ch_id_set; - config.ppi_ch_id_clr = p_cfg->ppi_ch_id_clr; - - nrf_fem_interface_configuration_set(&config); -} - -void nrf_802154_fem_control_cfg_get(nrf_802154_fem_control_cfg_t * p_cfg) -{ - nrf_fem_interface_config_t config; - - nrf_fem_interface_configuration_get(&config); - - p_cfg->lna_cfg.active_high = config.lna_pin_config.active_high; - p_cfg->lna_cfg.enable = config.lna_pin_config.enable; - p_cfg->lna_cfg.gpio_pin = config.lna_pin_config.gpio_pin; - - p_cfg->pa_cfg.active_high = config.pa_pin_config.active_high; - p_cfg->pa_cfg.enable = config.pa_pin_config.enable; - p_cfg->pa_cfg.gpio_pin = config.pa_pin_config.gpio_pin; - - p_cfg->lna_gpiote_ch_id = config.lna_pin_config.gpiote_ch_id; - p_cfg->pa_gpiote_ch_id = config.pa_pin_config.gpiote_ch_id; - - p_cfg->ppi_ch_id_clr = config.ppi_ch_id_clr; - p_cfg->ppi_ch_id_set = config.ppi_ch_id_set; -} - -#endif // ENABLE_FEM - -nrf_802154_state_t nrf_802154_state_get(void) -{ - switch (nrf_802154_core_state_get()) - { - case RADIO_STATE_SLEEP: - case RADIO_STATE_FALLING_ASLEEP: - return NRF_802154_STATE_SLEEP; - - case RADIO_STATE_RX: - case RADIO_STATE_TX_ACK: - return NRF_802154_STATE_RECEIVE; - - case RADIO_STATE_CCA_TX: - case RADIO_STATE_TX: - case RADIO_STATE_RX_ACK: - return NRF_802154_STATE_TRANSMIT; - - case RADIO_STATE_ED: - return NRF_802154_STATE_ENERGY_DETECTION; - - case RADIO_STATE_CCA: - return NRF_802154_STATE_CCA; - - case RADIO_STATE_CONTINUOUS_CARRIER: - return NRF_802154_STATE_CONTINUOUS_CARRIER; - } - - return NRF_802154_STATE_INVALID; -} - -bool nrf_802154_sleep(void) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_SLEEP); - - result = nrf_802154_request_sleep(NRF_802154_TERM_802154); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_SLEEP); - return result; -} - -nrf_802154_sleep_error_t nrf_802154_sleep_if_idle(void) -{ - nrf_802154_sleep_error_t result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_SLEEP); - - result = - nrf_802154_request_sleep(NRF_802154_TERM_NONE) ? NRF_802154_SLEEP_ERROR_NONE : - NRF_802154_SLEEP_ERROR_BUSY; - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_SLEEP); - return result; -} - -bool nrf_802154_receive(void) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RECEIVE); - - result = nrf_802154_request_receive(NRF_802154_TERM_802154, REQ_ORIG_HIGHER_LAYER, NULL, true); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RECEIVE); - return result; -} - -#if NRF_802154_USE_RAW_API -bool nrf_802154_transmit_raw(const uint8_t * p_data, bool cca) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TRANSMIT); - - result = nrf_802154_request_transmit(NRF_802154_TERM_NONE, - REQ_ORIG_HIGHER_LAYER, - p_data, - cca, - false, - NULL); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TRANSMIT); - return result; -} - -#else // NRF_802154_USE_RAW_API - -bool nrf_802154_transmit(const uint8_t * p_data, uint8_t length, bool cca) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TRANSMIT); - - tx_buffer_fill(p_data, length); - result = nrf_802154_request_transmit(NRF_802154_TERM_NONE, - REQ_ORIG_HIGHER_LAYER, - m_tx_buffer, - cca, - false, - NULL); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TRANSMIT); - return result; -} - -#endif // NRF_802154_USE_RAW_API - -bool nrf_802154_transmit_raw_at(const uint8_t * p_data, - bool cca, - uint32_t t0, - uint32_t dt, - uint8_t channel) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TRANSMIT_AT); - - result = nrf_802154_delayed_trx_transmit(p_data, cca, t0, dt, channel); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TRANSMIT_AT); - return result; -} - -bool nrf_802154_transmit_at_cancel(void) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TRANSMIT_AT_CANCEL); - - result = nrf_802154_delayed_trx_transmit_cancel(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TRANSMIT_AT_CANCEL); - return result; -} - -bool nrf_802154_receive_at(uint32_t t0, - uint32_t dt, - uint32_t timeout, - uint8_t channel) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RECEIVE_AT); - - result = nrf_802154_delayed_trx_receive(t0, dt, timeout, channel); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RECEIVE_AT); - return result; -} - -bool nrf_802154_receive_at_cancel(void) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RECEIVE_AT_CANCEL); - - result = nrf_802154_delayed_trx_receive_cancel(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RECEIVE_AT_CANCEL); - return result; -} - -bool nrf_802154_energy_detection(uint32_t time_us) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_ENERGY_DETECTION); - - result = nrf_802154_request_energy_detection(NRF_802154_TERM_NONE, time_us); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_ENERGY_DETECTION); - return result; -} - -bool nrf_802154_cca(void) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CCA); - - result = nrf_802154_request_cca(NRF_802154_TERM_NONE); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CCA); - return result; -} - -bool nrf_802154_continuous_carrier(void) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CONTINUOUS_CARRIER); - - result = nrf_802154_request_continuous_carrier(NRF_802154_TERM_NONE); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CONTINUOUS_CARRIER); - return result; -} - -#if NRF_802154_USE_RAW_API - -void nrf_802154_buffer_free_raw(uint8_t * p_data) -{ - bool result; - rx_buffer_t * p_buffer = (rx_buffer_t *)p_data; - - assert(p_buffer->free == false); - (void)p_buffer; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_BUFFER_FREE); - - result = nrf_802154_request_buffer_free(p_data); - assert(result); - (void)result; - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_BUFFER_FREE); -} - -bool nrf_802154_buffer_free_immediately_raw(uint8_t * p_data) -{ - bool result; - rx_buffer_t * p_buffer = (rx_buffer_t *)p_data; - - assert(p_buffer->free == false); - (void)p_buffer; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_BUFFER_FREE); - - result = nrf_802154_request_buffer_free(p_data); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_BUFFER_FREE); - return result; -} - -#else // NRF_802154_USE_RAW_API - -void nrf_802154_buffer_free(uint8_t * p_data) -{ - bool result; - rx_buffer_t * p_buffer = (rx_buffer_t *)(p_data - RAW_PAYLOAD_OFFSET); - - assert(p_buffer->free == false); - (void)p_buffer; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_BUFFER_FREE); - - result = nrf_802154_request_buffer_free(p_data - RAW_PAYLOAD_OFFSET); - assert(result); - (void)result; - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_BUFFER_FREE); -} - -bool nrf_802154_buffer_free_immediately(uint8_t * p_data) -{ - bool result; - rx_buffer_t * p_buffer = (rx_buffer_t *)(p_data - RAW_PAYLOAD_OFFSET); - - assert(p_buffer->free == false); - (void)p_buffer; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_BUFFER_FREE); - - result = nrf_802154_request_buffer_free(p_data - RAW_PAYLOAD_OFFSET); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_BUFFER_FREE); - return result; -} - -#endif // NRF_802154_USE_RAW_API - -bool nrf_802154_rssi_measure_begin(void) -{ - return nrf_802154_request_rssi_measure(); -} - -int8_t nrf_802154_rssi_last_get(void) -{ - int8_t result = 0; - - if (!nrf_802154_request_rssi_measurement_get(&result)) - { - result = NRF_802154_RSSI_INVALID; - } - - return result; -} - -bool nrf_802154_promiscuous_get(void) -{ - return nrf_802154_pib_promiscuous_get(); -} - -void nrf_802154_promiscuous_set(bool enabled) -{ - nrf_802154_pib_promiscuous_set(enabled); -} - -void nrf_802154_auto_ack_set(bool enabled) -{ - nrf_802154_pib_auto_ack_set(enabled); -} - -bool nrf_802154_auto_ack_get(void) -{ - return nrf_802154_pib_auto_ack_get(); -} - -bool nrf_802154_pan_coord_get(void) -{ - return nrf_802154_pib_pan_coord_get(); -} - -void nrf_802154_pan_coord_set(bool enabled) -{ - nrf_802154_pib_pan_coord_set(enabled); -} - -void nrf_802154_src_addr_matching_method_set(nrf_802154_src_addr_match_t match_method) -{ - nrf_802154_ack_data_src_addr_matching_method_set(match_method); -} - -bool nrf_802154_ack_data_set(const uint8_t * p_addr, - bool extended, - const void * p_data, - uint16_t length, - uint8_t data_type) -{ - return nrf_802154_ack_data_for_addr_set(p_addr, extended, data_type, p_data, length); -} - -bool nrf_802154_ack_data_clear(const uint8_t * p_addr, bool extended, uint8_t data_type) -{ - return nrf_802154_ack_data_for_addr_clear(p_addr, extended, data_type); -} - -void nrf_802154_auto_pending_bit_set(bool enabled) -{ - nrf_802154_ack_data_enable(enabled); -} - -bool nrf_802154_pending_bit_for_addr_set(const uint8_t * p_addr, bool extended) -{ - return nrf_802154_ack_data_for_addr_set(p_addr, - extended, - NRF_802154_ACK_DATA_PENDING_BIT, - NULL, - 0); -} - -bool nrf_802154_pending_bit_for_addr_clear(const uint8_t * p_addr, bool extended) -{ - return nrf_802154_ack_data_for_addr_clear(p_addr, extended, NRF_802154_ACK_DATA_PENDING_BIT); -} - -void nrf_802154_pending_bit_for_addr_reset(bool extended) -{ - nrf_802154_ack_data_reset(extended, NRF_802154_ACK_DATA_PENDING_BIT); -} - -void nrf_802154_cca_cfg_set(const nrf_802154_cca_cfg_t * p_cca_cfg) -{ - nrf_802154_pib_cca_cfg_set(p_cca_cfg); - - nrf_802154_request_cca_cfg_update(); -} - -void nrf_802154_cca_cfg_get(nrf_802154_cca_cfg_t * p_cca_cfg) -{ - nrf_802154_pib_cca_cfg_get(p_cca_cfg); -} - -#if NRF_802154_CSMA_CA_ENABLED -#if NRF_802154_USE_RAW_API - -void nrf_802154_transmit_csma_ca_raw(const uint8_t * p_data) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CSMACA); - - nrf_802154_csma_ca_start(p_data); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CSMACA); -} - -#else // NRF_802154_USE_RAW_API - -void nrf_802154_transmit_csma_ca(const uint8_t * p_data, uint8_t length) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CSMACA); - - tx_buffer_fill(p_data, length); - - nrf_802154_csma_ca_start(m_tx_buffer); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CSMACA); -} - -#endif // NRF_802154_USE_RAW_API -#endif // NRF_802154_CSMA_CA_ENABLED - -#if NRF_802154_ACK_TIMEOUT_ENABLED - -void nrf_802154_ack_timeout_set(uint32_t time) -{ - nrf_802154_ack_timeout_time_set(time); -} - -#endif // NRF_802154_ACK_TIMEOUT_ENABLED - -__WEAK void nrf_802154_tx_ack_started(uint8_t * p_data, int8_t power, uint8_t lqi) -{ - (void)p_data; - (void)power; - (void)lqi; -} - -#if NRF_802154_USE_RAW_API -__WEAK void nrf_802154_received_raw(uint8_t * p_data, int8_t power, uint8_t lqi) -{ - nrf_802154_received_timestamp_raw(p_data, power, lqi, last_rx_frame_timestamp_get()); -} - -__WEAK void nrf_802154_received_timestamp_raw(uint8_t * p_data, - int8_t power, - uint8_t lqi, - uint32_t time) -{ - (void)power; - (void)lqi; - (void)time; - - nrf_802154_buffer_free_raw(p_data); -} - -#else // NRF_802154_USE_RAW_API - -__WEAK void nrf_802154_received(uint8_t * p_data, uint8_t length, int8_t power, uint8_t lqi) -{ - nrf_802154_received_timestamp(p_data, length, power, lqi, last_rx_frame_timestamp_get()); -} - -__WEAK void nrf_802154_received_timestamp(uint8_t * p_data, - uint8_t length, - int8_t power, - uint8_t lqi, - uint32_t time) -{ - (void)length; - (void)power; - (void)lqi; - (void)time; - - nrf_802154_buffer_free(p_data); -} - -#endif // !NRF_802154_USE_RAW_API - -__WEAK void nrf_802154_receive_failed(nrf_802154_rx_error_t error) -{ - (void)error; -} - -__WEAK void nrf_802154_tx_started(const uint8_t * p_frame) -{ - (void)p_frame; -} - -#if NRF_802154_USE_RAW_API -__WEAK void nrf_802154_transmitted_raw(const uint8_t * p_frame, - uint8_t * p_ack, - int8_t power, - uint8_t lqi) -{ - uint32_t timestamp = (p_ack == NULL) ? NRF_802154_NO_TIMESTAMP : last_rx_frame_timestamp_get(); - - nrf_802154_transmitted_timestamp_raw(p_frame, p_ack, power, lqi, timestamp); -} - -__WEAK void nrf_802154_transmitted_timestamp_raw(const uint8_t * p_frame, - uint8_t * p_ack, - int8_t power, - uint8_t lqi, - uint32_t time) -{ - (void)p_frame; - (void)power; - (void)lqi; - (void)time; - - if (p_ack != NULL) - { - nrf_802154_buffer_free_raw(p_ack); - } -} - -#else // NRF_802154_USE_RAW_API - -__WEAK void nrf_802154_transmitted(const uint8_t * p_frame, - uint8_t * p_ack, - uint8_t length, - int8_t power, - uint8_t lqi) -{ - uint32_t timestamp = (p_ack == NULL) ? NRF_802154_NO_TIMESTAMP : last_rx_frame_timestamp_get(); - - nrf_802154_transmitted_timestamp(p_frame, p_ack, length, power, lqi, timestamp); -} - -__WEAK void nrf_802154_transmitted_timestamp(const uint8_t * p_frame, - uint8_t * p_ack, - uint8_t length, - int8_t power, - uint8_t lqi, - uint32_t time) -{ - (void)p_frame; - (void)length; - (void)power; - (void)lqi; - (void)time; - - if (p_ack != NULL) - { - nrf_802154_buffer_free(p_ack); - } -} - -#endif // NRF_802154_USE_RAW_API - -__WEAK void nrf_802154_transmit_failed(const uint8_t * p_frame, nrf_802154_tx_error_t error) -{ - (void)p_frame; - (void)error; -} - -__WEAK void nrf_802154_energy_detected(uint8_t result) -{ - (void)result; -} - -__WEAK void nrf_802154_energy_detection_failed(nrf_802154_ed_error_t error) -{ - (void)error; -} - -__WEAK void nrf_802154_cca_done(bool channel_free) -{ - (void)channel_free; -} - -__WEAK void nrf_802154_cca_failed(nrf_802154_cca_error_t error) -{ - (void)error; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154.h deleted file mode 100644 index 56be11b8a..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154.h +++ /dev/null @@ -1,1248 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @defgroup nrf_802154 802.15.4 radio driver - * @{ - * - */ - -#ifndef NRF_802154_H_ -#define NRF_802154_H_ - -#include -#include - -#include "nrf_802154_config.h" -#include "nrf_802154_types.h" - -#include "nrf_ppi.h" - -#if ENABLE_FEM -#include "fem/nrf_fem_protocol_api.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Timestamp value indicating that the timestamp is inaccurate. - */ -#define NRF_802154_NO_TIMESTAMP 0 - -/** - * @brief Initializes the 802.15.4 driver. - * - * This function initializes the RADIO peripheral in the @ref RADIO_STATE_SLEEP state. - * - * @note This function is to be called once, before any other functions from this module. - */ -void nrf_802154_init(void); - -/** - * @brief Deinitializes the 802.15.4 driver. - * - * This function deinitializes the RADIO peripheral and resets it to the default state. - */ -void nrf_802154_deinit(void); - -#if !NRF_802154_INTERNAL_RADIO_IRQ_HANDLING -/** - * @brief Handles the interrupt request from the RADIO peripheral. - * - * @note If NRF_802154_INTERNAL_RADIO_IRQ_HANDLING is enabled, the driver internally handles the - * RADIO IRQ, and this function must not be called. - * - * This function is intended for use in an operating system environment, where the OS handles IRQ - * and indirectly passes it to the driver, or with a RAAL implementation that indirectly passes - * radio IRQ to the driver (that is, SoftDevice). - */ -void nrf_802154_radio_irq_handler(void); -#endif // !NRF_802154_INTERNAL_RADIO_IRQ_HANDLING - -/** - * @brief Sets the channel on which the radio is to operate. - * - * @param[in] channel Channel number (11-26). - */ -void nrf_802154_channel_set(uint8_t channel); - -/** - * @brief Gets the channel on which the radio operates. - * - * @returns Channel number (11-26). - */ -uint8_t nrf_802154_channel_get(void); - -/** - * @brief Sets the transmit power. - * - * @note The driver recalculates the requested value to the nearest value accepted by the hardware. - * The calculation result is rounded up. - * - * @param[in] power Transmit power in dBm. - */ -void nrf_802154_tx_power_set(int8_t power); - -/** - * @brief Gets the currently set transmit power. - * - * @returns Currently used transmit power, in dBm. - */ -int8_t nrf_802154_tx_power_get(void); - -/** - * @defgroup nrf_802154_frontend Frontend Module management - * @{ - */ - -#if ENABLE_FEM - -/** Structure that contains the run-time configuration of the Frontend Module. */ -typedef nrf_fem_control_cfg_t nrf_802154_fem_control_cfg_t; - -/** Macro with the default configuration of the Frontend Module. */ -#define NRF_802154_FEM_DEFAULT_SETTINGS \ - ((nrf_802154_fem_control_cfg_t) { \ - .pa_cfg = { \ - .enable = 1, \ - .active_high = 1, \ - .gpio_pin = NRF_FEM_CONTROL_DEFAULT_PA_PIN, \ - }, \ - .lna_cfg = { \ - .enable = 1, \ - .active_high = 1, \ - .gpio_pin = NRF_FEM_CONTROL_DEFAULT_LNA_PIN, \ - }, \ - .pa_gpiote_ch_id = NRF_FEM_CONTROL_DEFAULT_PA_GPIOTE_CHANNEL, \ - .lna_gpiote_ch_id = NRF_FEM_CONTROL_DEFAULT_LNA_GPIOTE_CHANNEL, \ - .ppi_ch_id_set = NRF_FEM_CONTROL_DEFAULT_SET_PPI_CHANNEL, \ - .ppi_ch_id_clr = NRF_FEM_CONTROL_DEFAULT_CLR_PPI_CHANNEL, \ - }) - -/** - * @brief Sets the PA & LNA GPIO toggle configuration. - * - * @note This function must not be called when the radio is in use. - * - * @note This function is deprecated. Only to be used with Skyworks module. - * Consider using nrf_fem_interface_configuration_set instead. - * - * @param[in] p_cfg Pointer to the PA & LNA GPIO toggle configuration. - * - */ -void nrf_802154_fem_control_cfg_set(nrf_802154_fem_control_cfg_t const * const p_cfg); - -/** - * @brief Get the PA & LNA GPIO toggle configuration. - * - * @param[out] p_cfg Pointer to the structure for the PA & LNA GPIO toggle configuration. - * - * @note This function is deprecated. Only to be used with Skyworks module. - * Consider using nrf_fem_interface_configuration_get instead. - * - */ -void nrf_802154_fem_control_cfg_get(nrf_802154_fem_control_cfg_t * p_cfg); - -#endif // ENABLE_FEM - -/** - * @} - * @defgroup nrf_802154_addresses Setting addresses and PAN ID of the device - * @{ - */ - -/** - * @brief Sets the PAN ID used by the device. - * - * @param[in] p_pan_id Pointer to the PAN ID (2 bytes, little-endian). - * - * This function makes a copy of the PAN ID. - */ -void nrf_802154_pan_id_set(const uint8_t * p_pan_id); - -/** - * @brief Sets the extended address of the device. - * - * @param[in] p_extended_address Pointer to the extended address (8 bytes, little-endian). - * - * This function makes a copy of the address. - */ -void nrf_802154_extended_address_set(const uint8_t * p_extended_address); - -/** - * @brief Sets the short address of the device. - * - * @param[in] p_short_address Pointer to the short address (2 bytes, little-endian). - * - * This function makes a copy of the address. - */ -void nrf_802154_short_address_set(const uint8_t * p_short_address); - -/** - * @} - * @defgroup nrf_802154_data Functions to calculate data given by the driver - * @{ - */ - -/** - * @brief Converts the energy level received during the energy detection procedure to a dBm value. - * - * @param[in] energy_level Energy level passed by @ref nrf_802154_energy_detected. - * - * @return Result of the energy detection procedure in dBm. - */ -int8_t nrf_802154_dbm_from_energy_level_calculate(uint8_t energy_level); - -/** - * @brief Converts a given dBm level to a CCA energy detection threshold value. - * - * @param[in] dbm Energy level in dBm used to calculate the CCAEDTHRES value. - * - * @return Energy level value corresponding to the given dBm level that is to be written to - * the CCACTRL register. - */ -uint8_t nrf_802154_ccaedthres_from_dbm_calculate(int8_t dbm); - -/** - * @brief Calculates the timestamp of the first symbol of the preamble in a received frame. - * - * @param[in] end_timestamp Timestamp of the end of the last symbol in the frame, - * in microseconds. - * @param[in] psdu_length Number of bytes in the frame PSDU. - * - * @return Timestamp of the beginning of the first preamble symbol of a given frame, - * in microseconds. - */ -uint32_t nrf_802154_first_symbol_timestamp_get(uint32_t end_timestamp, uint8_t psdu_length); - -/** - * @} - * @defgroup nrf_802154_transitions Functions to request FSM transitions and check current state - * @{ - */ - -/** - * @brief Gets the current state of the radio. - */ -nrf_802154_state_t nrf_802154_state_get(void); - -/** - * @brief Changes the radio state to the @ref RADIO_STATE_SLEEP state. - * - * The sleep state is the lowest power state. In this state, the radio cannot transmit or receive - * frames. It is the only state in which the driver releases the high-frequency clock and does not - * request timeslots from a radio arbiter. - * - * @note If another module requests it, the high-frequency clock may be enabled even in the radio - * sleep state. - * - * @retval true The radio changes its state to the low power mode. - * @retval false The driver could not schedule changing state. - */ -bool nrf_802154_sleep(void); - -/** - * @brief Changes the radio state to the @ref RADIO_STATE_SLEEP state if the radio is idle. - * - * The sleep state is the lowest power state. In this state, the radio cannot transmit or receive - * frames. It is the only state in which the driver releases the high-frequency clock and does not - * request timeslots from a radio arbiter. - * - * @note If another module requests it, the high-frequency clock may be enabled even in the radio - * sleep state. - * - * @retval NRF_802154_SLEEP_ERROR_NONE The radio changes its state to the low power mode. - * @retval NRF_802154_SLEEP_ERROR_BUSY The driver could not schedule changing state. - */ -nrf_802154_sleep_error_t nrf_802154_sleep_if_idle(void); - -/** - * @brief Changes the radio state to @ref RADIO_STATE_RX. - * - * In the receive state, the radio receives frames and may automatically send ACK frames when - * appropriate. The received frame is reported to the higher layer by a call to - * @ref nrf_802154_received. - * - * @retval true The radio enters the receive state. - * @retval false The driver could not enter the receive state. - */ -bool nrf_802154_receive(void); - -/** - * @brief Requests reception at the specified time. - * - * This function works as a delayed version of @ref nrf_802154_receive. It is asynchronous. - * It queues the delayed reception using the Radio Scheduler module. - * If the delayed reception cannot be performed (@ref nrf_802154_receive_at would return false) - * or the requested reception timeslot is denied, @ref nrf_drv_radio802154_receive_failed is called - * with the @ref NRF_802154_RX_ERROR_DELAYED_TIMESLOT_DENIED argument. - * - * If the requested reception time is in the past, the function returns false and does not - * schedule reception. - * - * A scheduled reception can be cancelled by a call to @ref nrf_802154_receive_at_cancel. - * - * @param[in] t0 Base of delay time - absolute time used by the Timer Scheduler, - * in microseconds (us). - * @param[in] dt Delta of delay time from @p t0, in microseconds (us). - * @param[in] timeout Reception timeout (counted from @p t0 + @p dt), in microseconds (us). - * @param[in] channel Radio channel on which the frame is to be received. - * - * @retval true The reception procedure was scheduled. - * @retval false The driver could not schedule the reception procedure. - */ -bool nrf_802154_receive_at(uint32_t t0, - uint32_t dt, - uint32_t timeout, - uint8_t channel); - -/** - * @brief Cancels a delayed reception scheduled by a call to @ref nrf_802154_receive_at. - * - * If the receive window has been scheduled but has not started yet, this function prevents - * entering the receive window. If the receive window has been scheduled and has already started, - * the radio remains in the receive state, but a window timeout will not be reported. - * - * @retval true The delayed reception was scheduled and successfully cancelled. - * @retval false No delayed reception was scheduled. - */ -bool nrf_802154_receive_at_cancel(void); - -#if NRF_802154_USE_RAW_API -/** - * @brief Changes the radio state to @ref RADIO_STATE_TX. - * - * @note If the CPU is halted or interrupted while this function is executed, - * @ref nrf_802154_transmitted or @ref nrf_802154_transmit_failed can be called before this - * function returns a result. - * - * @note This function is implemented in zero-copy fashion. It passes the given buffer pointer to - * the RADIO peripheral. - * - * In the transmit state, the radio transmits a given frame. If requested, it waits for - * an ACK frame. Depending on @ref NRF_802154_ACK_TIMEOUT_ENABLED, the radio driver automatically - * stops waiting for an ACK frame or waits indefinitely for an ACK frame. If it is configured to - * wait, the MAC layer is responsible for calling @ref nrf_802154_receive or - * @ref nrf_802154_sleep after the ACK timeout. - * The transmission result is reported to the higher layer by calls to @ref nrf_802154_transmitted - * or @ref nrf_802154_transmit_failed. - * - * @verbatim - * p_data - * v - * +-----+-----------------------------------------------------------+------------+ - * | PHR | MAC header and payload | FCS | - * +-----+-----------------------------------------------------------+------------+ - * | | - * | <---------------------------- PHR -----------------------------------> | - * @endverbatim - * - * @param[in] p_data Pointer to the array with data to transmit. The first byte must contain frame - * length (including PHR and FCS). The following bytes contain data. The CRC is - * computed automatically by the radio hardware. Therefore, the FCS field can - * contain any bytes. - * @param[in] cca If the driver is to perform a CCA procedure before transmission. - * - * @retval true The transmission procedure was scheduled. - * @retval false The driver could not schedule the transmission procedure. - */ -bool nrf_802154_transmit_raw(const uint8_t * p_data, bool cca); - -#else // NRF_802154_USE_RAW_API - -/** - * @brief Changes the radio state to transmit. - * - * @note If the CPU is halted or interrupted while this function is executed, - * @ref nrf_802154_transmitted or @ref nrf_802154_transmit_failed must be called before this - * function returns a result. - * - * @note This function copies the given buffer. It maintains an internal buffer, which is used to - * make a frame copy. To prevent unnecessary memory consumption and to perform zero-copy - * transmission, use @ref nrf_802154_transmit_raw instead. - * - * In the transmit state, the radio transmits a given frame. If requested, it waits for - * an ACK frame. Depending on @ref NRF_802154_ACK_TIMEOUT_ENABLED, the radio driver automatically - * stops waiting for an ACK frame or waits indefinitely for an ACK frame. If it is configured to - * wait, the MAC layer is responsible for calling @ref nrf_802154_receive or - * @ref nrf_802154_sleep after the ACK timeout. - * The transmission result is reported to the higher layer by calls to @ref nrf_802154_transmitted - * or @ref nrf_802154_transmit_failed. - * - * @verbatim - * p_data - * v - * +-----+-----------------------------------------------------------+------------+ - * | PHR | MAC header and payload | FCS | - * +-----+-----------------------------------------------------------+------------+ - * | | - * | <------------------ length -----------------------------> | - * @endverbatim - * - * @param[in] p_data Pointer to the array with the payload of data to transmit. The array should - * exclude PHR or FCS fields of the 802.15.4 frame. - * @param[in] length Length of the given frame. This value must exclude PHR and FCS fields from - * the given frame (exact size of buffer pointed to by @p p_data). - * @param[in] cca If the driver is to perform a CCA procedure before transmission. - * - * @retval true The transmission procedure was scheduled. - * @retval false The driver could not schedule the transmission procedure. - */ -bool nrf_802154_transmit(const uint8_t * p_data, uint8_t length, bool cca); - -#endif // NRF_802154_USE_RAW_API - -/** - * @brief Requests transmission at the specified time. - * - * @note This function is implemented in a zero-copy fashion. It passes the given buffer pointer to - * the RADIO peripheral. - * - * This function works as a delayed version of @ref nrf_802154_transmit_raw. It is asynchronous. - * It queues the delayed transmission using the Radio Scheduler module and performs it - * at the specified time. - * - * If the delayed transmission is successfully performed, @ref nrf_802154_transmitted is called. - * If the delayed transmission cannot be performed (@ref nrf_802154_transmit_raw would return false) - * or the requested transmission timeslot is denied, @ref nrf_802154_transmit_failed with the - * @ref NRF_802154_TX_ERROR_TIMESLOT_DENIED argument is called. - * - * This function is designed to transmit the first symbol of SHR at the given time. - * - * If the requested transmission time is in the past, the function returns false and does not - * schedule transmission. - * - * A successfully scheduled transmission can be cancelled by a call - * to @ref nrf_802154_transmit_at_cancel. - * - * @param[in] p_data Pointer to the array with data to transmit. The first byte must contain - * the frame length (including PHR and FCS). The following bytes contain data. - * The CRC is computed automatically by the radio hardware. Therefore, the FCS - * field can contain any bytes. - * @param[in] cca If the driver is to perform a CCA procedure before transmission. - * @param[in] t0 Base of delay time - absolute time used by the Timer Scheduler, - * in microseconds (us). - * @param[in] dt Delta of delay time from @p t0, in microseconds (us). - * @param[in] channel Radio channel on which the frame is to be transmitted. - * - * @retval true The transmission procedure was scheduled. - * @retval false The driver could not schedule the transmission procedure. - */ -bool nrf_802154_transmit_raw_at(const uint8_t * p_data, - bool cca, - uint32_t t0, - uint32_t dt, - uint8_t channel); - -/** - * @brief Cancels a delayed transmission scheduled by a call to @ref nrf_802154_transmit_raw_at. - * - * If a delayed transmission has been scheduled but the transmission has not been started yet, - * a call to this function prevents the transmission. If the transmission is ongoing, - * it will not be aborted. - * - * If a delayed transmission has not been scheduled (or has already finished), this function does - * not change state and returns false. - * - * @retval true The delayed transmission was scheduled and successfully cancelled. - * @retval false No delayed transmission was scheduled. - */ -bool nrf_802154_transmit_at_cancel(void); - -/** - * @brief Changes the radio state to energy detection. - * - * In the energy detection state, the radio detects the maximum energy for a given time. - * The result of the detection is reported to the higher layer by @ref nrf_802154_energy_detected. - * - * @note @ref nrf_802154_energy_detected can be called before this function returns a result. - * @note Performing the energy detection procedure can take longer than requested in @p time_us. - * The procedure is performed only during the timeslots granted by a radio arbiter. - * It can be interrupted by other protocols using the radio hardware. If the procedure is - * interrupted, it is automatically continued and the sum of time periods during which the - * procedure is carried out is not less than the requested @p time_us. - * - * @param[in] time_us Duration of energy detection procedure. The given value is rounded up to - * multiplication of 8 symbols (128 us). - * - * @retval true The energy detection procedure was scheduled. - * @retval false The driver could not schedule the energy detection procedure. - */ -bool nrf_802154_energy_detection(uint32_t time_us); - -/** - * @brief Changes the radio state to @ref RADIO_STATE_CCA. - * - * @note @ref nrf_802154_cca_done can be called before this function returns a result. - * - * In the CCA state, the radio verifies if the channel is clear. The result of the verification is - * reported to the higher layer by @ref nrf_802154_cca_done. - * - * @retval true The CCA procedure was scheduled. - * @retval false The driver could not schedule the CCA procedure. - */ -bool nrf_802154_cca(void); - -/** - * @brief Changes the radio state to continuous carrier. - * - * @note When the radio is emitting continuous carrier signals, it blocks all transmissions on the - * selected channel. This function is to be called only during radio tests. Do not - * use it during normal device operation. - * - * @retval true The continuous carrier procedure was scheduled. - * @retval false The driver could not schedule the continuous carrier procedure. - */ -bool nrf_802154_continuous_carrier(void); - -/** - * @} - * @defgroup nrf_802154_calls Calls to higher layer - * @{ - */ - -/** - * @brief Notifies about the start of the ACK frame transmission. - * - * @note This function must be very short to prevent dropping frames by the driver. - * - * @param[in] p_data Pointer to a buffer with PHR and PSDU of the ACK frame. - * @param[in] power RSSI of the received frame. - * @param[in] lqi LQI of the received frame. - */ -extern void nrf_802154_tx_ack_started(uint8_t * p_data, int8_t power, uint8_t lqi); - -#if NRF_802154_USE_RAW_API - -/** - * @brief Notifies that a frame was received. - * - * @note The buffer pointed to by @p p_data is not modified by the radio driver (and cannot be used - * to receive a frame) until @ref nrf_802154_buffer_free_raw is called. - * @note The buffer pointed to by @p p_data may be modified by the function handler (and other - * modules) until @ref nrf_802154_buffer_free_raw is called. - * - * @verbatim - * p_data - * v - * +-----+-----------------------------------------------------------+------------+ - * | PHR | MAC Header and payload | FCS | - * +-----+-----------------------------------------------------------+------------+ - * | | - * | <---------------------------- PHR -----------------------------------> | - * @endverbatim - * - * @param[in] p_data Pointer to a buffer that contains PHR and PSDU of the received frame. - * The first byte in the buffer is the length of the frame (PHR). The following - * bytes contain the frame itself (PSDU). The length byte (PHR) includes FCS. - * FCS is already verified by the hardware and may be modified by the hardware. - * @param[in] power RSSI of the received frame. - * @param[in] lqi LQI of the received frame. - */ -extern void nrf_802154_received_raw(uint8_t * p_data, int8_t power, uint8_t lqi); - -/** - * @brief Notifies that a frame was received at a given time. - * - * This function works like @ref nrf_802154_received_raw and adds a timestamp to the parameter - * list. - * - * @note The received frame usually contains a timestamp. However, due to a race condition, - * the timestamp may be invalid. This erroneous situation is indicated by - * the @ref NRF_802154_NO_TIMESTAMP value of the @p time parameter. - * - * @param[in] p_data Pointer to a buffer that contains PHR and PSDU of the received frame. - * The first byte in the buffer is the length of the frame (PHR). The following - * bytes contain the frame itself (PSDU). The length byte (PHR) includes FCS. - * FCS is already verified by the hardware and may be modified by the hardware. - * @param[in] power RSSI of the received frame. - * @param[in] lqi LQI of the received frame. - * @param[in] time Timestamp taken when the last symbol of the frame was received, in - * microseconds (us), or @ref NRF_802154_NO_TIMESTAMP if the timestamp - * is invalid. - */ -extern void nrf_802154_received_timestamp_raw(uint8_t * p_data, - int8_t power, - uint8_t lqi, - uint32_t time); - -#else // NRF_802154_USE_RAW_API - -/** - * @brief Notifies that a frame was received. - * - * @note The buffer pointed to by @p p_data is not modified by the radio driver (and cannot - * be used to receive a frame) until @ref nrf_802154_buffer_free is called. - * @note The buffer pointed to by @p p_data can be modified by the function handler (and other - * modules) until @ref nrf_802154_buffer_free is called. - * - * @verbatim - * p_data - * v - * +-----+-----------------------------------------------------------+------------+ - * | PHR | MAC Header and payload | FCS | - * +-----+-----------------------------------------------------------+------------+ - * | | - * | <------------------ length -----------------------------> | - * @endverbatim - * - * @param[in] p_data Pointer to a buffer that contains only the payload of the received frame - * (PSDU without FCS). - * @param[in] length Length of the received payload. - * @param[in] power RSSI of the received frame. - * @param[in] lqi LQI of the received frame. - */ -extern void nrf_802154_received(uint8_t * p_data, uint8_t length, int8_t power, uint8_t lqi); - -/** - * @brief Notifies that a frame was received at a given time. - * - * This function works like @ref nrf_802154_received and adds a timestamp to the parameter list. - * - * @note The received frame usually contains a timestamp. However, due to a race condition, - * the timestamp may be invalid. This erroneous situation is indicated by - * the @ref NRF_802154_NO_TIMESTAMP value of the @p time parameter. - * - * @param[in] p_data Pointer to a buffer that contains only the payload of the received frame - * (PSDU without FCS). - * @param[in] length Length of the received payload. - * @param[in] power RSSI of the received frame. - * @param[in] lqi LQI of the received frame. - * @param[in] time Timestamp taken when the last symbol of the frame was received, - * in microseconds (us), or @ref NRF_802154_NO_TIMESTAMP if the timestamp - * is invalid. - */ -extern void nrf_802154_received_timestamp(uint8_t * p_data, - uint8_t length, - int8_t power, - uint8_t lqi, - uint32_t time); - -#endif // !NRF_802154_USE_RAW_API - -/** - * @brief Notifies that the reception of a frame failed. - * - * @param[in] error Error code that indicates the reason of the failure. - */ -extern void nrf_802154_receive_failed(nrf_802154_rx_error_t error); - -/** - * @brief Notifies that transmitting a frame has started. - * - * @note Usually, @ref nrf_802154_transmitted is called shortly after this function. - * However, if the transmit procedure is interrupted, it might happen that - * @ref nrf_802154_transmitted is not called. - * @note This function should be very short to prevent dropping frames by the driver. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame being - * transmitted. - */ -extern void nrf_802154_tx_started(const uint8_t * p_frame); - -#if NRF_802154_USE_RAW_API - -/** - * @brief Notifies that a frame was transmitted. - * - * @note If ACK was requested for the transmitted frame, this function is called after a proper ACK - * is received. If ACK was not requested, this function is called just after transmission has - * ended. - * @note The buffer pointed to by @p p_ack is not modified by the radio driver (and cannot be used - * to receive a frame) until @ref nrf_802154_buffer_free_raw is called. - * @note The buffer pointed to by @p p_ack may be modified by the function handler (and other - * modules) until @ref nrf_802154_buffer_free_raw is called. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the transmitted frame. - * @param[in] p_ack Pointer to a buffer that contains PHR and PSDU of the received ACK. - * The first byte in the buffer is the length of the frame (PHR). The following - * bytes contain the ACK frame itself (PSDU). The length byte (PHR) includes - * FCS. FCS is already verified by the hardware and may be modified by the - * hardware. If ACK was not requested, @p p_ack is set to NULL. - * @param[in] power RSSI of the received frame or 0 if ACK was not requested. - * @param[in] lqi LQI of the received frame or 0 if ACK was not requested. - */ -extern void nrf_802154_transmitted_raw(const uint8_t * p_frame, - uint8_t * p_ack, - int8_t power, - uint8_t lqi); - -/** - * @brief Notifies that a frame was transmitted. - * - * This function works like @ref nrf_802154_transmitted_raw and adds a timestamp to the parameter - * list. - * - * @note @p timestamp may be inaccurate due to software latency (IRQ handling). - * @note @p timestamp granularity depends on the granularity of the timer driver in the - * platform/timer directory. - * @note Including a timestamp for received frames uses resources like CPU time and memory. If the - * timestamp is not required, use @ref nrf_802154_received instead. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the transmitted frame. - * @param[in] p_ack Pointer to a buffer that contains PHR and PSDU of the received ACK. - * The first byte in the buffer is the length of the frame (PHR). The following - * bytes contain the ACK frame itself (PSDU). The length byte (PHR) includes - * FCS. FCS is already verified by the hardware and may be modified by the - * hardware. If ACK was not requested, @p p_ack is set to NULL. - * @param[in] power RSSI of the received frame or 0 if ACK was not requested. - * @param[in] lqi LQI of the received frame or 0 if ACK was not requested. - * @param[in] time Timestamp taken when the last symbol of ACK is received or 0 if ACK was not - * requested. - */ -extern void nrf_802154_transmitted_timestamp_raw(const uint8_t * p_frame, - uint8_t * p_ack, - int8_t power, - uint8_t lqi, - uint32_t time); - -#else // NRF_802154_USE_RAW_API - -/** - * @brief Notifies that a frame was transmitted. - * - * @note If ACK was requested for the transmitted frame, this function is called after a proper ACK - * is received. If ACK was not requested, this function is called just after transmission has - * ended. - * @note The buffer pointed to by @p p_ack is not modified by the radio driver (and cannot - * be used to receive a frame) until @ref nrf_802154_buffer_free is - * called. - * @note The buffer pointed to by @p p_ack may be modified by the function handler (and other - * modules) until @ref nrf_802154_buffer_free is called. - * @note The next higher layer must handle either @ref nrf_802154_transmitted or - * @ref nrf_802154_transmitted_raw. It should not handle both functions. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the transmitted frame. - * @param[in] p_ack Pointer to a buffer that contains only the received ACK payload (PSDU - * excluding FCS). - * If ACK was not requested, @p p_ack is set to NULL. - * @param[in] length Length of the received ACK payload or 0 if ACK was not requested. - * @param[in] power RSSI of the received frame or 0 if ACK was not requested. - * @param[in] lqi LQI of the received frame or 0 if ACK was not requested. - */ -extern void nrf_802154_transmitted(const uint8_t * p_frame, - uint8_t * p_ack, - uint8_t length, - int8_t power, - uint8_t lqi); - -/** - * @brief Notifies that a frame was transmitted. - * - * This function works like @ref nrf_802154_transmitted and adds a timestamp to the parameter - * list. - * - * @note @p timestamp may be inaccurate due to software latency (IRQ handling). - * @note @p timestamp granularity depends on the granularity of the timer driver - * in the platform/timer directory. - * @note Including a timestamp for received frames uses resources like CPU time and memory. If the - * timestamp is not required, use @ref nrf_802154_received instead. - * - * @param[in] p_frame Pointer to the buffer containing PHR and PSDU of the transmitted frame. - * @param[in] p_ack Pointer to the buffer containing only the received ACK payload (PSDU - * excluding FCS). - * If ACK was not requested, @p p_ack is set to NULL. - * @param[in] length Length of the received ACK payload. - * @param[in] power RSSI of the received frame or 0 if ACK was not requested. - * @param[in] lqi LQI of the received frame or 0 if ACK was not requested. - * @param[in] time Timestamp taken when the last symbol of ACK is received or 0 if ACK was not - * requested. - */ -extern void nrf_802154_transmitted_timestamp(const uint8_t * p_frame, - uint8_t * p_ack, - uint8_t length, - int8_t power, - uint8_t lqi, - uint32_t time); - -#endif // !NRF_802154_USE_RAW_API - -/** - * @brief Notifies that a frame was not transmitted due to a busy channel. - * - * This function is called if the transmission procedure fails. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame that was not - * transmitted. - * @param[in] error Reason of the failure. - */ -extern void nrf_802154_transmit_failed(const uint8_t * p_frame, - nrf_802154_tx_error_t error); - -/** - * @brief Notifies that the energy detection procedure finished. - * - * @note This function passes the EnergyLevel defined in the 802.15.4-2006 specification: - * 0x00 - 0xff, proportionally to the detected energy level (dBm above receiver sensitivity). - * To calculate the result in dBm, use @ref nrf_802154_dbm_from_energy_level_calculate. - * - * @param[in] result Maximum energy detected during the energy detection procedure. - */ -extern void nrf_802154_energy_detected(uint8_t result); - -/** - * @brief Notifies that the energy detection procedure failed. - * - * @param[in] error Reason of the failure. - */ -extern void nrf_802154_energy_detection_failed(nrf_802154_ed_error_t error); - -/** - * @brief Notifies that the CCA procedure has finished. - * - * @param[in] channel_free Indication if the channel is free. - */ -extern void nrf_802154_cca_done(bool channel_free); - -/** - * @brief Notifies that the CCA procedure failed. - * - * @param[in] error Reason of the failure. - */ -extern void nrf_802154_cca_failed(nrf_802154_cca_error_t error); - -/** - * @} - * @defgroup nrf_802154_memman Driver memory management - * @{ - */ - -#if NRF_802154_USE_RAW_API - -/** - * @brief Notifies the driver that the buffer containing the received frame is not used anymore. - * - * @note The buffer pointed to by @p p_data may be modified by this function. - * @note This function can be safely called only from the main context. To free the buffer from - * a callback or the IRQ context, use @ref nrf_802154_buffer_free_immediately_raw. - * - * @param[in] p_data Pointer to the buffer containing the received data that is no longer needed - * by the higher layer. - */ -void nrf_802154_buffer_free_raw(uint8_t * p_data); - -/** - * @brief Notifies the driver that the buffer containing the received frame is not used anymore. - * - * @note The buffer pointed to by @p p_data may be modified by this function. - * @note This function can be safely called from any context. If the driver is busy processing - * a request called from a context with lower priority, this function returns false and - * the caller should free the buffer later. - * - * @param[in] p_data Pointer to the buffer containing the received data that is no longer needed - * by the higher layer. - * - * @retval true Buffer was freed successfully. - * @retval false Buffer cannot be freed right now due to ongoing operation. - */ -bool nrf_802154_buffer_free_immediately_raw(uint8_t * p_data); - -#else // NRF_802154_USE_RAW_API - -/** - * @brief Notifies the driver that the buffer containing the received frame is not used anymore. - * - * @note The buffer pointed to by @p p_data may be modified by this function. - * @note This function can be safely called only from the main context. To free the buffer from - * a callback or IRQ context, use @ref nrf_802154_buffer_free_immediately. - * - * @param[in] p_data Pointer to the buffer containing the received data that is no longer needed - * by the higher layer. - */ -void nrf_802154_buffer_free(uint8_t * p_data); - -/** - * @brief Notifies the driver that the buffer containing the received frame is not used anymore. - * - * @note The buffer pointed to by @p p_data may be modified by this function. - * @note This function can be safely called from any context. If the driver is busy processing - * a request called from a context with lower priority, this function returns false and - * the caller should free the buffer later. - * - * @param[in] p_data Pointer to the buffer containing the received data that is no longer needed - * by the higher layer. - * - * @retval true Buffer was freed successfully. - * @retval false Buffer cannot be freed right now due to ongoing operation. - */ -bool nrf_802154_buffer_free_immediately(uint8_t * p_data); - -#endif // NRF_802154_USE_RAW_API - -/** - * @} - * @defgroup nrf_802154_rssi RSSI measurement function - * @{ - */ - -/** - * @brief Begins the RSSI measurement. - * - * @note This function is to be called in the @ref RADIO_STATE_RX state. - * - * The result will be available after the measurement process is finished. The result can be read by - * @ref nrf_802154_rssi_last_get. Check the documentation of the RADIO peripheral to check - * the duration of the RSSI measurement procedure. - * - * @retval true RSSI measurement successfully requested. - * @retval false RSSI measurement cannot be scheduled at the moment. - */ -bool nrf_802154_rssi_measure_begin(void); - -/** - * @brief Gets the result of the last RSSI measurement. - * - * @returns RSSI measurement result, in dBm. - */ -int8_t nrf_802154_rssi_last_get(void); - -/** - * @} - * @defgroup nrf_802154_prom Promiscuous mode - * @{ - */ - -/** - * @brief Enables or disables the promiscuous radio mode. - * - * @note The promiscuous mode is disabled by default. - * - * In the promiscuous mode, the driver notifies the higher layer that it received any frame - * (regardless frame type or destination address). - * In normal mode (not promiscuous), the higher layer is not notified about ACK frames and frames - * with unknown type. Also, frames with a destination address not matching the device address are - * ignored. - * - * @param[in] enabled If the promiscuous mode is to be enabled. - */ -void nrf_802154_promiscuous_set(bool enabled); - -/** - * @brief Checks if the radio is in the promiscuous mode. - * - * @retval True Radio is in the promiscuous mode. - * @retval False Radio is not in the promiscuous mode. - */ -bool nrf_802154_promiscuous_get(void); - -/** - * @} - * @defgroup nrf_802154_autoack Auto ACK management - * @{ - */ - -/** - * @brief Enables or disables the automatic acknowledgments (auto ACK). - * - * @note The auto ACK is enabled by default. - * - * If the auto ACK is enabled, the driver prepares and sends ACK frames automatically - * aTurnaroundTime (192 us) after the proper frame is received. The driver prepares an ACK frame - * according to the data provided by @ref nrf_802154_ack_data_set. - * When the auto ACK is enabled, the driver notifies the next higher layer about the received frame - * after the ACK frame is transmitted. - * If the auto ACK is disabled, the driver does not transmit ACK frames. It notifies the next higher - * layer about the received frames when a frame is received. In this mode, the next higher layer is - * responsible for sending the ACK frame. ACK frames should be sent using @ref nrf_802154_transmit. - * - * @param[in] enabled If the auto ACK should be enabled. - */ -void nrf_802154_auto_ack_set(bool enabled); - -/** - * @brief Checks if the auto ACK is enabled. - * - * @retval True Auto ACK is enabled. - * @retval False Auto ACK is disabled. - */ -bool nrf_802154_auto_ack_get(void); - -/** - * @brief Configures the device as the PAN coordinator. - * - * @note That information is used for packet filtering. - * - * @param[in] enabled The radio is configured as the PAN coordinator. - */ -void nrf_802154_pan_coord_set(bool enabled); - -/** - * @brief Checks if the radio is configured as the PAN coordinator. - * - * @retval true The radio is configured as the PAN coordinator. - * @retval false The radio is not configured as the PAN coordinator. - */ -bool nrf_802154_pan_coord_get(void); - -/** - * @brief Select the source matching algorithm. - * - * @note This method should be called after driver initialization, but before transceiver is enabled. - * - * When calling @ref nrf_802154_ack_data_pending_bit_should_be_set, one of several algorithms - * for source address matching will be chosen. To ensure a specific algorithm is selected, - * call this function before @ref rf_802154_ack_data_pending_bit_should_be_set. - * - * @param[in] match_method Source address matching method to be used. - */ -void nrf_802154_src_addr_matching_method_set(nrf_802154_src_addr_match_t match_method); - -/** - * @brief Adds the address of a peer node for which the provided ACK data - * is to be added to the pending bit list. - * - * The pending bit list works differently, depending on the upper layer for which the source - * address matching method is selected: - * - For Thread, @ref NRF_802154_SRC_ADDR_MATCH_THREAD - * - For Zigbee, @ref NRF_802154_SRC_ADDR_MATCH_ZIGBEE - * - For Standard-compliant, @ref NRF_802154_SRC_ADDR_MATCH_ALWAYS_1 - * For more information, see @ref nrf_802154_src_addr_match_t. - * - * The method can be set during initialization phase by calling @ref nrf_802154_src_matching_method. - * - * @param[in] p_addr Array of bytes containing the address of the node (little-endian). - * @param[in] extended If the given address is an extended MAC address or a short MAC address. - * @param[in] p_data Pointer to the buffer containing data to be set. - * @param[in] length Length of @p p_data. - * @param[in] data_type Type of data to be set. Refer to the @ref nrf_802154_ack_data_t type. - * - * @retval True Address successfully added to the list. - * @retval False Not enough memory to store this address in the list. - */ -bool nrf_802154_ack_data_set(const uint8_t * p_addr, - bool extended, - const void * p_data, - uint16_t length, - uint8_t data_type); - -/** - * @brief Removes the address of a peer node for which the ACK data is set from the pending bit list. - * - * The ACK data that was previously set for the given address is automatically removed. - * - * The pending bit list works differently, depending on the upper layer for which the source - * address matching method is selected: - * - For Thread, @ref NRF_802154_SRC_ADDR_MATCH_THREAD - * - For Zigbee, @ref NRF_802154_SRC_ADDR_MATCH_ZIGBEE - * - For Standard-compliant, @ref NRF_802154_SRC_ADDR_MATCH_ALWAYS_1 - * For more information, see @ref nrf_802154_src_addr_match_t. - * - * The method can be set during initialization phase by calling @ref nrf_802154_src_matching_method. - * - * @param[in] p_addr Array of bytes containing the address of the node (little-endian). - * @param[in] extended If the given address is an extended MAC address or a short MAC address. - * @param[in] data_type Type of data to be removed. Refer to the @ref nrf_802154_ack_data_t type. - * - * @retval True Address removed from the list. - * @retval False Address not found in the list. - */ -bool nrf_802154_ack_data_clear(const uint8_t * p_addr, bool extended, uint8_t data_type); - -/** - * @brief Enables or disables setting a pending bit in automatically transmitted ACK frames. - * - * @note Setting a pending bit in automatically transmitted ACK frames is enabled by default. - * - * The radio driver automatically sends ACK frames in response frames destined for this node with - * the ACK Request bit set. The pending bit in the ACK frame can be set or cleared regarding data - * in the indirect queue destined for the ACK destination. - * - * If setting a pending bit in ACK frames is disabled, the pending bit in every ACK frame is set. - * If setting a pending bit in ACK frames is enabled, the radio driver checks if there is data - * in the indirect queue destined for the ACK destination. If there is no such data, - * the pending bit is cleared. - * - * @note Due to the ISR latency, the radio driver might not be able to verify if there is data - * in the indirect queue before ACK is sent. In this case, the pending bit is set. - * - * @param[in] enabled If setting a pending bit in ACK frames is enabled. - */ -void nrf_802154_auto_pending_bit_set(bool enabled); - -/** - * @brief Adds the address of a peer node to the pending bit list. - * - * The pending bit list works differently, depending on the upper layer for which the source - * address matching method is selected: - * - For Thread, @ref NRF_802154_SRC_ADDR_MATCH_THREAD - * - For Zigbee, @ref NRF_802154_SRC_ADDR_MATCH_ZIGBEE - * - For Standard-compliant, @ref NRF_802154_SRC_ADDR_MATCH_ALWAYS_1 - * For more information, see @ref nrf_802154_src_addr_match_t. - * - * The method can be set during initialization phase by calling @ref nrf_802154_src_matching_method. - * - * @note This function makes a copy of the given address. - * - * @param[in] p_addr Array of bytes containing the address of the node (little-endian). - * @param[in] extended If the given address is an extended MAC address or a short MAC address. - * - * @retval True The address is successfully added to the list. - * @retval False Not enough memory to store the address in the list. - */ -bool nrf_802154_pending_bit_for_addr_set(const uint8_t * p_addr, bool extended); - -/** - * @brief Removes address of a peer node from the pending bit list. - * - * The pending bit list works differently, depending on the upper layer for which the source - * address matching method is selected: - * - For Thread, @ref NRF_802154_SRC_ADDR_MATCH_THREAD - * - For Zigbee, @ref NRF_802154_SRC_ADDR_MATCH_ZIGBEE - * - For Standard-compliant, @ref NRF_802154_SRC_ADDR_MATCH_ALWAYS_1 - * For more information, see @ref nrf_802154_src_addr_match_t. - * - * The method can be set during initialization phase by calling @ref nrf_802154_src_matching_method. - * - * @param[in] p_addr Array of bytes containing the address of the node (little-endian). - * @param[in] extended If the given address is an extended MAC address or a short MAC address. - * - * @retval True The address is successfully removed from the list. - * @retval False No such address in the list. - */ -bool nrf_802154_pending_bit_for_addr_clear(const uint8_t * p_addr, bool extended); - -/** - * @brief Removes all addresses of a given type from the pending bit list. - * - * The pending bit list works differently, depending on the upper layer for which the source - * address matching method is selected: - * - For Thread, @ref NRF_802154_SRC_ADDR_MATCH_THREAD - * - For Zigbee, @ref NRF_802154_SRC_ADDR_MATCH_ZIGBEE - * - For Standard-compliant, @ref NRF_802154_SRC_ADDR_MATCH_ALWAYS_1 - * For more information, see @ref nrf_802154_src_addr_match_t. - * - * The method can be set during initialization phase by calling @ref nrf_802154_src_matching_method. - * - * @param[in] extended If the function is to remove all extended MAC addresses or all short - * addresses. - */ -void nrf_802154_pending_bit_for_addr_reset(bool extended); - -/** - * @} - * @defgroup nrf_802154_cca CCA configuration management - * @{ - */ - -/** - * @brief Configures the radio CCA mode and threshold. - * - * @param[in] p_cca_cfg Pointer to the CCA configuration structure. Only fields relevant to - * the selected mode are updated. - */ -void nrf_802154_cca_cfg_set(const nrf_802154_cca_cfg_t * p_cca_cfg); - -/** - * @brief Gets the current radio CCA configuration. - * - * @param[out] p_cca_cfg Pointer to the structure for the current CCA configuration. - */ -void nrf_802154_cca_cfg_get(nrf_802154_cca_cfg_t * p_cca_cfg); - -/** - * @} - * @defgroup nrf_802154_csma CSMA-CA procedure - * @{ - */ -#if NRF_802154_CSMA_CA_ENABLED -#if NRF_802154_USE_RAW_API - -/** - * @brief Performs the CSMA-CA procedure and transmits a frame in case of success. - * - * The end of the CSMA-CA procedure is notified by @ref nrf_802154_transmitted_raw or - * @ref nrf_802154_transmit_failed. - * - * @note The driver may be configured to automatically time out waiting for an ACK frame depending - * on @ref NRF_802154_ACK_TIMEOUT_ENABLED. If the automatic ACK timeout is disabled, - * the CSMA-CA procedure does not time out waiting for an ACK frame if a frame - * with the ACK request bit set was transmitted. The MAC layer is expected to manage the timer - * to time out waiting for the ACK frame. This timer can be started - * by @ref nrf_802154_tx_started. When the timer expires, the MAC layer is expected - * to call @ref nrf_802154_receive or @ref nrf_802154_sleep to stop waiting for the ACK frame. - * - * @param[in] p_data Pointer to the frame to transmit. See also @ref nrf_802154_transmit_raw. - */ -void nrf_802154_transmit_csma_ca_raw(const uint8_t * p_data); - -#else // NRF_802154_USE_RAW_API - -/** - * @brief Performs the CSMA-CA procedure and transmits a frame in case of success. - * - * The end of the CSMA-CA procedure is notified by @ref nrf_802154_transmitted or - * @ref nrf_802154_transmit_failed. - * - * @note The driver may be configured to automatically time out waiting for an ACK frame depending - * on @ref NRF_802154_ACK_TIMEOUT_ENABLED. If the automatic ACK timeout is disabled, - * the CSMA-CA procedure does not time out waiting for an ACK frame if a frame - * with the ACK request bit set was transmitted. The MAC layer is expected to manage the timer - * to time out waiting for the ACK frame. This timer can be started - * by @ref nrf_802154_tx_started. When the timer expires, the MAC layer is expected - * to call @ref nrf_802154_receive or @ref nrf_802154_sleep to stop waiting for the ACK frame. - * - * @param[in] p_data Pointer to the frame to transmit. See also @ref nrf_802154_transmit. - * @param[in] length Length of the given frame. See also @ref nrf_802154_transmit. - */ -void nrf_802154_transmit_csma_ca(const uint8_t * p_data, uint8_t length); - -#endif // NRF_802154_USE_RAW_API -#endif // NRF_802154_CSMA_CA_ENABLED - -/** - * @} - * @defgroup nrf_802154_timeout ACK timeout procedure - * @{ - */ -#if NRF_802154_ACK_TIMEOUT_ENABLED - -/** - * @brief Sets timeout for the ACK timeout feature. - * - * A timeout is notified by @ref nrf_802154_transmit_failed. - * - * @param[in] time Timeout in microseconds (us). - * A default value is defined in nrf_802154_config.h. - */ -void nrf_802154_ack_timeout_set(uint32_t time); - -#endif // NRF_802154_ACK_TIMEOUT_ENABLED - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_H_ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_config.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_config.h deleted file mode 100644 index 4bead86ad..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_config.h +++ /dev/null @@ -1,425 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_CONFIG_H__ -#define NRF_802154_CONFIG_H__ - -#ifdef NRF_802154_PROJECT_CONFIG -#include NRF_802154_PROJECT_CONFIG -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_config 802.15.4 driver configuration - * @{ - * @ingroup nrf_802154 - * @brief Configuration of the 802.15.4 radio driver for nRF SoCs. - */ - -/** - * @defgroup nrf_802154_config_radio Radio driver configuration - * @{ - */ - -/** - * @def NRF_802154_CCA_MODE_DEFAULT - * - * CCA mode used by the driver. - * - */ -#ifndef NRF_802154_CCA_MODE_DEFAULT -#define NRF_802154_CCA_MODE_DEFAULT NRF_RADIO_CCA_MODE_ED -#endif - -/** - * @def NRF_802154_CCA_ED_THRESHOLD_DEFAULT - * - * Energy detection threshold used in the CCA procedure. - * - */ -#ifndef NRF_802154_CCA_ED_THRESHOLD_DEFAULT -#define NRF_802154_CCA_ED_THRESHOLD_DEFAULT 0x14 -#endif - -/** - * @def NRF_802154_CCA_CORR_THRESHOLD_DEFAULT - * - * Correlator threshold used in the CCA procedure. - * - */ -#ifndef NRF_802154_CCA_CORR_THRESHOLD_DEFAULT -#define NRF_802154_CCA_CORR_THRESHOLD_DEFAULT 0x14 -#endif - -/** - * @def NRF_802154_CCA_CORR_LIMIT_DEFAULT - * - * Correlator limit used in the CCA procedure. - * - */ -#ifndef NRF_802154_CCA_CORR_LIMIT_DEFAULT -#define NRF_802154_CCA_CORR_LIMIT_DEFAULT 0x02 -#endif - -/** - * @def NRF_802154_INTERNAL_RADIO_IRQ_HANDLING - * - * If the driver is expected to internally handle the RADIO IRQ. - * If the driver is used in an OS, the RADIO IRQ can be handled by the OS and passed to - * the driver by @ref nrf_802154_radio_irq_handler. - * In this case, the internal handling must be disabled. - * - */ - -#ifndef NRF_802154_INTERNAL_RADIO_IRQ_HANDLING - -#if RAAL_SOFTDEVICE || RAAL_REM -#define NRF_802154_INTERNAL_RADIO_IRQ_HANDLING 0 -#else // RAAL_SOFTDEVICE || RAAL_REM -#define NRF_802154_INTERNAL_RADIO_IRQ_HANDLING 1 -#endif // RAAL_SOFTDEVICE || RAAL_REM - -#endif // NRF_802154_INTERNAL_RADIO_IRQ_HANDLING - -/** - * @def NRF_802154_IRQ_PRIORITY - * - * Interrupt priority for RADIO peripheral. - * Keep the IRQ priority high (low number) to prevent losing frames due to preemption. - * - */ -#ifndef NRF_802154_IRQ_PRIORITY -#define NRF_802154_IRQ_PRIORITY 0 -#endif - -/** - * @def NRF_802154_SWI_PRIORITY - * - * The priority of software interrupt used for requests and notifications. - * - */ -#ifndef NRF_802154_SWI_PRIORITY -#define NRF_802154_SWI_PRIORITY 5 -#endif - -/** - * @def NRF_802154_USE_RAW_API - * - * When this flag is set, the RAW API is available for the MAC layer. It is recommended to use - * the RAW API because it provides more optimized functions. - * - * @note If the RAW API is not available for the MAC layer, only less optimized functions performing - * copy are available. - * - */ -#ifndef NRF_802154_USE_RAW_API -#define NRF_802154_USE_RAW_API 1 -#endif - -/** - * @def NRF_802154_PENDING_SHORT_ADDRESSES - * - * The number of slots containing short addresses of nodes for which the pending data is stored. - * - */ -#ifndef NRF_802154_PENDING_SHORT_ADDRESSES -#define NRF_802154_PENDING_SHORT_ADDRESSES 10 -#endif - -/** - * @def NRF_802154_PENDING_EXTENDED_ADDRESSES - * - * The number of slots containing extended addresses of nodes for which the pending data is stored. - * - */ -#ifndef NRF_802154_PENDING_EXTENDED_ADDRESSES -#define NRF_802154_PENDING_EXTENDED_ADDRESSES 10 -#endif - -/** - * @def NRF_802154_RX_BUFFERS - * - * The number of buffers in the receive queue. - * - */ -#ifndef NRF_802154_RX_BUFFERS -#define NRF_802154_RX_BUFFERS 16 -#endif - -/** - * @def NRF_802154_DISABLE_BCC_MATCHING - * - * Setting this flag disables NRF_RADIO_EVENT_BCMATCH handling, and therefore the address filtering - * during the frame reception. With this flag set to 1, the address filtering is done after - * receiving a frame, during NRF_RADIO_EVENT_END handling. - * - */ -#ifndef NRF_802154_DISABLE_BCC_MATCHING -#define NRF_802154_DISABLE_BCC_MATCHING 0 -#endif - -/** - * @def NRF_802154_NOTIFY_CRCERROR - * - * With this flag set to 1, the CRC errors are notified to upper layers. This requires an interrupt - * handler to be used. - * - */ -#ifndef NRF_802154_NOTIFY_CRCERROR -#define NRF_802154_NOTIFY_CRCERROR 1 -#endif - -/** - * @def NRF_802154_FRAME_TIMESTAMP_ENABLED - * - * If timestamps are to be added to the frames received. - * Enabling this feature enables the functions @ref nrf_802154_received_timestamp_raw, - * @ref nrf_802154_received_timestamp, @ref nrf_802154_transmitted_timestamp_raw, and - * @ref nrf_802154_transmitted_timestamp, which add timestamps to the frames received. - * - */ -#ifndef NRF_802154_FRAME_TIMESTAMP_ENABLED -#define NRF_802154_FRAME_TIMESTAMP_ENABLED 1 -#endif - -/** - * @def NRF_802154_DELAYED_TRX_ENABLED - * - * If the delayed transmission and the receive window features are available. - * - */ -#ifndef NRF_802154_DELAYED_TRX_ENABLED -#define NRF_802154_DELAYED_TRX_ENABLED 1 -#endif - -/** - * @} - * @defgroup nrf_802154_config_clock Clock driver configuration - * @{ - */ - -/** - * @def NRF_802154_CLOCK_IRQ_PRIORITY - * - * The priority of clock interrupt used in the standalone clock driver implementation. - * - * @note This configuration is only applicable for the Clock Abstraction Layer implementation - * in nrf_802154_clock_nodrv.c. - * - */ -#ifndef NRF_802154_CLOCK_IRQ_PRIORITY -#define NRF_802154_CLOCK_IRQ_PRIORITY 7 -#endif - -/** - * @def NRF_802154_CLOCK_LFCLK_SOURCE - * - * The low-frequency clock source used in the standalone clock driver implementation. - * - * @note This configuration is only applicable for the Clock Abstraction Layer implementation - * in nrf_802154_clock_nodrv.c. - * - */ -#ifndef NRF_802154_CLOCK_LFCLK_SOURCE -#define NRF_802154_CLOCK_LFCLK_SOURCE NRF_CLOCK_LFCLK_Xtal -#endif - -/** - * @} - * @defgroup nrf_802154_config_rtc RTC driver configuration - * @{ - */ - -/** - * @def NRF_802154_RTC_IRQ_PRIORITY - * - * The priority of RTC interrupt used in the standalone timer driver implementation. - * - * @note This configuration is only applicable for the Low Power Timer Abstraction Layer - * implementation in nrf_802154_lp_timer_nodrv.c. - * - */ -#ifndef NRF_802154_RTC_IRQ_PRIORITY -#define NRF_802154_RTC_IRQ_PRIORITY 6 -#endif - -/** - * @} - * @defgroup nrf_802154_config_csma CSMA/CA procedure configuration - * @{ - */ - -/** - * @def NRF_802154_CSMA_CA_ENABLED - * - * If CSMA-CA is to be enabled by the driver. Disabling CSMA-CA improves - * the driver performance. - * - */ -#ifndef NRF_802154_CSMA_CA_ENABLED -#define NRF_802154_CSMA_CA_ENABLED 1 -#endif - -/** - * @def NRF_802154_CSMA_CA_MIN_BE - * - * The minimum value of the backoff exponent (BE) in the CSMA-CA algorithm - * (see IEEE 802.15.4-2015: 6.2.5.1). - * - */ -#ifndef NRF_802154_CSMA_CA_MIN_BE -#define NRF_802154_CSMA_CA_MIN_BE 3 -#endif - -/** - * @def NRF_802154_CSMA_CA_MAX_BE - * - * The maximum value of the backoff exponent, BE, in the CSMA-CA algorithm - * (see IEEE 802.15.4-2015: 6.2.5.1). - * - */ -#ifndef NRF_802154_CSMA_CA_MAX_BE -#define NRF_802154_CSMA_CA_MAX_BE 5 -#endif - -/** - * @def NRF_802154_CSMA_CA_MAX_CSMA_BACKOFFS - * - * The maximum number of backoffs that the CSMA-CA algorithm will attempt before declaring a channel - * access failure. - * - */ -#ifndef NRF_802154_CSMA_CA_MAX_CSMA_BACKOFFS -#define NRF_802154_CSMA_CA_MAX_CSMA_BACKOFFS 4 -#endif - -/** - * @def NRF_802154_CSMA_CA_WAIT_FOR_TIMESLOT - * - * Indicates whether the CSMA-CA algorithm waits for an available timeslot before it performs - * the CCA procedure. - * - * @note When this option is enabled, the CSMA-CA procedure can be synchronized with timeslots of - * other protocols. This decreases the robustness of the CSMA-CA procedure. On the other hand, - * enabling this function increases the performance of multi-protocol applications, especially - * when protocols other than 802.15.4 use much of the radio time (like the BLE scanning - * operation). - * - */ -#ifndef NRF_802154_CSMA_CA_WAIT_FOR_TIMESLOT -#define NRF_802154_CSMA_CA_WAIT_FOR_TIMESLOT 1 -#endif - -/** - * @} - * @defgroup nrf_802154_config_timeout ACK timeout feature configuration - * @{ - */ - -/** - * @def NRF_802154_ACK_TIMEOUT_ENABLED - * - * Indicates whether the ACK timeout feature is to be enabled in the driver. - * - */ -#ifndef NRF_802154_ACK_TIMEOUT_ENABLED -#define NRF_802154_ACK_TIMEOUT_ENABLED 1 -#endif - -/** - * @def NRF_802154_ACK_TIMEOUT_DEFAULT_TIMEOUT - * - * The default timeout in microseconds (us) for the ACK timeout feature. - * - */ -#ifndef NRF_802154_ACK_TIMEOUT_DEFAULT_TIMEOUT -#define NRF_802154_ACK_TIMEOUT_DEFAULT_TIMEOUT 7000 -#endif - -/** - * @def NRF_802154_ACK_TIMEOUT_DEFAULT_TIMEOUT - * - * The default timeout in microseconds (us) for the precise ACK timeout feature. - * - */ -#ifndef NRF_802154_PRECISE_ACK_TIMEOUT_DEFAULT_TIMEOUT -#define NRF_802154_PRECISE_ACK_TIMEOUT_DEFAULT_TIMEOUT 210 -#endif - -/** - * @def NRF_802154_MAX_ACK_IE_SIZE - * - * The maximum supported size of the 802.15.4-2015 IE header and content fields in an Enh-Ack. - * - */ -#ifndef NRF_802154_MAX_ACK_IE_SIZE -#define NRF_802154_MAX_ACK_IE_SIZE 8 -#endif - -/** - * @} - * @defgroup nrf_802154_config_transmission Transmission start notification feature configuration - * @{ - */ - -/** - * @def NRF_802154_TX_STARTED_NOTIFY_ENABLED - * - * Indicates whether the notifications of the started transmissions are to be enabled in the driver. - * - * @note This feature is enabled by default if the ACK timeout feature or CSMA-CA is enabled. - * These features depend on the notifications of the transmission start. - */ -#ifndef NRF_802154_TX_STARTED_NOTIFY_ENABLED -#if NRF_802154_ACK_TIMEOUT_ENABLED || NRF_802154_CSMA_CA_ENABLED -#define NRF_802154_TX_STARTED_NOTIFY_ENABLED 1 -#else -#define NRF_802154_TX_STARTED_NOTIFY_ENABLED 0 -#endif -#endif // NRF_802154_TX_STARTED_NOTIFY_ENABLED - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif // NRF_802154_CONFIG_H__ - -/** - *@} - **/ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_const.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_const.h deleted file mode 100644 index bc324ae48..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_const.h +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (c) 2017, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains definitions of constant values used by the nRF 802.15.4 driver. - * - */ - -#ifndef NRF_802154_CONST_H_ -#define NRF_802154_CONST_H_ - -#include -#include "nrf_802154_config.h" - -#define ACK_HEADER_WITH_PENDING 0x12 ///< The first byte of an ACK frame containing a pending bit. -#define ACK_HEADER_WITHOUT_PENDING 0x02 ///< The first byte of an ACK frame without a pending bit. - -#define ACK_REQUEST_OFFSET 1 ///< Byte containing the ACK request bit (+1 for the frame length byte). -#define ACK_REQUEST_BIT (1 << 5) ///< ACK request bit. - -#define DEST_ADDR_TYPE_OFFSET 2 ///< Byte containing the destination address type (+1 for the frame length byte). -#define DEST_ADDR_TYPE_MASK 0x0c ///< Mask of bits containing the destination address type. -#define DEST_ADDR_TYPE_EXTENDED 0x0c ///< Bits containing the extended destination address type. -#define DEST_ADDR_TYPE_NONE 0x00 ///< Bits containing a not-present destination address type. -#define DEST_ADDR_TYPE_SHORT 0x08 ///< Bits containing the short destination address type. -#define DEST_ADDR_OFFSET 6 ///< Offset of the destination address in the Data frame (+1 for the frame length byte). - -#define DSN_OFFSET 3 ///< Byte containing the DSN value (+1 for the frame length byte). -#define DSN_SUPPRESS_OFFSET 2 ///< Byte containing the DSN suppression field. -#define DSN_SUPPRESS_BIT 0x01 ///< Bits containing the DSN suppression field. - -#define FRAME_COUNTER_SUPPRESS_BIT 0x20 ///< Bit containing the Frame Counter Suppression field. - -#define FRAME_PENDING_OFFSET 1 ///< Byte containing a pending bit (+1 for the frame length byte). -#define FRAME_PENDING_BIT (1 << 4) ///< Pending bit. - -#define FRAME_TYPE_OFFSET 1 ///< Byte containing the frame type bits (+1 for the frame length byte). -#define FRAME_TYPE_MASK 0x07 ///< Mask of bits containing the frame type. -#define FRAME_TYPE_ACK 0x02 ///< Bits containing the ACK frame type. -#define FRAME_TYPE_BEACON 0x00 ///< Bits containing the Beacon frame type. -#define FRAME_TYPE_COMMAND 0x03 ///< Bits containing the Command frame type. -#define FRAME_TYPE_DATA 0x01 ///< Bits containing the Data frame type. -#define FRAME_TYPE_EXTENDED 0x07 ///< Bits containing the Extended frame type. -#define FRAME_TYPE_FRAGMENT 0x06 ///< Bits containing the Fragment or the Frak frame type. -#define FRAME_TYPE_MULTIPURPOSE 0x05 ///< Bits containing the Multipurpose frame type. - -#define FRAME_VERSION_OFFSET 2 ///< Byte containing the frame version bits (+1 for the frame length byte). -#define FRAME_VERSION_MASK 0x30 ///< Mask of bits containing the frame version. -#define FRAME_VERSION_0 0x00 ///< Bits containing the frame version 0b00. -#define FRAME_VERSION_1 0x10 ///< Bits containing the frame version 0b01. -#define FRAME_VERSION_2 0x20 ///< Bits containing the frame version 0b10. -#define FRAME_VERSION_3 0x30 ///< Bits containing the frame version 0b11. - -#define IE_HEADER_LENGTH_MASK 0x3f ///< Mask of bits containing the length of an IE header content. -#define IE_PRESENT_OFFSET 2 ///< Byte containing the IE Present bit. -#define IE_PRESENT_BIT 0x02 ///< Bits containing the IE Present field. - -#define KEY_ID_MODE_MASK 0x18 ///< Mask of bits containing Key Identifier Mode in the Security Control field. -#define KEY_ID_MODE_0 0 ///< Bits containing the 0x00 Key Identifier Mode. -#define KEY_ID_MODE_1 0x08 ///< Bits containing the 0x01 Key Identifier Mode. -#define KEY_ID_MODE_2 0x10 ///< Bits containing the 0x10 Key Identifier Mode. -#define KEY_ID_MODE_3 0x18 ///< Bits containing the 0x11 Key Identifier Mode. - -#define MAC_CMD_ASSOC_REQ 0x01 ///< Command frame identifier for MAC Association request. -#define MAC_CMD_ASSOC_RESP 0x02 ///< Command frame identifier for MAC Association response. -#define MAC_CMD_DISASSOC_NOTIFY 0x03 ///< Command frame identifier for MAC Disaccociation notification. -#define MAC_CMD_DATA_REQ 0x04 ///< Command frame identifier for MAC Data Requests. -#define MAC_CMD_PANID_CONFLICT 0x05 ///< Command frame identifier for MAC PAN ID conflict notification. -#define MAC_CMD_ORPHAN_NOTIFY 0x06 ///< Command frame identifier for MAC Orphan notification. -#define MAC_CMD_BEACON_REQ 0x07 ///< Command frame identifier for MAC Beacon. -#define MAC_CMD_COORD_REALIGN 0x08 ///< Command frame identifier for MAC Coordinator realignment. -#define MAC_CMD_GTS_REQUEST 0x09 ///< Command frame identifier for MAC GTS request. - -#define PAN_ID_COMPR_OFFSET 1 ///< Byte containing the PAN ID compression bit (+1 for the frame length byte). -#define PAN_ID_COMPR_MASK 0x40 ///< PAN ID compression bit. - -#define PAN_ID_OFFSET 4 ///< Offset of PAN ID in the Data frame (+1 for the frame length byte). - -#define PHR_OFFSET 0 ///< Offset of the PHY header in a frame. - -#define SECURITY_ENABLED_OFFSET 1 ///< Byte containing the Security Enabled bit. -#define SECURITY_ENABLED_BIT 0x08 ///< Bits containing the Security Enabled field. -#define SECURITY_LEVEL_MASK 0x07 ///< Mask of bits containing the Security level field. -#define SECURITY_LEVEL_MIC_32 0x01 ///< Bits containing the 32-bit Message Integrity Code (0b001). -#define SECURITY_LEVEL_MIC_64 0x02 ///< Bits containing the 64-bit Message Integrity Code (0b010). -#define SECURITY_LEVEL_MIC_128 0x03 ///< Bits containing the 128-bit Message Integrity Code (0b011). -#define SECURITY_LEVEL_ENC_MIC_32 0x05 ///< Bits containing the 32-bit Encrypted Message Integrity Code (0b101). -#define SECURITY_LEVEL_ENC_MIC_64 0x06 ///< Bits containing the 64-bit Encrypted Message Integrity Code (0b110). -#define SECURITY_LEVEL_ENC_MIC_128 0x07 ///< Bits containing the 128-bit Encrypted Message Integrity Code (0b111). - -#define SRC_ADDR_TYPE_EXTENDED 0xc0 ///< Bits containing the extended source address type. -#define SRC_ADDR_TYPE_NONE 0x00 ///< Bits containing a not-present source address type. -#define SRC_ADDR_TYPE_MASK 0xc0 ///< Mask of bits containing the source address type. -#define SRC_ADDR_TYPE_OFFSET 2 ///< Byte containing the source address type (+1 for the frame length byte). -#define SRC_ADDR_TYPE_SHORT 0x80 ///< Bits containing the short source address type. - -#define SRC_ADDR_OFFSET_SHORT_DST 8 ///< Offset of the source address in the Data frame if the destination address is short. -#define SRC_ADDR_OFFSET_EXTENDED_DST 14 ///< Offset of the source address in the Data frame if the destination address is extended. - -#define DSN_SIZE 1 ///< Size of the Sequence Number field. -#define FCF_SIZE 2 ///< Size of the FCF field. -#define FCS_SIZE 2 ///< Size of the FCS field. -#define FRAME_COUNTER_SIZE 4 ///< Size of the Frame Counter field. -#define IE_HEADER_SIZE 4 ///< Size of the obligatory IE Header field elements, including the header termination. -#define IMM_ACK_LENGTH 5 ///< Length of the ACK frame. -#define KEY_ID_MODE_1_SIZE 1 ///< Size of the 0x01 Key Identifier Mode field. -#define KEY_ID_MODE_2_SIZE 5 ///< Size of the 0x10 Key Identifier Mode field. -#define KEY_ID_MODE_3_SIZE 9 ///< Size of the 0x11 Key Identifier Mode field. -#define MAX_PACKET_SIZE 127 ///< Maximum size of the radio packet. -#define MIC_32_SIZE 4 ///< Size of MIC with the MIC-32 and ENC-MIC-32 security attributes. -#define MIC_64_SIZE 8 ///< Size of MIC with the MIC-64 and ENC-MIC-64 security attributes. -#define MIC_128_SIZE 16 ///< Size of MIC with the MIC-128 and ENC-MIC-128 security attributes. -#define PAN_ID_SIZE 2 ///< Size of the PAN ID. -#define PHR_SIZE 1 ///< Size of the PHR field. -#define SECURITY_CONTROL_SIZE 1 ///< Size of the Security Control field. - -#define EXTENDED_ADDRESS_SIZE 8 ///< Size of the Extended Mac Address. -#define SHORT_ADDRESS_SIZE 2 ///< Size of the Short Mac Address. - -#define TURNAROUND_TIME 192UL ///< RX-to-TX or TX-to-RX turnaround time (aTurnaroundTime), in microseconds (us). -#define CCA_TIME 128UL ///< Time required to perform CCA detection (aCcaTime), in microseconds (us). -#define UNIT_BACKOFF_PERIOD (TURNAROUND_TIME + CCA_TIME) ///< Number of symbols in the basic time period used by CSMA-CA algorithm (aUnitBackoffPeriod), in (us). - -#define PHY_US_PER_SYMBOL 16 ///< Duration of a single symbol in microseconds (us). -#define PHY_SYMBOLS_PER_OCTET 2 ///< Number of symbols in a single byte (octet). -#define PHY_SHR_SYMBOLS 10 ///< Number of symbols in the Synchronization Header (SHR). - -#define ED_MIN_DBM (-94) ///< dBm value corresponding to value 0 in the EDSAMPLE register. -#define ED_RESULT_FACTOR 4 ///< Factor needed to calculate the ED result based on the data from the RADIO peripheral. -#define ED_RESULT_MAX 0xff ///< Maximal ED result. - -#define BROADCAST_ADDRESS ((uint8_t[SHORT_ADDRESS_SIZE]) {0xff, 0xff}) ///< Broadcast short address. - -typedef enum -{ - REQ_ORIG_HIGHER_LAYER, - REQ_ORIG_CORE, - REQ_ORIG_RSCH, -#if NRF_802154_CSMA_CA_ENABLED - REQ_ORIG_CSMA_CA, -#endif // NRF_802154_CSMA_CA_ENABLED -#if NRF_802154_ACK_TIMEOUT_ENABLED - REQ_ORIG_ACK_TIMEOUT, -#endif // NRF_802154_ACK_TIMEOUT_ENABLED -#if NRF_802154_DELAYED_TRX_ENABLED - REQ_ORIG_DELAYED_TRX, -#endif // NRF_802154_DELAYED_TRX_ENABLED -} req_originator_t; - -#endif // NRD_DRV_RADIO802154_CONST_H_ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.c deleted file mode 100644 index d623ecb98..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.c +++ /dev/null @@ -1,3275 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements Finite State Machine of nRF 802.15.4 radio driver. - * - */ - -#include "nrf_802154_core.h" - -#include -#include -#include -#include - -#include "nrf_802154.h" -#include "nrf_802154_config.h" -#include "nrf_802154_const.h" -#include "nrf_802154_critical_section.h" -#include "nrf_802154_debug.h" -#include "nrf_802154_notification.h" -#include "nrf_802154_peripherals.h" -#include "nrf_802154_pib.h" -#include "nrf_802154_procedures_duration.h" -#include "nrf_802154_rssi.h" -#include "nrf_802154_rx_buffer.h" -#include "nrf_802154_utils.h" -#include "nrf_802154_timer_coord.h" -#include "nrf_802154_types.h" -#include "nrf_802154_utils.h" -#include "nrf_egu.h" -#include "nrf_error.h" -#include "nrf_ppi.h" -#include "nrf_radio.h" -#include "nrf_timer.h" -#include "fem/nrf_fem_protocol_api.h" -#include "mac_features/nrf_802154_delayed_trx.h" -#include "mac_features/nrf_802154_filter.h" -#include "mac_features/nrf_802154_frame_parser.h" -#include "mac_features/ack_generator/nrf_802154_ack_data.h" -#include "mac_features/ack_generator/nrf_802154_ack_generator.h" -#include "rsch/nrf_802154_rsch.h" -#include "rsch/nrf_802154_rsch_crit_sect.h" - -#include "nrf_802154_core_hooks.h" - -#define EGU_EVENT NRF_EGU_EVENT_TRIGGERED15 -#define EGU_TASK NRF_EGU_TASK_TRIGGER15 -#define PPI_CHGRP0 NRF_802154_PPI_CORE_GROUP ///< PPI group used to disable self-disabling PPIs -#define PPI_CHGRP0_DIS_TASK NRF_PPI_TASK_CHG0_DIS ///< PPI task used to disable self-disabling PPIs - -#define PPI_DISABLED_EGU NRF_802154_PPI_RADIO_DISABLED_TO_EGU ///< PPI that connects RADIO DISABLED event with EGU task -#define PPI_EGU_RAMP_UP NRF_802154_PPI_EGU_TO_RADIO_RAMP_UP ///< PPI that connects EGU event with RADIO TXEN or RXEN task -#define PPI_EGU_TIMER_START NRF_802154_PPI_EGU_TO_TIMER_START ///< PPI that connects EGU event with TIMER START task -#define PPI_CRCERROR_CLEAR NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR ///< PPI that connects RADIO CRCERROR event with TIMER CLEAR task -#define PPI_CCAIDLE_FEM NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE ///< PPI that connects RADIO CCAIDLE event with GPIOTE tasks used by FEM -#define PPI_TIMER_TX_ACK NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN ///< PPI that connects TIMER COMPARE event with RADIO TXEN task -#define PPI_CRCOK_DIS_PPI NRF_802154_PPI_RADIO_CRCOK_TO_PPI_GRP_DISABLE ///< PPI that connects RADIO CRCOK event with task that disables PPI group - -#if NRF_802154_DISABLE_BCC_MATCHING -#define PPI_ADDRESS_COUNTER_COUNT NRF_802154_PPI_RADIO_ADDR_TO_COUNTER_COUNT ///< PPI that connects RADIO ADDRESS event with TIMER COUNT task -#define PPI_CRCERROR_COUNTER_CLEAR NRF_802154_PPI_RADIO_CRCERROR_COUNTER_CLEAR ///< PPI that connects RADIO CRCERROR event with TIMER CLEAR task -#endif // NRF_802154_DISABLE_BCC_MATCHING - -#if NRF_802154_DISABLE_BCC_MATCHING -#define SHORT_ADDRESS_BCSTART 0UL -#else // NRF_802154_DISABLE_BCC_MATCHING -#define SHORT_ADDRESS_BCSTART NRF_RADIO_SHORT_ADDRESS_BCSTART_MASK -#endif // NRF_802154_DISABLE_BCC_MATCHING - -/// Value set to SHORTS register when no shorts should be enabled. -#define SHORTS_IDLE 0 - -/// Value set to SHORTS register for RX operation. -#define SHORTS_RX (NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK | \ - NRF_RADIO_SHORT_END_DISABLE_MASK | \ - SHORT_ADDRESS_BCSTART) - -#define SHORTS_RX_FREE_BUFFER (NRF_RADIO_SHORT_RXREADY_START_MASK) - -#define SHORTS_TX_ACK (NRF_RADIO_SHORT_TXREADY_START_MASK | \ - NRF_RADIO_SHORT_PHYEND_DISABLE_MASK) - -#define SHORTS_CCA_TX (NRF_RADIO_SHORT_RXREADY_CCASTART_MASK | \ - NRF_RADIO_SHORT_CCABUSY_DISABLE_MASK | \ - NRF_RADIO_SHORT_CCAIDLE_TXEN_MASK | \ - NRF_RADIO_SHORT_TXREADY_START_MASK | \ - NRF_RADIO_SHORT_PHYEND_DISABLE_MASK) - -#define SHORTS_TX (NRF_RADIO_SHORT_TXREADY_START_MASK | \ - NRF_RADIO_SHORT_PHYEND_DISABLE_MASK) - -#define SHORTS_RX_ACK (NRF_RADIO_SHORT_ADDRESS_RSSISTART_MASK | \ - NRF_RADIO_SHORT_END_DISABLE_MASK) - -#define SHORTS_ED (NRF_RADIO_SHORT_READY_EDSTART_MASK) - -#define SHORTS_CCA (NRF_RADIO_SHORT_RXREADY_CCASTART_MASK | \ - NRF_RADIO_SHORT_CCABUSY_DISABLE_MASK) - -/// Delay before first check of received frame: 24 bits is PHY header and MAC Frame Control field. -#define BCC_INIT (3 * 8) - -/// Duration of single iteration of Energy Detection procedure -#define ED_ITER_DURATION 128U -/// Overhead of hardware preparation for ED procedure (aTurnaroundTime) [number of iterations] -#define ED_ITERS_OVERHEAD 2U - -#define CRC_LENGTH 2 ///< Length of CRC in 802.15.4 frames [bytes] -#define CRC_POLYNOMIAL 0x011021 ///< Polynomial used for CRC calculation in 802.15.4 frames - -#define MHMU_MASK 0xff000700 ///< Mask of known bytes in ACK packet -#define MHMU_PATTERN 0x00000200 ///< Values of known bytes in ACK packet -#define MHMU_PATTERN_DSN_OFFSET 24 ///< Offset of DSN in MHMU_PATTER [bits] - -#define ACK_IFS TURNAROUND_TIME ///< Ack Inter Frame Spacing [us] - delay between last symbol of received frame and first symbol of transmitted Ack -#define TXRU_TIME 40 ///< Transmitter ramp up time [us] -#define EVENT_LAT 23 ///< END event latency [us] - -#define MAX_CRIT_SECT_TIME 60 ///< Maximal time that the driver spends in single critical section. - -#define LQI_VALUE_FACTOR 4 ///< Factor needed to calculate LQI value based on data from RADIO peripheral -#define LQI_MAX 0xff ///< Maximal LQI value - -/** Get LQI of given received packet. If CRC is calculated by hardware LQI is included instead of CRC - * in the frame. Length is stored in byte with index 0; CRC is 2 last bytes. - */ -#define RX_FRAME_LQI(data) ((data)[(data)[0] - 1]) - -#if NRF_802154_RX_BUFFERS > 1 -/// Pointer to currently used receive buffer. -static rx_buffer_t * mp_current_rx_buffer; - -#else -/// If there is only one buffer use const pointer to the receive buffer. -static rx_buffer_t * const mp_current_rx_buffer = &nrf_802154_rx_buffers[0]; - -#endif - -static uint8_t * mp_ack; ///< Pointer to Ack frame buffer. -static const uint8_t * mp_tx_data; ///< Pointer to the data to transmit. -static uint32_t m_ed_time_left; ///< Remaining time of the current energy detection procedure [us]. -static uint8_t m_ed_result; ///< Result of the current energy detection procedure. -static uint8_t m_last_lqi; ///< LQI value of last Rx frame. - -static volatile radio_state_t m_state; ///< State of the radio driver. - -/// Common parameters for the FAL handling. -static const nrf_802154_fal_event_t m_deactivate_on_disable = -{ - .type = NRF_802154_FAL_EVENT_TYPE_GENERIC, - .override_ppi = false, - .event.generic.register_address = - ((uint32_t)NRF_RADIO_BASE + (uint32_t)NRF_RADIO_EVENT_DISABLED) -}; - -static const nrf_802154_fal_event_t m_activate_rx_cc0 = -{ - .type = NRF_802154_FAL_EVENT_TYPE_TIMER, - .override_ppi = false, - .event.timer = - { - .p_timer_instance = NRF_802154_TIMER_INSTANCE, - .counter_value = RX_RAMP_UP_TIME, - .compare_channel_mask = ((1 << NRF_TIMER_CC_CHANNEL0) | (1 << NRF_TIMER_CC_CHANNEL2)), - }, -}; - -static const nrf_802154_fal_event_t m_activate_tx_cc0 = -{ - .type = NRF_802154_FAL_EVENT_TYPE_TIMER, - .override_ppi = false, - .event.timer = - { - .p_timer_instance = NRF_802154_TIMER_INSTANCE, - .counter_value = TX_RAMP_UP_TIME, - .compare_channel_mask = ((1 << NRF_TIMER_CC_CHANNEL0) | (1 << NRF_TIMER_CC_CHANNEL2)), - }, -}; - -static const nrf_802154_fal_event_t m_ccaidle = -{ - .type = NRF_802154_FAL_EVENT_TYPE_GENERIC, - .override_ppi = true, - .ppi_ch_id = PPI_CCAIDLE_FEM, - .event.generic.register_address = ((uint32_t)NRF_RADIO_BASE + (uint32_t)NRF_RADIO_EVENT_CCAIDLE) -}; - -typedef struct -{ - bool frame_filtered : 1; ///< If frame being received passed filtering operation. - bool rx_timeslot_requested : 1; ///< If timeslot for the frame being received is already requested. - -#if !NRF_802154_DISABLE_BCC_MATCHING - bool psdu_being_received : 1; ///< If PSDU is currently being received. - -#endif // !NRF_802154_DISABLE_BCC_MATCHING -#if NRF_802154_TX_STARTED_NOTIFY_ENABLED - bool tx_started : 1; ///< If the requested transmission has started. - -#endif // NRF_802154_TX_STARTED_NOTIFY_ENABLED - bool rssi_started : 1; -} nrf_802154_flags_t; -static nrf_802154_flags_t m_flags; ///< Flags used to store the current driver state. - -static volatile bool m_rsch_timeslot_is_granted; ///< State of the RSCH timeslot. - -/*************************************************************************************************** - * @section Common core operations - **************************************************************************************************/ - -/** Set driver state. - * - * @param[in] state Driver state to set. - */ -static void state_set(radio_state_t state) -{ - m_state = state; - - nrf_802154_log(EVENT_SET_STATE, (uint32_t)state); -} - -/** Clear flags describing frame being received. */ -static void rx_flags_clear(void) -{ - m_flags.frame_filtered = false; - m_flags.rx_timeslot_requested = false; -#if !NRF_802154_DISABLE_BCC_MATCHING - m_flags.psdu_being_received = false; -#endif // !NRF_802154_DISABLE_BCC_MATCHING -} - -/** Request the RSSI measurement. */ -static void rssi_measure(void) -{ - m_flags.rssi_started = true; - nrf_radio_event_clear(NRF_RADIO_EVENT_RSSIEND); - nrf_radio_task_trigger(NRF_RADIO_TASK_RSSISTART); -} - -/** Wait for the RSSI measurement. */ -static void rssi_measurement_wait(void) -{ - while (!nrf_radio_event_check(NRF_RADIO_EVENT_RSSIEND)) - { - // Intentionally empty: This function is called from a critical section. - // WFE would not be waken up by a RADIO event. - } -} - -/** Get the result of the last RSSI measurement. - * - * @returns Result of the last RSSI measurement in dBm. - */ -static int8_t rssi_last_measurement_get(void) -{ - uint8_t rssi_sample = nrf_radio_rssi_sample_get(); - - rssi_sample = nrf_802154_rssi_sample_corrected_get(rssi_sample); - - return -((int8_t)rssi_sample); -} - -/** Get LQI of a received frame. - * - * @param[in] p_data Pointer to buffer containing PHR and PSDU of received frame - * - * @returns LQI of given frame. - */ -static uint8_t lqi_get(const uint8_t * p_data) -{ - uint32_t lqi = RX_FRAME_LQI(p_data); - - lqi = nrf_802154_rssi_lqi_corrected_get(lqi); - lqi *= LQI_VALUE_FACTOR; - - if (lqi > LQI_MAX) - { - lqi = LQI_MAX; - } - - return (uint8_t)lqi; -} - -static void received_frame_notify(uint8_t * p_data) -{ - nrf_802154_notify_received(p_data, // data - rssi_last_measurement_get(), // rssi - lqi_get(p_data)); // lqi -} - -/** Allow nesting critical sections and notify MAC layer that a frame was received. */ -static void received_frame_notify_and_nesting_allow(uint8_t * p_data) -{ - nrf_802154_critical_section_nesting_allow(); - - received_frame_notify(p_data); - - nrf_802154_critical_section_nesting_deny(); -} - -/** Notify MAC layer that receive procedure failed. */ -static void receive_failed_notify(nrf_802154_rx_error_t error) -{ - nrf_802154_critical_section_nesting_allow(); - - nrf_802154_notify_receive_failed(error); - - nrf_802154_critical_section_nesting_deny(); -} - -/** Notify MAC layer that transmission of requested frame has started. */ -static void transmit_started_notify(void) -{ - const uint8_t * p_frame = mp_tx_data; - - if (nrf_802154_core_hooks_tx_started(p_frame)) - { - nrf_802154_tx_started(p_frame); - } - -} - -#if !NRF_802154_DISABLE_BCC_MATCHING -/** Notify that reception of a frame has started. */ -static void receive_started_notify(void) -{ - const uint8_t * p_frame = mp_current_rx_buffer->data; - - nrf_802154_core_hooks_rx_started(p_frame); -} - -#endif - -/** Notify MAC layer that a frame was transmitted. */ -static void transmitted_frame_notify(uint8_t * p_ack, int8_t power, uint8_t lqi) -{ - const uint8_t * p_frame = mp_tx_data; - - nrf_802154_critical_section_nesting_allow(); - - nrf_802154_core_hooks_transmitted(p_frame); - nrf_802154_notify_transmitted(p_frame, p_ack, power, lqi); - - nrf_802154_critical_section_nesting_deny(); -} - -/** Notify MAC layer that transmission procedure failed. */ -static void transmit_failed_notify(nrf_802154_tx_error_t error) -{ - const uint8_t * p_frame = mp_tx_data; - - if (nrf_802154_core_hooks_tx_failed(p_frame, error)) - { - nrf_802154_notify_transmit_failed(p_frame, error); - } -} - -/** Allow nesting critical sections and notify MAC layer that transmission procedure failed. */ -static void transmit_failed_notify_and_nesting_allow(nrf_802154_tx_error_t error) -{ - nrf_802154_critical_section_nesting_allow(); - - transmit_failed_notify(error); - - nrf_802154_critical_section_nesting_deny(); -} - -/** Notify MAC layer that energy detection procedure ended. */ -static void energy_detected_notify(uint8_t result) -{ - nrf_802154_critical_section_nesting_allow(); - - nrf_802154_notify_energy_detected(result); - - nrf_802154_critical_section_nesting_deny(); -} - -/** Notify MAC layer that CCA procedure ended. */ -static void cca_notify(bool result) -{ - nrf_802154_critical_section_nesting_allow(); - - nrf_802154_notify_cca(result); - - nrf_802154_critical_section_nesting_deny(); -} - -/** Update CCA configuration in RADIO registers. */ -static void cca_configuration_update(void) -{ - nrf_802154_cca_cfg_t cca_cfg; - - nrf_802154_pib_cca_cfg_get(&cca_cfg); - nrf_radio_cca_configure(cca_cfg.mode, - nrf_802154_rssi_cca_ed_threshold_corrected_get(cca_cfg.ed_threshold), - cca_cfg.corr_threshold, - cca_cfg.corr_limit); -} - -/** Check if PSDU is currently being received. - * - * @returns True if radio is receiving PSDU, false otherwise. - */ -static bool psdu_is_being_received(void) -{ -#if NRF_802154_DISABLE_BCC_MATCHING - nrf_timer_task_trigger(NRF_802154_COUNTER_TIMER_INSTANCE, - nrf_timer_capture_task_get(NRF_TIMER_CC_CHANNEL0)); - uint32_t counter = nrf_timer_cc_read(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_CC_CHANNEL0); - - assert(counter <= 1); - - return counter > 0; -#else // NRF_802154_DISABLE_BCC_MATCHING - return m_flags.psdu_being_received; -#endif // NRF_802154_DISABLE_BCC_MATCHING -} - -/** Check if requested transmission has already started. - * - * @retval true The transmission has started. - * @retval false The transmission has not started. - */ -static bool transmission_has_started(void) -{ -#if NRF_802154_TX_STARTED_NOTIFY_ENABLED - return m_flags.tx_started; -#else // NRF_802154_TX_STARTED_NOTIFY_ENABLED - return nrf_radio_event_check(NRF_RADIO_EVENT_ADDRESS); -#endif // NRF_802154_TX_STARTED_NOTIFY_ENABLED -} - -/** Check if timeslot is currently granted. - * - * @retval true The timeslot is granted. - * @retval false The timeslot is not granted. - */ -static bool timeslot_is_granted(void) -{ - return m_rsch_timeslot_is_granted; -} - -/*************************************************************************************************** - * @section RX buffer management - **************************************************************************************************/ - -/** Set currently used rx buffer to given address. - * - * @param[in] p_rx_buffer Pointer to receive buffer that should be used now. - */ -static void rx_buffer_in_use_set(rx_buffer_t * p_rx_buffer) -{ -#if NRF_802154_RX_BUFFERS > 1 - mp_current_rx_buffer = p_rx_buffer; -#else - (void)p_rx_buffer; -#endif -} - -/** Check if currently there is available rx buffer. - * - * @retval true There is available rx buffer. - * @retval false Currently there is no available rx buffer. - */ -static bool rx_buffer_is_available(void) -{ - return (mp_current_rx_buffer != NULL) && (mp_current_rx_buffer->free); -} - -/** Get pointer to available rx buffer. - * - * @returns Pointer to available rx buffer or NULL if rx buffer is not available. - */ -static uint8_t * rx_buffer_get(void) -{ - return rx_buffer_is_available() ? mp_current_rx_buffer->data : NULL; -} - -/*************************************************************************************************** - * @section Radio parameters calculators - **************************************************************************************************/ - -/** Set radio channel - * - * @param[in] channel Channel number to set (11-26). - */ -static void channel_set(uint8_t channel) -{ - assert(channel >= 11 && channel <= 26); - - nrf_radio_frequency_set(2405 + 5 * (channel - 11)); -} - -/*************************************************************************************************** - * @section ACK transmission management - **************************************************************************************************/ - -/** Check if ACK is requested in given frame. - * - * @param[in] p_frame Pointer to a frame to check. - * - * @retval true ACK is requested in given frame. - * @retval false ACK is not requested in given frame. - */ -static bool ack_is_requested(const uint8_t * p_frame) -{ - return nrf_802154_frame_parser_ar_bit_is_set(p_frame); -} - -/*************************************************************************************************** - * @section ACK receiving management - **************************************************************************************************/ - -/** Enable hardware ACK matching accelerator. */ -static void ack_matching_enable(void) -{ - nrf_radio_event_clear(NRF_RADIO_EVENT_MHRMATCH); - nrf_radio_mhmu_search_pattern_set(MHMU_PATTERN | - ((uint32_t)mp_tx_data[DSN_OFFSET] << - MHMU_PATTERN_DSN_OFFSET)); -} - -/** Disable hardware ACK matching accelerator. */ -static void ack_matching_disable(void) -{ - nrf_radio_mhmu_search_pattern_set(0); - nrf_radio_event_clear(NRF_RADIO_EVENT_MHRMATCH); -} - -/** Check if hardware ACK matching accelerator matched ACK pattern in received frame. - * - * @retval true ACK matching accelerator matched ACK pattern. - * @retval false ACK matching accelerator did not match ACK pattern. - */ -static bool ack_is_matched(void) -{ - return (nrf_radio_event_check(NRF_RADIO_EVENT_MHRMATCH)) && - (nrf_radio_crc_status_check()); -} - -/*************************************************************************************************** - * @section RADIO peripheral management - **************************************************************************************************/ - -/** Initialize radio peripheral. */ -static void nrf_radio_init(void) -{ - nrf_radio_packet_conf_t packet_conf; - - nrf_radio_mode_set(NRF_RADIO_MODE_IEEE802154_250KBIT); - - memset(&packet_conf, 0, sizeof(packet_conf)); - packet_conf.lflen = 8; - packet_conf.plen = NRF_RADIO_PREAMBLE_LENGTH_32BIT_ZERO; - packet_conf.crcinc = true; - packet_conf.maxlen = MAX_PACKET_SIZE; - nrf_radio_packet_configure(&packet_conf); - - nrf_radio_modecnf0_set(true, 0); - - // Configure CRC - nrf_radio_crc_configure(CRC_LENGTH, NRF_RADIO_CRC_ADDR_IEEE802154, CRC_POLYNOMIAL); - - // Configure CCA - cca_configuration_update(); - - // Configure MAC Header Match Unit - nrf_radio_mhmu_search_pattern_set(0); - nrf_radio_mhmu_pattern_mask_set(MHMU_MASK); - - // Set channel - channel_set(nrf_802154_pib_channel_get()); -} - -/** Reset radio peripheral. */ -static void nrf_radio_reset(void) -{ - nrf_radio_power_set(false); - nrf_radio_power_set(true); - - nrf_802154_log(EVENT_RADIO_RESET, 0); -} - -/** Initialize interrupts for radio peripheral. */ -static void irq_init(void) -{ -#if !NRF_IS_IRQ_PRIORITY_ALLOWED(NRF_802154_IRQ_PRIORITY) -#error NRF_802154_IRQ_PRIORITY value out of the allowed range. -#endif - NVIC_SetPriority(RADIO_IRQn, NRF_802154_IRQ_PRIORITY); - NVIC_ClearPendingIRQ(RADIO_IRQn); -} - -/** Deinitialize interrupts for radio peripheral. */ -static void irq_deinit(void) -{ - NVIC_DisableIRQ(RADIO_IRQn); - NVIC_ClearPendingIRQ(RADIO_IRQn); - NVIC_SetPriority(RADIO_IRQn, 0); - - __DSB(); - __ISB(); -} - -/*************************************************************************************************** - * @section TIMER peripheral management - **************************************************************************************************/ - -/** Initialize TIMER peripheral used by the driver. */ -static void nrf_timer_init(void) -{ - nrf_timer_mode_set(NRF_802154_TIMER_INSTANCE, NRF_TIMER_MODE_TIMER); - nrf_timer_bit_width_set(NRF_802154_TIMER_INSTANCE, NRF_TIMER_BIT_WIDTH_32); - nrf_timer_frequency_set(NRF_802154_TIMER_INSTANCE, NRF_TIMER_FREQ_1MHz); - -#if NRF_802154_DISABLE_BCC_MATCHING - // Setup timer for detecting PSDU reception. - nrf_timer_mode_set(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_MODE_COUNTER); - nrf_timer_bit_width_set(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_BIT_WIDTH_8); -#endif -} - -/*************************************************************************************************** - * @section Energy detection management - **************************************************************************************************/ - -/** Get ED result value. - * - * @returns ED result based on data collected during Energy Detection procedure. - */ -static uint8_t ed_result_get(void) -{ - uint32_t result = m_ed_result; - - result = nrf_802154_rssi_ed_corrected_get(result); - result *= ED_RESULT_FACTOR; - - if (result > ED_RESULT_MAX) - { - result = ED_RESULT_MAX; - } - - return (uint8_t)result; -} - -/** Setup next iteration of energy detection procedure. - * - * Energy detection procedure is performed in iterations to make sure it is performed for requested - * time regardless radio arbitration. - * - * @param[in] Remaining time of energy detection procedure [us]. - * - * @retval true Next iteration of energy detection procedure will be performed now. - * @retval false Next iteration of energy detection procedure will not be performed now due to - * ending timeslot. - */ -static bool ed_iter_setup(uint32_t time_us) -{ - uint32_t us_left_in_timeslot = nrf_802154_rsch_timeslot_us_left_get(); - uint32_t next_ed_iters = us_left_in_timeslot / ED_ITER_DURATION; - - if (next_ed_iters > ED_ITERS_OVERHEAD) - { - next_ed_iters -= ED_ITERS_OVERHEAD; - - if ((time_us / ED_ITER_DURATION) < next_ed_iters) - { - m_ed_time_left = 0; - next_ed_iters = time_us / ED_ITER_DURATION; - } - else - { - m_ed_time_left = time_us - (next_ed_iters * ED_ITER_DURATION); - next_ed_iters--; // Time of ED procedure is (next_ed_iters + 1) * 128us - } - - nrf_radio_ed_loop_count_set(next_ed_iters); - - return true; - } - else - { - // Silently wait for a new timeslot - - m_ed_time_left = time_us; - - return false; - } -} - -/*************************************************************************************************** - * @section FSM transition request sub-procedures - **************************************************************************************************/ - -/** Wait time needed to propagate event through PPI to EGU. - * - * During detection if trigger of DISABLED event caused start of hardware procedure, detecting - * function needs to wait until event is propagated from RADIO through PPI to EGU. This delay is - * required to make sure EGU event is set if hardware was prepared before DISABLED event was - * triggered. - */ -static inline void ppi_and_egu_delay_wait(void) -{ - __ASM("nop"); - __ASM("nop"); - __ASM("nop"); - __ASM("nop"); - __ASM("nop"); - __ASM("nop"); -} - -/** Detect if PPI starting EGU for current operation worked. - * - * @retval true PPI worked. - * @retval false PPI did not work. DISABLED task should be triggered. - */ -static bool ppi_egu_worked(void) -{ - // Detect if PPIs were set before DISABLED event was notified. If not trigger DISABLE - if (nrf_radio_state_get() != NRF_RADIO_STATE_DISABLED) - { - // If RADIO state is not DISABLED, it means that RADIO is still ramping down or already - // started ramping up. - return true; - } - - // Wait for PPIs - ppi_and_egu_delay_wait(); - - if (nrf_egu_event_check(NRF_802154_SWI_EGU_INSTANCE, EGU_EVENT)) - { - // If EGU event is set, procedure is running. - return true; - } - else - { - return false; - } -} - -/** Set PPIs to connect DISABLED->EGU->RAMP_UP - * - * @param[in] ramp_up_task Task triggered to start ramp up procedure. - * @param[in] self_disabling If PPI should disable itself. - */ -static void ppis_for_egu_and_ramp_up_set(nrf_radio_task_t ramp_up_task, bool self_disabling) -{ - if (self_disabling) - { - nrf_ppi_channel_and_fork_endpoint_setup(PPI_EGU_RAMP_UP, - (uint32_t)nrf_egu_event_address_get( - NRF_802154_SWI_EGU_INSTANCE, - EGU_EVENT), - (uint32_t)nrf_radio_task_address_get(ramp_up_task), - (uint32_t)nrf_ppi_task_address_get( - PPI_CHGRP0_DIS_TASK)); - } - else - { - nrf_ppi_channel_endpoint_setup(PPI_EGU_RAMP_UP, - (uint32_t)nrf_egu_event_address_get( - NRF_802154_SWI_EGU_INSTANCE, - EGU_EVENT), - (uint32_t)nrf_radio_task_address_get(ramp_up_task)); - } - - nrf_ppi_channel_endpoint_setup(PPI_DISABLED_EGU, - (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_DISABLED), - (uint32_t)nrf_egu_task_address_get( - NRF_802154_SWI_EGU_INSTANCE, - EGU_TASK)); - - if (self_disabling) - { - nrf_ppi_channel_include_in_group(PPI_EGU_RAMP_UP, PPI_CHGRP0); - } - - nrf_ppi_channel_enable(PPI_EGU_RAMP_UP); - nrf_ppi_channel_enable(PPI_DISABLED_EGU); -} - -/** Configure FEM to set LNA at appropriate time. */ -static void fem_for_lna_set(void) -{ - if (nrf_802154_fal_lna_configuration_set(&m_activate_rx_cc0, NULL) == NRF_SUCCESS) - { - uint32_t event_addr = (uint32_t)nrf_egu_event_address_get(NRF_802154_SWI_EGU_INSTANCE, - EGU_EVENT); - uint32_t task_addr = (uint32_t)nrf_timer_task_address_get(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_TASK_START); - - nrf_timer_shorts_enable(m_activate_rx_cc0.event.timer.p_timer_instance, - NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - nrf_ppi_channel_endpoint_setup(PPI_EGU_TIMER_START, event_addr, task_addr); - nrf_ppi_channel_enable(PPI_EGU_TIMER_START); - } -} - -/** Reset FEM configuration for LNA. - * - * @param[in] timer_short_mask Mask of shorts that should be disabled on FEM timer. - */ -static void fem_for_lna_reset(void) -{ - nrf_802154_fal_lna_configuration_clear(&m_activate_rx_cc0, NULL); - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_timer_shorts_disable(NRF_802154_TIMER_INSTANCE, NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - nrf_ppi_channel_disable(PPI_EGU_TIMER_START); -} - -/** Configure FEM to set PA at appropriate time. */ -static void fem_for_pa_set(void) -{ - if (nrf_802154_fal_pa_configuration_set(&m_activate_tx_cc0, NULL) == NRF_SUCCESS) - { - uint32_t event_addr = (uint32_t)nrf_egu_event_address_get(NRF_802154_SWI_EGU_INSTANCE, - EGU_EVENT); - uint32_t task_addr = (uint32_t)nrf_timer_task_address_get(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_TASK_START); - - nrf_timer_shorts_enable(m_activate_tx_cc0.event.timer.p_timer_instance, - NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - nrf_ppi_channel_endpoint_setup(PPI_EGU_TIMER_START, event_addr, task_addr); - nrf_ppi_channel_enable(PPI_EGU_TIMER_START); - } -} - -/** Reset FEM configuration for PA. */ -static void fem_for_pa_reset(void) -{ - nrf_802154_fal_pa_configuration_clear(&m_activate_tx_cc0, NULL); - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_ppi_channel_disable(PPI_EGU_TIMER_START); - nrf_802154_fal_deactivate_now(NRF_802154_FAL_PA); -} - -/** Configure FEM for TX procedure. */ -static void fem_for_tx_set(bool cca) -{ - bool success; - - if (cca) - { - bool pa_set = false; - bool lna_set = false; - - if (nrf_802154_fal_lna_configuration_set(&m_activate_rx_cc0, &m_ccaidle) == NRF_SUCCESS) - { - lna_set = true; - } - - if (nrf_802154_fal_pa_configuration_set(&m_ccaidle, NULL) == NRF_SUCCESS) - { - pa_set = true; - } - - success = pa_set || lna_set; - - } - else - { - success = (nrf_802154_fal_pa_configuration_set(&m_activate_tx_cc0, NULL) == NRF_SUCCESS); - } - - if (success) - { - nrf_timer_shorts_enable(NRF_802154_TIMER_INSTANCE, NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - - uint32_t egu_event_addr = (uint32_t)nrf_egu_event_address_get(NRF_802154_SWI_EGU_INSTANCE, - EGU_EVENT); - uint32_t timer_task_addr = (uint32_t)nrf_timer_task_address_get(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_TASK_START); - - nrf_ppi_channel_endpoint_setup(PPI_EGU_TIMER_START, egu_event_addr, timer_task_addr); - nrf_ppi_channel_enable(PPI_EGU_TIMER_START); - } -} - -/** Reset FEM for TX procedure. */ -static void fem_for_tx_reset(bool disable_ppi_egu_timer_start) -{ - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_timer_shorts_disable(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_SHORT_COMPARE0_STOP_MASK | - NRF_TIMER_SHORT_COMPARE1_STOP_MASK); - - switch (m_state) - { - case RADIO_STATE_CCA_TX: - nrf_802154_fal_pa_configuration_clear(&m_activate_rx_cc0, &m_ccaidle); - break; - - case RADIO_STATE_TX: - nrf_802154_fal_pa_configuration_clear(&m_activate_tx_cc0, NULL); - break; - - default: - assert(false); - break; - } - - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - - if (disable_ppi_egu_timer_start) - { - nrf_ppi_channel_disable(PPI_EGU_TIMER_START); - } -} - -/** Restart RX procedure after frame was received (and no ACK transmitted). */ -static void rx_restart(bool set_shorts) -{ - // Disable PPIs on DISABLED event to control TIMER. - nrf_ppi_channel_disable(PPI_DISABLED_EGU); - - if (set_shorts) - { - nrf_radio_shorts_set(SHORTS_RX); - } - - // Restart TIMER. - // Anomaly 78: use SHUTDOWN instead of STOP and CLEAR. - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - -#if NRF_802154_DISABLE_BCC_MATCHING - // Anomaly 78: use SHUTDOWN instead of STOP and CLEAR. - nrf_timer_task_trigger(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - // Enable self-disabled PPI or PPI disabled by CRCOK - nrf_ppi_channel_enable(PPI_EGU_RAMP_UP); - - rx_flags_clear(); -#if !NRF_802154_DISABLE_BCC_MATCHING - nrf_radio_event_clear(NRF_RADIO_EVENT_BCMATCH); - nrf_radio_bcc_set(BCC_INIT); -#endif // !NRF_802154_DISABLE_BCC_MATCHING - - // Enable PPIs on DISABLED event and clear event to detect if PPI worked - nrf_egu_event_clear(NRF_802154_SWI_EGU_INSTANCE, EGU_EVENT); - nrf_ppi_channel_enable(PPI_DISABLED_EGU); - - // Prepare the timer coordinator to get a precise timestamp of the CRCOK event. - nrf_802154_timer_coord_timestamp_prepare( - (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_CRCOK)); - - if (!ppi_egu_worked()) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - } -} - -/** Check if time remaining in the timeslot is long enough to process whole critical section. */ -static bool remaining_timeslot_time_is_enough_for_crit_sect(void) -{ - return nrf_802154_rsch_timeslot_us_left_get() >= MAX_CRIT_SECT_TIME; -} - -/** Check if critical section can be processed at the moment. - * - * @note This function returns valid result only inside critical section. - * - * @retval true There is enough time in current timeslot or timeslot is denied at the moment. - * @retval false Current timeslot ends too shortly to process critical section inside. - */ -static bool critical_section_can_be_processed_now(void) -{ - return !timeslot_is_granted() || remaining_timeslot_time_is_enough_for_crit_sect(); -} - -/** Enter critical section and verify if there is enough time to complete operations within. */ -static bool critical_section_enter_and_verify_timeslot_length(void) -{ - bool result = nrf_802154_critical_section_enter(); - - if (result) - { - if (!critical_section_can_be_processed_now()) - { - result = false; - - nrf_802154_critical_section_exit(); - } - } - - return result; -} - -/** Terminate Falling Asleep procedure. */ -static void falling_asleep_terminate(void) -{ - if (timeslot_is_granted()) - { - nrf_radio_int_disable(NRF_RADIO_INT_DISABLED_MASK); - } -} - -/** Terminate Sleep procedure. */ -static void sleep_terminate(void) -{ - nrf_802154_rsch_crit_sect_prio_request(RSCH_PRIO_MAX); -} - -/** Terminate RX procedure. */ -static void rx_terminate(void) -{ - uint32_t ints_to_disable = 0; - - nrf_ppi_channel_disable(PPI_DISABLED_EGU); - nrf_ppi_channel_disable(PPI_EGU_RAMP_UP); - nrf_ppi_channel_disable(PPI_EGU_TIMER_START); -#if NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_disable(PPI_CRCERROR_CLEAR); - nrf_ppi_channel_disable(PPI_CRCOK_DIS_PPI); - nrf_ppi_channel_disable(PPI_ADDRESS_COUNTER_COUNT); - nrf_ppi_channel_disable(PPI_CRCERROR_COUNTER_CLEAR); - nrf_ppi_channel_endpoint_setup(PPI_CRCERROR_CLEAR, 0, 0); - nrf_ppi_fork_endpoint_setup(PPI_CRCERROR_CLEAR, 0); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - // Disable LNA - nrf_802154_fal_lna_configuration_clear(&m_activate_rx_cc0, NULL); - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_ppi_channel_remove_from_group(PPI_EGU_RAMP_UP, PPI_CHGRP0); - -#if NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_fork_endpoint_setup(PPI_EGU_TIMER_START, 0); -#else // NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_fork_endpoint_setup(PPI_EGU_RAMP_UP, 0); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - // Anomaly 78: use SHUTDOWN instead of STOP and CLEAR. - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_timer_shorts_disable(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - -#if NRF_802154_DISABLE_BCC_MATCHING - // Anomaly 78: use SHUTDOWN instead of STOP and CLEAR. - nrf_timer_task_trigger(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_timer_shorts_disable(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_SHORT_COMPARE1_STOP_MASK); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - if (timeslot_is_granted()) - { -#if !NRF_802154_DISABLE_BCC_MATCHING || NRF_802154_NOTIFY_CRCERROR - ints_to_disable |= NRF_RADIO_INT_CRCERROR_MASK; -#endif // !NRF_802154_DISABLE_BCC_MATCHING || NRF_802154_NOTIFY_CRCERROR -#if !NRF_802154_DISABLE_BCC_MATCHING - ints_to_disable |= NRF_RADIO_INT_BCMATCH_MASK; -#endif // !NRF_802154_DISABLE_BCC_MATCHING - ints_to_disable |= NRF_RADIO_INT_CRCOK_MASK; - nrf_radio_int_disable(ints_to_disable); - nrf_radio_shorts_set(SHORTS_IDLE); - bool shutdown = nrf_fem_prepare_powerdown(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_CC_CHANNEL0, - PPI_EGU_TIMER_START); - - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - if (shutdown) - { - while (!nrf_timer_event_check(NRF_802154_TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0)) - { - // Wait until the event is set. - } - nrf_timer_shorts_disable(NRF_802154_TIMER_INSTANCE, NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_ppi_channel_disable(PPI_EGU_TIMER_START); - } - } -} - -/** Terminate TX ACK procedure. */ -static void tx_ack_terminate(void) -{ - uint32_t ints_to_disable = 0; - - nrf_ppi_channel_disable(PPI_DISABLED_EGU); - nrf_ppi_channel_disable(PPI_EGU_RAMP_UP); - nrf_ppi_channel_disable(PPI_EGU_TIMER_START); -#if NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_disable(PPI_CRCERROR_CLEAR); - nrf_ppi_channel_disable(PPI_CRCOK_DIS_PPI); - nrf_ppi_channel_endpoint_setup(PPI_CRCERROR_CLEAR, 0, 0); - nrf_ppi_fork_endpoint_setup(PPI_CRCERROR_CLEAR, 0); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - // Disable PA - nrf_802154_fal_pa_configuration_clear(&m_activate_tx_cc0, NULL); - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - - nrf_ppi_channel_remove_from_group(PPI_EGU_RAMP_UP, PPI_CHGRP0); -#if !NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_fork_endpoint_setup(PPI_EGU_RAMP_UP, 0); -#endif // !NRF_802154_DISABLE_BCC_MATCHING - - // Anomaly 78: use SHUTDOWN instead of STOP and CLEAR. - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_timer_shorts_disable(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - -#if NRF_802154_DISABLE_BCC_MATCHING - // Anomaly 78: use SHUTDOWN instead of STOP and CLEAR. - nrf_timer_task_trigger(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_timer_shorts_disable(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_SHORT_COMPARE1_STOP_MASK); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - if (timeslot_is_granted()) - { - ints_to_disable = NRF_RADIO_INT_PHYEND_MASK; - -#if NRF_802154_TX_STARTED_NOTIFY_ENABLED - ints_to_disable |= NRF_RADIO_INT_ADDRESS_MASK; -#endif // NRF_802154_TX_STARTED_NOTIFY_ENABLED - - nrf_radio_int_disable(ints_to_disable); - nrf_radio_shorts_set(SHORTS_IDLE); - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - } -} - -/** Terminate TX procedure. */ -static void tx_terminate(void) -{ - uint32_t ints_to_disable; - - nrf_ppi_channel_disable(PPI_DISABLED_EGU); - nrf_ppi_channel_disable(PPI_EGU_RAMP_UP); - - fem_for_tx_reset(true); - - nrf_ppi_channel_remove_from_group(PPI_EGU_RAMP_UP, PPI_CHGRP0); - nrf_ppi_fork_endpoint_setup(PPI_EGU_RAMP_UP, 0); - - if (timeslot_is_granted()) - { - ints_to_disable = NRF_RADIO_INT_PHYEND_MASK | NRF_RADIO_INT_CCABUSY_MASK; - -#if NRF_802154_TX_STARTED_NOTIFY_ENABLED - ints_to_disable |= NRF_RADIO_INT_ADDRESS_MASK; -#endif // NRF_802154_TX_STARTED_NOTIFY_ENABLED - - nrf_radio_int_disable(ints_to_disable); - nrf_radio_shorts_set(SHORTS_IDLE); - bool shutdown = nrf_fem_prepare_powerdown(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_CC_CHANNEL0, - PPI_EGU_TIMER_START); - - nrf_radio_task_trigger(NRF_RADIO_TASK_CCASTOP); - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - if (shutdown) - { - while (!nrf_timer_event_check(NRF_802154_TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0)) - { - // Wait until the event is set. - } - nrf_timer_shorts_disable(NRF_802154_TIMER_INSTANCE, NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_ppi_channel_disable(PPI_EGU_TIMER_START); - } - } -} - -/** Terminate RX ACK procedure. */ -static void rx_ack_terminate(void) -{ - uint32_t ints_to_disable; - - nrf_ppi_channel_disable(PPI_DISABLED_EGU); - nrf_ppi_channel_disable(PPI_EGU_RAMP_UP); - - fem_for_lna_reset(); - - nrf_ppi_channel_remove_from_group(PPI_EGU_RAMP_UP, PPI_CHGRP0); - nrf_ppi_fork_endpoint_setup(PPI_EGU_RAMP_UP, 0); - - if (timeslot_is_granted()) - { - ints_to_disable = NRF_RADIO_INT_END_MASK; - ints_to_disable |= NRF_RADIO_INT_ADDRESS_MASK; - - nrf_radio_int_disable(ints_to_disable); - nrf_radio_shorts_set(SHORTS_IDLE); - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - - ack_matching_disable(); - } -} - -/** Terminate ED procedure. */ -static void ed_terminate(void) -{ - nrf_ppi_channel_disable(PPI_DISABLED_EGU); - nrf_ppi_channel_disable(PPI_EGU_RAMP_UP); - - fem_for_lna_reset(); - - nrf_ppi_channel_remove_from_group(PPI_EGU_RAMP_UP, PPI_CHGRP0); - nrf_ppi_fork_endpoint_setup(PPI_EGU_RAMP_UP, 0); - - if (timeslot_is_granted()) - { - bool shutdown = nrf_fem_prepare_powerdown(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_CC_CHANNEL0, - PPI_EGU_TIMER_START); - - nrf_radio_int_disable(NRF_RADIO_INT_EDEND_MASK); - nrf_radio_shorts_set(SHORTS_IDLE); - nrf_radio_task_trigger(NRF_RADIO_TASK_EDSTOP); - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - - if (shutdown) - { - while (!nrf_timer_event_check(NRF_802154_TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0)) - { - // Wait until the event is set. - } - nrf_timer_shorts_disable(NRF_802154_TIMER_INSTANCE, NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_ppi_channel_disable(PPI_EGU_TIMER_START); - } - } -} - -/** Terminate CCA procedure. */ -static void cca_terminate(void) -{ - nrf_ppi_channel_disable(PPI_DISABLED_EGU); - nrf_ppi_channel_disable(PPI_EGU_RAMP_UP); - - fem_for_lna_reset(); - - nrf_ppi_channel_remove_from_group(PPI_EGU_RAMP_UP, PPI_CHGRP0); - nrf_ppi_fork_endpoint_setup(PPI_EGU_RAMP_UP, 0); - - if (timeslot_is_granted()) - { - bool shutdown = nrf_fem_prepare_powerdown(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_CC_CHANNEL0, - PPI_EGU_TIMER_START); - - nrf_radio_int_disable(NRF_RADIO_INT_CCABUSY_MASK | NRF_RADIO_INT_CCAIDLE_MASK); - nrf_radio_shorts_set(SHORTS_IDLE); - nrf_radio_task_trigger(NRF_RADIO_TASK_CCASTOP); - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - - if (shutdown) - { - while (!nrf_timer_event_check(NRF_802154_TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0)) - { - // Wait until the event is set. - } - nrf_timer_shorts_disable(NRF_802154_TIMER_INSTANCE, NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_ppi_channel_disable(PPI_EGU_TIMER_START); - } - } -} - -/** Terminate Continuous Carrier procedure. */ -static void continuous_carrier_terminate(void) -{ - nrf_ppi_channel_disable(PPI_DISABLED_EGU); - nrf_ppi_channel_disable(PPI_EGU_RAMP_UP); - - fem_for_pa_reset(); - - if (timeslot_is_granted()) - { - bool shutdown = nrf_fem_prepare_powerdown(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_CC_CHANNEL0, - PPI_EGU_TIMER_START); - - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - if (shutdown) - { - while (!nrf_timer_event_check(NRF_802154_TIMER_INSTANCE, NRF_TIMER_EVENT_COMPARE0)) - { - // Wait until the event is set. - } - nrf_timer_shorts_disable(NRF_802154_TIMER_INSTANCE, NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_ppi_channel_disable(PPI_EGU_TIMER_START); - } - } -} - -/** Terminate ongoing operation. - * - * This function is called when MAC layer requests transition to another operation. - * - * After calling this function RADIO should enter DISABLED state and Radio Scheduler - * should be in continuous mode. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] req_orig Module that originates termination request. - * @param[in] notify_abort If Termination of current operation shall be notified. - * - * @retval true Terminated ongoing operation. - * @retval false Ongoing operation was not terminated. - */ -static bool current_operation_terminate(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - bool notify) -{ - bool result = nrf_802154_core_hooks_terminate(term_lvl, req_orig); - - if (result) - { - switch (m_state) - { - case RADIO_STATE_SLEEP: - if (req_orig != REQ_ORIG_RSCH) - { - // Terminate sleep state unless it is requested by Radio Scheduler - // during timeslot end. - sleep_terminate(); - } - - break; - - case RADIO_STATE_FALLING_ASLEEP: - falling_asleep_terminate(); - break; - - case RADIO_STATE_RX: - if (psdu_is_being_received()) - { - if (term_lvl >= NRF_802154_TERM_802154) - { - rx_terminate(); - - if (notify) - { - nrf_802154_notify_receive_failed(NRF_802154_RX_ERROR_ABORTED); - } - } - else - { - result = false; - } - } - else - { - rx_terminate(); - } - - break; - - case RADIO_STATE_TX_ACK: - if (term_lvl >= NRF_802154_TERM_802154) - { - tx_ack_terminate(); - - if (notify) - { - mp_current_rx_buffer->free = false; - received_frame_notify(mp_current_rx_buffer->data); - } - } - else - { - result = false; - } - - break; - - case RADIO_STATE_CCA_TX: - case RADIO_STATE_TX: - if (term_lvl >= NRF_802154_TERM_802154) - { - tx_terminate(); - - if (notify) - { - transmit_failed_notify(NRF_802154_TX_ERROR_ABORTED); - } - } - else - { - result = false; - } - - break; - - case RADIO_STATE_RX_ACK: - if (term_lvl >= NRF_802154_TERM_802154) - { - rx_ack_terminate(); - - if (notify) - { - transmit_failed_notify(NRF_802154_TX_ERROR_ABORTED); - } - } - else - { - result = false; - } - - break; - - case RADIO_STATE_ED: - if (term_lvl >= NRF_802154_TERM_802154) - { - ed_terminate(); - - if (notify) - { - nrf_802154_notify_energy_detection_failed(NRF_802154_ED_ERROR_ABORTED); - } - } - else - { - result = false; - } - - break; - - case RADIO_STATE_CCA: - if (term_lvl >= NRF_802154_TERM_802154) - { - cca_terminate(); - - if (notify) - { - nrf_802154_notify_cca_failed(NRF_802154_CCA_ERROR_ABORTED); - } - } - else - { - result = false; - } - break; - - case RADIO_STATE_CONTINUOUS_CARRIER: - continuous_carrier_terminate(); - break; - - default: - assert(false); - } - } - - return result; -} - -/** Enter Sleep state. */ -static void sleep_init(void) -{ - nrf_802154_timer_coord_stop(); - nrf_802154_rsch_crit_sect_prio_request(RSCH_PRIO_IDLE); -} - -/** Initialize Falling Asleep operation. */ -static void falling_asleep_init(void) -{ - if (!timeslot_is_granted()) - { - state_set(RADIO_STATE_SLEEP); - sleep_init(); - return; - } - - nrf_radio_event_clear(NRF_RADIO_EVENT_DISABLED); - nrf_radio_int_enable(NRF_RADIO_INT_DISABLED_MASK); - - if (nrf_radio_state_get() == NRF_RADIO_STATE_DISABLED) - { - // Radio is already disabled. Enter sleep state directly. - falling_asleep_terminate(); - state_set(RADIO_STATE_SLEEP); - sleep_init(); - } -} - -/** Initialize RX operation. */ -static void rx_init(bool disabled_was_triggered) -{ - bool free_buffer; - int32_t ints_to_enable = 0; - - if (!timeslot_is_granted()) - { - return; - } - - // Clear filtering flag - rx_flags_clear(); - // Clear the RSSI measurement flag. - m_flags.rssi_started = false; - - nrf_radio_txpower_set(nrf_802154_pib_tx_power_get()); - - // Find available RX buffer - free_buffer = rx_buffer_is_available(); - - if (free_buffer) - { - nrf_radio_packetptr_set(rx_buffer_get()); - } - - // Set shorts - nrf_radio_shorts_set(free_buffer ? (SHORTS_RX | SHORTS_RX_FREE_BUFFER) : (SHORTS_RX)); - - // Set BCC -#if !NRF_802154_DISABLE_BCC_MATCHING - nrf_radio_bcc_set(BCC_INIT); -#endif // !NRF_802154_DISABLE_BCC_MATCHING - - // Enable IRQs -#if !NRF_802154_DISABLE_BCC_MATCHING || NRF_802154_NOTIFY_CRCERROR - nrf_radio_event_clear(NRF_RADIO_EVENT_CRCERROR); - ints_to_enable |= NRF_RADIO_INT_CRCERROR_MASK; -#endif // !NRF_802154_DISABLE_BCC_MATCHING ||NRF_802154_NOTIFY_CRCERROR -#if !NRF_802154_DISABLE_BCC_MATCHING - nrf_radio_event_clear(NRF_RADIO_EVENT_BCMATCH); - ints_to_enable |= NRF_RADIO_INT_BCMATCH_MASK; -#endif // !NRF_802154_DISABLE_BCC_MATCHING - nrf_radio_event_clear(NRF_RADIO_EVENT_CRCOK); - ints_to_enable |= NRF_RADIO_INT_CRCOK_MASK; - nrf_radio_int_enable(ints_to_enable); - - // Set FEM - nrf_timer_shorts_enable(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_SHORT_COMPARE0_STOP_MASK); - - uint32_t delta_time; - - if (nrf_802154_fal_lna_configuration_set(&m_activate_rx_cc0, NULL) == NRF_SUCCESS) - { - delta_time = nrf_timer_cc_read(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_CC_CHANNEL0); - } - else - { - delta_time = 1; - nrf_timer_cc_write(NRF_802154_TIMER_INSTANCE, NRF_TIMER_CC_CHANNEL0, delta_time); - } - - nrf_timer_cc_write(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_CC_CHANNEL1, - delta_time + ACK_IFS - TXRU_TIME - EVENT_LAT); - -#if NRF_802154_DISABLE_BCC_MATCHING - nrf_timer_shorts_enable(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_SHORT_COMPARE1_STOP_MASK); - nrf_timer_cc_write(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_CC_CHANNEL1, 1); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - // Clr event EGU - nrf_egu_event_clear(NRF_802154_SWI_EGU_INSTANCE, EGU_EVENT); - - // Set PPIs -#if NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_endpoint_setup(PPI_EGU_RAMP_UP, - (uint32_t)nrf_egu_event_address_get( - NRF_802154_SWI_EGU_INSTANCE, - EGU_EVENT), - (uint32_t)nrf_radio_task_address_get(NRF_RADIO_TASK_RXEN)); - nrf_ppi_channel_and_fork_endpoint_setup(PPI_EGU_TIMER_START, - (uint32_t)nrf_egu_event_address_get( - NRF_802154_SWI_EGU_INSTANCE, - EGU_EVENT), - (uint32_t)nrf_timer_task_address_get( - NRF_802154_TIMER_INSTANCE, - NRF_TIMER_TASK_START), - (uint32_t)nrf_timer_task_address_get( - NRF_802154_COUNTER_TIMER_INSTANCE, - NRF_TIMER_TASK_START)); - // Anomaly 78: use SHUTDOWN instead of CLEAR. - nrf_ppi_channel_endpoint_setup(PPI_CRCERROR_CLEAR, - (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_CRCERROR), - (uint32_t)nrf_timer_task_address_get( - NRF_802154_TIMER_INSTANCE, - NRF_TIMER_TASK_SHUTDOWN)); - nrf_ppi_channel_endpoint_setup(PPI_CRCOK_DIS_PPI, - (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_CRCOK), - (uint32_t)nrf_ppi_task_address_get(PPI_CHGRP0_DIS_TASK)); -#else // NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_and_fork_endpoint_setup(PPI_EGU_RAMP_UP, - (uint32_t)nrf_egu_event_address_get( - NRF_802154_SWI_EGU_INSTANCE, - EGU_EVENT), - (uint32_t)nrf_radio_task_address_get( - NRF_RADIO_TASK_RXEN), - (uint32_t)nrf_ppi_task_address_get( - PPI_CHGRP0_DIS_TASK)); - nrf_ppi_channel_endpoint_setup(PPI_EGU_TIMER_START, - (uint32_t)nrf_egu_event_address_get( - NRF_802154_SWI_EGU_INSTANCE, - EGU_EVENT), - (uint32_t)nrf_timer_task_address_get( - NRF_802154_TIMER_INSTANCE, - NRF_TIMER_TASK_START)); -#endif // NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_include_in_group(PPI_EGU_RAMP_UP, PPI_CHGRP0); - - nrf_ppi_channel_endpoint_setup(PPI_DISABLED_EGU, - (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_DISABLED), - (uint32_t)nrf_egu_task_address_get( - NRF_802154_SWI_EGU_INSTANCE, - EGU_TASK)); -#if NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_endpoint_setup(PPI_ADDRESS_COUNTER_COUNT, - (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_ADDRESS), - (uint32_t)nrf_timer_task_address_get( - NRF_802154_COUNTER_TIMER_INSTANCE, - NRF_TIMER_TASK_COUNT)); - // Anomaly 78: use SHUTDOWN instead of CLEAR. - nrf_ppi_channel_endpoint_setup(PPI_CRCERROR_COUNTER_CLEAR, - (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_CRCERROR), - (uint32_t)nrf_timer_task_address_get( - NRF_802154_COUNTER_TIMER_INSTANCE, - NRF_TIMER_TASK_SHUTDOWN)); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - nrf_ppi_channel_enable(PPI_EGU_RAMP_UP); - nrf_ppi_channel_enable(PPI_EGU_TIMER_START); -#if NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_enable(PPI_CRCERROR_CLEAR); - nrf_ppi_channel_enable(PPI_CRCOK_DIS_PPI); - nrf_ppi_channel_enable(PPI_ADDRESS_COUNTER_COUNT); - nrf_ppi_channel_enable(PPI_CRCERROR_COUNTER_CLEAR); -#endif // NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_enable(PPI_DISABLED_EGU); - - // Configure the timer coordinator to get a timestamp of the CRCOK event. - nrf_802154_timer_coord_timestamp_prepare( - (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_CRCOK)); - - // Start procedure if necessary - if (!disabled_was_triggered || !ppi_egu_worked()) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - } - - // Find RX buffer if none available - if (!free_buffer) - { - rx_buffer_in_use_set(nrf_802154_rx_buffer_free_find()); - - if (rx_buffer_is_available()) - { - nrf_radio_packetptr_set(rx_buffer_get()); - nrf_radio_shorts_set(SHORTS_RX | SHORTS_RX_FREE_BUFFER); - - if (nrf_radio_state_get() == NRF_RADIO_STATE_RXIDLE) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_START); - } - } - } -} - -/** Initialize TX operation. */ -static bool tx_init(const uint8_t * p_data, bool cca, bool disabled_was_triggered) -{ - uint32_t ints_to_enable = 0; - - if (!timeslot_is_granted() || !nrf_802154_rsch_timeslot_request( - nrf_802154_tx_duration_get(p_data[0], cca, ack_is_requested(p_data)))) - { - return false; - } - - nrf_radio_txpower_set(nrf_802154_pib_tx_power_get()); - nrf_radio_packetptr_set(p_data); - - // Set shorts - nrf_radio_shorts_set(cca ? SHORTS_CCA_TX : SHORTS_TX); - - // Enable IRQs - nrf_radio_event_clear(NRF_RADIO_EVENT_PHYEND); - ints_to_enable |= NRF_RADIO_INT_PHYEND_MASK; - - if (cca) - { - nrf_radio_event_clear(NRF_RADIO_EVENT_CCABUSY); - ints_to_enable |= NRF_RADIO_INT_CCABUSY_MASK; - } - - nrf_radio_event_clear(NRF_RADIO_EVENT_ADDRESS); -#if NRF_802154_TX_STARTED_NOTIFY_ENABLED - ints_to_enable |= NRF_RADIO_INT_ADDRESS_MASK; - m_flags.tx_started = false; -#endif // NRF_802154_TX_STARTED_NOTIFY_ENABLED - - nrf_radio_int_enable(ints_to_enable); - - // Set FEM - fem_for_tx_set(cca); - - // Clr event EGU - nrf_egu_event_clear(NRF_802154_SWI_EGU_INSTANCE, EGU_EVENT); - - // Set PPIs - ppis_for_egu_and_ramp_up_set(cca ? NRF_RADIO_TASK_RXEN : NRF_RADIO_TASK_TXEN, true); - - if (!disabled_was_triggered || !ppi_egu_worked()) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - } - - return true; -} - -/** Initialize ED operation */ -static void ed_init(bool disabled_was_triggered) -{ - if (!timeslot_is_granted() || !ed_iter_setup(m_ed_time_left)) - { - // Just wait for next timeslot if there is not enough time in this one. - return; - } - - // Set shorts - nrf_radio_shorts_set(SHORTS_ED); - - // Enable IRQs - nrf_radio_event_clear(NRF_RADIO_EVENT_EDEND); - nrf_radio_int_enable(NRF_RADIO_INT_EDEND_MASK); - - // Set FEM - fem_for_lna_set(); - - // Clr event EGU - nrf_egu_event_clear(NRF_802154_SWI_EGU_INSTANCE, EGU_EVENT); - - // Set PPIs - ppis_for_egu_and_ramp_up_set(NRF_RADIO_TASK_RXEN, true); - - if (!disabled_was_triggered || !ppi_egu_worked()) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - } -} - -/** Initialize CCA operation. */ -static void cca_init(bool disabled_was_triggered) -{ - if (!timeslot_is_granted() || !nrf_802154_rsch_timeslot_request(nrf_802154_cca_duration_get())) - { - return; - } - - // Set shorts - nrf_radio_shorts_set(SHORTS_CCA); - - // Enable IRQs - nrf_radio_event_clear(NRF_RADIO_EVENT_CCABUSY); - nrf_radio_event_clear(NRF_RADIO_EVENT_CCAIDLE); - nrf_radio_int_enable(NRF_RADIO_INT_CCABUSY_MASK | NRF_RADIO_INT_CCAIDLE_MASK); - - // Set FEM - fem_for_lna_set(); - - // Clr event EGU - nrf_egu_event_clear(NRF_802154_SWI_EGU_INSTANCE, EGU_EVENT); - - // Set PPIs - ppis_for_egu_and_ramp_up_set(NRF_RADIO_TASK_RXEN, true); - - if (!disabled_was_triggered || !ppi_egu_worked()) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - } -} - -/** Initialize Continuous Carrier operation. */ -static void continuous_carrier_init(bool disabled_was_triggered) -{ - if (!timeslot_is_granted()) - { - return; - } - - // Set Tx Power - nrf_radio_txpower_set(nrf_802154_pib_tx_power_get()); - - // Set FEM - fem_for_pa_set(); - - // Clr event EGU - nrf_egu_event_clear(NRF_802154_SWI_EGU_INSTANCE, EGU_EVENT); - - // Set PPIs - ppis_for_egu_and_ramp_up_set(NRF_RADIO_TASK_TXEN, false); - - if (!disabled_was_triggered || !ppi_egu_worked()) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - } -} - -/*************************************************************************************************** - * @section Radio Scheduler notification handlers - **************************************************************************************************/ - -static void cont_prec_approved(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TIMESLOT_STARTED); - - if (remaining_timeslot_time_is_enough_for_crit_sect() && !timeslot_is_granted()) - { - nrf_radio_reset(); - nrf_radio_init(); - irq_init(); - - assert(nrf_radio_shorts_get() == SHORTS_IDLE); - - m_rsch_timeslot_is_granted = true; - nrf_802154_timer_coord_start(); - - nrf_802154_fal_pa_configuration_set(NULL, &m_deactivate_on_disable); - nrf_802154_fal_lna_configuration_set(NULL, &m_deactivate_on_disable); - - switch (m_state) - { - case RADIO_STATE_SLEEP: - // Intentionally empty. Appropriate action will be performed on state change. - break; - - case RADIO_STATE_RX: - rx_init(false); - break; - - case RADIO_STATE_CCA_TX: - (void)tx_init(mp_tx_data, true, false); - break; - - case RADIO_STATE_TX: - (void)tx_init(mp_tx_data, false, false); - break; - - case RADIO_STATE_ED: - ed_init(false); - break; - - case RADIO_STATE_CCA: - cca_init(false); - break; - - case RADIO_STATE_CONTINUOUS_CARRIER: - continuous_carrier_init(false); - break; - - default: - assert(false); - } - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TIMESLOT_STARTED); -} - -static void cont_prec_denied(void) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TIMESLOT_ENDED); - - if (timeslot_is_granted()) - { - m_rsch_timeslot_is_granted = false; - - if (nrf_802154_rsch_timeslot_is_requested()) - { - irq_deinit(); - nrf_radio_reset(); - } - - nrf_802154_fal_pa_configuration_clear(NULL, &m_deactivate_on_disable); - nrf_802154_fal_lna_configuration_clear(NULL, &m_deactivate_on_disable); - - nrf_802154_fal_deactivate_now(NRF_802154_FAL_ALL); - nrf_802154_timer_coord_stop(); - - result = current_operation_terminate(NRF_802154_TERM_802154, REQ_ORIG_RSCH, false); - assert(result); - (void)result; - - switch (m_state) - { - case RADIO_STATE_FALLING_ASLEEP: - state_set(RADIO_STATE_SLEEP); - sleep_init(); - break; - - case RADIO_STATE_RX: - if (psdu_is_being_received()) - { - receive_failed_notify(NRF_802154_RX_ERROR_TIMESLOT_ENDED); - } - - break; - - case RADIO_STATE_TX_ACK: - state_set(RADIO_STATE_RX); - mp_current_rx_buffer->free = false; - received_frame_notify_and_nesting_allow(mp_current_rx_buffer->data); - break; - - case RADIO_STATE_CCA_TX: - case RADIO_STATE_TX: - case RADIO_STATE_RX_ACK: - state_set(RADIO_STATE_RX); - transmit_failed_notify_and_nesting_allow(NRF_802154_TX_ERROR_TIMESLOT_ENDED); - break; - - case RADIO_STATE_ED: - case RADIO_STATE_CCA: - case RADIO_STATE_CONTINUOUS_CARRIER: - case RADIO_STATE_SLEEP: - // Intentionally empty. - break; - - default: - assert(false); - } - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TIMESLOT_ENDED); -} - -void nrf_802154_rsch_crit_sect_prio_changed(rsch_prio_t prio) -{ - if (prio > RSCH_PRIO_IDLE) - { - cont_prec_approved(); - } - else - { - cont_prec_denied(); - nrf_802154_rsch_continuous_ended(); - } -} - -/*************************************************************************************************** - * @section RADIO interrupt handler - **************************************************************************************************/ - -static void irq_address_state_tx_frame(void) -{ - transmit_started_notify(); - -#if NRF_802154_TX_STARTED_NOTIFY_ENABLED - m_flags.tx_started = true; -#endif // NRF_802154_TX_STARTED_NOTIFY_ENABLED -} - -static void irq_address_state_tx_ack(void) -{ - nrf_802154_tx_ack_started(mp_ack, rssi_last_measurement_get(), m_last_lqi); -} - -static void irq_address_state_rx_ack(void) -{ - nrf_802154_core_hooks_rx_ack_started(); -} - -#if !NRF_802154_DISABLE_BCC_MATCHING -// This event is generated during frame reception to request Radio Scheduler timeslot -// and to filter frame -static void irq_bcmatch_state_rx(void) -{ - uint8_t prev_num_data_bytes; - uint8_t num_data_bytes; - nrf_802154_rx_error_t filter_result; - bool frame_accepted = true; - - num_data_bytes = nrf_radio_bcc_get() / 8; - prev_num_data_bytes = num_data_bytes; - - assert(num_data_bytes >= PHR_SIZE + FCF_SIZE); - - // If CRCERROR event is set, it means that events are handled out of order due to software - // latency. Just skip this handler in this case - frame will be dropped. - if (nrf_radio_event_check(NRF_RADIO_EVENT_CRCERROR)) - { - return; - } - - if (!m_flags.frame_filtered) - { - m_flags.psdu_being_received = true; - filter_result = nrf_802154_filter_frame_part(mp_current_rx_buffer->data, - &num_data_bytes); - - if (filter_result == NRF_802154_RX_ERROR_NONE) - { - if (num_data_bytes != prev_num_data_bytes) - { - nrf_radio_bcc_set(num_data_bytes * 8); - } - else - { - m_flags.frame_filtered = true; - } - } - else if ((filter_result == NRF_802154_RX_ERROR_INVALID_LENGTH) || - (!nrf_802154_pib_promiscuous_get())) - { - rx_terminate(); - rx_init(true); - - frame_accepted = false; - - if ((mp_current_rx_buffer->data[FRAME_TYPE_OFFSET] & FRAME_TYPE_MASK) != - FRAME_TYPE_ACK) - { - receive_failed_notify(filter_result); - } - } - else - { - // Promiscuous mode, allow incorrect frames. Nothing to do here. - } - } - - if ((!m_flags.rx_timeslot_requested) && (frame_accepted)) - { - if (nrf_802154_rsch_timeslot_request(nrf_802154_rx_duration_get( - mp_current_rx_buffer->data[0], - ack_is_requested(mp_current_rx_buffer->data)))) - { - m_flags.rx_timeslot_requested = true; - - receive_started_notify(); - } - else - { - // Disable receiver and wait for a new timeslot. - rx_terminate(); - - nrf_802154_notify_receive_failed(NRF_802154_RX_ERROR_TIMESLOT_ENDED); - } - } -} - -#endif // !NRF_802154_DISABLE_BCC_MATCHING - -#if !NRF_802154_DISABLE_BCC_MATCHING || NRF_802154_NOTIFY_CRCERROR -static void irq_crcerror_state_rx(void) -{ -#if !NRF_802154_DISABLE_BCC_MATCHING - rx_restart(false); -#endif // !NRF_802154_DISABLE_BCC_MATCHING -#if NRF_802154_NOTIFY_CRCERROR - receive_failed_notify(NRF_802154_RX_ERROR_INVALID_FCS); -#endif // NRF_802154_NOTIFY_CRCERROR -} - -#endif // !NRF_802154_DISABLE_BCC_MATCHING || NRF_802154_NOTIFY_CRCERROR - -static void irq_crcok_state_rx(void) -{ - uint8_t * p_received_data = mp_current_rx_buffer->data; - uint32_t ints_to_disable = 0; - uint32_t ints_to_enable = 0; - - m_flags.rssi_started = true; - -#if NRF_802154_DISABLE_BCC_MATCHING - uint8_t num_data_bytes = PHR_SIZE + FCF_SIZE; - uint8_t prev_num_data_bytes = 0; - nrf_802154_rx_error_t filter_result; - - // Frame filtering - while (num_data_bytes != prev_num_data_bytes) - { - prev_num_data_bytes = num_data_bytes; - - // Keep checking consecutive parts of the frame header. - filter_result = nrf_802154_filter_frame_part(mp_current_rx_buffer->data, &num_data_bytes); - - if (filter_result == NRF_802154_RX_ERROR_NONE) - { - if (num_data_bytes == prev_num_data_bytes) - { - m_flags.frame_filtered = true; - } - } - else - { - break; - } - } - - // Timeslot request - if (m_flags.frame_filtered && - ack_is_requested(p_received_data) && - !nrf_802154_rsch_timeslot_request(nrf_802154_rx_duration_get(0, true))) - { - // Frame is destined to this node but there is no timeslot to transmit ACK. - // Just disable receiver and wait for a new timeslot. - rx_terminate(); - - rx_flags_clear(); - - // Filter out received ACK frame if promiscuous mode is disabled. - if (((p_received_data[FRAME_TYPE_OFFSET] & FRAME_TYPE_MASK) != FRAME_TYPE_ACK) || - nrf_802154_pib_promiscuous_get()) - { - mp_current_rx_buffer->free = false; - received_frame_notify_and_nesting_allow(p_received_data); - } - - return; - } -#endif // NRF_802154_DISABLE_BCC_MATCHING - - if (m_flags.frame_filtered || nrf_802154_pib_promiscuous_get()) - { - bool send_ack = false; - - if (m_flags.frame_filtered && - ack_is_requested(mp_current_rx_buffer->data) && - nrf_802154_pib_auto_ack_get()) - { - mp_ack = nrf_802154_ack_generator_create(mp_current_rx_buffer->data); - m_last_lqi = lqi_get(mp_current_rx_buffer->data); - - if (NULL != mp_ack) - { - send_ack = true; - } - } - - if (send_ack) - { - bool wait_for_phyend; - - nrf_radio_packetptr_set(mp_ack); - - // Set shorts - nrf_radio_shorts_set(SHORTS_TX_ACK); - - // Clear TXREADY event to detect if PPI worked - nrf_radio_event_clear(NRF_RADIO_EVENT_TXREADY); - -#if NRF_802154_DISABLE_BCC_MATCHING - // Disable PPIs for PSDU detection - nrf_ppi_fork_endpoint_setup(PPI_EGU_TIMER_START, 0); - nrf_ppi_channel_disable(PPI_ADDRESS_COUNTER_COUNT); - nrf_ppi_channel_disable(PPI_CRCERROR_COUNTER_CLEAR); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - // Set PPIs - nrf_ppi_channel_endpoint_setup(PPI_TIMER_TX_ACK, - (uint32_t)nrf_timer_event_address_get( - NRF_802154_TIMER_INSTANCE, - NRF_TIMER_EVENT_COMPARE1), - (uint32_t)nrf_radio_task_address_get( - NRF_RADIO_TASK_TXEN)); - -#if !NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_enable(PPI_TIMER_TX_ACK); -#endif // !NRF_802154_DISABLE_BCC_MATCHING - - // Set FEM PPIs - uint32_t time_to_rampup = nrf_timer_cc_read(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_CC_CHANNEL1); - - nrf_802154_fal_event_t timer = m_activate_tx_cc0; - - timer.event.timer.counter_value += time_to_rampup; - - nrf_802154_fal_pa_configuration_set(&timer, NULL); - - // Detect if PPI worked (timer is counting or TIMER event is marked) - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_CAPTURE3); - uint32_t current_timer_value = nrf_timer_cc_read(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_CC_CHANNEL3); - uint32_t time_to_fem = nrf_timer_cc_read(NRF_802154_TIMER_INSTANCE, - NRF_TIMER_CC_CHANNEL0); - - // When external PA uses timer, it should be configured to a time later than ramp up - // time. In such case, the timer stops with shorts on PA timer. - // But if external PA does not use timer, FEM time is set to a value in the pased - // used by LNA. After timer overflow, the timer stops with short on the past value - // used by LNA. We have to detect if the timer is after the overflow. - if ((current_timer_value < time_to_rampup) && - ((time_to_fem >= time_to_rampup) || (current_timer_value > time_to_fem))) - { - wait_for_phyend = true; - } - else - { - ppi_and_egu_delay_wait(); - - if (nrf_radio_state_get() == NRF_RADIO_STATE_TXRU) - { - wait_for_phyend = true; - } - else if (nrf_radio_event_check(NRF_RADIO_EVENT_TXREADY)) - { - wait_for_phyend = true; - } - else - { - wait_for_phyend = false; - } - } - - if (wait_for_phyend) - { - state_set(RADIO_STATE_TX_ACK); - - // Set event handlers -#if !NRF_802154_DISABLE_BCC_MATCHING || NRF_802154_NOTIFY_CRCERROR - ints_to_disable |= NRF_RADIO_INT_CRCERROR_MASK; -#endif // !NRF_802154_DISABLE_BCC_MATCHING || NRF_802154_NOTIFY_CRCERROR -#if !NRF_802154_DISABLE_BCC_MATCHING - ints_to_disable |= NRF_RADIO_INT_BCMATCH_MASK; -#endif // !NRF_802154_DISABLE_BCC_MATCHING - ints_to_disable |= NRF_RADIO_INT_CRCOK_MASK; - nrf_radio_int_disable(ints_to_disable); - - nrf_radio_event_clear(NRF_RADIO_EVENT_PHYEND); - ints_to_enable = NRF_RADIO_INT_PHYEND_MASK; - -#if NRF_802154_TX_STARTED_NOTIFY_ENABLED - nrf_radio_event_clear(NRF_RADIO_EVENT_ADDRESS); - ints_to_enable |= NRF_RADIO_INT_ADDRESS_MASK; -#endif // NRF_802154_TX_STARTED_NOTIFY_ENABLED - - nrf_radio_int_enable(ints_to_enable); - } - else - { - mp_current_rx_buffer->free = false; - -#if !NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_disable(PPI_TIMER_TX_ACK); - nrf_ppi_channel_endpoint_setup(PPI_TIMER_TX_ACK, 0, 0); - nrf_ppi_fork_endpoint_setup(PPI_TIMER_TX_ACK, 0); -#endif // !NRF_802154_DISABLE_BCC_MATCHING - - // RX uses the same peripherals as TX_ACK until RADIO ints are updated. - rx_terminate(); - rx_init(true); - - received_frame_notify_and_nesting_allow(p_received_data); - } - } - else - { - rx_restart(true); - - // Filter out received ACK frame if promiscuous mode is disabled. - if (((p_received_data[FRAME_TYPE_OFFSET] & FRAME_TYPE_MASK) != FRAME_TYPE_ACK) || - nrf_802154_pib_promiscuous_get()) - { - // Find new RX buffer - mp_current_rx_buffer->free = false; - rx_buffer_in_use_set(nrf_802154_rx_buffer_free_find()); - - if (rx_buffer_is_available()) - { - nrf_radio_packetptr_set(rx_buffer_get()); - nrf_radio_shorts_set(SHORTS_RX | SHORTS_RX_FREE_BUFFER); - - if (nrf_radio_state_get() == NRF_RADIO_STATE_RXIDLE) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_START); - } - } - - received_frame_notify_and_nesting_allow(p_received_data); - } - else - { - nrf_radio_shorts_set(SHORTS_RX | SHORTS_RX_FREE_BUFFER); - - if (nrf_radio_state_get() == NRF_RADIO_STATE_RXIDLE) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_START); - } - } - } - } - else - { - // CRC is OK, but filtering operation did not end - it is invalid frame with valid CRC - // or problem due to software latency (i.e. handled BCMATCH, CRCERROR, CRCOK from two - // consecutively received frames). - rx_terminate(); - rx_init(true); - -#if NRF_802154_DISABLE_BCC_MATCHING - if ((p_received_data[FRAME_TYPE_OFFSET] & FRAME_TYPE_MASK) != FRAME_TYPE_ACK) - { - receive_failed_notify(filter_result); - } -#else // NRF_802154_DISABLE_BCC_MATCHING - receive_failed_notify(NRF_802154_RX_ERROR_RUNTIME); -#endif // NRF_802154_DISABLE_BCC_MATCHING - } -} - -static void irq_phyend_state_tx_ack(void) -{ - uint8_t * p_received_data = mp_current_rx_buffer->data; - uint32_t ints_to_enable = 0; - uint32_t ints_to_disable = 0; - - // Disable PPIs on DISABLED event to control TIMER. - nrf_ppi_channel_disable(PPI_DISABLED_EGU); - - // Set FEM PPIs - nrf_802154_fal_pa_configuration_clear(&m_activate_tx_cc0, NULL); - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - nrf_802154_fal_lna_configuration_set(&m_activate_rx_cc0, NULL); - - nrf_radio_shorts_set(SHORTS_RX); - - // Set BCC for next reception -#if !NRF_802154_DISABLE_BCC_MATCHING - nrf_radio_bcc_set(BCC_INIT); -#endif // !NRF_802154_DISABLE_BCC_MATCHING - - ints_to_disable = NRF_RADIO_INT_PHYEND_MASK; - -#if NRF_802154_TX_STARTED_NOTIFY_ENABLED - ints_to_disable |= NRF_RADIO_INT_ADDRESS_MASK; -#endif // NRF_802154_TX_STARTED_NOTIFY_ENABLED - - nrf_radio_int_disable(ints_to_disable); - -#if !NRF_802154_DISABLE_BCC_MATCHING || NRF_802154_NOTIFY_CRCERROR - nrf_radio_event_clear(NRF_RADIO_EVENT_CRCERROR); - ints_to_enable |= NRF_RADIO_INT_CRCERROR_MASK; -#endif // !NRF_802154_DISABLE_BCC_MATCHING ||NRF_802154_NOTIFY_CRCERROR -#if !NRF_802154_DISABLE_BCC_MATCHING - nrf_radio_event_clear(NRF_RADIO_EVENT_BCMATCH); - ints_to_enable |= NRF_RADIO_INT_BCMATCH_MASK; -#endif // !NRF_802154_DISABLE_BCC_MATCHING - nrf_radio_event_clear(NRF_RADIO_EVENT_CRCOK); - ints_to_enable |= NRF_RADIO_INT_CRCOK_MASK; - nrf_radio_int_enable(ints_to_enable); - - // Restart TIMER. - // Anomaly 78: use SHUTDOWN instead of STOP and CLEAR. - nrf_timer_task_trigger(NRF_802154_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - -#if NRF_802154_DISABLE_BCC_MATCHING - // Anomaly 78: use SHUTDOWN instead of STOP and CLEAR. - nrf_timer_task_trigger(NRF_802154_COUNTER_TIMER_INSTANCE, NRF_TIMER_TASK_SHUTDOWN); - - // Reset PPI for RX mode -#if PPI_TIMER_TX_ACK != PPI_CRCERROR_CLEAR -#error Invalid PPI configuration -#endif - // Anomaly 78: use SHUTDOWN instead of CLEAR. - nrf_ppi_channel_endpoint_setup(PPI_CRCERROR_CLEAR, - (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_CRCERROR), - (uint32_t)nrf_timer_task_address_get( - NRF_802154_TIMER_INSTANCE, - NRF_TIMER_TASK_SHUTDOWN)); - - nrf_ppi_fork_endpoint_setup(PPI_EGU_TIMER_START, - (uint32_t)nrf_timer_task_address_get( - NRF_802154_COUNTER_TIMER_INSTANCE, - NRF_TIMER_TASK_START)); -#else // NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_disable(PPI_TIMER_TX_ACK); - nrf_ppi_channel_endpoint_setup(PPI_TIMER_TX_ACK, 0, 0); - nrf_ppi_fork_endpoint_setup(PPI_TIMER_TX_ACK, 0); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - // Enable PPI disabled by CRCOK - nrf_ppi_channel_enable(PPI_EGU_RAMP_UP); -#if NRF_802154_DISABLE_BCC_MATCHING - nrf_ppi_channel_enable(PPI_ADDRESS_COUNTER_COUNT); - nrf_ppi_channel_enable(PPI_CRCERROR_COUNTER_CLEAR); -#endif // NRF_802154_DISABLE_BCC_MATCHING - - // Enable PPIs on DISABLED event and clear event to detect if PPI worked - nrf_egu_event_clear(NRF_802154_SWI_EGU_INSTANCE, EGU_EVENT); - nrf_ppi_channel_enable(PPI_DISABLED_EGU); - - // Prepare the timer coordinator to get a precise timestamp of the CRCOK event. - nrf_802154_timer_coord_timestamp_prepare( - (uint32_t)nrf_radio_event_address_get(NRF_RADIO_EVENT_CRCOK)); - - if (!ppi_egu_worked()) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - } - - // Find new RX buffer - mp_current_rx_buffer->free = false; - rx_buffer_in_use_set(nrf_802154_rx_buffer_free_find()); - - if (rx_buffer_is_available()) - { - nrf_radio_packetptr_set(rx_buffer_get()); - nrf_radio_shorts_set(SHORTS_RX | SHORTS_RX_FREE_BUFFER); - - if (nrf_radio_state_get() == NRF_RADIO_STATE_RXIDLE) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_START); - } - } - - state_set(RADIO_STATE_RX); - - rx_flags_clear(); - - received_frame_notify_and_nesting_allow(p_received_data); -} - -static void irq_phyend_state_tx_frame(void) -{ - uint32_t ints_to_disable = 0; - uint32_t ints_to_enable = 0; - - // Ignore PHYEND event if transmission has not started. This event may be triggered by - // previously terminated transmission. - if (!transmission_has_started()) - { - return; - } - - if (ack_is_requested(mp_tx_data)) - { - bool rx_buffer_free = rx_buffer_is_available(); - uint32_t shorts = rx_buffer_free ? - (SHORTS_RX_ACK | SHORTS_RX_FREE_BUFFER) : SHORTS_RX_ACK; - - // Disable EGU PPI to prevent unsynchronized PPIs - nrf_ppi_channel_disable(PPI_DISABLED_EGU); - - nrf_radio_shorts_set(shorts); - - if (rx_buffer_free) - { - nrf_radio_packetptr_set(rx_buffer_get()); - } - - ints_to_disable = NRF_RADIO_INT_CCABUSY_MASK; -#if NRF_802154_TX_STARTED_NOTIFY_ENABLED - ints_to_disable |= NRF_RADIO_INT_ADDRESS_MASK; -#endif // NRF_802154_TX_STARTED_NOTIFY_ENABLED - - ints_to_disable |= NRF_RADIO_INT_PHYEND_MASK; - nrf_radio_event_clear(NRF_RADIO_EVENT_END); - ints_to_enable |= NRF_RADIO_INT_END_MASK; - - nrf_radio_int_disable(ints_to_disable); - - nrf_radio_event_clear(NRF_RADIO_EVENT_ADDRESS); - ints_to_enable |= NRF_RADIO_INT_ADDRESS_MASK; - - nrf_radio_int_enable(ints_to_enable); - - // Clear FEM configuration set at the beginning of the transmission - fem_for_tx_reset(false); - // Set PPIs necessary in rx_ack state - fem_for_lna_set(); - - nrf_ppi_channel_and_fork_endpoint_setup(PPI_EGU_RAMP_UP, - (uint32_t)nrf_egu_event_address_get( - NRF_802154_SWI_EGU_INSTANCE, - EGU_EVENT), - (uint32_t)nrf_radio_task_address_get( - NRF_RADIO_TASK_RXEN), - (uint32_t)nrf_ppi_task_address_get( - PPI_CHGRP0_DIS_TASK)); - - nrf_egu_event_clear(NRF_802154_SWI_EGU_INSTANCE, EGU_EVENT); - - // Enable PPI disabled by DISABLED event - nrf_ppi_channel_enable(PPI_EGU_RAMP_UP); - - // Enable EGU PPI to start all PPIs synchronously - nrf_ppi_channel_enable(PPI_DISABLED_EGU); - - state_set(RADIO_STATE_RX_ACK); - - if (!ppi_egu_worked()) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - } - - if (!rx_buffer_free) - { - rx_buffer_in_use_set(nrf_802154_rx_buffer_free_find()); - - if (rx_buffer_is_available()) - { - nrf_radio_packetptr_set(rx_buffer_get()); - nrf_radio_shorts_set(SHORTS_RX_ACK | SHORTS_RX_FREE_BUFFER); - - if (nrf_radio_state_get() == NRF_RADIO_STATE_RXIDLE) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_START); - } - } - } - - if ((mp_tx_data[FRAME_VERSION_OFFSET] & FRAME_VERSION_MASK) != FRAME_VERSION_2) - { - ack_matching_enable(); - } - } - else - { - tx_terminate(); - state_set(RADIO_STATE_RX); - rx_init(true); - - transmitted_frame_notify(NULL, 0, 0); - } -} - -static void irq_end_state_rx_ack(void) -{ - bool ack_match = ack_is_matched(); - rx_buffer_t * p_ack_buffer = NULL; - uint8_t * p_ack_data = mp_current_rx_buffer->data; - - if (!ack_match && - ((mp_tx_data[FRAME_VERSION_OFFSET] & FRAME_VERSION_MASK) == FRAME_VERSION_2) && - ((p_ack_data[FRAME_VERSION_OFFSET] & FRAME_VERSION_MASK) == FRAME_VERSION_2) && - ((p_ack_data[FRAME_TYPE_OFFSET] & FRAME_TYPE_MASK) == FRAME_TYPE_ACK) && - (nrf_radio_crc_status_check())) - { - // For frame version 2 sequence number bit may be suppressed and its check fails. - // Verify ACK frame using its destination address. - nrf_802154_frame_parser_mhr_data_t tx_mhr_data; - nrf_802154_frame_parser_mhr_data_t ack_mhr_data; - bool parse_result; - - parse_result = nrf_802154_frame_parser_mhr_parse(mp_tx_data, &tx_mhr_data); - assert(parse_result); - parse_result = nrf_802154_frame_parser_mhr_parse(p_ack_data, &ack_mhr_data); - - if (parse_result && - (tx_mhr_data.p_src_addr != NULL) && - (ack_mhr_data.p_dst_addr != NULL) && - (tx_mhr_data.src_addr_size == ack_mhr_data.dst_addr_size) && - (0 == memcmp(tx_mhr_data.p_src_addr, - ack_mhr_data.p_dst_addr, - tx_mhr_data.src_addr_size))) - { - ack_match = true; - } - } - - if (ack_match) - { - p_ack_buffer = mp_current_rx_buffer; - mp_current_rx_buffer->free = false; - } - - rx_ack_terminate(); - state_set(RADIO_STATE_RX); - rx_init(true); - - if (ack_match) - { - transmitted_frame_notify(p_ack_buffer->data, // phr + psdu - rssi_last_measurement_get(), // rssi - lqi_get(p_ack_buffer->data)); // lqi; - } - else - { - transmit_failed_notify_and_nesting_allow(NRF_802154_TX_ERROR_INVALID_ACK); - } -} - -static void irq_disabled_state_falling_asleep(void) -{ - falling_asleep_terminate(); - state_set(RADIO_STATE_SLEEP); - sleep_init(); -} - -/// This event is generated when CCA reports idle channel during stand-alone procedure. -static void irq_ccaidle_state_cca(void) -{ - cca_terminate(); - state_set(RADIO_STATE_RX); - rx_init(true); - - cca_notify(true); -} - -static void irq_ccabusy_state_tx_frame(void) -{ - tx_terminate(); - state_set(RADIO_STATE_RX); - rx_init(true); - - transmit_failed_notify_and_nesting_allow(NRF_802154_TX_ERROR_BUSY_CHANNEL); -} - -static void irq_ccabusy_state_cca(void) -{ - cca_terminate(); - state_set(RADIO_STATE_RX); - rx_init(true); - - cca_notify(false); -} - -/// This event is generated when energy detection procedure ends. -static void irq_edend_state_ed(void) -{ - uint32_t result = nrf_radio_ed_sample_get(); - - m_ed_result = result > m_ed_result ? result : m_ed_result; - - if (m_ed_time_left) - { - if (ed_iter_setup(m_ed_time_left)) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_EDSTART); - } - else - { - fem_for_lna_reset(); - } - } - else - { - // In case channel change was requested during energy detection procedure. - channel_set(nrf_802154_pib_channel_get()); - - ed_terminate(); - state_set(RADIO_STATE_RX); - rx_init(true); - - energy_detected_notify(ed_result_get()); - } -} - -/// Handler of radio interrupts. -static void irq_handler(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_IRQ_HANDLER); - - // Prevent interrupting of this handler by requests from higher priority code. - nrf_802154_critical_section_forcefully_enter(); - - if (nrf_radio_int_enable_check(NRF_RADIO_INT_ADDRESS_MASK) && - nrf_radio_event_check(NRF_RADIO_EVENT_ADDRESS)) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_EVENT_FRAMESTART); - nrf_radio_event_clear(NRF_RADIO_EVENT_ADDRESS); - - switch (m_state) - { - case RADIO_STATE_CCA_TX: - case RADIO_STATE_TX: - irq_address_state_tx_frame(); - break; - - case RADIO_STATE_TX_ACK: - irq_address_state_tx_ack(); - break; - - case RADIO_STATE_RX_ACK: - irq_address_state_rx_ack(); - break; - - default: - assert(false); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_EVENT_FRAMESTART); - } - -#if !NRF_802154_DISABLE_BCC_MATCHING - // Check MAC frame header. - if (nrf_radio_int_enable_check(NRF_RADIO_INT_BCMATCH_MASK) && - nrf_radio_event_check(NRF_RADIO_EVENT_BCMATCH)) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_EVENT_BCMATCH); - nrf_radio_event_clear(NRF_RADIO_EVENT_BCMATCH); - - switch (m_state) - { - case RADIO_STATE_RX: - irq_bcmatch_state_rx(); - break; - - default: - assert(false); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_EVENT_BCMATCH); - } - -#endif // !NRF_802154_DISABLE_BCC_MATCHING - -#if !NRF_802154_DISABLE_BCC_MATCHING || NRF_802154_NOTIFY_CRCERROR - if (nrf_radio_int_enable_check(NRF_RADIO_INT_CRCERROR_MASK) && - nrf_radio_event_check(NRF_RADIO_EVENT_CRCERROR)) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_EVENT_CRCERROR); - nrf_radio_event_clear(NRF_RADIO_EVENT_CRCERROR); - - switch (m_state) - { - case RADIO_STATE_RX: - irq_crcerror_state_rx(); - break; - - default: - assert(false); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_EVENT_CRCERROR); - } -#endif // !NRF_802154_DISABLE_BCC_MATCHING || NRF_802154_NOTIFY_CRCERROR - - if (nrf_radio_int_enable_check(NRF_RADIO_INT_CRCOK_MASK) && - nrf_radio_event_check(NRF_RADIO_EVENT_CRCOK)) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_EVENT_CRCOK); - nrf_radio_event_clear(NRF_RADIO_EVENT_CRCOK); - - switch (m_state) - { - case RADIO_STATE_RX: - irq_crcok_state_rx(); - break; - - default: - assert(false); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_EVENT_CRCOK); - } - - if (nrf_radio_int_enable_check(NRF_RADIO_INT_PHYEND_MASK) && - nrf_radio_event_check(NRF_RADIO_EVENT_PHYEND)) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_EVENT_PHYEND); - nrf_radio_event_clear(NRF_RADIO_EVENT_PHYEND); - - switch (m_state) - { - case RADIO_STATE_TX_ACK: - irq_phyend_state_tx_ack(); - break; - - case RADIO_STATE_CCA_TX: - case RADIO_STATE_TX: - irq_phyend_state_tx_frame(); - break; - - default: - assert(false); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_EVENT_PHYEND); - } - - if (nrf_radio_int_enable_check(NRF_RADIO_INT_END_MASK) && - nrf_radio_event_check(NRF_RADIO_EVENT_END)) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_EVENT_END); - nrf_radio_event_clear(NRF_RADIO_EVENT_END); - - switch (m_state) - { - case RADIO_STATE_RX_ACK: // Ended receiving of ACK. - irq_end_state_rx_ack(); - break; - - default: - assert(false); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_EVENT_END); - } - - if (nrf_radio_int_enable_check(NRF_RADIO_INT_DISABLED_MASK) && - nrf_radio_event_check(NRF_RADIO_EVENT_DISABLED)) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_EVENT_DISABLED); - nrf_radio_event_clear(NRF_RADIO_EVENT_DISABLED); - - switch (m_state) - { - case RADIO_STATE_FALLING_ASLEEP: - irq_disabled_state_falling_asleep(); - break; - - default: - assert(false); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_EVENT_DISABLED); - } - - if (nrf_radio_int_enable_check(NRF_RADIO_INT_CCAIDLE_MASK) && - nrf_radio_event_check(NRF_RADIO_EVENT_CCAIDLE)) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_EVENT_CCAIDLE); - nrf_radio_event_clear(NRF_RADIO_EVENT_CCAIDLE); - - switch (m_state) - { - case RADIO_STATE_CCA: - irq_ccaidle_state_cca(); - break; - - default: - assert(false); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_EVENT_CCAIDLE); - } - - if (nrf_radio_int_enable_check(NRF_RADIO_INT_CCABUSY_MASK) && - nrf_radio_event_check(NRF_RADIO_EVENT_CCABUSY)) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_EVENT_CCABUSY); - nrf_radio_event_clear(NRF_RADIO_EVENT_CCABUSY); - - switch (m_state) - { - case RADIO_STATE_CCA_TX: - case RADIO_STATE_TX: - irq_ccabusy_state_tx_frame(); - break; - - case RADIO_STATE_CCA: - irq_ccabusy_state_cca(); - break; - - default: - assert(false); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_EVENT_CCABUSY); - } - - if (nrf_radio_int_enable_check(NRF_RADIO_INT_EDEND_MASK) && - nrf_radio_event_check(NRF_RADIO_EVENT_EDEND)) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_EVENT_EDEND); - nrf_radio_event_clear(NRF_RADIO_EVENT_EDEND); - - switch (m_state) - { - case RADIO_STATE_ED: - irq_edend_state_ed(); - break; - - default: - assert(false); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_EVENT_EDEND); - } - - nrf_802154_critical_section_exit(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_IRQ_HANDLER); -} - -/*************************************************************************************************** - * @section API functions - **************************************************************************************************/ - -void nrf_802154_core_init(void) -{ - m_state = RADIO_STATE_SLEEP; - m_rsch_timeslot_is_granted = false; - - nrf_timer_init(); - nrf_802154_ack_generator_init(); -} - -void nrf_802154_core_deinit(void) -{ - if (timeslot_is_granted()) - { - nrf_radio_reset(); - nrf_802154_fal_deactivate_now(NRF_802154_FAL_ALL); - } - - nrf_802154_fal_cleanup(); - - irq_deinit(); -} - -radio_state_t nrf_802154_core_state_get(void) -{ - return m_state; -} - -bool nrf_802154_core_sleep(nrf_802154_term_t term_lvl) -{ - bool result = nrf_802154_critical_section_enter(); - - if (result) - { - if ((m_state != RADIO_STATE_SLEEP) && (m_state != RADIO_STATE_FALLING_ASLEEP)) - { - result = current_operation_terminate(term_lvl, REQ_ORIG_CORE, true); - - if (result) - { - state_set(RADIO_STATE_FALLING_ASLEEP); - falling_asleep_init(); - } - } - - nrf_802154_critical_section_exit(); - } - - return result; -} - -bool nrf_802154_core_receive(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - nrf_802154_notification_func_t notify_function, - bool notify_abort) -{ - bool result = nrf_802154_critical_section_enter(); - - if (result) - { - if ((m_state != RADIO_STATE_RX) && (m_state != RADIO_STATE_TX_ACK)) - { - if (critical_section_can_be_processed_now()) - { - result = current_operation_terminate(term_lvl, req_orig, notify_abort); - - if (result) - { - state_set(RADIO_STATE_RX); - rx_init(true); - } - } - else - { - result = false; - } - } - - if (notify_function != NULL) - { - notify_function(result); - } - - nrf_802154_critical_section_exit(); - } - else - { - if (notify_function != NULL) - { - notify_function(false); - } - } - - return result; -} - -bool nrf_802154_core_transmit(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - const uint8_t * p_data, - bool cca, - bool immediate, - nrf_802154_notification_func_t notify_function) -{ - bool result = critical_section_enter_and_verify_timeslot_length(); - - if (result) - { - result = current_operation_terminate(term_lvl, req_orig, true); - - if (result) - { - // Set state to RX in case sleep terminate succeeded, but transmit_begin fails. - state_set(RADIO_STATE_RX); - - mp_tx_data = p_data; - result = tx_init(p_data, cca, true); - - if (!immediate) - { - result = true; - } - } - - if (result) - { - state_set(cca ? RADIO_STATE_CCA_TX : RADIO_STATE_TX); - } - - if (notify_function != NULL) - { - notify_function(result); - } - - nrf_802154_critical_section_exit(); - } - else - { - if (notify_function != NULL) - { - notify_function(false); - } - } - - return result; -} - -bool nrf_802154_core_energy_detection(nrf_802154_term_t term_lvl, uint32_t time_us) -{ - bool result = critical_section_enter_and_verify_timeslot_length(); - - if (result) - { - result = current_operation_terminate(term_lvl, REQ_ORIG_CORE, true); - - if (result) - { - state_set(RADIO_STATE_ED); - m_ed_time_left = time_us; - m_ed_result = 0; - ed_init(true); - } - - nrf_802154_critical_section_exit(); - } - - return result; -} - -bool nrf_802154_core_cca(nrf_802154_term_t term_lvl) -{ - bool result = critical_section_enter_and_verify_timeslot_length(); - - if (result) - { - result = current_operation_terminate(term_lvl, REQ_ORIG_CORE, true); - - if (result) - { - state_set(RADIO_STATE_CCA); - cca_init(true); - } - - nrf_802154_critical_section_exit(); - } - - return result; -} - -bool nrf_802154_core_continuous_carrier(nrf_802154_term_t term_lvl) -{ - bool result = critical_section_enter_and_verify_timeslot_length(); - - if (result) - { - result = current_operation_terminate(term_lvl, REQ_ORIG_CORE, true); - - if (result) - { - state_set(RADIO_STATE_CONTINUOUS_CARRIER); - continuous_carrier_init(true); - } - - nrf_802154_critical_section_exit(); - } - - return result; -} - -bool nrf_802154_core_notify_buffer_free(uint8_t * p_data) -{ - rx_buffer_t * p_buffer = (rx_buffer_t *)p_data; - bool in_crit_sect = critical_section_enter_and_verify_timeslot_length(); - - p_buffer->free = true; - - if (in_crit_sect) - { - if (timeslot_is_granted()) - { - switch (m_state) - { - case RADIO_STATE_RX: - if (nrf_radio_state_get() == NRF_RADIO_STATE_RXIDLE) - { - assert(nrf_radio_shorts_get() == SHORTS_RX); - - rx_buffer_in_use_set(p_buffer); - - nrf_radio_packetptr_set(rx_buffer_get()); - nrf_radio_shorts_set(SHORTS_RX | SHORTS_RX_FREE_BUFFER); - - nrf_radio_task_trigger(NRF_RADIO_TASK_START); - } - - break; - - case RADIO_STATE_RX_ACK: - if (nrf_radio_state_get() == NRF_RADIO_STATE_RXIDLE) - { - assert(nrf_radio_shorts_get() == SHORTS_RX_ACK); - - rx_buffer_in_use_set(p_buffer); - - nrf_radio_packetptr_set(rx_buffer_get()); - nrf_radio_shorts_set(SHORTS_RX_ACK | SHORTS_RX_FREE_BUFFER); - - nrf_radio_task_trigger(NRF_RADIO_TASK_START); - } - - break; - - default: - // Don't perform any action in any other state (receiver should not be started). - break; - } - } - - nrf_802154_critical_section_exit(); - } - - return true; -} - -bool nrf_802154_core_channel_update(void) -{ - bool result = critical_section_enter_and_verify_timeslot_length(); - - if (result) - { - if (timeslot_is_granted()) - { - channel_set(nrf_802154_pib_channel_get()); - } - - switch (m_state) - { - case RADIO_STATE_RX: - if (current_operation_terminate(NRF_802154_TERM_NONE, REQ_ORIG_CORE, true)) - { - rx_init(true); - } - - break; - - case RADIO_STATE_CONTINUOUS_CARRIER: - if (timeslot_is_granted()) - { - nrf_radio_task_trigger(NRF_RADIO_TASK_DISABLE); - } - - break; - - default: - // Don't perform any additional action in any other state. - break; - } - - nrf_802154_critical_section_exit(); - } - - return result; -} - -bool nrf_802154_core_cca_cfg_update(void) -{ - bool result = critical_section_enter_and_verify_timeslot_length(); - - if (result) - { - if (timeslot_is_granted()) - { - cca_configuration_update(); - } - - nrf_802154_critical_section_exit(); - } - - return result; -} - -bool nrf_802154_core_rssi_measure(void) -{ - bool result = critical_section_enter_and_verify_timeslot_length(); - - if (result) - { - if (timeslot_is_granted() && (m_state == RADIO_STATE_RX)) - { - rssi_measure(); - } - else - { - result = false; - } - - nrf_802154_critical_section_exit(); - } - - return result; -} - -bool nrf_802154_core_last_rssi_measurement_get(int8_t * p_rssi) -{ - bool result = false; - bool rssi_started = m_flags.rssi_started; - bool in_crit_sect = false; - - if (rssi_started) - { - in_crit_sect = critical_section_enter_and_verify_timeslot_length(); - } - - if (rssi_started && in_crit_sect) - { - // Checking if a timeslot is granted is valid only in a critical section - if (timeslot_is_granted()) - { - rssi_measurement_wait(); - *p_rssi = rssi_last_measurement_get(); - result = true; - } - } - - if (in_crit_sect) - { - nrf_802154_critical_section_exit(); - } - - return result; -} - -#if NRF_802154_INTERNAL_RADIO_IRQ_HANDLING -void RADIO_IRQHandler(void) -#else // NRF_802154_INTERNAL_RADIO_IRQ_HANDLING -void nrf_802154_core_irq_handler(void) -#endif // NRF_802154_INTERNAL_RADIO_IRQ_HANDLING -{ - irq_handler(); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.h deleted file mode 100644 index 381a0387c..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core.h +++ /dev/null @@ -1,240 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains core of the nRF IEEE 802.15.4 radio driver. - * - */ - -#ifndef NRF_802154_CORE_H_ -#define NRF_802154_CORE_H_ - -#include -#include - -#include "nrf_802154_config.h" -#include "nrf_802154_notification.h" -#include "nrf_802154_rx_buffer.h" -#include "nrf_802154_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief States of the nRF 802.15.4 driver. - */ -typedef enum -{ - // Sleep - RADIO_STATE_SLEEP, ///< Low power mode (disabled) - the only state in which all radio preconditions are not requested. - RADIO_STATE_FALLING_ASLEEP, ///< Before entering the sleep state, all radio preconditions are requested. - - // Receive - RADIO_STATE_RX, ///< The receiver is enabled and it is receiving frames. - RADIO_STATE_TX_ACK, ///< The frame is received and the ACK is being transmitted. - - // Transmit - RADIO_STATE_CCA_TX, ///< Performing CCA followed by the frame transmission. - RADIO_STATE_TX, ///< Transmitting data frame (or beacon). - RADIO_STATE_RX_ACK, ///< Receiving ACK after the transmitted frame. - - // Energy Detection - RADIO_STATE_ED, ///< Performing the energy detection procedure. - - // CCA - RADIO_STATE_CCA, ///< Performing the CCA procedure. - - // Continuous carrier - RADIO_STATE_CONTINUOUS_CARRIER, ///< Emitting the continuous carrier wave. -} radio_state_t; - -/** - * @brief Initializes the 802.15.4 driver core. - */ -void nrf_802154_core_init(void); - -/** - * @brief Deinitializes the 802.15.4 driver core. - */ -void nrf_802154_core_deinit(void); - -/** - * @brief Gets the current state of the nRF 802.15.4 driver. - * - * @returns Current state of the 802.15.4 driver. - */ -radio_state_t nrf_802154_core_state_get(void); - -/*************************************************************************************************** - * @section State machine transition requests - **************************************************************************************************/ - -/** - * @brief Requests the transition to the @ref RADIO_STATE_SLEEP state. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * - * @retval true Entering the sleep state succeeded. - * @retval false Entering the sleep state failed (the driver is performing other procedure). - */ -bool nrf_802154_core_sleep(nrf_802154_term_t term_lvl); - -/** - * @brief Requests the transition to the @ref RADIO_STATE_RX state. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] req_orig Module that originates this request. - * @param[in] notify_function Function called to notify the status of this procedure. May be NULL. - * @param[in] notify_abort If abort notification is to be triggered. - * - * @retval true Entering the receive state succeeded. - * @retval false Entering the receive state failed (the driver is performing other procedure). - */ -bool nrf_802154_core_receive(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - nrf_802154_notification_func_t notify_function, - bool notify_abort); - -/** - * @brief Requests the transition to the @ref RADIO_STATE_TX state. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] req_orig Module that originates this request. - * @param[in] p_data Pointer to a frame to transmit. - * @param[in] cca If the driver is to perform CCA procedure before transmission. - * @param[in] immediate If true, the driver schedules transmission immediately or never. - * If false, the transmission may be postponed until - * the TX preconditions are met. - * @param[in] notify_function Function called to notify the status of this procedure. May be NULL. - * - * @retval true Entering the transmit state succeeded. - * @retval false Entering the transmit state failed (the driver is performing other procedure). - */ -bool nrf_802154_core_transmit(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - const uint8_t * p_data, - bool cca, - bool immediate, - nrf_802154_notification_func_t notify_function); - -/** - * @brief Requests the transition to the @ref RADIO_STATE_ED state. - * - * When the energy detection procedure is finished, the driver transitions - * to the @ref RADIO_STATE_RX state. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] time_us Minimal time of energy detection procedure. - * - * @retval true Entering the energy detection state succeeded. - * @retval false Entering the energy detection state failed - * (the driver is performing other procedure). - */ -bool nrf_802154_core_energy_detection(nrf_802154_term_t term_lvl, uint32_t time_us); - -/** - * @brief Requests the transition to the @ref RADIO_STATE_CCA state. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * - * @retval true Entering the CCA state succeeded. - * @retval false Entering the CCA state failed (the driver is performing other procedure). - */ -bool nrf_802154_core_cca(nrf_802154_term_t term_lvl); - -/** - * @brief Requests the transition to the @ref RADIO_STATE_CONTINUOUS_CARRIER state. - * - * When the CCA procedure is finished, the driver transitions to the @ref RADIO_STATE_RX state. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * - * @retval true Entering the continuous carrier state succeeded. - * @retval false Entering the continuous carrier state failed - * (the driver is performing other procedure). - */ -bool nrf_802154_core_continuous_carrier(nrf_802154_term_t term_lvl); - -/*************************************************************************************************** - * @section State machine notifications - **************************************************************************************************/ - -/** - * @brief Notifies the core module that a higher layer freed a frame buffer. - * - * When there are no free buffers available, the core does not start the receiver. - * If the core receives this notification, it changes the internal state to make sure - * the receiver is started if requested. - * - * @param[in] p_data Pointer to buffer that has been freed. - */ -bool nrf_802154_core_notify_buffer_free(uint8_t * p_data); - -/** - * @brief Notifies the core module that the next higher layer requested the change of the channel. - * - * The core is expected to update the frequency register of the peripheral and, if it is - * in the @ref RADIO_STATE_RX or in the @ref RADIO_STATE_CONTINUOUS_CARRIER state, the transceiver - * is disabled and enabled again to use the new channel. - * - */ -bool nrf_802154_core_channel_update(void); - -/** - * @brief Notifies the core module that the next higher layer requested the change - * of the CCA configuration. - */ -bool nrf_802154_core_cca_cfg_update(void); - -/** - * @brief Notifies the core module that the next higher layer requested the RSSI measurement. - */ -bool nrf_802154_core_rssi_measure(void); - -/** - * @brief Gets the last RSSI measurement. - * - * @param[out] p_rssi RSSI measurement value in dBm. - */ -bool nrf_802154_core_last_rssi_measurement_get(int8_t * p_rssi); - -#if !NRF_802154_INTERNAL_IRQ_HANDLING -/** - * @brief Notifies the core module that there is a pending IRQ to be handled. - */ -void nrf_802154_core_irq_handler(void); -#endif // !NRF_802154_INTERNAL_IRQ_HANDLING - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_CORE_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.c deleted file mode 100644 index 7035b681d..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.c +++ /dev/null @@ -1,236 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements hooks for the 802.15.4 driver Core module. - * - * Hooks are used by optional driver features to modify way in which notifications are propagated - * through the driver. - * - */ - -#include "nrf_802154_core_hooks.h" - -#include - -#include "mac_features/nrf_802154_ack_timeout.h" -#include "mac_features/nrf_802154_csma_ca.h" -#include "mac_features/nrf_802154_delayed_trx.h" -#include "nrf_802154_config.h" -#include "nrf_802154_types.h" - -typedef bool (* abort_hook)(nrf_802154_term_t term_lvl, req_originator_t req_orig); -typedef void (* transmitted_hook)(const uint8_t * p_frame); -typedef bool (* tx_failed_hook)(const uint8_t * p_frame, nrf_802154_tx_error_t error); -typedef bool (* tx_started_hook)(const uint8_t * p_frame); -typedef void (* rx_started_hook)(const uint8_t * p_frame); -typedef void (* rx_ack_started_hook)(void); - -/* Since some compilers do not allow empty initializers for arrays with unspecified bounds, - * NULL pointer is appended to below arrays if the compiler used is not GCC. It is intentionally - * unused, but it prevents the arrays from being empty. GCC manages to optimize empty arrays away, - * so such a solution is unnecessary. */ - -static const abort_hook m_abort_hooks[] = -{ -#if NRF_802154_CSMA_CA_ENABLED - nrf_802154_csma_ca_abort, -#endif - -#if NRF_802154_ACK_TIMEOUT_ENABLED - nrf_802154_ack_timeout_abort, -#endif - -#if NRF_802154_DELAYED_TRX_ENABLED - nrf_802154_delayed_trx_abort, -#endif - - NULL, -}; - -static const transmitted_hook m_transmitted_hooks[] = -{ -#if NRF_802154_ACK_TIMEOUT_ENABLED - nrf_802154_ack_timeout_transmitted_hook, -#endif - - NULL, -}; - -static const tx_failed_hook m_tx_failed_hooks[] = -{ -#if NRF_802154_CSMA_CA_ENABLED - nrf_802154_csma_ca_tx_failed_hook, -#endif - -#if NRF_802154_ACK_TIMEOUT_ENABLED - nrf_802154_ack_timeout_tx_failed_hook, -#endif - - NULL, -}; - -static const tx_started_hook m_tx_started_hooks[] = -{ -#if NRF_802154_CSMA_CA_ENABLED - nrf_802154_csma_ca_tx_started_hook, -#endif - -#if NRF_802154_ACK_TIMEOUT_ENABLED - nrf_802154_ack_timeout_tx_started_hook, -#endif - - NULL, -}; - -static const rx_started_hook m_rx_started_hooks[] = -{ -#if NRF_802154_DELAYED_TRX_ENABLED - nrf_802154_delayed_trx_rx_started_hook, -#endif - - NULL, -}; - -static const rx_ack_started_hook m_rx_ack_started_hooks[] = -{ -#if NRF_802154_ACK_TIMEOUT_ENABLED - nrf_802154_ack_timeout_rx_ack_started_hook, -#endif - - NULL, -}; - -bool nrf_802154_core_hooks_terminate(nrf_802154_term_t term_lvl, req_originator_t req_orig) -{ - bool result = true; - - for (uint32_t i = 0; i < sizeof(m_abort_hooks) / sizeof(m_abort_hooks[0]); i++) - { - if (m_abort_hooks[i] == NULL) - { - break; - } - - result = m_abort_hooks[i](term_lvl, req_orig); - - if (!result) - { - break; - } - } - - return result; -} - -void nrf_802154_core_hooks_transmitted(const uint8_t * p_frame) -{ - for (uint32_t i = 0; i < sizeof(m_transmitted_hooks) / sizeof(m_transmitted_hooks[0]); i++) - { - if (m_transmitted_hooks[i] == NULL) - { - break; - } - - m_transmitted_hooks[i](p_frame); - } -} - -bool nrf_802154_core_hooks_tx_failed(const uint8_t * p_frame, nrf_802154_tx_error_t error) -{ - bool result = true; - - for (uint32_t i = 0; i < sizeof(m_tx_failed_hooks) / sizeof(m_tx_failed_hooks[0]); i++) - { - if (m_tx_failed_hooks[i] == NULL) - { - break; - } - - result = m_tx_failed_hooks[i](p_frame, error); - - if (!result) - { - break; - } - } - - return result; -} - -bool nrf_802154_core_hooks_tx_started(const uint8_t * p_frame) -{ - bool result = true; - - for (uint32_t i = 0; i < sizeof(m_tx_started_hooks) / sizeof(m_tx_started_hooks[0]); i++) - { - if (m_tx_started_hooks[i] == NULL) - { - break; - } - - result = m_tx_started_hooks[i](p_frame); - - if (!result) - { - break; - } - } - - return result; -} - -void nrf_802154_core_hooks_rx_started(const uint8_t * p_frame) -{ - for (uint32_t i = 0; i < sizeof(m_rx_started_hooks) / sizeof(m_rx_started_hooks[0]); i++) - { - if (m_rx_started_hooks[i] == NULL) - { - break; - } - - m_rx_started_hooks[i](p_frame); - } -} - -void nrf_802154_core_hooks_rx_ack_started(void) -{ - for (uint32_t i = 0; i < sizeof(m_rx_ack_started_hooks) / sizeof(m_rx_ack_started_hooks[0]); - i++) - { - if (m_rx_ack_started_hooks[i] == NULL) - { - break; - } - - m_rx_ack_started_hooks[i](); - } -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.h deleted file mode 100644 index 41e0dd270..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_core_hooks.h +++ /dev/null @@ -1,111 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_CORE_HOOKS_H__ -#define NRF_802154_CORE_HOOKS_H__ - -#include -#include - -#include "nrf_802154_const.h" -#include "nrf_802154_types.h" - -/** - * @defgroup nrf_802154_hooks Hooks for the 802.15.4 driver core - * @{ - * @ingroup nrf_802154 - * @brief Hooks for the 802.15.4 driver core module. - * - * Hooks are used by the optional driver features to modify the way in which notifications - * are propagated through the driver. - */ - -/** - * @brief Processes hooks for the termination request. - * - * @param[in] term_lvl Termination level of the request that terminates the current operation. - * @param[in] req_orig Module that originates this request. - * - * @retval true All procedures are aborted. - * @retval false There is an ongoing procedure that cannot be aborted due to a too low @p term_lvl. - */ -bool nrf_802154_core_hooks_terminate(nrf_802154_term_t term_lvl, req_originator_t req_orig); - -/** - * @brief Processes hooks for the transmitted event. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame - * that was transmitted. - */ -void nrf_802154_core_hooks_transmitted(const uint8_t * p_frame); - -/** - * @brief Processes hooks for the TX failed event. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame - * that was not transmitted. - * @param[in] error Cause of the failed transmission. - * - * @retval true TX failed event is to be propagated to the MAC layer. - * @retval false TX failed event is not to be propagated to the MAC layer. It is handled - * internally. - */ -bool nrf_802154_core_hooks_tx_failed(const uint8_t * p_frame, nrf_802154_tx_error_t error); - -/** - * @brief Processes hooks for the TX started event. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame - * that is being transmitted. - * - * @retval true TX started event is to be propagated to the MAC layer. - * @retval false TX started event is not to be propagated to the MAC layer. It is handled - * internally. - */ -bool nrf_802154_core_hooks_tx_started(const uint8_t * p_frame); - -/** - * @brief Processes hooks for the RX started event. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame - * that is being received. - */ -void nrf_802154_core_hooks_rx_started(const uint8_t * p_frame); - -/** - * @brief Processes hooks for the RX ACK started event. - */ -void nrf_802154_core_hooks_rx_ack_started(void); - -/** - *@} - **/ - -#endif // NRF_802154_CORE_HOOKS_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.c deleted file mode 100644 index 3e1ad7293..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.c +++ /dev/null @@ -1,285 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements critical sections used with requests by 802.15.4 driver. - * - */ - -#include "nrf_802154_critical_section.h" - -#include -#include - -#include "nrf_802154_config.h" -#include "nrf_802154_debug.h" -#include "nrf_radio.h" -#include "rsch/nrf_802154_rsch.h" -#include "platform/lp_timer/nrf_802154_lp_timer.h" - -#include - -#define CMSIS_IRQ_NUM_VECTACTIVE_DIFF 16 - -#define NESTED_CRITICAL_SECTION_ALLOWED_PRIORITY_NONE (-1) - -static volatile uint8_t m_critical_section_monitor; ///< Monitors each critical section enter operation -static volatile uint8_t m_nested_critical_section_counter; ///< Counter of nested critical sections -static volatile int8_t m_nested_critical_section_allowed_priority; ///< Indicator if nested critical sections are currently allowed - -/*************************************************************************************************** - * @section Critical sections management - **************************************************************************************************/ - -/** @brief Enter critical section for RADIO peripheral - * - * @note RADIO peripheral registers (and NVIC) are modified only when timeslot is granted for the - * 802.15.4 driver. - */ -static void radio_critical_section_enter(void) -{ - if (nrf_802154_rsch_prec_is_approved(RSCH_PREC_RAAL, RSCH_PRIO_MIN_APPROVED)) - { - NVIC_DisableIRQ(RADIO_IRQn); - } -} - -/** @brief Exit critical section for RADIO peripheral - * - * @note RADIO peripheral registers (and NVIC) are modified only when timeslot is granted for the - * 802.15.4 driver. - */ -static void radio_critical_section_exit(void) -{ - if (nrf_802154_rsch_prec_is_approved(RSCH_PREC_RAAL, RSCH_PRIO_MIN_APPROVED)) - { - NVIC_EnableIRQ(RADIO_IRQn); - } -} - -/** @brief Convert active priority value to int8_t type. - * - * @param[in] active_priority Active priority in uint32_t format - * - * @return Active_priority value in int8_t format. - */ -static int8_t active_priority_convert(uint32_t active_priority) -{ - return active_priority == UINT32_MAX ? INT8_MAX : (int8_t)active_priority; -} - -/** @brief Check if active vector priority is equal to priority that allows nested crit sections. - * - * @retval true Active vector priority allows nested critical sections. - * @retval false Active vector priority denies nested critical sections. - */ -static bool nested_critical_section_is_allowed_in_this_context(void) -{ - return m_nested_critical_section_allowed_priority == - active_priority_convert(nrf_802154_critical_section_active_vector_priority_get()); -} - -static bool critical_section_enter(bool forced) -{ - bool result = false; - uint8_t cnt; - - if (forced || - (m_nested_critical_section_counter == 0) || - nested_critical_section_is_allowed_in_this_context()) - { - do - { - cnt = __LDREXB(&m_nested_critical_section_counter); - - assert(cnt < UINT8_MAX); - } - while (__STREXB(cnt + 1, &m_nested_critical_section_counter)); - - nrf_802154_critical_section_rsch_enter(); - nrf_802154_lp_timer_critical_section_enter(); - radio_critical_section_enter(); - __DSB(); - __ISB(); - - m_critical_section_monitor++; - - result = true; - } - - return result; -} - -static void critical_section_exit(void) -{ - uint8_t cnt = m_nested_critical_section_counter; - uint8_t monitor; - uint8_t atomic_cnt; - static bool exiting_crit_sect; - bool result; - - assert(cnt > 0); - - do - { - monitor = m_critical_section_monitor; - - // If critical section is not nested exit critical section - if (cnt == 1) - { - assert(!exiting_crit_sect); - (void)exiting_crit_sect; - exiting_crit_sect = true; - - nrf_802154_critical_section_rsch_exit(); - radio_critical_section_exit(); - nrf_802154_lp_timer_critical_section_exit(); - - exiting_crit_sect = false; - } - - do - { - atomic_cnt = __LDREXB(&m_nested_critical_section_counter); - assert(atomic_cnt == cnt); - } - while (__STREXB(atomic_cnt - 1, &m_nested_critical_section_counter)); - - // If critical section is not nested verify if during exit procedure RSCH notified - // change of state or critical section was visited by higher priority IRQ meantime. - if (cnt == 1) - { - // Check if critical section must be exited again. - if (nrf_802154_critical_section_rsch_event_is_pending() || - (monitor != m_critical_section_monitor)) - { - result = critical_section_enter(false); - assert(result); - (void)result; - - continue; - } - else - { - break; - } - } - } - while (cnt == 1); -} - -/*************************************************************************************************** - * @section API functions - **************************************************************************************************/ - -void nrf_802154_critical_section_init(void) -{ - m_nested_critical_section_counter = 0; - m_nested_critical_section_allowed_priority = NESTED_CRITICAL_SECTION_ALLOWED_PRIORITY_NONE; -} - -bool nrf_802154_critical_section_enter(void) -{ - bool result; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CRIT_SECT_ENTER); - - result = critical_section_enter(false); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CRIT_SECT_ENTER); - - return result; -} - -void nrf_802154_critical_section_forcefully_enter(void) -{ - bool critical_section_entered; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CRIT_SECT_ENTER); - - critical_section_entered = critical_section_enter(true); - assert(critical_section_entered); - (void)critical_section_entered; - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CRIT_SECT_ENTER); -} - -void nrf_802154_critical_section_exit(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_CRIT_SECT_EXIT); - - critical_section_exit(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_CRIT_SECT_EXIT); -} - -void nrf_802154_critical_section_nesting_allow(void) -{ - assert(m_nested_critical_section_allowed_priority == - NESTED_CRITICAL_SECTION_ALLOWED_PRIORITY_NONE); - assert(m_nested_critical_section_counter >= 1); - - m_nested_critical_section_allowed_priority = active_priority_convert( - nrf_802154_critical_section_active_vector_priority_get()); -} - -void nrf_802154_critical_section_nesting_deny(void) -{ - assert(m_nested_critical_section_allowed_priority >= 0); - assert(m_nested_critical_section_counter >= 1); - - m_nested_critical_section_allowed_priority = NESTED_CRITICAL_SECTION_ALLOWED_PRIORITY_NONE; -} - -bool nrf_802154_critical_section_is_nested(void) -{ - return m_nested_critical_section_counter > 1; -} - -uint32_t nrf_802154_critical_section_active_vector_priority_get(void) -{ - uint32_t active_vector_id = (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk) >> SCB_ICSR_VECTACTIVE_Pos; - IRQn_Type irq_number; - uint32_t active_priority; - - // Check if this function is called from main thread. - if (active_vector_id == 0) - { - return UINT32_MAX; - } - - assert(active_vector_id >= CMSIS_IRQ_NUM_VECTACTIVE_DIFF); - - irq_number = (IRQn_Type)(active_vector_id - CMSIS_IRQ_NUM_VECTACTIVE_DIFF); - active_priority = NVIC_GetPriority(irq_number); - - return active_priority; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.h deleted file mode 100644 index 5237a4619..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_critical_section.h +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_CRITICAL_SECTION_H__ -#define NRF_802154_CRITICAL_SECTION_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_critical_section 802.15.4 driver critical section - * @{ - * @ingroup nrf_802154 - * @brief Critical section used with requests to the 802.15.4 driver. - */ - -/** - * @brief Initializes the critical section module. - */ -void nrf_802154_critical_section_init(void); - -/** - * @brief Function for entering a critical section in the 802.15.4 driver. - * - * @retval true The critical section is entered. - * @retval false The critical section could not be entered. - */ -bool nrf_802154_critical_section_enter(void); - -/** - * @brief Function for exiting a critical section in the 802.15.4 driver. - */ -void nrf_802154_critical_section_exit(void); - -/** - * @brief Function for forcefully entering a critical section in the 802.15.4 driver. - * - * With this function, the critical section is entered regardless of whether - * it has been already entered before. - * - * This function is intended to be used by RADIO IRQ handler and RSCH notifications handlers to - * prevent interrupting of these procedures by FSM requests from higher priority IRQ handlers. - */ -void nrf_802154_critical_section_forcefully_enter(void); - -/** - * @brief Allows entry to a nested critical section. - * - * This function is intended to be used with the notification module to allow processing - * requests called from the notification context. - */ -void nrf_802154_critical_section_nesting_allow(void); - -/** - * @brief Denies entry to a nested critical section. - */ -void nrf_802154_critical_section_nesting_deny(void); - -/** - * @brief Checks if the critical section is nested. - * - * @retval true Critical section is nested. - * @retval false Critical section is not nested. - */ -bool nrf_802154_critical_section_is_nested(void); - -/** - * @brief Gets the current IRQ priority. - * - * @returns IRQ priority - */ -uint32_t nrf_802154_critical_section_active_vector_priority_get(void); - -/** - * @brief Function for entering a critical section in the RSCH module. - */ -extern void nrf_802154_critical_section_rsch_enter(void); - -/** - * @brief Function for exiting a critical section in the RSCH module. - */ -extern void nrf_802154_critical_section_rsch_exit(void); - -/** - * @brief Checks if there is a pending event in the RSCH critical section. - */ -extern bool nrf_802154_critical_section_rsch_event_is_pending(void); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif // NRF_802154_CRITICAL_SECTION_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.c deleted file mode 100644 index 9e4f579ae..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.c +++ /dev/null @@ -1,169 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements debug helpers for the nRF 802.15.4 radio driver. - * - */ - -#include "nrf_802154_debug.h" - -#include - -#include "nrf.h" -#include "nrf_gpio.h" -#include "nrf_gpiote.h" -#include "nrf_ppi.h" - -#if ENABLE_DEBUG_LOG -/// Buffer used to store debug log messages. -volatile uint32_t nrf_802154_debug_log_buffer[NRF_802154_DEBUG_LOG_BUFFER_LEN]; -/// Index of the log buffer pointing to the element that should be filled with next log message. -volatile uint32_t nrf_802154_debug_log_ptr = 0; - -#endif - -#if ENABLE_DEBUG_GPIO -/** - * @brief Initialize PPI to toggle GPIO pins on radio events. - */ -static void radio_event_gpio_toggle_init(void) -{ - nrf_gpio_cfg_output(PIN_DBG_RADIO_EVT_END); - nrf_gpio_cfg_output(PIN_DBG_RADIO_EVT_DISABLED); - nrf_gpio_cfg_output(PIN_DBG_RADIO_EVT_READY); - nrf_gpio_cfg_output(PIN_DBG_RADIO_EVT_FRAMESTART); - nrf_gpio_cfg_output(PIN_DBG_RADIO_EVT_EDEND); - - nrf_gpiote_task_configure(GPIOTE_DBG_RADIO_EVT_END, - PIN_DBG_RADIO_EVT_END, - NRF_GPIOTE_POLARITY_TOGGLE, - NRF_GPIOTE_INITIAL_VALUE_HIGH); - nrf_gpiote_task_configure(GPIOTE_DBG_RADIO_EVT_DISABLED, - PIN_DBG_RADIO_EVT_DISABLED, - NRF_GPIOTE_POLARITY_TOGGLE, - NRF_GPIOTE_INITIAL_VALUE_HIGH); - nrf_gpiote_task_configure(GPIOTE_DBG_RADIO_EVT_READY, - PIN_DBG_RADIO_EVT_READY, - NRF_GPIOTE_POLARITY_TOGGLE, - NRF_GPIOTE_INITIAL_VALUE_HIGH); - nrf_gpiote_task_configure(GPIOTE_DBG_RADIO_EVT_FRAMESTART, - PIN_DBG_RADIO_EVT_FRAMESTART, - NRF_GPIOTE_POLARITY_TOGGLE, - NRF_GPIOTE_INITIAL_VALUE_HIGH); - nrf_gpiote_task_configure(GPIOTE_DBG_RADIO_EVT_EDEND, - PIN_DBG_RADIO_EVT_EDEND, - NRF_GPIOTE_POLARITY_TOGGLE, - NRF_GPIOTE_INITIAL_VALUE_HIGH); - - nrf_gpiote_task_enable(GPIOTE_DBG_RADIO_EVT_END); - nrf_gpiote_task_enable(GPIOTE_DBG_RADIO_EVT_DISABLED); - nrf_gpiote_task_enable(GPIOTE_DBG_RADIO_EVT_READY); - nrf_gpiote_task_enable(GPIOTE_DBG_RADIO_EVT_FRAMESTART); - nrf_gpiote_task_enable(GPIOTE_DBG_RADIO_EVT_EDEND); - - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)PPI_DBG_RADIO_EVT_END, - (uint32_t)&NRF_RADIO->EVENTS_END, - nrf_gpiote_task_addr_get(NRF_GPIOTE_TASKS_OUT_0)); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)PPI_DBG_RADIO_EVT_DISABLED, - (uint32_t)&NRF_RADIO->EVENTS_DISABLED, - nrf_gpiote_task_addr_get(NRF_GPIOTE_TASKS_OUT_1)); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)PPI_DBG_RADIO_EVT_READY, - (uint32_t)&NRF_RADIO->EVENTS_READY, - nrf_gpiote_task_addr_get(NRF_GPIOTE_TASKS_OUT_2)); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)PPI_DBG_RADIO_EVT_FRAMESTART, - (uint32_t)&NRF_RADIO->EVENTS_FRAMESTART, - nrf_gpiote_task_addr_get(NRF_GPIOTE_TASKS_OUT_3)); - nrf_ppi_channel_endpoint_setup((nrf_ppi_channel_t)PPI_DBG_RADIO_EVT_EDEND, - (uint32_t)&NRF_RADIO->EVENTS_EDEND, - nrf_gpiote_task_addr_get(NRF_GPIOTE_TASKS_OUT_4)); - - nrf_ppi_channel_enable((nrf_ppi_channel_t)PPI_DBG_RADIO_EVT_END); - nrf_ppi_channel_enable((nrf_ppi_channel_t)PPI_DBG_RADIO_EVT_DISABLED); - nrf_ppi_channel_enable((nrf_ppi_channel_t)PPI_DBG_RADIO_EVT_READY); - nrf_ppi_channel_enable((nrf_ppi_channel_t)PPI_DBG_RADIO_EVT_FRAMESTART); - nrf_ppi_channel_enable((nrf_ppi_channel_t)PPI_DBG_RADIO_EVT_EDEND); -} - -/** - * @brief Initialize GPIO to set it simulated arbiter events. - */ -static void raal_simulator_gpio_init(void) -{ -#if RAAL_SIMULATOR - nrf_gpio_cfg_output(PIN_DBG_TIMESLOT_ACTIVE); - nrf_gpio_cfg_output(PIN_DBG_RAAL_CRITICAL_SECTION); -#endif -} - -#endif // ENABLE_DEBUG_GPIO - -void nrf_802154_debug_init(void) -{ -#if ENABLE_DEBUG_GPIO - radio_event_gpio_toggle_init(); - raal_simulator_gpio_init(); -#endif // ENABLE_DEBUG_GPIO -} - -#if ENABLE_DEBUG_ASSERT -void __assert_func(const char * file, int line, const char * func, const char * cond) -{ - (void)file; - (void)line; - (void)func; - (void)cond; - -#if defined(ENABLE_DEBUG_ASSERT_BKPT) && (ENABLE_DEBUG_ASSERT_BKPT != 0) - __BKPT(0); -#endif - __disable_irq(); - - while (1) - ; -} - -void __aeabi_assert(const char * expr, const char * file, int line) -{ - (void)expr; - (void)file; - (void)line; - -#if defined(ENABLE_DEBUG_ASSERT_BKPT) && (ENABLE_DEBUG_ASSERT_BKPT != 0) - __BKPT(0); -#endif - __disable_irq(); - - while (1) - ; -} - -#endif // ENABLE_DEBUG_ASSERT diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.h deleted file mode 100644 index d407b2a95..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug.h +++ /dev/null @@ -1,191 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains debug helpers for the 802.15.4 radio driver for the nRF SoC devices. - * - */ - -#ifndef NRF_802154_DEBUG_H_ -#define NRF_802154_DEBUG_H_ - -#include - -#include "nrf_802154_debug_core.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define EVENT_SET_STATE 0x0005UL -#define EVENT_RADIO_RESET 0x0006UL - -#define FUNCTION_SLEEP 0x0001UL -#define FUNCTION_RECEIVE 0x0002UL -#define FUNCTION_TRANSMIT 0x0003UL -#define FUNCTION_ENERGY_DETECTION 0x0004UL -#define FUNCTION_BUFFER_FREE 0x0005UL -#define FUNCTION_CCA 0x0006UL -#define FUNCTION_CONTINUOUS_CARRIER 0x0007UL -#define FUNCTION_CSMACA 0x0008UL -#define FUNCTION_TRANSMIT_AT 0x0009UL -#define FUNCTION_RECEIVE_AT 0x000AUL -#define FUNCTION_TRANSMIT_AT_CANCEL 0x000BUL -#define FUNCTION_RECEIVE_AT_CANCEL 0x000CUL - -#define FUNCTION_IRQ_HANDLER 0x0100UL -#define FUNCTION_EVENT_FRAMESTART 0x0101UL -#define FUNCTION_EVENT_BCMATCH 0x0102UL -#define FUNCTION_EVENT_END 0x0103UL -#define FUNCTION_EVENT_DISABLED 0x0104UL -#define FUNCTION_EVENT_READY 0x0105UL -#define FUNCTION_EVENT_CCAIDLE 0x0106UL -#define FUNCTION_EVENT_CCABUSY 0x0107UL -#define FUNCTION_EVENT_EDEND 0x0108UL -#define FUNCTION_EVENT_PHYEND 0x0109UL -#define FUNCTION_EVENT_CRCOK 0x010AUL -#define FUNCTION_EVENT_CRCERROR 0x010BUL - -#define FUNCTION_AUTO_ACK_ABORT 0x0201UL -#define FUNCTION_TIMESLOT_STARTED 0x0202UL -#define FUNCTION_TIMESLOT_ENDED 0x0203UL -#define FUNCTION_CRIT_SECT_ENTER 0x0204UL -#define FUNCTION_CRIT_SECT_EXIT 0x0205UL - -/* Reserved for RAAL: 0x0300 - 0x047F */ - -#define FUNCTION_RSCH_CONTINUOUS_ENTER 0x0480UL -#define FUNCTION_RSCH_CONTINUOUS_EXIT 0x0481UL -#define FUNCTION_RSCH_CRITICAL_SECTION_ENTER 0x0482UL -#define FUNCTION_RSCH_CRITICAL_SECTION_EXIT 0x0483UL -#define FUNCTION_RSCH_TIMESLOT_STARTED 0x0484UL -#define FUNCTION_RSCH_TIMESLOT_ENDED 0x0485UL -#define FUNCTION_RSCH_DELAYED_TIMESLOT_REQ 0x048BUL -#define FUNCTION_RSCH_TIMER_DELAYED_PREC 0x048CUL -#define FUNCTION_RSCH_TIMER_DELAYED_START 0x048DUL -#define FUNCTION_RSCH_DELAYED_TIMESLOT_CANCEL 0x048EUL - -#define FUNCTION_CSMA_ABORT 0x0500UL -#define FUNCTION_CSMA_TX_FAILED 0x0501UL -#define FUNCTION_CSMA_TX_STARTED 0x0502UL -#define FUNCTION_CSMA_CHANNEL_BUSY 0x0503UL -#define FUNCTION_CSMA_FRAME_TRANSMIT 0x0504UL - -#define FUNCTION_TSCH_ADD 0x0600UL -#define FUNCTION_TSCH_FIRED 0x0601UL - -#define FUNCTION_TCOOR_START 0x0700UL -#define FUNCTION_TCOOR_STOP 0x0701UL -#define FUNCTION_TCOOR_TIMESTAMP_PREPARE 0x0702UL -#define FUNCTION_TCOOR_TIMESTAMP_GET 0x0703UL -#define FUNCTION_TCOOR_SYNCHRONIZED 0x0704UL - -#define FUNCTION_DTRX_RX_TIMEOUT 0x0800UL - -#define FUNCTION_ACK_TIMEOUT_FIRED 0x0900UL - -#define FUNCTION_mutex_trylock 0x1000UL -#define FUNCTION_mutex_unlock 0x1001UL -#define FUNCTION_max_prio_for_delayed_timeslot_get 0x1002UL -#define FUNCTION_required_prio_lvl_get 0x1003UL -#define FUNCTION_prec_approved_prio_set 0x1004UL -#define FUNCTION_all_prec_update 0x1005UL -#define FUNCTION_approved_prio_lvl_get 0x1006UL -#define FUNCTION_requested_prio_lvl_is_at_least 0x1007UL -#define FUNCTION_notify_core 0x1008UL - -#ifdef NRF52811_XXAA - -#define PIN_DBG_RADIO_EVT_END 13 -#define PIN_DBG_RADIO_EVT_DISABLED 14 -#define PIN_DBG_RADIO_EVT_READY 17 -#define PIN_DBG_RADIO_EVT_FRAMESTART 18 -#define PIN_DBG_RADIO_EVT_EDEND 25 -#define PIN_DBG_RADIO_EVT_PHYEND 24 - -#else - -#define PIN_DBG_RADIO_EVT_END 11 -#define PIN_DBG_RADIO_EVT_DISABLED 12 -#define PIN_DBG_RADIO_EVT_READY 13 -#define PIN_DBG_RADIO_EVT_FRAMESTART 14 -#define PIN_DBG_RADIO_EVT_EDEND 25 -#define PIN_DBG_RADIO_EVT_PHYEND 24 - -#endif - -#define PPI_DBG_RADIO_EVT_END 0 -#define PPI_DBG_RADIO_EVT_DISABLED 1 -#define PPI_DBG_RADIO_EVT_READY 2 -#define PPI_DBG_RADIO_EVT_FRAMESTART 3 -#define PPI_DBG_RADIO_EVT_EDEND 4 - -#define GPIOTE_DBG_RADIO_EVT_END 0 -#define GPIOTE_DBG_RADIO_EVT_DISABLED 1 -#define GPIOTE_DBG_RADIO_EVT_READY 2 -#define GPIOTE_DBG_RADIO_EVT_FRAMESTART 3 -#define GPIOTE_DBG_RADIO_EVT_EDEND 4 - -#if ENABLE_DEBUG_GPIO - -#define NRF_802154_DEBUG_PINS_USED_MASK ((1 << PIN_DBG_RADIO_EVT_END) | \ - (1 << PIN_DBG_RADIO_EVT_DISABLED) | \ - (1 << PIN_DBG_RADIO_EVT_READY) | \ - (1 << PIN_DBG_RADIO_EVT_FRAMESTART) | \ - (1 << PIN_DBG_RADIO_EVT_EDEND) | \ - (1 << PIN_DBG_RADIO_EVT_PHYEND)) - -#define NRF_802154_DEBUG_PPI_CHANNELS_USED_MASK ((1 << PPI_DBG_RADIO_EVT_END) | \ - (1 << PPI_DBG_RADIO_EVT_DISABLED) | \ - (1 << PPI_DBG_RADIO_EVT_READY) | \ - (1 << PPI_DBG_RADIO_EVT_FRAMESTART) | \ - (1 << PPI_DBG_RADIO_EVT_EDEND) | \ - (1 << PPI_DBG_RADIO_EVT_PHYEND)) - -#define NRF_802154_DEBUG_GPIOTE_CHANNELS_USED_MASK ((1 << GPIOTE_DBG_RADIO_EVT_END) | \ - (1 << GPIOTE_DBG_RADIO_EVT_DISABLED) | \ - (1 << GPIOTE_DBG_RADIO_EVT_READY) | \ - (1 << GPIOTE_DBG_RADIO_EVT_FRAMESTART) | \ - (1 << GPIOTE_DBG_RADIO_EVT_EDEND) | \ - (1 << GPIOTE_DBG_RADIO_EVT_PHYEND)) - -#else // ENABLE_DEBUG_GPIO - -#define NRF_802154_DEBUG_PINS_USED_MASK 0 -#define NRF_802154_DEBUG_PPI_CHANNELS_USED_MASK 0 -#define NRF_802154_DEBUG_GPIOTE_CHANNELS_USED_MASK 0 - -#endif // ENABLE_DEBUG_GPIO - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_DEBUG_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug_core.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug_core.h deleted file mode 100644 index 8da136c26..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_debug_core.h +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains debug helpers for the 802.15.4 radio driver for the nRF SoC devices. - * - */ - -#ifndef NRF_802154_DEBUG_CORE_H_ -#define NRF_802154_DEBUG_CORE_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#define NRF_802154_DEBUG_LOG_BUFFER_LEN 1024 - -#define EVENT_TRACE_ENTER 0x0001UL -#define EVENT_TRACE_EXIT 0x0002UL - -#define PIN_DBG_TIMESLOT_ACTIVE 3 -#define PIN_DBG_TIMESLOT_EXTEND_REQ 4 -#define PIN_DBG_TIMESLOT_SESSION_IDLE 16 -#define PIN_DBG_TIMESLOT_RADIO_IRQ 28 -#define PIN_DBG_TIMESLOT_FAILED 29 -#define PIN_DBG_TIMESLOT_BLOCKED 30 -#define PIN_DBG_RAAL_CRITICAL_SECTION 15 - -#define PIN_DBG_RTC0_EVT_REM 31 - -#if ENABLE_DEBUG_GPIO - -#define NRF_802154_DEBUG_CORE_PINS_USED ((1 << PIN_DBG_TIMESLOT_ACTIVE) | \ - (1 << PIN_DBG_TIMESLOT_EXTEND_REQ) | \ - (1 << PIN_DBG_TIMESLOT_SESSION_IDLE) | \ - (1 << PIN_DBG_TIMESLOT_RADIO_IRQ) | \ - (1 << PIN_DBG_TIMESLOT_FAILED) | \ - (1 << PIN_DBG_TIMESLOT_BLOCKED) | \ - (1 << PIN_DBG_RAAL_CRITICAL_SECTION)) - -#else // ENABLE_DEBUG_GPIO - -#define NRF_802154_DEBUG_CORE_PINS_USED 0 - -#endif - -#ifndef DEBUG_VERBOSITY -#define DEBUG_VERBOSITY 1 -#endif - -#ifndef CU_TEST -#if ENABLE_DEBUG_LOG -extern volatile uint32_t nrf_802154_debug_log_buffer[ - NRF_802154_DEBUG_LOG_BUFFER_LEN]; -extern volatile uint32_t nrf_802154_debug_log_ptr; - -#define nrf_802154_log(EVENT_CODE, EVENT_ARG) \ - do \ - { \ - uint32_t ptr = nrf_802154_debug_log_ptr; \ - \ - nrf_802154_debug_log_buffer[ptr] = ((EVENT_CODE) | ((EVENT_ARG) << 16)); \ - nrf_802154_debug_log_ptr = \ - ptr < (NRF_802154_DEBUG_LOG_BUFFER_LEN - 1) ? ptr + 1 : 0; \ - } \ - while (0) - -#else // ENABLE_DEBUG_LOG - -#define nrf_802154_log(EVENT_CODE, EVENT_ARG) (void)(EVENT_ARG) - -#endif // ENABLE_DEBUG_LOG - -#define nrf_802154_log_entry(function, verbosity) \ - do \ - { \ - if (verbosity <= DEBUG_VERBOSITY) \ - { \ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_ ## function); \ - } \ - } \ - while (0) - -#define nrf_802154_log_exit(function, verbosity) \ - do \ - { \ - if (verbosity <= DEBUG_VERBOSITY) \ - { \ - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_ ## function); \ - } \ - } \ - while (0) - -#else // CU_TEST - -#define nrf_802154_log(EVENT_CODE, EVENT_ARG) - -#endif - -#if ENABLE_DEBUG_GPIO - -#define nrf_802154_pin_set(pin) NRF_P0->OUTSET = (1UL << (pin)) -#define nrf_802154_pin_clr(pin) NRF_P0->OUTCLR = (1UL << (pin)) -#define nrf_802154_pin_tgl(pin) \ - do \ - { \ - volatile uint32_t ps = NRF_P0->OUT; \ - \ - NRF_P0->OUTSET = (~ps & (1UL << (pin))); \ - NRF_P0->OUTCLR = (ps & (1UL << (pin))); \ - } \ - while (0); - -#else // ENABLE_DEBUG_GPIO - -#define nrf_802154_pin_set(pin) -#define nrf_802154_pin_clr(pin) -#define nrf_802154_pin_tgl(pin) - -#endif // ENABLE_DEBUG_GPIO - -/** - * @brief Initializes debug helpers for the nRF 802.15.4 driver. - */ -void nrf_802154_debug_init(void); - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_DEBUG_CORE_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification.h deleted file mode 100644 index 3dd60b520..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification.h +++ /dev/null @@ -1,140 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_NOTIFICATION_H__ -#define NRF_802154_NOTIFICATION_H__ - -#include -#include - -#include "nrf_802154.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_notification 802.15.4 driver notification - * @{ - * @ingroup nrf_802154 - * @brief Notifications to the next higher layer triggered from the 802.15.4 radio driver. - */ - -/** - * @brief Function type used for notifications from critical sections in the core module. - * - * This function is called instead of the default notification. The function is passed to request - * notifications from a critical section during the request processing. - * - * @param[in] result If the called request succeeded. - */ -typedef void (* nrf_802154_notification_func_t)(bool result); - -/** - * @brief Initializes the notification module. - */ -void nrf_802154_notification_init(void); - -/** - * @brief Notifies the next higher layer that a frame was received. - * - * @param[in] p_data Pointer to a buffer that contains PHR and PSDU of the received frame. - * @param[in] power RSSI measured during the frame reception. - * @param[in] lqi LQI indicating measured link quality during the frame reception. - */ -void nrf_802154_notify_received(uint8_t * p_data, int8_t power, uint8_t lqi); - -/** - * @brief Notifies the next higher layer that the reception of a frame failed. - * - * @param[in] error Error code that indicates the reason of the failure. - */ -void nrf_802154_notify_receive_failed(nrf_802154_rx_error_t error); - -/** - * @brief Notifies the next higher layer that a frame was transmitted. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the transmitted frame. - * @param[in] p_ack Pointer to a buffer that containsthat contains PHR and PSDU of ACK frame. NULL if ACK was - * not requested. - * @param[in] power RSSI of the received frame or 0 if ACK was not requested. - * @param[in] lqi LQI of the received frame of 0 if ACK was not requested. - */ -void nrf_802154_notify_transmitted(const uint8_t * p_frame, - uint8_t * p_ack, - int8_t power, - uint8_t lqi); - -/** - * @brief Notifies the next higher layer that a frame was not transmitted. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame that failed - * the transmission operation. - * @param[in] error An error code indicating the reason of the failure. - */ -void nrf_802154_notify_transmit_failed(const uint8_t * p_frame, nrf_802154_tx_error_t error); - -/** - * @brief Notifies the next higher layer that the energy detection procedure ended. - * - * @param[in] result Detected energy level. - */ -void nrf_802154_notify_energy_detected(uint8_t result); - -/** - * @brief Notifies the next higher layer that the energy detection procedure failed. - * - * @param[in] error Error code indicating the reason of the failure. - */ -void nrf_802154_notify_energy_detection_failed(nrf_802154_ed_error_t error); - -/** - * @brief Notifies the next higher layer that the CCA procedure ended. - * - * @param[in] is_free If detected that channel is free. - */ -void nrf_802154_notify_cca(bool is_free); - -/** - * @brief Notifies the next higher layer that the CCA procedure failed. - * - * @param[in] error Error code indicating reason of the failure. - */ -void nrf_802154_notify_cca_failed(nrf_802154_cca_error_t error); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif // NRF_802154_NOTIFICATION_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification_direct.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification_direct.c deleted file mode 100644 index e9aacc1d9..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification_direct.c +++ /dev/null @@ -1,110 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements notifications triggered directly by the nrf 802.15.4 radio driver. - * - */ - -#include "nrf_802154_notification.h" - -#include -#include - -#include "nrf_802154.h" -#include "nrf_802154_critical_section.h" - -#define RAW_LENGTH_OFFSET 0 -#define RAW_PAYLOAD_OFFSET 1 - -void nrf_802154_notification_init(void) -{ - // Intentionally empty -} - -void nrf_802154_notify_received(uint8_t * p_data, int8_t power, uint8_t lqi) -{ -#if NRF_802154_USE_RAW_API - nrf_802154_received_raw(p_data, power, lqi); -#else // NRF_802154_USE_RAW_API - nrf_802154_received(p_data + RAW_PAYLOAD_OFFSET, p_data[RAW_LENGTH_OFFSET], power, lqi); -#endif // NRF_802154_USE_RAW_API -} - -void nrf_802154_notify_receive_failed(nrf_802154_rx_error_t error) -{ - nrf_802154_receive_failed(error); -} - -void nrf_802154_notify_transmitted(const uint8_t * p_frame, - uint8_t * p_ack, - int8_t power, - uint8_t lqi) -{ -#if NRF_802154_USE_RAW_API - nrf_802154_transmitted_raw(p_frame, p_ack, power, lqi); -#else // NRF_802154_USE_RAW_API - nrf_802154_transmitted(p_frame + RAW_PAYLOAD_OFFSET, - p_ack == NULL ? NULL : p_ack + RAW_PAYLOAD_OFFSET, - p_ack[RAW_LENGTH_OFFSET], - power, - lqi); -#endif // NRF_802154_USE_RAW_API -} - -void nrf_802154_notify_transmit_failed(const uint8_t * p_frame, nrf_802154_tx_error_t error) -{ -#if NRF_802154_USE_RAW_API - nrf_802154_transmit_failed(p_frame, error); -#else // NRF_802154_USE_RAW_API - nrf_802154_transmit_failed(p_frame + RAW_PAYLOAD_OFFSET, error); -#endif // NRF_802154_USE_RAW_API -} - -void nrf_802154_notify_energy_detected(uint8_t result) -{ - nrf_802154_energy_detected(result); -} - -void nrf_802154_notify_energy_detection_failed(nrf_802154_ed_error_t error) -{ - nrf_802154_energy_detection_failed(error); -} - -void nrf_802154_notify_cca(bool is_free) -{ - nrf_802154_cca_done(is_free); -} - -void nrf_802154_notify_cca_failed(nrf_802154_cca_error_t error) -{ - nrf_802154_cca_failed(error); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification_swi.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification_swi.c deleted file mode 100644 index c440490a4..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_notification_swi.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements notifications triggered by the nrf 802.15.4 radio driver via SWI. - * - */ - -#include "nrf_802154_notification.h" - -#include -#include - -#include "nrf_802154.h" -#include "nrf_802154_swi.h" - -void nrf_802154_notification_init(void) -{ - nrf_802154_swi_init(); -} - -void nrf_802154_notify_received(uint8_t * p_data, int8_t power, uint8_t lqi) -{ - nrf_802154_swi_notify_received(p_data, power, lqi); -} - -void nrf_802154_notify_receive_failed(nrf_802154_rx_error_t error) -{ - nrf_802154_swi_notify_receive_failed(error); -} - -void nrf_802154_notify_transmitted(const uint8_t * p_frame, - uint8_t * p_ack, - int8_t power, - uint8_t lqi) -{ - nrf_802154_swi_notify_transmitted(p_frame, p_ack, power, lqi); -} - -void nrf_802154_notify_transmit_failed(const uint8_t * p_frame, nrf_802154_tx_error_t error) -{ - nrf_802154_swi_notify_transmit_failed(p_frame, error); -} - -void nrf_802154_notify_energy_detected(uint8_t result) -{ - nrf_802154_swi_notify_energy_detected(result); -} - -void nrf_802154_notify_energy_detection_failed(nrf_802154_ed_error_t error) -{ - nrf_802154_swi_notify_energy_detection_failed(error); -} - -void nrf_802154_notify_cca(bool is_free) -{ - nrf_802154_swi_notify_cca(is_free); -} - -void nrf_802154_notify_cca_failed(nrf_802154_cca_error_t error) -{ - nrf_802154_swi_notify_cca_failed(error); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_peripherals.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_peripherals.h deleted file mode 100644 index 6ba51520e..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_peripherals.h +++ /dev/null @@ -1,506 +0,0 @@ -/* Copyright (c) 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that defines the 802.15.4 driver peripheral usage. - * - */ - -#ifndef NRF_802154_PERIPHERALS_H__ -#define NRF_802154_PERIPHERALS_H__ - -#include -#include -#include "nrf_802154_config.h" -#include "nrf_802154_debug.h" -#include "nrf_802154_debug_core.h" -#include "fem/nrf_fem_protocol_api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @def NRF_802154_HIGH_PRECISION_TIMER_INSTANCE_NO - * - * Number of the timer instance used for precise frame timestamps and synchronous radio operations. - * - */ -#ifndef NRF_802154_HIGH_PRECISION_TIMER_INSTANCE_NO -#define NRF_802154_HIGH_PRECISION_TIMER_INSTANCE_NO 0 -#endif - -/** - * @def NRF_802154_HIGH_PRECISION_TIMER_INSTANCE - * - * The timer instance used for precise frame timestamps and synchronous radio operations. - * - */ -#define NRF_802154_HIGH_PRECISION_TIMER_INSTANCE \ - NRFX_CONCAT_2(NRF_TIMER, NRF_802154_HIGH_PRECISION_TIMER_INSTANCE_NO) - -/** - * @def NRF_802154_TIMER_INSTANCE_NO - * - * Number of the timer instance used both by the driver for ACK IFS and by the FEM module. - * - */ -#ifndef NRF_802154_TIMER_INSTANCE_NO -#define NRF_802154_TIMER_INSTANCE_NO 1 -#endif - -/** - * @def NRF_802154_TIMER_INSTANCE - * - * The timer instance used both by the driver for ACK IFS and by the FEM module. - * - */ -#define NRF_802154_TIMER_INSTANCE \ - NRFX_CONCAT_2(NRF_TIMER, NRF_802154_TIMER_INSTANCE_NO) - -/** - * @def NRF_802154_COUNTER_TIMER_INSTANCE_NO - * - * Number of the timer instance used for detecting when PSDU is being received. - * - */ -#ifndef NRF_802154_COUNTER_TIMER_INSTANCE_NO -#define NRF_802154_COUNTER_TIMER_INSTANCE_NO 2 -#endif - -/** - * @def NRF_802154_COUNTER_TIMER_INSTANCE - * - * The timer instance used by the driver for detecting when PSDU is being received. - * - * @note This configuration is used only when the NRF_RADIO_EVENT_BCMATCH event handling is disabled - * (see @ref NRF_802154_DISABLE_BCC_MATCHING). - */ -#define NRF_802154_COUNTER_TIMER_INSTANCE \ - NRFX_CONCAT_2(NRF_TIMER, NRF_802154_COUNTER_TIMER_INSTANCE_NO) - -/** - * @def NRF_802154_SWI_EGU_INSTANCE_NO - * - * Number of the SWI EGU instance used by the driver to synchronize PPIs and for requests and - * notifications if SWI is in use. - * - */ -#ifndef NRF_802154_SWI_EGU_INSTANCE_NO - -#ifdef NRF52811_XXAA -#define NRF_802154_SWI_EGU_INSTANCE_NO 0 -#else -#define NRF_802154_SWI_EGU_INSTANCE_NO 3 -#endif - -#endif // NRF_802154_SWI_EGU_INSTANCE_NO - -/** - * @def NRF_802154_SWI_EGU_INSTANCE - * - * The SWI EGU instance used by the driver to synchronize PPIs and for requests and notifications if - * SWI is in use. - * - * @note This option is used by the core module regardless of the driver configuration. - * - */ -#define NRF_802154_SWI_EGU_INSTANCE NRFX_CONCAT_2(NRF_EGU, NRF_802154_SWI_EGU_INSTANCE_NO) - -/** - * @def NRF_802154_SWI_IRQ_HANDLER - * - * The SWI EGU IRQ handler used by the driver for requests and notifications if SWI is in use. - * - * @note This option is used when the driver uses SWI to process requests and notifications. - * - */ -#define NRF_802154_SWI_IRQ_HANDLER \ - NRFX_CONCAT_3(NRFX_CONCAT_3(SWI, NRF_802154_SWI_EGU_INSTANCE_NO, _EGU), \ - NRF_802154_SWI_EGU_INSTANCE_NO, \ - _IRQHandler) - -/** - * @def NRF_802154_SWI_IRQN - * - * The SWI EGU IRQ number used by the driver for requests and notifications if SWI is in use. - * - * @note This option is used when the driver uses SWI to process requests and notifications. - * - */ -#define NRF_802154_SWI_IRQN \ - NRFX_CONCAT_3(NRFX_CONCAT_3(SWI, NRF_802154_SWI_EGU_INSTANCE_NO, _EGU), \ - NRF_802154_SWI_EGU_INSTANCE_NO, \ - _IRQn) - -/** - * @def NRF_802154_RTC_INSTANCE_NO - * - * Number of the RTC instance used in the standalone timer driver implementation. - * - */ -#ifndef NRF_802154_RTC_INSTANCE_NO - -#ifdef NRF52811_XXAA -#define NRF_802154_RTC_INSTANCE_NO 0 -#else -#define NRF_802154_RTC_INSTANCE_NO 2 -#endif - -#endif // NRF_802154_RTC_INSTANCE_NO - -/** - * @def NRF_802154_RTC_INSTANCE - * - * The RTC instance used in the standalone timer driver implementation. - * - * @note This configuration is only applicable for the Low Power Timer Abstraction Layer - * implementation in nrf_802154_lp_timer_nodrv.c. - * - */ -#define NRF_802154_RTC_INSTANCE NRFX_CONCAT_2(NRF_RTC, NRF_802154_RTC_INSTANCE_NO) - -/** - * @def NRF_802154_RTC_IRQ_HANDLER - * - * The RTC interrupt handler name used in the standalone timer driver implementation. - * - * @note This configuration is only applicable for Low Power Timer Abstraction Layer implementation - * in nrf_802154_lp_timer_nodrv.c. - * - */ -#define NRF_802154_RTC_IRQ_HANDLER NRFX_CONCAT_3(RTC, NRF_802154_RTC_INSTANCE_NO, _IRQHandler) - -/** - * @def NRF_802154_RTC_IRQN - * - * The RTC Interrupt number used in the standalone timer driver implementation. - * - * @note This configuration is only applicable for the Low Power Timer Abstraction Layer implementation - * in nrf_802154_lp_timer_nodrv.c. - * - */ -#define NRF_802154_RTC_IRQN NRFX_CONCAT_3(RTC, NRF_802154_RTC_INSTANCE_NO, _IRQn) - -/** - * @def NRF_802154_PPI_RADIO_DISABLED_TO_EGU - * - * The PPI channel that connects RADIO_DISABLED event to EGU task. - * - * @note This option is used by the core module regardless of the driver configuration. - * - */ -#ifndef NRF_802154_PPI_RADIO_DISABLED_TO_EGU -#define NRF_802154_PPI_RADIO_DISABLED_TO_EGU NRF_PPI_CHANNEL6 -#endif - -/** - * @def NRF_802154_PPI_EGU_TO_RADIO_RAMP_UP - * - * The PPI channel that connects EGU event to RADIO_TXEN or RADIO_RXEN task. - * - * @note This option is used by the core module regardless of the driver configuration. - * - */ -#ifndef NRF_802154_PPI_EGU_TO_RADIO_RAMP_UP -#define NRF_802154_PPI_EGU_TO_RADIO_RAMP_UP NRF_PPI_CHANNEL7 -#endif - -/** - * @def NRF_802154_PPI_EGU_TO_TIMER_START - * - * The PPI channel that connects EGU event to TIMER_START task. - * - * @note This option is used by the core module regardless of the driver configuration. - * - */ -#ifndef NRF_802154_PPI_EGU_TO_TIMER_START -#define NRF_802154_PPI_EGU_TO_TIMER_START NRF_PPI_CHANNEL8 -#endif - -/** - * @def NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR - * - * The PPI channel that connects RADIO_CRCERROR event to TIMER_CLEAR task. - * - * @note This option is used by the core module regardless of the driver configuration. - * The peripheral is shared with @ref NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE - * and @ref NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN. - * - */ -#ifndef NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR -#define NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR NRF_PPI_CHANNEL9 -#endif - -/** - * @def NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE - * - * The PPI channel that connects RADIO_CCAIDLE event to the GPIOTE tasks used by the Frontend. - * - * @note This option is used by the core module regardless of the driver configuration. - * The peripheral is shared with @ref NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR - * and @ref NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN. - * - */ -#ifndef NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE -#define NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE NRF_PPI_CHANNEL9 -#endif - -/** - * @def NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN - * - * The PPI channel that connects TIMER_COMPARE event to RADIO_TXEN task. - * - * @note This option is used by the core module regardless of the driver configuration. - * The peripheral is shared with @ref NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR - * and @ref NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE. - * - */ -#ifndef NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN -#define NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN NRF_PPI_CHANNEL9 -#endif - -/** - * @def NRF_802154_PPI_RADIO_CRCOK_TO_PPI_GRP_DISABLE - * - * The PPI channel that connects RADIO_CRCOK event with the task that disables the whole PPI group. - * - * @note This option is used by the core module regardless of the driver configuration. - * - */ -#ifndef NRF_802154_PPI_RADIO_CRCOK_TO_PPI_GRP_DISABLE -#define NRF_802154_PPI_RADIO_CRCOK_TO_PPI_GRP_DISABLE NRF_PPI_CHANNEL10 -#endif - -#ifdef NRF_802154_DISABLE_BCC_MATCHING - -/** - * @def NRF_802154_PPI_RADIO_ADDR_TO_COUNTER_COUNT - * - * The PPI channel that connects RADIO_ADDRESS event to TIMER_COUNT task. - * - * @note This configuration is used only when the NRF_RADIO_EVENT_BCMATCH event handling is disabled - * (see @ref NRF_802154_DISABLE_BCC_MATCHING). - * - */ -#ifndef NRF_802154_PPI_RADIO_ADDR_TO_COUNTER_COUNT -#define NRF_802154_PPI_RADIO_ADDR_TO_COUNTER_COUNT NRF_PPI_CHANNEL11 -#endif - -/** - * @def NRF_802154_PPI_RADIO_CRCERROR_TO_COUNTER_CLEAR - * - * The PPI channel that connects RADIO_CRCERROR event to TIMER_CLEAR task. - * - * @note This option is used only when the NRF_RADIO_EVENT_BCMATCH event handling is disabled - * (see @ref NRF_802154_DISABLE_BCC_MATCHING). - * - */ -#ifndef NRF_802154_PPI_RADIO_CRCERROR_COUNTER_CLEAR -#define NRF_802154_PPI_RADIO_CRCERROR_COUNTER_CLEAR NRF_PPI_CHANNEL12 -#endif - -/** - * @def NRF_802154_DISABLE_BCC_MATCHING_PPI_CHANNELS_USED_MASK - * - * Helper bit mask of PPI channels used additionally by the 802.15.4 driver when the BCC matching - * is disabled. - */ -#define NRF_802154_DISABLE_BCC_MATCHING_PPI_CHANNELS_USED_MASK \ - ((1 << NRF_802154_PPI_RADIO_ADDR_TO_COUNTER_COUNT) | \ - (1 << NRF_802154_PPI_RADIO_CRCERROR_COUNTER_CLEAR)) - -#else // NRF_802154_DISABLE_BCC_MATCHING - -#define NRF_802154_DISABLE_BCC_MATCHING_PPI_CHANNELS_USED_MASK 0 - -#endif // NRF_802154_DISABLE_BCC_MATCHING - -#ifdef NRF_802154_FRAME_TIMESTAMP_ENABLED - -/** - * @def NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE - * - * The PPI channel that connects LP timer's COMPARE event to HP timer's TIMER_CAPTURE task. - * - * @note This option is used only when the timestamping feature is enabled - * (see @ref NRF_802154_FRAME_TIMESTAMP_ENABLED). - * - */ -#ifndef NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE -#define NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE NRF_PPI_CHANNEL13 -#endif - -/** - * @def NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE - * - * The PPI channel that connects provided event to HP timer's TIMER_CAPTURE task. - * - * @note This option is used only when the timestamping feature is enabled - * (see @ref NRF_802154_FRAME_TIMESTAMP_ENABLED). - * - */ -#ifndef NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE -#define NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE NRF_PPI_CHANNEL14 -#endif - -/** - * @def NRF_802154_TIMESTAMP_PPI_CHANNELS_USED_MASK - * - * Helper bit mask of PPI channels used by the 802.15.4 driver for timestamping. - */ -#define NRF_802154_TIMESTAMP_PPI_CHANNELS_USED_MASK \ - ((1 << NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE) | \ - (1 << NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE)) - -#else // NRF_802154_FRAME_TIMESTAMP_ENABLED - -#define NRF_802154_TIMESTAMP_PPI_CHANNELS_USED_MASK 0 - -#endif // NRF_802154_FRAME_TIMESTAMP_ENABLED - -/** - * @def NRF_802154_PPI_CORE_GROUP - * - * The PPI channel group used to disable self-disabling PPIs used by the core module. - * - * @note This option is used by the core module regardless of the driver configuration. - * - */ -#ifndef NRF_802154_PPI_CORE_GROUP -#define NRF_802154_PPI_CORE_GROUP NRF_PPI_CHANNEL_GROUP0 -#endif - -#ifdef NRF_802154_FRAME_TIMESTAMP_ENABLED - -/** - * @def NRF_802154_PPI_TIMESTAMP_GROUP - * - * The PPI channel group used to control PPIs used for timestamping. - * - * @note This option is used only when the timestamping feature is enabled - * (see @ref NRF_802154_FRAME_TIMESTAMP_ENABLED). - * - */ -#ifndef NRF_802154_PPI_TIMESTAMP_GROUP -#define NRF_802154_PPI_TIMESTAMP_GROUP NRF_PPI_CHANNEL_GROUP1 -#endif - -#endif // NRF_802154_FRAME_TIMESTAMP_ENABLED - -/** - * @def NRF_802154_TIMERS_USED_MASK - * - * Bit mask of instances of timer peripherals used by the 802.15.4 driver. - */ -#ifndef NRF_802154_TIMERS_USED_MASK -#define NRF_802154_TIMERS_USED_MASK ((1 << NRF_802154_HIGH_PRECISION_TIMER_INSTANCE_NO) | \ - (1 << NRF_802154_TIMER_INSTANCE_NO) | \ - (1 << NRF_802154_COUNTER_TIMER_INSTANCE_NO)) -#endif // NRF_802154_TIMERS_USED_MASK - -/** - * @def NRF_802154_SWI_EGU_USED_MASK - * - * Bit mask of instances of SWI/EGU peripherals used by the 802.15.4 driver. - */ -#ifndef NRF_802154_SWI_EGU_USED_MASK -#define NRF_802154_SWI_EGU_USED_MASK (1 << NRF_802154_SWI_EGU_INSTANCE_NO) -#endif - -/** - * @def NRF_802154_RTC_USED_MASK - * - * Bit mask of instances of RTC peripherals used by the 802.15.4 driver. - */ -#ifndef NRF_802154_RTC_USED_MASK -#define NRF_802154_RTC_USED_MASK (1 << NRF_802154_RTC_INSTANCE_NO) -#endif - -/** - * @def NRF_802154_GPIO_PINS_USED_MASK - * - * Bit mask of GPIO pins used by the 802.15.4 driver. - */ -#ifndef NRF_802154_GPIO_PINS_USED_MASK -#define NRF_802154_GPIO_PINS_USED_MASK (NRF_802154_FEM_PINS_USED_MASK | \ - NRF_802154_DEBUG_PINS_USED_MASK) -#endif // NRF_802154_GPIO_PINS_USED_MASK - -/** - * @def NRF_802154_GPIOTE_CHANNELS_USED_MASK - * - * Bit mask of GPIOTE peripherals used by the 802.15.4 driver. - */ -#ifndef NRF_802154_GPIOTE_CHANNELS_USED_MASK -#define NRF_802154_GPIOTE_CHANNELS_USED_MASK (NRF_802154_FEM_GPIOTE_CHANNELS_USED_MASK | \ - NRF_802154_DEBUG_GPIOTE_CHANNELS_USED_MASK) -#endif // NRF_802154_GPIOTE_CHANNELS_USED_MASK - -/** - * @def NRF_80254_PPI_CHANNELS_USED_MASK - * - * Bit mask of PPI channels used by the 802.15.4 driver. - */ -#ifndef NRF_802154_PPI_CHANNELS_USED_MASK -#define NRF_802154_PPI_CHANNELS_USED_MASK ((1 << NRF_802154_PPI_RADIO_DISABLED_TO_EGU) | \ - (1 << NRF_802154_PPI_EGU_TO_RADIO_RAMP_UP) | \ - (1 << NRF_802154_PPI_EGU_TO_TIMER_START) | \ - (1 << NRF_802154_PPI_RADIO_CRCERROR_TO_TIMER_CLEAR) | \ - (1 << NRF_802154_PPI_RADIO_CCAIDLE_TO_FEM_GPIOTE) | \ - (1 << NRF_802154_PPI_TIMER_COMPARE_TO_RADIO_TXEN) | \ - (1 << NRF_802154_PPI_RADIO_CRCOK_TO_PPI_GRP_DISABLE) | \ - NRF_802154_DISABLE_BCC_MATCHING_PPI_CHANNELS_USED_MASK | \ - NRF_802154_TIMESTAMP_PPI_CHANNELS_USED_MASK | \ - NRF_802154_FEM_PPI_CHANNELS_USED_MASK | \ - NRF_802154_DEBUG_PPI_CHANNELS_USED_MASK) -#endif // NRF_802154_PPI_CHANNELS_USED_MASK - -/** - * @def NRF_802154_PPI_GROUPS_USED_MASK - * - * Bit mask of PPI groups identifiers used by the 802.15.4 driver. - */ -#ifndef NRF_802154_PPI_GROUPS_USED_MASK - -#ifdef NRF_802154_FRAME_TIMESTAMP_ENABLED -#define NRF_802154_PPI_GROUPS_USED_MASK ((1 << NRF_802154_PPI_CORE_GROUP) | \ - (1 << NRF_802154_PPI_TIMESTAMP_GROUP)) -#else // NRF_802154_FRAME_TIMESTAMP_ENABLED -#define NRF_802154_PPI_GROUPS_USED_MASK (1 << NRF_802154_PPI_CORE_GROUP) -#endif // NRF_802154_FRAME_TIMESTAMP_ENABLED - -#endif // NRF_802154_PPI_GROUPS_USED_MASK - -#ifdef __cplusplus -} -#endif - -#endif // NRF_802154_PERIPHERALS_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.c deleted file mode 100644 index 07f56acf5..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.c +++ /dev/null @@ -1,251 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements storage of PIB attributes in nRF 802.15.4 radio driver. - * - */ - -#include "nrf_802154_pib.h" - -#include -#include -#include -#include - -#include "nrf_802154_config.h" -#include "nrf_802154_const.h" -#include "nrf_802154_utils.h" -#include "fal/nrf_802154_fal.h" - -typedef struct -{ - int8_t tx_power; ///< Transmit power. - uint8_t pan_id[PAN_ID_SIZE]; ///< Pan Id of this node. - uint8_t short_addr[SHORT_ADDRESS_SIZE]; ///< Short Address of this node. - uint8_t extended_addr[EXTENDED_ADDRESS_SIZE]; ///< Extended Address of this node. - nrf_802154_cca_cfg_t cca; ///< CCA mode and thresholds. - bool promiscuous : 1; ///< Indicating if radio is in promiscuous mode. - bool auto_ack : 1; ///< Indicating if auto ACK procedure is enabled. - bool pan_coord : 1; ///< Indicating if radio is configured as the PAN coordinator. - uint8_t channel : 5; ///< Channel on which the node receives messages. -} nrf_802154_pib_data_t; - -// Static variables. -static nrf_802154_pib_data_t m_data; ///< Buffer containing PIB data. - -/** - * Converts TX power integer values to RADIO TX power allowed values. - * - * @param[in] integer_tx_power TX power integer value. - * - * @retval RADIO TX power allowed value. - */ -static nrf_radio_txpower_t to_radio_tx_power_convert(int8_t integer_tx_power) -{ - const nrf_radio_txpower_t allowed_values[] = - { -#if defined(RADIO_TXPOWER_TXPOWER_Neg40dBm) - NRF_RADIO_TXPOWER_NEG40DBM, /**< -40 dBm. */ -#endif - NRF_RADIO_TXPOWER_NEG20DBM, /**< -20 dBm. */ - NRF_RADIO_TXPOWER_NEG16DBM, /**< -16 dBm. */ - NRF_RADIO_TXPOWER_NEG12DBM, /**< -12 dBm. */ - NRF_RADIO_TXPOWER_NEG8DBM, /**< -8 dBm. */ - NRF_RADIO_TXPOWER_NEG4DBM, /**< -4 dBm. */ - NRF_RADIO_TXPOWER_0DBM, /**< 0 dBm. */ -#if defined(RADIO_TXPOWER_TXPOWER_Pos2dBm) - NRF_RADIO_TXPOWER_POS2DBM, /**< 2 dBm. */ -#endif -#if defined(RADIO_TXPOWER_TXPOWER_Pos3dBm) - NRF_RADIO_TXPOWER_POS3DBM, /**< 3 dBm. */ -#endif - NRF_RADIO_TXPOWER_POS4DBM, /**< 4 dBm. */ -#if defined(RADIO_TXPOWER_TXPOWER_Pos5dBm) - NRF_RADIO_TXPOWER_POS5DBM, /**< 5 dBm. */ -#endif -#if defined(RADIO_TXPOWER_TXPOWER_Pos6dBm) - NRF_RADIO_TXPOWER_POS6DBM, /**< 6 dBm. */ -#endif -#if defined(RADIO_TXPOWER_TXPOWER_Pos7dBm) - NRF_RADIO_TXPOWER_POS7DBM, /**< 7 dBm. */ -#endif -#if defined(RADIO_TXPOWER_TXPOWER_Pos8dBm) - NRF_RADIO_TXPOWER_POS8DBM, /**< 8 dBm. */ -#endif - }; - - nrf_radio_txpower_t radio_tx_power = allowed_values[NUMELTS(allowed_values) - 1]; - - if (integer_tx_power < (int8_t)radio_tx_power) - { - for (uint32_t i = 0; i < NUMELTS(allowed_values); i++) - { - if (integer_tx_power <= (int8_t)allowed_values[i]) - { - radio_tx_power = allowed_values[i]; - break; - } - } - } - - return radio_tx_power; -} - -void nrf_802154_pib_init(void) -{ - m_data.promiscuous = false; - m_data.auto_ack = true; - m_data.pan_coord = false; - m_data.channel = 11; - - memset(m_data.pan_id, 0xff, sizeof(m_data.pan_id)); - m_data.short_addr[0] = 0xfe; - m_data.short_addr[1] = 0xff; - memset(m_data.extended_addr, 0, sizeof(m_data.extended_addr)); - - m_data.cca.mode = NRF_802154_CCA_MODE_DEFAULT; - m_data.cca.ed_threshold = NRF_802154_CCA_ED_THRESHOLD_DEFAULT; - m_data.cca.corr_threshold = NRF_802154_CCA_CORR_THRESHOLD_DEFAULT; - m_data.cca.corr_limit = NRF_802154_CCA_CORR_LIMIT_DEFAULT; -} - -bool nrf_802154_pib_promiscuous_get(void) -{ - return m_data.promiscuous; -} - -void nrf_802154_pib_promiscuous_set(bool enabled) -{ - m_data.promiscuous = enabled; -} - -bool nrf_802154_pib_auto_ack_get(void) -{ - return m_data.auto_ack; -} - -void nrf_802154_pib_auto_ack_set(bool enabled) -{ - m_data.auto_ack = enabled; -} - -bool nrf_802154_pib_pan_coord_get(void) -{ - return m_data.pan_coord; -} - -void nrf_802154_pib_pan_coord_set(bool enabled) -{ - m_data.pan_coord = enabled; -} - -uint8_t nrf_802154_pib_channel_get(void) -{ - return m_data.channel; -} - -void nrf_802154_pib_channel_set(uint8_t channel) -{ - m_data.channel = channel; -} - -nrf_radio_txpower_t nrf_802154_pib_tx_power_get(void) -{ - int8_t tx_power = nrf_802154_fal_tx_power_get(m_data.channel, m_data.tx_power); - - return to_radio_tx_power_convert(tx_power); -} - -void nrf_802154_pib_tx_power_set(int8_t dbm) -{ - m_data.tx_power = dbm; -} - -const uint8_t * nrf_802154_pib_pan_id_get(void) -{ - return m_data.pan_id; -} - -void nrf_802154_pib_pan_id_set(const uint8_t * p_pan_id) -{ - memcpy(m_data.pan_id, p_pan_id, PAN_ID_SIZE); -} - -const uint8_t * nrf_802154_pib_extended_address_get(void) -{ - return m_data.extended_addr; -} - -void nrf_802154_pib_extended_address_set(const uint8_t * p_extended_address) -{ - memcpy(m_data.extended_addr, p_extended_address, EXTENDED_ADDRESS_SIZE); -} - -const uint8_t * nrf_802154_pib_short_address_get(void) -{ - return m_data.short_addr; -} - -void nrf_802154_pib_short_address_set(const uint8_t * p_short_address) -{ - memcpy(m_data.short_addr, p_short_address, SHORT_ADDRESS_SIZE); -} - -void nrf_802154_pib_cca_cfg_set(const nrf_802154_cca_cfg_t * p_cca_cfg) -{ - switch (p_cca_cfg->mode) - { - case NRF_RADIO_CCA_MODE_ED: - m_data.cca.mode = p_cca_cfg->mode; - m_data.cca.ed_threshold = p_cca_cfg->ed_threshold; - break; - - case NRF_RADIO_CCA_MODE_CARRIER: - m_data.cca.mode = p_cca_cfg->mode; - m_data.cca.corr_threshold = p_cca_cfg->corr_threshold; - m_data.cca.corr_limit = p_cca_cfg->corr_limit; - break; - - case NRF_RADIO_CCA_MODE_CARRIER_AND_ED: - case NRF_RADIO_CCA_MODE_CARRIER_OR_ED: - memcpy(&m_data.cca, p_cca_cfg, sizeof(m_data.cca)); - break; - - default: - assert(false); - } -} - -void nrf_802154_pib_cca_cfg_get(nrf_802154_cca_cfg_t * p_cca_cfg) -{ - memcpy(p_cca_cfg, &m_data.cca, sizeof(m_data.cca)); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.h deleted file mode 100644 index 8aa24f90f..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_pib.h +++ /dev/null @@ -1,193 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that implements the storage of PIB attributes in the nRF 802.15.4 radio driver. - * - */ - -#ifndef NRF_802154_PIB_H_ -#define NRF_802154_PIB_H_ - -#include -#include - -#include "nrf_802154.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Initializes this module. - */ -void nrf_802154_pib_init(void); - -/** - * @brief Checks if the promiscuous mode is enabled. - * - * @retval true The promiscuous mode is enabled. - * @retval false The promiscuous mode is disabled. - */ -bool nrf_802154_pib_promiscuous_get(void); - -/** - * @brief Enables or disables the promiscuous mode. - * - * @param[in] enabled If the promiscuous mode is to be enabled. - */ -void nrf_802154_pib_promiscuous_set(bool enabled); - -/** - * @brief Checks if the auto ACK procedure is enabled. - * - * @retval true The auto ACK procedure is enabled. - * @retval false The auto ACK procedure is disabled. - */ -bool nrf_802154_pib_auto_ack_get(void); - -/** - * @brief Enables or disables the auto ACK procedure. - * - * @param[in] enabled If the auto ACK procedure is to be enabled. - */ -void nrf_802154_pib_auto_ack_set(bool enabled); - -/** - * @brief Checks if the radio is configured as the PAN coordinator. - * - * @retval true The radio is configured as the PAN coordinator. - * @retval false The radio is not configured as the PAN coordinator. - */ -bool nrf_802154_pib_pan_coord_get(void); - -/** - * @brief Configures the device as the PAN coordinator. - * - * @param[in] enabled If the radio is configured as the PAN coordinator. - */ -void nrf_802154_pib_pan_coord_set(bool enabled); - -/** - * @brief Gets the currently used channel. - * - * @returns Channel number used by the driver. - */ -uint8_t nrf_802154_pib_channel_get(void); - -/** - * @brief Sets the channel that will be used by the driver. - * - * @param[in] channel Number of the channel used by the driver. - */ -void nrf_802154_pib_channel_set(uint8_t channel); - -/** - * @brief Gets the transmit power. - * - * @returns Transmit power in dBm. - */ -nrf_radio_txpower_t nrf_802154_pib_tx_power_get(void); - -/** - * @brief Sets the transmit power used for ACK frames. - * - * @param[in] dbm Transmit power in dBm. - */ -void nrf_802154_pib_tx_power_set(int8_t dbm); - -/** - * @brief Gets the PAN ID used by this device. - * - * @returns Pointer to the buffer containing the PAN ID value (2 bytes, little-endian). - */ -const uint8_t * nrf_802154_pib_pan_id_get(void); - -/** - * @brief Sets the PAN ID used by this device. - * - * @param[in] p_pan_id Pointer to the PAN ID (2 bytes, little-endian). - * - * This function makes a copy of the PAN ID. - */ -void nrf_802154_pib_pan_id_set(const uint8_t * p_pan_id); - -/** - * @brief Gets the extended address of this device. - * - * @returns Pointer to the buffer containing the extended address (8 bytes, little-endian). - */ -const uint8_t * nrf_802154_pib_extended_address_get(void); - -/** - * @brief Sets the extended address of this device. - * - * @param[in] p_extended_address Pointer to extended address (8 bytes, little-endian). - * - * This function makes a copy of the address. - */ -void nrf_802154_pib_extended_address_set(const uint8_t * p_extended_address); - -/** - * @brief Gets the short address of this device. - * - * @returns Pointer to the buffer containing the short address (2 bytes, little-endian). - */ -const uint8_t * nrf_802154_pib_short_address_get(void); - -/** - * @brief Sets the short address of this device. - * - * @param[in] p_short_address Pointer to the short address (2 bytes, little-endian). - * - * This function makes a copy of the address. - */ -void nrf_802154_pib_short_address_set(const uint8_t * p_short_address); - -/** - * @brief Sets the radio CCA mode and threshold. - * - * @param[in] p_cca_cfg Pointer to the CCA configuration structure. Only fields relevant - * to the selected mode are updated. - */ -void nrf_802154_pib_cca_cfg_set(const nrf_802154_cca_cfg_t * p_cca_cfg); - -/** - * @brief Gets the current radio CCA configuration. - * - * @param[out] p_cca_cfg Pointer to the structure for the current CCA configuration. - */ -void nrf_802154_pib_cca_cfg_get(nrf_802154_cca_cfg_t * p_cca_cfg); - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_PIB_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop.h deleted file mode 100644 index 596c2c01a..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_PRIORITY_DROP_H__ -#define NRF_802154_PRIORITY_DROP_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_priority_drop 802.15.4 driver procedures with lower priority - * @{ - * @ingroup nrf_802154 - * @brief Internal procedures of the 802.15.4 driver that should be called with lower priority than - * the caller's priority. - */ - -/** - * @brief Initializes the notification module. - */ -void nrf_802154_priority_drop_init(void); - -/** - * @brief Requests the stop of the high frequency clock. - * - * @note This function must be called through this module to prevent calling it from the arbiter - * context. - */ -void nrf_802154_priority_drop_hfclk_stop(void); - -/** - * @brief Terminates the requesting of the high frequency clock stop procedure. - * - * Function used to to terminate the HFClk stop procedure requested by the previous call to - * @rev nrf_802154_priority_drop_hfclk_stop. The HFClk stop procedure is terminated only if it has - * not been started. - */ -void nrf_802154_priority_drop_hfclk_stop_terminate(void); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif // NRF_802154_PRIORITY_DROP_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop_direct.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop_direct.c deleted file mode 100644 index fe79f0a25..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop_direct.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements procedures that should be called with lower priority than caller in - * the nrf 802.15.4 radio driver. - * - */ - -#include "nrf_802154_priority_drop.h" - -#include "platform/clock/nrf_802154_clock.h" - -void nrf_802154_priority_drop_init(void) -{ - // Intentionally empty -} - -void nrf_802154_priority_drop_hfclk_stop(void) -{ - nrf_802154_clock_hfclk_stop(); -} - -void nrf_802154_priority_drop_hfclk_stop_terminate(void) -{ - // Intentionally empty: - // nrf_802154_priority_drop_hfclk_stop is synchronous and cannot be terminated. -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop_swi.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop_swi.c deleted file mode 100644 index ae2a31c02..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_priority_drop_swi.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements procedures that should be called with lower priority than caller in - * the nrf 802.15.4 radio driver. - * - */ - -#include "nrf_802154_priority_drop.h" - -#include "nrf_802154_swi.h" - -void nrf_802154_priority_drop_init(void) -{ - nrf_802154_swi_init(); -} - -void nrf_802154_priority_drop_hfclk_stop(void) -{ - nrf_802154_swi_hfclk_stop(); -} - -void nrf_802154_priority_drop_hfclk_stop_terminate(void) -{ - nrf_802154_swi_hfclk_stop_terminate(); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_procedures_duration.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_procedures_duration.h deleted file mode 100644 index 6cbc2973d..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_procedures_duration.h +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains calculations of the duration of the 802.15.4 radio driver procedures. - * - */ - -#ifndef NRF_802154_PROCEDURES_DURATION_H_ -#define NRF_802154_PROCEDURES_DURATION_H_ - -#include -#include -#include "nrf.h" - -#include "nrf_802154_const.h" - -#define TX_RAMP_UP_TIME 40 // us -#define RX_RAMP_UP_TIME 40 // us -#define RX_RAMP_DOWN_TIME 0 // us -#define MAX_RAMP_DOWN_TIME 6 // us -#define RX_TX_TURNAROUND_TIME 20 // us - -#define A_CCA_DURATION_SYMBOLS 8 // sym -#define A_TURNAROUND_TIME_SYMBOLS 12 // sym -#define A_UNIT_BACKOFF_SYMBOLS 20 // sym - -#define PHY_SYMBOLS_FROM_OCTETS(octets) ((octets) * PHY_SYMBOLS_PER_OCTET) -#define PHY_US_TIME_FROM_SYMBOLS(symbols) ((symbols) * PHY_US_PER_SYMBOL) - -#define IMM_ACK_SYMBOLS (PHY_SHR_SYMBOLS + \ - PHY_SYMBOLS_FROM_OCTETS(IMM_ACK_LENGTH + PHR_SIZE)) -#define IMM_ACK_DURATION (PHY_US_TIME_FROM_SYMBOLS(IMM_ACK_SYMBOLS)) - -#define MAC_IMM_ACK_WAIT_SYMBOLS (A_UNIT_BACKOFF_SYMBOLS + \ - A_TURNAROUND_TIME_SYMBOLS + \ - IMM_ACK_SYMBOLS) - -__STATIC_INLINE uint16_t nrf_802154_tx_duration_get(uint8_t psdu_length, - bool cca, - bool ack_requested); - -__STATIC_INLINE uint16_t nrf_802154_cca_before_tx_duration_get(void); - -__STATIC_INLINE uint16_t nrf_802154_rx_duration_get(uint8_t psdu_length, bool ack_requested); - -__STATIC_INLINE uint16_t nrf_802154_cca_duration_get(void); - -#ifndef SUPPRESS_INLINE_IMPLEMENTATION - -__STATIC_INLINE uint16_t nrf_802154_frame_duration_get(uint8_t psdu_length, - bool shr, - bool phr) -{ - uint16_t us_time = PHY_US_TIME_FROM_SYMBOLS(PHY_SYMBOLS_FROM_OCTETS(psdu_length)); - - if (phr) - { - us_time += PHY_US_TIME_FROM_SYMBOLS(PHY_SYMBOLS_FROM_OCTETS(PHR_SIZE)); - } - - if (shr) - { - us_time += PHY_US_TIME_FROM_SYMBOLS(PHY_SHR_SYMBOLS); - } - - return us_time; -} - -__STATIC_INLINE uint16_t nrf_802154_tx_duration_get(uint8_t psdu_length, - bool cca, - bool ack_requested) -{ - // ramp down - // if CCA: + RX ramp up + CCA + RX ramp down - // + TX ramp up + SHR + PHR + PSDU - // if ACK: + macAckWaitDuration - uint16_t us_time = MAX_RAMP_DOWN_TIME + TX_RAMP_UP_TIME + nrf_802154_frame_duration_get( - psdu_length, - true, - true); - - if (ack_requested) - { - us_time += PHY_US_TIME_FROM_SYMBOLS(MAC_IMM_ACK_WAIT_SYMBOLS); - } - - if (cca) - { - us_time += RX_RAMP_UP_TIME + RX_RAMP_DOWN_TIME + PHY_US_TIME_FROM_SYMBOLS( - A_CCA_DURATION_SYMBOLS); - } - - return us_time; -} - -__STATIC_INLINE uint16_t nrf_802154_cca_before_tx_duration_get(void) -{ - // CCA + turnaround time - uint16_t us_time = PHY_US_TIME_FROM_SYMBOLS(A_CCA_DURATION_SYMBOLS) + RX_TX_TURNAROUND_TIME; - - return us_time; -} - -__STATIC_INLINE uint16_t nrf_802154_rx_duration_get(uint8_t psdu_length, bool ack_requested) -{ - // SHR + PHR + PSDU - // if ACK: + aTurnaroundTime + ACK frame duration - uint16_t us_time = nrf_802154_frame_duration_get(psdu_length, true, true); - - if (ack_requested) - { - us_time += PHY_US_TIME_FROM_SYMBOLS(A_TURNAROUND_TIME_SYMBOLS + - PHY_SHR_SYMBOLS + - PHY_SYMBOLS_FROM_OCTETS(IMM_ACK_LENGTH + PHR_SIZE)); - } - - return us_time; -} - -__STATIC_INLINE uint16_t nrf_802154_cca_duration_get(void) -{ - // ramp down + rx ramp up + CCA - uint16_t us_time = MAX_RAMP_DOWN_TIME + - RX_RAMP_UP_TIME + - PHY_US_TIME_FROM_SYMBOLS(A_CCA_DURATION_SYMBOLS); - - return us_time; -} - -#endif /* SUPPRESS_INLINE_IMPLEMENTATION */ - -#endif /* NRF_802154_PROCEDURES_DURATION_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request.h deleted file mode 100644 index 7f2f5a9eb..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request.h +++ /dev/null @@ -1,171 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_REQUEST_H__ -#define NRF_802154_REQUEST_H__ - -#include -#include - -#include "nrf_802154_const.h" -#include "nrf_802154_notification.h" -#include "nrf_802154_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_request 802.15.4 driver request - * @{ - * @ingroup nrf_802154 - * @brief Requests to the driver triggered from the MAC layer. - */ - -/** - * @brief Initializes the request module. - */ -void nrf_802154_request_init(void); - -/** - * @brief Requests entering the @ref RADIO_STATE_SLEEP state for the driver. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * - * @retval true The driver will enter sleep state. - * @retval false The driver cannot enter the sleep state due to an ongoing operation. - */ -bool nrf_802154_request_sleep(nrf_802154_term_t term_lvl); - -/** - * @brief Requests entering the @ref RADIO_STATE_RX state for the driver. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] req_orig Module that originates this request. - * @param[in] notify_function Function called to notify the status of this procedure. May be NULL. - * @param[in] notify_abort If the abort notification is to be triggered automatically. - * - * @retval true The driver will enter the receive state. - * @retval false The driver cannot enter the receive state due to ongoing operation. - */ -bool nrf_802154_request_receive(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - nrf_802154_notification_func_t notify_function, - bool notify_abort); - -/** - * @brief Request entering the @ref RADIO_STATE_TX state for the driver. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] req_orig Module that originates this request. - * @param[in] p_data Pointer to the frame to transmit. - * @param[in] cca If the driver is to perform the CCA procedure before transmission. - * @param[in] immediate If true, the driver schedules transmission immediately or never. - * If false, the transmission can be postponed until the TX - * preconditions are met. - * @param[in] notify_function Function called to notify the status of this procedure. May be NULL. - * - * @retval true The driver will enter the transmit state. - * @retval false The driver cannot enter the transmit state due to an ongoing operation. - */ -bool nrf_802154_request_transmit(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - const uint8_t * p_data, - bool cca, - bool immediate, - nrf_802154_notification_func_t notify_function); - -/** - * @brief Requests entering the @ref RADIO_STATE_ED state. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] time_us Requested duration of the energy detection procedure. - * - * @retval true The driver will enter energy detection state. - * @retval false The driver cannot enter the energy detection state due to an ongoing operation. - */ -bool nrf_802154_request_energy_detection(nrf_802154_term_t term_lvl, uint32_t time_us); - -/** - * @brief Requests entering the @ref RADIO_STATE_CCA state. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * - * @retval true The driver will enter the CCA state. - * @retval false The driver cannot enter the CCA state due to an ongoing operation. - */ -bool nrf_802154_request_cca(nrf_802154_term_t term_lvl); - -/** - * @brief Requests entering the @ref RADIO_STATE_CONTINUOUS_CARRIER state. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * - * @retval true The driver will enter the continuous carrier state. - * @retval false The driver cannot enter the continuous carrier state due to an ongoing operation. - */ -bool nrf_802154_request_continuous_carrier(nrf_802154_term_t term_lvl); - -/** - * @brief Requests the driver to free the given buffer. - * - * @param[in] p_data Pointer to the buffer to be freed. - */ -bool nrf_802154_request_buffer_free(uint8_t * p_data); - -/** - * @brief Requests the driver to update the channel number used by the RADIO peripheral. - */ -bool nrf_802154_request_channel_update(void); - -/** - * @brief Requests the driver to update the CCA configuration used by the RADIO peripheral. - */ -bool nrf_802154_request_cca_cfg_update(void); - -/** - * @brief Requests the RSSI measurement. - */ -bool nrf_802154_request_rssi_measure(void); - -/** - * @brief Requests getting the last RSSI measurement result. - */ -bool nrf_802154_request_rssi_measurement_get(int8_t * p_rssi); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif // NRF_802154_REQUEST_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request_direct.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request_direct.c deleted file mode 100644 index f320a9326..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request_direct.c +++ /dev/null @@ -1,124 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements requests to the driver triggered directly by the MAC layer. - * - */ - -#include "nrf_802154_request.h" - -#include -#include - -#include "nrf_802154_core.h" -#include "nrf_radio.h" - -#define REQUEST_FUNCTION(func_core, ...) \ - bool result; \ - \ - result = func_core(__VA_ARGS__); \ - \ - return result; - -void nrf_802154_request_init(void) -{ - // Intentionally empty -} - -bool nrf_802154_request_sleep(nrf_802154_term_t term_lvl) -{ - REQUEST_FUNCTION(nrf_802154_core_sleep, term_lvl) -} - -bool nrf_802154_request_receive(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - nrf_802154_notification_func_t notify_function, - bool notify_abort) -{ - REQUEST_FUNCTION(nrf_802154_core_receive, term_lvl, req_orig, notify_function, notify_abort) -} - -bool nrf_802154_request_transmit(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - const uint8_t * p_data, - bool cca, - bool immediate, - nrf_802154_notification_func_t notify_function) -{ - REQUEST_FUNCTION(nrf_802154_core_transmit, - term_lvl, - req_orig, - p_data, - cca, - immediate, - notify_function) -} - -bool nrf_802154_request_energy_detection(nrf_802154_term_t term_lvl, uint32_t time_us) -{ - REQUEST_FUNCTION(nrf_802154_core_energy_detection, term_lvl, time_us) -} - -bool nrf_802154_request_cca(nrf_802154_term_t term_lvl) -{ - REQUEST_FUNCTION(nrf_802154_core_cca, term_lvl) -} - -bool nrf_802154_request_continuous_carrier(nrf_802154_term_t term_lvl) -{ - REQUEST_FUNCTION(nrf_802154_core_continuous_carrier, term_lvl) -} - -bool nrf_802154_request_buffer_free(uint8_t * p_data) -{ - REQUEST_FUNCTION(nrf_802154_core_notify_buffer_free, p_data) -} - -bool nrf_802154_request_channel_update(void) -{ - REQUEST_FUNCTION(nrf_802154_core_channel_update) -} - -bool nrf_802154_request_cca_cfg_update(void) -{ - REQUEST_FUNCTION(nrf_802154_core_cca_cfg_update) -} - -bool nrf_802154_request_rssi_measure(void) -{ - REQUEST_FUNCTION(nrf_802154_core_rssi_measure) -} - -bool nrf_802154_request_rssi_measurement_get(int8_t * p_rssi) -{ - REQUEST_FUNCTION(nrf_802154_core_last_rssi_measurement_get, p_rssi) -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request_swi.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request_swi.c deleted file mode 100644 index fcc36cbdc..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_request_swi.c +++ /dev/null @@ -1,187 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements requests to the driver triggered by the MAC layer through SWI. - * - */ - -#include "nrf_802154_request.h" - -#include -#include -#include - -#include "nrf_802154_config.h" -#include "nrf_802154_core.h" -#include "nrf_802154_critical_section.h" -#include "nrf_802154_debug.h" -#include "nrf_802154_peripherals.h" -#include "nrf_802154_rx_buffer.h" -#include "nrf_802154_swi.h" -#include "nrf_802154_utils.h" -#include "nrf_radio.h" - -#include - -/** Assert if SWI interrupt is disabled. */ -static inline void assert_interrupt_status(void) -{ - assert(nrf_is_nvic_irq_enabled(NRF_802154_SWI_IRQN)); -} - -#define REQUEST_FUNCTION(func_core, func_swi, ...) \ - bool result = false; \ - \ - if (active_vector_priority_is_high()) \ - { \ - result = func_core(__VA_ARGS__); \ - } \ - else \ - { \ - assert_interrupt_status(); \ - func_swi(__VA_ARGS__, &result); \ - } \ - \ - return result; - -#define REQUEST_FUNCTION_NO_ARGS(func_core, func_swi) \ - bool result = false; \ - \ - if (active_vector_priority_is_high()) \ - { \ - result = func_core(); \ - } \ - else \ - { \ - assert_interrupt_status(); \ - func_swi(&result); \ - } \ - \ - return result; - -/** Check if active vector priority is high enough to call requests directly. - * - * @retval true Active vector priority is greater or equal to SWI priority. - * @retval false Active vector priority is lower than SWI priority. - */ -static bool active_vector_priority_is_high(void) -{ - - return nrf_802154_critical_section_active_vector_priority_get() <= NRF_802154_SWI_PRIORITY; -} - -void nrf_802154_request_init(void) -{ - nrf_802154_swi_init(); -} - -bool nrf_802154_request_sleep(nrf_802154_term_t term_lvl) -{ - REQUEST_FUNCTION(nrf_802154_core_sleep, nrf_802154_swi_sleep, term_lvl) -} - -bool nrf_802154_request_receive(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - nrf_802154_notification_func_t notify_function, - bool notify_abort) -{ - REQUEST_FUNCTION(nrf_802154_core_receive, - nrf_802154_swi_receive, - term_lvl, - req_orig, - notify_function, - notify_abort) -} - -bool nrf_802154_request_transmit(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - const uint8_t * p_data, - bool cca, - bool immediate, - nrf_802154_notification_func_t notify_function) -{ - REQUEST_FUNCTION(nrf_802154_core_transmit, - nrf_802154_swi_transmit, - term_lvl, - req_orig, - p_data, - cca, - immediate, - notify_function) -} - -bool nrf_802154_request_energy_detection(nrf_802154_term_t term_lvl, - uint32_t time_us) -{ - REQUEST_FUNCTION(nrf_802154_core_energy_detection, - nrf_802154_swi_energy_detection, - term_lvl, - time_us) -} - -bool nrf_802154_request_cca(nrf_802154_term_t term_lvl) -{ - REQUEST_FUNCTION(nrf_802154_core_cca, nrf_802154_swi_cca, term_lvl) -} - -bool nrf_802154_request_continuous_carrier(nrf_802154_term_t term_lvl) -{ - REQUEST_FUNCTION(nrf_802154_core_continuous_carrier, nrf_802154_swi_continuous_carrier, - term_lvl) -} - -bool nrf_802154_request_buffer_free(uint8_t * p_data) -{ - REQUEST_FUNCTION(nrf_802154_core_notify_buffer_free, nrf_802154_swi_buffer_free, p_data) -} - -bool nrf_802154_request_channel_update(void) -{ - REQUEST_FUNCTION_NO_ARGS(nrf_802154_core_channel_update, nrf_802154_swi_channel_update) -} - -bool nrf_802154_request_cca_cfg_update(void) -{ - REQUEST_FUNCTION_NO_ARGS(nrf_802154_core_cca_cfg_update, nrf_802154_swi_cca_cfg_update) -} - -bool nrf_802154_request_rssi_measure(void) -{ - REQUEST_FUNCTION_NO_ARGS(nrf_802154_core_rssi_measure, nrf_802154_swi_rssi_measure) -} - -bool nrf_802154_request_rssi_measurement_get(int8_t * p_rssi) -{ - REQUEST_FUNCTION(nrf_802154_core_last_rssi_measurement_get, - nrf_802154_swi_rssi_measurement_get, - p_rssi) -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.c deleted file mode 100644 index b9ed46853..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.c +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements RSSI calculations for 802.15.4 driver. - * - */ - -#include - -#include "platform/temperature/nrf_802154_temperature.h" - -int8_t nrf_802154_rssi_sample_temp_corr_value_get(void) -{ - int8_t temp = nrf_802154_temperature_get(); - int8_t result; - - if (temp <= -30) - { - result = 3; - } - else if (temp <= -10) - { - result = 2; - } - else if (temp <= 10) - { - result = 1; - } - else if (temp <= 30) - { - result = 0; - } - else if (temp <= 50) - { - result = -1; - } - else if (temp <= 70) - { - result = -2; - } - else - { - result = -3; - } - - return result; -} - -uint8_t nrf_802154_rssi_sample_corrected_get(uint8_t rssi_sample) -{ - return rssi_sample + nrf_802154_rssi_sample_temp_corr_value_get(); -} - -uint8_t nrf_802154_rssi_lqi_corrected_get(uint8_t lqi) -{ - return lqi - nrf_802154_rssi_sample_temp_corr_value_get(); -} - -uint8_t nrf_802154_rssi_ed_corrected_get(uint8_t ed) -{ - return ed - nrf_802154_rssi_sample_temp_corr_value_get(); -} - -uint8_t nrf_802154_rssi_cca_ed_threshold_corrected_get(uint8_t cca_ed) -{ - return cca_ed - nrf_802154_rssi_sample_temp_corr_value_get(); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.h deleted file mode 100644 index 346795c85..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rssi.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_RSSI_H__ -#define NRF_802154_RSSI_H__ - -#include - -/** - * @defgroup nrf_802154_rssi RSSI calculations used internally in the 802.15.4 driver - * @{ - * @ingroup nrf_802154 - * @brief RSSI calculations used internally in the 802.15.4 driver. - */ - -/** - * @brief Gets the RSSISAMPLE temperature correction value. - * - * The correction value is based on the last temperature value reported by the platform. - * - * @returns RSSISAMPLE temperature correction value (Errata 153). - */ -int8_t nrf_802154_rssi_sample_temp_corr_value_get(void); - -/** - * @brief Adjusts the given RSSISAMPLE value by a temperature correction factor. - * - * @param[in] rssi_sample Value read from the RSSISAMPLE register. - * - * @returns RSSISAMPLE corrected by a temperature factor (Errata 153). - */ -uint8_t nrf_802154_rssi_sample_corrected_get(uint8_t rssi_sample); - -/** - * @brief Adjusts the reported LQI value using a temperature correction factor. - * - * @param[in] lqi Value read from the LQI byte. - * - * @returns LQI byte value corrected by a temperature factor (Errata 153). - */ -uint8_t nrf_802154_rssi_lqi_corrected_get(uint8_t lqi); - -/** - * @brief Adjusts the EDSAMPLE value using a temperature correction factor. - * - * @param[in] ed Value read from the EDSAMPLE register. - * - * @returns EDSAMPLE value corrected by a temperature factor (Errata 153). - */ -uint8_t nrf_802154_rssi_ed_corrected_get(uint8_t ed); - -/** - * @brief Adjusts the CCA ED threshold value using a temperature correction factor. - * - * @param[in] cca_ed Value representing the CCA ED threshold to be corrected. - * - * @returns CCA ED threshold value corrected by a temperature factor (Errata 153). - */ -uint8_t nrf_802154_rssi_cca_ed_threshold_corrected_get(uint8_t cca_ed); - -/** - *@} - **/ - -#endif // NRF_802154_RSSI_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.c deleted file mode 100644 index ffc09b9c6..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements buffer management for frames received by nRF 802.15.4 radio driver. - * - */ - -#include "nrf_802154_rx_buffer.h" - -#include - -#include "nrf_802154_config.h" - -#if NRF_802154_RX_BUFFERS < 1 -#error Not enough rx buffers in the 802.15.4 radio driver. -#endif - -rx_buffer_t nrf_802154_rx_buffers[NRF_802154_RX_BUFFERS]; ///< Receive buffers. - -void nrf_802154_rx_buffer_init(void) -{ - for (uint32_t i = 0; i < NRF_802154_RX_BUFFERS; i++) - { - nrf_802154_rx_buffers[i].free = true; - } -} - -rx_buffer_t * nrf_802154_rx_buffer_free_find(void) -{ - for (uint32_t i = 0; i < NRF_802154_RX_BUFFERS; i++) - { - if (nrf_802154_rx_buffers[i].free) - { - return &nrf_802154_rx_buffers[i]; - } - } - - return NULL; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.h deleted file mode 100644 index 9ec93a0d7..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_rx_buffer.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains buffer for frames received by the nRF 802.15.4 radio driver. - * - */ - -#ifndef NRF_802154_RX_BUFFER_H_ -#define NRF_802154_RX_BUFFER_H_ - -#include -#include - -#include "nrf_802154_const.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Structure that contains the received frame. - */ -typedef struct -{ - uint8_t data[MAX_PACKET_SIZE + 1]; - bool free; // If this buffer is free or contains a frame. -} rx_buffer_t; - -/** - * @brief Array that contains all buffers used to receive frame. - * - * This array is in the global scope to allow optimizations in the core module if there is only - * one buffer provided by this module. - * - */ -extern rx_buffer_t nrf_802154_rx_buffers[]; - -/** - * @brief Initializes the buffer for received frames. - */ -void nrf_802154_rx_buffer_init(void); - -/** - * @brief Gets a free buffer to receive a frame. - * - * @returns Pointer to a free buffer, or NULL if no free buffer is available. - */ -rx_buffer_t * nrf_802154_rx_buffer_free_find(void); - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_RX_BUFFER_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.c deleted file mode 100644 index bbadda84e..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.c +++ /dev/null @@ -1,868 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements SWI manager for nRF 802.15.4 driver. - * - */ - -#include "nrf_802154_swi.h" - -#include -#include -#include - -#include "nrf_802154.h" -#include "nrf_802154_config.h" -#include "nrf_802154_core.h" -#include "nrf_802154_peripherals.h" -#include "nrf_802154_rx_buffer.h" -#include "nrf_802154_utils.h" -#include "nrf_egu.h" -#include "platform/clock/nrf_802154_clock.h" - -/** Size of notification queue. - * - * One slot for each receive buffer, one for transmission, one for busy channel and one for energy - * detection. - */ -#define NTF_QUEUE_SIZE (NRF_802154_RX_BUFFERS + 3) - -/** Size of requests queue. - * - * Two is minimal queue size. It is not expected in current implementation to queue a few requests. - */ -#define REQ_QUEUE_SIZE 2 - -#define SWI_EGU NRF_802154_SWI_EGU_INSTANCE ///< Label of SWI peripheral. -#define SWI_IRQn NRF_802154_SWI_IRQN ///< Symbol of SWI IRQ number. -#define SWI_IRQHandler NRF_802154_SWI_IRQ_HANDLER ///< Symbol of SWI IRQ handler. - -#define NTF_INT NRF_EGU_INT_TRIGGERED0 ///< Label of notification interrupt. -#define NTF_TASK NRF_EGU_TASK_TRIGGER0 ///< Label of notification task. -#define NTF_EVENT NRF_EGU_EVENT_TRIGGERED0 ///< Label of notification event. - -#define HFCLK_STOP_INT NRF_EGU_INT_TRIGGERED1 ///< Label of HFClk stop interrupt. -#define HFCLK_STOP_TASK NRF_EGU_TASK_TRIGGER1 ///< Label of HFClk stop task. -#define HFCLK_STOP_EVENT NRF_EGU_EVENT_TRIGGERED1 ///< Label of HFClk stop event. - -#define REQ_INT NRF_EGU_INT_TRIGGERED2 ///< Label of request interrupt. -#define REQ_TASK NRF_EGU_TASK_TRIGGER2 ///< Label of request task. -#define REQ_EVENT NRF_EGU_EVENT_TRIGGERED2 ///< Label of request event. - -#define RAW_LENGTH_OFFSET 0 -#define RAW_PAYLOAD_OFFSET 1 - -/// Types of notifications in notification queue. -typedef enum -{ - NTF_TYPE_RECEIVED, ///< Frame received - NTF_TYPE_RECEIVE_FAILED, ///< Frame reception failed - NTF_TYPE_TRANSMITTED, ///< Frame transmitted - NTF_TYPE_TRANSMIT_FAILED, ///< Frame transmission failure - NTF_TYPE_ENERGY_DETECTED, ///< Energy detection procedure ended - NTF_TYPE_ENERGY_DETECTION_FAILED, ///< Energy detection procedure failed - NTF_TYPE_CCA, ///< CCA procedure ended - NTF_TYPE_CCA_FAILED, ///< CCA procedure failed -} nrf_802154_ntf_type_t; - -/// Notification data in the notification queue. -typedef struct -{ - nrf_802154_ntf_type_t type; ///< Notification type. - - union - { - struct - { - uint8_t * p_data; ///< Pointer to a buffer containing PHR and PSDU of the received frame. - int8_t power; ///< RSSI of received frame. - uint8_t lqi; ///< LQI of received frame. - } received; ///< Received frame details. - - struct - { - nrf_802154_rx_error_t error; ///< An error code that indicates reason of the failure. - } receive_failed; - - struct - { - const uint8_t * p_frame; ///< Pointer to frame that was transmitted. - uint8_t * p_data; ///< Pointer to a buffer containing PHR and PSDU of the received ACK or NULL. - int8_t power; ///< RSSI of received ACK or 0. - uint8_t lqi; ///< LQI of received ACK or 0. - } transmitted; ///< Transmitted frame details. - - struct - { - const uint8_t * p_frame; ///< Pointer to frame that was requested to be transmitted, but failed. - nrf_802154_tx_error_t error; ///< An error code that indicates reason of the failure. - } transmit_failed; - - struct - { - int8_t result; ///< Energy detection result. - } energy_detected; ///< Energy detection details. - - struct - { - nrf_802154_ed_error_t error; ///< An error code that indicates reason of the failure. - } energy_detection_failed; ///< Energy detection failure details. - - struct - { - bool result; ///< CCA result. - } cca; ///< CCA details. - - struct - { - nrf_802154_cca_error_t error; ///< An error code that indicates reason of the failure. - } cca_failed; ///< CCA failure details. - } data; ///< Notification data depending on it's type. -} nrf_802154_ntf_data_t; - -/// Type of requests in request queue. -typedef enum -{ - REQ_TYPE_SLEEP, - REQ_TYPE_RECEIVE, - REQ_TYPE_TRANSMIT, - REQ_TYPE_ENERGY_DETECTION, - REQ_TYPE_CCA, - REQ_TYPE_CONTINUOUS_CARRIER, - REQ_TYPE_BUFFER_FREE, - REQ_TYPE_CHANNEL_UPDATE, - REQ_TYPE_CCA_CFG_UPDATE, - REQ_TYPE_RSSI_MEASURE, - REQ_TYPE_RSSI_GET, -} nrf_802154_req_type_t; - -/// Request data in request queue. -typedef struct -{ - nrf_802154_req_type_t type; ///< Type of the request. - - union - { - struct - { - nrf_802154_term_t term_lvl; ///< Request priority. - bool * p_result; ///< Sleep request result. - } sleep; ///< Sleep request details. - - struct - { - nrf_802154_notification_func_t notif_func; ///< Error notified in case of success. - nrf_802154_term_t term_lvl; ///< Request priority. - req_originator_t req_orig; ///< Request originator. - bool notif_abort; ///< If function termination should be notified. - bool * p_result; ///< Receive request result. - } receive; ///< Receive request details. - - struct - { - nrf_802154_notification_func_t notif_func; ///< Error notified in case of success. - nrf_802154_term_t term_lvl; ///< Request priority. - req_originator_t req_orig; ///< Request originator. - const uint8_t * p_data; ///< Pointer to a buffer containing PHR and PSDU of the frame to transmit. - bool cca; ///< If CCA was requested prior to transmission. - bool immediate; ///< If TX procedure must be performed immediately. - bool * p_result; ///< Transmit request result. - } transmit; ///< Transmit request details. - - struct - { - nrf_802154_term_t term_lvl; ///< Request priority. - bool * p_result; ///< Energy detection request result. - uint32_t time_us; ///< Requested time of energy detection procedure. - } energy_detection; ///< Energy detection request details. - - struct - { - nrf_802154_term_t term_lvl; ///< Request priority. - bool * p_result; ///< CCA request result. - } cca; ///< CCA request details. - - struct - { - nrf_802154_term_t term_lvl; ///< Request priority. - bool * p_result; ///< Continuous carrier request result. - } continuous_carrier; ///< Continuous carrier request details. - - struct - { - uint8_t * p_data; ///< Pointer to receive buffer to free. - bool * p_result; ///< Buffer free request result. - } buffer_free; ///< Buffer free request details. - - struct - { - bool * p_result; ///< Channel update request result. - } channel_update; ///< Channel update request details. - - struct - { - bool * p_result; ///< CCA config update request result. - } cca_cfg_update; ///< CCA config update request details. - - struct - { - bool * p_result; ///< RSSI measurement request result. - } rssi_measure; ///< RSSI measurement request details. - - struct - { - int8_t * p_rssi; ///< RSSI measurement result. - bool * p_result; ///< RSSI measurement status. - } rssi_get; ///< Details of the getter that retrieves the RSSI measurement result. - } data; ///< Request data depending on its type. -} nrf_802154_req_data_t; - -static nrf_802154_ntf_data_t m_ntf_queue[NTF_QUEUE_SIZE]; ///< Notification queue. -static uint8_t m_ntf_r_ptr; ///< Notification queue read index. -static uint8_t m_ntf_w_ptr; ///< Notification queue write index. - -static nrf_802154_req_data_t m_req_queue[REQ_QUEUE_SIZE]; ///< Request queue. -static uint8_t m_req_r_ptr; ///< Request queue read index. -static uint8_t m_req_w_ptr; ///< Request queue write index. - -/** - * Increment given index for any queue. - * - * @param[inout] p_ptr Index to increment. - * @param[in] queue_size Number of elements in the queue. - */ -static void queue_ptr_increment(uint8_t * p_ptr, uint8_t queue_size) -{ - if (++(*p_ptr) >= queue_size) - { - *p_ptr = 0; - } -} - -/** - * Check if given queue is full. - * - * @param[in] r_ptr Read index associated with given queue. - * @param[in] w_ptr Write index associated with given queue. - * @param[in] queue_size Number of elements in the queue. - * - * @retval true Given queue is full. - * @retval false Given queue is not full. - */ -static bool queue_is_full(uint8_t r_ptr, uint8_t w_ptr, uint8_t queue_size) -{ - if (w_ptr == (r_ptr - 1)) - { - return true; - } - - if ((r_ptr == 0) && (w_ptr == queue_size - 1)) - { - return true; - } - - return false; -} - -/** - * Check if given queue is empty. - * - * @param[in] r_ptr Read index associated with given queue. - * @param[in] w_ptr Write index associated with given queue. - * - * @retval true Given queue is empty. - * @retval false Given queue is not empty. - */ -static bool queue_is_empty(uint8_t r_ptr, uint8_t w_ptr) -{ - return (r_ptr == w_ptr); -} - -/** - * Increment given index associated with notification queue. - * - * @param[inout] p_ptr Pointer to the index to increment. - */ -static void ntf_queue_ptr_increment(uint8_t * p_ptr) -{ - queue_ptr_increment(p_ptr, NTF_QUEUE_SIZE); -} - -/** - * Check if notification queue is full. - * - * @retval true Notification queue is full. - * @retval false Notification queue is not full. - */ -static bool ntf_queue_is_full(void) -{ - return queue_is_full(m_ntf_r_ptr, m_ntf_w_ptr, NTF_QUEUE_SIZE); -} - -/** - * Check if notification queue is empty. - * - * @retval true Notification queue is empty. - * @retval false Notification queue is not empty. - */ -static bool ntf_queue_is_empty(void) -{ - return queue_is_empty(m_ntf_r_ptr, m_ntf_w_ptr); -} - -/** - * Enter notify block. - * - * This is a helper function used in all notification functions to atomically - * find an empty slot in the notification queue and allow atomic slot update. - * - * @return Pointer to an empty slot in the notification queue. - */ -static nrf_802154_ntf_data_t * ntf_enter(void) -{ - __disable_irq(); - __DSB(); - __ISB(); - - assert(!ntf_queue_is_full()); - (void)ntf_queue_is_full(); - - return &m_ntf_queue[m_ntf_w_ptr]; -} - -/** - * Exit notify block. - * - * This is a helper function used in all notification functions to end atomic slot update - * and trigger SWI to process the notification from the slot. - */ -static void ntf_exit(void) -{ - ntf_queue_ptr_increment(&m_ntf_w_ptr); - - nrf_egu_task_trigger(SWI_EGU, NTF_TASK); - - __enable_irq(); -} - -/** - * Increment given index associated with request queue. - * - * @param[inout] p_ptr Pointer to the index to increment. - */ -static void req_queue_ptr_increment(uint8_t * p_ptr) -{ - queue_ptr_increment(p_ptr, REQ_QUEUE_SIZE); -} - -/** - * Check if request queue is full. - * - * @retval true Request queue is full. - * @retval false Request queue is not full. - */ -static bool req_queue_is_full(void) -{ - return queue_is_full(m_req_r_ptr, m_req_w_ptr, REQ_QUEUE_SIZE); -} - -/** - * Check if request queue is empty. - * - * @retval true Request queue is empty. - * @retval false Request queue is not empty. - */ -static bool req_queue_is_empty(void) -{ - return queue_is_empty(m_req_r_ptr, m_req_w_ptr); -} - -/** - * Enter request block. - * - * This is a helper function used in all request functions to atomically - * find an empty slot in request queue and allow atomic slot update. - * - * @return Pointer to an empty slot in the request queue. - */ -static nrf_802154_req_data_t * req_enter(void) -{ - __disable_irq(); - __DSB(); - __ISB(); - - assert(!req_queue_is_full()); - (void)req_queue_is_full(); - - return &m_req_queue[m_req_w_ptr]; -} - -/** - * Exit request block. - * - * This is a helper function used in all request functions to end atomic slot update - * and trigger SWI to process the request from the slot. - */ -static void req_exit(void) -{ - req_queue_ptr_increment(&m_req_w_ptr); - - nrf_egu_task_trigger(SWI_EGU, REQ_TASK); - - __enable_irq(); - __DSB(); - __ISB(); -} - -void nrf_802154_swi_init(void) -{ - m_ntf_r_ptr = 0; - m_ntf_w_ptr = 0; - - nrf_egu_int_enable(SWI_EGU, NTF_INT | HFCLK_STOP_INT | REQ_INT); - -#if !NRF_IS_IRQ_PRIORITY_ALLOWED(NRF_802154_SWI_PRIORITY) -#error NRF_802154_SWI_PRIORITY value out of the allowed range. -#endif - NVIC_SetPriority(SWI_IRQn, NRF_802154_SWI_PRIORITY); - NVIC_ClearPendingIRQ(SWI_IRQn); - NVIC_EnableIRQ(SWI_IRQn); -} - -void nrf_802154_swi_notify_received(uint8_t * p_data, int8_t power, uint8_t lqi) -{ - nrf_802154_ntf_data_t * p_slot = ntf_enter(); - - p_slot->type = NTF_TYPE_RECEIVED; - p_slot->data.received.p_data = p_data; - p_slot->data.received.power = power; - p_slot->data.received.lqi = lqi; - - ntf_exit(); -} - -void nrf_802154_swi_notify_receive_failed(nrf_802154_rx_error_t error) -{ - nrf_802154_ntf_data_t * p_slot = ntf_enter(); - - p_slot->type = NTF_TYPE_RECEIVE_FAILED; - p_slot->data.receive_failed.error = error; - - ntf_exit(); -} - -void nrf_802154_swi_notify_transmitted(const uint8_t * p_frame, - uint8_t * p_data, - int8_t power, - uint8_t lqi) -{ - nrf_802154_ntf_data_t * p_slot = ntf_enter(); - - p_slot->type = NTF_TYPE_TRANSMITTED; - p_slot->data.transmitted.p_frame = p_frame; - p_slot->data.transmitted.p_data = p_data; - p_slot->data.transmitted.power = power; - p_slot->data.transmitted.lqi = lqi; - - ntf_exit(); -} - -void nrf_802154_swi_notify_transmit_failed(const uint8_t * p_frame, nrf_802154_tx_error_t error) -{ - nrf_802154_ntf_data_t * p_slot = ntf_enter(); - - p_slot->type = NTF_TYPE_TRANSMIT_FAILED; - p_slot->data.transmit_failed.p_frame = p_frame; - p_slot->data.transmit_failed.error = error; - - ntf_exit(); -} - -void nrf_802154_swi_notify_energy_detected(uint8_t result) -{ - nrf_802154_ntf_data_t * p_slot = ntf_enter(); - - p_slot->type = NTF_TYPE_ENERGY_DETECTED; - p_slot->data.energy_detected.result = result; - - ntf_exit(); -} - -void nrf_802154_swi_notify_energy_detection_failed(nrf_802154_ed_error_t error) -{ - nrf_802154_ntf_data_t * p_slot = ntf_enter(); - - p_slot->type = NTF_TYPE_ENERGY_DETECTION_FAILED; - p_slot->data.energy_detection_failed.error = error; - - ntf_exit(); -} - -void nrf_802154_swi_notify_cca(bool channel_free) -{ - nrf_802154_ntf_data_t * p_slot = ntf_enter(); - - p_slot->type = NTF_TYPE_CCA; - p_slot->data.cca.result = channel_free; - - ntf_exit(); -} - -void nrf_802154_swi_notify_cca_failed(nrf_802154_cca_error_t error) -{ - nrf_802154_ntf_data_t * p_slot = ntf_enter(); - - p_slot->type = NTF_TYPE_CCA_FAILED; - p_slot->data.cca_failed.error = error; - - ntf_exit(); -} - -void nrf_802154_swi_hfclk_stop(void) -{ - assert(!nrf_egu_event_check(SWI_EGU, HFCLK_STOP_EVENT)); - - nrf_egu_task_trigger(SWI_EGU, HFCLK_STOP_TASK); -} - -void nrf_802154_swi_hfclk_stop_terminate(void) -{ - nrf_egu_event_clear(SWI_EGU, HFCLK_STOP_EVENT); -} - -void nrf_802154_swi_sleep(nrf_802154_term_t term_lvl, bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_SLEEP; - p_slot->data.sleep.term_lvl = term_lvl; - p_slot->data.sleep.p_result = p_result; - - req_exit(); -} - -void nrf_802154_swi_receive(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - nrf_802154_notification_func_t notify_function, - bool notify_abort, - bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_RECEIVE; - p_slot->data.receive.term_lvl = term_lvl; - p_slot->data.receive.req_orig = req_orig; - p_slot->data.receive.notif_func = notify_function; - p_slot->data.receive.notif_abort = notify_abort; - p_slot->data.receive.p_result = p_result; - - req_exit(); -} - -void nrf_802154_swi_transmit(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - const uint8_t * p_data, - bool cca, - bool immediate, - nrf_802154_notification_func_t notify_function, - bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_TRANSMIT; - p_slot->data.transmit.term_lvl = term_lvl; - p_slot->data.transmit.req_orig = req_orig; - p_slot->data.transmit.p_data = p_data; - p_slot->data.transmit.cca = cca; - p_slot->data.transmit.immediate = immediate; - p_slot->data.transmit.notif_func = notify_function; - p_slot->data.transmit.p_result = p_result; - - req_exit(); -} - -void nrf_802154_swi_energy_detection(nrf_802154_term_t term_lvl, - uint32_t time_us, - bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_ENERGY_DETECTION; - p_slot->data.energy_detection.term_lvl = term_lvl; - p_slot->data.energy_detection.time_us = time_us; - p_slot->data.energy_detection.p_result = p_result; - - req_exit(); -} - -void nrf_802154_swi_cca(nrf_802154_term_t term_lvl, bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_CCA; - p_slot->data.cca.term_lvl = term_lvl; - p_slot->data.cca.p_result = p_result; - - req_exit(); -} - -void nrf_802154_swi_continuous_carrier(nrf_802154_term_t term_lvl, bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_CONTINUOUS_CARRIER; - p_slot->data.continuous_carrier.term_lvl = term_lvl; - p_slot->data.continuous_carrier.p_result = p_result; - - req_exit(); -} - -void nrf_802154_swi_buffer_free(uint8_t * p_data, bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_BUFFER_FREE; - p_slot->data.buffer_free.p_data = p_data; - p_slot->data.buffer_free.p_result = p_result; - - req_exit(); -} - -void nrf_802154_swi_channel_update(bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_CHANNEL_UPDATE; - p_slot->data.channel_update.p_result = p_result; - - req_exit(); -} - -void nrf_802154_swi_cca_cfg_update(bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_CCA_CFG_UPDATE; - p_slot->data.cca_cfg_update.p_result = p_result; - - req_exit(); -} - -void nrf_802154_swi_rssi_measure(bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_RSSI_MEASURE; - p_slot->data.rssi_measure.p_result = p_result; - - req_exit(); -} - -void nrf_802154_swi_rssi_measurement_get(int8_t * p_rssi, bool * p_result) -{ - nrf_802154_req_data_t * p_slot = req_enter(); - - p_slot->type = REQ_TYPE_RSSI_GET; - p_slot->data.rssi_get.p_rssi = p_rssi; - p_slot->data.rssi_get.p_result = p_result; - - req_exit(); -} - -void SWI_IRQHandler(void) -{ - if (nrf_egu_event_check(SWI_EGU, NTF_EVENT)) - { - nrf_egu_event_clear(SWI_EGU, NTF_EVENT); - - while (!ntf_queue_is_empty()) - { - nrf_802154_ntf_data_t * p_slot = &m_ntf_queue[m_ntf_r_ptr]; - - switch (p_slot->type) - { - case NTF_TYPE_RECEIVED: -#if NRF_802154_USE_RAW_API - nrf_802154_received_raw(p_slot->data.received.p_data, - p_slot->data.received.power, - p_slot->data.received.lqi); -#else // NRF_802154_USE_RAW_API - nrf_802154_received(p_slot->data.received.p_data + RAW_PAYLOAD_OFFSET, - p_slot->data.received.p_data[RAW_LENGTH_OFFSET], - p_slot->data.received.power, - p_slot->data.received.lqi); -#endif - break; - - case NTF_TYPE_RECEIVE_FAILED: - nrf_802154_receive_failed(p_slot->data.receive_failed.error); - break; - - case NTF_TYPE_TRANSMITTED: -#if NRF_802154_USE_RAW_API - nrf_802154_transmitted_raw(p_slot->data.transmitted.p_frame, - p_slot->data.transmitted.p_data, - p_slot->data.transmitted.power, - p_slot->data.transmitted.lqi); -#else // NRF_802154_USE_RAW_API - nrf_802154_transmitted(p_slot->data.transmitted.p_frame + RAW_PAYLOAD_OFFSET, - p_slot->data.transmitted.p_data == NULL ? NULL : - p_slot->data.transmitted.p_data + RAW_PAYLOAD_OFFSET, - p_slot->data.transmitted.p_data[RAW_LENGTH_OFFSET], - p_slot->data.transmitted.power, - p_slot->data.transmitted.lqi); -#endif - break; - - case NTF_TYPE_TRANSMIT_FAILED: -#if NRF_802154_USE_RAW_API - nrf_802154_transmit_failed(p_slot->data.transmit_failed.p_frame, - p_slot->data.transmit_failed.error); -#else // NRF_802154_USE_RAW_API - nrf_802154_transmit_failed( - p_slot->data.transmit_failed.p_frame + RAW_PAYLOAD_OFFSET, - p_slot->data.transmit_failed.error); -#endif - break; - - case NTF_TYPE_ENERGY_DETECTED: - nrf_802154_energy_detected(p_slot->data.energy_detected.result); - break; - - case NTF_TYPE_ENERGY_DETECTION_FAILED: - nrf_802154_energy_detection_failed( - p_slot->data.energy_detection_failed.error); - break; - - case NTF_TYPE_CCA: - nrf_802154_cca_done(p_slot->data.cca.result); - break; - - case NTF_TYPE_CCA_FAILED: - nrf_802154_cca_failed(p_slot->data.cca_failed.error); - break; - - default: - assert(false); - } - - ntf_queue_ptr_increment(&m_ntf_r_ptr); - } - } - - if (nrf_egu_event_check(SWI_EGU, HFCLK_STOP_EVENT)) - { - nrf_802154_clock_hfclk_stop(); - - nrf_egu_event_clear(SWI_EGU, HFCLK_STOP_EVENT); - } - - if (nrf_egu_event_check(SWI_EGU, REQ_EVENT)) - { - nrf_egu_event_clear(SWI_EGU, REQ_EVENT); - - while (!req_queue_is_empty()) - { - nrf_802154_req_data_t * p_slot = &m_req_queue[m_req_r_ptr]; - - switch (p_slot->type) - { - case REQ_TYPE_SLEEP: - *(p_slot->data.sleep.p_result) = - nrf_802154_core_sleep(p_slot->data.sleep.term_lvl); - break; - - case REQ_TYPE_RECEIVE: - *(p_slot->data.receive.p_result) = - nrf_802154_core_receive(p_slot->data.receive.term_lvl, - p_slot->data.receive.req_orig, - p_slot->data.receive.notif_func, - p_slot->data.receive.notif_abort); - break; - - case REQ_TYPE_TRANSMIT: - *(p_slot->data.transmit.p_result) = - nrf_802154_core_transmit(p_slot->data.transmit.term_lvl, - p_slot->data.transmit.req_orig, - p_slot->data.transmit.p_data, - p_slot->data.transmit.cca, - p_slot->data.transmit.immediate, - p_slot->data.transmit.notif_func); - break; - - case REQ_TYPE_ENERGY_DETECTION: - *(p_slot->data.energy_detection.p_result) = - nrf_802154_core_energy_detection( - p_slot->data.energy_detection.term_lvl, - p_slot->data.energy_detection.time_us); - break; - - case REQ_TYPE_CCA: - *(p_slot->data.cca.p_result) = nrf_802154_core_cca(p_slot->data.cca.term_lvl); - break; - - case REQ_TYPE_CONTINUOUS_CARRIER: - *(p_slot->data.continuous_carrier.p_result) = - nrf_802154_core_continuous_carrier( - p_slot->data.continuous_carrier.term_lvl); - break; - - case REQ_TYPE_BUFFER_FREE: - *(p_slot->data.buffer_free.p_result) = - nrf_802154_core_notify_buffer_free(p_slot->data.buffer_free.p_data); - break; - - case REQ_TYPE_CHANNEL_UPDATE: - *(p_slot->data.channel_update.p_result) = nrf_802154_core_channel_update(); - break; - - case REQ_TYPE_CCA_CFG_UPDATE: - *(p_slot->data.cca_cfg_update.p_result) = nrf_802154_core_cca_cfg_update(); - break; - - case REQ_TYPE_RSSI_MEASURE: - *(p_slot->data.rssi_measure.p_result) = nrf_802154_core_rssi_measure(); - break; - - case REQ_TYPE_RSSI_GET: - *(p_slot->data.rssi_get.p_result) = - nrf_802154_core_last_rssi_measurement_get(p_slot->data.rssi_get.p_rssi); - break; - - default: - assert(false); - } - - req_queue_ptr_increment(&m_req_r_ptr); - } - } -} diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.h deleted file mode 100644 index e96f92510..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_swi.h +++ /dev/null @@ -1,263 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_SWI_H__ -#define NRF_802154_SWI_H__ - -#include -#include - -#include "nrf_802154.h" -#include "nrf_802154_const.h" -#include "nrf_802154_notification.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_swi 802.15.4 driver SWI management - * @{ - * @ingroup nrf_802154 - * @brief SWI manager for the 802.15.4 driver. - */ - -/** - * @brief Initializes the SWI module. - */ -void nrf_802154_swi_init(void); - -/** - * @brief Notifies the next higher layer that a frame was received. - * - * The notification is triggered from the SWI priority level. - * - * @param[in] p_data Pointer to a buffer that contains PHR and PSDU of the received frame. - * @param[in] power RSSI measured during the frame reception. - * @param[in] lqi LQI that indicates the measured link quality during the frame reception. - */ -void nrf_802154_swi_notify_received(uint8_t * p_data, int8_t power, uint8_t lqi); - -/** - * @brief Notifies the next higher layer that the reception of a frame failed. - * - * @param[in] error Error code that indicates reason of the failure. - */ -void nrf_802154_swi_notify_receive_failed(nrf_802154_rx_error_t error); - -/** - * @brief Notifies the next higher layer that a frame was transmitted - * - * The notification is triggered from the SWI priority level. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the transmitted frame. - * @param[in] p_ack Pointer to a buffer that contains PHR and PSDU of ACK frame. NULL if ACK was - * not requested. - * @param[in] power RSSI of the received frame, or 0 if ACK was not requested. - * @param[in] lqi LQI of the received frame, or 0 if ACK was not requested. - */ -void nrf_802154_swi_notify_transmitted(const uint8_t * p_frame, - uint8_t * p_data, - int8_t power, - uint8_t lqi); - -/** - * @brief Notifies the next higher layer that a frame was not transmitted from the SWI priority - * level. - * - * @param[in] p_frame Pointer to a buffer that contains PHR and PSDU of the frame that failed - * the transmission. - * @param[in] error Reason of the transmission failure. - */ -void nrf_802154_swi_notify_transmit_failed(const uint8_t * p_frame, nrf_802154_tx_error_t error); - -/** - * @brief Notifies the next higher layer that the energy detection procedure ended from - * the SWI priority level. - * - * @param[in] result Detected energy level. - */ -void nrf_802154_swi_notify_energy_detected(uint8_t result); - -/** - * @brief Notifies the next higher layer that the energy detection procedure failed from - * the SWI priority level. - * - * @param[in] error Reason of the energy detection failure. - */ -void nrf_802154_swi_notify_energy_detection_failed(nrf_802154_ed_error_t error); - -/** - * @brief Notifies the next higher layer that the Clear Channel Assessment (CCA) procedure ended. - * - * The notification is triggered from the SWI priority level. - * - * @param[in] channel_free If a free channel was detected. - */ -void nrf_802154_swi_notify_cca(bool channel_free); - -/** - * @brief Notifies the next higher layer that the Clear Channel Assessment (CCA) procedure failed. - * - * The notification is triggered from the SWI priority level. - * - * @param[in] error Reason of the CCA failure. - */ -void nrf_802154_swi_notify_cca_failed(nrf_802154_cca_error_t error); - -/** - * @brief Requests a stop of the HF clock. - * - * The notification is triggered from the SWI priority level. - * - * @note This function is to be called through notification module to prevent calling it from - * the arbiter context. - */ -void nrf_802154_swi_hfclk_stop(void); - -/** - * @brief Terminates the stopping of the HF clock. - * - * @note This function terminates the stopping of the HF clock only if it has not been performed - * yet. - */ -void nrf_802154_swi_hfclk_stop_terminate(void); - -/** - * @brief Requests entering the @ref RADIO_STATE_SLEEP state from the SWI priority. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[out] p_result Result of entering the sleep state. - */ -void nrf_802154_swi_sleep(nrf_802154_term_t term_lvl, bool * p_result); - -/** - * @brief Requests entering the @ref RADIO_STATE_RX state from the SWI priority. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] req_orig Module that originates this request. - * @param[in] notify_function Function called to notify the status of the procedure. May be NULL. - * @param[in] notify_abort If abort notification should be triggered automatically. - * @param[out] p_result Result of entering the receive state. - */ -void nrf_802154_swi_receive(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - nrf_802154_notification_func_t notify_function, - bool notify_abort, - bool * p_result); - -/** - * @biref Requests entering the @ref RADIO_STATE_TX state from the SWI priority. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] req_orig Module that originates this request. - * @param[in] p_data Pointer to a buffer that contains PHR and PSDU of the frame to be - * transmitted. - * @param[in] cca If the driver should perform the CCA procedure before transmission. - * @param[in] immediate If true, the driver schedules transmission immediately or never; - * if false, the transmission may be postponed until TX preconditions - * are met. - * @param[in] notify_function Function called to notify the status of this procedure instead of - * the default notification. If NULL, the default notification - * is used. - * @param[out] p_result Result of entering the transmit state. - */ -void nrf_802154_swi_transmit(nrf_802154_term_t term_lvl, - req_originator_t req_orig, - const uint8_t * p_data, - bool cca, - bool immediate, - nrf_802154_notification_func_t notify_function, - bool * p_result); - -/** - * @brief Requests entering the @ref RADIO_STATE_ED state from the SWI priority. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[in] time_us Requested duration of the energy detection procedure. - * @param[out] p_result Result of entering the energy detection state. - */ -void nrf_802154_swi_energy_detection(nrf_802154_term_t term_lvl, - uint32_t time_us, - bool * p_result); - -/** - * @brief Requests entering the @ref RADIO_STATE_CCA state from the SWI priority. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[out] p_result Result of entering the CCA state. - */ -void nrf_802154_swi_cca(nrf_802154_term_t term_lvl, bool * p_result); - -/** - * @brief Requests entering the @ref RADIO_STATE_CONTINUOUS_CARRIER state from the SWI priority. - * - * @param[in] term_lvl Termination level of this request. Selects procedures to abort. - * @param[out] p_result Result of entering the continuous carrier state. - */ -void nrf_802154_swi_continuous_carrier(nrf_802154_term_t term_lvl, bool * p_result); - -/** - * @brief Notifies the core module that the given buffer is not used anymore and can be freed. - * - * @param[in] p_data Pointer to the buffer to be freed. - */ -void nrf_802154_swi_buffer_free(uint8_t * p_data, bool * p_result); - -/** - * @brief Notifies the core module that the next higher layer has requested a channel change. - */ -void nrf_802154_swi_channel_update(bool * p_result); - -/** - * @brief Notifies the core module that the next higher layer has requested a CCA configuration - * change. - */ -void nrf_802154_swi_cca_cfg_update(bool * p_result); - -/** - * @brief Notifies the core module that the next higher layer requested the RSSI measurement. - */ -void nrf_802154_swi_rssi_measure(bool * p_result); - -/** - * @brief Gets the last RSSI measurement result from the core module. - */ -void nrf_802154_swi_rssi_measurement_get(int8_t * p_rssi, bool * p_result); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif // NRF_802154_SWI_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_timer_coord.c b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_timer_coord.c deleted file mode 100644 index 0aaf598b5..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_timer_coord.c +++ /dev/null @@ -1,268 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements Timer Coordinator module. - * - */ - -#include "nrf_802154_timer_coord.h" - -#include -#include -#include - -#include "nrf_802154_config.h" -#include "nrf_802154_debug.h" -#include "nrf_802154_peripherals.h" -#include "platform/hp_timer/nrf_802154_hp_timer.h" -#include "platform/lp_timer/nrf_802154_lp_timer.h" - -#define DIV_ROUND_POSITIVE(n, d) (((n) + (d) / 2) / (d)) -#define DIV_ROUND_NEGATIVE(n, d) (((n) - (d) / 2) / (d)) -#define DIV_ROUND(n, d) ((((n) < 0) ^ ((d) < 0)) ? \ - DIV_ROUND_NEGATIVE(n, d) : \ - DIV_ROUND_POSITIVE(n, d)) - -#define TIME_BASE (1UL << 22) ///< Unit used to calculate PPTB (Point per Time Base). It is not equal million to speed up computations and increase precision. -#define FIRST_RESYNC_TIME TIME_BASE ///< Delay of the first resynchronization. The first resynchronization is needed to measure timers drift. -#define RESYNC_TIME (4 * TIME_BASE) ///< Delay of following resynchronizations. -#define EWMA_COEF (8) ///< Weight used in the EWMA algorithm. - -#define PPI_SYNC NRF_802154_PPI_RTC_COMPARE_TO_TIMER_CAPTURE -#define PPI_TIMESTAMP NRF_802154_PPI_TIMESTAMP_EVENT_TO_TIMER_CAPTURE -#define PPI_TIMESTAMP_GROUP NRF_802154_PPI_TIMESTAMP_GROUP - -#if NRF_802154_FRAME_TIMESTAMP_ENABLED -// Structure holding common timepoint from both timers. -typedef struct -{ - uint32_t lp_timer_time; ///< LP Timer time of common timepoint. - uint32_t hp_timer_time; ///< HP Timer time of common timepoint. -} common_timepoint_t; - -// Static variables. -static common_timepoint_t m_last_sync; ///< Common timepoint of last synchronization event. -static volatile bool m_synchronized; ///< If timers were synchronized since last start. -static bool m_drift_known; ///< If timer drift value is known. -static int32_t m_drift; ///< Drift of the HP timer relatively to the LP timer [PPTB]. - -void nrf_802154_timer_coord_init(void) -{ - uint32_t sync_event; - uint32_t sync_task; - - m_drift = 0; - m_drift_known = 0; - - nrf_802154_hp_timer_init(); - - sync_event = nrf_802154_lp_timer_sync_event_get(); - sync_task = nrf_802154_hp_timer_sync_task_get(); - - nrf_ppi_channel_endpoint_setup(PPI_SYNC, sync_event, sync_task); - nrf_ppi_channel_enable(PPI_SYNC); - - nrf_ppi_channel_include_in_group(PPI_TIMESTAMP, PPI_TIMESTAMP_GROUP); -} - -void nrf_802154_timer_coord_uninit(void) -{ - nrf_802154_hp_timer_deinit(); - - nrf_ppi_channel_disable(PPI_SYNC); - nrf_ppi_channel_endpoint_setup(PPI_SYNC, 0, 0); - - nrf_ppi_group_disable(PPI_TIMESTAMP_GROUP); - nrf_ppi_channel_and_fork_endpoint_setup(PPI_TIMESTAMP, 0, 0, 0); -} - -void nrf_802154_timer_coord_start(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TCOOR_START); - - m_synchronized = false; - nrf_802154_hp_timer_start(); - nrf_802154_hp_timer_sync_prepare(); - nrf_802154_lp_timer_sync_start_now(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TCOOR_START); -} - -void nrf_802154_timer_coord_stop(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TCOOR_STOP); - - nrf_802154_hp_timer_stop(); - nrf_802154_lp_timer_sync_stop(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TCOOR_STOP); -} - -void nrf_802154_timer_coord_timestamp_prepare(uint32_t event_addr) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TCOOR_TIMESTAMP_PREPARE); - - nrf_ppi_channel_and_fork_endpoint_setup(PPI_TIMESTAMP, - event_addr, - nrf_802154_hp_timer_timestamp_task_get(), - (uint32_t)nrf_ppi_task_group_disable_address_get( - PPI_TIMESTAMP_GROUP)); - - nrf_ppi_group_enable(PPI_TIMESTAMP_GROUP); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TCOOR_TIMESTAMP_PREPARE); -} - -bool nrf_802154_timer_coord_timestamp_get(uint32_t * p_timestamp) -{ - uint32_t hp_timestamp; - uint32_t hp_delta; - int32_t drift; - bool result = false; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TCOOR_TIMESTAMP_GET); - assert(p_timestamp != NULL); - - if (m_synchronized) - { - hp_timestamp = nrf_802154_hp_timer_timestamp_get(); - hp_delta = hp_timestamp - m_last_sync.hp_timer_time; - drift = m_drift_known ? - (DIV_ROUND(((int64_t)m_drift * hp_delta), ((int64_t)TIME_BASE + m_drift))) : - 0; - *p_timestamp = m_last_sync.lp_timer_time + hp_delta - drift; - result = true; - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TCOOR_TIMESTAMP_GET); - return result; -} - -void nrf_802154_lp_timer_synchronized(void) -{ - common_timepoint_t sync_time; - uint32_t lp_delta; - uint32_t hp_delta; - int32_t timers_diff; - int32_t drift; - int32_t tb_fraction_of_lp_delta; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TCOOR_SYNCHRONIZED); - - if (nrf_802154_hp_timer_sync_time_get(&sync_time.hp_timer_time)) - { - sync_time.lp_timer_time = nrf_802154_lp_timer_sync_time_get(); - - // Calculate timers drift - if (m_synchronized) - { - lp_delta = sync_time.lp_timer_time - m_last_sync.lp_timer_time; - hp_delta = sync_time.hp_timer_time - m_last_sync.hp_timer_time; - tb_fraction_of_lp_delta = DIV_ROUND_POSITIVE(lp_delta, TIME_BASE); - timers_diff = hp_delta - lp_delta; - drift = DIV_ROUND(timers_diff, tb_fraction_of_lp_delta); // Drift in PPTB - - if (m_drift_known) - { - m_drift = DIV_ROUND((m_drift * (EWMA_COEF - 1) + drift), EWMA_COEF); - } - else - { - m_drift = drift; - } - - m_drift_known = true; - } - - /* To avoid possible race when nrf_802154_timer_coord_timestamp_get - * is called when m_last_sync is being assigned report that we are not synchronized - * during assignment. - * This is naive solution that can be improved if needed with double buffering. - */ - m_synchronized = false; - __DMB(); - m_last_sync = sync_time; - __DMB(); - m_synchronized = true; - - nrf_802154_hp_timer_sync_prepare(); - nrf_802154_lp_timer_sync_start_at(m_last_sync.lp_timer_time, - m_drift_known ? RESYNC_TIME : FIRST_RESYNC_TIME); - } - else - { - nrf_802154_hp_timer_sync_prepare(); - nrf_802154_lp_timer_sync_start_now(); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TCOOR_SYNCHRONIZED); -} - -#else // NRF_802154_FRAME_TIMESTAMP_ENABLED - -void nrf_802154_timer_coord_init(void) -{ - // Intentionally empty -} - -void nrf_802154_timer_coord_uninit(void) -{ - // Intentionally empty -} - -void nrf_802154_timer_coord_start(void) -{ - // Intentionally empty -} - -void nrf_802154_timer_coord_stop(void) -{ - // Intentionally empty -} - -void nrf_802154_timer_coord_timestamp_prepare(uint32_t event_addr) -{ - (void)event_addr; - - // Intentionally empty -} - -bool nrf_802154_timer_coord_timestamp_get(uint32_t * p_timestamp) -{ - (void)p_timestamp; - - // Intentionally empty - - return false; -} - -#endif // NRF_802154_FRAME_TIMESTAMP_ENABLED diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_timer_coord.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_timer_coord.h deleted file mode 100644 index c7f875483..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_timer_coord.h +++ /dev/null @@ -1,117 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that defines the Timer Coordinator interface. - * - */ - -#ifndef NRF_802154_TIMER_COORD_H_ -#define NRF_802154_TIMER_COORD_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_timer_coord Timer Coordinator - * @{ - * @ingroup nrf_802154 - * @brief The Timer Coordinator interface. - * - * Timer Coordinator is responsible for synchronizing and coordinating operations of the Low Power - * timer that counts the absolute time and the High Precision timer that counts the time relative to - * a timeslot. - */ - -/** - * @brief Initializes the Timer Coordinator module. - * - */ -void nrf_802154_timer_coord_init(void); - -/** - * @brief Deinitializes the Timer Coordinator module. - * - */ -void nrf_802154_timer_coord_uninit(void); - -/** - * @brief Starts the Timer Coordinator module. - * - * This function starts the HP timer and synchronizes it with the LP timer. - * - * Once started, Timer Coordinator resynchronizes automatically in a constant interval. - */ -void nrf_802154_timer_coord_start(void); - -/** - * @brief Stops the Timer Coordinator module. - * - * This function stops the HP timer. - */ -void nrf_802154_timer_coord_stop(void); - -/** - * @brief Prepares for getting a precise timestamp of the given event. - * - * @param[in] event_addr Address of the peripheral register corresponding to the event that - * is to be time-stamped. - */ -void nrf_802154_timer_coord_timestamp_prepare(uint32_t event_addr); - -/** - * @brief Gets the timestamp of the recently prepared event. - * - * If the recently prepared event occurred a few times since the preparation, this function returns - * the timestamp of the first occurrence. - * If the requested event did not occur since the preparation or the HP timer is not synchronized, - * this function returns false. - * - * @param[out] p_timestamp Precise absolute timestamp of the recently prepared event, - * in microseconds (us). - * - * @retval true Timestamp is available. - * @retval false Timestamp is unavailable. - */ -bool nrf_802154_timer_coord_timestamp_get(uint32_t * p_timestamp); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_TIMER_COORD_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_types.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_types.h deleted file mode 100644 index 202c346dd..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_types.h +++ /dev/null @@ -1,168 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_TYPES_H__ -#define NRF_802154_TYPES_H__ - -#include - -#include "nrf_radio.h" - -/** - * @defgroup nrf_802154_types Type definitions used in the 802.15.4 driver - * @{ - * @ingroup nrf_802154 - * @brief Definitions of types used in the 802.15.4 driver. - */ - -/** - * @brief States of the driver. - */ -typedef uint8_t nrf_802154_state_t; - -#define NRF_802154_STATE_INVALID 0x01 // !< Radio in an invalid state. -#define NRF_802154_STATE_SLEEP 0x02 // !< Radio in the sleep state. -#define NRF_802154_STATE_RECEIVE 0x03 // !< Radio in the receive state. -#define NRF_802154_STATE_TRANSMIT 0x04 // !< Radio in the transmit state. -#define NRF_802154_STATE_ENERGY_DETECTION 0x05 // !< Radio in the energy detection state. -#define NRF_802154_STATE_CCA 0x06 // !< Radio in the CCA state. -#define NRF_802154_STATE_CONTINUOUS_CARRIER 0x07 // !< Radio in the continuous carrier state. - -/** - * @brief Errors reported during the frame transmission. - */ -typedef uint8_t nrf_802154_tx_error_t; - -#define NRF_802154_TX_ERROR_NONE 0x00 // !< There is no transmit error. -#define NRF_802154_TX_ERROR_BUSY_CHANNEL 0x01 // !< CCA reported busy channel before the transmission. -#define NRF_802154_TX_ERROR_INVALID_ACK 0x02 // !< Received ACK frame is other than expected. -#define NRF_802154_TX_ERROR_NO_MEM 0x03 // !< No receive buffer is available to receive an ACK. -#define NRF_802154_TX_ERROR_TIMESLOT_ENDED 0x04 // !< Radio timeslot ended during the transmission procedure. -#define NRF_802154_TX_ERROR_NO_ACK 0x05 // !< ACK frame was not received during the timeout period. -#define NRF_802154_TX_ERROR_ABORTED 0x06 // !< Procedure was aborted by another operation. -#define NRF_802154_TX_ERROR_TIMESLOT_DENIED 0x07 // !< Transmission did not start due to a denied timeslot request. - -/** - * @brief Possible errors during the frame reception. - */ -typedef uint8_t nrf_802154_rx_error_t; - -#define NRF_802154_RX_ERROR_NONE 0x00 // !< There is no receive error. -#define NRF_802154_RX_ERROR_INVALID_FRAME 0x01 // !< Received a malformed frame. -#define NRF_802154_RX_ERROR_INVALID_FCS 0x02 // !< Received a frame with an invalid checksum. -#define NRF_802154_RX_ERROR_INVALID_DEST_ADDR 0x03 // !< Received a frame with a mismatched destination address. -#define NRF_802154_RX_ERROR_RUNTIME 0x04 // !< Runtime error occurred (for example, CPU was held for too long). -#define NRF_802154_RX_ERROR_TIMESLOT_ENDED 0x05 // !< Radio timeslot ended during the frame reception. -#define NRF_802154_RX_ERROR_ABORTED 0x06 // !< Procedure was aborted by another operation. -#define NRF_802154_RX_ERROR_DELAYED_TIMESLOT_DENIED 0x07 // !< Delayed reception request was rejected due to a denied timeslot request. -#define NRF_802154_RX_ERROR_DELAYED_TIMEOUT 0x08 // !< Delayed reception timeslot ended. -#define NRF_802154_RX_ERROR_INVALID_LENGTH 0x09 // !< Received a frame with invalid length. -#define NRF_802154_RX_ERROR_DELAYED_ABORTED 0x0A // !< Delayed operation in the ongoing state was aborted by other request. - -/** - * @brief Possible errors during the energy detection. - */ -typedef uint8_t nrf_802154_ed_error_t; - -#define NRF_802154_ED_ERROR_ABORTED 0x01 // !< Procedure was aborted by another operation. - -/** - * @brief Possible errors during the CCA procedure. - */ -typedef uint8_t nrf_802154_cca_error_t; - -#define NRF_802154_CCA_ERROR_ABORTED 0x01 // !< Procedure was aborted by another operation. - -/** - * @brief Possible errors during sleep procedure call. - */ -typedef uint8_t nrf_802154_sleep_error_t; - -#define NRF_802154_SLEEP_ERROR_NONE 0x00 // !< There is no error. -#define NRF_802154_SLEEP_ERROR_BUSY 0x01 // !< The driver cannot enter the sleep state due to the ongoing operation. - -/** - * @brief Termination level selected for a particular request. - * - * Each request can terminate an ongoing operation. This type selects which operation should be - * aborted by a given request. - */ -typedef uint8_t nrf_802154_term_t; - -#define NRF_802154_TERM_NONE 0x00 // !< Request is skipped if another operation is ongoing. -#define NRF_802154_TERM_802154 0x01 // !< Request terminates the ongoing 802.15.4 operation. - -/** - * @brief Structure for configuring CCA. - */ -typedef struct -{ - nrf_radio_cca_mode_t mode; // !< CCA mode. - uint8_t ed_threshold; // !< Busy threshold of the CCA energy. Not used in NRF_RADIO_CCA_MODE_CARRIER. - uint8_t corr_threshold; // !< Busy threshold of the CCA correlator. Not used in NRF_RADIO_CCA_MODE_ED. - uint8_t corr_limit; // !< Limit of occurrences above the busy threshold of the CCA correlator. Not used in NRF_RADIO_CCA_MODE_ED. -} nrf_802154_cca_cfg_t; - -/** - * @brief Types of data that can be set in an ACK message. - */ -typedef uint8_t nrf_802154_ack_data_t; - -#define NRF_802154_ACK_DATA_PENDING_BIT 0x00 -#define NRF_802154_ACK_DATA_IE 0x01 - -/** - * @brief Methods of source address matching. - * - * You can use one of the following methods that can be set during the initialization phase - * by calling @ref nrf_802154_src_matching_method: - * - For Thread: @ref NRF_802154_SRC_ADDR_MATCH_THREAD -- The pending bit is set only for the addresses found in the list. - * - For Zigbee: @ref NRF_802154_SRC_ADDR_MATCH_ZIGBEE -- The pending bit is cleared only for the short addresses found in the list.\n - * This method does not set pending bit in non-command and non-data-request frames. - * - For standard-compliant implementation: @ref NRF_802154_SRC_ADDR_MATCH_ALWAYS_1 -- The pending bit is always set to 1.\n - * This requires an empty data frame with AR set to 0 to be transmitted immediately afterwards. - */ -typedef uint8_t nrf_802154_src_addr_match_t; - -#define NRF_802154_SRC_ADDR_MATCH_THREAD 0x00 // !< Implementation for the Thread protocol. -#define NRF_802154_SRC_ADDR_MATCH_ZIGBEE 0x01 // !< Implementation for the Zigbee protocol. -#define NRF_802154_SRC_ADDR_MATCH_ALWAYS_1 0x02 // !< Standard compliant implementation. - -/** - * @brief RSSI measurement results. - */ - -#define NRF_802154_RSSI_INVALID INT8_MAX - -/** - *@} - **/ - -#endif // NRF_802154_TYPES_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_utils.h b/third_party/NordicSemiconductor/drivers/radio/nrf_802154_utils.h deleted file mode 100644 index 1820ea2b3..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/nrf_802154_utils.h +++ /dev/null @@ -1,172 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_UTILS_H__ -#define NRF_802154_UTILS_H__ - -#include -#include -#include "nrf.h" - -/** - * @defgroup nrf_802154_utils Utils definitions used in the 802.15.4 driver - * @{ - * @ingroup nrf_802154 - * @brief Definitions of utils used in the 802.15.4 driver. - */ - -/**@brief RTC clock frequency. */ -#define NRF_802154_RTC_FREQUENCY 32768UL - -/**@brief Defines the number of microseconds in one second. */ -#define NRF_802154_US_PER_S 1000000ULL - -/**@brief Number of microseconds in one RTC tick (rounded up). */ -#define NRF_802154_US_PER_TICK NRF_802154_RTC_TICKS_TO_US(1) - -/**@brief Number of bits to shift RTC_FREQUENCY and US_PER_S to achieve the division by greatest common divisor. */ -#define NRF_802154_FREQUENCY_US_PER_S_GCD_BITS 6 - -/**@brief Ceil division helper. */ -#define NRF_802154_DIVIDE_AND_CEIL(A, B) (((A) + (B)-1) / (B)) - -/**@brief Defines the conversion of RTC ticks to microseconds (us). */ -#define NRF_802154_RTC_TICKS_TO_US(ticks) \ - NRF_802154_DIVIDE_AND_CEIL( \ - (ticks) * (NRF_802154_US_PER_S >> NRF_802154_FREQUENCY_US_PER_S_GCD_BITS), \ - (NRF_802154_RTC_FREQUENCY >> NRF_802154_FREQUENCY_US_PER_S_GCD_BITS)) - -/** Checks if the given IRQ priority is within the range implemented by the MCU. */ -#define NRF_IS_IRQ_PRIORITY_ALLOWED(priority) \ - (((priority) >= 0) && ((priority) < (1U << (__NVIC_PRIO_BITS)))) - -/**@brief Macro to get the number of elements in an array. - * - * @param[in] X Array. - */ -#define NUMELTS(X) (sizeof((X)) / sizeof(X[0])) - -/**@brief Wait procedure used in a busy loop. */ -#define nrf_802154_busy_wait() __WFE() - -static inline uint64_t NRF_802154_US_TO_RTC_TICKS(uint64_t time) -{ - uint64_t t1, u1; - uint64_t result; - - /* The required range for time is [0..315360000000000], and the calculation below is - verified to work within a broader range [0...2^49 ~ 17 years]. - - This first step in the calculation is to find out how many units - of 15625 us there are in the input_us, because 512 RTC units - correspond _exactly_ to 15625 us. The desired calculation is therefore - t1 = time / 15625, but the division is slow and therefore let's calculate - t1 = time * k instead. The constant k is 1/15625, shifted up by as many bits - as possible without causing overflow during the calculation. - - 49 bits are needed to store the maximum value that time can have, and the - lowest 13 bits in that value can be shifted away because a minimum of 14 bits - are needed to store the divisor. - - This means that the time can be reduced to 49 - 13 = 36 bits to make space - for k. - - The most suitable number of shift for the value 1/15625 = 0.000064 - (binary 0.00000000000001000011000110111101111...) is 41, because that results - in a 28-bit number that does not cause overflow in the multiplication. - - ((2^41)/15625) is equal to 0x8637bd0, and is written in a hexadecimal representation - to show the bit width of the number. Shifting is limited to 41 bits because: - 1 The time uses up to 49 bits; - 2) The time can only be shifted down 13 bits to avoid shifting away - a full unit of 15625 microseconds; - 3) The maximum value of the calculation would otherwise overflow (that is, - (315360000000000 >> 13) * 0x8637bd0 = 0x4b300bfcd0aefde0 would no longer be less than - 0Xffffffffffffffff). - - There is a possible loss of precision, so that t1 will be up to 93*15625 _smaller_ - than the accurate number. This is taken into account in the next step. - */ - - t1 = ((time >> 13) * 0x8637bd0) >> 28; // ((time >> 13) * (2^41 / 15625)) >> (41 - 13) - result = t1 * 512; - t1 = time - t1 * 15625; - - /* This second step of the calculation is to find out how many RTC units there are - still left in the remaining microseconds. - - ((2^56)/15625) is equal to 0x431bde82d7b, and is written in a hexadecimal representation - to show the bit width of the number. Shifting 56 bits is determined by the worst - case value of t1. The constant is selected by using the same methodology as in the - first step of the calculation above. - - The possible loss of precision in the calculation above can make t1 93*15625 lower - than it should have been here. The worst case found is that t1 can be 1453125, and - therefore there is no overflow in the calculation - 1453125 * 0x431bde82d7b = 0x5cfffffffff76627 (that is, it is less than 0xffffffffffffffff). - - 15625 below is the binary representation of 30.51757813 (11110.100001001) - scaled up by 2^9, and the calculation below are therefore using that scale. - - Rounding up to the nearest RTC tick is done by adding the value of the least - significant bits of the fraction (that is, adding the value of bits 1..47 of the scaled - up timer unit size (2^47)) to the calculated value before scaling the final - value down to RTC ticks.*/ - - // ceil((time * (2^56 / 15625)) >> (56 - 9)) - assert(t1 <= 1453125); - u1 = (t1 * 0x431bde82d7b); // (time * (2^56 / 15625)) - u1 += 0x7fffffffffff; // round up - u1 >>= 47; // ceil(u1 >> (56 - 9)) - - result += u1; - - return result; -} - -/**@brief Checks if the provided interrupt is currently enabled. - * - * @note This function is valid only for the ARM Cortex-M4 core. - * - * @params IRQn Interrupt number. - * - * @returns Zero value if the interrupt is disabled; non-zero value otherwise. - */ -static inline uint32_t nrf_is_nvic_irq_enabled(IRQn_Type IRQn) -{ - return (NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)]) & - ((uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))); -} - -/** - *@} - **/ - -#endif // NRF_802154_UTILS_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock.h b/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock.h deleted file mode 100644 index 595c5496d..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock.h +++ /dev/null @@ -1,134 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief This module defines the Clock Abstraction Layer for the 802.15.4 driver. - * - * Clock Abstraction Layer can be used by other modules to start and stop nRF52840 clocks. - * - * It is used by the Radio Scheduler (RSCH) to start the HF clock when entering continuous mode - * and to stop the HF clock after exiting the continuous mode. - * - * It is also used by the standalone Low Power Timer Abstraction Layer implementation - * to start the LF clock during the initialization. - * - */ - -#ifndef NRF_802154_CLOCK_H_ -#define NRF_802154_CLOCK_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_clock Clock Abstraction Layer for the 802.15.4 driver - * @{ - * @ingroup nrf_802154_clock - * @brief Clock Abstraction Layer interface for the 802.15.4 driver. - * - */ - -/** - * @brief Initializes the clock driver. - */ -void nrf_802154_clock_init(void); - -/** - * @brief Deinitializes the clock driver. - */ -void nrf_802154_clock_deinit(void); - -/** - * @brief Starts the High Frequency Clock. - * - * This function is asynchronous, meant to request the ramp-up of the High Frequency Clock and exit. - * When the High Frequency Clock is ready, @ref nrf_802154_hfclk_ready() is called. - * - */ -void nrf_802154_clock_hfclk_start(void); - -/** - * @brief Stops the High Frequency Clock. - */ -void nrf_802154_clock_hfclk_stop(void); - -/** - * @brief Checks if the High Frequency Clock is running. - * - * @retval true High Frequency Clock is running. - * @retval false High Frequency Clock is not running. - * - */ -bool nrf_802154_clock_hfclk_is_running(void); - -/** - * @brief Starts the Low Frequency Clock. - * - * This function is asynchronous, meant to request the ramp-up of the Low Frequency Clock and exit. - * When the Low Frequency Clock is ready, @ref nrf_802154_lfclk_ready() is called. - * - */ -void nrf_802154_clock_lfclk_start(void); - -/** - * @brief Stops the Low Frequency Clock. - */ -void nrf_802154_clock_lfclk_stop(void); - -/** - * @brief Checks if the Low Frequency Clock is running. - * - * @retval true Low Frequency Clock is running. - * @retval false Low Frequency Clock is not running. - */ -bool nrf_802154_clock_lfclk_is_running(void); - -/** - * @brief Callback function executed when the High Frequency Clock is ready. - */ -extern void nrf_802154_clock_hfclk_ready(void); - -/** - * @brief Callback function executed when the Low Frequency Clock is ready. - */ -extern void nrf_802154_clock_lfclk_ready(void); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_CLOCK_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_nodrv.c b/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_nodrv.c deleted file mode 100644 index 011ea8efb..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_nodrv.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the nrf 802.15.4 Clock Abstraction Layer without any driver. - * - * This implementation uses directly CLOCK hardware registers. - */ - -#include "nrf_802154_clock.h" - -#include -#include - -#include "nrf_802154_config.h" -#include "nrf_802154_utils.h" - -void nrf_802154_clock_init(void) -{ - nrf_clock_lf_src_set(NRF_802154_CLOCK_LFCLK_SOURCE); - -#if !NRF_IS_IRQ_PRIORITY_ALLOWED(NRF_802154_CLOCK_IRQ_PRIORITY) -#error NRF_802154_CLOCK_IRQ_PRIORITY value out of the allowed range. -#endif - NVIC_SetPriority(POWER_CLOCK_IRQn, NRF_802154_CLOCK_IRQ_PRIORITY); - NVIC_ClearPendingIRQ(POWER_CLOCK_IRQn); - NVIC_EnableIRQ(POWER_CLOCK_IRQn); - - nrf_clock_int_enable(NRF_CLOCK_INT_HF_STARTED_MASK); - nrf_clock_int_enable(NRF_CLOCK_INT_LF_STARTED_MASK); -} - -void nrf_802154_clock_deinit(void) -{ - NVIC_DisableIRQ(POWER_CLOCK_IRQn); - NVIC_ClearPendingIRQ(POWER_CLOCK_IRQn); - - nrf_clock_int_disable(NRF_CLOCK_INT_HF_STARTED_MASK); - nrf_clock_int_disable(NRF_CLOCK_INT_LF_STARTED_MASK); -} - -void nrf_802154_clock_hfclk_start(void) -{ - nrf_clock_event_clear(NRF_CLOCK_EVENT_HFCLKSTARTED); - nrf_clock_task_trigger(NRF_CLOCK_TASK_HFCLKSTART); -} - -void nrf_802154_clock_hfclk_stop(void) -{ - nrf_clock_task_trigger(NRF_CLOCK_TASK_HFCLKSTOP); -} - -bool nrf_802154_clock_hfclk_is_running(void) -{ - return nrf_clock_hf_is_running(NRF_CLOCK_HFCLK_HIGH_ACCURACY); -} - -void nrf_802154_clock_lfclk_start(void) -{ - nrf_clock_event_clear(NRF_CLOCK_EVENT_LFCLKSTARTED); - nrf_clock_task_trigger(NRF_CLOCK_TASK_LFCLKSTART); -} - -void nrf_802154_clock_lfclk_stop(void) -{ - nrf_clock_task_trigger(NRF_CLOCK_TASK_LFCLKSTOP); -} - -bool nrf_802154_clock_lfclk_is_running(void) -{ - return nrf_clock_lf_is_running(); -} - -void POWER_CLOCK_IRQHandler(void) -{ - if (nrf_clock_event_check(NRF_CLOCK_EVENT_HFCLKSTARTED)) - { - nrf_clock_event_clear(NRF_CLOCK_EVENT_HFCLKSTARTED); - - nrf_802154_clock_hfclk_ready(); - } - - if (nrf_clock_event_check(NRF_CLOCK_EVENT_LFCLKSTARTED)) - { - nrf_clock_event_clear(NRF_CLOCK_EVENT_LFCLKSTARTED); - - nrf_802154_clock_lfclk_ready(); - } -} - -__WEAK void nrf_802154_clock_hfclk_ready(void) -{ - // Intentionally empty. -} - -__WEAK void nrf_802154_clock_lfclk_ready(void) -{ - // Intentionally empty. -} diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_ot.c b/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_ot.c deleted file mode 100644 index 8207e7f9c..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_ot.c +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the nrf 802.15.4 HF Clock abstraction with SDK driver. - * - * This implementation uses clock driver implementation from SDK. - */ - -#include "nrf_802154_clock.h" - -#include - -#include -#include - -static void clock_handler(nrf_drv_clock_evt_type_t event); - -static nrf_drv_clock_handler_item_t m_clock_handler = -{ - .p_next = NULL, - .event_handler = clock_handler, -}; - -static void clock_handler(nrf_drv_clock_evt_type_t event) -{ - if (event == NRF_DRV_CLOCK_EVT_HFCLK_STARTED) - { - nrf_802154_clock_hfclk_ready(); - } - - if (event == NRF_DRV_CLOCK_EVT_LFCLK_STARTED) - { - nrf_802154_clock_lfclk_ready(); - } -} - -void nrf_802154_clock_init(void) -{ - // Intentionally empty. -} - -void nrf_802154_clock_deinit(void) -{ - // Intentionally empty. -} - -void nrf_802154_clock_hfclk_start(void) -{ - nrf_drv_clock_hfclk_request(&m_clock_handler); -} - -void nrf_802154_clock_hfclk_stop(void) -{ - nrf_drv_clock_hfclk_release(); -} - -bool nrf_802154_clock_hfclk_is_running(void) -{ - return nrf_drv_clock_hfclk_is_running(); -} - -void nrf_802154_clock_lfclk_start(void) -{ - nrf_drv_clock_lfclk_request(&m_clock_handler); -} - -void nrf_802154_clock_lfclk_stop(void) -{ - nrf_drv_clock_lfclk_release(); -} - -bool nrf_802154_clock_lfclk_is_running(void) -{ - return nrf_drv_clock_lfclk_is_running(); -} - -__WEAK void nrf_802154_clock_hfclk_ready(void) -{ - // Intentionally empty. -} - -__WEAK void nrf_802154_clock_lfclk_ready(void) -{ - // Intentionally empty. -} - diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_sdk.c b/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_sdk.c deleted file mode 100644 index de1173fe2..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/clock/nrf_802154_clock_sdk.c +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the nrf 802.15.4 HF Clock abstraction with SDK driver. - * - * This implementation uses clock driver implementation from SDK. - */ - -#include "nrf_802154_clock.h" - -#include - -#include -#include - -static void clock_handler(nrf_drv_clock_evt_type_t event); - -static nrf_drv_clock_handler_item_t m_clock_handler = -{ - .p_next = NULL, - .event_handler = clock_handler, -}; - -static void clock_handler(nrf_drv_clock_evt_type_t event) -{ - if (event == NRF_DRV_CLOCK_EVT_HFCLK_STARTED) - { - nrf_802154_clock_hfclk_ready(); - } - - if (event == NRF_DRV_CLOCK_EVT_LFCLK_STARTED) - { - nrf_802154_clock_lfclk_ready(); - } -} - -void nrf_802154_clock_init(void) -{ - nrf_drv_clock_init(); -} - -void nrf_802154_clock_deinit(void) -{ - nrf_drv_clock_uninit(); -} - -void nrf_802154_clock_hfclk_start(void) -{ - nrf_drv_clock_hfclk_request(&m_clock_handler); -} - -void nrf_802154_clock_hfclk_stop(void) -{ - nrf_drv_clock_hfclk_release(); -} - -bool nrf_802154_clock_hfclk_is_running(void) -{ - return nrf_drv_clock_hfclk_is_running(); -} - -void nrf_802154_clock_lfclk_start(void) -{ - nrf_drv_clock_lfclk_request(&m_clock_handler); -} - -void nrf_802154_clock_lfclk_stop(void) -{ - nrf_drv_clock_lfclk_release(); -} - -bool nrf_802154_clock_lfclk_is_running(void) -{ - return nrf_drv_clock_lfclk_is_running(); -} - -__WEAK void nrf_802154_clock_hfclk_ready(void) -{ - // Intentionally empty. -} - -__WEAK void nrf_802154_clock_lfclk_ready(void) -{ - // Intentionally empty. -} diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/coex/nrf_802154_wifi_coex.h b/third_party/NordicSemiconductor/drivers/radio/platform/coex/nrf_802154_wifi_coex.h deleted file mode 100644 index 61b5f787b..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/coex/nrf_802154_wifi_coex.h +++ /dev/null @@ -1,108 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that defines the Wi-Fi coexistence module. - * - */ - -#ifndef NRF_802154_WIFI_COEX_H_ -#define NRF_802154_WIFI_COEX_H_ - -#include "rsch/nrf_802154_rsch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_wifi_coex Wi-Fi Coexistence - * @{ - * @ingroup nrf_802154 - * @brief The Wi-Fi Coexistence module. - * - * The Wi-Fi Coexistence module is a client of the PTA (defined in the 802.15.2). It manages GPIO - * to assert pins and respond to pin state changes. - */ - -/** - * @brief Initializes the Wi-Fi Coexistence module. - * - * @note This function must be called once, before any other function from this module. - * - */ -void nrf_802154_wifi_coex_init(void); - -/** - * @brief Deinitializes the Wi-Fi Coexistence module. - * - */ -void nrf_802154_wifi_coex_uninit(void); - -/** - * @brief Requests the given priority from the Wi-Fi Coexistence module. - * - * @note The approval of the requested priority is notified asynchronously by the - * @ref nrf_802154_wifi_coex_prio_changed call. - * - * @param[in] priority The requested priority level. - * - */ -void nrf_802154_wifi_coex_prio_request(rsch_prio_t priority); - -/** - * @brief Gets the priority denial event address. - * - * Get the address of a hardware event that notifies about the denial of a previously approved - * priority. - * - * @returns Address of the priority denial event. - */ -void * nrf_802154_wifi_coex_deny_event_addr_get(void); - -/** - * @brief Notifies about the approved priority change. - * - * The Wi-Fi Coexistence module calls this function to notify the RSCH of the currently approved - * priority level. - * - * @param[in] priority The approved priority level. - */ -extern void nrf_802154_wifi_coex_prio_changed(rsch_prio_t priority); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_WIFI_COEX_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/coex/nrf_802154_wifi_coex_none.c b/third_party/NordicSemiconductor/drivers/radio/platform/coex/nrf_802154_wifi_coex_none.c deleted file mode 100644 index 215861798..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/coex/nrf_802154_wifi_coex_none.c +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the nrf 802.15.4 WiFi Coexitstence abstraction in case no implementation is used. - * - */ - -#include "nrf_802154_wifi_coex.h" - -#include "stddef.h" - -#include - -void nrf_802154_wifi_coex_init(void) -{ - // Intentionally empty -} - -void nrf_802154_wifi_coex_uninit(void) -{ - // Intentionally empty -} - -void nrf_802154_wifi_coex_prio_request(rsch_prio_t priority) -{ - (void)priority; - // Intentionally empty -} - -void * nrf_802154_wifi_coex_deny_event_addr_get(void) -{ - // Intentionally empty - return NULL; -} - -__WEAK void nrf_802154_wifi_coex_prio_changed(rsch_prio_t priority) -{ - (void)priority; - // Intentionally empty -} diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/hp_timer/nrf_802154_hp_timer.c b/third_party/NordicSemiconductor/drivers/radio/platform/hp_timer/nrf_802154_hp_timer.c deleted file mode 100644 index eadce206b..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/hp_timer/nrf_802154_hp_timer.c +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file contains implementation of the nRF 802.15.4 high precision timer abstraction. - * - * This implementation is built on top of the TIMER peripheral. - * If SoftDevice RAAL is in use the TIMER peripheral is shared between RAAL and this module. - * - */ - -#include "nrf_802154_hp_timer.h" - -#include -#include -#include - -#include -#include - -#include "nrf_802154_config.h" -#include "nrf_802154_peripherals.h" - -/**@brief Timer instance. */ -#define TIMER NRF_802154_HIGH_PRECISION_TIMER_INSTANCE - -/**@brief Timer compare channel definitions. */ -#define TIMER_CC_CAPTURE NRF_TIMER_CC_CHANNEL1 -#define TIMER_CC_CAPTURE_TASK NRF_TIMER_TASK_CAPTURE1 - -#define TIMER_CC_SYNC NRF_TIMER_CC_CHANNEL2 -#define TIMER_CC_SYNC_TASK NRF_TIMER_TASK_CAPTURE2 -#define TIMER_CC_SYNC_EVENT NRF_TIMER_EVENT_COMPARE2 -#define TIMER_CC_SYNC_INT NRF_TIMER_INT_COMPARE2_MASK - -#define TIMER_CC_EVT NRF_TIMER_CC_CHANNEL3 -#define TIMER_CC_EVT_TASK NRF_TIMER_TASK_CAPTURE3 -#define TIMER_CC_EVT_INT NRF_TIMER_INT_COMPARE3_MASK - -/**@brief Unexpected value in the sync compare channel. */ -static uint32_t m_unexpected_sync; - -/**@brief Get current time on the Timer. */ -static inline uint32_t timer_time_get(void) -{ - nrf_timer_task_trigger(TIMER, TIMER_CC_CAPTURE_TASK); - return nrf_timer_cc_read(TIMER, TIMER_CC_CAPTURE); -} - -void nrf_802154_hp_timer_init(void) -{ - // Intentionally empty -} - -void nrf_802154_hp_timer_deinit(void) -{ - nrf_timer_task_trigger(TIMER, NRF_TIMER_TASK_SHUTDOWN); -} - -void nrf_802154_hp_timer_start(void) -{ -#if !RAAL_SOFTDEVICE && !RAAL_SIMULATOR && !RAAL_REM - nrf_timer_mode_set(TIMER, NRF_TIMER_MODE_TIMER); - nrf_timer_bit_width_set(TIMER, NRF_TIMER_BIT_WIDTH_32); - nrf_timer_frequency_set(TIMER, NRF_TIMER_FREQ_1MHz); - nrf_timer_task_trigger(TIMER, NRF_TIMER_TASK_START); -#endif // !RAAL_SOFTDEVICE && !RAAL_SIMULATOR && !RAAL_REM -} - -void nrf_802154_hp_timer_stop(void) -{ -#if !RAAL_SOFTDEVICE && !RAAL_SIMULATOR && !RAAL_REM - nrf_timer_task_trigger(TIMER, NRF_TIMER_TASK_SHUTDOWN); -#endif // !RAAL_SOFTDEVICE && !RAAL_SIMULATOR && !RAAL_REM -} - -uint32_t nrf_802154_hp_timer_sync_task_get(void) -{ - return (uint32_t)nrf_timer_task_address_get(TIMER, TIMER_CC_SYNC_TASK); -} - -void nrf_802154_hp_timer_sync_prepare(void) -{ - uint32_t past_time = timer_time_get() - 1; - - m_unexpected_sync = past_time; - nrf_timer_cc_write(TIMER, TIMER_CC_SYNC, past_time); -} - -bool nrf_802154_hp_timer_sync_time_get(uint32_t * p_timestamp) -{ - bool result = false; - uint32_t sync_time = nrf_timer_cc_read(TIMER, TIMER_CC_SYNC); - - assert(p_timestamp != NULL); - - if (sync_time != m_unexpected_sync) - { - *p_timestamp = sync_time; - result = true; - } - - return result; -} - -uint32_t nrf_802154_hp_timer_timestamp_task_get(void) -{ - return (uint32_t)nrf_timer_task_address_get(TIMER, TIMER_CC_EVT_TASK); -} - -uint32_t nrf_802154_hp_timer_timestamp_get(void) -{ - return nrf_timer_cc_read(TIMER, TIMER_CC_EVT); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/hp_timer/nrf_802154_hp_timer.h b/third_party/NordicSemiconductor/drivers/radio/platform/hp_timer/nrf_802154_hp_timer.h deleted file mode 100644 index b36abc818..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/hp_timer/nrf_802154_hp_timer.h +++ /dev/null @@ -1,148 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that defines API of High Precision Timer for the 802.15.4 driver. - * - */ - -#ifndef NRF_802154_HP_TIMER_H_ -#define NRF_802154_HP_TIMER_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_hp_timer High Precision Timer for the 802.15.4 driver - * @{ - * @ingroup nrf_802154_hp_timer - * @brief High Precision Timer for the 802.15.4 driver. - * - * The High Precision Timer is used only when the radio is in use. It is not - * used when the radio is in the sleep mode or out of the RAAL timeslots. - * This timer is meant to provide at least 1-microsecond precision. It is intended to be used - * for precise frame timestamps or synchronous radio operations. - * - * @note The High Precision Timer is relative. To use it as an absolute timer, - * synchronize it with the Low Power Timer using the Timer Coordinator module. - * - */ - -/** - * @brief Initializes the timer. - */ -void nrf_802154_hp_timer_init(void); - -/** - * @brief Deinitializes the timer. - */ -void nrf_802154_hp_timer_deinit(void); - -/** - * @brief Starts the timer. - * - * The timer starts counting when this command is called. - */ -void nrf_802154_hp_timer_start(void); - -/** - * @brief Stops the timer. - * - * The timer stops counting and enters the low power mode. - */ -void nrf_802154_hp_timer_stop(void); - -/** - * @brief Gets the value indicated by the timer right now. - * - * @note The returned value is relative to the @ref nrf_802154_hp_timer_start call time. It is not - * synchronized with the LP timer. - * - * @returns Current timer value in microseconds. - * - */ -uint32_t nrf_802154_hp_timer_current_time_get(void); - -/** - * @brief Gets the task used to synchronize the timer with the LP timer. - * - * @returns Address of the task. - * - */ -uint32_t nrf_802154_hp_timer_sync_task_get(void); - -/** - * @brief Configures the timer to detect if the synchronization task was triggered. - */ -void nrf_802154_hp_timer_sync_prepare(void); - -/** - * @brief Gets the timestamp of the synchronization event. - * - * @param[out] p_timestamp Timestamp of the synchronization event. - * - * @retval true Synchronization was performed and @p p_timestamp is valid. - * @retval false Synchronization was not performed. @p p_timestamp was not modified. - * - */ -bool nrf_802154_hp_timer_sync_time_get(uint32_t * p_timestamp); - -/** - * @brief Gets the task used to make timestamp of an event. - * - * This function is to be used to configure PPI. - * It configures the timer to detect if the returned task was triggered to return - * a valid value by @ref nrf_802154_hp_timer_timestamp_get. - * - * @returns Address of the task. - */ -uint32_t nrf_802154_hp_timer_timestamp_task_get(void); - -/** - * @brief Gets the timestamp of the last event. - * - * @returns Timestamp of the last event that triggered - * the @ref nrf_802154_hp_timer_timestamp_task_get task. - */ -uint32_t nrf_802154_hp_timer_timestamp_get(void); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_HP_TIMER_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer.h b/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer.h deleted file mode 100644 index 19d4a4c40..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer.h +++ /dev/null @@ -1,212 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that defines the Low Power Timer Abstraction Layer for the 802.15.4 driver. - * - */ - -#ifndef NRF_802154_LP_TIMER_API_H_ -#define NRF_802154_LP_TIMER_API_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_timer Low Power Timer Abstraction Layer for the 802.15.4 driver - * @{ - * @ingroup nrf_802154_timer - * @brief Low Power Timer Abstraction Layer interface for the 802.15.4 driver. - * - * The Low Power Timer Abstraction Layer is an abstraction layer of the timer that is meant - * to be used by the nRF 802.15.4 driver. This timer is intended to provide low latency - * (max. 100 microseconds) to allow the implementation of the following features in the driver code: - * * Timing out when waiting for an ACK frame - * * SIFS and LIFS - * * CSMA/CA - * * CSL - * * Auto polling by rx-off-when-idle devices - * - * @note Most of the Low Power Timer Abstraction Layer API is not intended to be called directly - * by the 802.15.4 driver modules. This API is used by the Timer Scheduler module included - * in the driver. Other modules should use the Timer Scheduler API. The exception are - * initialization and deinitialization functions @ref nrf_802154_lp_timer_init() and - * @ref nrf_802154_lp_timer_deinit(), as well as critical section management - * @ref nrf_802154_lp_timer_critical_section_enter() and - * @ref nrf_802154_lp_timer_critical_section_exit(), as these functions are called from - * the nrf_802154_critical_section module and from the global initialization - * and deinitialization functions @ref nrf_802154_init() and @ref nrf_802154_deinit(). - */ - -/** - * @brief Initializes the Timer. - */ -void nrf_802154_lp_timer_init(void); - -/** - * @brief Deinitializes the Timer. - */ -void nrf_802154_lp_timer_deinit(void); - -/** - * @brief Enters the critical section of the timer. - * - * In the critical section, the timer cannot execute the @ref nrf_802154_lp_timer_fired() function. - * - * @note The critical section cannot be nested. - * - */ -void nrf_802154_lp_timer_critical_section_enter(void); - -/** - * @brief Exits the critical section of the timer. - * - * In the critical section, the timer cannot execute the @ref nrf_802154_lp_timer_fired() function. - * - * @note The critical section cannot be nested. - */ -void nrf_802154_lp_timer_critical_section_exit(void); - -/** - * @brief Gets the current time. - * - * @pre Before getting the current time, the timer must be initialized with - * @ref nrf_802154_lp_timer_init(). This is the only requirement that must be met before using this - * function. - * - * @returns Current time in microseconds. - */ -uint32_t nrf_802154_lp_timer_time_get(void); - -/** - * @brief Gets the granularity of the timer. - * - * This function can be used to round up or round down the time calculations. - * - * @returns Timer granularity in microseconds. - */ -uint32_t nrf_802154_lp_timer_granularity_get(void); - -/** - * @brief Starts a one-shot timer that expires at the specified time. - * - * This function starts a one-shot timer that will expire @p dt microseconds after @p t0 time. - * If the timer is running when this function is called, the running timer is stopped - * automatically. - * - * On timer expiration, the @ref nrf_802154_lp_timer_fired function will be called. - * The timer stops automatically after the expiration. - * - * @param[in] t0 Number of microseconds representing timer start time. - * @param[in] dt Time of the timer expiration as time elapsed from @p t0, in microseconds. - */ -void nrf_802154_lp_timer_start(uint32_t t0, uint32_t dt); - -/** - * @brief Stops the currently running timer. - */ -void nrf_802154_lp_timer_stop(void); - -/** - * @brief Checks if the timer is currently running. - * - * @retval true Timer is running. - * @retval false Timer is not running. - */ -bool nrf_802154_lp_timer_is_running(void); - -/** - * @brief Starts a one-shot synchronization timer that expires at the nearest possible timepoint. - * - * On timer expiration, the @ref nrf_802154_lp_timer_synchronized function is called and the - * event returned by @ref nrf_802154_lp_timer_sync_event_get is triggered. - * - * @note @ref nrf_802154_lp_timer_synchronized may be called multiple times. - */ -void nrf_802154_lp_timer_sync_start_now(void); - -/** - * @brief Starts a one-shot synchronization timer that expires at the specified time. - * - * This function starts a one-shot synchronization timer that expires @p dt microseconds after - * @p t0 time. - * - * On timer expiration, @ref nrf_802154_lp_timer_synchronized function is called and - * the event returned by @ref nrf_802154_lp_timer_sync_event_get is triggered. - * - * @param[in] t0 Number of microseconds that represents the timer start time. - * @param[in] dt Time of the timer expiration as time elapsed from @p t0, in microseconds. - */ -void nrf_802154_lp_timer_sync_start_at(uint32_t t0, uint32_t dt); - -/** - * @brief Stops the currently running synchronization timer. - */ -void nrf_802154_lp_timer_sync_stop(void); - -/** - * @brief Gets the event used to synchronize this timer with the HP Timer. - * - * @returns Address of the peripheral register corresponding to the event - * to be used for the timer synchronization. - * - */ -uint32_t nrf_802154_lp_timer_sync_event_get(void); - -/** - * @brief Gets the timestamp of the synchronization event. - * - * @returns Timestamp of the synchronization event. - */ -uint32_t nrf_802154_lp_timer_sync_time_get(void); - -/** - * @brief Callback function executed when the timer expires. - */ -extern void nrf_802154_lp_timer_fired(void); - -/** - * @brief Callback function executed when the synchronization timer expires. - */ -extern void nrf_802154_lp_timer_synchronized(void); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_LP_TIMER_API_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer_nodrv.c b/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer_nodrv.c deleted file mode 100644 index 552622e64..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer_nodrv.c +++ /dev/null @@ -1,610 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file contains standalone implementation of the nRF 802.15.4 timer abstraction. - * - * This implementation is built on top of the RTC peripheral. - * - */ - -#include "nrf_802154_lp_timer.h" - -#include - -#include -#include - -#include "platform/clock/nrf_802154_clock.h" -#include "nrf_802154_config.h" -#include "nrf_802154_peripherals.h" -#include "nrf_802154_utils.h" - -#define RTC_LP_TIMER_COMPARE_CHANNEL 0 -#define RTC_LP_TIMER_COMPARE_INT_MASK NRF_RTC_INT_COMPARE0_MASK -#define RTC_LP_TIMER_COMPARE_EVENT NRF_RTC_EVENT_COMPARE_0 -#define RTC_LP_TIMER_COMPARE_EVENT_MASK RTC_EVTEN_COMPARE0_Msk - -#define RTC_SYNC_COMPARE_CHANNEL 1 -#define RTC_SYNC_COMPARE_INT_MASK NRF_RTC_INT_COMPARE1_MASK -#define RTC_SYNC_COMPARE_EVENT NRF_RTC_EVENT_COMPARE_1 -#define RTC_SYNC_COMPARE_EVENT_MASK RTC_EVTEN_COMPARE1_Msk - -#define US_PER_OVERFLOW (512UL * NRF_802154_US_PER_S) ///< Time that has passed between overflow events. On full RTC speed, it occurs every 512 s. -#define MIN_RTC_COMPARE_EVENT_DT (2 * NRF_802154_US_PER_TICK) ///< Minimum time delta from now before RTC compare event is guaranteed to fire. - -#define EPOCH_32BIT_US (1ULL << 32) -#define EPOCH_FROM_TIME(time) ((time) & ((uint64_t)UINT32_MAX << 32)) - -#define MAX_LP_TIMER_SYNC_ITERS 4 - -// Struct holding information about compare channel. -typedef struct -{ - uint32_t channel; ///< Channel number - uint32_t int_mask; ///< Interrupt mask - nrf_rtc_event_t event; ///< Event - uint32_t event_mask; ///< Event mask -} compare_channel_descriptor_t; - -// Enum holding all used compare channels. -typedef enum {LP_TIMER_CHANNEL, SYNC_CHANNEL, CHANNEL_CNT} compare_channel_t; - -// Descriptors of all used compare channels. -static const compare_channel_descriptor_t m_cmp_ch[CHANNEL_CNT] = {{RTC_LP_TIMER_COMPARE_CHANNEL, - RTC_LP_TIMER_COMPARE_INT_MASK, - RTC_LP_TIMER_COMPARE_EVENT, - RTC_LP_TIMER_COMPARE_EVENT_MASK}, - {RTC_SYNC_COMPARE_CHANNEL, - RTC_SYNC_COMPARE_INT_MASK, - RTC_SYNC_COMPARE_EVENT, - RTC_SYNC_COMPARE_EVENT_MASK}}; - -static uint64_t m_target_times[CHANNEL_CNT]; ///< Target time of given channel [us]. - -static volatile uint32_t m_lp_timer_irq_enabled; ///< Information that RTC interrupt was enabled while entering critical section. -static volatile uint32_t m_offset_counter; ///< Counter of RTC overflows, incremented by 2 on each OVERFLOW event. -static volatile uint8_t m_mutex; ///< Mutex for write access to @ref m_offset_counter. -static volatile bool m_clock_ready; ///< Information that LFCLK is ready. -static volatile bool m_shall_fire_immediately; ///< Information if timer should fire immediately. - -static uint32_t overflow_counter_get(void); - -/** @brief Non-blocking mutex for mutual write access to @ref m_offset_counter variable. - * - * @retval true Mutex was acquired. - * @retval false Mutex could not be acquired. - */ -static inline bool mutex_get(void) -{ - do - { - volatile uint8_t mutex_value = __LDREXB(&m_mutex); - - if (mutex_value) - { - __CLREX(); - return false; - } - } - while (__STREXB(1, &m_mutex)); - - // Disable OVERFLOW interrupt to prevent lock-up in interrupt context while mutex is locked from lower priority context - // and OVERFLOW event flag is stil up. - nrf_rtc_int_disable(NRF_802154_RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - - __DMB(); - - return true; -} - -/** @brief Release mutex. */ -static inline void mutex_release(void) -{ - // Re-enable OVERFLOW interrupt. - nrf_rtc_int_enable(NRF_802154_RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - - __DMB(); - m_mutex = 0; -} - -/** @brief Check if timer shall strike. - * - * @param[in] now Current time. - * - * @retval true Timer shall strike now. - * @retval false Timer shall not strike now. - */ -static inline bool shall_strike(uint64_t now) -{ - return now >= m_target_times[LP_TIMER_CHANNEL]; -} - -/** @brief Convert time in [us] to RTC ticks. - * - * @param[in] time Time to convert. - * - * @return Time value in RTC ticks. - */ -static inline uint64_t time_to_ticks(uint64_t time) -{ - return NRF_802154_US_TO_RTC_TICKS(time); -} - -/** @brief Convert RTC ticks to time in [us]. - * - * @param[in] ticks RTC ticks to convert. - * - * @return Time value in [us]. - */ -static inline uint64_t ticks_to_time(uint64_t ticks) -{ - return NRF_802154_RTC_TICKS_TO_US(ticks); -} - -/** @brief Get current value of the RTC counter. - * - * @return RTC counter value [ticks]. - */ -static uint32_t counter_get(void) -{ - return nrf_rtc_counter_get(NRF_802154_RTC_INSTANCE); -} - -/** @brief Get RTC counter value and matching offset that represent the current time. - * - * @param[out] p_offset Offset of the current time. - * @param[out] p_counter RTC value of the current time. - */ -static void offset_and_counter_get(uint32_t * p_offset, uint32_t * p_counter) -{ - uint32_t offset_1 = overflow_counter_get(); - - __DMB(); - - uint32_t rtc_value_1 = counter_get(); - - __DMB(); - - uint32_t offset_2 = overflow_counter_get(); - - *p_offset = offset_2; - *p_counter = (offset_1 == offset_2) ? rtc_value_1 : counter_get(); -} - -/** @brief Get time from given @p offset and @p counter values. - * - * @param[in] offset Offset of time to get. - * @param[in] counter RTC value representing time to get. - * - * @return Time calculated from given offset and counter [us]. - */ -static uint64_t time_get(uint32_t offset, uint32_t counter) -{ - return (uint64_t)offset * US_PER_OVERFLOW + ticks_to_time(counter); -} - -/** @brief Get current time. - * - * @return Current time in [us]. - */ -static uint64_t curr_time_get(void) -{ - uint32_t offset; - uint32_t rtc_value; - - offset_and_counter_get(&offset, &rtc_value); - - return time_get(offset, rtc_value); -} - -/** @brief Get current overflow counter and handle OVERFLOW event if present. - * - * This function returns current value of m_overflow_counter variable. If OVERFLOW event is present - * while calling this function, it is handled within it. - * - * @return Current number of OVERFLOW events since platform start. - */ -static uint32_t overflow_counter_get(void) -{ - uint32_t offset; - - // Get mutual access for writing to m_offset_counter variable. - if (mutex_get()) - { - bool increasing = false; - - // Check if interrupt was handled already. - if (nrf_rtc_event_pending(NRF_802154_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW)) - { - m_offset_counter++; - increasing = true; - - __DMB(); - - // Mark that interrupt was handled. - nrf_rtc_event_clear(NRF_802154_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW); - - // Result should be incremented. m_offset_counter will be incremented after mutex is released. - } - else - { - // Either overflow handling is not needed OR we acquired the mutex just after it was released. - // Overflow is handled after mutex is released, but it cannot be assured that m_offset_counter - // was incremented for the second time, so we increment the result here. - } - - offset = (m_offset_counter + 1) / 2; - - mutex_release(); - - if (increasing) - { - // It's virtually impossible that overflow event is pending again before next instruction is performed. It is an error condition. - assert(m_offset_counter & 0x01); - - // Increment the counter for the second time, to alloww instructions from other context get correct value of the counter. - m_offset_counter++; - } - } - else - { - // Failed to acquire mutex. - if (nrf_rtc_event_pending(NRF_802154_RTC_INSTANCE, - NRF_RTC_EVENT_OVERFLOW) || (m_offset_counter & 0x01)) - { - // Lower priority context is currently incrementing m_offset_counter variable. - offset = (m_offset_counter + 2) / 2; - } - else - { - // Lower priority context has already incremented m_offset_counter variable or incrementing is not needed now. - offset = m_offset_counter / 2; - } - } - - return offset; -} - -/** @brief Handle COMPARE event. */ -static void handle_compare_match(bool skip_check) -{ - nrf_rtc_event_clear(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].event); - - // In case the target time was larger than single overflow, - // we should only strike the timer on final compare event. - if (skip_check || shall_strike(curr_time_get())) - { - nrf_rtc_event_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].event_mask); - nrf_rtc_int_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].int_mask); - - nrf_802154_lp_timer_fired(); - } -} - -/** - * @brief Convert t0 and dt to 64 bit time. - * - * @note This function takes into account possible overflow of first 32 bits in current time. - * - * @return Converted time in [us]. - */ -static uint64_t convert_to_64bit_time(uint32_t t0, uint32_t dt, const uint64_t * p_now) -{ - uint64_t now; - - now = *p_now; - - // Check if 32 LSB of `now` overflowed between getting t0 and loading `now` value. - if (((uint32_t)now < t0) && ((t0 - (uint32_t)now) > (UINT32_MAX / 2))) - { - now -= EPOCH_32BIT_US; - } - else if (((uint32_t)now > t0) && (((uint32_t)now) - t0 > (UINT32_MAX / 2))) - { - now += EPOCH_32BIT_US; - } - - return (EPOCH_FROM_TIME(now)) + t0 + dt; -} - -/** - * @brief Round time up to multiple of the timer ticks. - */ -static uint64_t round_up_to_timer_ticks_multiply(uint64_t time) -{ - uint64_t ticks = time_to_ticks(time); - uint64_t result = ticks_to_time(ticks); - - return result; -} - -/** - * @brief Start one-shot timer that expires at specified time on desired channel. - * - * Start one-shot timer that will expire @p dt microseconds after @p t0 time on channel @p channel. - * - * @param[in] channel Compare channel on which timer will be started. - * @param[in] t0 Number of microseconds representing timer start time. - * @param[in] dt Time of timer expiration as time elapsed from @p t0 [us]. - * @param[in] p_now Pointer to data with the current time. - */ -static void timer_start_at(compare_channel_t channel, - uint32_t t0, - uint32_t dt, - const uint64_t * p_now) -{ - uint64_t target_counter; - uint64_t target_time; - - nrf_rtc_int_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[channel].int_mask); - nrf_rtc_event_enable(NRF_802154_RTC_INSTANCE, m_cmp_ch[channel].event_mask); - - target_time = convert_to_64bit_time(t0, dt, p_now); - target_counter = time_to_ticks(target_time); - - m_target_times[channel] = round_up_to_timer_ticks_multiply(target_time); - - nrf_rtc_cc_set(NRF_802154_RTC_INSTANCE, m_cmp_ch[channel].channel, target_counter); -} - -/** - * @brief Start synchronization timer at given time. - * - * @param[in] t0 Number of microseconds representing timer start time. - * @param[in] dt Time of timer expiration as time elapsed from @p t0 [us]. - * @param[in] p_now Pointer to data with current time. - */ -static void timer_sync_start_at(uint32_t t0, uint32_t dt, const uint64_t * p_now) -{ - timer_start_at(SYNC_CHANNEL, t0, dt, p_now); - - nrf_rtc_int_enable(NRF_802154_RTC_INSTANCE, m_cmp_ch[SYNC_CHANNEL].int_mask); -} - -void nrf_802154_lp_timer_init(void) -{ - m_offset_counter = 0; - m_target_times[LP_TIMER_CHANNEL] = 0; - m_clock_ready = false; - m_lp_timer_irq_enabled = 0; - - // Setup low frequency clock. - nrf_802154_clock_lfclk_start(); - - while (!m_clock_ready) - { - // Intentionally empty - } - - // Setup RTC timer. -#if !NRF_IS_IRQ_PRIORITY_ALLOWED(NRF_802154_RTC_IRQ_PRIORITY) -#error NRF_802154_RTC_IRQ_PRIORITY value out of the allowed range. -#endif - NVIC_SetPriority(NRF_802154_RTC_IRQN, NRF_802154_RTC_IRQ_PRIORITY); - NVIC_ClearPendingIRQ(NRF_802154_RTC_IRQN); - NVIC_EnableIRQ(NRF_802154_RTC_IRQN); - - nrf_rtc_prescaler_set(NRF_802154_RTC_INSTANCE, 0); - - // Setup RTC events. - nrf_rtc_event_clear(NRF_802154_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW); - nrf_rtc_event_enable(NRF_802154_RTC_INSTANCE, RTC_EVTEN_OVRFLW_Msk); - nrf_rtc_int_enable(NRF_802154_RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - - nrf_rtc_int_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].int_mask); - nrf_rtc_event_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].event_mask); - nrf_rtc_event_clear(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].event); - - // Start RTC timer. - nrf_rtc_task_trigger(NRF_802154_RTC_INSTANCE, NRF_RTC_TASK_START); -} - -void nrf_802154_lp_timer_deinit(void) -{ - nrf_rtc_task_trigger(NRF_802154_RTC_INSTANCE, NRF_RTC_TASK_STOP); - - nrf_rtc_int_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].int_mask); - nrf_rtc_event_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].event_mask); - nrf_rtc_event_clear(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].event); - - nrf_rtc_int_disable(NRF_802154_RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - nrf_rtc_event_disable(NRF_802154_RTC_INSTANCE, RTC_EVTEN_OVRFLW_Msk); - nrf_rtc_event_clear(NRF_802154_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW); - - nrf_802154_lp_timer_sync_stop(); - - NVIC_DisableIRQ(NRF_802154_RTC_IRQN); - NVIC_ClearPendingIRQ(NRF_802154_RTC_IRQN); - NVIC_SetPriority(NRF_802154_RTC_IRQN, 0); - - nrf_802154_clock_lfclk_stop(); -} - -void nrf_802154_lp_timer_critical_section_enter(void) -{ - if (nrf_is_nvic_irq_enabled(NRF_802154_RTC_IRQN)) - { - m_lp_timer_irq_enabled = 1; - } - - NVIC_DisableIRQ(NRF_802154_RTC_IRQN); -} - -void nrf_802154_lp_timer_critical_section_exit(void) -{ - if (m_lp_timer_irq_enabled) - { - m_lp_timer_irq_enabled = 0; - NVIC_EnableIRQ(NRF_802154_RTC_IRQN); - } -} - -uint32_t nrf_802154_lp_timer_time_get(void) -{ - return (uint32_t)curr_time_get(); -} - -uint32_t nrf_802154_lp_timer_granularity_get(void) -{ - return NRF_802154_US_PER_TICK; -} - -void nrf_802154_lp_timer_start(uint32_t t0, uint32_t dt) -{ - uint32_t offset; - uint32_t rtc_value; - uint64_t now; - - offset_and_counter_get(&offset, &rtc_value); - now = time_get(offset, rtc_value); - - timer_start_at(LP_TIMER_CHANNEL, t0, dt, &now); - - if (rtc_value != counter_get()) - { - now = curr_time_get(); - } - - if (shall_strike(now + MIN_RTC_COMPARE_EVENT_DT)) - { - m_shall_fire_immediately = true; - NVIC_SetPendingIRQ(NRF_802154_RTC_IRQN); - } - else - { - nrf_rtc_int_enable(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].int_mask); - } -} - -bool nrf_802154_lp_timer_is_running(void) -{ - return nrf_rtc_int_is_enabled(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].int_mask); -} - -void nrf_802154_lp_timer_stop(void) -{ - nrf_rtc_event_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].event_mask); - nrf_rtc_int_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].int_mask); - nrf_rtc_event_clear(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].event); -} - -void nrf_802154_lp_timer_sync_start_now(void) -{ - uint32_t counter; - uint32_t offset; - uint64_t now; - uint32_t iterations = MAX_LP_TIMER_SYNC_ITERS; - - do - { - offset_and_counter_get(&offset, &counter); - now = time_get(offset, counter); - timer_sync_start_at((uint32_t)now, MIN_RTC_COMPARE_EVENT_DT, &now); - } - while ((counter_get() != counter) && (--iterations > 0)); -} - -void nrf_802154_lp_timer_sync_start_at(uint32_t t0, uint32_t dt) -{ - uint64_t now = curr_time_get(); - - timer_sync_start_at(t0, dt, &now); -} - -void nrf_802154_lp_timer_sync_stop(void) -{ - nrf_rtc_event_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[SYNC_CHANNEL].event_mask); - nrf_rtc_int_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[SYNC_CHANNEL].int_mask); - nrf_rtc_event_clear(NRF_802154_RTC_INSTANCE, m_cmp_ch[SYNC_CHANNEL].event); -} - -uint32_t nrf_802154_lp_timer_sync_event_get(void) -{ - return (uint32_t)nrf_rtc_event_address_get(NRF_802154_RTC_INSTANCE, - m_cmp_ch[SYNC_CHANNEL].event); -} - -uint32_t nrf_802154_lp_timer_sync_time_get(void) -{ - return (uint32_t)m_target_times[SYNC_CHANNEL]; -} - -void nrf_802154_clock_lfclk_ready(void) -{ - m_clock_ready = true; -} - -void NRF_802154_RTC_IRQ_HANDLER(void) -{ - // Handle overflow. - if (nrf_rtc_event_pending(NRF_802154_RTC_INSTANCE, NRF_RTC_EVENT_OVERFLOW)) - { - // Disable OVERFLOW interrupt to prevent lock-up in interrupt context while mutex is locked from lower priority context - // and OVERFLOW event flag is stil up. - // OVERFLOW interrupt will be re-enabled when mutex is released - either from this handler, or from lower priority context, - // that locked the mutex. - nrf_rtc_int_disable(NRF_802154_RTC_INSTANCE, NRF_RTC_INT_OVERFLOW_MASK); - - // Handle OVERFLOW event by reading current value of overflow counter. - (void)overflow_counter_get(); - } - - // Handle compare match. - if (m_shall_fire_immediately) - { - m_shall_fire_immediately = false; - handle_compare_match(true); - } - - if (nrf_rtc_int_is_enabled(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].int_mask) && - nrf_rtc_event_pending(NRF_802154_RTC_INSTANCE, m_cmp_ch[LP_TIMER_CHANNEL].event)) - { - handle_compare_match(false); - } - - if (nrf_rtc_int_is_enabled(NRF_802154_RTC_INSTANCE, m_cmp_ch[SYNC_CHANNEL].int_mask) && - nrf_rtc_event_pending(NRF_802154_RTC_INSTANCE, m_cmp_ch[SYNC_CHANNEL].event)) - { - nrf_rtc_event_clear(NRF_802154_RTC_INSTANCE, m_cmp_ch[SYNC_CHANNEL].event); - nrf_rtc_event_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[SYNC_CHANNEL].event_mask); - nrf_rtc_int_disable(NRF_802154_RTC_INSTANCE, m_cmp_ch[SYNC_CHANNEL].int_mask); - nrf_802154_lp_timer_synchronized(); - } -} - -#ifndef UNITY_ON_TARGET -__WEAK void nrf_802154_lp_timer_synchronized(void) -{ - // Intentionally empty -} - -#endif // UNITY_ON_TARGET diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer_none.c b/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer_none.c deleted file mode 100644 index 7dd29376f..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/lp_timer/nrf_802154_lp_timer_none.c +++ /dev/null @@ -1,62 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the nrf 802.15.4 timer abstraction in case timer is not used. - * - * This timer abstraction should be used only when none of driver features that use timer is enabled. - * - */ - -#include "nrf_802154_lp_timer.h" - -void nrf_802154_lp_timer_init(void) -{ - // Intentionally empty -} - -void nrf_802154_lp_timer_deinit(void) -{ - // Intentionally empty -} - -void nrf_802154_lp_timer_critical_section_enter(void) -{ - // Intentionally empty -} - -void nrf_802154_lp_timer_critical_section_exit(void) -{ - // Intentionally empty -} - -// Other functions from TimAL API are intentionally not implemented to detect build configuration -// problems compile-time. diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random.h b/third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random.h deleted file mode 100644 index 15e8d94fa..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that defines the pseudo-random number generator Abstraction Layer. - * - */ - -#ifndef NRF_802154_RANDOM_H_ -#define NRF_802154_RANDOM_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_random Random Abstraction Layer for the 802.15.4 driver - * @{ - * @ingroup nrf_802154_random - * @brief The pseudo-random number generator Abstraction Layer interface for the 802.15.4 driver. - * - * The Random Abstraction Layer is an abstraction layer of a pseudo-random number generator that is - * used to perform CSMA-CA procedure correctly. - * - */ - -/** - * @brief Initializes the random number generator. - */ -void nrf_802154_random_init(void); - -/** - * @brief Deinitializes the random number generator. - */ -void nrf_802154_random_deinit(void); - -/** - * @brief Gets a pseudo-random number. - * - * @returns Pseudo-random number. - */ -uint32_t nrf_802154_random_get(void); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_RANDOM_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random_newlib.c b/third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random_newlib.c deleted file mode 100644 index f1b6b188e..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random_newlib.c +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the pseudo-random number generator abstraction layer. - * - * This pseudo-random number abstraction layer uses newlib's rand_r() function. - * - */ - -#define _POSIX_C_SOURCE 1 // Enable access to POSIX functions (rand_r is not from the std library) - -#include "nrf_802154_random.h" - -#include -#include - -#include "nrf.h" - -#if RAAL_SOFTDEVICE -#include -#endif // RAAL_SOFTDEVICE - -unsigned int m_seed; - -void nrf_802154_random_init(void) -{ -#if RAAL_SOFTDEVICE - uint32_t result; - - do - { - result = sd_rand_application_vector_get((uint8_t *)&m_seed, sizeof(m_seed)); - } - while (result != NRF_SUCCESS); -#else // RAAL_SOFTDEVICE - NRF_RNG->TASKS_START = 1; - - while (!NRF_RNG->EVENTS_VALRDY); - NRF_RNG->EVENTS_VALRDY = 0; - - m_seed = NRF_RNG->VALUE; -#endif // RAAL_SOFTDEVICE -} - -void nrf_802154_random_deinit(void) -{ - // Intentionally empty -} - -uint32_t nrf_802154_random_get(void) -{ - return (uint32_t)rand_r(&m_seed); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random_stdlib.c b/third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random_stdlib.c deleted file mode 100644 index d2644f71d..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/random/nrf_802154_random_stdlib.c +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the pseudo-random number generator abstraction layer. - * - * This pseudo-random number abstraction layer uses standard library rand() function. - * - */ - -#include "nrf_802154_random.h" - -#include -#include - -#include "nrf.h" - -#if RAAL_SOFTDEVICE -#include -#endif // RAAL_SOFTDEVICE - -void nrf_802154_random_init(void) -{ - uint32_t seed; - -#if RAAL_SOFTDEVICE - uint32_t result; - - do - { - result = sd_rand_application_vector_get((uint8_t *)&seed, sizeof(seed)); - } - while (result != NRF_SUCCESS); -#else // RAAL_SOFTDEVICE - NRF_RNG->TASKS_START = 1; - - while (!NRF_RNG->EVENTS_VALRDY); - NRF_RNG->EVENTS_VALRDY = 0; - - seed = NRF_RNG->VALUE; -#endif // RAAL_SOFTDEVICE - - srand((unsigned int)seed); -} - -void nrf_802154_random_deinit(void) -{ - // Intentionally empty -} - -uint32_t nrf_802154_random_get(void) -{ - return (uint32_t)rand(); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/temperature/nrf_802154_temperature.h b/third_party/NordicSemiconductor/drivers/radio/platform/temperature/nrf_802154_temperature.h deleted file mode 100644 index 71f611bec..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/temperature/nrf_802154_temperature.h +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that defines the Thermometer Abstraction Layer for the 802.15.4 driver. - * - */ - -#ifndef NRF_802154_TEMPERATURE_H_ -#define NRF_802154_TEMPERATURE_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_temperature Thermometer Abstraction Layer for the 802.15.4 driver - * @{ - * @ingroup nrf_802154_temperature - * @brief The Thermometer Abstraction Layer interface for the 802.15.4 driver. - * - * The Thermometer Abstraction Layer is an abstraction layer of the thermometer that is used - * to correct RSSI, LQI and ED measurements, and the CCA threshold value. - * - */ - -/** - * @brief Initializes the thermometer. - */ -void nrf_802154_temperature_init(void); - -/** - * @brief Deinitializes the thermometer. - */ -void nrf_802154_temperature_deinit(void); - -/** - * @brief Gets the current temperature. - * - * @returns Current temperature, in centigrades (C). - */ -int8_t nrf_802154_temperature_get(void); - -/** - * @brief Callback function executed when the temperature changes. - */ -extern void nrf_802154_temperature_changed(void); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_TEMPERATURE_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/platform/temperature/nrf_802154_temperature_none.c b/third_party/NordicSemiconductor/drivers/radio/platform/temperature/nrf_802154_temperature_none.c deleted file mode 100644 index f6590b3b8..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/platform/temperature/nrf_802154_temperature_none.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the thermometer abstraction stub that does not use thermometer. - * - * This thermometer abstraction will cause RSSI, LQI, ED, CCA threshold errors up to 3 dBm when - * temperature of device differs more than 5 C from 20 C. - * - */ - -#include "nrf_802154_temperature.h" - -#include - -#define DEFAULT_TEMPERATURE 20 ///< Default temperature reported by this driver stub [C]. - -void nrf_802154_temperature_init(void) -{ - // Intentionally empty -} - -void nrf_802154_temperature_deinit(void) -{ - // Intentionally empty -} - -int8_t nrf_802154_temperature_get(void) -{ - return DEFAULT_TEMPERATURE; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch.c b/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch.c deleted file mode 100644 index 10fa6ebe8..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch.c +++ /dev/null @@ -1,561 +0,0 @@ -#include "nrf_802154_rsch.h" - -#include -#include -#include - -#include "../nrf_802154_debug.h" -#include "nrf_802154_priority_drop.h" -#include "platform/clock/nrf_802154_clock.h" -#include "platform/coex/nrf_802154_wifi_coex.h" -#include "raal/nrf_raal_api.h" -#include "timer_scheduler/nrf_802154_timer_sched.h" - -/* The following macro defines ramp-up time of preconditions [us]. It depends on HF clock, - * which takes the longest to ramp-up out of all preconditions. - * In case of nRF52811, the value of this macro is the sum of 360us of HFXO startup time, - * 31us of timer granularity margin, 55us of POWER_CLOCK_IRQHandler processing time, 60us of - * RTC_IRQHandler processing time and 9us of margin. - * In case of nRF52840, the value of this macro is the sum of 256us of HFXO debounce time, - * 75us of the worst case power-up time for an Epson crystal, 31us of timer granularity margin, - * 50us of POWER_CLOCK_IRQHandler processing time, 60us of RTC_IRQHandler processing time - * and 8us of margin. - */ -#ifdef NRF52811_XXAA -#define PREC_HFXO_STARTUP_TIME 360 -#define PREC_TIMER_GRANULARITY_MARGIN 31 -#define PREC_POWER_CLOCK_IRQ_HANDLER_PROC_TIME 50 -#define PREC_RTC_IRQ_HANDLER_PROC_TIME 60 -#define PREC_RAMP_UP_MARGIN 9 -#define PREC_RAMP_UP_TIME (PREC_HFXO_STARTUP_TIME + \ - PREC_TIMER_GRANULARITY_MARGIN + \ - PREC_POWER_CLOCK_IRQ_HANDLER_PROC_TIME + \ - PREC_RTC_IRQ_HANDLER_PROC_TIME + \ - PREC_RAMP_UP_MARGIN) -#else -#define PREC_HFXO_DEBOUNCE_TIME 256 -#define PREC_CRYSTAL_WORST_CASE_POWER_UP_TIME 75 -#define PREC_TIMER_GRANULARITY_MARGIN 31 -#define PREC_POWER_CLOCK_IRQ_HANDLER_PROC_TIME 50 -#define PREC_RTC_IRQ_HANDLER_PROC_TIME 60 -#define PREC_RAMP_UP_MARGIN 8 -#define PREC_RAMP_UP_TIME (PREC_HFXO_DEBOUNCE_TIME + \ - PREC_CRYSTAL_WORST_CASE_POWER_UP_TIME + \ - PREC_TIMER_GRANULARITY_MARGIN + \ - PREC_POWER_CLOCK_IRQ_HANDLER_PROC_TIME + \ - PREC_RTC_IRQ_HANDLER_PROC_TIME + \ - PREC_RAMP_UP_MARGIN) -#endif - -static volatile uint8_t m_ntf_mutex; ///< Mutex for notyfying core. -static volatile uint8_t m_ntf_mutex_monitor; ///< Mutex monitor, incremented every failed ntf mutex lock. -static volatile uint8_t m_req_mutex; ///< Mutex for requesting preconditions. -static volatile uint8_t m_req_mutex_monitor; ///< Mutex monitor, incremented every failed req mutex lock. -static volatile rsch_prio_t m_last_notified_prio; ///< Last reported approved priority level. -static volatile rsch_prio_t m_approved_prios[RSCH_PREC_CNT]; ///< Priority levels approved by each precondition. -static rsch_prio_t m_requested_prio; ///< Priority requested from all preconditions. -static rsch_prio_t m_cont_mode_prio; ///< Continuous mode priority level. If continuous mode is not requested equal to @ref RSCH_PRIO_IDLE. - -typedef struct -{ - rsch_prio_t prio; ///< Delayed timeslot priority level. If delayed timeslot is not scheduled equal to @ref RSCH_PRIO_IDLE. - uint32_t t0; ///< Time base of the delayed timeslot trigger time. - uint32_t dt; ///< Time delta of the delayed timeslot trigger time. - nrf_802154_timer_t timer; ///< Timer used to trigger delayed timeslot. -} dly_ts_t; - -static dly_ts_t m_dly_ts[RSCH_DLY_TS_NUM]; - -/** @brief Non-blocking mutex for notifying core. - * - * @param[inout] p_mutex Pointer to the mutex data. - * @param[inout] p_mutex_monitor Pointer to the mutex monitor counter. - * - * @retval true Mutex was acquired. - * @retval false Mutex could not be acquired. - */ -static inline bool mutex_trylock(volatile uint8_t * p_mutex, volatile uint8_t * p_mutex_monitor) -{ - nrf_802154_log_entry(mutex_trylock, 2); - - do - { - uint8_t mutex_value = __LDREXB(p_mutex); - - if (mutex_value) - { - __CLREX(); - - (*p_mutex_monitor)++; - - nrf_802154_log_exit(mutex_trylock, 2); - - return false; - } - } - while (__STREXB(1, p_mutex)); - - __DMB(); - - nrf_802154_log_exit(mutex_trylock, 2); - - return true; -} - -/** @brief Release mutex. */ -static inline void mutex_unlock(volatile uint8_t * p_mutex) -{ - nrf_802154_log_entry(mutex_unlock, 2); - - __DMB(); - *p_mutex = 0; - - nrf_802154_log_exit(mutex_unlock, 2); -} - -/** @brief Check maximal priority level required by any of delayed timeslots at the moment. - * - * To meet delayed timeslot timing requirements there is a time window in which radio - * preconditions should be requested. This function is used to prevent releasing preconditions - * in this time window. - * - * @return Maximal priority level required by delayed timeslots. - */ -static rsch_prio_t max_prio_for_delayed_timeslot_get(void) -{ - nrf_802154_log_entry(max_prio_for_delayed_timeslot_get, 2); - - rsch_prio_t result = RSCH_PRIO_IDLE; - uint32_t now = nrf_802154_timer_sched_time_get(); - - for (uint32_t i = 0; i < RSCH_DLY_TS_NUM; i++) - { - dly_ts_t * p_dly_ts = &m_dly_ts[i]; - uint32_t t0 = p_dly_ts->t0; - uint32_t dt = p_dly_ts->dt - PREC_RAMP_UP_TIME - - nrf_802154_timer_sched_granularity_get(); - - if ((p_dly_ts->prio > result) && !nrf_802154_timer_sched_time_is_in_future(now, t0, dt)) - { - result = p_dly_ts->prio; - } - } - - nrf_802154_log_exit(max_prio_for_delayed_timeslot_get, 2); - - return result; -} - -static rsch_prio_t required_prio_lvl_get(void) -{ - nrf_802154_log_entry(required_prio_lvl_get, 2); - - rsch_prio_t result = max_prio_for_delayed_timeslot_get(); - - if (m_cont_mode_prio > result) - { - result = m_cont_mode_prio; - } - - nrf_802154_log_exit(required_prio_lvl_get, 2); - - return result; -} - -/** @brief Set approved priority level @p prio on given precondition @p prec. - * - * When requested priority level equals to the @ref RSCH_PRIO_IDLE this function will approve only - * the @ref RSCH_PRIO_IDLE priority level and drop other approved levels silently. - * - * @param[in] prec Precondition which state will be changed. - * @param[in] prio Approved priority level for given precondition. - */ -static inline void prec_approved_prio_set(rsch_prec_t prec, rsch_prio_t prio) -{ - nrf_802154_log_entry(prec_approved_prio_set, 2); - - assert(prec <= RSCH_PREC_CNT); - - if ((m_requested_prio == RSCH_PRIO_IDLE) && (prio != RSCH_PRIO_IDLE)) - { - // Ignore approved precondition - it was not requested. - return; - } - - assert((m_approved_prios[prec] != prio) || (prio == RSCH_PRIO_IDLE)); - - m_approved_prios[prec] = prio; - - nrf_802154_log_exit(prec_approved_prio_set, 2); -} - -/** @brief Request all preconditions. - */ -static inline void all_prec_update(void) -{ - nrf_802154_log_entry(all_prec_update, 2); - - rsch_prio_t prev_prio; - rsch_prio_t new_prio; - uint8_t monitor; - - do - { - if (!mutex_trylock(&m_req_mutex, &m_req_mutex_monitor)) - { - return; - } - - monitor = m_req_mutex_monitor; - prev_prio = m_requested_prio; - new_prio = required_prio_lvl_get(); - - if (prev_prio != new_prio) - { - m_requested_prio = new_prio; - - nrf_802154_wifi_coex_prio_request(new_prio); - prec_approved_prio_set(RSCH_PREC_COEX, new_prio); - - if (new_prio == RSCH_PRIO_IDLE) - { - nrf_802154_priority_drop_hfclk_stop(); - prec_approved_prio_set(RSCH_PREC_HFCLK, RSCH_PRIO_IDLE); - - nrf_raal_continuous_mode_exit(); - prec_approved_prio_set(RSCH_PREC_RAAL, RSCH_PRIO_IDLE); - } - else - { - nrf_802154_priority_drop_hfclk_stop_terminate(); - nrf_802154_clock_hfclk_start(); - nrf_raal_continuous_mode_enter(); - } - } - - mutex_unlock(&m_req_mutex); - } - while (monitor != m_req_mutex_monitor); - - nrf_802154_log_exit(all_prec_update, 2); -} - -/** @brief Get currently approved priority level. - * - * @return Maximal priority level approved by all radio preconditions. - */ -static inline rsch_prio_t approved_prio_lvl_get(void) -{ - nrf_802154_log_entry(approved_prio_lvl_get, 2); - - rsch_prio_t result = RSCH_PRIO_MAX; - - for (uint32_t i = 0; i < RSCH_PREC_CNT; i++) - { - if (m_approved_prios[i] < result) - { - result = m_approved_prios[i]; - } - } - - nrf_802154_log_exit(approved_prio_lvl_get, 2); - - return result; -} - -/** @brief Check if all preconditions are requested or met at given priority level or higher. - * - * @param[in] prio Minimal priority level requested from preconditions. - * - * @retval true All preconditions are requested or met at given or higher level. - * @retval false At least one precondition is requested at lower level than required. - */ -static inline bool requested_prio_lvl_is_at_least(rsch_prio_t prio) -{ - nrf_802154_log_entry(requested_prio_lvl_is_at_least, 2); - nrf_802154_log_exit(requested_prio_lvl_is_at_least, 2); - - return m_requested_prio >= prio; -} - -/** @brief Notify core if preconditions are approved or denied if current state differs from last reported. - */ -static inline void notify_core(void) -{ - nrf_802154_log_entry(notify_core, 2); - - rsch_prio_t approved_prio_lvl; - uint8_t temp_mon; - - do - { - if (!mutex_trylock(&m_ntf_mutex, &m_ntf_mutex_monitor)) - { - return; - } - - /* It is possible that preemption is not detected (m_ntf_mutex_monitor is read after - * acquiring mutex). It is not a problem because we will call proper handler function - * requested by preempting context. Avoiding this race would generate one additional - * iteration without any effect. - */ - temp_mon = m_ntf_mutex_monitor; - approved_prio_lvl = approved_prio_lvl_get(); - - if (m_last_notified_prio != approved_prio_lvl) - { - m_last_notified_prio = approved_prio_lvl; - - nrf_802154_rsch_continuous_prio_changed(approved_prio_lvl); - } - - mutex_unlock(&m_ntf_mutex); - } - while (temp_mon != m_ntf_mutex_monitor); - - nrf_802154_log_exit(notify_core, 2); -} - -/** Timer callback used to trigger delayed timeslot. - * - * @param[in] p_context Index of the delayed timeslot operation (TX or RX). - */ -static void delayed_timeslot_start(void * p_context) -{ - rsch_dly_ts_id_t dly_ts_id = (rsch_dly_ts_id_t)(uint32_t)p_context; - dly_ts_t * p_dly_ts = &m_dly_ts[dly_ts_id]; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RSCH_TIMER_DELAYED_START); - - nrf_802154_rsch_delayed_timeslot_started(dly_ts_id); - - p_dly_ts->prio = RSCH_PRIO_IDLE; - - all_prec_update(); - notify_core(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RSCH_TIMER_DELAYED_START); -} - -/** Timer callback used to request preconditions for delayed timeslot. - * - * @param[in] p_context Index of the delayed timeslot operation (TX or RX). - */ -static void delayed_timeslot_prec_request(void * p_context) -{ - rsch_dly_ts_id_t dly_ts_id = (rsch_dly_ts_id_t)(uint32_t)p_context; - dly_ts_t * p_dly_ts = &m_dly_ts[dly_ts_id]; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RSCH_TIMER_DELAYED_PREC); - - all_prec_update(); - - p_dly_ts->timer.t0 = p_dly_ts->t0; - p_dly_ts->timer.dt = p_dly_ts->dt; - p_dly_ts->timer.callback = delayed_timeslot_start; - p_dly_ts->timer.p_context = p_context; - - nrf_802154_timer_sched_add(&p_dly_ts->timer, true); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RSCH_TIMER_DELAYED_PREC); -} - -/*************************************************************************************************** - * Public API - **************************************************************************************************/ - -void nrf_802154_rsch_init(void) -{ - nrf_raal_init(); - nrf_802154_wifi_coex_init(); - - m_ntf_mutex = 0; - m_req_mutex = 0; - m_last_notified_prio = RSCH_PRIO_IDLE; - m_cont_mode_prio = RSCH_PRIO_IDLE; - m_requested_prio = RSCH_PRIO_IDLE; - - for (uint32_t i = 0; i < RSCH_DLY_TS_NUM; i++) - { - m_dly_ts[i].prio = RSCH_PRIO_IDLE; - } - - for (uint32_t i = 0; i < RSCH_PREC_CNT; i++) - { - m_approved_prios[i] = RSCH_PRIO_IDLE; - } -} - -void nrf_802154_rsch_uninit(void) -{ - for (uint32_t i = 0; i < RSCH_DLY_TS_NUM; i++) - { - nrf_802154_timer_sched_remove(&m_dly_ts[i].timer, NULL); - } - - nrf_802154_wifi_coex_uninit(); - nrf_raal_uninit(); -} - -void nrf_802154_rsch_continuous_mode_priority_set(rsch_prio_t prio) -{ - nrf_802154_log(EVENT_TRACE_ENTER, (prio > RSCH_PRIO_IDLE) ? FUNCTION_RSCH_CONTINUOUS_ENTER : - FUNCTION_RSCH_CONTINUOUS_EXIT); - - m_cont_mode_prio = prio; - __DMB(); - - all_prec_update(); - notify_core(); - - nrf_802154_log(EVENT_TRACE_EXIT, (prio > RSCH_PRIO_IDLE) ? FUNCTION_RSCH_CONTINUOUS_ENTER : - FUNCTION_RSCH_CONTINUOUS_EXIT); -} - -void nrf_802154_rsch_continuous_ended(void) -{ - nrf_raal_continuous_ended(); -} - -bool nrf_802154_rsch_timeslot_request(uint32_t length_us) -{ - return nrf_raal_timeslot_request(length_us); -} - -bool nrf_802154_rsch_delayed_timeslot_request(uint32_t t0, - uint32_t dt, - uint32_t length, - rsch_prio_t prio, - rsch_dly_ts_id_t dly_ts_id) -{ - (void)length; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RSCH_DELAYED_TIMESLOT_REQ); - assert(dly_ts_id < RSCH_DLY_TS_NUM); - - dly_ts_t * p_dly_ts = &m_dly_ts[dly_ts_id]; - uint32_t now = nrf_802154_timer_sched_time_get(); - uint32_t req_dt = dt - PREC_RAMP_UP_TIME; - bool result; - - assert(!nrf_802154_timer_sched_is_running(&p_dly_ts->timer)); - assert(p_dly_ts->prio == RSCH_PRIO_IDLE); - assert(prio != RSCH_PRIO_IDLE); - - if (nrf_802154_timer_sched_time_is_in_future(now, t0, req_dt)) - { - p_dly_ts->prio = prio; - p_dly_ts->t0 = t0; - p_dly_ts->dt = dt; - - p_dly_ts->timer.t0 = t0; - p_dly_ts->timer.dt = req_dt; - p_dly_ts->timer.callback = delayed_timeslot_prec_request; - p_dly_ts->timer.p_context = (void *)dly_ts_id; - - nrf_802154_timer_sched_add(&p_dly_ts->timer, false); - - result = true; - } - else if (requested_prio_lvl_is_at_least(RSCH_PRIO_MAX) && - nrf_802154_timer_sched_time_is_in_future(now, t0, dt)) - { - p_dly_ts->prio = prio; - p_dly_ts->t0 = t0; - p_dly_ts->dt = dt; - - p_dly_ts->timer.t0 = t0; - p_dly_ts->timer.dt = dt; - p_dly_ts->timer.callback = delayed_timeslot_start; - p_dly_ts->timer.p_context = (void *)dly_ts_id; - - nrf_802154_timer_sched_add(&p_dly_ts->timer, true); - - result = true; - } - else - { - result = false; - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RSCH_DELAYED_TIMESLOT_REQ); - - return result; -} - -bool nrf_802154_rsch_delayed_timeslot_cancel(rsch_dly_ts_id_t dly_ts_id) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RSCH_DELAYED_TIMESLOT_CANCEL); - assert(dly_ts_id < RSCH_DLY_TS_NUM); - - bool result = false; - dly_ts_t * p_dly_ts = &m_dly_ts[dly_ts_id]; - bool was_running; - - nrf_802154_timer_sched_remove(&p_dly_ts->timer, &was_running); - - p_dly_ts->prio = RSCH_PRIO_IDLE; - all_prec_update(); - notify_core(); - - result = was_running; - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RSCH_DELAYED_TIMESLOT_CANCEL); - - return result; -} - -bool nrf_802154_rsch_timeslot_is_requested(void) -{ - bool result = false; - - for (uint32_t i = 0; i < RSCH_PREC_CNT; i++) - { - if (m_approved_prios[i] > RSCH_PRIO_IDLE) - { - result = true; - break; - } - } - - return result; -} - -bool nrf_802154_rsch_prec_is_approved(rsch_prec_t prec, rsch_prio_t prio) -{ - assert(prec < RSCH_PREC_CNT); - return m_approved_prios[prec] >= prio; -} - -uint32_t nrf_802154_rsch_timeslot_us_left_get(void) -{ - return nrf_raal_timeslot_us_left_get(); -} - -// External handlers - -void nrf_raal_timeslot_started(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RSCH_TIMESLOT_STARTED); - - prec_approved_prio_set(RSCH_PREC_RAAL, RSCH_PRIO_MAX); - notify_core(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RSCH_TIMESLOT_STARTED); -} - -void nrf_raal_timeslot_ended(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RSCH_TIMESLOT_ENDED); - - prec_approved_prio_set(RSCH_PREC_RAAL, RSCH_PRIO_IDLE); - notify_core(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RSCH_TIMESLOT_ENDED); -} - -void nrf_802154_clock_hfclk_ready(void) -{ - prec_approved_prio_set(RSCH_PREC_HFCLK, RSCH_PRIO_MAX); - notify_core(); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch.h b/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch.h deleted file mode 100644 index 5d258577d..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch.h +++ /dev/null @@ -1,246 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that defines the Radio Scheduler interface. - * - */ - -#ifndef NRF_802154_RSCH_H_ -#define NRF_802154_RSCH_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_rsch Radio Scheduler - * @{ - * @ingroup nrf_802154 - * @brief The Radio Scheduler interface. - * - * Radio Scheduler is responsible to schedule radio activities and preconditions in time. It is - * expected that the Radio Scheduler module manages timings to meet the requirements requested from - * the core module. - * - * Examples of the radio activity preconditions are: High-Frequency Clock running, radio arbiter (RAAL) - * granted access to the RADIO peripheral. - */ - -/** - * @brief List of the preconditions that have to be met before any radio activity. - */ -typedef enum -{ - RSCH_PREC_HFCLK, - RSCH_PREC_RAAL, - RSCH_PREC_COEX, - RSCH_PREC_CNT, -} rsch_prec_t; - -/** - * @brief Priorities of the 802.15.4 radio operations. - */ -typedef enum -{ - RSCH_PRIO_IDLE, ///< Priority used in the sleep state. With this priority, RSCH releases all preconditions. - RSCH_PRIO_IDLE_LISTENING, ///< Priority used during the idle listening procedure. - RSCH_PRIO_RX, ///< Priority used when a frame is being received. - RSCH_PRIO_DETECT, ///< Priority used to detect channel conditions (CCA, ED). - RSCH_PRIO_TX, ///< Priority used to transmit a frame. - - RSCH_PRIO_MIN_APPROVED = RSCH_PRIO_IDLE_LISTENING, ///< Minimal priority indicating that the given precondition is approved. - RSCH_PRIO_MAX = RSCH_PRIO_TX, ///< Maximal priority available in the RSCH module. -} rsch_prio_t; - -/** - * @brief Enumeration of the delayed timeslot IDs. - */ -typedef enum -{ - RSCH_DLY_TX, ///< Timeslot for delayed TX operation. - RSCH_DLY_RX, ///< Timeslot for delayed RX operation. - - RSCH_DLY_TS_NUM, ///< Number of delayed timeslots. -} rsch_dly_ts_id_t; - -/** - * @brief Initializes Radio Scheduler. - * - * @note This function must be called once, before any other function from this module. - * - * @note Radio Scheduler starts in the inactive mode after the initialization. To start the radio activity, - * @ref nrf_802154_rsch_continuous_mode_enter should be called. - * - */ -void nrf_802154_rsch_init(void); - -/** - * @brief Deinitializes Radio Scheduler. - * - */ -void nrf_802154_rsch_uninit(void); - -/** - * @brief Sets the priority for the continuous radio mode. - * - * In the continuous mode, Radio Scheduler tries to satisfy all preconditions for as long as - * possible to give the radio driver core as much radio time as possible while - * disturbing the other activities to the minimum extent. - * - * @note The start of a timeslot is indicated by the @ref nrf_802154_rsch_prec_is_approved call. - * @note To disable the continuous radio mode, the @ref RSCH_PRIO_IDLE should be used. - * - * @param[in] prio Priority level used in the continuous radio mode. - * - */ -void nrf_802154_rsch_continuous_mode_priority_set(rsch_prio_t prio); - -/** - * @brief Confirms that the current part of the continuous timeslot is ended by the core. - * - * This confirmation is used by the core to synchronize the ending of the continuous timeslot parts with - * the RSCH module. - * - */ -void nrf_802154_rsch_continuous_ended(void); - -/** - * @brief Immediately requests a timeslot for radio communication. - * - * This function is to be called only after @ref nrf_802154_rsch_prec_is_approved indicated the - * start of a timeslot. - * - * @param[in] length_us Requested radio timeslot length in microseconds. - * - * @retval true Radio driver has now exclusive access to the RADIO peripheral for the - * full length of the timeslot. - * @retval false Slot cannot be assigned due to other activities. - * - */ -bool nrf_802154_rsch_timeslot_request(uint32_t length_us); - -/** - * @brief Requests a timeslot in the future. - * - * Request timeslot that is to be granted in the future. The function parameters provide data when - * the timeslot is supposed to start and how long it is to last. When the requested timeslot starts, - * @ref nrf_802154_rsch_delayed_timeslot_started is called. - * - * @note @ref nrf_802154_rsch_delayed_timeslot_started can be delayed and it is up to - * the called module to check the delay and decide if it causes any issues. - * - * @note The time parameters use the same units that are used in the Timer Scheduler module. - * - * @param[in] t0 Base time of the timestamp of the timeslot start, in microseconds. - * @param[in] dt Time delta between @p t0 and the timestamp of the timeslot start, in microseconds. - * @param[in] length Requested radio timeslot length, in microseconds. - * @param[in] prio Priority level required for the delayed timeslot. - * @param[in] dly_ts Type of the requested timeslot. - * - * @retval true Requested timeslot has been scheduled. - * @retval false Requested timeslot cannot be scheduled and will not be granted. - */ -bool nrf_802154_rsch_delayed_timeslot_request(uint32_t t0, - uint32_t dt, - uint32_t length, - rsch_prio_t prio, - rsch_dly_ts_id_t dly_ts); - -/** - * @brief Cancels a requested future timeslot. - * - * @param[in] dly_ts_id Type of the requested timeslot. - * - * @retval true Scheduled timeslot has been cancelled. - * @retval false No scheduled timeslot has been requested (nothing to cancel). - */ -bool nrf_802154_rsch_delayed_timeslot_cancel(rsch_dly_ts_id_t dly_ts_id); - -/** - * @brief Checks if there is a pending timeslot request. - * - * @note The delayed timeslot is considered requested once its preconditions are requested - * or granted. - * - * @retval true There is a timeslot request pending. - * @retval false There are no pending timeslot requests. - */ -bool nrf_802154_rsch_timeslot_is_requested(void); - -/** - * @brief Checks if the RSCH precondition is satisfied. - * - * @param[in] prec RSCH precondition to be checked. - * @param[in] prio Minimal required priority level of the given precondition. - * - * @retval true Precondition @p prec is currently granted. - * @retval false Precondition @p prec is not currently granted. - */ -bool nrf_802154_rsch_prec_is_approved(rsch_prec_t prec, rsch_prio_t prio); - -/** - * @brief Gets the remaining time of the currently granted timeslot, in microseconds. - * - * @returns Number of microseconds remaining in the currently granted timeslot. - */ -uint32_t nrf_802154_rsch_timeslot_us_left_get(void); - -/** - * @brief Notifies the core about changes of the approved priority level. - * - * If @p prio is greater than @ref RSCH_PRIO_IDLE, the radio driver has exclusive access to the - * peripherals until this function is called with @p prio equal to @ref RSCH_PRIO_IDLE. - * - * @note The end of the timeslot is indicated by @p prio equal to @ref RSCH_PRIO_IDLE. - * - * @param[in] prio Currently approved priority level. - */ -extern void nrf_802154_rsch_continuous_prio_changed(rsch_prio_t prio); - -/** - * @brief Notifies that the previously requested delayed timeslot has started just now. - * - * @param[in] dly_ts_id Type of the started timeslot. - */ -extern void nrf_802154_rsch_delayed_timeslot_started(rsch_dly_ts_id_t dly_ts_id); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_RSCH_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch_crit_sect.c b/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch_crit_sect.c deleted file mode 100644 index da8dcf2e5..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch_crit_sect.c +++ /dev/null @@ -1,154 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements critical sections for the RSCH module. - * - */ - -#include "nrf_802154_rsch_crit_sect.h" - -#include -#include -#include - -#include "nrf_802154_critical_section.h" -#include "nrf_802154_rsch.h" - -#include - -#define RSCH_EVT_NONE (rsch_prio_t)UINT8_MAX - -static volatile uint8_t m_rsch_pending_evt; ///< Indicator of pending RSCH event. - -/*************************************************************************************************** - * @section RSCH pending events management - **************************************************************************************************/ - -static void rsch_pending_evt_set(rsch_prio_t prio) -{ - volatile uint8_t rsch_pending_evt; // Dummy variable to prevent compilers from removing ldrex - - do - { - rsch_pending_evt = __LDREXB(&m_rsch_pending_evt); - (void)rsch_pending_evt; - } - while (__STREXB((uint8_t)prio, &m_rsch_pending_evt)); -} - -static rsch_prio_t rsch_pending_evt_clear(void) -{ - uint8_t evt_value; - - do - { - evt_value = __LDREXB(&m_rsch_pending_evt); - } - while (__STREXB(RSCH_EVT_NONE, &m_rsch_pending_evt)); - - return (rsch_prio_t)evt_value; -} - -static bool rsch_pending_evt_is_none(void) -{ - return m_rsch_pending_evt == (uint8_t)RSCH_EVT_NONE; -} - -static void rsch_evt_process(rsch_prio_t evt) -{ - if (evt != RSCH_EVT_NONE) - { - nrf_802154_rsch_crit_sect_prio_changed(evt); - } -} - -/*************************************************************************************************** - * @section Public API - **************************************************************************************************/ - -void nrf_802154_rsch_crit_sect_init(void) -{ - m_rsch_pending_evt = RSCH_EVT_NONE; -} - -void nrf_802154_rsch_crit_sect_prio_request(rsch_prio_t prio) -{ - nrf_802154_rsch_continuous_mode_priority_set(prio); -} - -/*************************************************************************************************** - * @section RSCH callbacks - **************************************************************************************************/ - -void nrf_802154_rsch_continuous_prio_changed(rsch_prio_t prio) -{ - bool crit_sect_success = false; - - crit_sect_success = nrf_802154_critical_section_enter(); - - // If we managed to enter critical section, but there is already a pending event, - // it means that the Critical Section module is about to make one more iteration of the - // critical section exit procedure. To prevent race in continuous mode priorities notification, - // we do not notify directly, but just update the pending event. - if (crit_sect_success && rsch_pending_evt_is_none()) - { - nrf_802154_rsch_crit_sect_prio_changed(prio); - } - else - { - rsch_pending_evt_set(prio); - } - - if (crit_sect_success) - { - nrf_802154_critical_section_exit(); - } -} - -/*************************************************************************************************** - * @section Critical section callbacks - **************************************************************************************************/ - -void nrf_802154_critical_section_rsch_enter(void) -{ - // Intentionally empty -} - -void nrf_802154_critical_section_rsch_exit(void) -{ - rsch_evt_process(rsch_pending_evt_clear()); -} - -bool nrf_802154_critical_section_rsch_event_is_pending(void) -{ - return !rsch_pending_evt_is_none(); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch_crit_sect.h b/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch_crit_sect.h deleted file mode 100644 index ff8902542..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/nrf_802154_rsch_crit_sect.h +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (c) 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_802154_RSCH_CRIT_SECT_H__ -#define NRF_802154_RSCH_CRIT_SECT_H__ - -#include - -#include "nrf_802154_rsch.h" - -/** - * @defgroup nrf_802154_rsch_crit_sect RSCH event queue used during critical sections - * @{ - * @ingroup nrf_802154_rsch - * @brief The critical section implementation for the RSCH module. - */ - -/** - * @brief Initializes the RSCH critical section module. - */ -void nrf_802154_rsch_crit_sect_init(void); - -/** - * @brief Requests the priority level from RSCH through the critical section module. - * - * @param[in] prio Requested priority level. - */ -void nrf_802154_rsch_crit_sect_prio_request(rsch_prio_t prio); - -/** - * @brief Notifies the core that the approved RSCH priority has changed. - * - * @note This function is called from the critical section context and does not preempt - * other critical sections. - * - * @param[in] prio Approved priority level. - */ -extern void nrf_802154_rsch_crit_sect_prio_changed(rsch_prio_t prio); - -/** - *@} - **/ - -#endif // NRF_802154_RSCH_CRIT_SECT_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/nrf_raal_api.h b/third_party/NordicSemiconductor/drivers/radio/rsch/raal/nrf_raal_api.h deleted file mode 100644 index bb09ee419..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/nrf_raal_api.h +++ /dev/null @@ -1,161 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that defines the Radio Arbiter Abstraction Layer interface. - * - */ - -#ifndef NRF_RAAL_API_H_ -#define NRF_RAAL_API_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_raal Radio Arbiter Abstraction Layer - * @{ - * @ingroup nrf_802154 - * @brief The Radio Arbiter Abstraction Layer interface. - */ - -/** - * @brief Initializes Radio Arbiter Abstraction Layer client. - * - * This function must be called once, before any other function from this module. - * - * @note The arbiter starts in the inactive mode after the initialization. - * To start the radio activity, the @p nrf_raal_continuous_mode_enter method must be called. - * - */ -void nrf_raal_init(void); - -/** - * @brief Deinitializes Radio Arbiter Abstraction Layer client. - * - */ -void nrf_raal_uninit(void); - -/** - * @brief Puts the arbiter into the continuous radio mode. - * - * In this mode, the radio arbiter tries to create long continuous timeslots that will give - * the radio driver as much radio time as possible while disturbing the other activities as little - * as possible. - * - * @note The start of a timeslot is indicated by the @p nrf_raal_timeslot_started call. - * - */ -void nrf_raal_continuous_mode_enter(void); - -/** - * @brief Moves the arbiter out of the continuous mode. - * - * In this mode, the radio arbiter does not extend or allocate any more timeslots for - * the radio driver. - * - */ -void nrf_raal_continuous_mode_exit(void); - -/** - * @brief Sends a confirmation to RAAL that the current part of the continuous timeslot is ended. - * - * The core cannot use the RADIO peripheral after this call until the timeslot is started again. - */ -void nrf_raal_continuous_ended(void); - -/** - * @brief Requests a timeslot for radio communication. - * - * This method is to be called only after @p nrf_raal_timeslot_started indicated the start - * of a timeslot. - * - * @param[in] length_us Requested radio timeslot length in microseconds. - * - * @retval true Radio driver has now exclusive access to the RADIO peripheral for the - * full length of the timeslot. - * @retval false Slot cannot be assigned due to other activities. - * - */ -bool nrf_raal_timeslot_request(uint32_t length_us); - -/** - * @brief Gets the remaining time of the currently granted timeslot, in microseconds. - * - * @returns Number of microseconds left in the currently granted timeslot. - */ -uint32_t nrf_raal_timeslot_us_left_get(void); - -/** - * @brief Notifies the radio driver about the start of a timeslot. Called by the RAAL client. - * - * The radio driver has now exclusive access to the peripherals until @p nrf_raal_timeslot_ended - * is called. - * - * @note The high frequency clock must be enabled when this function is called. - * @note The end of the timeslot is indicated by the @p nrf_raal_timeslot_ended function. - * - */ -extern void nrf_raal_timeslot_started(void); - -/** - * @brief Notifies the radio driver about the end of a timeslot. Called by the RAAL client. - * - * Depending on the RAAL client configuration, the radio driver has NRF_RAAL_MAX_CLEAN_UP_TIME_US - * microseconds to do any clean-up actions on the RADIO peripheral and stop using it. - * For this reason, the arbiter must call this function NRF_RAAL_MAX_CLEAN_UP_TIME_US microseconds - * before timeslot is finished. - * - * If RAAL is in the continuous mode, the next timeslot is indicated again by - * the @p nrf_raal_timeslot_started function. - * - * The radio driver will assume that the timeslot has been finished after - * the @p nrf_raal_continuous_mode_exit call. - * - * @note Because the radio driver must stop any operation on the RADIO peripheral within - * NRF_RAAL_MAX_CLEAN_UP_TIME_US microseconds, this method is to be called with high - * interrupt priority level to avoid unwanted delays. - * - */ -extern void nrf_raal_timeslot_ended(void); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_RAAL_API_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/nrf_raal_config.h b/third_party/NordicSemiconductor/drivers/radio/rsch/raal/nrf_raal_config.h deleted file mode 100644 index 014ca19bc..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/nrf_raal_config.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_RAAL_CONFIG_H__ -#define NRF_RAAL_CONFIG_H__ - -#ifdef NRF_802154_PROJECT_CONFIG -#include NRF_802154_PROJECT_CONFIG -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_raal_config RAAL configuration - * @{ - * @ingroup nrf_802154 - * @brief Configuration of Radio Arbiter Abstraction Layer. - */ - -/** - * @def NRF_RAAL_MAX_CLEAN_UP_TIME_US - * - * The maximum time in which the radio driver must do any clean-up actions on the RADIO peripheral - * and stop using it. - * - */ -#ifndef NRF_RAAL_MAX_CLEAN_UP_TIME_US -#define NRF_RAAL_MAX_CLEAN_UP_TIME_US 91 -#endif - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif // NRF_RAAL_CONFIG_H__ diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/simulator/nrf_802154_debug.h b/third_party/NordicSemiconductor/drivers/radio/rsch/raal/simulator/nrf_802154_debug.h deleted file mode 100644 index ef3959ad1..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/simulator/nrf_802154_debug.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains debug helpers for the 802.15.4 radio driver for the nRF SoC devices. - * - */ - -#ifndef NRF_802154_DEBUG_H_ -#define NRF_802154_DEBUG_H_ - -#include - -#include "nrf_802154_debug_core.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define EVENT_TIMESLOT_REQUEST 0x0007UL -#define EVENT_TIMESLOT_REQUEST_RESULT 0x0008UL - -/* Reserved for RAAL: 0x0300 - 0x047F */ - -#define FUNCTION_RAAL_CRIT_SECT_ENTER 0x0301UL -#define FUNCTION_RAAL_CRIT_SECT_EXIT 0x0302UL -#define FUNCTION_RAAL_CONTINUOUS_ENTER 0x0303UL -#define FUNCTION_RAAL_CONTINUOUS_EXIT 0x0304UL - -#define FUNCTION_RAAL_SIG_HANDLER 0x0400UL -#define FUNCTION_RAAL_SIG_EVENT_START 0x0401UL -#define FUNCTION_RAAL_SIG_EVENT_MARGIN 0x0402UL -#define FUNCTION_RAAL_SIG_EVENT_EXTEND 0x0403UL -#define FUNCTION_RAAL_SIG_EVENT_ENDED 0x0404UL -#define FUNCTION_RAAL_SIG_EVENT_RADIO 0x0405UL -#define FUNCTION_RAAL_SIG_EVENT_EXTEND_SUCCESS 0x0406UL -#define FUNCTION_RAAL_SIG_EVENT_EXTEND_FAIL 0x0407UL -#define FUNCTION_RAAL_EVT_BLOCKED 0x0408UL -#define FUNCTION_RAAL_EVT_SESSION_IDLE 0x0409UL -#define FUNCTION_RAAL_EVT_HFCLK_READY 0x040AUL -#define FUNCTION_RAAL_SIG_EVENT_MARGIN_MOVE 0x040BUL - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_DEBUG_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/simulator/nrf_raal_simulator.c b/third_party/NordicSemiconductor/drivers/radio/rsch/raal/simulator/nrf_raal_simulator.c deleted file mode 100644 index 7bfae69f2..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/simulator/nrf_raal_simulator.c +++ /dev/null @@ -1,251 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the nrf 802.15.4 simulated radio arbiter. - * - * This arbiter should be used for testing driver and tweaking other arbiters. - * - */ - -#include "rsch/raal/nrf_raal_api.h" - -#include -#include -#include - -#include "nrf.h" -#include "nrf_802154_debug.h" - -static bool m_continuous_requested; -static bool m_continuous_granted; - -static uint16_t m_time_interval = 250; // ms -static uint16_t m_ble_duty = 10; // ms -static uint16_t m_pre_preemption_notification = 150; // us - -static uint32_t m_ended_timestamp; -static uint32_t m_started_timestamp; -static uint32_t m_margin_timestamp; - -static void continuous_grant(void) -{ - if (m_continuous_requested && !m_continuous_granted) - { - nrf_802154_pin_set(PIN_DBG_TIMESLOT_ACTIVE); - m_continuous_granted = true; - nrf_raal_timeslot_started(); - } -} - -static void continuous_revoke(void) -{ - if (m_continuous_requested && m_continuous_granted) - { - nrf_802154_pin_clr(PIN_DBG_TIMESLOT_ACTIVE); - m_continuous_granted = false; - nrf_raal_timeslot_ended(); - } -} - -static uint32_t time_get(void) -{ - NRF_TIMER0->TASKS_CAPTURE[1] = 1; - return NRF_TIMER0->CC[1]; -} - -void nrf_raal_init(void) -{ - m_ended_timestamp = m_time_interval * 1000UL; - m_started_timestamp = m_ble_duty * 1000UL; - m_margin_timestamp = (m_time_interval * 1000UL) - m_pre_preemption_notification; - - NRF_MWU->PREGION[0].SUBS = 0x00000002; - NRF_MWU->INTENSET = MWU_INTENSET_PREGION0WA_Msk | MWU_INTENSET_PREGION0RA_Msk; - - NVIC_SetPriority(MWU_IRQn, 0); - NVIC_ClearPendingIRQ(MWU_IRQn); - NVIC_EnableIRQ(MWU_IRQn); - - NRF_TIMER0->MODE = TIMER_MODE_MODE_Timer; - NRF_TIMER0->BITMODE = TIMER_BITMODE_BITMODE_24Bit; - NRF_TIMER0->PRESCALER = 4; - NRF_TIMER0->INTENSET = TIMER_INTENSET_COMPARE0_Msk; - NRF_TIMER0->CC[0] = m_started_timestamp; - - NVIC_SetPriority(TIMER0_IRQn, 1); - NVIC_ClearPendingIRQ(TIMER0_IRQn); - NVIC_EnableIRQ(TIMER0_IRQn); - - m_continuous_requested = false; - - NRF_TIMER0->TASKS_START = 1; -} - -void nrf_raal_uninit(void) -{ - // Intentionally empty. -} - -void nrf_raal_continuous_mode_enter(void) -{ - uint32_t time; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_CONTINUOUS_ENTER); - - assert(!m_continuous_requested); - - m_continuous_requested = true; - - NVIC_DisableIRQ(TIMER0_IRQn); - __DSB(); - __ISB(); - - time = time_get(); - - if ((time >= m_started_timestamp) && (time < m_margin_timestamp)) - { - continuous_grant(); - } - - NVIC_EnableIRQ(TIMER0_IRQn); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_CONTINUOUS_ENTER); -} - -void nrf_raal_continuous_mode_exit(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_CONTINUOUS_EXIT); - - assert(m_continuous_requested); - - m_continuous_requested = false; - m_continuous_granted = false; - - nrf_802154_pin_clr(PIN_DBG_TIMESLOT_ACTIVE); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_CONTINUOUS_EXIT); -} - -void nrf_raal_continuous_ended(void) -{ - // Intentionally empty. -} - -bool nrf_raal_timeslot_request(uint32_t length_us) -{ - uint32_t timer; - - assert(m_continuous_requested); - - if (!m_continuous_granted) - { - return false; - } - - timer = time_get(); - - return (timer >= m_started_timestamp) && ((timer + length_us) < m_margin_timestamp); -} - -uint32_t nrf_raal_timeslot_us_left_get(void) -{ - uint32_t timer = time_get(); - - return ((timer >= m_started_timestamp) && (timer < m_margin_timestamp)) ? - (m_margin_timestamp - timer) : 0; -} - -void TIMER0_IRQHandler(void) -{ - uint32_t ev_timestamp; - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_HANDLER); - - if (NRF_TIMER0->EVENTS_COMPARE[0]) - { - while (time_get() >= NRF_TIMER0->CC[0]) - { - NRF_TIMER0->EVENTS_COMPARE[0] = 0; - - ev_timestamp = NRF_TIMER0->CC[0]; - - if (ev_timestamp == m_ended_timestamp) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_ENDED); - - NRF_MWU->REGIONENSET = MWU_REGIONENSET_PRGN0WA_Msk | MWU_REGIONENSET_PRGN0RA_Msk; - - NRF_TIMER0->TASKS_STOP = 1; - NRF_TIMER0->TASKS_CLEAR = 1; - - NRF_TIMER0->CC[0] = m_started_timestamp; - - NRF_TIMER0->TASKS_START = 1; - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_ENDED); - } - else if (ev_timestamp == m_started_timestamp) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_START); - - NRF_MWU->REGIONENCLR = MWU_REGIONENCLR_PRGN0WA_Msk | MWU_REGIONENCLR_PRGN0RA_Msk; - - NRF_TIMER0->CC[0] = m_margin_timestamp; - - continuous_grant(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_START); - } - else if (ev_timestamp == m_margin_timestamp) - { - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_MARGIN); - - NRF_TIMER0->CC[0] = m_ended_timestamp; - - continuous_revoke(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_MARGIN); - } - else - { - assert(false); - } - } - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_HANDLER); -} - -void MWU_IRQHandler(void) -{ - assert(false); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/single_phy/single_phy.c b/third_party/NordicSemiconductor/drivers/radio/rsch/raal/single_phy/single_phy.c deleted file mode 100644 index 0175ed2ab..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/single_phy/single_phy.c +++ /dev/null @@ -1,89 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the nrf 802.15.4 radio arbiter for single phy. - * - * This arbiter should be used when 802.15.4 is the only wireless protocol used by the application. - * - */ - -#include "rsch/raal/nrf_raal_api.h" - -#include -#include -#include - -static bool m_continuous; - -void nrf_raal_init(void) -{ - m_continuous = false; -} - -void nrf_raal_uninit(void) -{ - // Intentionally empty. -} - -void nrf_raal_continuous_mode_enter(void) -{ - assert(!m_continuous); - - m_continuous = true; - nrf_raal_timeslot_started(); -} - -void nrf_raal_continuous_mode_exit(void) -{ - assert(m_continuous); - - m_continuous = false; -} - -void nrf_raal_continuous_ended(void) -{ - // Intentionally empty. -} - -bool nrf_raal_timeslot_request(uint32_t length_us) -{ - (void)length_us; - - assert(m_continuous); - - return true; -} - -uint32_t nrf_raal_timeslot_us_left_get(void) -{ - return UINT32_MAX; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_802154_debug.h b/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_802154_debug.h deleted file mode 100644 index ef3959ad1..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_802154_debug.h +++ /dev/null @@ -1,74 +0,0 @@ -/* Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that contains debug helpers for the 802.15.4 radio driver for the nRF SoC devices. - * - */ - -#ifndef NRF_802154_DEBUG_H_ -#define NRF_802154_DEBUG_H_ - -#include - -#include "nrf_802154_debug_core.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define EVENT_TIMESLOT_REQUEST 0x0007UL -#define EVENT_TIMESLOT_REQUEST_RESULT 0x0008UL - -/* Reserved for RAAL: 0x0300 - 0x047F */ - -#define FUNCTION_RAAL_CRIT_SECT_ENTER 0x0301UL -#define FUNCTION_RAAL_CRIT_SECT_EXIT 0x0302UL -#define FUNCTION_RAAL_CONTINUOUS_ENTER 0x0303UL -#define FUNCTION_RAAL_CONTINUOUS_EXIT 0x0304UL - -#define FUNCTION_RAAL_SIG_HANDLER 0x0400UL -#define FUNCTION_RAAL_SIG_EVENT_START 0x0401UL -#define FUNCTION_RAAL_SIG_EVENT_MARGIN 0x0402UL -#define FUNCTION_RAAL_SIG_EVENT_EXTEND 0x0403UL -#define FUNCTION_RAAL_SIG_EVENT_ENDED 0x0404UL -#define FUNCTION_RAAL_SIG_EVENT_RADIO 0x0405UL -#define FUNCTION_RAAL_SIG_EVENT_EXTEND_SUCCESS 0x0406UL -#define FUNCTION_RAAL_SIG_EVENT_EXTEND_FAIL 0x0407UL -#define FUNCTION_RAAL_EVT_BLOCKED 0x0408UL -#define FUNCTION_RAAL_EVT_SESSION_IDLE 0x0409UL -#define FUNCTION_RAAL_EVT_HFCLK_READY 0x040AUL -#define FUNCTION_RAAL_SIG_EVENT_MARGIN_MOVE 0x040BUL - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_DEBUG_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.c b/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.c deleted file mode 100644 index 4b29897a7..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.c +++ /dev/null @@ -1,830 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements the nrf 802.15.4 radio arbiter for softdevice. - * - * This arbiter should be used when 802.15.4 works concurrently with SoftDevice's radio stack. - * - */ - -#include "nrf_raal_softdevice.h" - -#include -#include -#include - -#include -#include -#include "nrf_802154_debug.h" -#include -#include -#include -#include - -#if defined(__GNUC__) -_Pragma("GCC diagnostic push") -_Pragma("GCC diagnostic ignored \"-Wreturn-type\"") -_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") -_Pragma("GCC diagnostic ignored \"-Wpedantic\"") -#endif - -#include -#include -#include -#include - -#if defined(__GNUC__) -_Pragma("GCC diagnostic pop") -#endif - -/*************************************************************************************************** - * @section Defines and typedefs. - **************************************************************************************************/ - -/* - * @brief Defines the only version of the SoftDevice that supports configuration of BLE advertising - * role scheduling. - * - * The only SoftDevice that supports this option is S140 6.1.1 (6001001). The full version - * number for the SoftDevice binary is a decimal number in the form Mmmmbbb, where: - * - M is major version (one or more digits) - * - mmm is minor version (three digits) - * - bbb is bugfix version (three digits). - */ -#define BLE_ADV_SCHED_CFG_SUPPORT_SD_VERSION (6001001) - -/* - * @brief Defines the minimum version of the SoftDevice that correctly handles timeslot releasing. - * - * The first SoftDevice that supports this option is S140 6.1.0 (6001000). The full version - * number for the SoftDevice binary is a decimal number in the form Mmmmbbb, where: - * - M is major version (one or more digits) - * - mmm is minor version (three digits) - * - bbb is bugfix version (three digits). - */ -#define TIMESLOT_RELEASE_SUPPORT_MIN_SD_VERSION (6001000) - -/**@brief Enable Request and End on timeslot safety interrupt. */ -#define ENABLE_REQUEST_AND_END_ON_TIMESLOT_END 0 - -/**@brief RAAL Timer instance. */ -#define RAAL_TIMER NRF_TIMER0 - -/**@brief RAAL Timer interrupt number. */ -#define RAAL_TIMER_IRQn TIMER0_IRQn - -/**@brief Minimum time prior safe margin reached by RTC when TIMER reports reached margin in microseconds. */ -#define MIN_TIME_PRIOR_MARGIN_IS_REACHED_US 31 - -/**@brief Timer compare channel definitions. */ -#define TIMER_CC_ACTION NRF_TIMER_CC_CHANNEL0 -#define TIMER_CC_ACTION_EVENT NRF_TIMER_EVENT_COMPARE0 -#define TIMER_CC_ACTION_INT NRF_TIMER_INT_COMPARE0_MASK - -#define TIMER_CC_CAPTURE NRF_TIMER_CC_CHANNEL1 -#define TIMER_CC_CAPTURE_TASK NRF_TIMER_TASK_CAPTURE1 - -#define MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_TICKS NRF_802154_US_TO_RTC_TICKS( \ - NRF_RADIO_MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_US) - -/**@brief PPM constants. */ -#define PPM_UNIT 1000000UL -#define MAX_HFCLK_PPM 40 - -/**@brief Defines states of timeslot. */ -typedef enum -{ - TIMESLOT_STATE_IDLE = 0, - TIMESLOT_STATE_REQUESTED, - TIMESLOT_STATE_GRANTED -} timeslot_state_t; - -/**@brief Define timer actions. */ -typedef enum -{ - TIMER_ACTION_EXTEND, - TIMER_ACTION_MARGIN, -} timer_action_t; - -/*************************************************************************************************** - * @section Static variables. - **************************************************************************************************/ - -/**@brief Defines if module has been initialized. */ -static bool m_initialized = false; - -/**@brief Request parameters. */ -static nrf_radio_request_t m_request; - -/**@brief Return parameter for SD radio signal handler. */ -static nrf_radio_signal_callback_return_param_t m_ret_param; - -/**@brief Current configuration of the RAAL. */ -static nrf_raal_softdevice_cfg_t m_config; - -/**@brief Defines if RAAL is in continuous mode. */ -static volatile bool m_continuous = false; - -/**@brief Defines if RAAL is currently in a timeslot. */ -static volatile timeslot_state_t m_timeslot_state; - -/**@brief Current action of the timer. */ -static timer_action_t m_timer_action; - -/**@brief Current timeslot length. */ -static uint16_t m_timeslot_length; - -/**@brief Previously granted timeslot length. */ -static uint16_t m_prev_timeslot_length; - -/**@brief Interval between successive timeslot extensions. */ -static uint16_t m_extension_interval; - -/**@brief Number of already performed extentions tries on failed event. */ -static volatile uint16_t m_timeslot_extend_tries; - -/**@brief Defines if timeslot releasing works correctly on given SoftDevice version. */ -static bool m_timeslot_releasing; - -/*************************************************************************************************** - * @section Drift calculations - **************************************************************************************************/ - -static uint32_t time_corrected_for_drift_get(uint32_t time) -{ - uint32_t ppm = m_config.lf_clk_accuracy_ppm + MAX_HFCLK_PPM; - - return time - NRF_802154_DIVIDE_AND_CEIL(time * ppm, PPM_UNIT); -} - -static void calculate_config(void) -{ - m_extension_interval = time_corrected_for_drift_get(m_config.timeslot_length); -} - -/*************************************************************************************************** - * @section Operations on RAAL TIMER. - **************************************************************************************************/ - -/**@brief Set timer on timeslot started. */ -static void timer_start(void) -{ - m_timer_action = TIMER_ACTION_EXTEND; - nrf_timer_task_trigger(RAAL_TIMER, NRF_TIMER_TASK_STOP); - nrf_timer_task_trigger(RAAL_TIMER, NRF_TIMER_TASK_CLEAR); - nrf_timer_bit_width_set(RAAL_TIMER, NRF_TIMER_BIT_WIDTH_32); - nrf_timer_cc_write(RAAL_TIMER, TIMER_CC_ACTION, 0); - - nrf_timer_task_trigger(RAAL_TIMER, NRF_TIMER_TASK_START); - NVIC_EnableIRQ(RAAL_TIMER_IRQn); -} - -/**@brief Reset timer. */ -static void timer_reset(void) -{ - NVIC_DisableIRQ(RAAL_TIMER_IRQn); - __DSB(); - __ISB(); - - nrf_timer_task_trigger(RAAL_TIMER, NRF_TIMER_TASK_STOP); - nrf_timer_event_clear(RAAL_TIMER, TIMER_CC_ACTION_EVENT); -} - -/**@brief Get current time on RAAL Timer. */ -static inline uint32_t timer_time_get(void) -{ - nrf_timer_task_trigger(RAAL_TIMER, TIMER_CC_CAPTURE_TASK); - return nrf_timer_cc_read(RAAL_TIMER, TIMER_CC_CAPTURE); -} - -/**@brief Check if timer is set to margin. - * - * @retval true Timer action CC is set to the margin action. - * @retval false Timer action CC is set to the extend action. - */ -static inline bool timer_is_set_to_margin(void) -{ - return m_timer_action == TIMER_ACTION_MARGIN; -} - -static inline uint32_t ticks_to_timeslot_end_get(void) -{ - uint32_t cc = NRF_RTC0->CC[1]; - uint32_t counter = NRF_RTC0->COUNTER; - - // We add one tick as RTC might be just about to increment COUNTER value. - return (cc - (counter + 1)) & RTC_COUNTER_COUNTER_Msk; -} - -static inline uint32_t safe_time_to_timeslot_end_get(void) -{ - uint32_t margin = m_config.timeslot_safe_margin + NRF_RADIO_START_JITTER_US; - uint32_t timeslot_end = NRF_802154_RTC_TICKS_TO_US(ticks_to_timeslot_end_get()); - - if (timeslot_end > margin) - { - return timeslot_end - margin; - } - else - { - return 0; - } -} - -/**@brief Get timeslot margin. */ -static uint32_t timer_get_cc_margin(void) -{ - uint32_t corrected_time_to_margin = time_corrected_for_drift_get( - safe_time_to_timeslot_end_get()); - - return timer_time_get() + corrected_time_to_margin; -} - -/**@brief Set timer action to the timeslot margin. */ -static inline void timer_to_margin_set(void) -{ - uint32_t margin_cc = timer_get_cc_margin(); - - m_timer_action = TIMER_ACTION_MARGIN; - - nrf_timer_event_clear(RAAL_TIMER, TIMER_CC_ACTION_EVENT); - nrf_timer_cc_write(RAAL_TIMER, TIMER_CC_ACTION, margin_cc); - nrf_timer_int_enable(RAAL_TIMER, TIMER_CC_ACTION_INT); -} - -/**@brief Check if margin is already reached. */ -static inline bool timer_is_margin_reached(void) -{ - return timer_is_set_to_margin() && nrf_timer_event_check(RAAL_TIMER, TIMER_CC_ACTION_EVENT) && - safe_time_to_timeslot_end_get() <= MIN_TIME_PRIOR_MARGIN_IS_REACHED_US; -} - -/**@brief Set timer on extend event. */ -static void timer_on_extend_update(void) -{ - NVIC_ClearPendingIRQ(RAAL_TIMER_IRQn); - - if (timer_is_set_to_margin()) - { - uint32_t margin_cc = nrf_timer_cc_read(RAAL_TIMER, TIMER_CC_ACTION); - - margin_cc += m_timeslot_length; - nrf_timer_cc_write(RAAL_TIMER, TIMER_CC_ACTION, margin_cc); - } - else - { - uint16_t extension_interval = (m_prev_timeslot_length == m_config.timeslot_length) ? - m_extension_interval : - time_corrected_for_drift_get(m_prev_timeslot_length); - - nrf_timer_cc_write(RAAL_TIMER, TIMER_CC_ACTION, - nrf_timer_cc_read(RAAL_TIMER, TIMER_CC_ACTION) + extension_interval); - nrf_timer_int_enable(RAAL_TIMER, TIMER_CC_ACTION_INT); - } -} - -/*************************************************************************************************** - * @section Timeslot related functions. - **************************************************************************************************/ - -/**@brief Initialize timeslot internal variables. */ -static inline void timeslot_data_init(void) -{ - m_timeslot_extend_tries = 0; - m_timeslot_length = m_config.timeslot_length; -} - -/**@brief Indicate if timeslot is in idle state. */ -static inline bool timeslot_is_idle(void) -{ - return (m_timeslot_state == TIMESLOT_STATE_IDLE); -} - -/**@brief Indicate if timeslot has been granted. */ -static inline bool timeslot_is_granted(void) -{ - return (m_timeslot_state == TIMESLOT_STATE_GRANTED); -} - -/**@brief Notify driver that timeslot has been started. */ -static inline void timeslot_started_notify(void) -{ - if (timeslot_is_granted() && m_continuous) - { - nrf_raal_timeslot_started(); - } -} - -/**@brief Notify driver that timeslot has been ended. */ -static inline void timeslot_ended_notify(void) -{ - if (!timeslot_is_granted() && m_continuous) - { - nrf_raal_timeslot_ended(); - } -} - -/**@brief Prepare earliest timeslot request. */ -static void timeslot_request_prepare(void) -{ - memset(&m_request, 0, sizeof(m_request)); - m_request.request_type = NRF_RADIO_REQ_TYPE_EARLIEST; - m_request.params.earliest.hfclk = NRF_RADIO_HFCLK_CFG_NO_GUARANTEE; - m_request.params.earliest.priority = NRF_RADIO_PRIORITY_NORMAL; - m_request.params.earliest.length_us = m_timeslot_length; - m_request.params.earliest.timeout_us = m_config.timeslot_timeout; -} - -/**@brief Request earliest timeslot. */ -static void timeslot_request(void) -{ - timeslot_request_prepare(); - - m_timeslot_state = TIMESLOT_STATE_REQUESTED; - - // Request timeslot from SoftDevice. - uint32_t err_code = sd_radio_request(&m_request); - - if (err_code != NRF_SUCCESS) - { - m_timeslot_state = TIMESLOT_STATE_IDLE; - } - - nrf_802154_log(EVENT_TIMESLOT_REQUEST, m_request.params.earliest.length_us); - nrf_802154_log(EVENT_TIMESLOT_REQUEST_RESULT, err_code); -} - -/**@brief Decrease timeslot length. */ -static void timeslot_length_decrease(void) -{ - m_timeslot_extend_tries++; - m_timeslot_length = m_timeslot_length >> 1; -} - -/**@brief Fill timeslot parameters with extend action. */ -static void timeslot_extend(uint32_t timeslot_length) -{ - m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_EXTEND; - m_ret_param.params.extend.length_us = timeslot_length; - - nrf_802154_pin_set(PIN_DBG_TIMESLOT_EXTEND_REQ); - nrf_802154_log(EVENT_TIMESLOT_REQUEST, m_ret_param.params.extend.length_us); -} - -/**@brief Extend timeslot further. */ -static void timeslot_next_extend(void) -{ - // Check if we can make another extend query. - if (m_timeslot_extend_tries < m_config.timeslot_alloc_iters) - { - // Decrease timeslot length. - timeslot_length_decrease(); - - // Try to extend right after start. - timeslot_extend(m_timeslot_length); - } -} - -/*************************************************************************************************** - * @section RAAL TIMER interrupt handler. - **************************************************************************************************/ - -/**@brief Handle timer interrupts. */ -static void timer_irq_handle(void) -{ - // Margin or extend event triggered. - if (nrf_timer_event_check(RAAL_TIMER, TIMER_CC_ACTION_EVENT)) - { - if (timer_is_set_to_margin()) - { - if (timer_is_margin_reached()) - { - // Safe margin exceeded. - nrf_802154_pin_clr(PIN_DBG_TIMESLOT_ACTIVE); - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_MARGIN); - - m_timeslot_state = TIMESLOT_STATE_IDLE; - timeslot_ended_notify(); - - // Ignore any other events. - timer_reset(); - - // Return and wait for NRF_EVT_RADIO_SESSION_IDLE event. - m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE; - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_MARGIN); - } - else - { - // Move safety margin a little further to suppress clocks drift - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_MARGIN_MOVE); - timer_to_margin_set(); - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_MARGIN_MOVE); - } - } - else - { - // Extension margin exceeded. - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_EXTEND); - - nrf_timer_int_disable(RAAL_TIMER, TIMER_CC_ACTION_INT); - nrf_timer_event_clear(RAAL_TIMER, TIMER_CC_ACTION_EVENT); - - if (m_continuous && - (nrf_timer_cc_read(RAAL_TIMER, TIMER_CC_ACTION) + - m_config.timeslot_length < m_config.timeslot_max_length)) - { - // Try to extend timeslot. - timeslot_extend(m_config.timeslot_length); - } - else - { - // We have reached maximum timeslot length. - timer_to_margin_set(); - - m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE; - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_EXTEND); - } - } - else - { - // Should not happen. - assert(false); - } -} - -/*************************************************************************************************** - * @section SoftDevice signal and SoC handlers. - **************************************************************************************************/ - -/**@brief Signal handler. */ -static nrf_radio_signal_callback_return_param_t * signal_handler(uint8_t signal_type) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_HANDLER); - - // Default response. - m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE; - - if (!m_continuous) - { - nrf_802154_pin_clr(PIN_DBG_TIMESLOT_ACTIVE); - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_ENDED); - - m_timeslot_state = TIMESLOT_STATE_IDLE; - - m_ret_param.callback_action = m_timeslot_releasing ? NRF_RADIO_SIGNAL_CALLBACK_ACTION_END : - NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE; - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_ENDED); - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_HANDLER); - return &m_ret_param; - } - - switch (signal_type) - { - case NRF_RADIO_CALLBACK_SIGNAL_TYPE_START: /**< This signal indicates the start of the radio timeslot. */ - { - nrf_802154_pin_set(PIN_DBG_TIMESLOT_ACTIVE); - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_START); - - assert(m_timeslot_state == TIMESLOT_STATE_REQUESTED); - - // Set up timer first with requested timeslot length. - timer_start(); - - // Re-initialize timeslot data for future extensions. - m_prev_timeslot_length = m_timeslot_length; - timeslot_data_init(); - - // Try to extend right after start. - timeslot_extend(m_timeslot_length); - - // Do not notify started timeslot here. Notify after successful extend to make sure - // enough timeslot length is available before notification. - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_START); - break; - } - - case NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0: /**< This signal indicates the TIMER0 interrupt. */ - timer_irq_handle(); - break; - - case NRF_RADIO_CALLBACK_SIGNAL_TYPE_RADIO: /**< This signal indicates the NRF_RADIO interrupt. */ - nrf_802154_pin_set(PIN_DBG_TIMESLOT_RADIO_IRQ); - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_RADIO); - - if (timeslot_is_granted()) - { - if (!timer_is_margin_reached()) - { - nrf_802154_radio_irq_handler(); - } - else - { - // Handle margin exceeded event. - timer_irq_handle(); - } - } - else - { - NVIC_DisableIRQ(RADIO_IRQn); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_RADIO); - nrf_802154_pin_clr(PIN_DBG_TIMESLOT_RADIO_IRQ); - break; - - case NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_FAILED: /**< This signal indicates extend action failed. */ - nrf_802154_pin_tgl(PIN_DBG_TIMESLOT_FAILED); - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_EXTEND_FAIL); - - if (!timer_is_set_to_margin()) - { - timer_to_margin_set(); - } - - timeslot_next_extend(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_EXTEND_FAIL); - break; - - case NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED: /**< This signal indicates extend action succeeded. */ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_SIG_EVENT_EXTEND_SUCCESS); - - if ((!timer_is_set_to_margin()) && - (ticks_to_timeslot_end_get() < - MINIMUM_TIMESLOT_LENGTH_EXTENSION_TIME_TICKS)) - { - timer_to_margin_set(); - - m_ret_param.callback_action = NRF_RADIO_SIGNAL_CALLBACK_ACTION_NONE; - } - else - { - timer_on_extend_update(); - m_prev_timeslot_length = m_timeslot_length; - - // Request further extension only if any of previous one failed. - if (m_timeslot_extend_tries != 0) - { - timeslot_next_extend(); - } - } - - if (!timeslot_is_granted()) - { - m_timeslot_state = TIMESLOT_STATE_GRANTED; - timeslot_started_notify(); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_EVENT_EXTEND_SUCCESS); - break; - - default: - break; - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_SIG_HANDLER); - - return &m_ret_param; -} - -void nrf_raal_softdevice_soc_evt_handler(uint32_t evt_id) -{ - switch (evt_id) - { - case NRF_EVT_RADIO_BLOCKED: - case NRF_EVT_RADIO_CANCELED: - { - nrf_802154_pin_tgl(PIN_DBG_TIMESLOT_BLOCKED); - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_EVT_BLOCKED); - - assert(!timeslot_is_granted()); - - m_timeslot_state = TIMESLOT_STATE_IDLE; - - if (m_continuous) - { - if (m_timeslot_extend_tries < m_config.timeslot_alloc_iters) - { - timeslot_length_decrease(); - } - - timeslot_request(); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_EVT_BLOCKED); - - break; - } - - case NRF_EVT_RADIO_SIGNAL_CALLBACK_INVALID_RETURN: - assert(false); - break; - - case NRF_EVT_RADIO_SESSION_IDLE: - - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_EVT_SESSION_IDLE); - nrf_802154_pin_tgl(PIN_DBG_TIMESLOT_SESSION_IDLE); - - if (m_continuous && timeslot_is_idle()) - { - timeslot_data_init(); - timeslot_request(); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_EVT_SESSION_IDLE); - - break; - - case NRF_EVT_RADIO_SESSION_CLOSED: - break; - - default: - break; - } -} - -/*************************************************************************************************** - * @section RAAL API. - **************************************************************************************************/ - -void nrf_raal_softdevice_config(const nrf_raal_softdevice_cfg_t * p_cfg) -{ - assert(m_initialized); - assert(!m_continuous); - assert(p_cfg); - - m_config = *p_cfg; - - calculate_config(); -} - -void nrf_raal_init(void) -{ - assert(!m_initialized); - - m_continuous = false; - m_timeslot_state = TIMESLOT_STATE_IDLE; - - m_config.timeslot_length = NRF_RAAL_TIMESLOT_DEFAULT_LENGTH; - m_config.timeslot_alloc_iters = NRF_RAAL_TIMESLOT_DEFAULT_ALLOC_ITERS; - m_config.timeslot_safe_margin = NRF_RAAL_TIMESLOT_DEFAULT_SAFE_MARGIN; - m_config.timeslot_max_length = NRF_RAAL_TIMESLOT_DEFAULT_MAX_LENGTH; - m_config.timeslot_timeout = NRF_RAAL_TIMESLOT_DEFAULT_TIMEOUT; - m_config.lf_clk_accuracy_ppm = NRF_RAAL_DEFAULT_LF_CLK_ACCURACY_PPM; - - calculate_config(); - - uint32_t err_code = sd_radio_session_open(signal_handler); - - assert(err_code == NRF_SUCCESS); - (void)err_code; - -#if (SD_VERSION == BLE_ADV_SCHED_CFG_SUPPORT_SD_VERSION) - // Ensure that correct SoftDevice version is flashed. - if (SD_VERSION_GET(MBR_SIZE) == BLE_ADV_SCHED_CFG_SUPPORT_SD_VERSION) - { - // Use improved Advertiser Role Scheduling configuration. - ble_opt_t opt; - - memset(&opt, 0, sizeof(opt)); - opt.common_opt.adv_sched_cfg.sched_cfg = ADV_SCHED_CFG_IMPROVED; - - err_code = sd_ble_opt_set(BLE_COMMON_OPT_ADV_SCHED_CFG, &opt); - - assert(err_code == NRF_SUCCESS); - (void)err_code; - } -#endif - - // Ensure that correct SoftDevice version is flashed. - if (SD_VERSION_GET(MBR_SIZE) >= TIMESLOT_RELEASE_SUPPORT_MIN_SD_VERSION) - { - m_timeslot_releasing = true; - } - - m_initialized = true; -} - -void nrf_raal_uninit(void) -{ - assert(m_initialized); - - uint32_t err_code = sd_radio_session_close(); - - assert(err_code == NRF_SUCCESS); - (void)err_code; - - m_continuous = false; - m_timeslot_state = TIMESLOT_STATE_IDLE; - - nrf_802154_pin_clr(PIN_DBG_TIMESLOT_ACTIVE); -} - -void nrf_raal_continuous_mode_enter(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_CONTINUOUS_ENTER); - - assert(m_initialized); - assert(!m_continuous); - - m_continuous = true; - - if (timeslot_is_idle()) - { - timeslot_data_init(); - timeslot_request(); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_CONTINUOUS_ENTER); -} - -void nrf_raal_continuous_mode_exit(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_RAAL_CONTINUOUS_EXIT); - - assert(m_initialized); - assert(m_continuous); - - if (timeslot_is_granted()) - { - // Reset timer prior marking exiting continuous mode to prevent timeslot release caused by - // the timer - timer_reset(); - - m_continuous = false; - __DMB(); - - nrf_raal_timeslot_ended(); - - // Emulate signal interrupt to inform SD about end of continuous mode. - NVIC_SetPendingIRQ(RADIO_IRQn); - NVIC_EnableIRQ(RADIO_IRQn); - } - else - { - m_continuous = false; - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_RAAL_CONTINUOUS_EXIT); -} - -void nrf_raal_continuous_ended(void) -{ - // Intentionally empty. -} - -bool nrf_raal_timeslot_request(uint32_t length_us) -{ - uint32_t us_left; - - if (!m_continuous || !timeslot_is_granted()) - { - return false; - } - - us_left = nrf_raal_timeslot_us_left_get(); - - assert((us_left >= nrf_802154_rx_duration_get(MAX_PACKET_SIZE, - true)) || timer_is_set_to_margin()); - - return length_us < us_left; -} - -uint32_t nrf_raal_timeslot_us_left_get(void) -{ - return timeslot_is_granted() ? safe_time_to_timeslot_end_get() : 0; -} diff --git a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.h b/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.h deleted file mode 100644 index 9f735c119..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/rsch/raal/softdevice/nrf_raal_softdevice.h +++ /dev/null @@ -1,141 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that defines the Radio Arbiter Abstraction Layer interface - * using Timeslot API provided by SoftDevice. - * - */ - -#ifndef NRF_RAAL_SOFTDEVICE_H_ -#define NRF_RAAL_SOFTDEVICE_H_ - -#include -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** @brief RAAL SoftDevice default parameters. */ -#define NRF_RAAL_TIMESLOT_DEFAULT_LENGTH 6400 -#define NRF_RAAL_TIMESLOT_DEFAULT_ALLOC_ITERS 5 -#define NRF_RAAL_TIMESLOT_DEFAULT_SAFE_MARGIN nrf_raal_softdevice_safe_margin_calc( \ - NRF_RAAL_DEFAULT_LF_CLK_ACCURACY_PPM) -#define NRF_RAAL_TIMESLOT_DEFAULT_TIMEOUT 2500 -#define NRF_RAAL_TIMESLOT_DEFAULT_MAX_LENGTH 120000000 -#define NRF_RAAL_DEFAULT_LF_CLK_ACCURACY_PPM 500 - -#define NRF_RAAL_TIMESLOT_DEFAULT_SAFE_MARGIN_LFRC_TICKS 4 -#define NRF_RAAL_TIMESLOT_DEFAULT_SAFE_MARGIN_CRYSTAL_TICKS 3 -#define NRF_RAAL_TIMESLOT_DEFAULT_SAFE_MARGIN_US 3 - -#define NRF_RAAL_PPM_THRESHOLD 500 - -#define NRF_RAAL_TIMESLOT_SAFE_MARGIN_TICKS(ppm) ((ppm >= NRF_RAAL_PPM_THRESHOLD) ? \ - NRF_RAAL_TIMESLOT_DEFAULT_SAFE_MARGIN_LFRC_TICKS \ - : \ - NRF_RAAL_TIMESLOT_DEFAULT_SAFE_MARGIN_CRYSTAL_TICKS) - -/** - * @brief Function-like macro used to calculate a safe margin from the LF clock accuracy - * in ppm unit. - * - * @param[in] ppm LF clock accuracy in ppm units. - */ -#define nrf_raal_softdevice_safe_margin_calc(ppm) (NRF_802154_RTC_TICKS_TO_US( \ - NRF_RAAL_TIMESLOT_SAFE_MARGIN_TICKS( \ - ppm)) \ - + \ - NRF_RAAL_TIMESLOT_DEFAULT_SAFE_MARGIN_US) - -/** @brief RAAL Softdevice configuration parameters. */ -typedef struct -{ - /** - * @brief Timeslot length requested by the module, in microseconds. - */ - uint32_t timeslot_length; - - /** - * @brief The longest acceptable delay until the start of the requested timeslot, - * in microseconds. - */ - uint32_t timeslot_timeout; - - /** - * @brief The maximum single timeslot length created by the extension processing, - * in microseconds. - */ - uint32_t timeslot_max_length; - - /** - * @brief The maximum number of iteration of dividing timeslot_length by factor of 2 performed - * by the arbiter. - */ - uint16_t timeslot_alloc_iters; - - /** - * @brief The safe margin before the timeslot is finished and nrf_raal_timeslot_ended - * is to be called, in microseconds. @ref nrf_raal_softdevice_safe_margin_calc can be used - * to calculate the proper value based on the clock accuracy. This value can also be selected - * experimentally. - */ - uint16_t timeslot_safe_margin; - - /** - * @brief The clock accuracy in ppm unit. - */ - uint16_t lf_clk_accuracy_ppm; -} nrf_raal_softdevice_cfg_t; - -/** - * @brief Informs the RAAL client about the SoftDevice SoC events. - * - */ -void nrf_raal_softdevice_soc_evt_handler(uint32_t evt_id); - -/** - * @brief Sets non-default parameters of RAAL. - * - */ -void nrf_raal_softdevice_config(const nrf_raal_softdevice_cfg_t * p_cfg); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_RAAL_SOFTDEVICE_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.c b/third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.c deleted file mode 100644 index 8b09aad71..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.c +++ /dev/null @@ -1,475 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * This file implements timer scheduler for the nRF 802.15.4 driver. - * - * This implementation supports scheduling of multiple timer instances and can be used from different contexts. - * - * @note Timer scheduler is secured against preemption and adding/removing different timers from different contexts, - * it shall not be used for adding/removing the same timer instance from two contexts at the same time. - * - */ - -#include "nrf_802154_timer_sched.h" - -#include -#include -#include -#include - -#include -#include "../nrf_802154_debug.h" -#include "platform/lp_timer/nrf_802154_lp_timer.h" - -#if defined(__ICCARM__) -_Pragma("diag_suppress=Pe167") -#endif - -static volatile uint8_t m_timer_mutex; ///< Mutex for starting the timer. -static volatile uint8_t m_fired_mutex; ///< Mutex for the timer firing procedure. -static volatile uint8_t m_queue_changed_cntr; ///< Information that scheduler queue was modified. -static volatile nrf_802154_timer_t * mp_head; ///< Head of the running timers list. - -/** @brief Non-blocking mutex for starting the timer. - * - * @retval true Mutex was acquired. - * @retval false Mutex could not be acquired. - */ -static inline bool mutex_trylock(volatile uint8_t * p_mutex) -{ - do - { - volatile uint8_t mutex_value = __LDREXB(p_mutex); - - if (mutex_value) - { - __CLREX(); - return false; - } - } - while (__STREXB(1, p_mutex)); - - __DMB(); - - return true; -} - -/** @brief Release mutex. */ -static inline void mutex_unlock(volatile uint8_t * p_mutex) -{ - __DMB(); - *p_mutex = 0; -} - -/** @brief Increment queue counter value to detect changes in the queue. */ -static inline void queue_cntr_bump(void) -{ - volatile uint8_t cntr; - - do - { - cntr = __LDREXB(&m_queue_changed_cntr); - } - while (__STREXB(cntr + 1, &m_queue_changed_cntr)); - - __DMB(); -} - -/** - * @brief Check if @p time_1 is before @p time_2. - * - * @param[in] time_1 First time to compare. - * @param[in] time_2 Second time to compare. - * - * @return True if @p time_1 is before @p time_2, false otherwise. - */ -static inline bool is_time_before(uint32_t time_1, uint32_t time_2) -{ - int32_t diff = time_1 - time_2; - - return diff < 0; -} - -/** - * @brief Check if @p p_timer_1 shall strike earlier than @p p_timer_2. - * - * @param[in] p_timer_1 A pointer to first timer to compare. - * @param[in] p_timer_2 A pointer to second timer to compare. - * - * @return True if @p p_timer_1 shall strike earlier than @p p_timer_2, false otherwise. - */ -static inline bool is_timer_prior(const nrf_802154_timer_t * p_timer_1, - const nrf_802154_timer_t * p_timer_2) -{ - return is_time_before(p_timer_1->t0 + p_timer_1->dt, p_timer_2->t0 + p_timer_2->dt); -} - -/** - * @brief Handle operation on timer with mutex protection. - */ -static inline void handle_timer(void) -{ - volatile nrf_802154_timer_t * p_head; - uint8_t queue_cntr; - - do - { - queue_cntr = m_queue_changed_cntr; - p_head = mp_head; - - if (mutex_trylock(&m_timer_mutex)) - { - if (p_head == NULL) - { - nrf_802154_lp_timer_stop(); - } - else - { - uint32_t t0 = p_head->t0; - uint32_t dt = p_head->dt; - - // Set the timer only if current HEAD wasn't removed - otherwise t0 and dt might've been modified - // between reading t0 and dt and not be a valid combination. - if (p_head == mp_head) - { - nrf_802154_lp_timer_start(t0, dt); - } - } - - mutex_unlock(&m_timer_mutex); - } - } - while (queue_cntr != m_queue_changed_cntr); -} - -/** - * @brief Remove a timer from the queue. - * - * The timer to be removed can be running or not running. If the timer is running, it is removed from - * the timer queue and the value pointed by the @c p_was_running parameter is set to true. If the timer is not running, - * the value pointed by @c p_was_running is set to false. - * - * @param[in,out] p_timer Pointer to the timer to remove from the queue. - * @param[out] p_was_running Informs a caller if the timer was running. Pass NULL if irrelevant. - * - * @retval true @sa handle_timer() shall be called by caller of this function. - * @retval false @sa handle_timer() shall not be called by the caller. - */ -static bool timer_remove(nrf_802154_timer_t * p_timer, bool * p_was_running) -{ - assert(p_timer != NULL); - - nrf_802154_timer_t ** pp_item; - nrf_802154_timer_t * volatile p_next; // Volatile pointer to prevent compiler from removing any code related to this variable during optimization (IAR). - nrf_802154_timer_t * p_cur; - uint8_t queue_cntr; - bool timer_start; - bool timer_stop; - - while (true) - { - queue_cntr = m_queue_changed_cntr; - pp_item = (nrf_802154_timer_t **)&mp_head; - p_next = NULL; - p_cur = NULL; - timer_start = false; - timer_stop = false; - - // Find entry to remove - while (true) - { - p_cur = (nrf_802154_timer_t *)__LDREXW((uint32_t *)pp_item); - - if ((p_cur == NULL) || (p_cur == p_timer)) - { - break; - } - - pp_item = &(p_cur->p_next); - } - - if (queue_cntr != m_queue_changed_cntr) - { - // Higher priority modified the queue while iterating, try again. - continue; - } - - if (p_cur == p_timer) - { - // Entry found. - p_next = p_cur->p_next; - - // Restart timer when removing HEAD and other timer instance is pending. - if (p_cur == mp_head) - { - if (p_next != NULL) - { - timer_start = true; - } - else - { - timer_stop = true; - } - } - } - else - { - // Entry not found - __CLREX(); - break; - } - - if (!__STREXW((uint32_t)p_next, (uint32_t *)pp_item)) - { - // Exit, if exclusive access succeeds. - queue_cntr_bump(); - break; - } - } - - bool was_running = false; - - // Write to the pointer next on removal to ensure that node removal is detected by - // lower priority context in case it was going to be used. - if (p_cur != NULL) - { - was_running = true; - uint32_t temp; - - do - { - // This assignment is used to prevent compiler from removing exclusive load during optimization (IAR). - temp = __LDREXW((uint32_t *)&p_cur->p_next); - assert((void *)temp != p_cur); - } - while (__STREXW(temp, (uint32_t *)&p_cur->p_next)); - } - - if (p_was_running != NULL) - { - *p_was_running = was_running; - } - - return (timer_start || timer_stop); -} - -void nrf_802154_timer_sched_init(void) -{ - mp_head = NULL; - m_timer_mutex = 0; - m_fired_mutex = 0; - m_queue_changed_cntr = 0; -} - -void nrf_802154_timer_sched_deinit(void) -{ - nrf_802154_lp_timer_stop(); - - mp_head = NULL; -} - -uint32_t nrf_802154_timer_sched_time_get(void) -{ - return nrf_802154_lp_timer_time_get(); -} - -uint32_t nrf_802154_timer_sched_granularity_get(void) -{ - return nrf_802154_lp_timer_granularity_get(); -} - -bool nrf_802154_timer_sched_time_is_in_future(uint32_t now, uint32_t t0, uint32_t dt) -{ - uint32_t target_time = t0 + dt; - int32_t difference = target_time - now; - - return difference > 0; -} - -uint32_t nrf_802154_timer_sched_remaining_time_get(const nrf_802154_timer_t * p_timer) -{ - assert(p_timer != NULL); - - uint32_t now = nrf_802154_lp_timer_time_get(); - uint32_t expiration = p_timer->t0 + p_timer->dt; - int32_t remaining = expiration - now; - - if (remaining > 0) - { - return (uint32_t)remaining; - } - else - { - return 0ul; - } -} - -void nrf_802154_timer_sched_add(nrf_802154_timer_t * p_timer, bool round_up) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TSCH_ADD); - - assert(p_timer != NULL); - assert(p_timer->callback != NULL); - - if (round_up) - { - p_timer->dt += nrf_802154_lp_timer_granularity_get() - 1; - } - - if (timer_remove(p_timer, NULL)) - { - handle_timer(); - } - - nrf_802154_timer_t ** pp_item; - nrf_802154_timer_t * p_next; - uint8_t queue_cntr; - - while (true) - { - queue_cntr = m_queue_changed_cntr; - pp_item = (nrf_802154_timer_t **)&mp_head; - p_next = NULL; - - // Search the current queue to find appropriate position to insert timer. - while (true) - { - nrf_802154_timer_t * p_cur = (nrf_802154_timer_t *)__LDREXW((uint32_t *)pp_item); - - assert(p_cur != p_timer); - - if (p_cur == NULL) - { - // No HEAD or insert at the end. - p_next = NULL; - break; - } - - if (is_timer_prior(p_timer, p_cur)) - { - // Insert at the beginning with existing HEAD or somewhere in the middle. - p_next = p_cur; - break; - } - - pp_item = &(p_cur->p_next); - } - - if (queue_cntr != m_queue_changed_cntr) - { - // Higher priority modified the queue while iterating, try again. - continue; - } - - assert(p_next != p_timer); - p_timer->p_next = p_next; - - if (!__STREXW((uint32_t)p_timer, (uint32_t *)pp_item)) - { - // Exit, if exclusive access succeeds. - queue_cntr_bump(); - break; - } - } - - if (mp_head == p_timer) - { - handle_timer(); - } - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TSCH_ADD); -} - -void nrf_802154_timer_sched_remove(nrf_802154_timer_t * p_timer, bool * p_was_running) -{ - if (timer_remove(p_timer, p_was_running)) - { - handle_timer(); - } -} - -bool nrf_802154_timer_sched_is_running(nrf_802154_timer_t * p_timer) -{ - uint8_t queue_cntr; - bool result; - - do - { - result = false; - queue_cntr = m_queue_changed_cntr; - - for (volatile nrf_802154_timer_t * p_cur = mp_head; - p_cur != NULL; - p_cur = p_cur->p_next) - { - if (p_cur == p_timer) - { - result = true; - break; - } - } - } - while (queue_cntr != m_queue_changed_cntr); - - return result; -} - -void nrf_802154_lp_timer_fired(void) -{ - nrf_802154_log(EVENT_TRACE_ENTER, FUNCTION_TSCH_FIRED); - - if (mutex_trylock(&m_fired_mutex)) - { - nrf_802154_timer_t * p_timer = (nrf_802154_timer_t *)mp_head; - - if (p_timer != NULL) - { - nrf_802154_timer_callback_t callback = p_timer->callback; - void * p_context = p_timer->p_context; - - bool was_running; - - (void)timer_remove(p_timer, &was_running); - - if (was_running && (callback != NULL)) - { - callback(p_context); - } - } - - mutex_unlock(&m_fired_mutex); - } - - handle_timer(); - - nrf_802154_log(EVENT_TRACE_EXIT, FUNCTION_TSCH_FIRED); -} diff --git a/third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.h b/third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.h deleted file mode 100644 index 86021c24a..000000000 --- a/third_party/NordicSemiconductor/drivers/radio/timer_scheduler/nrf_802154_timer_sched.h +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (c) 2017 - 2018, Nordic Semiconductor ASA - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @brief Module that provides the timer scheduling functionality for the 802.15.4 driver. - * - * Use the timer scheduler module to implement the strict timing features specified in the IEEE 802.15.4, like: - * * CSL - * * Timing out when waiting for ACK frames - * * CSMA/CA - * * Inter-frame spacing: SIFS, LIFS (AIFS is implemented without using the timer module) - * - */ - -#ifndef NRF_802154_TIMER_SCHED_H_ -#define NRF_802154_TIMER_SCHED_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_802154_timer_sched Timer Scheduler module for the 802.15.4 driver - * @{ - * @ingroup nrf_802154_timer_sched - * @brief The Timer Scheduler module for the 802.15.4 driver. - * - */ - -/** - * @brief Type of function called when the timer expires. - * - * @param[inout] p_context Pointer to user-defined memory location. Can be NULL. - */ -typedef void (* nrf_802154_timer_callback_t)(void * p_context); - -/** - * @brief Type for the driver instance. - */ -typedef struct nrf_802154_timer_s nrf_802154_timer_t; - -/** - * @brief Structure containing timer data used by the timer module. - */ -struct nrf_802154_timer_s -{ - uint32_t t0; ///< Base time of the timer, in microseconds. - uint32_t dt; ///< Timer expiration delta from @p t0, in microseconds. - nrf_802154_timer_callback_t callback; ///< Callback function called when timer expires. - void * p_context; ///< User-defined context passed to the callback function. - nrf_802154_timer_t * p_next; ///< Pointer to the next running timer. -}; - -/** - * @brief Initializes the timer scheduler. - */ -void nrf_802154_timer_sched_init(void); - -/** - * @brief Deinitializes the timer scheduler. - */ -void nrf_802154_timer_sched_deinit(void); - -/** - * @brief Gets the current time. - * - * This function can be used to set the base time in the @ref nrf_802154_timer_t structure. - * - * @returns Current time in microseconds [us]. - */ -uint32_t nrf_802154_timer_sched_time_get(void); - -/** - * @brief Gets the granularity of the timer that runs the timer scheduler. - * - * @returns Granularity of the timer, in microseconds [us]. - */ -uint32_t nrf_802154_timer_sched_granularity_get(void); - -/** - * @brief Checks if the given time is in the future. - * - * @param[in] now Current time. @ref nrf_802154_timer_sched_time_get(). - * @param[in] t0 Base of time compared with @p now. - * @param[in] dt Time delta from @p t0 compared with @p now. - * - * @retval true Given time @p t0 @p dt is in future (compared to given @p now). - * @retval false Given time @p t0 @p dt is not in future (compared to given @p now). - */ -bool nrf_802154_timer_sched_time_is_in_future(uint32_t now, uint32_t t0, uint32_t dt); - -/** - * @brief Gets timer time that remains to expiration. - * - * @param[in] p_timer Pointer to the timer to check the remaining time. - * - * @returns Remaining time in microseconds, or zero if the timer has already expired. - * - */ -uint32_t nrf_802154_timer_sched_remaining_time_get(const nrf_802154_timer_t * p_timer); - -/** - * @brief Starts the given timer and adds it to the scheduler. - * - * @note Fields @c t0, @c dt, @c callback and @c p_context must be filled in @p p_timer before - * calling this function. The @c callback field cannot be NULL. - * - * @note Due to the timer granularity, the callback function cannot be called exactly - * at the specified time. Use @p round_up to specify if the given timer should expire before - * or after the time given in the @p p_timer structure. The @c dt field of the @p p_timer - * is updated with the rounded-up value. - * - * @param[inout] p_timer Pointer to the timer to be started and added to the scheduler. - * @param[in] round_up True if the timer is to expire after the specified time. - * False if it is to expire before the specified time. - */ -void nrf_802154_timer_sched_add(nrf_802154_timer_t * p_timer, bool round_up); - -/** - * @brief Stops the given timer and removes it from the scheduler. - * - * @param[in,out] p_timer Pointer to the timer to be stopped and removed - * from the scheduler. - * @param[out] p_was_running Inform a caller if the timer was running. - * Pass NULL if irrelevant. - */ -void nrf_802154_timer_sched_remove(nrf_802154_timer_t * p_timer, bool * p_was_running); - -/** - * @brief Checks if the given timer is already scheduled. - * - * @param[in] p_timer Pointer to the timer to check. - * - * @retval true Given timer is already scheduled. - * @retval false Given timer is not scheduled. - */ -bool nrf_802154_timer_sched_is_running(nrf_802154_timer_t * p_timer); - -/** - *@} - **/ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_802154_TIMER_SCHED_H_ */ diff --git a/third_party/NordicSemiconductor/drivers/systick/nrf_drv_systick.h b/third_party/NordicSemiconductor/drivers/systick/nrf_drv_systick.h deleted file mode 100644 index cb3f4f337..000000000 --- a/third_party/NordicSemiconductor/drivers/systick/nrf_drv_systick.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_DRV_SYSTICK_H__ -#define NRF_DRV_SYSTICK_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_drv_systick ARM(R) SysTick driver - legacy layer - * @{ - * @ingroup nrf_systick - * - * @brief Layer providing compatibility with the former API. - */ - -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_systick_state_t nrf_drv_systick_state_t; - -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_systick_init nrfx_systick_init -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_systick_get nrfx_systick_get -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_systick_test nrfx_systick_test -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_systick_delay_ticks nrfx_systick_delay_ticks -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_systick_delay_us nrfx_systick_delay_us -/** @brief Macro for forwarding the new implementation. */ -#define nrf_drv_systick_delay_ms nrfx_systick_delay_ms - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif // NRF_DRV_SYSTICK_H__ diff --git a/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd.h b/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd.h deleted file mode 100644 index db30fce08..000000000 --- a/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd.h +++ /dev/null @@ -1,272 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_DRV_USBD_H__ -#define NRF_DRV_USBD_H__ - -#include "nrfx.h" -#include "nrfx_usbd.h" -#include "nrf_drv_usbd_errata.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_drv_usbd USBD driver - legacy layer - * @{ - * @ingroup nrf_usbd - * - * @brief @tagAPI52 Layer providing compatibility with the former API. - */ - -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_DMASCHEDULER_PRIORITIZED NRFX_USBD_DMASCHEDULER_PRIORITIZED -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_DMASCHEDULER_ROUNDROBIN NRFX_USBD_DMASCHEDULER_ROUNDROBIN -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPSIZE NRFX_USBD_EPSIZE -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_ISOSIZE NRFX_USBD_ISOSIZE -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_FEEDER_BUFFER_SIZE NRFX_USBD_EPSIZE -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPIN NRFX_USBD_EPIN -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPOUT NRFX_USBD_EPOUT - -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_ep_t nrf_drv_usbd_ep_t; -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPOUT0 NRFX_USBD_EPOUT0 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPOUT1 NRFX_USBD_EPOUT1 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPOUT2 NRFX_USBD_EPOUT2 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPOUT3 NRFX_USBD_EPOUT3 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPOUT4 NRFX_USBD_EPOUT4 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPOUT5 NRFX_USBD_EPOUT5 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPOUT6 NRFX_USBD_EPOUT6 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPOUT7 NRFX_USBD_EPOUT7 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPOUT8 NRFX_USBD_EPOUT8 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPIN0 NRFX_USBD_EPIN0 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPIN1 NRFX_USBD_EPIN1 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPIN2 NRFX_USBD_EPIN2 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPIN3 NRFX_USBD_EPIN3 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPIN4 NRFX_USBD_EPIN4 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPIN5 NRFX_USBD_EPIN5 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPIN6 NRFX_USBD_EPIN6 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPIN7 NRFX_USBD_EPIN7 -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EPIN8 NRFX_USBD_EPIN8 - -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_event_type_t nrf_drv_usbd_event_type_t; -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EVT_SOF NRFX_USBD_EVT_SOF -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EVT_RESET NRFX_USBD_EVT_RESET -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EVT_SUSPEND NRFX_USBD_EVT_SUSPEND -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EVT_RESUME NRFX_USBD_EVT_RESUME -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EVT_WUREQ NRFX_USBD_EVT_WUREQ -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EVT_SETUP NRFX_USBD_EVT_SETUP -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EVT_EPTRANSFER NRFX_USBD_EVT_EPTRANSFER -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_EVT_CNT NRFX_USBD_EVT_CNT - -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_USBD_EP_OK NRFX_USBD_EP_OK -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_USBD_EP_WAITING NRFX_USBD_EP_WAITING -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_USBD_EP_OVERLOAD NRFX_USBD_EP_OVERLOAD -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_USBD_EP_ABORTED NRFX_USBD_EP_ABORTED - -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_ep_status_t nrf_drv_usbd_ep_status_t; -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_evt_t nrf_drv_usbd_evt_t; -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_event_handler_t nrf_drv_usbd_event_handler_t; -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_data_ptr_t nrf_drv_usbd_data_ptr_t; -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_ep_transfer_t nrf_drv_usbd_ep_transfer_t; -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_transfer_flags_t nrf_drv_usbd_transfer_flags_t; -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_TRANSFER_ZLP_FLAG NRFX_USBD_TRANSFER_ZLP_FLAG - -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_transfer_t nrf_drv_usbd_transfer_t; - -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_TRANSFER_IN_FLAGS(name, tx_buff, tx_size, tx_flags) \ - NRFX_USBD_TRANSFER_IN(name, tx_buff, tx_size, tx_flags) -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_TRANSFER_IN(name, tx_buff, tx_size) \ - NRFX_USBD_TRANSFER_IN(name, tx_buff, tx_size, 0) -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_TRANSFER_IN_ZLP(name, tx_buff, tx_size) \ - NRFX_USBD_TRANSFER_IN(name, tx_buff, tx_size, NRFX_USBD_TRANSFER_ZLP_FLAG) -/** @brief Type definition for forwarding the new implementation. */ -#define NRF_DRV_USBD_TRANSFER_OUT NRFX_USBD_TRANSFER_OUT - -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_feeder_t nrf_drv_usbd_feeder_t; -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_consumer_t nrf_drv_usbd_consumer_t; -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_handler_t nrf_drv_usbd_handler_t; -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_handler_desc_t nrf_drv_usbd_handler_desc_t; -/** @brief Type definition for forwarding the new implementation. */ -typedef nrfx_usbd_setup_t nrf_drv_usbd_setup_t; - -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_init nrfx_usbd_init -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_enable nrfx_usbd_enable -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_disable nrfx_usbd_disable -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_start nrfx_usbd_start -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_stop nrfx_usbd_stop -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_is_initialized nrfx_usbd_is_initialized -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_is_enabled nrfx_usbd_is_enabled -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_is_started nrfx_usbd_is_started -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_suspend nrfx_usbd_suspend -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_wakeup_req nrfx_usbd_wakeup_req -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_suspend_check nrfx_usbd_suspend_check -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_suspend_irq_config nrfx_usbd_suspend_irq_config -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_active_irq_config nrfx_usbd_active_irq_config -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_force_bus_wakeup nrfx_usbd_force_bus_wakeup -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_bus_suspend_check nrfx_usbd_bus_suspend_check -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_max_packet_size_set nrfx_usbd_ep_max_packet_size_set -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_max_packet_size_get nrfx_usbd_ep_max_packet_size_get -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_enable_check nrfx_usbd_ep_enable_check -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_enable nrfx_usbd_ep_enable -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_disable nrfx_usbd_ep_disable -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_default_config nrfx_usbd_ep_default_config -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_transfer nrfx_usbd_ep_transfer -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_handled_transfer nrfx_usbd_ep_handled_transfer -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_feeder_buffer_get nrfx_usbd_feeder_buffer_get -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_status_get nrfx_usbd_ep_status_get -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_epout_size_get nrfx_usbd_epout_size_get -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_is_busy nrfx_usbd_ep_is_busy -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_stall nrfx_usbd_ep_stall -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_stall_clear nrfx_usbd_ep_stall_clear -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_stall_check nrfx_usbd_ep_stall_check -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_dtoggle_clear nrfx_usbd_ep_dtoggle_clear -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_setup_get nrfx_usbd_setup_get -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_setup_data_clear nrfx_usbd_setup_data_clear -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_setup_clear nrfx_usbd_setup_clear -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_setup_stall nrfx_usbd_setup_stall -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_ep_abort nrfx_usbd_ep_abort -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_last_setup_dir_get nrfx_usbd_last_setup_dir_get -/** @brief Type definition for forwarding the new implementation. */ -#define nrf_drv_usbd_transfer_out_drop nrfx_usbd_transfer_out_drop - -/** @brief Type definition for forwarding the new implementation. */ -static inline ret_code_t nrf_drv_usbd_uninit(void) -{ - nrfx_usbd_uninit(); - return NRF_SUCCESS; -} - -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif /* NRF_DRV_USBD_H__ */ diff --git a/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd_errata.h b/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd_errata.h deleted file mode 100644 index 00c589b67..000000000 --- a/third_party/NordicSemiconductor/drivers/usbd/nrf_drv_usbd_errata.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef NRF_DRV_USBD_ERRATA_H__ -#define NRF_DRV_USBD_ERRATA_H__ - -#include "nrfx.h" - -#ifndef NRFX_USBD_ERRATA_ENABLE - #ifdef NRF_DRV_USBD_ERRATA_ENABLE - #define NRFX_USBD_ERRATA_ENABLE NRF_DRV_USBD_ERRATA_ENABLE - #endif -#endif - -#include "../src/nrfx_usbd_errata.h" - -#ifndef NRF_DRV_USBD_ERRATA_ENABLE -#define NRF_DRV_USBD_ERRATA_ENABLE NRFX_USBD_ERRATA_ENABLE -#endif - -#define nrf_drv_usbd_errata_type_52840 nrfx_usbd_errata_type_52840 -#define nrf_drv_usbd_errata_type_52840_proto1 nrfx_usbd_errata_type_52840_proto1 -#define nrf_drv_usbd_errata_type_52840_fp1 nrfx_usbd_errata_type_52840_fp1 -#define nrf_drv_usbd_errata_type_52840_fp2 nrfx_usbd_errata_type_52840_fp2 -#define nrf_drv_usbd_errata_104 nrfx_usbd_errata_104 -#define nrf_drv_usbd_errata_154 nrfx_usbd_errata_154 -#define nrf_drv_usbd_errata_166 nrfx_usbd_errata_166 -#define nrf_drv_usbd_errata_171 nrfx_usbd_errata_171 -#define nrf_drv_usbd_errata_187 nrfx_usbd_errata_187 -#define nrf_drv_usbd_errata_sizeepout_rw nrfx_usbd_errata_sizeepout_rw -#define nrf_drv_usb_errata_199 nrfx_usb_errata_199 - -#endif /* NRF_DRV_USBD_ERRATA_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/app_error/app_error.c b/third_party/NordicSemiconductor/libraries/app_error/app_error.c deleted file mode 100644 index 97b2eed36..000000000 --- a/third_party/NordicSemiconductor/libraries/app_error/app_error.c +++ /dev/null @@ -1,139 +0,0 @@ -/** - * Copyright (c) 2014 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/** @file - * - * @defgroup app_error Common application error handler - * @{ - * @ingroup app_common - * - * @brief Common application error handler. - */ - -#include "nrf.h" -#include -#include "app_error.h" -#include "nordic_common.h" -#include "sdk_errors.h" - -/**@brief Function for error handling, which is called when an error has occurred. - * - * @warning This handler is an example only and does not fit a final product. You need to analyze - * how your product is supposed to react in case of error. - * - * @param[in] error_code Error code supplied to the handler. - * @param[in] line_num Line number where the handler is called. - * @param[in] p_file_name Pointer to the file name. - */ -void app_error_handler_bare(ret_code_t error_code) -{ - error_info_t error_info = - { - .line_num = 0, - .p_file_name = NULL, - .err_code = error_code, - }; - - app_error_fault_handler(NRF_FAULT_ID_SDK_ERROR, 0, (uint32_t)(&error_info)); - - UNUSED_VARIABLE(error_info); -} - -/**@brief Function for error handling, which is called when an error has occurred. - * - * @param[in] error_code Error code supplied to the handler. - * @param[in] line_num Line number where the handler is called. - * @param[in] p_file_name Pointer to the file name. - */ -void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name) -{ - UNUSED_VARIABLE(line_num); - UNUSED_VARIABLE(p_file_name); - - app_error_handler_bare(error_code); -} - -void app_error_save_and_stop(uint32_t id, uint32_t pc, uint32_t info) -{ - /* static error variables - in order to prevent removal by optimizers */ - static volatile struct - { - uint32_t fault_id; - uint32_t pc; - uint32_t error_info; - assert_info_t * p_assert_info; - error_info_t * p_error_info; - ret_code_t err_code; - uint32_t line_num; - const uint8_t * p_file_name; - } m_error_data = {0}; - - // The following variable helps Keil keep the call stack visible, in addition, it can be set to - // 0 in the debugger to continue executing code after the error check. - volatile bool loop = true; - UNUSED_VARIABLE(loop); - - m_error_data.fault_id = id; - m_error_data.pc = pc; - m_error_data.error_info = info; - - switch (id) - { - case NRF_FAULT_ID_SDK_ASSERT: - m_error_data.p_assert_info = (assert_info_t *)info; - m_error_data.line_num = m_error_data.p_assert_info->line_num; - m_error_data.p_file_name = m_error_data.p_assert_info->p_file_name; - break; - - case NRF_FAULT_ID_SDK_ERROR: - m_error_data.p_error_info = (error_info_t *)info; - m_error_data.err_code = m_error_data.p_error_info->err_code; - m_error_data.line_num = m_error_data.p_error_info->line_num; - m_error_data.p_file_name = m_error_data.p_error_info->p_file_name; - break; - } - - UNUSED_VARIABLE(m_error_data); - - // If printing is disrupted, remove the irq calls, or set the loop variable to 0 in the debugger. - __disable_irq(); - while (loop); - - __enable_irq(); -} diff --git a/third_party/NordicSemiconductor/libraries/app_error/app_error.h b/third_party/NordicSemiconductor/libraries/app_error/app_error.h deleted file mode 100644 index ff8b2a890..000000000 --- a/third_party/NordicSemiconductor/libraries/app_error/app_error.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Copyright (c) 2013 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/** @file - * - * @defgroup app_error Common application error handler - * @{ - * @ingroup app_common - * - * @brief Common application error handler and macros for utilizing a common error handler. - */ - -#ifndef APP_ERROR_H__ -#define APP_ERROR_H__ - - -#include -#include -#include -#include "nrf.h" -#include "sdk_errors.h" -#include "nordic_common.h" -#include "app_error_weak.h" -#ifdef ANT_STACK_SUPPORT_REQD -#include "ant_error.h" -#endif // ANT_STACK_SUPPORT_REQD - - - -#ifdef __cplusplus -extern "C" { -#endif - -#define NRF_FAULT_ID_SDK_RANGE_START (0x00004000) /**< The start of the range of error IDs defined in the SDK. */ - -/**@defgroup APP_ERROR_FAULT_IDS Fault ID types - * @{ */ -#define NRF_FAULT_ID_SDK_ERROR (NRF_FAULT_ID_SDK_RANGE_START + 1) /**< An error stemming from a call to @ref APP_ERROR_CHECK or @ref APP_ERROR_CHECK_BOOL. The info parameter is a pointer to an @ref error_info_t variable. */ -#define NRF_FAULT_ID_SDK_ASSERT (NRF_FAULT_ID_SDK_RANGE_START + 2) /**< An error stemming from a call to ASSERT (nrf_assert.h). The info parameter is a pointer to an @ref assert_info_t variable. */ -/**@} */ - -/**@brief Structure containing info about an error of the type @ref NRF_FAULT_ID_SDK_ERROR. - */ -typedef struct -{ - uint32_t line_num; /**< The line number where the error occurred. */ - uint8_t const * p_file_name; /**< The file in which the error occurred. */ - uint32_t err_code; /**< The error code representing the error that occurred. */ -} error_info_t; - -/**@brief Structure containing info about an error of the type @ref NRF_FAULT_ID_SDK_ASSERT. - */ -typedef struct -{ - uint16_t line_num; /**< The line number where the error occurred. */ - uint8_t const * p_file_name; /**< The file in which the error occurred. */ -} assert_info_t; - -/**@brief Defines required by app_error_handler assembler intructions. - */ -#define APP_ERROR_ERROR_INFO_OFFSET_LINE_NUM (offsetof(error_info_t, line_num)) -#define APP_ERROR_ERROR_INFO_OFFSET_P_FILE_NAME (offsetof(error_info_t, p_file_name)) -#define APP_ERROR_ERROR_INFO_OFFSET_ERR_CODE (offsetof(error_info_t, err_code)) -#define APP_ERROR_ERROR_INFO_SIZE (sizeof(error_info_t)) -#define APP_ERROR_ERROR_INFO_SIZE_ALIGNED_8BYTE \ - ALIGN_NUM(APP_ERROR_ERROR_INFO_SIZE, sizeof(uint64_t)) - - -/**@brief Function for error handling, which is called when an error has occurred. - * - * @param[in] error_code Error code supplied to the handler. - * @param[in] line_num Line number where the handler is called. - * @param[in] p_file_name Pointer to the file name. - */ -void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name); - -/**@brief Function for error handling, which is called when an error has occurred. - * - * @param[in] error_code Error code supplied to the handler. - */ -void app_error_handler_bare(ret_code_t error_code); - -/**@brief Function for saving the parameters and entering an eternal loop, for debug purposes. - * - * @param[in] id Fault identifier. See @ref NRF_FAULT_IDS. - * @param[in] pc The program counter of the instruction that triggered the fault, or 0 if - * unavailable. - * @param[in] info Optional additional information regarding the fault. Refer to each fault - * identifier for details. - */ -void app_error_save_and_stop(uint32_t id, uint32_t pc, uint32_t info); - -/**@brief Function for logging details of error and flushing logs. - * - * @param[in] id Fault identifier. See @ref NRF_FAULT_IDS. - * @param[in] pc The program counter of the instruction that triggered the fault, or 0 if - * unavailable. - * @param[in] info Optional additional information regarding the fault. Refer to each fault - * identifier for details. - */ -void app_error_log_handle(uint32_t id, uint32_t pc, uint32_t info); - - -/**@brief Macro for calling error handler function. - * - * @param[in] ERR_CODE Error code supplied to the error handler. - */ -#ifdef DEBUG -#define APP_ERROR_HANDLER(ERR_CODE) \ - do \ - { \ - app_error_handler((ERR_CODE), __LINE__, (uint8_t*) __FILE__); \ - } while (0) -#else -#define APP_ERROR_HANDLER(ERR_CODE) \ - do \ - { \ - app_error_handler_bare((ERR_CODE)); \ - } while (0) -#endif -/**@brief Macro for calling error handler function if supplied error code any other than NRF_SUCCESS. - * - * @param[in] ERR_CODE Error code supplied to the error handler. - */ -#define APP_ERROR_CHECK(ERR_CODE) \ - do \ - { \ - const uint32_t LOCAL_ERR_CODE = (ERR_CODE); \ - if (LOCAL_ERR_CODE != NRF_SUCCESS) \ - { \ - APP_ERROR_HANDLER(LOCAL_ERR_CODE); \ - } \ - } while (0) - -/**@brief Macro for calling error handler function if supplied boolean value is false. - * - * @param[in] BOOLEAN_VALUE Boolean value to be evaluated. - */ -#define APP_ERROR_CHECK_BOOL(BOOLEAN_VALUE) \ - do \ - { \ - const uint32_t LOCAL_BOOLEAN_VALUE = (BOOLEAN_VALUE); \ - if (!LOCAL_BOOLEAN_VALUE) \ - { \ - APP_ERROR_HANDLER(0); \ - } \ - } while (0) - - -#ifdef __cplusplus -} -#endif - -#endif // APP_ERROR_H__ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/app_error/app_error_weak.c b/third_party/NordicSemiconductor/libraries/app_error/app_error_weak.c deleted file mode 100644 index f101410f0..000000000 --- a/third_party/NordicSemiconductor/libraries/app_error/app_error_weak.c +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "app_error.h" - -/*lint -save -e14 */ -/** - * Function is implemented as weak so that it can be overwritten by custom application error handler - * when needed. - */ -__WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info) -{ - (void)id; - (void)pc; - (void)info; - -#ifndef DEBUG - NVIC_SystemReset(); -#else - app_error_save_and_stop(id, pc, info); -#endif // DEBUG -} -/*lint -restore */ diff --git a/third_party/NordicSemiconductor/libraries/app_error/app_error_weak.h b/third_party/NordicSemiconductor/libraries/app_error/app_error_weak.h deleted file mode 100644 index 4476ae1bd..000000000 --- a/third_party/NordicSemiconductor/libraries/app_error/app_error_weak.h +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c) 2016 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef APP_ERROR_WEAK_H__ -#define APP_ERROR_WEAK_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** @file - * - * @defgroup app_error Common application error handler - * @{ - * @ingroup app_common - * - * @brief Common application error handler. - */ - -/**@brief Callback function for errors, asserts, and faults. - * - * @details This function is called every time an error is raised in app_error, nrf_assert, or - * in the SoftDevice. Information about the error can be found in the @p info - * parameter. - * - * See also @ref nrf_fault_handler_t for more details. - * - * @note The function is implemented as weak so that it can be redefined by a custom error - * handler when needed. - * - * @param[in] id Fault identifier. See @ref NRF_FAULT_IDS. - * @param[in] pc The program counter of the instruction that triggered the fault, or 0 if - * unavailable. - * @param[in] info Optional additional information regarding the fault. The value of the @p id - * parameter dictates how to interpret this parameter. Refer to the documentation - * for each fault identifier (@ref NRF_FAULT_IDS and @ref APP_ERROR_FAULT_IDS) for - * details about interpreting @p info. - */ -void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info); - - -/** @} */ - - -#ifdef __cplusplus -} -#endif - -#endif // APP_ERROR_WEAK_H__ diff --git a/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.c b/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.c deleted file mode 100644 index 836e3b909..000000000 --- a/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.c +++ /dev/null @@ -1,189 +0,0 @@ -/** - * Copyright (c) 2011 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include -#include -#include -#include "app_util.h" -#include "nrf_atfifo.h" -#include "nrf_atfifo_internal.h" - -#if NRF_ATFIFO_CONFIG_LOG_ENABLED - #define NRF_LOG_LEVEL NRF_ATFIFO_CONFIG_LOG_LEVEL - #define NRF_LOG_INIT_FILTER_LEVEL NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL - #define NRF_LOG_INFO_COLOR NRF_ATFIFO_CONFIG_INFO_COLOR - #define NRF_LOG_DEBUG_COLOR NRF_ATFIFO_CONFIG_DEBUG_COLOR -#else - #define NRF_LOG_LEVEL 0 -#endif // NRF_ATFIFO_CONFIG_LOG_ENABLED -#include "nrf_log.h" - -/* Unions testing */ -STATIC_ASSERT(sizeof(nrf_atfifo_postag_t) == sizeof(uint32_t)); - - -ret_code_t nrf_atfifo_init(nrf_atfifo_t * const p_fifo, void * p_buf, uint16_t buf_size, uint16_t item_size) -{ - if (NULL == p_buf) - { - NRF_LOG_INST_ERROR(p_fifo->p_log, "Initialization failed. p_buf == NULL"); - return NRF_ERROR_NULL; - } - if (0 != (buf_size % item_size)) - { - NRF_LOG_INST_ERROR(p_fifo->p_log, "Initialization failed. Buf_size not multiple of item_size"); - return NRF_ERROR_INVALID_LENGTH; - } - - p_fifo->p_buf = p_buf; - p_fifo->tail.tag = 0; - p_fifo->head.tag = 0; - p_fifo->buf_size = buf_size; - p_fifo->item_size = item_size; - - NRF_LOG_INST_INFO(p_fifo->p_log, "Initialized."); - return NRF_SUCCESS; -} - - -ret_code_t nrf_atfifo_clear(nrf_atfifo_t * const p_fifo) -{ - bool released = nrf_atfifo_space_clear(p_fifo); - NRF_LOG_INST_INFO(p_fifo->p_log, "Cleared result:%s", released ? "success" : "busy"); - return released ? NRF_SUCCESS : NRF_ERROR_BUSY; -} - - -ret_code_t nrf_atfifo_alloc_put(nrf_atfifo_t * const p_fifo, void const * p_var, size_t size, bool * const p_visible) -{ - nrf_atfifo_item_put_t context; - bool visible; - void * p_data = nrf_atfifo_item_alloc(p_fifo, &context); - if (NULL == p_data) - { - NRF_LOG_INST_WARNING(p_fifo->p_log, "Copying in element (0x%08X) failed - no space.", p_var); - return NRF_ERROR_NO_MEM; - } - - memcpy(p_data, p_var, size); - - visible = nrf_atfifo_item_put(p_fifo, &context); - if (NULL != p_visible) - { - *p_visible = visible; - } - NRF_LOG_INST_DEBUG(p_fifo->p_log, "Element (0x%08X) copied in.", p_var); - return NRF_SUCCESS; -} - - -void * nrf_atfifo_item_alloc(nrf_atfifo_t * const p_fifo, nrf_atfifo_item_put_t * p_context) -{ - if (nrf_atfifo_wspace_req(p_fifo, &(p_context->last_tail))) - { - void * p_item = ((uint8_t*)(p_fifo->p_buf)) + p_context->last_tail.pos.wr; - NRF_LOG_INST_DEBUG(p_fifo->p_log, "Allocated element (0x%08X).", p_item); - return p_item; - } - NRF_LOG_INST_WARNING(p_fifo->p_log, "Allocation failed - no space."); - return NULL; -} - - -bool nrf_atfifo_item_put(nrf_atfifo_t * const p_fifo, nrf_atfifo_item_put_t * p_context) -{ - if ((p_context->last_tail.pos.wr) == (p_context->last_tail.pos.rd)) - { - NRF_LOG_INST_DEBUG(p_fifo->p_log, "Put (uninterrupted)"); - nrf_atfifo_wspace_close(p_fifo); - return true; - } - NRF_LOG_INST_DEBUG(p_fifo->p_log, "Put (interrupted!)"); - return false; -} - - -ret_code_t nrf_atfifo_get_free(nrf_atfifo_t * const p_fifo, void * const p_var, size_t size, bool * p_released) -{ - nrf_atfifo_item_get_t context; - bool released; - void const * p_s = nrf_atfifo_item_get(p_fifo, &context); - if (NULL == p_s) - { - NRF_LOG_INST_WARNING(p_fifo->p_log, "Copying out failed - no item in the FIFO."); - return NRF_ERROR_NOT_FOUND; - } - - memcpy(p_var, p_s, size); - - released = nrf_atfifo_item_free(p_fifo, &context); - if (NULL != p_released) - { - *p_released = released; - } - NRF_LOG_INST_DEBUG(p_fifo->p_log, "Element (0x%08X) copied out.", p_var); - return NRF_SUCCESS; -} - - -void * nrf_atfifo_item_get(nrf_atfifo_t * const p_fifo, nrf_atfifo_item_get_t * p_context) -{ - if (nrf_atfifo_rspace_req(p_fifo, &(p_context->last_head))) - { - void * p_item = ((uint8_t*)(p_fifo->p_buf)) + p_context->last_head.pos.rd; - NRF_LOG_INST_DEBUG(p_fifo->p_log, "Get element: 0x%08X", p_item); - return p_item; - } - NRF_LOG_INST_WARNING(p_fifo->p_log, "Get failed - no item in the FIFO."); - return NULL; -} - - -bool nrf_atfifo_item_free(nrf_atfifo_t * const p_fifo, nrf_atfifo_item_get_t * p_context) -{ - if ((p_context->last_head.pos.wr) == (p_context->last_head.pos.rd)) - { - NRF_LOG_INST_DEBUG(p_fifo->p_log, "Free (uninterrupted)"); - nrf_atfifo_rspace_close(p_fifo); - return true; - } - NRF_LOG_INST_DEBUG(p_fifo->p_log, "Free (interrupted)"); - return false; -} diff --git a/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.h b/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.h deleted file mode 100644 index e8c2ad0f0..000000000 --- a/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo.h +++ /dev/null @@ -1,424 +0,0 @@ -/** - * Copyright (c) 2011 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_ATFIFO_H__ -#define NRF_ATFIFO_H__ - -#include -#include -#include "sdk_config.h" -#include "nordic_common.h" -#include "nrf_assert.h" -#include "sdk_errors.h" -#include "nrf_log_instance.h" -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup nrf_atfifo Atomic FIFO - * @ingroup app_common - * - * @brief @tagAPI52 FIFO implementation that allows for making atomic transactions without - * locking interrupts. - * - * @details There are two types of functions to prepare the FIFO writing: - * - Single function for simple access: - * @code - * if (NRF_SUCCESS != nrf_atfifo_simple_put(my_fifo, &data, NULL)) - * { - * // Error handling - * } - * @endcode - * - Function pair to limit data copying: - * @code - * struct point3d - * { - * int x, y, z; - * }point3d_t; - * nrf_atfifo_context_t context; - * point3d_t * point; - * - * if (NULL != (point = nrf_atfifo_item_alloc(my_fifo, &context))) - * { - * point->x = a; - * point->y = b; - * point->z = c; - * if (nrf_atfifo_item_put(my_fifo, &context)) - * { - * // Send information to the rest of the system - * // that there is new data in the FIFO available for reading. - * } - * } - * else - * { - * // Error handling - * } - * - * @endcode - * @note - * This atomic FIFO implementation requires that the operation that is - * opened last is finished (committed/flushed) first. - * This is typical for operations performed from the interrupt runtime - * when the other operation is performed from the main thread. - * - * This implementation does not support typical multithreading operating system - * access where operations can be started and finished in totally unrelated order. - * - * @{ - */ - -/** - * @brief Read and write position structure. - * - * A structure that holds the read and write position used by the FIFO head and tail. - */ -typedef struct nrf_atfifo_postag_pos_s -{ - uint16_t wr; //!< First free space to write the data - uint16_t rd; //!< A place after the last data to read -}nrf_atfifo_postag_pos_t; - -/** - * @brief End data index tag. - * - * A tag used to mark the end of data. - * To properly realize atomic data committing, the whole variable has to be - * accessed atomically. - */ -typedef union nrf_atfifo_postag_u -{ - uint32_t tag; //!< Whole tag, used for atomic, 32-bit access - nrf_atfifo_postag_pos_t pos; //!< Structure that holds reading and writing position separately -}nrf_atfifo_postag_t; - -/** - * @brief The FIFO instance. - * - * The instance of atomic FIFO. - * Used with all FIFO functions. - */ -typedef struct nrf_atfifo_s -{ - void * p_buf; //!< Pointer to the data buffer - nrf_atfifo_postag_t tail; //!< Read and write tail position tag - nrf_atfifo_postag_t head; //!< Read and write head position tag - uint16_t buf_size; //!< FIFO size in number of bytes (has to be divisible by @c item_size) - uint16_t item_size; //!< Size of a single FIFO item - NRF_LOG_INSTANCE_PTR_DECLARE(p_log) //!< Pointer to instance of the logger object (Conditionally compiled). -}nrf_atfifo_t; - -/** - * @brief FIFO write operation item context. - * - * Context structure used to mark an allocated space in FIFO that is ready for put. - * All the data required to properly put allocated and written data. - */ -typedef struct nrf_atfifo_item_put_s -{ - nrf_atfifo_postag_t last_tail; //!< Tail tag value that was here when opening the FIFO to write -}nrf_atfifo_item_put_t; - - -/** - * @brief FIFO read operation item context. - * - * Context structure used to mark an opened get operation to properly free an item after reading. - */ -typedef struct nrf_atfifo_rcontext_s -{ - nrf_atfifo_postag_t last_head; //!< Head tag value that was here when opening the FIFO to read -}nrf_atfifo_item_get_t; - - -/** @brief Name of the module used for logger messaging. - */ -#define NRF_ATFIFO_LOG_NAME atfifo - -/** - * @defgroup nrf_atfifo_instmacros FIFO instance macros - * - * A group of macros helpful for FIFO instance creation and initialization. - * They may be used to create and initialize instances for most use cases. - * - * FIFO may also be created and initialized directly using - * @ref nrf_atfifo_init function. - * @{ - */ - /** - * @brief Macro for generating the name for a data buffer. - * - * The name of the data buffer that would be created by - * @ref NRF_ATFIFO_DEF macro. - * - * @param[in] fifo_id Identifier of the FIFO object. - * - * @return Name of the buffer variable. - * - * @note This is auxiliary internal macro and in normal usage - * it should not be called. - */ - #define NRF_ATFIFO_BUF_NAME(fifo_id) CONCAT_2(fifo_id, _data) - - /** - * @brief Macro for generating the name for a FIFO instance. - * - * The name of the instance variable that will be created by the - * @ref NRF_ATFIFO_DEF macro. - * - * @param[in] fifo_id Identifier of the FIFO object. - * - * @return Name of the instance variable. - * - * @note This is auxiliary internal macro and in normal usage - * it should not be called. - */ - #define NRF_ATFIFO_INST_NAME(fifo_id) CONCAT_2(fifo_id, _inst) - - /** - * @brief Macro for creating an instance. - * - * Creates the FIFO object variable itself. - * - * Usage example: - * @code - * NRF_ATFIFO_DEF(my_fifo, uint16_t, 12); - * NRF_ATFIFO_INIT(my_fifo); - * - * uint16_t some_val = 45; - * nrf_atfifo_item_put(my_fifo, &some_val, sizeof(some_val), NULL); - * nrf_atfifo_item_get(my_fifo, &some_val, sizeof(some_val), NULL); - * @endcode - * - * @param[in] fifo_id Identifier of a FIFO object. - * This identifier will be a pointer to the instance. - * It makes it possible to use this directly for the functions - * that operate on the FIFO. - * Because it is a static const object, it should be optimized by the compiler. - * @param[in] storage_type Type of data that will be stored in the FIFO. - * @param[in] item_cnt Capacity of the created FIFO in maximum number of items that may be stored. - * The phisical size of the buffer will be 1 element bigger. - */ - #define NRF_ATFIFO_DEF(fifo_id, storage_type, item_cnt) \ - static storage_type NRF_ATFIFO_BUF_NAME(fifo_id)[(item_cnt)+1]; \ - NRF_LOG_INSTANCE_REGISTER(NRF_ATFIFO_LOG_NAME, fifo_id, \ - NRF_ATFIFO_CONFIG_INFO_COLOR, \ - NRF_ATFIFO_CONFIG_DEBUG_COLOR, \ - NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL, \ - NRF_ATFIFO_CONFIG_LOG_ENABLED ? \ - NRF_ATFIFO_CONFIG_LOG_LEVEL : NRF_LOG_SEVERITY_NONE); \ - static nrf_atfifo_t NRF_ATFIFO_INST_NAME(fifo_id) = { \ - .p_buf = NULL, \ - NRF_LOG_INSTANCE_PTR_INIT(p_log, NRF_ATFIFO_LOG_NAME, fifo_id) \ - }; \ - static nrf_atfifo_t * const fifo_id = &NRF_ATFIFO_INST_NAME(fifo_id) - - /** - * @brief Macro for initializing the FIFO that was previously declared by the macro. - * - * Use this macro to simplify FIFO initialization. - * - * @note - * This macro can be only used on a FIFO object defined by @ref NRF_ATFIFO_DEF macro. - * - * @param[in] fifo_id Identifier of the FIFO object. - * - * @return Value from the @ref nrf_atfifo_init function. - */ - #define NRF_ATFIFO_INIT(fifo_id) \ - nrf_atfifo_init( \ - fifo_id, \ - NRF_ATFIFO_BUF_NAME(fifo_id), \ - sizeof(NRF_ATFIFO_BUF_NAME(fifo_id)), \ - sizeof(NRF_ATFIFO_BUF_NAME(fifo_id)[0]) \ - ) - -/** @} */ - -/** - * @brief Function for initializing the FIFO. - * - * Preparing the FIFO instance to work. - * - * @param[out] p_fifo FIFO object to initialize. - * @param[in,out] p_buf FIFO buffer for storing data. - * @param[in] buf_size Total buffer size (has to be divisible by @c item_size). - * @param[in] item_size Size of a single item held inside the FIFO. - * - * @retval NRF_SUCCESS If initialization was successful. - * @retval NRF_ERROR_NULL If a NULL pointer is provided as the buffer. - * @retval NRF_ERROR_INVALID_LENGTH If size of the buffer provided is not divisible by @c item_size. - * - * @note - * Buffer size must be able to hold one element more than the designed FIFO capacity. - * This one, empty element is used for overflow checking. - */ -ret_code_t nrf_atfifo_init(nrf_atfifo_t * const p_fifo, void * p_buf, uint16_t buf_size, uint16_t item_size); - -/** - * @brief Function for clearing the FIFO. - * - * Function for clearing the FIFO. - * - * If this function is called during an opened and uncommitted write operation, - * the FIFO is cleared up to the currently ongoing commit. - * There is no possibility to cancel an ongoing commit. - * - * If this function is called during an opened and unflushed read operation, - * the read position in the head is set, but copying it into the write head position - * is left to read closing operation. - * - * This way, there is no more data to read, but the memory is released - * in the moment when it is safe. - * - * @param[in,out] p_fifo FIFO object. - * - * @retval NRF_SUCCESS FIFO totally cleared. - * @retval NRF_ERROR_BUSY Function called in the middle of writing or reading operation. - * If it is called in the middle of writing operation, - * FIFO was cleared up to the already started and uncommitted write. - * If it is called in the middle of reading operation, - * write head was only moved. It will be copied into read tail when the reading operation - * is flushed. - */ -ret_code_t nrf_atfifo_clear(nrf_atfifo_t * const p_fifo); - -/** - * @brief Function for atomically putting data into the FIFO. - * - * It uses memcpy function inside and in most situations, it is more suitable to - * use @ref nrf_atfifo_item_alloc, write the data, and @ref nrf_atfifo_item_put to store a new value - * in a FIFO. - * - * @param[in,out] p_fifo FIFO object. - * @param[in] p_var Variable to copy. - * @param[in] size Size of the variable to copy. - * Can be smaller or equal to the FIFO item size. - * @param[out] p_visible See value returned by @ref nrf_atfifo_item_put. - * It may be NULL if the caller does not require the current operation status. - * - * @retval NRF_SUCCESS If an element has been successfully added to the FIFO. - * @retval NRF_ERROR_NO_MEM If the FIFO is full. - * - * @note - * To avoid data copying, you can use the @ref nrf_atfifo_item_alloc and @ref nrf_atfifo_item_put - * functions pair. - */ -ret_code_t nrf_atfifo_alloc_put(nrf_atfifo_t * const p_fifo, void const * const p_var, size_t size, bool * const p_visible); - -/** - * @brief Function for opening the FIFO for writing. - * - * Function called to start the FIFO write operation and access the given FIFO buffer directly. - * - * @param[in,out] p_fifo FIFO object. - * @param[out] p_context Operation context, required by @ref nrf_atfifo_item_put. - * - * @return Pointer to the space where variable data can be stored. - * NULL if there is no space in the buffer. - */ -void * nrf_atfifo_item_alloc(nrf_atfifo_t * const p_fifo, nrf_atfifo_item_put_t * p_context); - -/** - * @brief Function for closing the writing operation. - * - * Puts a previously allocated context into FIFO. - * This function must be called to commit an opened write operation. - * It sets all the buffers and marks the data, so that it is visible to read. - * - * @param[in,out] p_fifo FIFO object. - * @param[in] p_context Operation context, filled by the @ref nrf_atfifo_item_alloc function. - * - * @retval true Data is currently ready and will be visible to read. - * @retval false The internal commit was marked, but the writing operation interrupted another writing operation. - * The data will be available to read when the interrupted operation is committed. - */ -bool nrf_atfifo_item_put(nrf_atfifo_t * const p_fifo, nrf_atfifo_item_put_t * p_context); - -/** - * @brief Function for getting a single value from the FIFO. - * - * This function gets the value from the top of the FIFO. - * The value is removed from the FIFO memory. - * - * @param[in,out] p_fifo FIFO object. - * @param[out] p_var Pointer to the variable to store the data. - * @param[in] size Size of the data to be loaded. - * @param[out] p_released See the values returned by @ref nrf_atfifo_item_free. - * - * @retval NRF_SUCCESS Element was successfully copied from the FIFO memory. - * @retval NRF_ERROR_NOT_FOUND No data in the FIFO. - */ -ret_code_t nrf_atfifo_get_free(nrf_atfifo_t * const p_fifo, void * const p_var, size_t size, bool * p_released); - -/** - * @brief Function for opening the FIFO for reading. - * - * Function called to start the FIFO read operation and access the given FIFO buffer directly. - * - * @param[in,out] p_fifo FIFO object. - * @param[out] p_context The operation context, required by @ref nrf_atfifo_item_free - * - * @return Pointer to data buffer or NULL if there is no data in the FIFO. - */ -void * nrf_atfifo_item_get(nrf_atfifo_t * const p_fifo, nrf_atfifo_item_get_t * p_context); - -/** - * @brief Function for closing the reading operation. - * - * Function used to finish the reading operation. - * If this reading operation does not interrupt another reading operation, the head write buffer is moved. - * If this reading operation is placed in the middle of another reading, only the new read pointer is written. - * - * @param[in,out] p_fifo FIFO object. - * @param[in] p_context Context of the reading operation to be closed. - * - * @retval true This operation is not generated in the middle of another read operation and the write head will be updated to the read head (space is released). - * @retval false This operation was performed in the middle of another read operation and the write buffer head was not moved (no space is released). - */ -bool nrf_atfifo_item_free(nrf_atfifo_t * const p_fifo, nrf_atfifo_item_get_t * p_context); - - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_ATFIFO_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo_internal.h b/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo_internal.h deleted file mode 100644 index 8e87eb576..000000000 --- a/third_party/NordicSemiconductor/libraries/atfifo/nrf_atfifo_internal.h +++ /dev/null @@ -1,577 +0,0 @@ -/** - * Copyright (c) 2011 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -/** - * @file - * @brief Atomic FIFO internal file - * - * This file should be included only by nrf_atfifo internally. - * Needs nrf_atfifo.h included first. - */ -#ifndef NRF_ATFIFO_H__ -#error This is internal file. Do not include this file in your program. -#endif - -#ifndef NRF_ATFIFO_INTERNAL_H__ -#define NRF_ATFIFO_INTERNAL_H__ -#include -#include "nrf.h" -#include "app_util.h" -#include "nordic_common.h" - -#if ((__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U)) == 0 -#error Unsupported core version -#endif - -/* - * Make sure that rd and wr pos in a tag are aligned like expected - * Changing this would require changes inside assembly code! - */ -STATIC_ASSERT(offsetof(nrf_atfifo_postag_pos_t, wr) == 0); -STATIC_ASSERT(offsetof(nrf_atfifo_postag_pos_t, rd) == 2); - -/** - * @brief Atomically reserve space for a new write. - * - * @param[in,out] p_fifo FIFO object. - * @param[out] old_tail Tail position tag before new space is reserved. - * - * @retval true Space available. - * @retval false Memory full. - * - * @sa nrf_atfifo_wspace_close - */ -static bool nrf_atfifo_wspace_req(nrf_atfifo_t * const p_fifo, nrf_atfifo_postag_t * const p_old_tail); - -/** - * @brief Atomically mark all written data available. - * - * This function marks all data available for reading. - * This marking is done by copying tail.pos.wr into tail.pos.rd. - * - * It must be called only when closing the first write. - * It cannot be called if any write access was interrupted. - * See the code below: - * @code - * if (old_tail.pos.wr == old_tail.pos.rd) - * { - * nrf_atfifo_wspace_close(my_fifo); - * return true; - * } - * return false; - * @endcode - * - * @param[in,out] p_fifo FIFO object. - * - * @sa nrf_atfifo_wspace_req - */ -static void nrf_atfifo_wspace_close(nrf_atfifo_t * const p_fifo); - -/** - * @brief Atomically get a part of a buffer to read data. - * - * @param[in,out] p_fifo FIFO object. - * @param[out] old_head Head position tag before the data buffer is read. - * - * @retval true Data available for reading. - * @retval false No data in the buffer. - * - * @sa nrf_atfifo_rspace_close - */ -static bool nrf_atfifo_rspace_req(nrf_atfifo_t * const p_fifo, nrf_atfifo_postag_t * const p_old_head); - -/** - * @brief Atomically release all read data. - * - * This function marks all data that was read as free space, - * which is available for writing. - * This marking is done by copying head.pos.rd into head.pos.wr. - * - * It must be called only when closing the first read. - * It cannot be called when the current read access interrupted any other read access. - * See code below: - * @code - * if (old_head.pos.wr == old_head.pos.rd) - * { - * nrf_atfifo_rspace_close(my_fifo); - * return true; - * } - * return false; - * @endcode - * - * @param[in,out] p_fifo FIFO object. - * - * @sa nrf_atfifo_rspace_req - */ -static void nrf_atfifo_rspace_close(nrf_atfifo_t * const p_fifo); - -/** - * @brief Safely clear the FIFO, internal function. - * - * This function realizes the functionality required by @ref nrf_atfifo_clear. - * - * @param[in,out] p_fifo FIFO object. - * - * @retval true All the data was released. - * @retval false All the data available for releasing was released, but there is some pending transfer. - */ -static bool nrf_atfifo_space_clear(nrf_atfifo_t * const p_fifo); - - -/* --------------------------------------------------------------------------- - * Implementation starts here - */ - -#if defined ( __CC_ARM ) - - -__ASM bool nrf_atfifo_wspace_req(nrf_atfifo_t * const p_fifo, nrf_atfifo_postag_t * const p_old_tail) -{ - /* Registry usage: - * R0 - p_fifo - * R1 - p_old_tail - * R2 - internal variable old_tail (saved by caller) - * R3 - internal variable new_tail (saved by caller) - * R4 - internal temporary register (saved by this function) - * R5 - not used stored to keep the stack aligned to 8 bytes - * Returned value: - * R0 (bool - 32 bits) - */ - push {r4, r5} -nrf_atfifo_wspace_req_repeat - /* Load tail tag and set memory monitor !!! R2 - old tail !!! */ - ldrex r2, [r0, #__cpp(offsetof(nrf_atfifo_t, tail))] - /* Extract write position !!! R3 !!! */ - uxth r3, r2 - /* Increment address with overload support !!! R4 used temporary !!! */ - ldrh r4, [r0, #__cpp(offsetof(nrf_atfifo_t, item_size))] - add r3, r4 - ldrh r4, [r0, #__cpp(offsetof(nrf_atfifo_t, buf_size))] - cmp r3, r4 - it hs - subhs r3, r3, r4 - - /* Check if FIFO would overload after making this increment !!! R4 used temporary !!! */ - ldrh r4, [r0, #__cpp(offsetof(nrf_atfifo_t, head) + offsetof(nrf_atfifo_postag_pos_t, wr))] - cmp r3, r4 - ittt eq - clrexeq - moveq r0, #__cpp(false) - beq nrf_atfifo_wspace_req_exit - - /* Pack everything back !!! R3 - new tail !!! */ - /* Copy lower byte from new_tail, and higher byte is a value from the top of old_tail */ - pkhbt r3, r3, r2 - - /* Store new value clearing memory monitor !!! R4 used temporary !!! */ - strex r4, r3, [r0, #__cpp(offsetof(nrf_atfifo_t, tail))] - cmp r4, #0 - bne nrf_atfifo_wspace_req_repeat - - /* Return true */ - mov r0, #__cpp(true) -nrf_atfifo_wspace_req_exit - /* Save old tail */ - str r2, [r1] - pop {r4, r5} - bx lr -} - - -__ASM void nrf_atfifo_wspace_close(nrf_atfifo_t * const p_fifo) -{ - /* Registry usage: - * R0 - p_fifo - * R1 - internal temporary register - * R2 - new_tail - */ -nrf_atfifo_wspace_close_repeat - ldrex r2, [r0, #__cpp(offsetof(nrf_atfifo_t, tail))] - /* Copy from lower byte to higher */ - pkhbt r2, r2, r2, lsl #16 - - strex r1, r2, [r0, #__cpp(offsetof(nrf_atfifo_t, tail))] - cmp r1, #0 - bne nrf_atfifo_wspace_close_repeat - bx lr -} - - -__ASM bool nrf_atfifo_rspace_req(nrf_atfifo_t * const p_fifo, nrf_atfifo_postag_t * const p_old_head) -{ - /* Registry usage: - * R0 - p_fifo - * R1 - p_old_head - * R2 - internal variable old_head (saved by caller) - * R3 - internal variable new_head (saved by caller) - * R4 - internal temporary register (saved by this function) - * R5 - not used stored to keep the stack aligned to 8 bytes - * Returned value: - * R0 (bool - 32 bits) - */ - push {r4, r5} -nrf_atfifo_rspace_req_repeat - /* Load tail tag and set memory monitor !!! R2 - old tail !!! */ - ldrex r2, [r0, #__cpp(offsetof(nrf_atfifo_t, head))] - /* Extract read position !!! R3 !!! */ - uxth r3, r2, ror #16 - - /* Check if we have any data !!! R4 used temporary !!! */ - ldrh r4, [r0, #__cpp(offsetof(nrf_atfifo_t, tail) + offsetof(nrf_atfifo_postag_pos_t, rd))] - cmp r3, r4 - ittt eq - clrexeq - moveq r0, #__cpp(false) - beq nrf_atfifo_rspace_req_exit - - /* Increment address with overload support !!! R4 used temporary !!! */ - ldrh r4, [r0, #__cpp(offsetof(nrf_atfifo_t, item_size))] - add r3, r4 - ldrh r4, [r0, #__cpp(offsetof(nrf_atfifo_t, buf_size))] - cmp r3, r4 - it hs - subhs r3, r3, r4 - - /* Pack everything back !!! R3 - new tail !!! */ - /* Copy lower byte from old_head, and higher byte is a value from write_pos */ - pkhbt r3, r2, r3, lsl #16 - - /* Store new value clearing memory monitor !!! R4 used temporary !!! */ - strex r4, r3, [r0, #__cpp(offsetof(nrf_atfifo_t, head))] - cmp r4, #0 - bne nrf_atfifo_rspace_req_repeat - - /* Return true */ - mov r0, #__cpp(true) -nrf_atfifo_rspace_req_exit - /* Save old head */ - str r2, [r1] - pop {r4, r5} - bx lr -} - - -__ASM void nrf_atfifo_rspace_close(nrf_atfifo_t * const p_fifo) -{ - /* Registry usage: - * R0 - p_fifo - * R1 - internal temporary register - * R2 - new_tail - */ -nrf_atfifo_rspace_close_repeat - ldrex r2, [r0, #__cpp(offsetof(nrf_atfifo_t, head))] - /* Copy from higher byte to lower */ - pkhtb r2, r2, r2, asr #16 - - strex r1, r2, [r0, #__cpp(offsetof(nrf_atfifo_t, head))] - cmp r1, #0 - bne nrf_atfifo_rspace_close_repeat - bx lr -} - - -__ASM bool nrf_atfifo_space_clear(nrf_atfifo_t * const p_fifo) -{ - /* Registry usage: - * R0 - p_fifo as input, bool output after - * R1 - tail, rd pointer, new_head - * R2 - head_old, destroyed when creating new_head - * R3 - p_fifo - copy - */ - mov r3, r0 -nrf_atfifo_space_clear_repeat - /* Load old head in !!! R2 register !!! and read pointer of tail in !!! R1 register !!! */ - ldrex r2, [r3, #__cpp(offsetof(nrf_atfifo_t, head))] - ldrh r1, [r3, #__cpp(offsetof(nrf_atfifo_t, tail) + offsetof(nrf_atfifo_postag_pos_t, rd))] - cmp r2, r2, ror #16 - /* Return false as default */ - mov r0, #__cpp(false) - /* Create new head in !!! R1 register !!! Data in !!! R2 register broken !!! */ - itett ne - uxthne r2, r2 - orreq r1, r1, r1, lsl #16 - orrne r1, r2, r1, lsl #16 - - /* Skip header test */ - bne nrf_atfifo_space_clear_head_test_skip - - /* Load whole tail and test it !!! R2 used !!! */ - ldr r2, [r3, #__cpp(offsetof(nrf_atfifo_t, tail))] - cmp r2, r2, ror #16 - /* Return true if equal */ - it eq - moveq r0, #__cpp(true) - -nrf_atfifo_space_clear_head_test_skip - /* Store and test if success !!! R2 used temporary !!! */ - strex r2, r1, [r3, #__cpp(offsetof(nrf_atfifo_t, head))] - cmp r2, #0 - bne nrf_atfifo_space_clear_repeat - bx lr -} - -#elif defined ( __ICCARM__ ) || defined ( __GNUC__ ) - -bool nrf_atfifo_wspace_req(nrf_atfifo_t * const p_fifo, nrf_atfifo_postag_t * const p_old_tail) -{ - volatile bool ret; - volatile uint32_t old_tail; - uint32_t new_tail; - uint32_t temp; - - __ASM volatile( - /* For more comments see Keil version above */ - "1: \n" - " ldrex %[old_tail], [%[p_fifo], %[offset_tail]] \n" - " uxth %[new_tail], %[old_tail] \n" - " \n" - " ldrh %[temp], [%[p_fifo], %[offset_item_size]] \n" - " add %[new_tail], %[temp] \n" - " ldrh %[temp], [%[p_fifo], %[offset_buf_size]] \n" - " cmp %[new_tail], %[temp] \n" - " it hs \n" - " subhs %[new_tail], %[new_tail], %[temp] \n" - " \n" - " ldrh %[temp], [%[p_fifo], %[offset_head_wr]] \n" - " cmp %[new_tail], %[temp] \n" - " ittt eq \n" - " clrexeq \n" - " moveq %[ret], %[false_val] \n" - " beq.n 2f \n" - " \n" - " pkhbt %[new_tail], %[new_tail], %[old_tail] \n" - " \n" - " strex %[temp], %[new_tail], [%[p_fifo], %[offset_tail]] \n" - " cmp %[temp], #0 \n" - " bne.n 1b \n" - " \n" - " mov %[ret], %[true_val] \n" - "2: \n" - : /* Output operands */ - [ret] "=r"(ret), - [temp] "=&r"(temp), - [old_tail]"=&r"(old_tail), - [new_tail]"=&r"(new_tail) - : /* Input operands */ - [p_fifo] "r"(p_fifo), - [offset_tail] "J"(offsetof(nrf_atfifo_t, tail)), - [offset_head_wr] "J"(offsetof(nrf_atfifo_t, head) + offsetof(nrf_atfifo_postag_pos_t, wr)), - [offset_item_size]"J"(offsetof(nrf_atfifo_t, item_size)), - [offset_buf_size] "J"(offsetof(nrf_atfifo_t, buf_size)), - [true_val] "I"(true), - [false_val] "I"(false) - : /* Clobbers */ - "cc"); - - p_old_tail->tag = old_tail; - UNUSED_VARIABLE(new_tail); - UNUSED_VARIABLE(temp); - return ret; -} - - -void nrf_atfifo_wspace_close(nrf_atfifo_t * const p_fifo) -{ - uint32_t temp; - uint32_t new_tail; - - __ASM volatile( - /* For more comments see Keil version above */ - "1: \n" - " ldrex %[new_tail], [%[p_fifo], %[offset_tail]] \n" - " pkhbt %[new_tail],%[new_tail], %[new_tail], lsl #16 \n" - " \n" - " strex %[temp], %[new_tail], [%[p_fifo], %[offset_tail]] \n" - " cmp %[temp], #0 \n" - " bne.n 1b \n" - : /* Output operands */ - [temp] "=&r"(temp), - [new_tail] "=&r"(new_tail) - : /* Input operands */ - [p_fifo] "r"(p_fifo), - [offset_tail] "J"(offsetof(nrf_atfifo_t, tail)) - : /* Clobbers */ - "cc"); - - UNUSED_VARIABLE(temp); - UNUSED_VARIABLE(new_tail); -} - - -bool nrf_atfifo_rspace_req(nrf_atfifo_t * const p_fifo, nrf_atfifo_postag_t * const p_old_head) -{ - volatile bool ret; - volatile uint32_t old_head; - uint32_t new_head; - uint32_t temp; - - __ASM volatile( - /* For more comments see Keil version above */ - "1: \n" - " ldrex %[old_head], [%[p_fifo], %[offset_head]] \n" - " uxth %[new_head], %[old_head], ror #16 \n" - " \n" - " ldrh %[temp], [%[p_fifo], %[offset_tail_rd]] \n" - " cmp %[new_head], %[temp] \n" - " ittt eq \n" - " clrexeq \n" - " moveq %[ret], %[false_val] \n" - " beq.n 2f \n" - " \n" - " ldrh %[temp], [%[p_fifo], %[offset_item_size]] \n" - " add %[new_head], %[temp] \n" - " ldrh %[temp], [%[p_fifo], %[offset_buf_size]] \n" - " cmp %[new_head], %[temp] \n" - " it hs \n" - " subhs %[new_head], %[new_head], %[temp] \n" - " \n" - " pkhbt %[new_head], %[old_head], %[new_head], lsl #16 \n" - " \n" - " strex %[temp], %[new_head], [%[p_fifo], %[offset_head]] \n" - " cmp %[temp], #0 \n" - " bne.n 1b \n" - " \n" - " mov %[ret], %[true_val] \n" - "2: \n" - : /* Output operands */ - [ret] "=r"(ret), - [temp] "=&r"(temp), - [old_head]"=&r"(old_head), - [new_head]"=&r"(new_head) - : /* Input operands */ - [p_fifo] "r"(p_fifo), - [offset_head] "J"(offsetof(nrf_atfifo_t, head)), - [offset_tail_rd] "J"(offsetof(nrf_atfifo_t, tail) + offsetof(nrf_atfifo_postag_pos_t, rd)), - [offset_item_size]"J"(offsetof(nrf_atfifo_t, item_size)), - [offset_buf_size] "J"(offsetof(nrf_atfifo_t, buf_size)), - [true_val] "I"(true), - [false_val] "I"(false) - : /* Clobbers */ - "cc"); - - p_old_head->tag = old_head; - UNUSED_VARIABLE(new_head); - UNUSED_VARIABLE(temp); - return ret; -} - - -void nrf_atfifo_rspace_close(nrf_atfifo_t * const p_fifo) -{ - uint32_t temp; - uint32_t new_head; - - __ASM volatile( - /* For more comments see Keil version above */ - "1: \n" - " ldrex %[new_head], [%[p_fifo], %[offset_head]] \n" - " pkhtb %[new_head],%[new_head], %[new_head], asr #16 \n" - " \n" - " strex %[temp], %[new_head], [%[p_fifo], %[offset_head]] \n" - " cmp %[temp], #0 \n" - " bne.n 1b \n" - : /* Output operands */ - [temp] "=&r"(temp), - [new_head] "=&r"(new_head) - : /* Input operands */ - [p_fifo] "r"(p_fifo), - [offset_head] "J"(offsetof(nrf_atfifo_t, head)) - : /* Clobbers */ - "cc"); - - UNUSED_VARIABLE(temp); - UNUSED_VARIABLE(new_head); -} - - -bool nrf_atfifo_space_clear(nrf_atfifo_t * const p_fifo) -{ - volatile bool ret; - uint32_t old_head; /* This variable is left broken after assembly code finishes */ - uint32_t new_head; - - __ASM volatile( - "1: \n" - " ldrex %[old_head], [%[p_fifo], %[offset_head]] \n" - " ldrh %[new_head], [%[p_fifo], %[offset_tail_rd]] \n" - " cmp %[old_head], %[old_head], ror #16 \n" - " \n" - " mov %[ret], %[false_val] \n" - " \n" - " itett ne \n" - " uxthne %[old_head], %[old_head] \n" - " orreq %[new_head], %[new_head], %[new_head], lsl #16 \n" - " orrne %[new_head], %[old_head], %[new_head], lsl #16 \n" - " \n" - " bne.n 2f \n" - " \n" - " ldr %[old_head], [%[p_fifo], %[offset_tail]] \n" - " cmp %[old_head], %[old_head], ror #16 \n" - " it eq \n" - " moveq %[ret], %[true_val] \n" - " \n" - "2: \n" - " strex %[old_head], %[new_head], [%[p_fifo], %[offset_head]] \n" - " cmp %[old_head], #0 \n" - " bne.n 1b \n" - : /* Output operands */ - [ret] "=&r"(ret), - [old_head] "=&r"(old_head), - [new_head] "=&r"(new_head) - : /* Input operands */ - [p_fifo] "r"(p_fifo), - [offset_head] "J"(offsetof(nrf_atfifo_t, head)), - [offset_tail] "J"(offsetof(nrf_atfifo_t, tail)), - [offset_tail_rd] "J"(offsetof(nrf_atfifo_t, tail) + offsetof(nrf_atfifo_postag_pos_t, rd)), - [true_val] "I"(true), - [false_val] "I"(false) - : /* Clobbers */ - "cc"); - - UNUSED_VARIABLE(old_head); - UNUSED_VARIABLE(new_head); - return ret; -} - -#else -#error Unsupported compiler -#endif - -#endif /* NRF_ATFIFO_INTERNAL_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.c b/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.c deleted file mode 100644 index cf4681226..000000000 --- a/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.c +++ /dev/null @@ -1,449 +0,0 @@ -/** - * Copyright (c) 2018 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include "nrf_atomic.h" - -#ifndef NRF_ATOMIC_USE_BUILD_IN -#if (defined(__GNUC__) && defined(WIN32)) - #define NRF_ATOMIC_USE_BUILD_IN 1 -#else - #define NRF_ATOMIC_USE_BUILD_IN 0 -#endif -#endif // NRF_ATOMIC_USE_BUILD_IN - -#if ((__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U)) -#define STREX_LDREX_PRESENT -#else -#include "app_util_platform.h" -#endif - - -#if (NRF_ATOMIC_USE_BUILD_IN == 0) && defined(STREX_LDREX_PRESENT) -#include "nrf_atomic_internal.h" -#endif - -uint32_t nrf_atomic_u32_fetch_store(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_exchange_n(p_data, value, __ATOMIC_SEQ_CST); - -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - NRF_ATOMIC_OP(mov, old_val, new_val, p_data, value); - - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return old_val; -#else - CRITICAL_REGION_ENTER(); - uint32_t old_val = *p_data; - *p_data = value; - CRITICAL_REGION_EXIT(); - return old_val; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_store(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - __atomic_store_n(p_data, value, __ATOMIC_SEQ_CST); - return value; -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(mov, old_val, new_val, p_data, value); - - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return new_val; -#else - CRITICAL_REGION_ENTER(); - *p_data = value; - CRITICAL_REGION_EXIT(); - return value; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_fetch_or(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_fetch_or(p_data, value, __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(orr, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return old_val; -#else - CRITICAL_REGION_ENTER(); - uint32_t old_val = *p_data; - *p_data |= value; - CRITICAL_REGION_EXIT(); - return old_val; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_or(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_or_fetch(p_data, value, __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(orr, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return new_val; -#else - CRITICAL_REGION_ENTER(); - *p_data |= value; - uint32_t new_value = *p_data; - CRITICAL_REGION_EXIT(); - return new_value; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_fetch_and(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_fetch_and(p_data, value, __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(and, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return old_val; -#else - CRITICAL_REGION_ENTER(); - uint32_t old_val = *p_data; - *p_data &= value; - CRITICAL_REGION_EXIT(); - return old_val; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_and(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_and_fetch(p_data, value, __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(and, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return new_val; -#else - CRITICAL_REGION_ENTER(); - *p_data &= value; - uint32_t new_value = *p_data; - CRITICAL_REGION_EXIT(); - return new_value; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_fetch_xor(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_fetch_xor(p_data, value, __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(eor, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return old_val; -#else - CRITICAL_REGION_ENTER(); - uint32_t old_val = *p_data; - *p_data ^= value; - CRITICAL_REGION_EXIT(); - return old_val; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_xor(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_xor_fetch(p_data, value, __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(eor, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return new_val; -#else - CRITICAL_REGION_ENTER(); - *p_data ^= value; - uint32_t new_value = *p_data; - CRITICAL_REGION_EXIT(); - return new_value; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_fetch_add(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_fetch_add(p_data, value, __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(add, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return old_val; -#else - CRITICAL_REGION_ENTER(); - uint32_t old_val = *p_data; - *p_data += value; - CRITICAL_REGION_EXIT(); - return old_val; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_add(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_add_fetch(p_data, value, __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(add, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return new_val; -#else - CRITICAL_REGION_ENTER(); - *p_data += value; - uint32_t new_value = *p_data; - CRITICAL_REGION_EXIT(); - return new_value; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_fetch_sub(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_fetch_sub(p_data, value, __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(sub, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return old_val; -#else - CRITICAL_REGION_ENTER(); - uint32_t old_val = *p_data; - *p_data -= value; - CRITICAL_REGION_EXIT(); - return old_val; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_sub(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_sub_fetch(p_data, value, __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(sub, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return new_val; -#else - CRITICAL_REGION_ENTER(); - *p_data -= value; - uint32_t new_value = *p_data; - CRITICAL_REGION_EXIT(); - return new_value; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -bool nrf_atomic_u32_cmp_exch(nrf_atomic_u32_t * p_data, - uint32_t * p_expected, - uint32_t desired) -{ -#if NRF_ATOMIC_USE_BUILD_IN - return __atomic_compare_exchange(p_data, - p_expected, - &desired, - 1, - __ATOMIC_SEQ_CST, - __ATOMIC_SEQ_CST); -#elif defined(STREX_LDREX_PRESENT) - return nrf_atomic_internal_cmp_exch(p_data, p_expected, desired); -#else - bool ret; - CRITICAL_REGION_ENTER(); - if (*p_data == *p_expected) - { - *p_data = desired; - ret = true; - } - else - { - *p_expected = *p_data; - ret = false; - } - CRITICAL_REGION_EXIT(); - return ret; -#endif -} - -uint32_t nrf_atomic_u32_fetch_sub_hs(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - uint32_t expected = *p_data; - uint32_t new_val; - bool success; - - do - { - if (expected >= value) - { - new_val = expected - value; - } - else - { - new_val = expected; - } - success = __atomic_compare_exchange(p_data, - &expected, - &new_val, - 1, - __ATOMIC_SEQ_CST, - __ATOMIC_SEQ_CST); - } while(!success); - return expected; -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(sub_hs, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return old_val; -#else - CRITICAL_REGION_ENTER(); - uint32_t old_val = *p_data; - *p_data -= value; - CRITICAL_REGION_EXIT(); - return old_val; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_u32_sub_hs(nrf_atomic_u32_t * p_data, uint32_t value) -{ -#if NRF_ATOMIC_USE_BUILD_IN - uint32_t expected = *p_data; - uint32_t new_val; - bool success; - - do - { - if (expected >= value) - { - new_val = expected - value; - } - else - { - new_val = expected; - } - success = __atomic_compare_exchange(p_data, - &expected, - &new_val, - 1, - __ATOMIC_SEQ_CST, - __ATOMIC_SEQ_CST); - } while(!success); - return new_val; -#elif defined(STREX_LDREX_PRESENT) - uint32_t old_val; - uint32_t new_val; - - NRF_ATOMIC_OP(sub_hs, old_val, new_val, p_data, value); - UNUSED_PARAMETER(old_val); - UNUSED_PARAMETER(new_val); - return new_val; -#else - CRITICAL_REGION_ENTER(); - *p_data -= value; - uint32_t new_value = *p_data; - CRITICAL_REGION_EXIT(); - return new_value; -#endif //NRF_ATOMIC_USE_BUILD_IN -} - -uint32_t nrf_atomic_flag_set_fetch(nrf_atomic_flag_t * p_data) -{ - return nrf_atomic_u32_fetch_or(p_data, 1); -} - -uint32_t nrf_atomic_flag_set(nrf_atomic_flag_t * p_data) -{ - return nrf_atomic_u32_or(p_data, 1); -} - -uint32_t nrf_atomic_flag_clear_fetch(nrf_atomic_flag_t * p_data) -{ - return nrf_atomic_u32_fetch_and(p_data, 0); -} - -uint32_t nrf_atomic_flag_clear(nrf_atomic_flag_t * p_data) -{ - return nrf_atomic_u32_and(p_data, 0); -} - diff --git a/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.h b/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.h deleted file mode 100644 index 137aadc4d..000000000 --- a/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic.h +++ /dev/null @@ -1,274 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -/**@file - * - * @defgroup nrf_atomic Atomic operations API - * @ingroup app_common - * @{ - * - * @brief @tagAPI52 This module implements C11 stdatomic.h simplified API. - At this point only Cortex-M3/M4 cores are supported (LDREX/STREX instructions). - * Atomic types are limited to @ref nrf_atomic_u32_t and @ref nrf_atomic_flag_t. - */ - -#ifndef NRF_ATOMIC_H__ -#define NRF_ATOMIC_H__ - -#include "sdk_common.h" - -/** - * @brief Atomic 32 bit unsigned type - * */ -typedef volatile uint32_t nrf_atomic_u32_t; - -/** - * @brief Atomic 1 bit flag type (technically 32 bit) - * */ -typedef volatile uint32_t nrf_atomic_flag_t; - - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Stores value to an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value to store - * - * @return Old value stored into atomic object - * */ -uint32_t nrf_atomic_u32_fetch_store(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Stores value to an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value to store - * - * @return New value stored into atomic object - * */ -uint32_t nrf_atomic_u32_store(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Logical OR operation on an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand OR operation - * - * @return Old value stored into atomic object - * */ -uint32_t nrf_atomic_u32_fetch_or(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Logical OR operation on an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand OR operation - * - * @return New value stored into atomic object - * */ -uint32_t nrf_atomic_u32_or(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Logical AND operation on an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand AND operation - * - * @return Old value stored into atomic object - * */ -uint32_t nrf_atomic_u32_fetch_and(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Logical AND operation on an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand AND operation - * - * @return New value stored into atomic object - * */ -uint32_t nrf_atomic_u32_and(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Logical XOR operation on an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand XOR operation - * - * @return Old value stored into atomic object - * */ -uint32_t nrf_atomic_u32_fetch_xor(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Logical XOR operation on an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand XOR operation - * - * @return New value stored into atomic object - * */ -uint32_t nrf_atomic_u32_xor(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Arithmetic ADD operation on an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand ADD operation - * - * @return Old value stored into atomic object - * */ -uint32_t nrf_atomic_u32_fetch_add(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Arithmetic ADD operation on an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand ADD operation - * - * @return New value stored into atomic object - * */ -uint32_t nrf_atomic_u32_add(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Arithmetic SUB operation on an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand SUB operation - * - * @return Old value stored into atomic object - * */ -uint32_t nrf_atomic_u32_fetch_sub(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Arithmetic SUB operation on an atomic object - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand SUB operation - * - * @return New value stored into atomic object - * */ -uint32_t nrf_atomic_u32_sub(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief If value at pointer is equal to expected value, changes value at pointer to desired - * - * Atomically compares the value pointed to by p_data with the value pointed to by p_expected, - * and if those are equal, replaces the former with desired. Otherwise, loads the actual value - * pointed to by p_data into *p_expected. - * - * @param p_data Atomic memory pointer to test and modify. - * @param p_expected Pointer to test value. - * @param desired Value to be stored to atomic memory. - * - * @retval true *p_data was equal to *p_expected - * @retval false *p_data was not equal to *p_expected - */ -bool nrf_atomic_u32_cmp_exch(nrf_atomic_u32_t * p_data, - uint32_t * p_expected, - uint32_t desired); - -/** - * @brief Arithmetic SUB operation on an atomic object performed if object >= value. - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand SUB operation - * - * @return Old value stored into atomic object - * */ -uint32_t nrf_atomic_u32_fetch_sub_hs(nrf_atomic_u32_t * p_data, uint32_t value); - -/** - * @brief Arithmetic SUB operation on an atomic object performed if object >= value. - * - * @param[in] p_data Atomic memory pointer - * @param[in] value Value of second operand SUB operation - * - * @return New value stored into atomic object - * */ -uint32_t nrf_atomic_u32_sub_hs(nrf_atomic_u32_t * p_data, uint32_t value); - -/**************************************************************************************************/ - -/** - * @brief Logic one bit flag set operation on an atomic object - * - * @param[in] p_data Atomic flag memory pointer - * - * @return Old flag value - * */ -uint32_t nrf_atomic_flag_set_fetch(nrf_atomic_flag_t * p_data); - -/** - * @brief Logic one bit flag set operation on an atomic object - * - * @param[in] p_data Atomic flag memory pointer - * - * @return New flag value - * */ -uint32_t nrf_atomic_flag_set(nrf_atomic_flag_t * p_data); - -/** - * @brief Logic one bit flag clear operation on an atomic object - * - * @param[in] p_data Atomic flag memory pointer - * - * @return Old flag value - * */ -uint32_t nrf_atomic_flag_clear_fetch(nrf_atomic_flag_t * p_data); - -/** - * @brief Logic one bit flag clear operation on an atomic object - * - * @param[in] p_data Atomic flag memory pointer - * - * @return New flag value - * */ -uint32_t nrf_atomic_flag_clear(nrf_atomic_flag_t * p_data); - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_ATOMIC_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic_internal.h b/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic_internal.h deleted file mode 100644 index ab114f675..000000000 --- a/third_party/NordicSemiconductor/libraries/atomic/nrf_atomic_internal.h +++ /dev/null @@ -1,343 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_ATOMIC_INTERNAL_H__ -#define NRF_ATOMIC_INTERNAL_H__ - -#include "sdk_common.h" -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * - * @defgroup nrf_atomic_internal Atomic operations internals - * @ingroup nrf_atomic - * @{ - * - */ - -/* Only Cortex M cores > 3 support LDREX/STREX instructions*/ -#if ((__CORTEX_M >= 0x03U) || (__CORTEX_SC >= 300U)) == 0 -#error "Unsupported core version" -#endif - -#if defined ( __CC_ARM ) -static __asm uint32_t nrf_atomic_internal_mov(nrf_atomic_u32_t * p_ptr, - uint32_t value, - uint32_t * p_new) -{ - /* The base standard provides for passing arguments in core registers (r0-r3) and on the stack. - * Registers r4 and r5 have to be saved on stack. Note that only even number of register push are - * allowed. This is a requirement of the Procedure Call Standard for the ARM Architecture [AAPCS]. - * */ - push {r4, r5} - mov r4, r0 - -loop_mov - ldrex r0, [r4] - mov r5, r1 - strex r3, r5, [r4] - cmp r3, #0 - bne loop_mov - - str r5, [r2] - pop {r4, r5} - bx lr -} - - -static __asm uint32_t nrf_atomic_internal_orr(nrf_atomic_u32_t * p_ptr, - uint32_t value, - uint32_t * p_new) -{ - push {r4, r5} - mov r4, r0 - -loop_orr - ldrex r0, [r4] - orr r5, r0, r1 - strex r3, r5, [r4] - cmp r3, #0 - bne loop_orr - - str r5, [r2] - pop {r4, r5} - bx lr -} - -static __asm uint32_t nrf_atomic_internal_and(nrf_atomic_u32_t * p_ptr, - uint32_t value, - uint32_t * p_new) -{ - push {r4, r5} - mov r4, r0 - -loop_and - ldrex r0, [r4] - and r5, r0, r1 - strex r3, r5, [r4] - cmp r3, #0 - bne loop_and - - str r5, [r2] - pop {r4, r5} - bx lr -} - -static __asm uint32_t nrf_atomic_internal_eor(nrf_atomic_u32_t * p_ptr, - uint32_t value, - uint32_t * p_new) -{ - push {r4, r5} - mov r4, r0 - -loop_eor - ldrex r0, [r4] - eor r5, r0, r1 - strex r3, r5, [r4] - cmp r3, #0 - bne loop_eor - - str r5, [r2] - pop {r4, r5} - bx lr -} - -static __asm uint32_t nrf_atomic_internal_add(nrf_atomic_u32_t * p_ptr, - uint32_t value, - uint32_t * p_new) -{ - push {r4, r5} - mov r4, r0 - -loop_add - ldrex r0, [r4] - add r5, r0, r1 - strex r3, r5, [r4] - cmp r3, #0 - bne loop_add - - str r5, [r2] - pop {r4, r5} - bx lr -} - -static __asm uint32_t nrf_atomic_internal_sub(nrf_atomic_u32_t * p_ptr, - uint32_t value, - uint32_t * p_new) -{ - push {r4, r5} - mov r4, r0 - -loop_sub - ldrex r0, [r4] - sub r5, r0, r1 - strex r3, r5, [r4] - cmp r3, #0 - bne loop_sub - - str r5, [r2] - pop {r4, r5} - bx lr -} - -static __asm bool nrf_atomic_internal_cmp_exch(nrf_atomic_u32_t * p_data, - uint32_t * p_expected, - uint32_t value) -{ -#define RET_REG r0 -#define P_EXPC r1 -#define VALUE r2 -#define STR_RES r3 -#define P_DATA r4 -#define EXPC_VAL r5 -#define ACT_VAL r6 - - push {r4-r6} - mov P_DATA, r0 - mov RET_REG, #0 - -loop_cmp_exch - ldrex ACT_VAL, [P_DATA] - ldr EXPC_VAL, [P_EXPC] - cmp ACT_VAL, EXPC_VAL - ittee eq - strexeq STR_RES, VALUE, [P_DATA] - moveq RET_REG, #1 - strexne STR_RES, ACT_VAL, [P_DATA] - strne ACT_VAL, [P_EXPC] - cmp STR_RES, #0 - itt ne - movne RET_REG, #0 - bne loop_cmp_exch - - pop {r4-r6} - bx lr - -#undef RET_REG -#undef P_EXPC -#undef VALUE -#undef STR_RES -#undef P_DATA -#undef EXPC_VAL -#undef ACT_VAL -} - -static __asm uint32_t nrf_atomic_internal_sub_hs(nrf_atomic_u32_t * p_ptr, - uint32_t value, - uint32_t * p_new) -{ - push {r4, r5} - mov r4, r0 - -loop_sub_ge - ldrex r0, [r4] - cmp r0, r1 - ite hs - subhs r5, r0, r1 - movlo r5, r0 - strex r3, r5, [r4] - cmp r3, #0 - bne loop_sub_ge - - str r5, [r2] - pop {r4, r5} - bx lr -} - - -#define NRF_ATOMIC_OP(asm_op, old_val, new_val, ptr, value) \ - old_val = nrf_atomic_internal_##asm_op(ptr, value, &new_val) - -#elif defined ( __ICCARM__ ) || defined ( __GNUC__ ) - -/** - * @brief Atomic operation generic macro - * @param[in] asm_op operation: mov, orr, and, eor, add, sub - * @param[out] old_val atomic object output (uint32_t), value before operation - * @param[out] new_val atomic object output (uint32_t), value after operation - * @param[in] value atomic operation operand - * */ -#define NRF_ATOMIC_OP(asm_op, old_val, new_val, ptr, value) \ -{ \ - uint32_t str_res; \ - __ASM volatile( \ - "1: ldrex %["#old_val"], [%["#ptr"]]\n" \ - NRF_ATOMIC_OP_##asm_op(new_val, old_val, value) \ - " strex %[str_res], %["#new_val"], [%["#ptr"]]\n" \ - " teq %[str_res], #0\n" \ - " bne.n 1b" \ - : \ - [old_val]"=&r" (old_val), \ - [new_val]"=&r" (new_val), \ - [str_res]"=&r" (str_res) \ - : \ - [ptr]"r" (ptr), \ - [value]"r" (value) \ - : "cc"); \ - UNUSED_PARAMETER(str_res); \ -} - -#define NRF_ATOMIC_OP_mov(new_val, old_val, value) "mov %["#new_val"], %["#value"]\n" -#define NRF_ATOMIC_OP_orr(new_val, old_val, value) "orr %["#new_val"], %["#old_val"], %["#value"]\n" -#define NRF_ATOMIC_OP_and(new_val, old_val, value) "and %["#new_val"], %["#old_val"], %["#value"]\n" -#define NRF_ATOMIC_OP_eor(new_val, old_val, value) "eor %["#new_val"], %["#old_val"], %["#value"]\n" -#define NRF_ATOMIC_OP_add(new_val, old_val, value) "add %["#new_val"], %["#old_val"], %["#value"]\n" -#define NRF_ATOMIC_OP_sub(new_val, old_val, value) "sub %["#new_val"], %["#old_val"], %["#value"]\n" -#define NRF_ATOMIC_OP_sub_hs(new_val, old_val, value) \ - "cmp %["#old_val"], %["#value"]\n " \ - "ite hs\n" \ - "subhs %["#new_val"], %["#old_val"], %["#value"]\n" \ - "movlo %["#new_val"], %["#old_val"]\n" - -static inline bool nrf_atomic_internal_cmp_exch(nrf_atomic_u32_t * p_data, - uint32_t * p_expected, - uint32_t value) -{ - bool res = false; - uint32_t str_res = 0; - uint32_t act_val = 0; - uint32_t exp_val = 0; - UNUSED_VARIABLE(str_res); - UNUSED_VARIABLE(act_val); - UNUSED_VARIABLE(exp_val); - __ASM volatile( - "1: ldrex %[act_val], [%[ptr]]\n" - " ldr %[exp_val], [%[expc]]\n" - " cmp %[act_val], %[exp_val]\n" - " ittee eq\n" - " strexeq %[str_res], %[value], [%[ptr]]\n" - " moveq %[res], #1\n" - " strexne %[str_res], %[act_val], [%[ptr]]\n" - " strne %[act_val], [%[expc]]\n" - " cmp %[str_res], #0\n" - " itt ne\n" - " movne %[res], #0\n" - " bne.n 1b" - : - [res] "=&r" (res), - [exp_val] "=&r" (exp_val), - [act_val] "=&r" (act_val), - [str_res] "=&r" (str_res) - : - "0" (res), - "1" (exp_val), - "2" (act_val), - [expc] "r" (p_expected), - [ptr] "r" (p_data), - [value] "r" (value) - : "cc"); - return res; -} - -#else -#error "Unsupported compiler" -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_ATOMIC_INTERNAL_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/block_dev/nrf_block_dev.h b/third_party/NordicSemiconductor/libraries/block_dev/nrf_block_dev.h deleted file mode 100644 index 0f57d92ce..000000000 --- a/third_party/NordicSemiconductor/libraries/block_dev/nrf_block_dev.h +++ /dev/null @@ -1,352 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_BLOCK_DEV_H__ -#define NRF_BLOCK_DEV_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "sdk_common.h" -#include "nrf_assert.h" - -#include - -/**@file - * - * @defgroup nrf_block_dev Block device - * @{ - * @ingroup app_common - * - * @brief This module implements unified block device API. It could used as a middle layer between - * filesystems and memories. - */ - -/** - * @brief Block device request descriptor item. - */ -typedef struct { - uint32_t blk_id; //!< Block ID - uint32_t blk_count; //!< Block count - void * p_buff; //!< Data buffer -} nrf_block_req_t; - - -/** - * @brief Helper macro to create block device read/write request item - * - * @param name Instance name - * @param block_start Block number start - * @param block_count Number of blocks - * @param buff Buffer to read/write - */ -#define NRF_BLOCK_DEV_REQUEST(name, block_start, block_count, buff) \ - nrf_block_req_t name = { \ - .blk_id = block_start, \ - .blk_count = block_count, \ - .p_buff = buff, \ - } -/** - * @brief Block device events. - * - * Events are propagated when event handler is defined (@ref nrf_blk_dev_init) - * - */ -typedef enum { - NRF_BLOCK_DEV_EVT_INIT, /**< Passed to event handler when init is done*/ - NRF_BLOCK_DEV_EVT_UNINIT, /**< Passed to event handler when uninit is done*/ - NRF_BLOCK_DEV_EVT_BLK_READ_DONE, /**< Passed to event handler block read operation is done*/ - NRF_BLOCK_DEV_EVT_BLK_WRITE_DONE, /**< Passed to event handler block write operation is done*/ -} nrf_block_dev_event_type_t; - -typedef enum { - NRF_BLOCK_DEV_RESULT_SUCCESS = 0, /**< Operation completed succsefully*/ - NRF_BLOCK_DEV_RESULT_IO_ERROR, /**< I/O error*/ - NRF_BLOCK_DEV_RESULT_TIMEOUT, /**< Device timeout*/ -} nrf_block_dev_result_t; - -/** - * @brief Block device event - * */ -typedef struct { - nrf_block_dev_event_type_t ev_type; //!< Event type - nrf_block_dev_result_t result; //!< Operation status - nrf_block_req_t const * p_blk_req; //!< Block request - void const * p_context; //!< Event context -} nrf_block_dev_event_t; - -struct nrf_block_dev_s; - -/** - * @brief Block device event handler. - * - * @param[in] p_blk_dev Block device handle - * @param[in] p_event Block device event - */ -typedef void (* nrf_block_dev_ev_handler)(struct nrf_block_dev_s const * p_blk_dev, - nrf_block_dev_event_t const * p_event); - -/** - * @brief Block device geometry - */ -typedef struct { - uint32_t blk_count; //!< Block count - uint32_t blk_size; //!< Block size -} nrf_block_dev_geometry_t; - -/** - * @brief Block device information strings - */ -typedef struct { - const char * p_vendor; //!< Vendor string - const char * p_product; //!< Product string - const char * p_revision; //!< Revision string -} nrf_block_dev_info_strings_t; - -/** - * @brief Block device information config - * - * @param vendor Vendor string - * @param product Product string - * @param revision Revision string - * */ -#define NFR_BLOCK_DEV_INFO_CONFIG(vendor, product, revision) ( { \ - .p_vendor = vendor, \ - .p_product = product, \ - .p_revision = revision, \ -}) - -/** - * @brief Empty info string initializer - * */ -#define NFR_BLOCK_DEV_INFO_CONFIG_EMPTY \ - NFR_BLOCK_DEV_INFO_CONFIG(NULL, NULL, NULL) - -/** - * @brief Block device IOCTL requests - */ -typedef enum { - NRF_BLOCK_DEV_IOCTL_REQ_CACHE_FLUSH = 0, /**< Cache flush IOCTL request*/ - NRF_BLOCK_DEV_IOCTL_REQ_INFO_STRINGS, /**< Get info strings IOCTL request*/ -} nrf_block_dev_ioctl_req_t; - - -/** - * @brief Helper macro to get block device address from specific instance - * - * @param instance Block device instance - * @param member Block device member name - * */ -#define NRF_BLOCKDEV_BASE_ADDR(instance, member) &(instance).member - -/** - * @brief Block device API - * */ -typedef struct nrf_block_dev_s { - struct nrf_block_dev_ops_s { - /** - * @brief @ref nrf_blk_dev_init - */ - ret_code_t (*init)(struct nrf_block_dev_s const * p_blk_dev, - nrf_block_dev_ev_handler ev_handler, - void const * p_context); - - /** - * @brief @ref nrf_blk_dev_uninit - */ - ret_code_t (*uninit)(struct nrf_block_dev_s const * p_blk_dev); - - /** - * @brief @ref nrf_blk_dev_read_req - */ - ret_code_t (*read_req)(struct nrf_block_dev_s const * p_blk_dev, - nrf_block_req_t const * p_blk); - - /** - * @brief @ref nrf_blk_dev_write_req - */ - ret_code_t (*write_req)(struct nrf_block_dev_s const * p_blk_dev, - nrf_block_req_t const * p_blk); - - /** - * @brief @ref nrf_blk_dev_ioctl - */ - ret_code_t (*ioctl)(struct nrf_block_dev_s const * p_blk_dev, - nrf_block_dev_ioctl_req_t req, - void * p_data); - - /** - * @brief @ref nrf_blk_dev_geometry - */ - nrf_block_dev_geometry_t const * (*geometry)(struct nrf_block_dev_s const * p_blk_dev); - } const * p_ops; -} nrf_block_dev_t; - -/** - * @brief Internals of @ref nrf_block_dev_t - * */ -typedef struct nrf_block_dev_ops_s nrf_block_dev_ops_t; - -/** - * @brief Initializes a block device. - * - * @param[in] p_blk_dev Block device handle - * @param[in] ev_handler Event handler (pass NULL to work in synchronous mode) - * @param[in] p_context Context passed to event handler - * - * @return Standard error code - */ -static inline ret_code_t nrf_blk_dev_init(nrf_block_dev_t const * p_blk_dev, - nrf_block_dev_ev_handler ev_handler, - void const * p_context) -{ - ASSERT(p_blk_dev->p_ops->init); - return p_blk_dev->p_ops->init(p_blk_dev, ev_handler, p_context); -} - -/** - * @brief Un-initializes a block device. - * - * @param[in] p_blk_dev Block device handle - * - * @return Standard error code - */ -static inline ret_code_t nrf_blk_dev_uninit(nrf_block_dev_t const * p_blk_dev) -{ - ASSERT(p_blk_dev->p_ops->uninit); - return p_blk_dev->p_ops->uninit(p_blk_dev); -} - -/** - * @brief Block read request. - * - * In synchronous mode this function will execute the read operation - * and wait for its completion. In asynchronous mode the function will only request - * the operation and return immediately. Then, the @ref NRF_BLOCK_DEV_EVT_BLK_READ_DONE - * event will signal that operation has been completed and the specified buffer contains - * valid data. - * - * @param[in] p_blk_dev Block device handle - * @param[in] p_blk Block device request - * - * @return Standard error code - */ -static inline ret_code_t nrf_blk_dev_read_req(nrf_block_dev_t const * p_blk_dev, - nrf_block_req_t const * p_blk) -{ - ASSERT(p_blk_dev->p_ops->read_req); - ASSERT(p_blk_dev->p_ops->geometry); - - if (p_blk->blk_id >= p_blk_dev->p_ops->geometry(p_blk_dev)->blk_count) - { - return NRF_ERROR_INVALID_PARAM; - } - - return p_blk_dev->p_ops->read_req(p_blk_dev, p_blk); -} - -/** - * @brief Block write request. - * - * In synchronous mode this function will execute the write operation - * and wait for its completion. In asynchronous mode the function will only request - * the operation and return immediately. Then, the @ref NRF_BLOCK_DEV_EVT_BLK_WRITE_DONE - * event will signal that operation has been completed and the specified buffer - * can be freed. - * - * @param[in] p_blk_dev Block device handle - * @param[in] p_blk Block device request - * - * @return Standard error code - */ -static inline ret_code_t nrf_blk_dev_write_req(nrf_block_dev_t const * p_blk_dev, - nrf_block_req_t const * p_blk) -{ - ASSERT(p_blk_dev->p_ops->write_req); - ASSERT(p_blk_dev->p_ops->geometry); - - if (p_blk->blk_id >= p_blk_dev->p_ops->geometry(p_blk_dev)->blk_count) - { - return NRF_ERROR_INVALID_PARAM; - } - - return p_blk_dev->p_ops->write_req(p_blk_dev, p_blk); -} - -/** - * @brief IO control function. - * - * @param[in] p_blk_dev Block device handle - * @param[in] req Block device ioctl request - * @param[in] p_data Block device ioctl data - * - * @return Standard error code - * */ -static inline ret_code_t nrf_blk_dev_ioctl(nrf_block_dev_t const * p_blk_dev, - nrf_block_dev_ioctl_req_t req, - void * p_data) -{ - ASSERT(p_blk_dev->p_ops->ioctl); - return p_blk_dev->p_ops->ioctl(p_blk_dev, req, p_data); -} - -/** - * @brief Return a geometry of a block device. - * - * @param[in] p_blk_dev Block device handle - * - * @return Block size and count @ref nrf_block_dev_geometry_t - */ -static inline nrf_block_dev_geometry_t const * -nrf_blk_dev_geometry(nrf_block_dev_t const * p_blk_dev) -{ - ASSERT(p_blk_dev->p_ops->geometry); - return p_blk_dev->p_ops->geometry(p_blk_dev); -} - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_BLOCK_DEV_H__ */ - - diff --git a/third_party/NordicSemiconductor/libraries/delay/nrf_delay.h b/third_party/NordicSemiconductor/libraries/delay/nrf_delay.h deleted file mode 100644 index 3719683d3..000000000 --- a/third_party/NordicSemiconductor/libraries/delay/nrf_delay.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) 2011 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef _NRF_DELAY_H -#define _NRF_DELAY_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Function for delaying execution for a number of microseconds. - * - * @param us_time Number of microseconds to wait. - */ -#define nrf_delay_us(us_time) NRFX_DELAY_US(us_time) - - -/** - * @brief Function for delaying execution for a number of milliseconds. - * - * @param ms_time Number of milliseconds to wait. - */ - -__STATIC_INLINE void nrf_delay_ms(uint32_t ms_time) -{ - if (ms_time == 0) - { - return; - } - - do { - nrf_delay_us(1000); - } while (--ms_time); -} - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/config/nrf-config.h b/third_party/NordicSemiconductor/libraries/nrf_security/config/nrf-config.h deleted file mode 100644 index 3d933930b..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/config/nrf-config.h +++ /dev/null @@ -1,3761 +0,0 @@ -/** - * \file config.h - * - * \brief Configuration options (set of defines) - * - * This set of compile-time options may be used to enable - * or disable features selectively, and reduce the global - * memory footprint. - */ -/* - * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef MBEDTLS_CONFIG_H -#define MBEDTLS_CONFIG_H - -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif - -/** - * \name SECTION: System support - * - * This section sets system specific settings. - * \{ - */ - -/** - * \def MBEDTLS_HAVE_ASM - * - * The compiler has support for asm(). - * - * Requires support for asm() in compiler. - * - * Used in: - * library/aria.c - * library/timing.c - * include/mbedtls/bn_mul.h - * - * Required by: - * MBEDTLS_AESNI_C - * MBEDTLS_PADLOCK_C - * - * Comment to disable the use of assembly code. - */ -#define MBEDTLS_HAVE_ASM - -/** - * \def MBEDTLS_NO_UDBL_DIVISION - * - * The platform lacks support for double-width integer division (64-bit - * division on a 32-bit platform, 128-bit division on a 64-bit platform). - * - * Used in: - * include/mbedtls/bignum.h - * library/bignum.c - * - * The bignum code uses double-width division to speed up some operations. - * Double-width division is often implemented in software that needs to - * be linked with the program. The presence of a double-width integer - * type is usually detected automatically through preprocessor macros, - * but the automatic detection cannot know whether the code needs to - * and can be linked with an implementation of division for that type. - * By default division is assumed to be usable if the type is present. - * Uncomment this option to prevent the use of double-width division. - * - * Note that division for the native integer type is always required. - * Furthermore, a 64-bit type is always required even on a 32-bit - * platform, but it need not support multiplication or division. In some - * cases it is also desirable to disable some double-width operations. For - * example, if double-width division is implemented in software, disabling - * it can reduce code size in some embedded targets. - */ -//#define MBEDTLS_NO_UDBL_DIVISION - -/** - * \def MBEDTLS_NO_64BIT_MULTIPLICATION - * - * The platform lacks support for 32x32 -> 64-bit multiplication. - * - * Used in: - * library/poly1305.c - * - * Some parts of the library may use multiplication of two unsigned 32-bit - * operands with a 64-bit result in order to speed up computations. On some - * platforms, this is not available in hardware and has to be implemented in - * software, usually in a library provided by the toolchain. - * - * Sometimes it is not desirable to have to link to that library. This option - * removes the dependency of that library on platforms that lack a hardware - * 64-bit multiplier by embedding a software implementation in Mbed TLS. - * - * Note that depending on the compiler, this may decrease performance compared - * to using the library function provided by the toolchain. - */ -//#define MBEDTLS_NO_64BIT_MULTIPLICATION - -/** - * \def MBEDTLS_HAVE_SSE2 - * - * CPU supports SSE2 instruction set. - * - * Uncomment if the CPU supports SSE2 (IA-32 specific). - */ -//#define MBEDTLS_HAVE_SSE2 - -/** - * \def MBEDTLS_HAVE_TIME - * - * System has time.h and time(). - * The time does not need to be correct, only time differences are used, - * by contrast with MBEDTLS_HAVE_TIME_DATE - * - * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT, - * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and - * MBEDTLS_PLATFORM_STD_TIME. - * - * Comment if your system does not support time functions - */ -//#define MBEDTLS_HAVE_TIME - -/** - * \def MBEDTLS_HAVE_TIME_DATE - * - * System has time.h, time(), and an implementation for - * mbedtls_platform_gmtime_r() (see below). - * The time needs to be correct (not necessarily very accurate, but at least - * the date should be correct). This is used to verify the validity period of - * X.509 certificates. - * - * Comment if your system does not have a correct clock. - * - * \note mbedtls_platform_gmtime_r() is an abstraction in platform_util.h that - * behaves similarly to the gmtime_r() function from the C standard. Refer to - * the documentation for mbedtls_platform_gmtime_r() for more information. - * - * \note It is possible to configure an implementation for - * mbedtls_platform_gmtime_r() at compile-time by using the macro - * MBEDTLS_PLATFORM_GMTIME_R_ALT. - */ -//#define MBEDTLS_HAVE_TIME_DATE - -/** - * \def MBEDTLS_PLATFORM_MEMORY - * - * Enable the memory allocation layer. - * - * By default mbed TLS uses the system-provided calloc() and free(). - * This allows different allocators (self-implemented or provided) to be - * provided to the platform abstraction layer. - * - * Enabling MBEDTLS_PLATFORM_MEMORY without the - * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide - * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and - * free() function pointer at runtime. - * - * Enabling MBEDTLS_PLATFORM_MEMORY and specifying - * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the - * alternate function at compile time. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Enable this layer to allow use of alternative memory allocators. - */ -#define MBEDTLS_PLATFORM_MEMORY - -/** - * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - * - * Do not assign standard functions in the platform layer (e.g. calloc() to - * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF) - * - * This makes sure there are no linking errors on platforms that do not support - * these functions. You will HAVE to provide alternatives, either at runtime - * via the platform_set_xxx() functions or at compile time by setting - * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a - * MBEDTLS_PLATFORM_XXX_MACRO. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Uncomment to prevent default assignment of standard functions in the - * platform layer. - */ -#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - -/** - * \def MBEDTLS_PLATFORM_EXIT_ALT - * - * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the - * function in the platform abstraction layer. - * - * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will - * provide a function "mbedtls_platform_set_printf()" that allows you to set an - * alternative printf function pointer. - * - * All these define require MBEDTLS_PLATFORM_C to be defined! - * - * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows; - * it will be enabled automatically by check_config.h - * - * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as - * MBEDTLS_PLATFORM_XXX_MACRO! - * - * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME - * - * Uncomment a macro to enable alternate implementation of specific base - * platform function - */ -#define MBEDTLS_PLATFORM_EXIT_ALT -//#define MBEDTLS_PLATFORM_TIME_ALT -#define MBEDTLS_PLATFORM_FPRINTF_ALT -#define MBEDTLS_PLATFORM_PRINTF_ALT -#define MBEDTLS_PLATFORM_SNPRINTF_ALT -//#define MBEDTLS_PLATFORM_NV_SEED_ALT -#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT - -/** - * \def MBEDTLS_DEPRECATED_WARNING - * - * Mark deprecated functions and features so that they generate a warning if - * used. Functionality deprecated in one version will usually be removed in the - * next version. You can enable this to help you prepare the transition to a - * new major version by making sure your code is not using this functionality. - * - * This only works with GCC and Clang. With other compilers, you may want to - * use MBEDTLS_DEPRECATED_REMOVED - * - * Uncomment to get warnings on using deprecated functions and features. - */ -//#define MBEDTLS_DEPRECATED_WARNING - -/** - * \def MBEDTLS_DEPRECATED_REMOVED - * - * Remove deprecated functions and features so that they generate an error if - * used. Functionality deprecated in one version will usually be removed in the - * next version. You can enable this to help you prepare the transition to a - * new major version by making sure your code is not using this functionality. - * - * Uncomment to get errors on using deprecated functions and features. - */ -//#define MBEDTLS_DEPRECATED_REMOVED - -/** - * \def MBEDTLS_CHECK_PARAMS - * - * This configuration option controls whether the library validates more of - * the parameters passed to it. - * - * When this flag is not defined, the library only attempts to validate an - * input parameter if: (1) they may come from the outside world (such as the - * network, the filesystem, etc.) or (2) not validating them could result in - * internal memory errors such as overflowing a buffer controlled by the - * library. On the other hand, it doesn't attempt to validate parameters whose - * values are fully controlled by the application (such as pointers). - * - * When this flag is defined, the library additionally attempts to validate - * parameters that are fully controlled by the application, and should always - * be valid if the application code is fully correct and trusted. - * - * For example, when a function accepts as input a pointer to a buffer that may - * contain untrusted data, and its documentation mentions that this pointer - * must not be NULL: - * - The pointer is checked to be non-NULL only if this option is enabled. - * - The content of the buffer is always validated. - * - * When this flag is defined, if a library function receives a parameter that - * is invalid: - * 1. The function will invoke the macro MBEDTLS_PARAM_FAILED(). - * 2. If MBEDTLS_PARAM_FAILED() did not terminate the program, the function - * will immediately return. If the function returns an Mbed TLS error code, - * the error code in this case is MBEDTLS_ERR_xxx_BAD_INPUT_DATA. - * - * When defining this flag, you also need to arrange a definition for - * MBEDTLS_PARAM_FAILED(). You can do this by any of the following methods: - * - By default, the library defines MBEDTLS_PARAM_FAILED() to call a - * function mbedtls_param_failed(), but the library does not define this - * function. If you do not make any other arrangements, you must provide - * the function mbedtls_param_failed() in your application. - * See `platform_util.h` for its prototype. - * - If you enable the macro #MBEDTLS_CHECK_PARAMS_ASSERT, then the - * library defines MBEDTLS_PARAM_FAILED(\c cond) to be `assert(cond)`. - * You can still supply an alternative definition of - * MBEDTLS_PARAM_FAILED(), which may call `assert`. - * - If you define a macro MBEDTLS_PARAM_FAILED() before including `config.h` - * or you uncomment the definition of MBEDTLS_PARAM_FAILED() in `config.h`, - * the library will call the macro that you defined and will not supply - * its own version. Note that if MBEDTLS_PARAM_FAILED() calls `assert`, - * you need to enable #MBEDTLS_CHECK_PARAMS_ASSERT so that library source - * files include ``. - * - * Uncomment to enable validation of application-controlled parameters. - */ -//#define MBEDTLS_CHECK_PARAMS - -/** - * \def MBEDTLS_CHECK_PARAMS_ASSERT - * - * Allow MBEDTLS_PARAM_FAILED() to call `assert`, and make it default to - * `assert`. This macro is only used if #MBEDTLS_CHECK_PARAMS is defined. - * - * If this macro is not defined, then MBEDTLS_PARAM_FAILED() defaults to - * calling a function mbedtls_param_failed(). See the documentation of - * #MBEDTLS_CHECK_PARAMS for details. - * - * Uncomment to allow MBEDTLS_PARAM_FAILED() to call `assert`. - */ -//#define MBEDTLS_CHECK_PARAMS_ASSERT - -/* \} name SECTION: System support */ - -/** - * \name SECTION: mbed TLS feature support - * - * This section sets support for features that are or are not needed - * within the modules that are enabled. - * \{ - */ - -/** - * \def MBEDTLS_TIMING_ALT - * - * Uncomment to provide your own alternate implementation for mbedtls_timing_hardclock(), - * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay() - * - * Only works if you have MBEDTLS_TIMING_C enabled. - * - * You will need to provide a header "timing_alt.h" and an implementation at - * compile time. - */ -//#define MBEDTLS_TIMING_ALT - -/** - * \def MBEDTLS_AES_ALT - * - * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your - * alternate core implementation of a symmetric crypto, an arithmetic or hash - * module (e.g. platform specific assembly optimized implementations). Keep - * in mind that the function prototypes should remain the same. - * - * This replaces the whole module. If you only want to replace one of the - * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer - * provide the "struct mbedtls_aes_context" definition and omit the base - * function declarations and implementations. "aes_alt.h" will be included from - * "aes.h" to include the new function definitions. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * module. - * - * \warning MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their - * use constitutes a security risk. If possible, we recommend - * avoiding dependencies on them, and considering stronger message - * digests and ciphers instead. - * - */ -/* #undef MBEDTLS_AES_ALT */ -//#define MBEDTLS_ARC4_ALT -//#define MBEDTLS_ARIA_ALT -//#define MBEDTLS_BLOWFISH_ALT -//#define MBEDTLS_CAMELLIA_ALT -#define MBEDTLS_CCM_ALT -/* #undef MBEDTLS_CHACHA20_ALT */ -/* #undef MBEDTLS_CHACHAPOLY_ALT */ -/* #undef MBEDTLS_CMAC_ALT */ -//#define MBEDTLS_DES_ALT -/* #undef MBEDTLS_DHM_ALT */ -/* #undef MBEDTLS_ECJPAKE_ALT */ -/* #undef MBEDTLS_GCM_ALT */ -//#define MBEDTLS_NIST_KW_ALT -//#define MBEDTLS_MD2_ALT -//#define MBEDTLS_MD4_ALT -//#define MBEDTLS_MD5_ALT -/* #undef MBEDTLS_POLY1305_ALT */ -//#define MBEDTLS_RIPEMD160_ALT -#define MBEDTLS_ECP_ALT -/* #undef MBEDTLS_RSA_ALT */ -#define MBEDTLS_SHA1_ALT -#define MBEDTLS_SHA256_ALT -//#define MBEDTLS_SHA512_ALT -//#define MBEDTLS_XTEA_ALT - -/* - * When replacing the elliptic curve module, pleace consider, that it is - * implemented with two .c files: - * - ecp.c - * - ecp_curves.c - * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT - * macros as described above. The only difference is that you have to make sure - * that you provide functionality for both .c files. - */ -//#define MBEDTLS_ECP_ALT - -/** - * \def MBEDTLS_MD2_PROCESS_ALT - * - * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you - * alternate core implementation of symmetric crypto or hash function. Keep in - * mind that function prototypes should remain the same. - * - * This replaces only one function. The header file from mbed TLS is still - * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will - * no longer provide the mbedtls_sha1_process() function, but it will still provide - * the other function (using your mbedtls_sha1_process() function) and the definition - * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible - * with this definition. - * - * \note Because of a signature change, the core AES encryption and decryption routines are - * currently named mbedtls_aes_internal_encrypt and mbedtls_aes_internal_decrypt, - * respectively. When setting up alternative implementations, these functions should - * be overridden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt - * must stay untouched. - * - * \note If you use the AES_xxx_ALT macros, then is is recommended to also set - * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES - * tables. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - * - * \warning MD2, MD4, MD5, DES and SHA-1 are considered weak and their use - * constitutes a security risk. If possible, we recommend avoiding - * dependencies on them, and considering stronger message digests - * and ciphers instead. - * - * \warning If both MBEDTLS_ECDSA_SIGN_ALT and MBEDTLS_ECDSA_DETERMINISTIC are - * enabled, then the deterministic ECDH signature functions pass the - * the static HMAC-DRBG as RNG to mbedtls_ecdsa_sign(). Therefore - * alternative implementations should use the RNG only for generating - * the ephemeral key and nothing else. If this is not possible, then - * MBEDTLS_ECDSA_DETERMINISTIC should be disabled and an alternative - * implementation should be provided for mbedtls_ecdsa_sign_det_ext() - * (and for mbedtls_ecdsa_sign_det() too if backward compatibility is - * desirable). - * - */ -//#define MBEDTLS_MD2_PROCESS_ALT -//#define MBEDTLS_MD4_PROCESS_ALT -//#define MBEDTLS_MD5_PROCESS_ALT -//#define MBEDTLS_RIPEMD160_PROCESS_ALT -//#define MBEDTLS_SHA1_PROCESS_ALT -//#define MBEDTLS_SHA256_PROCESS_ALT -//#define MBEDTLS_SHA512_PROCESS_ALT -//#define MBEDTLS_DES_SETKEY_ALT -//#define MBEDTLS_DES_CRYPT_ECB_ALT -//#define MBEDTLS_DES3_CRYPT_ECB_ALT -/* #undef MBEDTLS_AES_SETKEY_ENC_ALT */ -/* #undef MBEDTLS_AES_SETKEY_DEC_ALT */ -/* #undef MBEDTLS_AES_ENCRYPT_ALT */ -/* #undef MBEDTLS_AES_DECRYPT_ALT */ -#define MBEDTLS_ECDH_GEN_PUBLIC_ALT -#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT -#define MBEDTLS_ECDSA_VERIFY_ALT -#define MBEDTLS_ECDSA_SIGN_ALT -#define MBEDTLS_ECDSA_GENKEY_ALT - -/** - * \def MBEDTLS_ECP_INTERNAL_ALT - * - * Expose a part of the internal interface of the Elliptic Curve Point module. - * - * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your - * alternative core implementation of elliptic curve arithmetic. Keep in mind - * that function prototypes should remain the same. - * - * This partially replaces one function. The header file from mbed TLS is still - * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation - * is still present and it is used for group structures not supported by the - * alternative. - * - * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT - * and implementing the following functions: - * unsigned char mbedtls_internal_ecp_grp_capable( - * const mbedtls_ecp_group *grp ) - * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp ) - * void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp ) - * The mbedtls_internal_ecp_grp_capable function should return 1 if the - * replacement functions implement arithmetic for the given group and 0 - * otherwise. - * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_free are - * called before and after each point operation and provide an opportunity to - * implement optimized set up and tear down instructions. - * - * Example: In case you uncomment MBEDTLS_ECP_INTERNAL_ALT and - * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac - * function, but will use your mbedtls_internal_ecp_double_jac if the group is - * supported (your mbedtls_internal_ecp_grp_capable function returns 1 when - * receives it as an argument). If the group is not supported then the original - * implementation is used. The other functions and the definition of - * mbedtls_ecp_group and mbedtls_ecp_point will not change, so your - * implementation of mbedtls_internal_ecp_double_jac and - * mbedtls_internal_ecp_grp_capable must be compatible with this definition. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - */ -/* Required for all the functions in this section */ -//#define MBEDTLS_ECP_INTERNAL_ALT -/* Support for Weierstrass curves with Jacobi representation */ -//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT -//#define MBEDTLS_ECP_ADD_MIXED_ALT -//#define MBEDTLS_ECP_DOUBLE_JAC_ALT -//#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT -//#define MBEDTLS_ECP_NORMALIZE_JAC_ALT -/* Support for curves with Montgomery arithmetic */ -//#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT -//#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT -//#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT - -/** - * \def MBEDTLS_TEST_NULL_ENTROPY - * - * Enables testing and use of mbed TLS without any configured entropy sources. - * This permits use of the library on platforms before an entropy source has - * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the - * MBEDTLS_ENTROPY_NV_SEED switches). - * - * WARNING! This switch MUST be disabled in production builds, and is suitable - * only for development. - * Enabling the switch negates any security provided by the library. - * - * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - * - */ -//#define MBEDTLS_TEST_NULL_ENTROPY - -/** - * \def MBEDTLS_ENTROPY_HARDWARE_ALT - * - * Uncomment this macro to let mbed TLS use your own implementation of a - * hardware entropy collector. - * - * Your function must be called \c mbedtls_hardware_poll(), have the same - * prototype as declared in entropy_poll.h, and accept NULL as first argument. - * - * Uncomment to use your own hardware entropy collector. - */ -#define MBEDTLS_ENTROPY_HARDWARE_ALT - -/** - * \def MBEDTLS_AES_ROM_TABLES - * - * Use precomputed AES tables stored in ROM. - * - * Uncomment this macro to use precomputed AES tables stored in ROM. - * Comment this macro to generate AES tables in RAM at runtime. - * - * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb - * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the - * initialization time before the first AES operation can be performed. - * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c - * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded - * performance if ROM access is slower than RAM access. - * - * This option is independent of \c MBEDTLS_AES_FEWER_TABLES. - * - */ -/* #undef MBEDTLS_AES_ROM_TABLES */ - -/** - * \def MBEDTLS_AES_FEWER_TABLES - * - * Use less ROM/RAM for AES tables. - * - * Uncommenting this macro omits 75% of the AES tables from - * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES) - * by computing their values on the fly during operations - * (the tables are entry-wise rotations of one another). - * - * Tradeoff: Uncommenting this reduces the RAM / ROM footprint - * by ~6kb but at the cost of more arithmetic operations during - * runtime. Specifically, one has to compare 4 accesses within - * different tables to 4 accesses with additional arithmetic - * operations within the same table. The performance gain/loss - * depends on the system and memory details. - * - * This option is independent of \c MBEDTLS_AES_ROM_TABLES. - * - */ -/* #undef MBEDTLS_AES_FEWER_TABLES */ - -/** - * \def MBEDTLS_CAMELLIA_SMALL_MEMORY - * - * Use less ROM for the Camellia implementation (saves about 768 bytes). - * - * Uncomment this macro to use less memory for Camellia. - */ -//#define MBEDTLS_CAMELLIA_SMALL_MEMORY - -/** - * \def MBEDTLS_CIPHER_MODE_CBC - * - * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers. - */ -/* #undef MBEDTLS_CIPHER_MODE_CBC */ - -/** - * \def MBEDTLS_CIPHER_MODE_CFB - * - * Enable Cipher Feedback mode (CFB) for symmetric ciphers. - */ -/* #undef MBEDTLS_CIPHER_MODE_CFB */ - -/** - * \def MBEDTLS_CIPHER_MODE_CTR - * - * Enable Counter Block Cipher mode (CTR) for symmetric ciphers. - */ -/* #undef MBEDTLS_CIPHER_MODE_CTR */ - -/** - * \def MBEDTLS_CIPHER_MODE_OFB - * - * Enable Output Feedback mode (OFB) for symmetric ciphers. - */ -/* #undef MBEDTLS_CIPHER_MODE_OFB */ - -/** - * \def MBEDTLS_CIPHER_MODE_XTS - * - * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES. - */ -/* #undef MBEDTLS_CIPHER_MODE_XTS */ - -/** - * \def MBEDTLS_CIPHER_NULL_CIPHER - * - * Enable NULL cipher. - * Warning: Only do so when you know what you are doing. This allows for - * encryption or channels without any security! - * - * Requires MBEDTLS_ENABLE_WEAK_CIPHERSUITES as well to enable - * the following ciphersuites: - * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA - * - * Uncomment this macro to enable the NULL cipher and ciphersuites - */ -//#define MBEDTLS_CIPHER_NULL_CIPHER - -/** - * \def MBEDTLS_CIPHER_PADDING_PKCS7 - * - * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for - * specific padding modes in the cipher layer with cipher modes that support - * padding (e.g. CBC) - * - * If you disable all padding modes, only full blocks can be used with CBC. - * - * Enable padding modes in the cipher layer. - */ -/* #undef MBEDTLS_CIPHER_PADDING_PKCS7 */ -/* #undef MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS */ -/* #undef MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN */ -/* #undef MBEDTLS_CIPHER_PADDING_ZEROS */ - -/** \def MBEDTLS_CTR_DRBG_USE_128_BIT_KEY - * - * Uncomment this macro to use a 128-bit key in the CTR_DRBG module. - * By default, CTR_DRBG uses a 256-bit key. - */ -#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY - -/** - * \def MBEDTLS_ENABLE_WEAK_CIPHERSUITES - * - * Enable weak ciphersuites in SSL / TLS. - * Warning: Only do so when you know what you are doing. This allows for - * channels with virtually no security at all! - * - * This enables the following ciphersuites: - * MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA - * - * Uncomment this macro to enable weak ciphersuites - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -//#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES - -/** - * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES - * - * Remove RC4 ciphersuites by default in SSL / TLS. - * This flag removes the ciphersuites based on RC4 from the default list as - * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to - * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them - * explicitly. - * - * Uncomment this macro to remove RC4 ciphersuites by default. - */ -#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES - -/** - * \def MBEDTLS_REMOVE_3DES_CIPHERSUITES - * - * Remove 3DES ciphersuites by default in SSL / TLS. - * This flag removes the ciphersuites based on 3DES from the default list as - * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible - * to enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including - * them explicitly. - * - * A man-in-the-browser attacker can recover authentication tokens sent through - * a TLS connection using a 3DES based cipher suite (see "On the Practical - * (In-)Security of 64-bit Block Ciphers" by Karthikeyan Bhargavan and Gaëtan - * Leurent, see https://sweet32.info/SWEET32_CCS16.pdf). If this attack falls - * in your threat model or you are unsure, then you should keep this option - * enabled to remove 3DES based cipher suites. - * - * Comment this macro to keep 3DES in the default ciphersuite list. - */ -#define MBEDTLS_REMOVE_3DES_CIPHERSUITES - -/** - * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED - * - * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve - * module. By default all supported curves are enabled. - * - * Comment macros to disable the curve and functions for it - */ -/* #undef MBEDTLS_ECP_DP_SECP192R1_ENABLED */ -/* #undef MBEDTLS_ECP_DP_SECP224R1_ENABLED */ -#define MBEDTLS_ECP_DP_SECP256R1_ENABLED -/* #undef MBEDTLS_ECP_DP_SECP384R1_ENABLED */ -/* #undef MBEDTLS_ECP_DP_SECP521R1_ENABLED */ -/* #undef MBEDTLS_ECP_DP_SECP192K1_ENABLED */ -/* #undef MBEDTLS_ECP_DP_SECP224K1_ENABLED */ -/* #undef MBEDTLS_ECP_DP_SECP256K1_ENABLED */ -/* #undef MBEDTLS_ECP_DP_BP256R1_ENABLED */ -/* #undef MBEDTLS_ECP_DP_BP384R1_ENABLED */ -/* #undef MBEDTLS_ECP_DP_BP512R1_ENABLED */ -/* #undef MBEDTLS_ECP_DP_CURVE25519_ENABLED */ -/* #undef MBEDTLS_ECP_DP_CURVE448_ENABLED */ - -/** - * \def MBEDTLS_ECP_NIST_OPTIM - * - * Enable specific 'modulo p' routines for each NIST prime. - * Depending on the prime and architecture, makes operations 4 to 8 times - * faster on the corresponding curve. - * - * Comment this macro to disable NIST curves optimisation. - */ -#define MBEDTLS_ECP_NIST_OPTIM - -/** - * \def MBEDTLS_ECP_NO_INTERNAL_RNG - * - * When this option is disabled, mbedtls_ecp_mul() will make use of an - * internal RNG when called with a NULL \c f_rng argument, in order to protect - * against some side-channel attacks. - * - * This protection introduces a dependency of the ECP module on one of the - * DRBG modules. For very constrained implementations that don't require this - * protection (for example, because you're only doing signature verification, - * so not manipulating any secret, or because local/physical side-channel - * attacks are outside your threat model), it might be desirable to get rid of - * that dependency. - * - * \warning Enabling this option makes some uses of ECP vulnerable to some - * side-channel attacks. Only enable it if you know that's not a problem for - * your use case. - * - * Uncomment this macro to disable some counter-measures in ECP. - */ -#define MBEDTLS_ECP_NO_INTERNAL_RNG - -/** - * \def MBEDTLS_ECP_RESTARTABLE - * - * Enable "non-blocking" ECC operations that can return early and be resumed. - * - * This allows various functions to pause by returning - * #MBEDTLS_ERR_ECP_IN_PROGRESS (or, for functions in the SSL module, - * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) and then be called later again in - * order to further progress and eventually complete their operation. This is - * controlled through mbedtls_ecp_set_max_ops() which limits the maximum - * number of ECC operations a function may perform before pausing; see - * mbedtls_ecp_set_max_ops() for more information. - * - * This is useful in non-threaded environments if you want to avoid blocking - * for too long on ECC (and, hence, X.509 or SSL/TLS) operations. - * - * Uncomment this macro to enable restartable ECC computations. - * - * \note This option only works with the default software implementation of - * elliptic curve functionality. It is incompatible with - * MBEDTLS_ECP_ALT, MBEDTLS_ECDH_XXX_ALT, MBEDTLS_ECDSA_XXX_ALT - * and MBEDTLS_ECDH_LEGACY_CONTEXT. - */ -//#define MBEDTLS_ECP_RESTARTABLE - -/** - * \def MBEDTLS_ECDH_LEGACY_CONTEXT - * - * Use a backward compatible ECDH context. - * - * Mbed TLS supports two formats for ECDH contexts (#mbedtls_ecdh_context - * defined in `ecdh.h`). For most applications, the choice of format makes - * no difference, since all library functions can work with either format, - * except that the new format is incompatible with MBEDTLS_ECP_RESTARTABLE. - - * The new format used when this option is disabled is smaller - * (56 bytes on a 32-bit platform). In future versions of the library, it - * will support alternative implementations of ECDH operations. - * The new format is incompatible with applications that access - * context fields directly and with restartable ECP operations. - * - * Define this macro if you enable MBEDTLS_ECP_RESTARTABLE or if you - * want to access ECDH context fields directly. Otherwise you should - * comment out this macro definition. - * - * This option has no effect if #MBEDTLS_ECDH_C is not enabled. - * - * \note This configuration option is experimental. Future versions of the - * library may modify the way the ECDH context layout is configured - * and may modify the layout of the new context type. - */ -#define MBEDTLS_ECDH_LEGACY_CONTEXT - -/** - * \def MBEDTLS_ECDSA_DETERMINISTIC - * - * Enable deterministic ECDSA (RFC 6979). - * Standard ECDSA is "fragile" in the sense that lack of entropy when signing - * may result in a compromise of the long-term signing key. This is avoided by - * the deterministic variant. - * - * Requires: MBEDTLS_HMAC_DRBG_C - * - * Comment this macro to disable deterministic ECDSA. - */ -#define MBEDTLS_ECDSA_DETERMINISTIC - -/** - * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - * - * Enable the PSK based ciphersuite modes in SSL / TLS. - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - * - * Enable the DHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -/* #undef MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED */ - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - * - * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - * - * Enable the RSA-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - */ -/* #undef MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED */ - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED - * - * Enable the RSA-only based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - */ -/* #undef MBEDTLS_KEY_EXCHANGE_RSA_ENABLED */ - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED - * - * Enable the DHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -/* #undef MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED */ - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - * - * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - */ -/* #undef MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED */ - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - * - * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C, - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - * - * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - * - * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - * - * Enable the ECJPAKE based ciphersuite modes in SSL / TLS. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Requires: MBEDTLS_ECJPAKE_C - * MBEDTLS_SHA256_C - * MBEDTLS_ECP_DP_SECP256R1_ENABLED - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 - */ -#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - -/** - * \def MBEDTLS_PK_PARSE_EC_EXTENDED - * - * Enhance support for reading EC keys using variants of SEC1 not allowed by - * RFC 5915 and RFC 5480. - * - * Currently this means parsing the SpecifiedECDomain choice of EC - * parameters (only known groups are supported, not arbitrary domains, to - * avoid validation issues). - * - * Disable if you only need to support RFC 5915 + 5480 key formats. - */ -#define MBEDTLS_PK_PARSE_EC_EXTENDED - -/** - * \def MBEDTLS_ERROR_STRERROR_DUMMY - * - * Enable a dummy error function to make use of mbedtls_strerror() in - * third party libraries easier when MBEDTLS_ERROR_C is disabled - * (no effect when MBEDTLS_ERROR_C is enabled). - * - * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're - * not using mbedtls_strerror() or error_strerror() in your application. - * - * Disable if you run into name conflicts and want to really remove the - * mbedtls_strerror() - */ -#define MBEDTLS_ERROR_STRERROR_DUMMY - -/** - * \def MBEDTLS_GENPRIME - * - * Enable the prime-number generation code. - * - * Requires: MBEDTLS_BIGNUM_C - */ -#define MBEDTLS_GENPRIME - -/** - * \def MBEDTLS_FS_IO - * - * Enable functions that use the filesystem. - */ -//#define MBEDTLS_FS_IO - -/** - * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - * - * Do not add default entropy sources. These are the platform specific, - * mbedtls_timing_hardclock and HAVEGE based poll functions. - * - * This is useful to have more control over the added entropy sources in an - * application. - * - * Uncomment this macro to prevent loading of default entropy functions. - */ -//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - -/** - * \def MBEDTLS_NO_PLATFORM_ENTROPY - * - * Do not use built-in platform entropy functions. - * This is useful if your platform does not support - * standards like the /dev/urandom or Windows CryptoAPI. - * - * Uncomment this macro to disable the built-in platform entropy functions. - */ -#define MBEDTLS_NO_PLATFORM_ENTROPY - -/** - * \def MBEDTLS_ENTROPY_FORCE_SHA256 - * - * Force the entropy accumulator to use a SHA-256 accumulator instead of the - * default SHA-512 based one (if both are available). - * - * Requires: MBEDTLS_SHA256_C - * - * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option - * if you have performance concerns. - * - * This option is only useful if both MBEDTLS_SHA256_C and - * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. - */ -#define MBEDTLS_ENTROPY_FORCE_SHA256 - -/** - * \def MBEDTLS_ENTROPY_NV_SEED - * - * Enable the non-volatile (NV) seed file-based entropy source. - * (Also enables the NV seed read/write functions in the platform layer) - * - * This is crucial (if not required) on systems that do not have a - * cryptographic entropy source (in hardware or kernel) available. - * - * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C - * - * \note The read/write functions that are used by the entropy source are - * determined in the platform layer, and can be modified at runtime and/or - * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used. - * - * \note If you use the default implementation functions that read a seedfile - * with regular fopen(), please make sure you make a seedfile with the - * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at - * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from - * and written to or you will get an entropy source error! The default - * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE - * bytes from the file. - * - * \note The entropy collector will write to the seed file before entropy is - * given to an external source, to update it. - */ -//#define MBEDTLS_ENTROPY_NV_SEED - -/* MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER - * - * In PSA key storage, encode the owner of the key. - * - * This is only meaningful when building the library as part of a - * multi-client service. When you activate this option, you must provide - * an implementation of the type psa_key_owner_id_t and a translation - * from psa_key_file_id_t to file name in all the storage backends that - * you wish to support. - * - * Note that this option is meant for internal use only and may be removed - * without notice. - */ -//#define MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER - -/** - * \def MBEDTLS_MEMORY_DEBUG - * - * Enable debugging of buffer allocator memory issues. Automatically prints - * (to stderr) all (fatal) messages on memory allocation issues. Enables - * function for 'debug output' of allocated memory. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Uncomment this macro to let the buffer allocator print out error messages. - */ -//#define MBEDTLS_MEMORY_DEBUG - -/** - * \def MBEDTLS_MEMORY_BACKTRACE - * - * Include backtrace information with each allocated block. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * GLIBC-compatible backtrace() an backtrace_symbols() support - * - * Uncomment this macro to include backtrace information - */ -//#define MBEDTLS_MEMORY_BACKTRACE - -/** - * \def MBEDTLS_PK_RSA_ALT_SUPPORT - * - * Support external private RSA keys (eg from a HSM) in the PK layer. - * - * Comment this macro to disable support for external private RSA keys. - */ -//#define MBEDTLS_PK_RSA_ALT_SUPPORT - -/** - * \def MBEDTLS_PKCS1_V15 - * - * Enable support for PKCS#1 v1.5 encoding. - * - * Requires: MBEDTLS_RSA_C - * - * This enables support for PKCS#1 v1.5 operations. - */ -/* #undef MBEDTLS_PKCS1_V15 */ - -/** - * \def MBEDTLS_PKCS1_V21 - * - * Enable support for PKCS#1 v2.1 encoding. - * - * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C - * - * This enables support for RSAES-OAEP and RSASSA-PSS operations. - */ -/* #undef MBEDTLS_PKCS1_V21 */ - -/** - * \def MBEDTLS_PSA_CRYPTO_SPM - * - * When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is built for SPM (Secure - * Partition Manager) integration which separates the code into two parts: a - * NSPE (Non-Secure Process Environment) and an SPE (Secure Process - * Environment). - * - * Module: library/psa_crypto.c - * Requires: MBEDTLS_PSA_CRYPTO_C - * - */ -//#define MBEDTLS_PSA_CRYPTO_SPM - -/** - * \def MBEDTLS_PSA_INJECT_ENTROPY - * - * Enable support for entropy injection at first boot. This feature is - * required on systems that do not have a built-in entropy source (TRNG). - * This feature is currently not supported on systems that have a built-in - * entropy source. - * - * Requires: MBEDTLS_PSA_CRYPTO_STORAGE_C, MBEDTLS_ENTROPY_NV_SEED - * - */ -//#define MBEDTLS_PSA_INJECT_ENTROPY - -/** - * \def MBEDTLS_RSA_NO_CRT - * - * Do not use the Chinese Remainder Theorem - * for the RSA private operation. - * - * Uncomment this macro to disable the use of CRT in RSA. - * - */ -//#define MBEDTLS_RSA_NO_CRT - -/** - * \def MBEDTLS_SELF_TEST - * - * Enable the checkup functions (*_self_test). - */ -//#define MBEDTLS_SELF_TEST - -/** - * \def MBEDTLS_SHA256_SMALLER - * - * Enable an implementation of SHA-256 that has lower ROM footprint but also - * lower performance. - * - * The default implementation is meant to be a reasonnable compromise between - * performance and size. This version optimizes more aggressively for size at - * the expense of performance. Eg on Cortex-M4 it reduces the size of - * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about - * 30%. - * - * Uncomment to enable the smaller implementation of SHA256. - */ -/* #undef MBEDTLS_SHA256_SMALLER */ - -/** - * \def MBEDTLS_SHA512_SMALLER - * - * Enable an implementation of SHA-512 that has lower ROM footprint but also - * lower performance. - * - * Uncomment to enable the smaller implementation of SHA512. - */ -//#define MBEDTLS_SHA512_SMALLER - -/** - * \def MBEDTLS_SHA512_NO_SHA384 - * - * Disable the SHA-384 option of the SHA-512 module. Use this to save some - * code size on devices that don't use SHA-384. - * - * Requires: MBEDTLS_SHA512_C - * - * Uncomment to disable SHA-384 - */ -//#define MBEDTLS_SHA512_NO_SHA384 - -/** - * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES - * - * Enable sending of alert messages in case of encountered errors as per RFC. - * If you choose not to send the alert messages, mbed TLS can still communicate - * with other servers, only debugging of failures is harder. - * - * The advantage of not sending alert messages, is that no information is given - * about reasons for failures thus preventing adversaries of gaining intel. - * - * Enable sending of all alert messages - */ -//#define MBEDTLS_SSL_ALL_ALERT_MESSAGES - -/** - * \def MBEDTLS_SSL_ASYNC_PRIVATE - * - * Enable asynchronous external private key operations in SSL. This allows - * you to configure an SSL connection to call an external cryptographic - * module to perform private key operations instead of performing the - * operation inside the library. - * - */ -//#define MBEDTLS_SSL_ASYNC_PRIVATE - -/** - * \def MBEDTLS_SSL_DEBUG_ALL - * - * Enable the debug messages in SSL module for all issues. - * Debug messages have been disabled in some places to prevent timing - * attacks due to (unbalanced) debugging function calls. - * - * If you need all error reporting you should enable this during debugging, - * but remove this for production servers that should log as well. - * - * Uncomment this macro to report all debug messages on errors introducing - * a timing side-channel. - * - */ -//#define MBEDTLS_SSL_DEBUG_ALL - -/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC - * - * Enable support for Encrypt-then-MAC, RFC 7366. - * - * This allows peers that both support it to use a more robust protection for - * ciphersuites using CBC, providing deep resistance against timing attacks - * on the padding or underlying cipher. - * - * This only affects CBC ciphersuites, and is useless if none is defined. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1 or - * MBEDTLS_SSL_PROTO_TLS1_1 or - * MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Encrypt-then-MAC - */ -#define MBEDTLS_SSL_ENCRYPT_THEN_MAC - -/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET - * - * Enable support for RFC 7627: Session Hash and Extended Master Secret - * Extension. - * - * This was introduced as "the proper fix" to the Triple Handshake familiy of - * attacks, but it is recommended to always use it (even if you disable - * renegotiation), since it actually fixes a more fundamental issue in the - * original SSL/TLS design, and has implications beyond Triple Handshake. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1 or - * MBEDTLS_SSL_PROTO_TLS1_1 or - * MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Extended Master Secret. - */ -#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET - -/** - * \def MBEDTLS_SSL_FALLBACK_SCSV - * - * Enable support for RFC 7507: Fallback Signaling Cipher Suite Value (SCSV) - * for Preventing Protocol Downgrade Attacks. - * - * For servers, it is recommended to always enable this, unless you support - * only one version of TLS, or know for sure that none of your clients - * implements a fallback strategy. - * - * For clients, you only need this if you're using a fallback strategy, which - * is not recommended in the first place, unless you absolutely need it to - * interoperate with buggy (version-intolerant) servers. - * - * Comment this macro to disable support for FALLBACK_SCSV - */ -#define MBEDTLS_SSL_FALLBACK_SCSV - -/** - * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE - * - * This option controls the availability of the API mbedtls_ssl_get_peer_cert() - * giving access to the peer's certificate after completion of the handshake. - * - * Unless you need mbedtls_ssl_peer_cert() in your application, it is - * recommended to disable this option for reduced RAM usage. - * - * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still - * defined, but always returns \c NULL. - * - * \note This option has no influence on the protection against the - * triple handshake attack. Even if it is disabled, Mbed TLS will - * still ensure that certificates do not change during renegotiation, - * for exaple by keeping a hash of the peer's certificate. - * - * Comment this macro to disable storing the peer's certificate - * after the handshake. - */ -#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE - -/** - * \def MBEDTLS_SSL_HW_RECORD_ACCEL - * - * Enable hooking functions in SSL module for hardware acceleration of - * individual records. - * - * \deprecated This option is deprecated and will be removed in a future - * version of Mbed TLS. - * - * Uncomment this macro to enable hooking functions. - */ -//#define MBEDTLS_SSL_HW_RECORD_ACCEL - -/** - * \def MBEDTLS_SSL_CBC_RECORD_SPLITTING - * - * Enable 1/n-1 record splitting for CBC mode in SSLv3 and TLS 1.0. - * - * This is a countermeasure to the BEAST attack, which also minimizes the risk - * of interoperability issues compared to sending 0-length records. - * - * Comment this macro to disable 1/n-1 record splitting. - */ -//#define MBEDTLS_SSL_CBC_RECORD_SPLITTING - -/** - * \def MBEDTLS_SSL_RENEGOTIATION - * - * Enable support for TLS renegotiation. - * - * The two main uses of renegotiation are (1) refresh keys on long-lived - * connections and (2) client authentication after the initial handshake. - * If you don't need renegotiation, it's probably better to disable it, since - * it has been associated with security issues in the past and is easy to - * misuse/misunderstand. - * - * Comment this to disable support for renegotiation. - * - * \note Even if this option is disabled, both client and server are aware - * of the Renegotiation Indication Extension (RFC 5746) used to - * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1). - * (See \c mbedtls_ssl_conf_legacy_renegotiation for the - * configuration of this extension). - * - */ -//#define MBEDTLS_SSL_RENEGOTIATION - -/** - * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - * - * Enable support for receiving and parsing SSLv2 Client Hello messages for the - * SSL Server module (MBEDTLS_SSL_SRV_C). - * - * \deprecated This option is deprecated and will be removed in a future - * version of Mbed TLS. - * - * Uncomment this macro to enable support for SSLv2 Client Hello messages. - */ -//#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - -/** - * \def MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE - * - * Pick the ciphersuite according to the client's preferences rather than ours - * in the SSL Server module (MBEDTLS_SSL_SRV_C). - * - * Uncomment this macro to respect client's ciphersuite order - */ -//#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE - -/** - * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - * - * Enable support for RFC 6066 max_fragment_length extension in SSL. - * - * Comment this macro to disable support for the max_fragment_length extension - */ -#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - -/** - * \def MBEDTLS_SSL_PROTO_SSL3 - * - * Enable support for SSL 3.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * \deprecated This option is deprecated and will be removed in a future - * version of Mbed TLS. - * - * Comment this macro to disable support for SSL 3.0 - */ -//#define MBEDTLS_SSL_PROTO_SSL3 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1 - * - * Enable support for TLS 1.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.0 - */ -//#define MBEDTLS_SSL_PROTO_TLS1 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_1 - * - * Enable support for TLS 1.1 (and DTLS 1.0 if DTLS is enabled). - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.1 / DTLS 1.0 - */ -//#define MBEDTLS_SSL_PROTO_TLS1_1 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_2 - * - * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled). - * - * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C - * (Depends on ciphersuites) - * - * Comment this macro to disable support for TLS 1.2 / DTLS 1.2 - */ -#define MBEDTLS_SSL_PROTO_TLS1_2 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL - * - * This macro is used to selectively enable experimental parts - * of the code that contribute to the ongoing development of - * the prototype TLS 1.3 and DTLS 1.3 implementation, and provide - * no other purpose. - * - * \warning TLS 1.3 and DTLS 1.3 aren't yet supported in Mbed TLS, - * and no feature exposed through this macro is part of the - * public API. In particular, features under the control - * of this macro are experimental and don't come with any - * stability guarantees. - * - * Uncomment this macro to enable experimental and partial - * functionality specific to TLS 1.3. - */ -//#define MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL - -/** - * \def MBEDTLS_SSL_PROTO_DTLS - * - * Enable support for DTLS (all available versions). - * - * Enable this and MBEDTLS_SSL_PROTO_TLS1_1 to enable DTLS 1.0, - * and/or this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_1 - * or MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for DTLS - */ -#define MBEDTLS_SSL_PROTO_DTLS - -/** - * \def MBEDTLS_SSL_ALPN - * - * Enable support for RFC 7301 Application Layer Protocol Negotiation. - * - * Comment this macro to disable support for ALPN. - */ -//#define MBEDTLS_SSL_ALPN - -/** - * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY - * - * Enable support for the anti-replay mechanism in DTLS. - * - * Requires: MBEDTLS_SSL_TLS_C - * MBEDTLS_SSL_PROTO_DTLS - * - * \warning Disabling this is often a security risk! - * See mbedtls_ssl_conf_dtls_anti_replay() for details. - * - * Comment this to disable anti-replay in DTLS. - */ -#define MBEDTLS_SSL_DTLS_ANTI_REPLAY - -/** - * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Enable support for HelloVerifyRequest on DTLS servers. - * - * This feature is highly recommended to prevent DTLS servers being used as - * amplifiers in DoS attacks against other hosts. It should always be enabled - * unless you know for sure amplification cannot be a problem in the - * environment in which your server operates. - * - * \warning Disabling this can ba a security risk! (see above) - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - * - * Comment this to disable support for HelloVerifyRequest. - */ -#define MBEDTLS_SSL_DTLS_HELLO_VERIFY - -/** - * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - * - * Enable server-side support for clients that reconnect from the same port. - * - * Some clients unexpectedly close the connection and try to reconnect using the - * same source port. This needs special support from the server to handle the - * new connection securely, as described in section 4.2.8 of RFC 6347. This - * flag enables that support. - * - * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Comment this to disable support for clients reusing the source port. - */ -//#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - -/** - * \def MBEDTLS_SSL_DTLS_BADMAC_LIMIT - * - * Enable support for a limit of records with bad MAC. - * - * See mbedtls_ssl_conf_dtls_badmac_limit(). - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - */ -//#define MBEDTLS_SSL_DTLS_BADMAC_LIMIT - -/** - * \def MBEDTLS_SSL_SESSION_TICKETS - * - * Enable support for RFC 5077 session tickets in SSL. - * Client-side, provides full support for session tickets (maintenance of a - * session store remains the responsibility of the application, though). - * Server-side, you also need to provide callbacks for writing and parsing - * tickets, including authenticated encryption and key management. Example - * callbacks are provided by MBEDTLS_SSL_TICKET_C. - * - * Comment this macro to disable support for SSL session tickets - */ -//#define MBEDTLS_SSL_SESSION_TICKETS - -/** - * \def MBEDTLS_SSL_EXPORT_KEYS - * - * Enable support for exporting key block and master secret. - * This is required for certain users of TLS, e.g. EAP-TLS. - * - * Comment this macro to disable support for key export - */ -#define MBEDTLS_SSL_EXPORT_KEYS - -/** - * \def MBEDTLS_SSL_SERVER_NAME_INDICATION - * - * Enable support for RFC 6066 server name indication (SNI) in SSL. - * - * Requires: MBEDTLS_X509_CRT_PARSE_C - * - * Comment this macro to disable support for server name indication in SSL - */ -//#define MBEDTLS_SSL_SERVER_NAME_INDICATION - -/** - * \def MBEDTLS_SSL_TRUNCATED_HMAC - * - * Enable support for RFC 6066 truncated HMAC in SSL. - * - * Comment this macro to disable support for truncated HMAC in SSL - */ -//#define MBEDTLS_SSL_TRUNCATED_HMAC - -/** - * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT - * - * Fallback to old (pre-2.7), non-conforming implementation of the truncated - * HMAC extension which also truncates the HMAC key. Note that this option is - * only meant for a transitory upgrade period and will be removed in a future - * version of the library. - * - * \warning The old implementation is non-compliant and has a security weakness - * (2^80 brute force attack on the HMAC key used for a single, - * uninterrupted connection). This should only be enabled temporarily - * when (1) the use of truncated HMAC is essential in order to save - * bandwidth, and (2) the peer is an Mbed TLS stack that doesn't use - * the fixed implementation yet (pre-2.7). - * - * \deprecated This option is deprecated and will be removed in a - * future version of Mbed TLS. - * - * Uncomment to fallback to old, non-compliant truncated HMAC implementation. - * - * Requires: MBEDTLS_SSL_TRUNCATED_HMAC - */ -//#define MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT - -/** - * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH - * - * Enable modifying the maximum I/O buffer size. - */ -//#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH - -/** - * \def MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN - * - * Enable testing of the constant-flow nature of some sensitive functions with - * clang's MemorySanitizer. This causes some existing tests to also test - * this non-functional property of the code under test. - * - * This setting requires compiling with clang -fsanitize=memory. The test - * suites can then be run normally. - * - * \warning This macro is only used for extended testing; it is not considered - * part of the library's API, so it may change or disappear at any time. - * - * Uncomment to enable testing of the constant-flow nature of selected code. - */ -//#define MBEDTLS_TEST_CONSTANT_FLOW_MEMSAN - -/** - * \def MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND - * - * Enable testing of the constant-flow nature of some sensitive functions with - * valgrind's memcheck tool. This causes some existing tests to also test - * this non-functional property of the code under test. - * - * This setting requires valgrind headers for building, and is only useful for - * testing if the tests suites are run with valgrind's memcheck. This can be - * done for an individual test suite with 'valgrind ./test_suite_xxx', or when - * using CMake, this can be done for all test suites with 'make memcheck'. - * - * \warning This macro is only used for extended testing; it is not considered - * part of the library's API, so it may change or disappear at any time. - * - * Uncomment to enable testing of the constant-flow nature of selected code. - */ -//#define MBEDTLS_TEST_CONSTANT_FLOW_VALGRIND - -/** - * \def MBEDTLS_TEST_HOOKS - * - * Enable features for invasive testing such as introspection functions and - * hooks for fault injection. This enables additional unit tests. - * - * Merely enabling this feature should not change the behavior of the product. - * It only adds new code, and new branching points where the default behavior - * is the same as when this feature is disabled. - * However, this feature increases the attack surface: there is an added - * risk of vulnerabilities, and more gadgets that can make exploits easier. - * Therefore this feature must never be enabled in production. - * - * See `docs/architecture/testing/mbed-crypto-invasive-testing.md` for more - * information. - * - * Uncomment to enable invasive tests. - */ -//#define MBEDTLS_TEST_HOOKS - -/** - * \def MBEDTLS_THREADING_ALT - * - * Provide your own alternate threading implementation. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to allow your own alternate threading implementation. - */ -#define MBEDTLS_THREADING_ALT - -/** - * \def MBEDTLS_THREADING_PTHREAD - * - * Enable the pthread wrapper layer for the threading layer. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to enable pthread mutexes. - */ -//#define MBEDTLS_THREADING_PTHREAD - -/** - * \def MBEDTLS_USE_PSA_CRYPTO - * - * Make the X.509 and TLS library use PSA for cryptographic operations, and - * enable new APIs for using keys handled by PSA Crypto. - * - * \note Development of this option is currently in progress, and parts of Mbed - * TLS's X.509 and TLS modules are not ported to PSA yet. However, these parts - * will still continue to work as usual, so enabling this option should not - * break backwards compatibility. - * - * \warning The PSA Crypto API is in beta stage. While you're welcome to - * experiment using it, incompatible API changes are still possible, and some - * parts may not have reached the same quality as the rest of Mbed TLS yet. - * - * \warning This option enables new Mbed TLS APIs that are dependent on the - * PSA Crypto API, so can't come with the same stability guarantees as the - * rest of the Mbed TLS APIs. You're welcome to experiment with them, but for - * now, access to these APIs is opt-in (via enabling the present option), in - * order to clearly differentiate them from the stable Mbed TLS APIs. - * - * Requires: MBEDTLS_PSA_CRYPTO_C. - * - * Uncomment this to enable internal use of PSA Crypto and new associated APIs. - */ -//#define MBEDTLS_USE_PSA_CRYPTO - -/** - * \def MBEDTLS_VERSION_FEATURES - * - * Allow run-time checking of compile-time enabled features. Thus allowing users - * to check at run-time if the library is for instance compiled with threading - * support via mbedtls_version_check_feature(). - * - * Requires: MBEDTLS_VERSION_C - * - * Comment this to disable run-time checking and save ROM space - */ -#define MBEDTLS_VERSION_FEATURES - -/** - * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 - * - * If set, the X509 parser will not break-off when parsing an X509 certificate - * and encountering an extension in a v1 or v2 certificate. - * - * Uncomment to prevent an error. - */ -//#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 - -/** - * \def MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION - * - * If set, the X509 parser will not break-off when parsing an X509 certificate - * and encountering an unknown critical extension. - * - * \warning Depending on your PKI use, enabling this can be a security risk! - * - * Uncomment to prevent an error. - */ -//#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION - -/** - * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK - * - * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()` - * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure - * the set of trusted certificates through a callback instead of a linked - * list. - * - * This is useful for example in environments where a large number of trusted - * certificates is present and storing them in a linked list isn't efficient - * enough, or when the set of trusted certificates changes frequently. - * - * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and - * `mbedtls_ssl_conf_ca_cb()` for more information. - * - * Uncomment to enable trusted certificate callbacks. - */ -//#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK - -/** - * \def MBEDTLS_X509_CHECK_KEY_USAGE - * - * Enable verification of the keyUsage extension (CA and leaf certificates). - * - * Disabling this avoids problems with mis-issued and/or misused - * (intermediate) CA and leaf certificates. - * - * \warning Depending on your PKI use, disabling this can be a security risk! - * - * Comment to skip keyUsage checking for both CA and leaf certificates. - */ -//#define MBEDTLS_X509_CHECK_KEY_USAGE - -/** - * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE - * - * Enable verification of the extendedKeyUsage extension (leaf certificates). - * - * Disabling this avoids problems with mis-issued and/or misused certificates. - * - * \warning Depending on your PKI use, disabling this can be a security risk! - * - * Comment to skip extendedKeyUsage checking for certificates. - */ -//#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE - -/** - * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT - * - * Enable parsing and verification of X.509 certificates, CRLs and CSRS - * signed with RSASSA-PSS (aka PKCS#1 v2.1). - * - * Comment this macro to disallow using RSASSA-PSS in certificates. - */ -//#define MBEDTLS_X509_RSASSA_PSS_SUPPORT - -/** - * \def MBEDTLS_ZLIB_SUPPORT - * - * If set, the SSL/TLS module uses ZLIB to support compression and - * decompression of packet data. - * - * \warning TLS-level compression MAY REDUCE SECURITY! See for example the - * CRIME attack. Before enabling this option, you should examine with care if - * CRIME or similar exploits may be applicable to your use case. - * - * \note Currently compression can't be used with DTLS. - * - * \deprecated This feature is deprecated and will be removed - * in the next major revision of the library. - * - * Used in: library/ssl_tls.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * This feature requires zlib library and headers to be present. - * - * Uncomment to enable use of ZLIB - */ -//#define MBEDTLS_ZLIB_SUPPORT -/* \} name SECTION: mbed TLS feature support */ - -/** - * \name SECTION: mbed TLS modules - * - * This section enables or disables entire modules in mbed TLS - * \{ - */ - -/** - * \def MBEDTLS_AESNI_C - * - * Enable AES-NI support on x86-64. - * - * Module: library/aesni.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the AES-NI instructions on x86-64 - */ -//#define MBEDTLS_AESNI_C - -/** - * \def MBEDTLS_AES_C - * - * Enable the AES block cipher. - * - * Module: library/aes.c - * Caller: library/cipher.c - * library/pem.c - * library/ctr_drbg.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * - * PEM_PARSE uses AES for decrypting encrypted keys. - */ -#define MBEDTLS_AES_C - -/** - * \def MBEDTLS_ARC4_C - * - * Enable the ARCFOUR stream cipher. - * - * Module: library/arc4.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. If possible, we recommend avoidng dependencies on - * it, and considering stronger ciphers instead. - * - */ -#define MBEDTLS_ARC4_C - -/** - * \def MBEDTLS_ASN1_PARSE_C - * - * Enable the generic ASN1 parser. - * - * Module: library/asn1.c - * Caller: library/x509.c - * library/dhm.c - * library/pkcs12.c - * library/pkcs5.c - * library/pkparse.c - */ -#define MBEDTLS_ASN1_PARSE_C - -/** - * \def MBEDTLS_ASN1_WRITE_C - * - * Enable the generic ASN1 writer. - * - * Module: library/asn1write.c - * Caller: library/ecdsa.c - * library/pkwrite.c - * library/x509_create.c - * library/x509write_crt.c - * library/x509write_csr.c - */ -#define MBEDTLS_ASN1_WRITE_C - -/** - * \def MBEDTLS_BASE64_C - * - * Enable the Base64 module. - * - * Module: library/base64.c - * Caller: library/pem.c - * - * This module is required for PEM support (required by X.509). - */ -#define MBEDTLS_BASE64_C - -/** - * \def MBEDTLS_BIGNUM_C - * - * Enable the multi-precision integer library. - * - * Module: library/bignum.c - * Caller: library/dhm.c - * library/ecp.c - * library/ecdsa.c - * library/rsa.c - * library/rsa_internal.c - * library/ssl_tls.c - * - * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support. - */ -#define MBEDTLS_BIGNUM_C - -/** - * \def MBEDTLS_BLOWFISH_C - * - * Enable the Blowfish block cipher. - * - * Module: library/blowfish.c - */ -//#define MBEDTLS_BLOWFISH_C - -/** - * \def MBEDTLS_CAMELLIA_C - * - * Enable the Camellia block cipher. - * - * Module: library/camellia.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - */ -//#define MBEDTLS_CAMELLIA_C - -/** - * \def MBEDTLS_ARIA_C - * - * Enable the ARIA block cipher. - * - * Module: library/aria.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * - * MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 - */ -//#define MBEDTLS_ARIA_C - -/** - * \def MBEDTLS_CCM_C - * - * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher. - * - * Module: library/ccm.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C - * - * This module enables the AES-CCM ciphersuites, if other requisites are - * enabled as well. - */ -#define MBEDTLS_CCM_C - -/** - * \def MBEDTLS_CERTS_C - * - * Enable the test certificates. - * - * Module: library/certs.c - * Caller: - * - * This module is used for testing (ssl_client/server). - */ -//#define MBEDTLS_CERTS_C - -/** - * \def MBEDTLS_CHACHA20_C - * - * Enable the ChaCha20 stream cipher. - * - * Module: library/chacha20.c - */ -#define MBEDTLS_CHACHA20_C - -/** - * \def MBEDTLS_CHACHAPOLY_C - * - * Enable the ChaCha20-Poly1305 AEAD algorithm. - * - * Module: library/chachapoly.c - * - * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C - */ -#define MBEDTLS_CHACHAPOLY_C - -/** - * \def MBEDTLS_CIPHER_C - * - * Enable the generic cipher layer. - * - * Module: library/cipher.c - * Caller: library/ssl_tls.c - * - * Uncomment to enable generic cipher wrappers. - */ -#define MBEDTLS_CIPHER_C - -/** - * \def MBEDTLS_CMAC_C - * - * Enable the CMAC (Cipher-based Message Authentication Code) mode for block - * ciphers. - * - * Module: library/cmac.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C - * - */ -#define MBEDTLS_CMAC_C - -/** - * \def MBEDTLS_CTR_DRBG_C - * - * Enable the CTR_DRBG AES-based random generator. - * The CTR_DRBG generator uses AES-256 by default. - * To use AES-128 instead, enable \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY above. - * - * \note To achieve a 256-bit security strength with CTR_DRBG, - * you must use AES-256 *and* use sufficient entropy. - * See ctr_drbg.h for more details. - * - * Module: library/ctr_drbg.c - * Caller: - * - * Requires: MBEDTLS_AES_C - * - * This module provides the CTR_DRBG AES random number generator. - */ -#define MBEDTLS_CTR_DRBG_C - -/** - * \def MBEDTLS_DEBUG_C - * - * Enable the debug functions. - * - * Module: library/debug.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module provides debugging functions. - */ -//#define MBEDTLS_DEBUG_C - -/** - * \def MBEDTLS_DES_C - * - * Enable the DES block cipher. - * - * Module: library/des.c - * Caller: library/pem.c - * library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * - * PEM_PARSE uses DES/3DES for decrypting encrypted keys. - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -//#define MBEDTLS_DES_C - -/** - * \def MBEDTLS_DHM_C - * - * Enable the Diffie-Hellman-Merkle module. - * - * Module: library/dhm.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is used by the following key exchanges: - * DHE-RSA, DHE-PSK - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -/* #undef MBEDTLS_DHM_C */ - -/** - * \def MBEDTLS_ECDH_C - * - * Enable the elliptic curve Diffie-Hellman library. - * - * Module: library/ecdh.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK - * - * Requires: MBEDTLS_ECP_C - */ -#define MBEDTLS_ECDH_C - -/** - * \def MBEDTLS_ECDSA_C - * - * Enable the elliptic curve DSA library. - * - * Module: library/ecdsa.c - * Caller: - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C, - * and at least one MBEDTLS_ECP_DP_XXX_ENABLED for a - * short Weierstrass curve. - */ -#define MBEDTLS_ECDSA_C - -/** - * \def MBEDTLS_ECJPAKE_C - * - * Enable the elliptic curve J-PAKE library. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Module: library/ecjpake.c - * Caller: - * - * This module is used by the following key exchanges: - * ECJPAKE - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C - */ -#define MBEDTLS_ECJPAKE_C - -/** - * \def MBEDTLS_ECP_C - * - * Enable the elliptic curve over GF(p) library. - * - * Module: library/ecp.c - * Caller: library/ecdh.c - * library/ecdsa.c - * library/ecjpake.c - * - * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED - */ -#define MBEDTLS_ECP_C - -/** - * \def MBEDTLS_ENTROPY_C - * - * Enable the platform-specific entropy code. - * - * Module: library/entropy.c - * Caller: - * - * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C - * - * This module provides a generic entropy pool - */ -#define MBEDTLS_ENTROPY_C - -/** - * \def MBEDTLS_ERROR_C - * - * Enable error code to error string conversion. - * - * Module: library/error.c - * Caller: - * - * This module enables mbedtls_strerror(). - */ -//#define MBEDTLS_ERROR_C - -/** - * \def MBEDTLS_GCM_C - * - * Enable the Galois/Counter Mode (GCM). - * - * Module: library/gcm.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or MBEDTLS_ARIA_C - * - * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other - * requisites are enabled as well. - */ -/* #undef MBEDTLS_GCM_C */ - -/** - * \def MBEDTLS_HAVEGE_C - * - * Enable the HAVEGE random generator. - * - * Warning: the HAVEGE random generator is not suitable for virtualized - * environments - * - * Warning: the HAVEGE random generator is dependent on timing and specific - * processor traits. It is therefore not advised to use HAVEGE as - * your applications primary random generator or primary entropy pool - * input. As a secondary input to your entropy pool, it IS able add - * the (limited) extra entropy it provides. - * - * Module: library/havege.c - * Caller: - * - * Requires: MBEDTLS_TIMING_C - * - * Uncomment to enable the HAVEGE random generator. - */ -//#define MBEDTLS_HAVEGE_C - -/** - * \def MBEDTLS_HKDF_C - * - * Enable the HKDF algorithm (RFC 5869). - * - * Module: library/hkdf.c - * Caller: - * - * Requires: MBEDTLS_MD_C - * - * This module adds support for the Hashed Message Authentication Code - * (HMAC)-based key derivation function (HKDF). - */ -#define MBEDTLS_HKDF_C - -/** - * \def MBEDTLS_HMAC_DRBG_C - * - * Enable the HMAC_DRBG random generator. - * - * Module: library/hmac_drbg.c - * Caller: - * - * Requires: MBEDTLS_MD_C - * - * Uncomment to enable the HMAC_DRBG random number geerator. - */ -#define MBEDTLS_HMAC_DRBG_C - -/** - * \def MBEDTLS_NIST_KW_C - * - * Enable the Key Wrapping mode for 128-bit block ciphers, - * as defined in NIST SP 800-38F. Only KW and KWP modes - * are supported. At the moment, only AES is approved by NIST. - * - * Module: library/nist_kw.c - * - * Requires: MBEDTLS_AES_C and MBEDTLS_CIPHER_C - */ -//#define MBEDTLS_NIST_KW_C - -/** - * \def MBEDTLS_MD_C - * - * Enable the generic message digest layer. - * - * Module: library/md.c - * Caller: - * - * Uncomment to enable generic message digest wrappers. - */ -#define MBEDTLS_MD_C - -/** - * \def MBEDTLS_MD2_C - * - * Enable the MD2 hash algorithm. - * - * Module: library/md2.c - * Caller: - * - * Uncomment to enable support for (rare) MD2-signed X.509 certs. - * - * \warning MD2 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -//#define MBEDTLS_MD2_C - -/** - * \def MBEDTLS_MD4_C - * - * Enable the MD4 hash algorithm. - * - * Module: library/md4.c - * Caller: - * - * Uncomment to enable support for (rare) MD4-signed X.509 certs. - * - * \warning MD4 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -//#define MBEDTLS_MD4_C - -/** - * \def MBEDTLS_MD5_C - * - * Enable the MD5 hash algorithm. - * - * Module: library/md5.c - * Caller: library/md.c - * library/pem.c - * library/ssl_tls.c - * - * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2 - * depending on the handshake parameters. Further, it is used for checking - * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded - * encrypted keys. - * - * \warning MD5 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -//#define MBEDTLS_MD5_C - -/** - * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Enable the buffer allocator implementation that makes use of a (stack) - * based buffer to 'allocate' dynamic memory. (replaces calloc() and free() - * calls) - * - * Module: library/memory_buffer_alloc.c - * - * Requires: MBEDTLS_PLATFORM_C - * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS) - * - * Enable this module to enable the buffer memory allocator. - */ -#define MBEDTLS_MEMORY_BUFFER_ALLOC_C - -/** - * \def MBEDTLS_NET_C - * - * Enable the TCP and UDP over IPv6/IPv4 networking routines. - * - * \note This module only works on POSIX/Unix (including Linux, BSD and OS X) - * and Windows. For other platforms, you'll want to disable it, and write your - * own networking callbacks to be passed to \c mbedtls_ssl_set_bio(). - * - * \note See also our Knowledge Base article about porting to a new - * environment: - * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS - * - * Module: library/net_sockets.c - * - * This module provides networking routines. - */ -//#define MBEDTLS_NET_C - -/** - * \def MBEDTLS_OID_C - * - * Enable the OID database. - * - * Module: library/oid.c - * Caller: library/asn1write.c - * library/pkcs5.c - * library/pkparse.c - * library/pkwrite.c - * library/rsa.c - * library/x509.c - * library/x509_create.c - * library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * This modules translates between OIDs and internal values. - */ -#define MBEDTLS_OID_C - -/** - * \def MBEDTLS_PADLOCK_C - * - * Enable VIA Padlock support on x86. - * - * Module: library/padlock.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the VIA PadLock on x86. - */ -//#define MBEDTLS_PADLOCK_C - -/** - * \def MBEDTLS_PEM_PARSE_C - * - * Enable PEM decoding / parsing. - * - * Module: library/pem.c - * Caller: library/dhm.c - * library/pkparse.c - * library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for decoding / parsing PEM files. - */ -#define MBEDTLS_PEM_PARSE_C - -/** - * \def MBEDTLS_PEM_WRITE_C - * - * Enable PEM encoding / writing. - * - * Module: library/pem.c - * Caller: library/pkwrite.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for encoding / writing PEM files. - */ -#define MBEDTLS_PEM_WRITE_C - -/** - * \def MBEDTLS_PK_C - * - * Enable the generic public (asymetric) key layer. - * - * Module: library/pk.c - * Caller: library/ssl_tls.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C - * - * Uncomment to enable generic public key wrappers. - */ -#define MBEDTLS_PK_C - -/** - * \def MBEDTLS_PK_PARSE_C - * - * Enable the generic public (asymetric) key parser. - * - * Module: library/pkparse.c - * Caller: library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key parse functions. - */ -#define MBEDTLS_PK_PARSE_C - -/** - * \def MBEDTLS_PK_WRITE_C - * - * Enable the generic public (asymetric) key writer. - * - * Module: library/pkwrite.c - * Caller: library/x509write.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key write functions. - */ -#define MBEDTLS_PK_WRITE_C - -/** - * \def MBEDTLS_PKCS5_C - * - * Enable PKCS#5 functions. - * - * Module: library/pkcs5.c - * - * Requires: MBEDTLS_MD_C - * - * This module adds support for the PKCS#5 functions. - */ -#define MBEDTLS_PKCS5_C - -/** - * \def MBEDTLS_PKCS11_C - * - * Enable wrapper for PKCS#11 smartcard support via the pkcs11-helper library. - * - * \deprecated This option is deprecated and will be removed in a future - * version of Mbed TLS. - * - * Module: library/pkcs11.c - * Caller: library/pk.c - * - * Requires: MBEDTLS_PK_C - * - * This module enables SSL/TLS PKCS #11 smartcard support. - * Requires the presence of the PKCS#11 helper library (libpkcs11-helper) - */ -//#define MBEDTLS_PKCS11_C - -/** - * \def MBEDTLS_PKCS12_C - * - * Enable PKCS#12 PBE functions. - * Adds algorithms for parsing PKCS#8 encrypted private keys - * - * Module: library/pkcs12.c - * Caller: library/pkparse.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * Can use: MBEDTLS_ARC4_C - * - * This module enables PKCS#12 functions. - */ -//#define MBEDTLS_PKCS12_C - -/** - * \def MBEDTLS_PLATFORM_C - * - * Enable the platform abstraction layer that allows you to re-assign - * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit(). - * - * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT - * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned - * above to be specified at runtime or compile time respectively. - * - * \note This abstraction layer must be enabled on Windows (including MSYS2) - * as other module rely on it for a fixed snprintf implementation. - * - * Module: library/platform.c - * Caller: Most other .c files - * - * This module enables abstraction of common (libc) functions. - */ -#define MBEDTLS_PLATFORM_C - -/** - * \def MBEDTLS_POLY1305_C - * - * Enable the Poly1305 MAC algorithm. - * - * Module: library/poly1305.c - * Caller: library/chachapoly.c - */ -#define MBEDTLS_POLY1305_C - -/** - * \def MBEDTLS_PSA_CRYPTO_C - * - * Enable the Platform Security Architecture cryptography API. - * - * \warning The PSA Crypto API is still beta status. While you're welcome to - * experiment using it, incompatible API changes are still possible, and some - * parts may not have reached the same quality as the rest of Mbed TLS yet. - * - * Module: library/psa_crypto.c - * - * Requires: MBEDTLS_CTR_DRBG_C, MBEDTLS_ENTROPY_C - * - */ -// #define MBEDTLS_PSA_CRYPTO_C - -/** - * \def MBEDTLS_PSA_CRYPTO_SE_C - * - * Enable secure element support in the Platform Security Architecture - * cryptography API. - * - * \warning This feature is not yet suitable for production. It is provided - * for API evaluation and testing purposes only. - * - * Module: library/psa_crypto_se.c - * - * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_PSA_CRYPTO_STORAGE_C - * - */ -//#define MBEDTLS_PSA_CRYPTO_SE_C - -/** - * \def MBEDTLS_PSA_CRYPTO_STORAGE_C - * - * Enable the Platform Security Architecture persistent key storage. - * - * Module: library/psa_crypto_storage.c - * - * Requires: MBEDTLS_PSA_CRYPTO_C, - * either MBEDTLS_PSA_ITS_FILE_C or a native implementation of - * the PSA ITS interface - */ -//#define MBEDTLS_PSA_CRYPTO_STORAGE_C - -/** - * \def MBEDTLS_PSA_ITS_FILE_C - * - * Enable the emulation of the Platform Security Architecture - * Internal Trusted Storage (PSA ITS) over files. - * - * Module: library/psa_its_file.c - * - * Requires: MBEDTLS_FS_IO - */ -//#define MBEDTLS_PSA_ITS_FILE_C - -/** - * \def MBEDTLS_RIPEMD160_C - * - * Enable the RIPEMD-160 hash algorithm. - * - * Module: library/ripemd160.c - * Caller: library/md.c - * - */ -//#define MBEDTLS_RIPEMD160_C - -/** - * \def MBEDTLS_RSA_C - * - * Enable the RSA public-key cryptosystem. - * - * Module: library/rsa.c - * library/rsa_internal.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509.c - * - * This module is used by the following key exchanges: - * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C - */ -/* #undef MBEDTLS_RSA_C */ - -/** - * \def MBEDTLS_SHA1_C - * - * Enable the SHA1 cryptographic hash algorithm. - * - * Module: library/sha1.c - * Caller: library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509write_crt.c - * - * This module is required for SSL/TLS up to version 1.1, for TLS 1.2 - * depending on the handshake parameters, and for SHA1-signed certificates. - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_SHA1_C - -/** - * \def MBEDTLS_SHA256_C - * - * Enable the SHA-224 and SHA-256 cryptographic hash algorithms. - * - * Module: library/sha256.c - * Caller: library/entropy.c - * library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module adds support for SHA-224 and SHA-256. - * This module is required for the SSL/TLS 1.2 PRF function. - */ -#define MBEDTLS_SHA256_C - -/** - * \def MBEDTLS_SHA512_C - * - * Enable the SHA-384 and SHA-512 cryptographic hash algorithms. - * - * Module: library/sha512.c - * Caller: library/entropy.c - * library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * This module adds support for SHA-384 and SHA-512. - */ -#define MBEDTLS_SHA512_C - -/** - * \def MBEDTLS_SSL_CACHE_C - * - * Enable simple SSL cache implementation. - * - * Module: library/ssl_cache.c - * Caller: - * - * Requires: MBEDTLS_SSL_CACHE_C - */ -//#define MBEDTLS_SSL_CACHE_C - -/** - * \def MBEDTLS_SSL_COOKIE_C - * - * Enable basic implementation of DTLS cookies for hello verification. - * - * Module: library/ssl_cookie.c - * Caller: - */ -#define MBEDTLS_SSL_COOKIE_C - -/** - * \def MBEDTLS_SSL_TICKET_C - * - * Enable an implementation of TLS server-side callbacks for session tickets. - * - * Module: library/ssl_ticket.c - * Caller: - * - * Requires: MBEDTLS_CIPHER_C - */ -//#define MBEDTLS_SSL_TICKET_C - -/** - * \def MBEDTLS_SSL_CLI_C - * - * Enable the SSL/TLS client code. - * - * Module: library/ssl_cli.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS client support. - */ -#define MBEDTLS_SSL_CLI_C - -/** - * \def MBEDTLS_SSL_SRV_C - * - * Enable the SSL/TLS server code. - * - * Module: library/ssl_srv.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS server support. - */ -#define MBEDTLS_SSL_SRV_C - -/** - * \def MBEDTLS_SSL_TLS_C - * - * Enable the generic SSL/TLS code. - * - * Module: library/ssl_tls.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * and at least one of the MBEDTLS_SSL_PROTO_XXX defines - * - * This module is required for SSL/TLS. - */ -#define MBEDTLS_SSL_TLS_C - -/** - * \def MBEDTLS_THREADING_C - * - * Enable the threading abstraction layer. - * By default mbed TLS assumes it is used in a non-threaded environment or that - * contexts are not shared between threads. If you do intend to use contexts - * between threads, you will need to enable this layer to prevent race - * conditions. See also our Knowledge Base article about threading: - * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading - * - * Module: library/threading.c - * - * This allows different threading implementations (self-implemented or - * provided). - * - * You will have to enable either MBEDTLS_THREADING_ALT or - * MBEDTLS_THREADING_PTHREAD. - * - * Enable this layer to allow use of mutexes within mbed TLS - */ -#define MBEDTLS_THREADING_C - -/** - * \def MBEDTLS_TIMING_C - * - * Enable the semi-portable timing interface. - * - * \note The provided implementation only works on POSIX/Unix (including Linux, - * BSD and OS X) and Windows. On other platforms, you can either disable that - * module and provide your own implementations of the callbacks needed by - * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide - * your own implementation of the whole module by setting - * \c MBEDTLS_TIMING_ALT in the current file. - * - * \note See also our Knowledge Base article about porting to a new - * environment: - * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS - * - * Module: library/timing.c - * Caller: library/havege.c - * - * This module is used by the HAVEGE random number generator. - */ -//#define MBEDTLS_TIMING_C - -/** - * \def MBEDTLS_VERSION_C - * - * Enable run-time version information. - * - * Module: library/version.c - * - * This module provides run-time version information. - */ -#define MBEDTLS_VERSION_C - -/** - * \def MBEDTLS_X509_USE_C - * - * Enable X.509 core for using certificates. - * - * Module: library/x509.c - * Caller: library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, - * MBEDTLS_PK_PARSE_C - * - * This module is required for the X.509 parsing modules. - */ -#define MBEDTLS_X509_USE_C - -/** - * \def MBEDTLS_X509_CRT_PARSE_C - * - * Enable X.509 certificate parsing. - * - * Module: library/x509_crt.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 certificate parsing. - */ -#define MBEDTLS_X509_CRT_PARSE_C - -/** - * \def MBEDTLS_X509_CRL_PARSE_C - * - * Enable X.509 CRL parsing. - * - * Module: library/x509_crl.c - * Caller: library/x509_crt.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 CRL parsing. - */ -//#define MBEDTLS_X509_CRL_PARSE_C - -/** - * \def MBEDTLS_X509_CSR_PARSE_C - * - * Enable X.509 Certificate Signing Request (CSR) parsing. - * - * Module: library/x509_csr.c - * Caller: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is used for reading X.509 certificate request. - */ -//#define MBEDTLS_X509_CSR_PARSE_C - -/** - * \def MBEDTLS_X509_CREATE_C - * - * Enable X.509 core for creating certificates. - * - * Module: library/x509_create.c - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C - * - * This module is the basis for creating X.509 certificates and CSRs. - */ -//#define MBEDTLS_X509_CREATE_C - -/** - * \def MBEDTLS_X509_CRT_WRITE_C - * - * Enable creating X.509 certificates. - * - * Module: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate creation. - */ -//#define MBEDTLS_X509_CRT_WRITE_C - -/** - * \def MBEDTLS_X509_CSR_WRITE_C - * - * Enable creating X.509 Certificate Signing Requests (CSR). - * - * Module: library/x509_csr_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate request writing. - */ -//#define MBEDTLS_X509_CSR_WRITE_C - -/** - * \def MBEDTLS_XTEA_C - * - * Enable the XTEA block cipher. - * - * Module: library/xtea.c - * Caller: - */ -//#define MBEDTLS_XTEA_C - -/* \} name SECTION: mbed TLS modules */ - -/** - * \name SECTION: Module configuration options - * - * This section allows for the setting of module specific sizes and - * configuration options. The default values are already present in the - * relevant header files and should suffice for the regular use cases. - * - * Our advice is to enable options and change their values here - * only if you have a good reason and know the consequences. - * - * Please check the respective header file for documentation on these - * parameters (to prevent duplicate documentation). - * \{ - */ - -/* MPI / BIGNUM options */ -#define MBEDTLS_MPI_WINDOW_SIZE 1 /**< Maximum windows size used. */ -#define MBEDTLS_MPI_MAX_SIZE 32 /**< Maximum number of bytes for usable MPIs. */ - -/* CTR_DRBG options */ -//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */ -/*! Maximal reseed counter - indicates maximal number of -requests allowed between reseeds; according to NIST 800-90 -it is (2^48 - 1), our restriction is : (int - 0xFFFF - 0xF).*/ -#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 0xFFF0 /**< Interval before reseed is performed by default */ -//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ -#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY /**< Use 128-bit key for CTR_DRBG - may reduce security (see ctr_drbg.h) */ - -/* HMAC_DRBG options */ -//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ - -/* ECP options */ -#define MBEDTLS_ECP_MAX_BITS 256 /**< Maximum bit size of groups */ -#define MBEDTLS_ECP_WINDOW_SIZE 2 /**< Maximum window size used */ -/* #undef MBEDTLS_ECP_FIXED_POINT_OPTIM */ - -/* Entropy options */ -//#define MBEDTLS_ENTROPY_MAX_SOURCES 1 /**< Maximum number of sources supported */ -#define MBEDTLS_ENTROPY_MAX_GATHER 144 /**< Maximum amount requested from entropy sources */ -//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */ - -/* Memory buffer allocator options */ -//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ - -/* Platform options */ -//#define MBEDTLS_PLATFORM_STD_MEM_HDR /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */ -//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ -/* Note: your snprintf must correctly zero-terminate the buffer! */ -//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */ - -/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */ -/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */ -//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */ -/* Note: your snprintf must correctly zero-terminate the buffer! */ -//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_VSNPRINTF_MACRO vsnprintf /**< Default vsnprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ - -/** - * \brief This macro is invoked by the library when an invalid parameter - * is detected that is only checked with #MBEDTLS_CHECK_PARAMS - * (see the documentation of that option for context). - * - * When you leave this undefined here, the library provides - * a default definition. If the macro #MBEDTLS_CHECK_PARAMS_ASSERT - * is defined, the default definition is `assert(cond)`, - * otherwise the default definition calls a function - * mbedtls_param_failed(). This function is declared in - * `platform_util.h` for the benefit of the library, but - * you need to define in your application. - * - * When you define this here, this replaces the default - * definition in platform_util.h (which no longer declares the - * function mbedtls_param_failed()) and it is your responsibility - * to make sure this macro expands to something suitable (in - * particular, that all the necessary declarations are visible - * from within the library - you can ensure that by providing - * them in this file next to the macro definition). - * If you define this macro to call `assert`, also define - * #MBEDTLS_CHECK_PARAMS_ASSERT so that library source files - * include ``. - * - * Note that you may define this macro to expand to nothing, in - * which case you don't have to worry about declarations or - * definitions. However, you will then be notified about invalid - * parameters only in non-void functions, and void function will - * just silently return early on invalid parameters, which - * partially negates the benefits of enabling - * #MBEDTLS_CHECK_PARAMS in the first place, so is discouraged. - * - * \param cond The expression that should evaluate to true, but doesn't. - */ -//#define MBEDTLS_PARAM_FAILED( cond ) assert( cond ) - -/* SSL Cache options */ -//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */ -//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */ - -/* SSL options */ - -/** \def MBEDTLS_SSL_MAX_CONTENT_LEN - * - * Maximum length (in bytes) of incoming and outgoing plaintext fragments. - * - * This determines the size of both the incoming and outgoing TLS I/O buffers - * in such a way that both are capable of holding the specified amount of - * plaintext data, regardless of the protection mechanism used. - * - * To configure incoming and outgoing I/O buffers separately, use - * #MBEDTLS_SSL_IN_CONTENT_LEN and #MBEDTLS_SSL_OUT_CONTENT_LEN, - * which overwrite the value set by this option. - * - * \note When using a value less than the default of 16KB on the client, it is - * recommended to use the Maximum Fragment Length (MFL) extension to - * inform the server about this limitation. On the server, there - * is no supported, standardized way of informing the client about - * restriction on the maximum size of incoming messages, and unless - * the limitation has been communicated by other means, it is recommended - * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN - * while keeping the default value of 16KB for the incoming buffer. - * - * Uncomment to set the maximum plaintext size of both - * incoming and outgoing I/O buffers. - */ -#define MBEDTLS_SSL_MAX_CONTENT_LEN 900 - -/** \def MBEDTLS_SSL_IN_CONTENT_LEN - * - * Maximum length (in bytes) of incoming plaintext fragments. - * - * This determines the size of the incoming TLS I/O buffer in such a way - * that it is capable of holding the specified amount of plaintext data, - * regardless of the protection mechanism used. - * - * If this option is undefined, it inherits its value from - * #MBEDTLS_SSL_MAX_CONTENT_LEN. - * - * \note When using a value less than the default of 16KB on the client, it is - * recommended to use the Maximum Fragment Length (MFL) extension to - * inform the server about this limitation. On the server, there - * is no supported, standardized way of informing the client about - * restriction on the maximum size of incoming messages, and unless - * the limitation has been communicated by other means, it is recommended - * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN - * while keeping the default value of 16KB for the incoming buffer. - * - * Uncomment to set the maximum plaintext size of the incoming I/O buffer - * independently of the outgoing I/O buffer. - */ -//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384 - -/** \def MBEDTLS_SSL_CID_IN_LEN_MAX - * - * The maximum length of CIDs used for incoming DTLS messages. - * - */ -//#define MBEDTLS_SSL_CID_IN_LEN_MAX 32 - -/** \def MBEDTLS_SSL_CID_OUT_LEN_MAX - * - * The maximum length of CIDs used for outgoing DTLS messages. - * - */ -//#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32 - -/** \def MBEDTLS_SSL_CID_PADDING_GRANULARITY - * - * This option controls the use of record plaintext padding - * when using the Connection ID extension in DTLS 1.2. - * - * The padding will always be chosen so that the length of the - * padded plaintext is a multiple of the value of this option. - * - * Note: A value of \c 1 means that no padding will be used - * for outgoing records. - * - * Note: On systems lacking division instructions, - * a power of two should be preferred. - * - */ -//#define MBEDTLS_SSL_CID_PADDING_GRANULARITY 16 - -/** \def MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY - * - * This option controls the use of record plaintext padding - * in TLS 1.3. - * - * The padding will always be chosen so that the length of the - * padded plaintext is a multiple of the value of this option. - * - * Note: A value of \c 1 means that no padding will be used - * for outgoing records. - * - * Note: On systems lacking division instructions, - * a power of two should be preferred. - */ -//#define MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY 1 - -/** \def MBEDTLS_SSL_OUT_CONTENT_LEN - * - * Maximum length (in bytes) of outgoing plaintext fragments. - * - * This determines the size of the outgoing TLS I/O buffer in such a way - * that it is capable of holding the specified amount of plaintext data, - * regardless of the protection mechanism used. - * - * If this option undefined, it inherits its value from - * #MBEDTLS_SSL_MAX_CONTENT_LEN. - * - * It is possible to save RAM by setting a smaller outward buffer, while keeping - * the default inward 16384 byte buffer to conform to the TLS specification. - * - * The minimum required outward buffer size is determined by the handshake - * protocol's usage. Handshaking will fail if the outward buffer is too small. - * The specific size requirement depends on the configured ciphers and any - * certificate data which is sent during the handshake. - * - * Uncomment to set the maximum plaintext size of the outgoing I/O buffer - * independently of the incoming I/O buffer. - */ -//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384 - -/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING - * - * Maximum number of heap-allocated bytes for the purpose of - * DTLS handshake message reassembly and future message buffering. - * - * This should be at least 9/8 * MBEDTLSSL_IN_CONTENT_LEN - * to account for a reassembled handshake message of maximum size, - * together with its reassembly bitmap. - * - * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default) - * should be sufficient for all practical situations as it allows - * to reassembly a large handshake message (such as a certificate) - * while buffering multiple smaller handshake messages. - * - */ -//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768 - -//#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */ -//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */ -//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ - -/** - * Complete list of ciphersuites to use, in order of preference. - * - * \warning No dependency checking is done on that field! This option can only - * be used to restrict the set of available ciphersuites. It is your - * responsibility to make sure the needed modules are active. - * - * Use this to save a few hundred bytes of ROM (default ordering of all - * available ciphersuites) and a few to a few hundred bytes of RAM. - * - * The value below is only an example, not the default. - */ -#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 - -/* X509 options */ -//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */ -//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */ - -/** - * Allow SHA-1 in the default TLS configuration for certificate signing. - * Without this build-time option, SHA-1 support must be activated explicitly - * through mbedtls_ssl_conf_cert_profile. Turning on this option is not - * recommended because of it is possible to generate SHA-1 collisions, however - * this may be safe for legacy infrastructure where additional controls apply. - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES - -/** - * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake - * signature and ciphersuite selection. Without this build-time option, SHA-1 - * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes. - * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by - * default. At the time of writing, there is no practical attack on the use - * of SHA-1 in handshake signatures, hence this option is turned on by default - * to preserve compatibility with existing peers, but the general - * warning applies nonetheless: - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE - -/** - * Uncomment the macro to let mbed TLS use your alternate implementation of - * mbedtls_platform_zeroize(). This replaces the default implementation in - * platform_util.c. - * - * mbedtls_platform_zeroize() is a widely used function across the library to - * zero a block of memory. The implementation is expected to be secure in the - * sense that it has been written to prevent the compiler from removing calls - * to mbedtls_platform_zeroize() as part of redundant code elimination - * optimizations. However, it is difficult to guarantee that calls to - * mbedtls_platform_zeroize() will not be optimized by the compiler as older - * versions of the C language standards do not provide a secure implementation - * of memset(). Therefore, MBEDTLS_PLATFORM_ZEROIZE_ALT enables users to - * configure their own implementation of mbedtls_platform_zeroize(), for - * example by using directives specific to their compiler, features from newer - * C standards (e.g using memset_s() in C11) or calling a secure memset() from - * their system (e.g explicit_bzero() in BSD). - */ -#define MBEDTLS_PLATFORM_ZEROIZE_ALT - -/** - * Uncomment the macro to let Mbed TLS use your alternate implementation of - * mbedtls_platform_gmtime_r(). This replaces the default implementation in - * platform_util.c. - * - * gmtime() is not a thread-safe function as defined in the C standard. The - * library will try to use safer implementations of this function, such as - * gmtime_r() when available. However, if Mbed TLS cannot identify the target - * system, the implementation of mbedtls_platform_gmtime_r() will default to - * using the standard gmtime(). In this case, calls from the library to - * gmtime() will be guarded by the global mutex mbedtls_threading_gmtime_mutex - * if MBEDTLS_THREADING_C is enabled. We recommend that calls from outside the - * library are also guarded with this mutex to avoid race conditions. However, - * if the macro MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, Mbed TLS will - * unconditionally use the implementation for mbedtls_platform_gmtime_r() - * supplied at compile time. - */ -//#define MBEDTLS_PLATFORM_GMTIME_R_ALT - -/** - * Enable the verified implementations of ECDH primitives from Project Everest - * (currently only Curve25519). This feature changes the layout of ECDH - * contexts and therefore is a compatibility break for applications that access - * fields of a mbedtls_ecdh_context structure directly. See also - * MBEDTLS_ECDH_LEGACY_CONTEXT in include/mbedtls/ecdh.h. - */ -//#define MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED - -/* \} name SECTION: Customisation configuration options */ - -/* Target and application specific configurations - * - * Allow user to override any previous default. - * - */ -#if defined(MBEDTLS_USER_CONFIG_FILE) -#include MBEDTLS_USER_CONFIG_FILE -#endif - - -/* - * Nordic added. 256 bit defines for vanilla mbed TLS - */ -#define MBEDTLS_CIPHER_AES_256_ECB_C -/* #undef MBEDTLS_CIPHER_AES_256_CBC_C */ -/* #undef MBEDTLS_CIPHER_AES_256_CTR_C */ -#define MBEDTLS_CIPHER_AES_256_CCM_C -/* #undef MBEDTLS_CIPHER_AES_256_CFB_C */ -/* #undef MBEDTLS_CIPHER_AES_256_OFB_C */ - - -/* - * Nordic added. Defines for features not supported in HW - * on non-glued functionality. - */ -#define MBEDTLS_AES_256_CMAC_C - -/* - * Nordic added. Ensure there is a definition of mbedtls_ecp_restart_ctx - */ -#if defined(MBEDTLS_ECP_ALT) && !defined(MBEDTLS_ECP_RESTARTABLE) -typedef void mbedtls_ecp_restart_ctx; -#endif - - - -#include "mbedtls/check_config.h" - -#if defined(MBEDTLS_NRF_CONFIG_FILE) -#include MBEDTLS_NRF_CONFIG_FILE -#endif - -#endif /* MBEDTLS_CONFIG_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aes.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aes.h deleted file mode 100644 index 151affdb2..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aes.h +++ /dev/null @@ -1,675 +0,0 @@ -/** - * \file aes.h - * - * \brief This file contains AES definitions and functions. - * - * The Advanced Encryption Standard (AES) specifies a FIPS-approved - * cryptographic algorithm that can be used to protect electronic - * data. - * - * The AES algorithm is a symmetric block cipher that can - * encrypt and decrypt information. For more information, see - * FIPS Publication 197: Advanced Encryption Standard and - * ISO/IEC 18033-2:2006: Information technology -- Security - * techniques -- Encryption algorithms -- Part 2: Asymmetric - * ciphers. - * - * The AES-XTS block mode is standardized by NIST SP 800-38E - * - * and described in detail by IEEE P1619 - * . - */ - -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_AES_H -#define MBEDTLS_AES_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -/* padlock.c and aesni.c rely on these values! */ -#define MBEDTLS_AES_ENCRYPT 1 /**< AES encryption. */ -#define MBEDTLS_AES_DECRYPT 0 /**< AES decryption. */ - -/* Error codes in range 0x0020-0x0022 */ -#define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020 /**< Invalid key length. */ -#define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022 /**< Invalid data input length. */ - -/* Error codes in range 0x0021-0x0025 */ -#define MBEDTLS_ERR_AES_BAD_INPUT_DATA -0x0021 /**< Invalid input data. */ - -/* MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE is deprecated and should not be used. */ -#define MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE -0x0023 /**< Feature not available. For example, an unsupported AES key size. */ - -/* MBEDTLS_ERR_AES_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_AES_HW_ACCEL_FAILED -0x0025 /**< AES hardware accelerator failed. */ - -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_AES_ALT) -// Regular implementation -// - -/** - * \brief The AES context-type definition. - */ -typedef struct mbedtls_aes_context -{ - int nr; /*!< The number of rounds. */ - uint32_t *rk; /*!< AES round keys. */ - uint32_t buf[68]; /*!< Unaligned data buffer. This buffer can - hold 32 extra Bytes, which can be used for - one of the following purposes: -
  • Alignment if VIA padlock is - used.
  • -
  • Simplifying key expansion in the 256-bit - case by generating an extra round key. -
*/ -} -mbedtls_aes_context; - -#if defined(MBEDTLS_CIPHER_MODE_XTS) -/** - * \brief The AES XTS context-type definition. - */ -typedef struct mbedtls_aes_xts_context -{ - mbedtls_aes_context crypt; /*!< The AES context to use for AES block - encryption or decryption. */ - mbedtls_aes_context tweak; /*!< The AES context used for tweak - computation. */ -} mbedtls_aes_xts_context; -#endif /* MBEDTLS_CIPHER_MODE_XTS */ - -#else /* MBEDTLS_AES_ALT */ -#include "aes_alt.h" -#endif /* MBEDTLS_AES_ALT */ - -/** - * \brief This function initializes the specified AES context. - * - * It must be the first API called before using - * the context. - * - * \param ctx The AES context to initialize. This must not be \c NULL. - */ -void mbedtls_aes_init( mbedtls_aes_context *ctx ); - -/** - * \brief This function releases and clears the specified AES context. - * - * \param ctx The AES context to clear. - * If this is \c NULL, this function does nothing. - * Otherwise, the context must have been at least initialized. - */ -void mbedtls_aes_free( mbedtls_aes_context *ctx ); - -#if defined(MBEDTLS_CIPHER_MODE_XTS) -/** - * \brief This function initializes the specified AES XTS context. - * - * It must be the first API called before using - * the context. - * - * \param ctx The AES XTS context to initialize. This must not be \c NULL. - */ -void mbedtls_aes_xts_init( mbedtls_aes_xts_context *ctx ); - -/** - * \brief This function releases and clears the specified AES XTS context. - * - * \param ctx The AES XTS context to clear. - * If this is \c NULL, this function does nothing. - * Otherwise, the context must have been at least initialized. - */ -void mbedtls_aes_xts_free( mbedtls_aes_xts_context *ctx ); -#endif /* MBEDTLS_CIPHER_MODE_XTS */ - -/** - * \brief This function sets the encryption key. - * - * \param ctx The AES context to which the key should be bound. - * It must be initialized. - * \param key The encryption key. - * This must be a readable buffer of size \p keybits bits. - * \param keybits The size of data passed in bits. Valid options are: - *
  • 128 bits
  • - *
  • 192 bits
  • - *
  • 256 bits
- * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. - */ -int mbedtls_aes_setkey_enc( mbedtls_aes_context *ctx, const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function sets the decryption key. - * - * \param ctx The AES context to which the key should be bound. - * It must be initialized. - * \param key The decryption key. - * This must be a readable buffer of size \p keybits bits. - * \param keybits The size of data passed. Valid options are: - *
  • 128 bits
  • - *
  • 192 bits
  • - *
  • 256 bits
- * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. - */ -int mbedtls_aes_setkey_dec( mbedtls_aes_context *ctx, const unsigned char *key, - unsigned int keybits ); - -#if defined(MBEDTLS_CIPHER_MODE_XTS) -/** - * \brief This function prepares an XTS context for encryption and - * sets the encryption key. - * - * \param ctx The AES XTS context to which the key should be bound. - * It must be initialized. - * \param key The encryption key. This is comprised of the XTS key1 - * concatenated with the XTS key2. - * This must be a readable buffer of size \p keybits bits. - * \param keybits The size of \p key passed in bits. Valid options are: - *
  • 256 bits (each of key1 and key2 is a 128-bit key)
  • - *
  • 512 bits (each of key1 and key2 is a 256-bit key)
- * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. - */ -int mbedtls_aes_xts_setkey_enc( mbedtls_aes_xts_context *ctx, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function prepares an XTS context for decryption and - * sets the decryption key. - * - * \param ctx The AES XTS context to which the key should be bound. - * It must be initialized. - * \param key The decryption key. This is comprised of the XTS key1 - * concatenated with the XTS key2. - * This must be a readable buffer of size \p keybits bits. - * \param keybits The size of \p key passed in bits. Valid options are: - *
  • 256 bits (each of key1 and key2 is a 128-bit key)
  • - *
  • 512 bits (each of key1 and key2 is a 256-bit key)
- * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure. - */ -int mbedtls_aes_xts_setkey_dec( mbedtls_aes_xts_context *ctx, - const unsigned char *key, - unsigned int keybits ); -#endif /* MBEDTLS_CIPHER_MODE_XTS */ - -/** - * \brief This function performs an AES single-block encryption or - * decryption operation. - * - * It performs the operation defined in the \p mode parameter - * (encrypt or decrypt), on the input data buffer defined in - * the \p input parameter. - * - * mbedtls_aes_init(), and either mbedtls_aes_setkey_enc() or - * mbedtls_aes_setkey_dec() must be called before the first - * call to this API with the same context. - * - * \param ctx The AES context to use for encryption or decryption. - * It must be initialized and bound to a key. - * \param mode The AES operation: #MBEDTLS_AES_ENCRYPT or - * #MBEDTLS_AES_DECRYPT. - * \param input The buffer holding the input data. - * It must be readable and at least \c 16 Bytes long. - * \param output The buffer where the output data will be written. - * It must be writeable and at least \c 16 Bytes long. - - * \return \c 0 on success. - */ -int mbedtls_aes_crypt_ecb( mbedtls_aes_context *ctx, - int mode, - const unsigned char input[16], - unsigned char output[16] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief This function performs an AES-CBC encryption or decryption operation - * on full blocks. - * - * It performs the operation defined in the \p mode - * parameter (encrypt/decrypt), on the input data buffer defined in - * the \p input parameter. - * - * It can be called as many times as needed, until all the input - * data is processed. mbedtls_aes_init(), and either - * mbedtls_aes_setkey_enc() or mbedtls_aes_setkey_dec() must be called - * before the first call to this API with the same context. - * - * \note This function operates on full blocks, that is, the input size - * must be a multiple of the AES block size of \c 16 Bytes. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the same function again on the next - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If you need to retain the contents of the IV, you should - * either save it manually or use the cipher module instead. - * - * - * \param ctx The AES context to use for encryption or decryption. - * It must be initialized and bound to a key. - * \param mode The AES operation: #MBEDTLS_AES_ENCRYPT or - * #MBEDTLS_AES_DECRYPT. - * \param length The length of the input data in Bytes. This must be a - * multiple of the block size (\c 16 Bytes). - * \param iv Initialization vector (updated after use). - * It must be a readable and writeable buffer of \c 16 Bytes. - * \param input The buffer holding the input data. - * It must be readable and of size \p length Bytes. - * \param output The buffer holding the output data. - * It must be writeable and of size \p length Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH - * on failure. - */ -int mbedtls_aes_crypt_cbc( mbedtls_aes_context *ctx, - int mode, - size_t length, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -#if defined(MBEDTLS_CIPHER_MODE_XTS) -/** - * \brief This function performs an AES-XTS encryption or decryption - * operation for an entire XTS data unit. - * - * AES-XTS encrypts or decrypts blocks based on their location as - * defined by a data unit number. The data unit number must be - * provided by \p data_unit. - * - * NIST SP 800-38E limits the maximum size of a data unit to 2^20 - * AES blocks. If the data unit is larger than this, this function - * returns #MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH. - * - * \param ctx The AES XTS context to use for AES XTS operations. - * It must be initialized and bound to a key. - * \param mode The AES operation: #MBEDTLS_AES_ENCRYPT or - * #MBEDTLS_AES_DECRYPT. - * \param length The length of a data unit in Bytes. This can be any - * length between 16 bytes and 2^24 bytes inclusive - * (between 1 and 2^20 block cipher blocks). - * \param data_unit The address of the data unit encoded as an array of 16 - * bytes in little-endian format. For disk encryption, this - * is typically the index of the block device sector that - * contains the data. - * \param input The buffer holding the input data (which is an entire - * data unit). This function reads \p length Bytes from \p - * input. - * \param output The buffer holding the output data (which is an entire - * data unit). This function writes \p length Bytes to \p - * output. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH if \p length is - * smaller than an AES block in size (16 Bytes) or if \p - * length is larger than 2^20 blocks (16 MiB). - */ -int mbedtls_aes_crypt_xts( mbedtls_aes_xts_context *ctx, - int mode, - size_t length, - const unsigned char data_unit[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_XTS */ - -#if defined(MBEDTLS_CIPHER_MODE_CFB) -/** - * \brief This function performs an AES-CFB128 encryption or decryption - * operation. - * - * It performs the operation defined in the \p mode - * parameter (encrypt or decrypt), on the input data buffer - * defined in the \p input parameter. - * - * For CFB, you must set up the context with mbedtls_aes_setkey_enc(), - * regardless of whether you are performing an encryption or decryption - * operation, that is, regardless of the \p mode parameter. This is - * because CFB mode uses the same key schedule for encryption and - * decryption. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the same function again on the next - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If you need to retain the contents of the - * IV, you must either save it manually or use the cipher - * module instead. - * - * - * \param ctx The AES context to use for encryption or decryption. - * It must be initialized and bound to a key. - * \param mode The AES operation: #MBEDTLS_AES_ENCRYPT or - * #MBEDTLS_AES_DECRYPT. - * \param length The length of the input data in Bytes. - * \param iv_off The offset in IV (updated after use). - * It must point to a valid \c size_t. - * \param iv The initialization vector (updated after use). - * It must be a readable and writeable buffer of \c 16 Bytes. - * \param input The buffer holding the input data. - * It must be readable and of size \p length Bytes. - * \param output The buffer holding the output data. - * It must be writeable and of size \p length Bytes. - * - * \return \c 0 on success. - */ -int mbedtls_aes_crypt_cfb128( mbedtls_aes_context *ctx, - int mode, - size_t length, - size_t *iv_off, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function performs an AES-CFB8 encryption or decryption - * operation. - * - * It performs the operation defined in the \p mode - * parameter (encrypt/decrypt), on the input data buffer defined - * in the \p input parameter. - * - * Due to the nature of CFB, you must use the same key schedule for - * both encryption and decryption operations. Therefore, you must - * use the context initialized with mbedtls_aes_setkey_enc() for - * both #MBEDTLS_AES_ENCRYPT and #MBEDTLS_AES_DECRYPT. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the same function again on the next - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * - * \param ctx The AES context to use for encryption or decryption. - * It must be initialized and bound to a key. - * \param mode The AES operation: #MBEDTLS_AES_ENCRYPT or - * #MBEDTLS_AES_DECRYPT - * \param length The length of the input data. - * \param iv The initialization vector (updated after use). - * It must be a readable and writeable buffer of \c 16 Bytes. - * \param input The buffer holding the input data. - * It must be readable and of size \p length Bytes. - * \param output The buffer holding the output data. - * It must be writeable and of size \p length Bytes. - * - * \return \c 0 on success. - */ -int mbedtls_aes_crypt_cfb8( mbedtls_aes_context *ctx, - int mode, - size_t length, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); -#endif /*MBEDTLS_CIPHER_MODE_CFB */ - -#if defined(MBEDTLS_CIPHER_MODE_OFB) -/** - * \brief This function performs an AES-OFB (Output Feedback Mode) - * encryption or decryption operation. - * - * For OFB, you must set up the context with - * mbedtls_aes_setkey_enc(), regardless of whether you are - * performing an encryption or decryption operation. This is - * because OFB mode uses the same key schedule for encryption and - * decryption. - * - * The OFB operation is identical for encryption or decryption, - * therefore no operation mode needs to be specified. - * - * \note Upon exit, the content of iv, the Initialisation Vector, is - * updated so that you can call the same function again on the next - * block(s) of data and get the same result as if it was encrypted - * in one call. This allows a "streaming" usage, by initialising - * iv_off to 0 before the first call, and preserving its value - * between calls. - * - * For non-streaming use, the iv should be initialised on each call - * to a unique value, and iv_off set to 0 on each call. - * - * If you need to retain the contents of the initialisation vector, - * you must either save it manually or use the cipher module - * instead. - * - * \warning For the OFB mode, the initialisation vector must be unique - * every encryption operation. Reuse of an initialisation vector - * will compromise security. - * - * \param ctx The AES context to use for encryption or decryption. - * It must be initialized and bound to a key. - * \param length The length of the input data. - * \param iv_off The offset in IV (updated after use). - * It must point to a valid \c size_t. - * \param iv The initialization vector (updated after use). - * It must be a readable and writeable buffer of \c 16 Bytes. - * \param input The buffer holding the input data. - * It must be readable and of size \p length Bytes. - * \param output The buffer holding the output data. - * It must be writeable and of size \p length Bytes. - * - * \return \c 0 on success. - */ -int mbedtls_aes_crypt_ofb( mbedtls_aes_context *ctx, - size_t length, - size_t *iv_off, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); - -#endif /* MBEDTLS_CIPHER_MODE_OFB */ - -#if defined(MBEDTLS_CIPHER_MODE_CTR) -/** - * \brief This function performs an AES-CTR encryption or decryption - * operation. - * - * This function performs the operation defined in the \p mode - * parameter (encrypt/decrypt), on the input data buffer - * defined in the \p input parameter. - * - * Due to the nature of CTR, you must use the same key schedule - * for both encryption and decryption operations. Therefore, you - * must use the context initialized with mbedtls_aes_setkey_enc() - * for both #MBEDTLS_AES_ENCRYPT and #MBEDTLS_AES_DECRYPT. - * - * \warning You must never reuse a nonce value with the same key. Doing so - * would void the encryption for the two messages encrypted with - * the same nonce and key. - * - * There are two common strategies for managing nonces with CTR: - * - * 1. You can handle everything as a single message processed over - * successive calls to this function. In that case, you want to - * set \p nonce_counter and \p nc_off to 0 for the first call, and - * then preserve the values of \p nonce_counter, \p nc_off and \p - * stream_block across calls to this function as they will be - * updated by this function. - * - * With this strategy, you must not encrypt more than 2**128 - * blocks of data with the same key. - * - * 2. You can encrypt separate messages by dividing the \p - * nonce_counter buffer in two areas: the first one used for a - * per-message nonce, handled by yourself, and the second one - * updated by this function internally. - * - * For example, you might reserve the first 12 bytes for the - * per-message nonce, and the last 4 bytes for internal use. In that - * case, before calling this function on a new message you need to - * set the first 12 bytes of \p nonce_counter to your chosen nonce - * value, the last 4 to 0, and \p nc_off to 0 (which will cause \p - * stream_block to be ignored). That way, you can encrypt at most - * 2**96 messages of up to 2**32 blocks each with the same key. - * - * The per-message nonce (or information sufficient to reconstruct - * it) needs to be communicated with the ciphertext and must be unique. - * The recommended way to ensure uniqueness is to use a message - * counter. An alternative is to generate random nonces, but this - * limits the number of messages that can be securely encrypted: - * for example, with 96-bit random nonces, you should not encrypt - * more than 2**32 messages with the same key. - * - * Note that for both stategies, sizes are measured in blocks and - * that an AES block is 16 bytes. - * - * \warning Upon return, \p stream_block contains sensitive data. Its - * content must not be written to insecure storage and should be - * securely discarded as soon as it's no longer needed. - * - * \param ctx The AES context to use for encryption or decryption. - * It must be initialized and bound to a key. - * \param length The length of the input data. - * \param nc_off The offset in the current \p stream_block, for - * resuming within the current cipher stream. The - * offset pointer should be 0 at the start of a stream. - * It must point to a valid \c size_t. - * \param nonce_counter The 128-bit nonce and counter. - * It must be a readable-writeable buffer of \c 16 Bytes. - * \param stream_block The saved stream block for resuming. This is - * overwritten by the function. - * It must be a readable-writeable buffer of \c 16 Bytes. - * \param input The buffer holding the input data. - * It must be readable and of size \p length Bytes. - * \param output The buffer holding the output data. - * It must be writeable and of size \p length Bytes. - * - * \return \c 0 on success. - */ -int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx, - size_t length, - size_t *nc_off, - unsigned char nonce_counter[16], - unsigned char stream_block[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CTR */ - -/** - * \brief Internal AES block encryption function. This is only - * exposed to allow overriding it using - * \c MBEDTLS_AES_ENCRYPT_ALT. - * - * \param ctx The AES context to use for encryption. - * \param input The plaintext block. - * \param output The output (ciphertext) block. - * - * \return \c 0 on success. - */ -int mbedtls_internal_aes_encrypt( mbedtls_aes_context *ctx, - const unsigned char input[16], - unsigned char output[16] ); - -/** - * \brief Internal AES block decryption function. This is only - * exposed to allow overriding it using see - * \c MBEDTLS_AES_DECRYPT_ALT. - * - * \param ctx The AES context to use for decryption. - * \param input The ciphertext block. - * \param output The output (plaintext) block. - * - * \return \c 0 on success. - */ -int mbedtls_internal_aes_decrypt( mbedtls_aes_context *ctx, - const unsigned char input[16], - unsigned char output[16] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Deprecated internal AES block encryption function - * without return value. - * - * \deprecated Superseded by mbedtls_internal_aes_encrypt() - * - * \param ctx The AES context to use for encryption. - * \param input Plaintext block. - * \param output Output (ciphertext) block. - */ -MBEDTLS_DEPRECATED void mbedtls_aes_encrypt( mbedtls_aes_context *ctx, - const unsigned char input[16], - unsigned char output[16] ); - -/** - * \brief Deprecated internal AES block decryption function - * without return value. - * - * \deprecated Superseded by mbedtls_internal_aes_decrypt() - * - * \param ctx The AES context to use for decryption. - * \param input Ciphertext block. - * \param output Output (plaintext) block. - */ -MBEDTLS_DEPRECATED void mbedtls_aes_decrypt( mbedtls_aes_context *ctx, - const unsigned char input[16], - unsigned char output[16] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_aes_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* aes.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aesni.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aesni.h deleted file mode 100644 index 955b7c990..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aesni.h +++ /dev/null @@ -1,138 +0,0 @@ -/** - * \file aesni.h - * - * \brief AES-NI for hardware AES acceleration on some Intel processors - * - * \warning These functions are only for internal use by other library - * functions; you must not call them directly. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_AESNI_H -#define MBEDTLS_AESNI_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/aes.h" - -#define MBEDTLS_AESNI_AES 0x02000000u -#define MBEDTLS_AESNI_CLMUL 0x00000002u - -#if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && \ - ( defined(__amd64__) || defined(__x86_64__) ) && \ - ! defined(MBEDTLS_HAVE_X86_64) -#define MBEDTLS_HAVE_X86_64 -#endif - -#if defined(MBEDTLS_HAVE_X86_64) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Internal function to detect the AES-NI feature in CPUs. - * - * \note This function is only for internal use by other library - * functions; you must not call it directly. - * - * \param what The feature to detect - * (MBEDTLS_AESNI_AES or MBEDTLS_AESNI_CLMUL) - * - * \return 1 if CPU has support for the feature, 0 otherwise - */ -int mbedtls_aesni_has_support( unsigned int what ); - -/** - * \brief Internal AES-NI AES-ECB block encryption and decryption - * - * \note This function is only for internal use by other library - * functions; you must not call it directly. - * - * \param ctx AES context - * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT - * \param input 16-byte input block - * \param output 16-byte output block - * - * \return 0 on success (cannot fail) - */ -int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx, - int mode, - const unsigned char input[16], - unsigned char output[16] ); - -/** - * \brief Internal GCM multiplication: c = a * b in GF(2^128) - * - * \note This function is only for internal use by other library - * functions; you must not call it directly. - * - * \param c Result - * \param a First operand - * \param b Second operand - * - * \note Both operands and result are bit strings interpreted as - * elements of GF(2^128) as per the GCM spec. - */ -void mbedtls_aesni_gcm_mult( unsigned char c[16], - const unsigned char a[16], - const unsigned char b[16] ); - -/** - * \brief Internal round key inversion. This function computes - * decryption round keys from the encryption round keys. - * - * \note This function is only for internal use by other library - * functions; you must not call it directly. - * - * \param invkey Round keys for the equivalent inverse cipher - * \param fwdkey Original round keys (for encryption) - * \param nr Number of rounds (that is, number of round keys minus one) - */ -void mbedtls_aesni_inverse_key( unsigned char *invkey, - const unsigned char *fwdkey, - int nr ); - -/** - * \brief Internal key expansion for encryption - * - * \note This function is only for internal use by other library - * functions; you must not call it directly. - * - * \param rk Destination buffer where the round keys are written - * \param key Encryption key - * \param bits Key size in bits (must be 128, 192 or 256) - * - * \return 0 if successful, or MBEDTLS_ERR_AES_INVALID_KEY_LENGTH - */ -int mbedtls_aesni_setkey_enc( unsigned char *rk, - const unsigned char *key, - size_t bits ); - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_HAVE_X86_64 */ - -#endif /* MBEDTLS_AESNI_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/arc4.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/arc4.h deleted file mode 100644 index acad623ad..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/arc4.h +++ /dev/null @@ -1,146 +0,0 @@ -/** - * \file arc4.h - * - * \brief The ARCFOUR stream cipher - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - */ -#ifndef MBEDTLS_ARC4_H -#define MBEDTLS_ARC4_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -/* MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019 /**< ARC4 hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_ARC4_ALT) -// Regular implementation -// - -/** - * \brief ARC4 context structure - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - * - */ -typedef struct mbedtls_arc4_context -{ - int x; /*!< permutation index */ - int y; /*!< permutation index */ - unsigned char m[256]; /*!< permutation table */ -} -mbedtls_arc4_context; - -#else /* MBEDTLS_ARC4_ALT */ -#include "arc4_alt.h" -#endif /* MBEDTLS_ARC4_ALT */ - -/** - * \brief Initialize ARC4 context - * - * \param ctx ARC4 context to be initialized - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - * - */ -void mbedtls_arc4_init( mbedtls_arc4_context *ctx ); - -/** - * \brief Clear ARC4 context - * - * \param ctx ARC4 context to be cleared - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - * - */ -void mbedtls_arc4_free( mbedtls_arc4_context *ctx ); - -/** - * \brief ARC4 key schedule - * - * \param ctx ARC4 context to be setup - * \param key the secret key - * \param keylen length of the key, in bytes - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - * - */ -void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key, - unsigned int keylen ); - -/** - * \brief ARC4 cipher function - * - * \param ctx ARC4 context - * \param length length of the input data - * \param input buffer holding the input data - * \param output buffer for the output data - * - * \return 0 if successful - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - * - */ -int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input, - unsigned char *output ); - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - * - */ -int mbedtls_arc4_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* arc4.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aria.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aria.h deleted file mode 100644 index f99e76fb6..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/aria.h +++ /dev/null @@ -1,371 +0,0 @@ -/** - * \file aria.h - * - * \brief ARIA block cipher - * - * The ARIA algorithm is a symmetric block cipher that can encrypt and - * decrypt information. It is defined by the Korean Agency for - * Technology and Standards (KATS) in KS X 1213:2004 (in - * Korean, but see http://210.104.33.10/ARIA/index-e.html in English) - * and also described by the IETF in RFC 5794. - */ -/* - * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_ARIA_H -#define MBEDTLS_ARIA_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#include "mbedtls/platform_util.h" - -#define MBEDTLS_ARIA_ENCRYPT 1 /**< ARIA encryption. */ -#define MBEDTLS_ARIA_DECRYPT 0 /**< ARIA decryption. */ - -#define MBEDTLS_ARIA_BLOCKSIZE 16 /**< ARIA block size in bytes. */ -#define MBEDTLS_ARIA_MAX_ROUNDS 16 /**< Maxiumum number of rounds in ARIA. */ -#define MBEDTLS_ARIA_MAX_KEYSIZE 32 /**< Maximum size of an ARIA key in bytes. */ - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#define MBEDTLS_ERR_ARIA_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -0x005C ) -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ -#define MBEDTLS_ERR_ARIA_BAD_INPUT_DATA -0x005C /**< Bad input data. */ - -#define MBEDTLS_ERR_ARIA_INVALID_INPUT_LENGTH -0x005E /**< Invalid data input length. */ - -/* MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE is deprecated and should not be used. - */ -#define MBEDTLS_ERR_ARIA_FEATURE_UNAVAILABLE -0x005A /**< Feature not available. For example, an unsupported ARIA key size. */ - -/* MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_ARIA_HW_ACCEL_FAILED -0x0058 /**< ARIA hardware accelerator failed. */ - -#if !defined(MBEDTLS_ARIA_ALT) -// Regular implementation -// - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The ARIA context-type definition. - */ -typedef struct mbedtls_aria_context -{ - unsigned char nr; /*!< The number of rounds (12, 14 or 16) */ - /*! The ARIA round keys. */ - uint32_t rk[MBEDTLS_ARIA_MAX_ROUNDS + 1][MBEDTLS_ARIA_BLOCKSIZE / 4]; -} -mbedtls_aria_context; - -#else /* MBEDTLS_ARIA_ALT */ -#include "aria_alt.h" -#endif /* MBEDTLS_ARIA_ALT */ - -/** - * \brief This function initializes the specified ARIA context. - * - * It must be the first API called before using - * the context. - * - * \param ctx The ARIA context to initialize. This must not be \c NULL. - */ -void mbedtls_aria_init( mbedtls_aria_context *ctx ); - -/** - * \brief This function releases and clears the specified ARIA context. - * - * \param ctx The ARIA context to clear. This may be \c NULL, in which - * case this function returns immediately. If it is not \c NULL, - * it must point to an initialized ARIA context. - */ -void mbedtls_aria_free( mbedtls_aria_context *ctx ); - -/** - * \brief This function sets the encryption key. - * - * \param ctx The ARIA context to which the key should be bound. - * This must be initialized. - * \param key The encryption key. This must be a readable buffer - * of size \p keybits Bits. - * \param keybits The size of \p key in Bits. Valid options are: - *
  • 128 bits
  • - *
  • 192 bits
  • - *
  • 256 bits
- * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_aria_setkey_enc( mbedtls_aria_context *ctx, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function sets the decryption key. - * - * \param ctx The ARIA context to which the key should be bound. - * This must be initialized. - * \param key The decryption key. This must be a readable buffer - * of size \p keybits Bits. - * \param keybits The size of data passed. Valid options are: - *
  • 128 bits
  • - *
  • 192 bits
  • - *
  • 256 bits
- * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_aria_setkey_dec( mbedtls_aria_context *ctx, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function performs an ARIA single-block encryption or - * decryption operation. - * - * It performs encryption or decryption (depending on whether - * the key was set for encryption on decryption) on the input - * data buffer defined in the \p input parameter. - * - * mbedtls_aria_init(), and either mbedtls_aria_setkey_enc() or - * mbedtls_aria_setkey_dec() must be called before the first - * call to this API with the same context. - * - * \param ctx The ARIA context to use for encryption or decryption. - * This must be initialized and bound to a key. - * \param input The 16-Byte buffer holding the input data. - * \param output The 16-Byte buffer holding the output data. - - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_aria_crypt_ecb( mbedtls_aria_context *ctx, - const unsigned char input[MBEDTLS_ARIA_BLOCKSIZE], - unsigned char output[MBEDTLS_ARIA_BLOCKSIZE] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief This function performs an ARIA-CBC encryption or decryption operation - * on full blocks. - * - * It performs the operation defined in the \p mode - * parameter (encrypt/decrypt), on the input data buffer defined in - * the \p input parameter. - * - * It can be called as many times as needed, until all the input - * data is processed. mbedtls_aria_init(), and either - * mbedtls_aria_setkey_enc() or mbedtls_aria_setkey_dec() must be called - * before the first call to this API with the same context. - * - * \note This function operates on aligned blocks, that is, the input size - * must be a multiple of the ARIA block size of 16 Bytes. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the same function again on the next - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If you need to retain the contents of the IV, you should - * either save it manually or use the cipher module instead. - * - * - * \param ctx The ARIA context to use for encryption or decryption. - * This must be initialized and bound to a key. - * \param mode The mode of operation. This must be either - * #MBEDTLS_ARIA_ENCRYPT for encryption, or - * #MBEDTLS_ARIA_DECRYPT for decryption. - * \param length The length of the input data in Bytes. This must be a - * multiple of the block size (16 Bytes). - * \param iv Initialization vector (updated after use). - * This must be a readable buffer of size 16 Bytes. - * \param input The buffer holding the input data. This must - * be a readable buffer of length \p length Bytes. - * \param output The buffer holding the output data. This must - * be a writable buffer of length \p length Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_aria_crypt_cbc( mbedtls_aria_context *ctx, - int mode, - size_t length, - unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -#if defined(MBEDTLS_CIPHER_MODE_CFB) -/** - * \brief This function performs an ARIA-CFB128 encryption or decryption - * operation. - * - * It performs the operation defined in the \p mode - * parameter (encrypt or decrypt), on the input data buffer - * defined in the \p input parameter. - * - * For CFB, you must set up the context with mbedtls_aria_setkey_enc(), - * regardless of whether you are performing an encryption or decryption - * operation, that is, regardless of the \p mode parameter. This is - * because CFB mode uses the same key schedule for encryption and - * decryption. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the same function again on the next - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If you need to retain the contents of the - * IV, you must either save it manually or use the cipher - * module instead. - * - * - * \param ctx The ARIA context to use for encryption or decryption. - * This must be initialized and bound to a key. - * \param mode The mode of operation. This must be either - * #MBEDTLS_ARIA_ENCRYPT for encryption, or - * #MBEDTLS_ARIA_DECRYPT for decryption. - * \param length The length of the input data \p input in Bytes. - * \param iv_off The offset in IV (updated after use). - * This must not be larger than 15. - * \param iv The initialization vector (updated after use). - * This must be a readable buffer of size 16 Bytes. - * \param input The buffer holding the input data. This must - * be a readable buffer of length \p length Bytes. - * \param output The buffer holding the output data. This must - * be a writable buffer of length \p length Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_aria_crypt_cfb128( mbedtls_aria_context *ctx, - int mode, - size_t length, - size_t *iv_off, - unsigned char iv[MBEDTLS_ARIA_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CFB */ - -#if defined(MBEDTLS_CIPHER_MODE_CTR) -/** - * \brief This function performs an ARIA-CTR encryption or decryption - * operation. - * - * This function performs the operation defined in the \p mode - * parameter (encrypt/decrypt), on the input data buffer - * defined in the \p input parameter. - * - * Due to the nature of CTR, you must use the same key schedule - * for both encryption and decryption operations. Therefore, you - * must use the context initialized with mbedtls_aria_setkey_enc() - * for both #MBEDTLS_ARIA_ENCRYPT and #MBEDTLS_ARIA_DECRYPT. - * - * \warning You must never reuse a nonce value with the same key. Doing so - * would void the encryption for the two messages encrypted with - * the same nonce and key. - * - * There are two common strategies for managing nonces with CTR: - * - * 1. You can handle everything as a single message processed over - * successive calls to this function. In that case, you want to - * set \p nonce_counter and \p nc_off to 0 for the first call, and - * then preserve the values of \p nonce_counter, \p nc_off and \p - * stream_block across calls to this function as they will be - * updated by this function. - * - * With this strategy, you must not encrypt more than 2**128 - * blocks of data with the same key. - * - * 2. You can encrypt separate messages by dividing the \p - * nonce_counter buffer in two areas: the first one used for a - * per-message nonce, handled by yourself, and the second one - * updated by this function internally. - * - * For example, you might reserve the first 12 bytes for the - * per-message nonce, and the last 4 bytes for internal use. In that - * case, before calling this function on a new message you need to - * set the first 12 bytes of \p nonce_counter to your chosen nonce - * value, the last 4 to 0, and \p nc_off to 0 (which will cause \p - * stream_block to be ignored). That way, you can encrypt at most - * 2**96 messages of up to 2**32 blocks each with the same key. - * - * The per-message nonce (or information sufficient to reconstruct - * it) needs to be communicated with the ciphertext and must be unique. - * The recommended way to ensure uniqueness is to use a message - * counter. An alternative is to generate random nonces, but this - * limits the number of messages that can be securely encrypted: - * for example, with 96-bit random nonces, you should not encrypt - * more than 2**32 messages with the same key. - * - * Note that for both stategies, sizes are measured in blocks and - * that an ARIA block is 16 bytes. - * - * \warning Upon return, \p stream_block contains sensitive data. Its - * content must not be written to insecure storage and should be - * securely discarded as soon as it's no longer needed. - * - * \param ctx The ARIA context to use for encryption or decryption. - * This must be initialized and bound to a key. - * \param length The length of the input data \p input in Bytes. - * \param nc_off The offset in Bytes in the current \p stream_block, - * for resuming within the current cipher stream. The - * offset pointer should be \c 0 at the start of a - * stream. This must not be larger than \c 15 Bytes. - * \param nonce_counter The 128-bit nonce and counter. This must point to - * a read/write buffer of length \c 16 bytes. - * \param stream_block The saved stream block for resuming. This must - * point to a read/write buffer of length \c 16 bytes. - * This is overwritten by the function. - * \param input The buffer holding the input data. This must - * be a readable buffer of length \p length Bytes. - * \param output The buffer holding the output data. This must - * be a writable buffer of length \p length Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_aria_crypt_ctr( mbedtls_aria_context *ctx, - size_t length, - size_t *nc_off, - unsigned char nonce_counter[MBEDTLS_ARIA_BLOCKSIZE], - unsigned char stream_block[MBEDTLS_ARIA_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CTR */ - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine. - * - * \return \c 0 on success, or \c 1 on failure. - */ -int mbedtls_aria_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* aria.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/asn1.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/asn1.h deleted file mode 100644 index 4c61b6e1c..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/asn1.h +++ /dev/null @@ -1,609 +0,0 @@ -/** - * \file asn1.h - * - * \brief Generic ASN.1 parsing - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ASN1_H -#define MBEDTLS_ASN1_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#if defined(MBEDTLS_BIGNUM_C) -#include "mbedtls/bignum.h" -#endif - -/** - * \addtogroup asn1_module - * \{ - */ - -/** - * \name ASN1 Error codes - * These error codes are OR'ed to X509 error codes for - * higher error granularity. - * ASN1 is a standard to specify data structures. - * \{ - */ -#define MBEDTLS_ERR_ASN1_OUT_OF_DATA -0x0060 /**< Out of data when parsing an ASN1 data structure. */ -#define MBEDTLS_ERR_ASN1_UNEXPECTED_TAG -0x0062 /**< ASN1 tag was of an unexpected value. */ -#define MBEDTLS_ERR_ASN1_INVALID_LENGTH -0x0064 /**< Error when trying to determine the length or invalid length. */ -#define MBEDTLS_ERR_ASN1_LENGTH_MISMATCH -0x0066 /**< Actual length differs from expected length. */ -#define MBEDTLS_ERR_ASN1_INVALID_DATA -0x0068 /**< Data is invalid. */ -#define MBEDTLS_ERR_ASN1_ALLOC_FAILED -0x006A /**< Memory allocation failed */ -#define MBEDTLS_ERR_ASN1_BUF_TOO_SMALL -0x006C /**< Buffer too small when writing ASN.1 data structure. */ - -/* \} name */ - -/** - * \name DER constants - * These constants comply with the DER encoded ASN.1 type tags. - * DER encoding uses hexadecimal representation. - * An example DER sequence is:\n - * - 0x02 -- tag indicating INTEGER - * - 0x01 -- length in octets - * - 0x05 -- value - * Such sequences are typically read into \c ::mbedtls_x509_buf. - * \{ - */ -#define MBEDTLS_ASN1_BOOLEAN 0x01 -#define MBEDTLS_ASN1_INTEGER 0x02 -#define MBEDTLS_ASN1_BIT_STRING 0x03 -#define MBEDTLS_ASN1_OCTET_STRING 0x04 -#define MBEDTLS_ASN1_NULL 0x05 -#define MBEDTLS_ASN1_OID 0x06 -#define MBEDTLS_ASN1_ENUMERATED 0x0A -#define MBEDTLS_ASN1_UTF8_STRING 0x0C -#define MBEDTLS_ASN1_SEQUENCE 0x10 -#define MBEDTLS_ASN1_SET 0x11 -#define MBEDTLS_ASN1_PRINTABLE_STRING 0x13 -#define MBEDTLS_ASN1_T61_STRING 0x14 -#define MBEDTLS_ASN1_IA5_STRING 0x16 -#define MBEDTLS_ASN1_UTC_TIME 0x17 -#define MBEDTLS_ASN1_GENERALIZED_TIME 0x18 -#define MBEDTLS_ASN1_UNIVERSAL_STRING 0x1C -#define MBEDTLS_ASN1_BMP_STRING 0x1E -#define MBEDTLS_ASN1_PRIMITIVE 0x00 -#define MBEDTLS_ASN1_CONSTRUCTED 0x20 -#define MBEDTLS_ASN1_CONTEXT_SPECIFIC 0x80 - -/* Slightly smaller way to check if tag is a string tag - * compared to canonical implementation. */ -#define MBEDTLS_ASN1_IS_STRING_TAG( tag ) \ - ( ( tag ) < 32u && ( \ - ( ( 1u << ( tag ) ) & ( ( 1u << MBEDTLS_ASN1_BMP_STRING ) | \ - ( 1u << MBEDTLS_ASN1_UTF8_STRING ) | \ - ( 1u << MBEDTLS_ASN1_T61_STRING ) | \ - ( 1u << MBEDTLS_ASN1_IA5_STRING ) | \ - ( 1u << MBEDTLS_ASN1_UNIVERSAL_STRING ) | \ - ( 1u << MBEDTLS_ASN1_PRINTABLE_STRING ) | \ - ( 1u << MBEDTLS_ASN1_BIT_STRING ) ) ) != 0 ) ) - -/* - * Bit masks for each of the components of an ASN.1 tag as specified in - * ITU X.690 (08/2015), section 8.1 "General rules for encoding", - * paragraph 8.1.2.2: - * - * Bit 8 7 6 5 1 - * +-------+-----+------------+ - * | Class | P/C | Tag number | - * +-------+-----+------------+ - */ -#define MBEDTLS_ASN1_TAG_CLASS_MASK 0xC0 -#define MBEDTLS_ASN1_TAG_PC_MASK 0x20 -#define MBEDTLS_ASN1_TAG_VALUE_MASK 0x1F - -/* \} name */ -/* \} addtogroup asn1_module */ - -/** Returns the size of the binary string, without the trailing \\0 */ -#define MBEDTLS_OID_SIZE(x) (sizeof(x) - 1) - -/** - * Compares an mbedtls_asn1_buf structure to a reference OID. - * - * Only works for 'defined' oid_str values (MBEDTLS_OID_HMAC_SHA1), you cannot use a - * 'unsigned char *oid' here! - */ -#define MBEDTLS_OID_CMP(oid_str, oid_buf) \ - ( ( MBEDTLS_OID_SIZE(oid_str) != (oid_buf)->len ) || \ - memcmp( (oid_str), (oid_buf)->p, (oid_buf)->len) != 0 ) - -#define MBEDTLS_OID_CMP_RAW(oid_str, oid_buf, oid_buf_len) \ - ( ( MBEDTLS_OID_SIZE(oid_str) != (oid_buf_len) ) || \ - memcmp( (oid_str), (oid_buf), (oid_buf_len) ) != 0 ) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Functions to parse ASN.1 data structures - * \{ - */ - -/** - * Type-length-value structure that allows for ASN1 using DER. - */ -typedef struct mbedtls_asn1_buf -{ - int tag; /**< ASN1 type, e.g. MBEDTLS_ASN1_UTF8_STRING. */ - size_t len; /**< ASN1 length, in octets. */ - unsigned char *p; /**< ASN1 data, e.g. in ASCII. */ -} -mbedtls_asn1_buf; - -/** - * Container for ASN1 bit strings. - */ -typedef struct mbedtls_asn1_bitstring -{ - size_t len; /**< ASN1 length, in octets. */ - unsigned char unused_bits; /**< Number of unused bits at the end of the string */ - unsigned char *p; /**< Raw ASN1 data for the bit string */ -} -mbedtls_asn1_bitstring; - -/** - * Container for a sequence of ASN.1 items - */ -typedef struct mbedtls_asn1_sequence -{ - mbedtls_asn1_buf buf; /**< Buffer containing the given ASN.1 item. */ - struct mbedtls_asn1_sequence *next; /**< The next entry in the sequence. */ -} -mbedtls_asn1_sequence; - -/** - * Container for a sequence or list of 'named' ASN.1 data items - */ -typedef struct mbedtls_asn1_named_data -{ - mbedtls_asn1_buf oid; /**< The object identifier. */ - mbedtls_asn1_buf val; /**< The named value. */ - struct mbedtls_asn1_named_data *next; /**< The next entry in the sequence. */ - unsigned char next_merged; /**< Merge next item into the current one? */ -} -mbedtls_asn1_named_data; - -/** - * \brief Get the length of an ASN.1 element. - * Updates the pointer to immediately behind the length. - * - * \param p On entry, \c *p points to the first byte of the length, - * i.e. immediately after the tag. - * On successful completion, \c *p points to the first byte - * after the length, i.e. the first byte of the content. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param len On successful completion, \c *len contains the length - * read from the ASN.1 input. - * - * \return 0 if successful. - * \return #MBEDTLS_ERR_ASN1_OUT_OF_DATA if the ASN.1 element - * would end beyond \p end. - * \return #MBEDTLS_ERR_ASN1_INVALID_LENGTH if the length is unparseable. - */ -int mbedtls_asn1_get_len( unsigned char **p, - const unsigned char *end, - size_t *len ); - -/** - * \brief Get the tag and length of the element. - * Check for the requested tag. - * Updates the pointer to immediately behind the tag and length. - * - * \param p On entry, \c *p points to the start of the ASN.1 element. - * On successful completion, \c *p points to the first byte - * after the length, i.e. the first byte of the content. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param len On successful completion, \c *len contains the length - * read from the ASN.1 input. - * \param tag The expected tag. - * - * \return 0 if successful. - * \return #MBEDTLS_ERR_ASN1_UNEXPECTED_TAG if the data does not start - * with the requested tag. - * \return #MBEDTLS_ERR_ASN1_OUT_OF_DATA if the ASN.1 element - * would end beyond \p end. - * \return #MBEDTLS_ERR_ASN1_INVALID_LENGTH if the length is unparseable. - */ -int mbedtls_asn1_get_tag( unsigned char **p, - const unsigned char *end, - size_t *len, int tag ); - -/** - * \brief Retrieve a boolean ASN.1 tag and its value. - * Updates the pointer to immediately behind the full tag. - * - * \param p On entry, \c *p points to the start of the ASN.1 element. - * On successful completion, \c *p points to the first byte - * beyond the ASN.1 element. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param val On success, the parsed value (\c 0 or \c 1). - * - * \return 0 if successful. - * \return An ASN.1 error code if the input does not start with - * a valid ASN.1 BOOLEAN. - */ -int mbedtls_asn1_get_bool( unsigned char **p, - const unsigned char *end, - int *val ); - -/** - * \brief Retrieve an integer ASN.1 tag and its value. - * Updates the pointer to immediately behind the full tag. - * - * \param p On entry, \c *p points to the start of the ASN.1 element. - * On successful completion, \c *p points to the first byte - * beyond the ASN.1 element. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param val On success, the parsed value. - * - * \return 0 if successful. - * \return An ASN.1 error code if the input does not start with - * a valid ASN.1 INTEGER. - * \return #MBEDTLS_ERR_ASN1_INVALID_LENGTH if the parsed value does - * not fit in an \c int. - */ -int mbedtls_asn1_get_int( unsigned char **p, - const unsigned char *end, - int *val ); - -/** - * \brief Retrieve an enumerated ASN.1 tag and its value. - * Updates the pointer to immediately behind the full tag. - * - * \param p On entry, \c *p points to the start of the ASN.1 element. - * On successful completion, \c *p points to the first byte - * beyond the ASN.1 element. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param val On success, the parsed value. - * - * \return 0 if successful. - * \return An ASN.1 error code if the input does not start with - * a valid ASN.1 ENUMERATED. - * \return #MBEDTLS_ERR_ASN1_INVALID_LENGTH if the parsed value does - * not fit in an \c int. - */ -int mbedtls_asn1_get_enum( unsigned char **p, - const unsigned char *end, - int *val ); - -/** - * \brief Retrieve a bitstring ASN.1 tag and its value. - * Updates the pointer to immediately behind the full tag. - * - * \param p On entry, \c *p points to the start of the ASN.1 element. - * On successful completion, \c *p is equal to \p end. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param bs On success, ::mbedtls_asn1_bitstring information about - * the parsed value. - * - * \return 0 if successful. - * \return #MBEDTLS_ERR_ASN1_LENGTH_MISMATCH if the input contains - * extra data after a valid BIT STRING. - * \return An ASN.1 error code if the input does not start with - * a valid ASN.1 BIT STRING. - */ -int mbedtls_asn1_get_bitstring( unsigned char **p, const unsigned char *end, - mbedtls_asn1_bitstring *bs ); - -/** - * \brief Retrieve a bitstring ASN.1 tag without unused bits and its - * value. - * Updates the pointer to the beginning of the bit/octet string. - * - * \param p On entry, \c *p points to the start of the ASN.1 element. - * On successful completion, \c *p points to the first byte - * of the content of the BIT STRING. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param len On success, \c *len is the length of the content in bytes. - * - * \return 0 if successful. - * \return #MBEDTLS_ERR_ASN1_INVALID_DATA if the input starts with - * a valid BIT STRING with a nonzero number of unused bits. - * \return An ASN.1 error code if the input does not start with - * a valid ASN.1 BIT STRING. - */ -int mbedtls_asn1_get_bitstring_null( unsigned char **p, - const unsigned char *end, - size_t *len ); - -/** - * \brief Parses and splits an ASN.1 "SEQUENCE OF ". - * Updates the pointer to immediately behind the full sequence tag. - * - * This function allocates memory for the sequence elements. You can free - * the allocated memory with mbedtls_asn1_sequence_free(). - * - * \note On error, this function may return a partial list in \p cur. - * You must set `cur->next = NULL` before calling this function! - * Otherwise it is impossible to distinguish a previously non-null - * pointer from a pointer to an object allocated by this function. - * - * \note If the sequence is empty, this function does not modify - * \c *cur. If the sequence is valid and non-empty, this - * function sets `cur->buf.tag` to \p tag. This allows - * callers to distinguish between an empty sequence and - * a one-element sequence. - * - * \param p On entry, \c *p points to the start of the ASN.1 element. - * On successful completion, \c *p is equal to \p end. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param cur A ::mbedtls_asn1_sequence which this function fills. - * When this function returns, \c *cur is the head of a linked - * list. Each node in this list is allocated with - * mbedtls_calloc() apart from \p cur itself, and should - * therefore be freed with mbedtls_free(). - * The list describes the content of the sequence. - * The head of the list (i.e. \c *cur itself) describes the - * first element, `*cur->next` describes the second element, etc. - * For each element, `buf.tag == tag`, `buf.len` is the length - * of the content of the content of the element, and `buf.p` - * points to the first byte of the content (i.e. immediately - * past the length of the element). - * Note that list elements may be allocated even on error. - * \param tag Each element of the sequence must have this tag. - * - * \return 0 if successful. - * \return #MBEDTLS_ERR_ASN1_LENGTH_MISMATCH if the input contains - * extra data after a valid SEQUENCE OF \p tag. - * \return #MBEDTLS_ERR_ASN1_UNEXPECTED_TAG if the input starts with - * an ASN.1 SEQUENCE in which an element has a tag that - * is different from \p tag. - * \return #MBEDTLS_ERR_ASN1_ALLOC_FAILED if a memory allocation failed. - * \return An ASN.1 error code if the input does not start with - * a valid ASN.1 SEQUENCE. - */ -int mbedtls_asn1_get_sequence_of( unsigned char **p, - const unsigned char *end, - mbedtls_asn1_sequence *cur, - int tag ); -/** - * \brief Free a heap-allocated linked list presentation of - * an ASN.1 sequence, including the first element. - * - * There are two common ways to manage the memory used for the representation - * of a parsed ASN.1 sequence: - * - Allocate a head node `mbedtls_asn1_sequence *head` with mbedtls_calloc(). - * Pass this node as the `cur` argument to mbedtls_asn1_get_sequence_of(). - * When you have finished processing the sequence, - * call mbedtls_asn1_sequence_free() on `head`. - * - Allocate a head node `mbedtls_asn1_sequence *head` in any manner, - * for example on the stack. Make sure that `head->next == NULL`. - * Pass `head` as the `cur` argument to mbedtls_asn1_get_sequence_of(). - * When you have finished processing the sequence, - * call mbedtls_asn1_sequence_free() on `head->cur`, - * then free `head` itself in the appropriate manner. - * - * \param seq The address of the first sequence component. This may - * be \c NULL, in which case this functions returns - * immediately. - */ -void mbedtls_asn1_sequence_free( mbedtls_asn1_sequence *seq ); - -/** - * \brief Traverse an ASN.1 SEQUENCE container and - * call a callback for each entry. - * - * This function checks that the input is a SEQUENCE of elements that - * each have a "must" tag, and calls a callback function on the elements - * that have a "may" tag. - * - * For example, to validate that the input is a SEQUENCE of `tag1` and call - * `cb` on each element, use - * ``` - * mbedtls_asn1_traverse_sequence_of(&p, end, 0xff, tag1, 0, 0, cb, ctx); - * ``` - * - * To validate that the input is a SEQUENCE of ANY and call `cb` on - * each element, use - * ``` - * mbedtls_asn1_traverse_sequence_of(&p, end, 0, 0, 0, 0, cb, ctx); - * ``` - * - * To validate that the input is a SEQUENCE of CHOICE {NULL, OCTET STRING} - * and call `cb` on each element that is an OCTET STRING, use - * ``` - * mbedtls_asn1_traverse_sequence_of(&p, end, 0xfe, 0x04, 0xff, 0x04, cb, ctx); - * ``` - * - * The callback is called on the elements with a "may" tag from left to - * right. If the input is not a valid SEQUENCE of elements with a "must" tag, - * the callback is called on the elements up to the leftmost point where - * the input is invalid. - * - * \warning This function is still experimental and may change - * at any time. - * - * \param p The address of the pointer to the beginning of - * the ASN.1 SEQUENCE header. This is updated to - * point to the end of the ASN.1 SEQUENCE container - * on a successful invocation. - * \param end The end of the ASN.1 SEQUENCE container. - * \param tag_must_mask A mask to be applied to the ASN.1 tags found within - * the SEQUENCE before comparing to \p tag_must_value. - * \param tag_must_val The required value of each ASN.1 tag found in the - * SEQUENCE, after masking with \p tag_must_mask. - * Mismatching tags lead to an error. - * For example, a value of \c 0 for both \p tag_must_mask - * and \p tag_must_val means that every tag is allowed, - * while a value of \c 0xFF for \p tag_must_mask means - * that \p tag_must_val is the only allowed tag. - * \param tag_may_mask A mask to be applied to the ASN.1 tags found within - * the SEQUENCE before comparing to \p tag_may_value. - * \param tag_may_val The desired value of each ASN.1 tag found in the - * SEQUENCE, after masking with \p tag_may_mask. - * Mismatching tags will be silently ignored. - * For example, a value of \c 0 for \p tag_may_mask and - * \p tag_may_val means that any tag will be considered, - * while a value of \c 0xFF for \p tag_may_mask means - * that all tags with value different from \p tag_may_val - * will be ignored. - * \param cb The callback to trigger for each component - * in the ASN.1 SEQUENCE that matches \p tag_may_val. - * The callback function is called with the following - * parameters: - * - \p ctx. - * - The tag of the current element. - * - A pointer to the start of the current element's - * content inside the input. - * - The length of the content of the current element. - * If the callback returns a non-zero value, - * the function stops immediately, - * forwarding the callback's return value. - * \param ctx The context to be passed to the callback \p cb. - * - * \return \c 0 if successful the entire ASN.1 SEQUENCE - * was traversed without parsing or callback errors. - * \return #MBEDTLS_ERR_ASN1_LENGTH_MISMATCH if the input - * contains extra data after a valid SEQUENCE - * of elements with an accepted tag. - * \return #MBEDTLS_ERR_ASN1_UNEXPECTED_TAG if the input starts - * with an ASN.1 SEQUENCE in which an element has a tag - * that is not accepted. - * \return An ASN.1 error code if the input does not start with - * a valid ASN.1 SEQUENCE. - * \return A non-zero error code forwarded from the callback - * \p cb in case the latter returns a non-zero value. - */ -int mbedtls_asn1_traverse_sequence_of( - unsigned char **p, - const unsigned char *end, - unsigned char tag_must_mask, unsigned char tag_must_val, - unsigned char tag_may_mask, unsigned char tag_may_val, - int (*cb)( void *ctx, int tag, - unsigned char* start, size_t len ), - void *ctx ); - -#if defined(MBEDTLS_BIGNUM_C) -/** - * \brief Retrieve an integer ASN.1 tag and its value. - * Updates the pointer to immediately behind the full tag. - * - * \param p On entry, \c *p points to the start of the ASN.1 element. - * On successful completion, \c *p points to the first byte - * beyond the ASN.1 element. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param X On success, the parsed value. - * - * \return 0 if successful. - * \return An ASN.1 error code if the input does not start with - * a valid ASN.1 INTEGER. - * \return #MBEDTLS_ERR_ASN1_INVALID_LENGTH if the parsed value does - * not fit in an \c int. - * \return An MPI error code if the parsed value is too large. - */ -int mbedtls_asn1_get_mpi( unsigned char **p, - const unsigned char *end, - mbedtls_mpi *X ); -#endif /* MBEDTLS_BIGNUM_C */ - -/** - * \brief Retrieve an AlgorithmIdentifier ASN.1 sequence. - * Updates the pointer to immediately behind the full - * AlgorithmIdentifier. - * - * \param p On entry, \c *p points to the start of the ASN.1 element. - * On successful completion, \c *p points to the first byte - * beyond the AlgorithmIdentifier element. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param alg The buffer to receive the OID. - * \param params The buffer to receive the parameters. - * This is zeroized if there are no parameters. - * - * \return 0 if successful or a specific ASN.1 or MPI error code. - */ -int mbedtls_asn1_get_alg( unsigned char **p, - const unsigned char *end, - mbedtls_asn1_buf *alg, mbedtls_asn1_buf *params ); - -/** - * \brief Retrieve an AlgorithmIdentifier ASN.1 sequence with NULL or no - * params. - * Updates the pointer to immediately behind the full - * AlgorithmIdentifier. - * - * \param p On entry, \c *p points to the start of the ASN.1 element. - * On successful completion, \c *p points to the first byte - * beyond the AlgorithmIdentifier element. - * On error, the value of \c *p is undefined. - * \param end End of data. - * \param alg The buffer to receive the OID. - * - * \return 0 if successful or a specific ASN.1 or MPI error code. - */ -int mbedtls_asn1_get_alg_null( unsigned char **p, - const unsigned char *end, - mbedtls_asn1_buf *alg ); - -/** - * \brief Find a specific named_data entry in a sequence or list based on - * the OID. - * - * \param list The list to seek through - * \param oid The OID to look for - * \param len Size of the OID - * - * \return NULL if not found, or a pointer to the existing entry. - */ -mbedtls_asn1_named_data *mbedtls_asn1_find_named_data( mbedtls_asn1_named_data *list, - const char *oid, size_t len ); - -/** - * \brief Free a mbedtls_asn1_named_data entry - * - * \param entry The named data entry to free. - * This function calls mbedtls_free() on - * `entry->oid.p` and `entry->val.p`. - */ -void mbedtls_asn1_free_named_data( mbedtls_asn1_named_data *entry ); - -/** - * \brief Free all entries in a mbedtls_asn1_named_data list. - * - * \param head Pointer to the head of the list of named data entries to free. - * This function calls mbedtls_asn1_free_named_data() and - * mbedtls_free() on each list element and - * sets \c *head to \c NULL. - */ -void mbedtls_asn1_free_named_data_list( mbedtls_asn1_named_data **head ); - -#ifdef __cplusplus -} -#endif - -#endif /* asn1.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/asn1write.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/asn1write.h deleted file mode 100644 index 0bce28ed1..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/asn1write.h +++ /dev/null @@ -1,372 +0,0 @@ -/** - * \file asn1write.h - * - * \brief ASN.1 buffer writing functionality - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ASN1_WRITE_H -#define MBEDTLS_ASN1_WRITE_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/asn1.h" - -#define MBEDTLS_ASN1_CHK_ADD(g, f) \ - do \ - { \ - if( ( ret = (f) ) < 0 ) \ - return( ret ); \ - else \ - (g) += ret; \ - } while( 0 ) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Write a length field in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param len The length value to write. - * - * \return The number of bytes written to \p p on success. - * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_asn1_write_len( unsigned char **p, unsigned char *start, - size_t len ); -/** - * \brief Write an ASN.1 tag in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param tag The tag to write. - * - * \return The number of bytes written to \p p on success. - * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_asn1_write_tag( unsigned char **p, unsigned char *start, - unsigned char tag ); - -/** - * \brief Write raw buffer data. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param buf The data buffer to write. - * \param size The length of the data buffer. - * - * \return The number of bytes written to \p p on success. - * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start, - const unsigned char *buf, size_t size ); - -#if defined(MBEDTLS_BIGNUM_C) -/** - * \brief Write a arbitrary-precision number (#MBEDTLS_ASN1_INTEGER) - * in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param X The MPI to write. - * It must be non-negative. - * - * \return The number of bytes written to \p p on success. - * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_asn1_write_mpi( unsigned char **p, unsigned char *start, - const mbedtls_mpi *X ); -#endif /* MBEDTLS_BIGNUM_C */ - -/** - * \brief Write a NULL tag (#MBEDTLS_ASN1_NULL) with zero data - * in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * - * \return The number of bytes written to \p p on success. - * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_asn1_write_null( unsigned char **p, unsigned char *start ); - -/** - * \brief Write an OID tag (#MBEDTLS_ASN1_OID) and data - * in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param oid The OID to write. - * \param oid_len The length of the OID. - * - * \return The number of bytes written to \p p on success. - * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_asn1_write_oid( unsigned char **p, unsigned char *start, - const char *oid, size_t oid_len ); - -/** - * \brief Write an AlgorithmIdentifier sequence in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param oid The OID of the algorithm to write. - * \param oid_len The length of the algorithm's OID. - * \param par_len The length of the parameters, which must be already written. - * If 0, NULL parameters are added - * - * \return The number of bytes written to \p p on success. - * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_asn1_write_algorithm_identifier( unsigned char **p, - unsigned char *start, - const char *oid, size_t oid_len, - size_t par_len ); - -/** - * \brief Write a boolean tag (#MBEDTLS_ASN1_BOOLEAN) and value - * in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param boolean The boolean value to write, either \c 0 or \c 1. - * - * \return The number of bytes written to \p p on success. - * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start, - int boolean ); - -/** - * \brief Write an int tag (#MBEDTLS_ASN1_INTEGER) and value - * in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param val The integer value to write. - * It must be non-negative. - * - * \return The number of bytes written to \p p on success. - * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_asn1_write_int( unsigned char **p, unsigned char *start, int val ); - -/** - * \brief Write an enum tag (#MBEDTLS_ASN1_ENUMERATED) and value - * in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param val The integer value to write. - * - * \return The number of bytes written to \p p on success. - * \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_asn1_write_enum( unsigned char **p, unsigned char *start, int val ); - -/** - * \brief Write a string in ASN.1 format using a specific - * string encoding tag. - - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param tag The string encoding tag to write, e.g. - * #MBEDTLS_ASN1_UTF8_STRING. - * \param text The string to write. - * \param text_len The length of \p text in bytes (which might - * be strictly larger than the number of characters). - * - * \return The number of bytes written to \p p on success. - * \return A negative error code on failure. - */ -int mbedtls_asn1_write_tagged_string( unsigned char **p, unsigned char *start, - int tag, const char *text, - size_t text_len ); - -/** - * \brief Write a string in ASN.1 format using the PrintableString - * string encoding tag (#MBEDTLS_ASN1_PRINTABLE_STRING). - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param text The string to write. - * \param text_len The length of \p text in bytes (which might - * be strictly larger than the number of characters). - * - * \return The number of bytes written to \p p on success. - * \return A negative error code on failure. - */ -int mbedtls_asn1_write_printable_string( unsigned char **p, - unsigned char *start, - const char *text, size_t text_len ); - -/** - * \brief Write a UTF8 string in ASN.1 format using the UTF8String - * string encoding tag (#MBEDTLS_ASN1_UTF8_STRING). - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param text The string to write. - * \param text_len The length of \p text in bytes (which might - * be strictly larger than the number of characters). - * - * \return The number of bytes written to \p p on success. - * \return A negative error code on failure. - */ -int mbedtls_asn1_write_utf8_string( unsigned char **p, unsigned char *start, - const char *text, size_t text_len ); - -/** - * \brief Write a string in ASN.1 format using the IA5String - * string encoding tag (#MBEDTLS_ASN1_IA5_STRING). - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param text The string to write. - * \param text_len The length of \p text in bytes (which might - * be strictly larger than the number of characters). - * - * \return The number of bytes written to \p p on success. - * \return A negative error code on failure. - */ -int mbedtls_asn1_write_ia5_string( unsigned char **p, unsigned char *start, - const char *text, size_t text_len ); - -/** - * \brief Write a bitstring tag (#MBEDTLS_ASN1_BIT_STRING) and - * value in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param buf The bitstring to write. - * \param bits The total number of bits in the bitstring. - * - * \return The number of bytes written to \p p on success. - * \return A negative error code on failure. - */ -int mbedtls_asn1_write_bitstring( unsigned char **p, unsigned char *start, - const unsigned char *buf, size_t bits ); - -/** - * \brief This function writes a named bitstring tag - * (#MBEDTLS_ASN1_BIT_STRING) and value in ASN.1 format. - * - * As stated in RFC 5280 Appendix B, trailing zeroes are - * omitted when encoding named bitstrings in DER. - * - * \note This function works backwards within the data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer which is used for bounds-checking. - * \param buf The bitstring to write. - * \param bits The total number of bits in the bitstring. - * - * \return The number of bytes written to \p p on success. - * \return A negative error code on failure. - */ -int mbedtls_asn1_write_named_bitstring( unsigned char **p, - unsigned char *start, - const unsigned char *buf, - size_t bits ); - -/** - * \brief Write an octet string tag (#MBEDTLS_ASN1_OCTET_STRING) - * and value in ASN.1 format. - * - * \note This function works backwards in data buffer. - * - * \param p The reference to the current position pointer. - * \param start The start of the buffer, for bounds-checking. - * \param buf The buffer holding the data to write. - * \param size The length of the data buffer \p buf. - * - * \return The number of bytes written to \p p on success. - * \return A negative error code on failure. - */ -int mbedtls_asn1_write_octet_string( unsigned char **p, unsigned char *start, - const unsigned char *buf, size_t size ); - -/** - * \brief Create or find a specific named_data entry for writing in a - * sequence or list based on the OID. If not already in there, - * a new entry is added to the head of the list. - * Warning: Destructive behaviour for the val data! - * - * \param list The pointer to the location of the head of the list to seek - * through (will be updated in case of a new entry). - * \param oid The OID to look for. - * \param oid_len The size of the OID. - * \param val The associated data to store. If this is \c NULL, - * no data is copied to the new or existing buffer. - * \param val_len The minimum length of the data buffer needed. - * If this is 0, do not allocate a buffer for the associated - * data. - * If the OID was already present, enlarge, shrink or free - * the existing buffer to fit \p val_len. - * - * \return A pointer to the new / existing entry on success. - * \return \c NULL if if there was a memory allocation error. - */ -mbedtls_asn1_named_data *mbedtls_asn1_store_named_data( mbedtls_asn1_named_data **list, - const char *oid, size_t oid_len, - const unsigned char *val, - size_t val_len ); - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_ASN1_WRITE_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/base64.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/base64.h deleted file mode 100644 index 07ae3bf54..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/base64.h +++ /dev/null @@ -1,98 +0,0 @@ -/** - * \file base64.h - * - * \brief RFC 1521 base64 encoding/decoding - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_BASE64_H -#define MBEDTLS_BASE64_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#define MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -0x002A /**< Output buffer too small. */ -#define MBEDTLS_ERR_BASE64_INVALID_CHARACTER -0x002C /**< Invalid character in input. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Encode a buffer into base64 format - * - * \param dst destination buffer - * \param dlen size of the destination buffer - * \param olen number of bytes written - * \param src source buffer - * \param slen amount of data to be encoded - * - * \return 0 if successful, or MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL. - * *olen is always updated to reflect the amount - * of data that has (or would have) been written. - * If that length cannot be represented, then no data is - * written to the buffer and *olen is set to the maximum - * length representable as a size_t. - * - * \note Call this function with dlen = 0 to obtain the - * required buffer size in *olen - */ -int mbedtls_base64_encode( unsigned char *dst, size_t dlen, size_t *olen, - const unsigned char *src, size_t slen ); - -/** - * \brief Decode a base64-formatted buffer - * - * \param dst destination buffer (can be NULL for checking size) - * \param dlen size of the destination buffer - * \param olen number of bytes written - * \param src source buffer - * \param slen amount of data to be decoded - * - * \return 0 if successful, MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL, or - * MBEDTLS_ERR_BASE64_INVALID_CHARACTER if the input data is - * not correct. *olen is always updated to reflect the amount - * of data that has (or would have) been written. - * - * \note Call this function with *dst = NULL or dlen = 0 to obtain - * the required buffer size in *olen - */ -int mbedtls_base64_decode( unsigned char *dst, size_t dlen, size_t *olen, - const unsigned char *src, size_t slen ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_base64_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* base64.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/bignum.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/bignum.h deleted file mode 100644 index 1d00c560a..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/bignum.h +++ /dev/null @@ -1,1019 +0,0 @@ -/** - * \file bignum.h - * - * \brief Multi-precision integer library - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_BIGNUM_H -#define MBEDTLS_BIGNUM_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#if defined(MBEDTLS_FS_IO) -#include -#endif - -#define MBEDTLS_ERR_MPI_FILE_IO_ERROR -0x0002 /**< An error occurred while reading from or writing to a file. */ -#define MBEDTLS_ERR_MPI_BAD_INPUT_DATA -0x0004 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_MPI_INVALID_CHARACTER -0x0006 /**< There is an invalid character in the digit string. */ -#define MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL -0x0008 /**< The buffer is too small to write to. */ -#define MBEDTLS_ERR_MPI_NEGATIVE_VALUE -0x000A /**< The input arguments are negative or result in illegal output. */ -#define MBEDTLS_ERR_MPI_DIVISION_BY_ZERO -0x000C /**< The input argument for division is zero, which is not allowed. */ -#define MBEDTLS_ERR_MPI_NOT_ACCEPTABLE -0x000E /**< The input arguments are not acceptable. */ -#define MBEDTLS_ERR_MPI_ALLOC_FAILED -0x0010 /**< Memory allocation failed. */ - -#define MBEDTLS_MPI_CHK(f) \ - do \ - { \ - if( ( ret = (f) ) != 0 ) \ - goto cleanup; \ - } while( 0 ) - -/* - * Maximum size MPIs are allowed to grow to in number of limbs. - */ -#define MBEDTLS_MPI_MAX_LIMBS 10000 - -#if !defined(MBEDTLS_MPI_WINDOW_SIZE) -/* - * Maximum window size used for modular exponentiation. Default: 6 - * Minimum value: 1. Maximum value: 6. - * - * Result is an array of ( 2 << MBEDTLS_MPI_WINDOW_SIZE ) MPIs used - * for the sliding window calculation. (So 64 by default) - * - * Reduction in size, reduces speed. - */ -#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */ -#endif /* !MBEDTLS_MPI_WINDOW_SIZE */ - -#if !defined(MBEDTLS_MPI_MAX_SIZE) -/* - * Maximum size of MPIs allowed in bits and bytes for user-MPIs. - * ( Default: 512 bytes => 4096 bits, Maximum tested: 2048 bytes => 16384 bits ) - * - * Note: Calculations can temporarily result in larger MPIs. So the number - * of limbs required (MBEDTLS_MPI_MAX_LIMBS) is higher. - */ -#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */ -#endif /* !MBEDTLS_MPI_MAX_SIZE */ - -#define MBEDTLS_MPI_MAX_BITS ( 8 * MBEDTLS_MPI_MAX_SIZE ) /**< Maximum number of bits for usable MPIs. */ - -/* - * When reading from files with mbedtls_mpi_read_file() and writing to files with - * mbedtls_mpi_write_file() the buffer should have space - * for a (short) label, the MPI (in the provided radix), the newline - * characters and the '\0'. - * - * By default we assume at least a 10 char label, a minimum radix of 10 - * (decimal) and a maximum of 4096 bit numbers (1234 decimal chars). - * Autosized at compile time for at least a 10 char label, a minimum radix - * of 10 (decimal) for a number of MBEDTLS_MPI_MAX_BITS size. - * - * This used to be statically sized to 1250 for a maximum of 4096 bit - * numbers (1234 decimal chars). - * - * Calculate using the formula: - * MBEDTLS_MPI_RW_BUFFER_SIZE = ceil(MBEDTLS_MPI_MAX_BITS / ln(10) * ln(2)) + - * LabelSize + 6 - */ -#define MBEDTLS_MPI_MAX_BITS_SCALE100 ( 100 * MBEDTLS_MPI_MAX_BITS ) -#define MBEDTLS_LN_2_DIV_LN_10_SCALE100 332 -#define MBEDTLS_MPI_RW_BUFFER_SIZE ( ((MBEDTLS_MPI_MAX_BITS_SCALE100 + MBEDTLS_LN_2_DIV_LN_10_SCALE100 - 1) / MBEDTLS_LN_2_DIV_LN_10_SCALE100) + 10 + 6 ) - -/* - * Define the base integer type, architecture-wise. - * - * 32 or 64-bit integer types can be forced regardless of the underlying - * architecture by defining MBEDTLS_HAVE_INT32 or MBEDTLS_HAVE_INT64 - * respectively and undefining MBEDTLS_HAVE_ASM. - * - * Double-width integers (e.g. 128-bit in 64-bit architectures) can be - * disabled by defining MBEDTLS_NO_UDBL_DIVISION. - */ -#if !defined(MBEDTLS_HAVE_INT32) - #if defined(_MSC_VER) && defined(_M_AMD64) - /* Always choose 64-bit when using MSC */ - #if !defined(MBEDTLS_HAVE_INT64) - #define MBEDTLS_HAVE_INT64 - #endif /* !MBEDTLS_HAVE_INT64 */ - typedef int64_t mbedtls_mpi_sint; - typedef uint64_t mbedtls_mpi_uint; - #elif defined(__GNUC__) && ( \ - defined(__amd64__) || defined(__x86_64__) || \ - defined(__ppc64__) || defined(__powerpc64__) || \ - defined(__ia64__) || defined(__alpha__) || \ - ( defined(__sparc__) && defined(__arch64__) ) || \ - defined(__s390x__) || defined(__mips64) || \ - defined(__aarch64__) ) - #if !defined(MBEDTLS_HAVE_INT64) - #define MBEDTLS_HAVE_INT64 - #endif /* MBEDTLS_HAVE_INT64 */ - typedef int64_t mbedtls_mpi_sint; - typedef uint64_t mbedtls_mpi_uint; - #if !defined(MBEDTLS_NO_UDBL_DIVISION) - /* mbedtls_t_udbl defined as 128-bit unsigned int */ - typedef unsigned int mbedtls_t_udbl __attribute__((mode(TI))); - #define MBEDTLS_HAVE_UDBL - #endif /* !MBEDTLS_NO_UDBL_DIVISION */ - #elif defined(__ARMCC_VERSION) && defined(__aarch64__) - /* - * __ARMCC_VERSION is defined for both armcc and armclang and - * __aarch64__ is only defined by armclang when compiling 64-bit code - */ - #if !defined(MBEDTLS_HAVE_INT64) - #define MBEDTLS_HAVE_INT64 - #endif /* !MBEDTLS_HAVE_INT64 */ - typedef int64_t mbedtls_mpi_sint; - typedef uint64_t mbedtls_mpi_uint; - #if !defined(MBEDTLS_NO_UDBL_DIVISION) - /* mbedtls_t_udbl defined as 128-bit unsigned int */ - typedef __uint128_t mbedtls_t_udbl; - #define MBEDTLS_HAVE_UDBL - #endif /* !MBEDTLS_NO_UDBL_DIVISION */ - #elif defined(MBEDTLS_HAVE_INT64) - /* Force 64-bit integers with unknown compiler */ - typedef int64_t mbedtls_mpi_sint; - typedef uint64_t mbedtls_mpi_uint; - #endif -#endif /* !MBEDTLS_HAVE_INT32 */ - -#if !defined(MBEDTLS_HAVE_INT64) - /* Default to 32-bit compilation */ - #if !defined(MBEDTLS_HAVE_INT32) - #define MBEDTLS_HAVE_INT32 - #endif /* !MBEDTLS_HAVE_INT32 */ - typedef int32_t mbedtls_mpi_sint; - typedef uint32_t mbedtls_mpi_uint; - #if !defined(MBEDTLS_NO_UDBL_DIVISION) - typedef uint64_t mbedtls_t_udbl; - #define MBEDTLS_HAVE_UDBL - #endif /* !MBEDTLS_NO_UDBL_DIVISION */ -#endif /* !MBEDTLS_HAVE_INT64 */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief MPI structure - */ -typedef struct mbedtls_mpi -{ - int s; /*!< Sign: -1 if the mpi is negative, 1 otherwise */ - size_t n; /*!< total # of limbs */ - mbedtls_mpi_uint *p; /*!< pointer to limbs */ -} -mbedtls_mpi; - -/** - * \brief Initialize an MPI context. - * - * This makes the MPI ready to be set or freed, - * but does not define a value for the MPI. - * - * \param X The MPI context to initialize. This must not be \c NULL. - */ -void mbedtls_mpi_init( mbedtls_mpi *X ); - -/** - * \brief This function frees the components of an MPI context. - * - * \param X The MPI context to be cleared. This may be \c NULL, - * in which case this function is a no-op. If it is - * not \c NULL, it must point to an initialized MPI. - */ -void mbedtls_mpi_free( mbedtls_mpi *X ); - -/** - * \brief Enlarge an MPI to the specified number of limbs. - * - * \note This function does nothing if the MPI is - * already large enough. - * - * \param X The MPI to grow. It must be initialized. - * \param nblimbs The target number of limbs. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_mpi_grow( mbedtls_mpi *X, size_t nblimbs ); - -/** - * \brief This function resizes an MPI downwards, keeping at least the - * specified number of limbs. - * - * If \c X is smaller than \c nblimbs, it is resized up - * instead. - * - * \param X The MPI to shrink. This must point to an initialized MPI. - * \param nblimbs The minimum number of limbs to keep. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed - * (this can only happen when resizing up). - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_mpi_shrink( mbedtls_mpi *X, size_t nblimbs ); - -/** - * \brief Make a copy of an MPI. - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param Y The source MPI. This must point to an initialized MPI. - * - * \note The limb-buffer in the destination MPI is enlarged - * if necessary to hold the value in the source MPI. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_mpi_copy( mbedtls_mpi *X, const mbedtls_mpi *Y ); - -/** - * \brief Swap the contents of two MPIs. - * - * \param X The first MPI. It must be initialized. - * \param Y The second MPI. It must be initialized. - */ -void mbedtls_mpi_swap( mbedtls_mpi *X, mbedtls_mpi *Y ); - -/** - * \brief Perform a safe conditional copy of MPI which doesn't - * reveal whether the condition was true or not. - * - * \param X The MPI to conditionally assign to. This must point - * to an initialized MPI. - * \param Y The MPI to be assigned from. This must point to an - * initialized MPI. - * \param assign The condition deciding whether to perform the - * assignment or not. Possible values: - * * \c 1: Perform the assignment `X = Y`. - * * \c 0: Keep the original value of \p X. - * - * \note This function is equivalent to - * `if( assign ) mbedtls_mpi_copy( X, Y );` - * except that it avoids leaking any information about whether - * the assignment was done or not (the above code may leak - * information through branch prediction and/or memory access - * patterns analysis). - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_mpi_safe_cond_assign( mbedtls_mpi *X, const mbedtls_mpi *Y, unsigned char assign ); - -/** - * \brief Perform a safe conditional swap which doesn't - * reveal whether the condition was true or not. - * - * \param X The first MPI. This must be initialized. - * \param Y The second MPI. This must be initialized. - * \param assign The condition deciding whether to perform - * the swap or not. Possible values: - * * \c 1: Swap the values of \p X and \p Y. - * * \c 0: Keep the original values of \p X and \p Y. - * - * \note This function is equivalent to - * if( assign ) mbedtls_mpi_swap( X, Y ); - * except that it avoids leaking any information about whether - * the assignment was done or not (the above code may leak - * information through branch prediction and/or memory access - * patterns analysis). - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return Another negative error code on other kinds of failure. - * - */ -int mbedtls_mpi_safe_cond_swap( mbedtls_mpi *X, mbedtls_mpi *Y, unsigned char assign ); - -/** - * \brief Store integer value in MPI. - * - * \param X The MPI to set. This must be initialized. - * \param z The value to use. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_mpi_lset( mbedtls_mpi *X, mbedtls_mpi_sint z ); - -/** - * \brief Get a specific bit from an MPI. - * - * \param X The MPI to query. This must be initialized. - * \param pos Zero-based index of the bit to query. - * - * \return \c 0 or \c 1 on success, depending on whether bit \c pos - * of \c X is unset or set. - * \return A negative error code on failure. - */ -int mbedtls_mpi_get_bit( const mbedtls_mpi *X, size_t pos ); - -/** - * \brief Modify a specific bit in an MPI. - * - * \note This function will grow the target MPI if necessary to set a - * bit to \c 1 in a not yet existing limb. It will not grow if - * the bit should be set to \c 0. - * - * \param X The MPI to modify. This must be initialized. - * \param pos Zero-based index of the bit to modify. - * \param val The desired value of bit \c pos: \c 0 or \c 1. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_mpi_set_bit( mbedtls_mpi *X, size_t pos, unsigned char val ); - -/** - * \brief Return the number of bits of value \c 0 before the - * least significant bit of value \c 1. - * - * \note This is the same as the zero-based index of - * the least significant bit of value \c 1. - * - * \param X The MPI to query. - * - * \return The number of bits of value \c 0 before the least significant - * bit of value \c 1 in \p X. - */ -size_t mbedtls_mpi_lsb( const mbedtls_mpi *X ); - -/** - * \brief Return the number of bits up to and including the most - * significant bit of value \c 1. - * - * * \note This is same as the one-based index of the most - * significant bit of value \c 1. - * - * \param X The MPI to query. This must point to an initialized MPI. - * - * \return The number of bits up to and including the most - * significant bit of value \c 1. - */ -size_t mbedtls_mpi_bitlen( const mbedtls_mpi *X ); - -/** - * \brief Return the total size of an MPI value in bytes. - * - * \param X The MPI to use. This must point to an initialized MPI. - * - * \note The value returned by this function may be less than - * the number of bytes used to store \p X internally. - * This happens if and only if there are trailing bytes - * of value zero. - * - * \return The least number of bytes capable of storing - * the absolute value of \p X. - */ -size_t mbedtls_mpi_size( const mbedtls_mpi *X ); - -/** - * \brief Import an MPI from an ASCII string. - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param radix The numeric base of the input string. - * \param s Null-terminated string buffer. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_mpi_read_string( mbedtls_mpi *X, int radix, const char *s ); - -/** - * \brief Export an MPI to an ASCII string. - * - * \param X The source MPI. This must point to an initialized MPI. - * \param radix The numeric base of the output string. - * \param buf The buffer to write the string to. This must be writable - * buffer of length \p buflen Bytes. - * \param buflen The available size in Bytes of \p buf. - * \param olen The address at which to store the length of the string - * written, including the final \c NULL byte. This must - * not be \c NULL. - * - * \note You can call this function with `buflen == 0` to obtain the - * minimum required buffer size in `*olen`. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if the target buffer \p buf - * is too small to hold the value of \p X in the desired base. - * In this case, `*olen` is nonetheless updated to contain the - * size of \p buf required for a successful call. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_write_string( const mbedtls_mpi *X, int radix, - char *buf, size_t buflen, size_t *olen ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Read an MPI from a line in an opened file. - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param radix The numeric base of the string representation used - * in the source line. - * \param fin The input file handle to use. This must not be \c NULL. - * - * \note On success, this function advances the file stream - * to the end of the current line or to EOF. - * - * The function returns \c 0 on an empty line. - * - * Leading whitespaces are ignored, as is a - * '0x' prefix for radix \c 16. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if the file read buffer - * is too small. - * \return Another negative error code on failure. - */ -int mbedtls_mpi_read_file( mbedtls_mpi *X, int radix, FILE *fin ); - -/** - * \brief Export an MPI into an opened file. - * - * \param p A string prefix to emit prior to the MPI data. - * For example, this might be a label, or "0x" when - * printing in base \c 16. This may be \c NULL if no prefix - * is needed. - * \param X The source MPI. This must point to an initialized MPI. - * \param radix The numeric base to be used in the emitted string. - * \param fout The output file handle. This may be \c NULL, in which case - * the output is written to \c stdout. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_mpi_write_file( const char *p, const mbedtls_mpi *X, - int radix, FILE *fout ); -#endif /* MBEDTLS_FS_IO */ - -/** - * \brief Import an MPI from unsigned big endian binary data. - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param buf The input buffer. This must be a readable buffer of length - * \p buflen Bytes. - * \param buflen The length of the input buffer \p p in Bytes. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_read_binary( mbedtls_mpi *X, const unsigned char *buf, - size_t buflen ); - -/** - * \brief Import X from unsigned binary data, little endian - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param buf The input buffer. This must be a readable buffer of length - * \p buflen Bytes. - * \param buflen The length of the input buffer \p p in Bytes. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_read_binary_le( mbedtls_mpi *X, - const unsigned char *buf, size_t buflen ); - -/** - * \brief Export X into unsigned binary data, big endian. - * Always fills the whole buffer, which will start with zeros - * if the number is smaller. - * - * \param X The source MPI. This must point to an initialized MPI. - * \param buf The output buffer. This must be a writable buffer of length - * \p buflen Bytes. - * \param buflen The size of the output buffer \p buf in Bytes. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p buf isn't - * large enough to hold the value of \p X. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_write_binary( const mbedtls_mpi *X, unsigned char *buf, - size_t buflen ); - -/** - * \brief Export X into unsigned binary data, little endian. - * Always fills the whole buffer, which will end with zeros - * if the number is smaller. - * - * \param X The source MPI. This must point to an initialized MPI. - * \param buf The output buffer. This must be a writable buffer of length - * \p buflen Bytes. - * \param buflen The size of the output buffer \p buf in Bytes. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL if \p buf isn't - * large enough to hold the value of \p X. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_write_binary_le( const mbedtls_mpi *X, - unsigned char *buf, size_t buflen ); - -/** - * \brief Perform a left-shift on an MPI: X <<= count - * - * \param X The MPI to shift. This must point to an initialized MPI. - * \param count The number of bits to shift by. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_shift_l( mbedtls_mpi *X, size_t count ); - -/** - * \brief Perform a right-shift on an MPI: X >>= count - * - * \param X The MPI to shift. This must point to an initialized MPI. - * \param count The number of bits to shift by. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_shift_r( mbedtls_mpi *X, size_t count ); - -/** - * \brief Compare the absolute values of two MPIs. - * - * \param X The left-hand MPI. This must point to an initialized MPI. - * \param Y The right-hand MPI. This must point to an initialized MPI. - * - * \return \c 1 if `|X|` is greater than `|Y|`. - * \return \c -1 if `|X|` is lesser than `|Y|`. - * \return \c 0 if `|X|` is equal to `|Y|`. - */ -int mbedtls_mpi_cmp_abs( const mbedtls_mpi *X, const mbedtls_mpi *Y ); - -/** - * \brief Compare two MPIs. - * - * \param X The left-hand MPI. This must point to an initialized MPI. - * \param Y The right-hand MPI. This must point to an initialized MPI. - * - * \return \c 1 if \p X is greater than \p Y. - * \return \c -1 if \p X is lesser than \p Y. - * \return \c 0 if \p X is equal to \p Y. - */ -int mbedtls_mpi_cmp_mpi( const mbedtls_mpi *X, const mbedtls_mpi *Y ); - -/** - * \brief Check if an MPI is less than the other in constant time. - * - * \param X The left-hand MPI. This must point to an initialized MPI - * with the same allocated length as Y. - * \param Y The right-hand MPI. This must point to an initialized MPI - * with the same allocated length as X. - * \param ret The result of the comparison: - * \c 1 if \p X is less than \p Y. - * \c 0 if \p X is greater than or equal to \p Y. - * - * \return 0 on success. - * \return MBEDTLS_ERR_MPI_BAD_INPUT_DATA if the allocated length of - * the two input MPIs is not the same. - */ -int mbedtls_mpi_lt_mpi_ct( const mbedtls_mpi *X, const mbedtls_mpi *Y, - unsigned *ret ); - -/** - * \brief Compare an MPI with an integer. - * - * \param X The left-hand MPI. This must point to an initialized MPI. - * \param z The integer value to compare \p X to. - * - * \return \c 1 if \p X is greater than \p z. - * \return \c -1 if \p X is lesser than \p z. - * \return \c 0 if \p X is equal to \p z. - */ -int mbedtls_mpi_cmp_int( const mbedtls_mpi *X, mbedtls_mpi_sint z ); - -/** - * \brief Perform an unsigned addition of MPIs: X = |A| + |B| - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param A The first summand. This must point to an initialized MPI. - * \param B The second summand. This must point to an initialized MPI. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_add_abs( mbedtls_mpi *X, const mbedtls_mpi *A, - const mbedtls_mpi *B ); - -/** - * \brief Perform an unsigned subtraction of MPIs: X = |A| - |B| - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param A The minuend. This must point to an initialized MPI. - * \param B The subtrahend. This must point to an initialized MPI. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_NEGATIVE_VALUE if \p B is greater than \p A. - * \return Another negative error code on different kinds of failure. - * - */ -int mbedtls_mpi_sub_abs( mbedtls_mpi *X, const mbedtls_mpi *A, - const mbedtls_mpi *B ); - -/** - * \brief Perform a signed addition of MPIs: X = A + B - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param A The first summand. This must point to an initialized MPI. - * \param B The second summand. This must point to an initialized MPI. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_add_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, - const mbedtls_mpi *B ); - -/** - * \brief Perform a signed subtraction of MPIs: X = A - B - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param A The minuend. This must point to an initialized MPI. - * \param B The subtrahend. This must point to an initialized MPI. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_sub_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, - const mbedtls_mpi *B ); - -/** - * \brief Perform a signed addition of an MPI and an integer: X = A + b - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param A The first summand. This must point to an initialized MPI. - * \param b The second summand. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_add_int( mbedtls_mpi *X, const mbedtls_mpi *A, - mbedtls_mpi_sint b ); - -/** - * \brief Perform a signed subtraction of an MPI and an integer: - * X = A - b - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param A The minuend. This must point to an initialized MPI. - * \param b The subtrahend. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_sub_int( mbedtls_mpi *X, const mbedtls_mpi *A, - mbedtls_mpi_sint b ); - -/** - * \brief Perform a multiplication of two MPIs: X = A * B - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param A The first factor. This must point to an initialized MPI. - * \param B The second factor. This must point to an initialized MPI. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on different kinds of failure. - * - */ -int mbedtls_mpi_mul_mpi( mbedtls_mpi *X, const mbedtls_mpi *A, - const mbedtls_mpi *B ); - -/** - * \brief Perform a multiplication of an MPI with an unsigned integer: - * X = A * b - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param A The first factor. This must point to an initialized MPI. - * \param b The second factor. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on different kinds of failure. - * - */ -int mbedtls_mpi_mul_int( mbedtls_mpi *X, const mbedtls_mpi *A, - mbedtls_mpi_uint b ); - -/** - * \brief Perform a division with remainder of two MPIs: - * A = Q * B + R - * - * \param Q The destination MPI for the quotient. - * This may be \c NULL if the value of the - * quotient is not needed. - * \param R The destination MPI for the remainder value. - * This may be \c NULL if the value of the - * remainder is not needed. - * \param A The dividend. This must point to an initialized MPi. - * \param B The divisor. This must point to an initialized MPI. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return #MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if \p B equals zero. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_div_mpi( mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, - const mbedtls_mpi *B ); - -/** - * \brief Perform a division with remainder of an MPI by an integer: - * A = Q * b + R - * - * \param Q The destination MPI for the quotient. - * This may be \c NULL if the value of the - * quotient is not needed. - * \param R The destination MPI for the remainder value. - * This may be \c NULL if the value of the - * remainder is not needed. - * \param A The dividend. This must point to an initialized MPi. - * \param b The divisor. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return #MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if \p b equals zero. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_div_int( mbedtls_mpi *Q, mbedtls_mpi *R, const mbedtls_mpi *A, - mbedtls_mpi_sint b ); - -/** - * \brief Perform a modular reduction. R = A mod B - * - * \param R The destination MPI for the residue value. - * This must point to an initialized MPI. - * \param A The MPI to compute the residue of. - * This must point to an initialized MPI. - * \param B The base of the modular reduction. - * This must point to an initialized MPI. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return #MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if \p B equals zero. - * \return #MBEDTLS_ERR_MPI_NEGATIVE_VALUE if \p B is negative. - * \return Another negative error code on different kinds of failure. - * - */ -int mbedtls_mpi_mod_mpi( mbedtls_mpi *R, const mbedtls_mpi *A, - const mbedtls_mpi *B ); - -/** - * \brief Perform a modular reduction with respect to an integer. - * r = A mod b - * - * \param r The address at which to store the residue. - * This must not be \c NULL. - * \param A The MPI to compute the residue of. - * This must point to an initialized MPi. - * \param b The integer base of the modular reduction. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return #MBEDTLS_ERR_MPI_DIVISION_BY_ZERO if \p b equals zero. - * \return #MBEDTLS_ERR_MPI_NEGATIVE_VALUE if \p b is negative. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_mod_int( mbedtls_mpi_uint *r, const mbedtls_mpi *A, - mbedtls_mpi_sint b ); - -/** - * \brief Perform a sliding-window exponentiation: X = A^E mod N - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param A The base of the exponentiation. - * This must point to an initialized MPI. - * \param E The exponent MPI. This must point to an initialized MPI. - * \param N The base for the modular reduction. This must point to an - * initialized MPI. - * \param _RR A helper MPI depending solely on \p N which can be used to - * speed-up multiple modular exponentiations for the same value - * of \p N. This may be \c NULL. If it is not \c NULL, it must - * point to an initialized MPI. If it hasn't been used after - * the call to mbedtls_mpi_init(), this function will compute - * the helper value and store it in \p _RR for reuse on - * subsequent calls to this function. Otherwise, the function - * will assume that \p _RR holds the helper value set by a - * previous call to mbedtls_mpi_exp_mod(), and reuse it. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \c N is negative or - * even, or if \c E is negative. - * \return Another negative error code on different kinds of failures. - * - */ -int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A, - const mbedtls_mpi *E, const mbedtls_mpi *N, - mbedtls_mpi *_RR ); - -/** - * \brief Fill an MPI with a number of random bytes. - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param size The number of random bytes to generate. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG parameter to be passed to \p f_rng. This may be - * \c NULL if \p f_rng doesn't need a context argument. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on failure. - * - * \note The bytes obtained from the RNG are interpreted - * as a big-endian representation of an MPI; this can - * be relevant in applications like deterministic ECDSA. - */ -int mbedtls_mpi_fill_random( mbedtls_mpi *X, size_t size, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Compute the greatest common divisor: G = gcd(A, B) - * - * \param G The destination MPI. This must point to an initialized MPI. - * \param A The first operand. This must point to an initialized MPI. - * \param B The second operand. This must point to an initialized MPI. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_mpi_gcd( mbedtls_mpi *G, const mbedtls_mpi *A, - const mbedtls_mpi *B ); - -/** - * \brief Compute the modular inverse: X = A^-1 mod N - * - * \param X The destination MPI. This must point to an initialized MPI. - * \param A The MPI to calculate the modular inverse of. This must point - * to an initialized MPI. - * \param N The base of the modular inversion. This must point to an - * initialized MPI. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \p N is less than - * or equal to one. - * \return #MBEDTLS_ERR_MPI_NOT_ACCEPTABLE if \p has no modular inverse - * with respect to \p N. - */ -int mbedtls_mpi_inv_mod( mbedtls_mpi *X, const mbedtls_mpi *A, - const mbedtls_mpi *N ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Perform a Miller-Rabin primality test with error - * probability of 2-80. - * - * \deprecated Superseded by mbedtls_mpi_is_prime_ext() which allows - * specifying the number of Miller-Rabin rounds. - * - * \param X The MPI to check for primality. - * This must point to an initialized MPI. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG parameter to be passed to \p f_rng. - * This may be \c NULL if \p f_rng doesn't use a - * context parameter. - * - * \return \c 0 if successful, i.e. \p X is probably prime. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return #MBEDTLS_ERR_MPI_NOT_ACCEPTABLE if \p X is not prime. - * \return Another negative error code on other kinds of failure. - */ -MBEDTLS_DEPRECATED int mbedtls_mpi_is_prime( const mbedtls_mpi *X, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Miller-Rabin primality test. - * - * \warning If \p X is potentially generated by an adversary, for example - * when validating cryptographic parameters that you didn't - * generate yourself and that are supposed to be prime, then - * \p rounds should be at least the half of the security - * strength of the cryptographic algorithm. On the other hand, - * if \p X is chosen uniformly or non-adversially (as is the - * case when mbedtls_mpi_gen_prime calls this function), then - * \p rounds can be much lower. - * - * \param X The MPI to check for primality. - * This must point to an initialized MPI. - * \param rounds The number of bases to perform the Miller-Rabin primality - * test for. The probability of returning 0 on a composite is - * at most 2-2*\p rounds. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG parameter to be passed to \p f_rng. - * This may be \c NULL if \p f_rng doesn't use - * a context parameter. - * - * \return \c 0 if successful, i.e. \p X is probably prime. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return #MBEDTLS_ERR_MPI_NOT_ACCEPTABLE if \p X is not prime. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_mpi_is_prime_ext( const mbedtls_mpi *X, int rounds, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -/** - * \brief Flags for mbedtls_mpi_gen_prime() - * - * Each of these flags is a constraint on the result X returned by - * mbedtls_mpi_gen_prime(). - */ -typedef enum { - MBEDTLS_MPI_GEN_PRIME_FLAG_DH = 0x0001, /**< (X-1)/2 is prime too */ - MBEDTLS_MPI_GEN_PRIME_FLAG_LOW_ERR = 0x0002, /**< lower error rate from 2-80 to 2-128 */ -} mbedtls_mpi_gen_prime_flag_t; - -/** - * \brief Generate a prime number. - * - * \param X The destination MPI to store the generated prime in. - * This must point to an initialized MPi. - * \param nbits The required size of the destination MPI in bits. - * This must be between \c 3 and #MBEDTLS_MPI_MAX_BITS. - * \param flags A mask of flags of type #mbedtls_mpi_gen_prime_flag_t. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG parameter to be passed to \p f_rng. - * This may be \c NULL if \p f_rng doesn't use - * a context parameter. - * - * \return \c 0 if successful, in which case \p X holds a - * probably prime number. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. - * \return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if `nbits` is not between - * \c 3 and #MBEDTLS_MPI_MAX_BITS. - */ -int mbedtls_mpi_gen_prime( mbedtls_mpi *X, size_t nbits, int flags, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_mpi_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* bignum.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/blowfish.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/blowfish.h deleted file mode 100644 index 1e5dba3a3..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/blowfish.h +++ /dev/null @@ -1,287 +0,0 @@ -/** - * \file blowfish.h - * - * \brief Blowfish block cipher - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_BLOWFISH_H -#define MBEDTLS_BLOWFISH_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#include "mbedtls/platform_util.h" - -#define MBEDTLS_BLOWFISH_ENCRYPT 1 -#define MBEDTLS_BLOWFISH_DECRYPT 0 -#define MBEDTLS_BLOWFISH_MAX_KEY_BITS 448 -#define MBEDTLS_BLOWFISH_MIN_KEY_BITS 32 -#define MBEDTLS_BLOWFISH_ROUNDS 16 /**< Rounds to use. When increasing this value, make sure to extend the initialisation vectors */ -#define MBEDTLS_BLOWFISH_BLOCKSIZE 8 /* Blowfish uses 64 bit blocks */ - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#define MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -0x0016 ) -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ -#define MBEDTLS_ERR_BLOWFISH_BAD_INPUT_DATA -0x0016 /**< Bad input data. */ - -#define MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018 /**< Invalid data input length. */ - -/* MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED is deprecated and should not be used. - */ -#define MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED -0x0017 /**< Blowfish hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_BLOWFISH_ALT) -// Regular implementation -// - -/** - * \brief Blowfish context structure - */ -typedef struct mbedtls_blowfish_context -{ - uint32_t P[MBEDTLS_BLOWFISH_ROUNDS + 2]; /*!< Blowfish round keys */ - uint32_t S[4][256]; /*!< key dependent S-boxes */ -} -mbedtls_blowfish_context; - -#else /* MBEDTLS_BLOWFISH_ALT */ -#include "blowfish_alt.h" -#endif /* MBEDTLS_BLOWFISH_ALT */ - -/** - * \brief Initialize a Blowfish context. - * - * \param ctx The Blowfish context to be initialized. - * This must not be \c NULL. - */ -void mbedtls_blowfish_init( mbedtls_blowfish_context *ctx ); - -/** - * \brief Clear a Blowfish context. - * - * \param ctx The Blowfish context to be cleared. - * This may be \c NULL, in which case this function - * returns immediately. If it is not \c NULL, it must - * point to an initialized Blowfish context. - */ -void mbedtls_blowfish_free( mbedtls_blowfish_context *ctx ); - -/** - * \brief Perform a Blowfish key schedule operation. - * - * \param ctx The Blowfish context to perform the key schedule on. - * \param key The encryption key. This must be a readable buffer of - * length \p keybits Bits. - * \param keybits The length of \p key in Bits. This must be between - * \c 32 and \c 448 and a multiple of \c 8. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_blowfish_setkey( mbedtls_blowfish_context *ctx, const unsigned char *key, - unsigned int keybits ); - -/** - * \brief Perform a Blowfish-ECB block encryption/decryption operation. - * - * \param ctx The Blowfish context to use. This must be initialized - * and bound to a key. - * \param mode The mode of operation. Possible values are - * #MBEDTLS_BLOWFISH_ENCRYPT for encryption, or - * #MBEDTLS_BLOWFISH_DECRYPT for decryption. - * \param input The input block. This must be a readable buffer - * of size \c 8 Bytes. - * \param output The output block. This must be a writable buffer - * of size \c 8 Bytes. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_blowfish_crypt_ecb( mbedtls_blowfish_context *ctx, - int mode, - const unsigned char input[MBEDTLS_BLOWFISH_BLOCKSIZE], - unsigned char output[MBEDTLS_BLOWFISH_BLOCKSIZE] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief Perform a Blowfish-CBC buffer encryption/decryption operation. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx The Blowfish context to use. This must be initialized - * and bound to a key. - * \param mode The mode of operation. Possible values are - * #MBEDTLS_BLOWFISH_ENCRYPT for encryption, or - * #MBEDTLS_BLOWFISH_DECRYPT for decryption. - * \param length The length of the input data in Bytes. This must be - * multiple of \c 8. - * \param iv The initialization vector. This must be a read/write buffer - * of length \c 8 Bytes. It is updated by this function. - * \param input The input data. This must be a readable buffer of length - * \p length Bytes. - * \param output The output data. This must be a writable buffer of length - * \p length Bytes. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_blowfish_crypt_cbc( mbedtls_blowfish_context *ctx, - int mode, - size_t length, - unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -#if defined(MBEDTLS_CIPHER_MODE_CFB) -/** - * \brief Perform a Blowfish CFB buffer encryption/decryption operation. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx The Blowfish context to use. This must be initialized - * and bound to a key. - * \param mode The mode of operation. Possible values are - * #MBEDTLS_BLOWFISH_ENCRYPT for encryption, or - * #MBEDTLS_BLOWFISH_DECRYPT for decryption. - * \param length The length of the input data in Bytes. - * \param iv_off The offset in the initialiation vector. - * The value pointed to must be smaller than \c 8 Bytes. - * It is updated by this function to support the aforementioned - * streaming usage. - * \param iv The initialization vector. This must be a read/write buffer - * of size \c 8 Bytes. It is updated after use. - * \param input The input data. This must be a readable buffer of length - * \p length Bytes. - * \param output The output data. This must be a writable buffer of length - * \p length Bytes. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_blowfish_crypt_cfb64( mbedtls_blowfish_context *ctx, - int mode, - size_t length, - size_t *iv_off, - unsigned char iv[MBEDTLS_BLOWFISH_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /*MBEDTLS_CIPHER_MODE_CFB */ - -#if defined(MBEDTLS_CIPHER_MODE_CTR) -/** - * \brief Perform a Blowfish-CTR buffer encryption/decryption operation. - * - * \warning You must never reuse a nonce value with the same key. Doing so - * would void the encryption for the two messages encrypted with - * the same nonce and key. - * - * There are two common strategies for managing nonces with CTR: - * - * 1. You can handle everything as a single message processed over - * successive calls to this function. In that case, you want to - * set \p nonce_counter and \p nc_off to 0 for the first call, and - * then preserve the values of \p nonce_counter, \p nc_off and \p - * stream_block across calls to this function as they will be - * updated by this function. - * - * With this strategy, you must not encrypt more than 2**64 - * blocks of data with the same key. - * - * 2. You can encrypt separate messages by dividing the \p - * nonce_counter buffer in two areas: the first one used for a - * per-message nonce, handled by yourself, and the second one - * updated by this function internally. - * - * For example, you might reserve the first 4 bytes for the - * per-message nonce, and the last 4 bytes for internal use. In that - * case, before calling this function on a new message you need to - * set the first 4 bytes of \p nonce_counter to your chosen nonce - * value, the last 4 to 0, and \p nc_off to 0 (which will cause \p - * stream_block to be ignored). That way, you can encrypt at most - * 2**32 messages of up to 2**32 blocks each with the same key. - * - * The per-message nonce (or information sufficient to reconstruct - * it) needs to be communicated with the ciphertext and must be unique. - * The recommended way to ensure uniqueness is to use a message - * counter. - * - * Note that for both stategies, sizes are measured in blocks and - * that a Blowfish block is 8 bytes. - * - * \warning Upon return, \p stream_block contains sensitive data. Its - * content must not be written to insecure storage and should be - * securely discarded as soon as it's no longer needed. - * - * \param ctx The Blowfish context to use. This must be initialized - * and bound to a key. - * \param length The length of the input data in Bytes. - * \param nc_off The offset in the current stream_block (for resuming - * within current cipher stream). The offset pointer - * should be \c 0 at the start of a stream and must be - * smaller than \c 8. It is updated by this function. - * \param nonce_counter The 64-bit nonce and counter. This must point to a - * read/write buffer of length \c 8 Bytes. - * \param stream_block The saved stream-block for resuming. This must point to - * a read/write buffer of length \c 8 Bytes. - * \param input The input data. This must be a readable buffer of - * length \p length Bytes. - * \param output The output data. This must be a writable buffer of - * length \p length Bytes. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_blowfish_crypt_ctr( mbedtls_blowfish_context *ctx, - size_t length, - size_t *nc_off, - unsigned char nonce_counter[MBEDTLS_BLOWFISH_BLOCKSIZE], - unsigned char stream_block[MBEDTLS_BLOWFISH_BLOCKSIZE], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CTR */ - -#ifdef __cplusplus -} -#endif - -#endif /* blowfish.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/bn_mul.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/bn_mul.h deleted file mode 100644 index 163869ae7..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/bn_mul.h +++ /dev/null @@ -1,940 +0,0 @@ -/** - * \file bn_mul.h - * - * \brief Multi-precision integer library - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -/* - * Multiply source vector [s] with b, add result - * to destination vector [d] and set carry c. - * - * Currently supports: - * - * . IA-32 (386+) . AMD64 / EM64T - * . IA-32 (SSE2) . Motorola 68000 - * . PowerPC, 32-bit . MicroBlaze - * . PowerPC, 64-bit . TriCore - * . SPARC v8 . ARM v3+ - * . Alpha . MIPS32 - * . C, longlong . C, generic - */ -#ifndef MBEDTLS_BN_MUL_H -#define MBEDTLS_BN_MUL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/bignum.h" - -#if defined(MBEDTLS_HAVE_ASM) - -#ifndef asm -#define asm __asm -#endif - -/* armcc5 --gnu defines __GNUC__ but doesn't support GNU's extended asm */ -#if defined(__GNUC__) && \ - ( !defined(__ARMCC_VERSION) || __ARMCC_VERSION >= 6000000 ) - -/* - * Disable use of the i386 assembly code below if option -O0, to disable all - * compiler optimisations, is passed, detected with __OPTIMIZE__ - * This is done as the number of registers used in the assembly code doesn't - * work with the -O0 option. - */ -#if defined(__i386__) && defined(__OPTIMIZE__) - -#define MULADDC_INIT \ - asm( \ - "movl %%ebx, %0 \n\t" \ - "movl %5, %%esi \n\t" \ - "movl %6, %%edi \n\t" \ - "movl %7, %%ecx \n\t" \ - "movl %8, %%ebx \n\t" - -#define MULADDC_CORE \ - "lodsl \n\t" \ - "mull %%ebx \n\t" \ - "addl %%ecx, %%eax \n\t" \ - "adcl $0, %%edx \n\t" \ - "addl (%%edi), %%eax \n\t" \ - "adcl $0, %%edx \n\t" \ - "movl %%edx, %%ecx \n\t" \ - "stosl \n\t" - -#if defined(MBEDTLS_HAVE_SSE2) - -#define MULADDC_HUIT \ - "movd %%ecx, %%mm1 \n\t" \ - "movd %%ebx, %%mm0 \n\t" \ - "movd (%%edi), %%mm3 \n\t" \ - "paddq %%mm3, %%mm1 \n\t" \ - "movd (%%esi), %%mm2 \n\t" \ - "pmuludq %%mm0, %%mm2 \n\t" \ - "movd 4(%%esi), %%mm4 \n\t" \ - "pmuludq %%mm0, %%mm4 \n\t" \ - "movd 8(%%esi), %%mm6 \n\t" \ - "pmuludq %%mm0, %%mm6 \n\t" \ - "movd 12(%%esi), %%mm7 \n\t" \ - "pmuludq %%mm0, %%mm7 \n\t" \ - "paddq %%mm2, %%mm1 \n\t" \ - "movd 4(%%edi), %%mm3 \n\t" \ - "paddq %%mm4, %%mm3 \n\t" \ - "movd 8(%%edi), %%mm5 \n\t" \ - "paddq %%mm6, %%mm5 \n\t" \ - "movd 12(%%edi), %%mm4 \n\t" \ - "paddq %%mm4, %%mm7 \n\t" \ - "movd %%mm1, (%%edi) \n\t" \ - "movd 16(%%esi), %%mm2 \n\t" \ - "pmuludq %%mm0, %%mm2 \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "movd 20(%%esi), %%mm4 \n\t" \ - "pmuludq %%mm0, %%mm4 \n\t" \ - "paddq %%mm3, %%mm1 \n\t" \ - "movd 24(%%esi), %%mm6 \n\t" \ - "pmuludq %%mm0, %%mm6 \n\t" \ - "movd %%mm1, 4(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "movd 28(%%esi), %%mm3 \n\t" \ - "pmuludq %%mm0, %%mm3 \n\t" \ - "paddq %%mm5, %%mm1 \n\t" \ - "movd 16(%%edi), %%mm5 \n\t" \ - "paddq %%mm5, %%mm2 \n\t" \ - "movd %%mm1, 8(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "paddq %%mm7, %%mm1 \n\t" \ - "movd 20(%%edi), %%mm5 \n\t" \ - "paddq %%mm5, %%mm4 \n\t" \ - "movd %%mm1, 12(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "paddq %%mm2, %%mm1 \n\t" \ - "movd 24(%%edi), %%mm5 \n\t" \ - "paddq %%mm5, %%mm6 \n\t" \ - "movd %%mm1, 16(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "paddq %%mm4, %%mm1 \n\t" \ - "movd 28(%%edi), %%mm5 \n\t" \ - "paddq %%mm5, %%mm3 \n\t" \ - "movd %%mm1, 20(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "paddq %%mm6, %%mm1 \n\t" \ - "movd %%mm1, 24(%%edi) \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "paddq %%mm3, %%mm1 \n\t" \ - "movd %%mm1, 28(%%edi) \n\t" \ - "addl $32, %%edi \n\t" \ - "addl $32, %%esi \n\t" \ - "psrlq $32, %%mm1 \n\t" \ - "movd %%mm1, %%ecx \n\t" - -#define MULADDC_STOP \ - "emms \n\t" \ - "movl %4, %%ebx \n\t" \ - "movl %%ecx, %1 \n\t" \ - "movl %%edi, %2 \n\t" \ - "movl %%esi, %3 \n\t" \ - : "=m" (t), "=m" (c), "=m" (d), "=m" (s) \ - : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b) \ - : "eax", "ebx", "ecx", "edx", "esi", "edi" \ - ); - -#else - -#define MULADDC_STOP \ - "movl %4, %%ebx \n\t" \ - "movl %%ecx, %1 \n\t" \ - "movl %%edi, %2 \n\t" \ - "movl %%esi, %3 \n\t" \ - : "=m" (t), "=m" (c), "=m" (d), "=m" (s) \ - : "m" (t), "m" (s), "m" (d), "m" (c), "m" (b) \ - : "eax", "ebx", "ecx", "edx", "esi", "edi" \ - ); -#endif /* SSE2 */ -#endif /* i386 */ - -#if defined(__amd64__) || defined (__x86_64__) - -#define MULADDC_INIT \ - asm( \ - "xorq %%r8, %%r8\n" - -#define MULADDC_CORE \ - "movq (%%rsi), %%rax\n" \ - "mulq %%rbx\n" \ - "addq $8, %%rsi\n" \ - "addq %%rcx, %%rax\n" \ - "movq %%r8, %%rcx\n" \ - "adcq $0, %%rdx\n" \ - "nop \n" \ - "addq %%rax, (%%rdi)\n" \ - "adcq %%rdx, %%rcx\n" \ - "addq $8, %%rdi\n" - -#define MULADDC_STOP \ - : "+c" (c), "+D" (d), "+S" (s) \ - : "b" (b) \ - : "rax", "rdx", "r8" \ - ); - -#endif /* AMD64 */ - -#if defined(__aarch64__) - -#define MULADDC_INIT \ - asm( - -#define MULADDC_CORE \ - "ldr x4, [%2], #8 \n\t" \ - "ldr x5, [%1] \n\t" \ - "mul x6, x4, %3 \n\t" \ - "umulh x7, x4, %3 \n\t" \ - "adds x5, x5, x6 \n\t" \ - "adc x7, x7, xzr \n\t" \ - "adds x5, x5, %0 \n\t" \ - "adc %0, x7, xzr \n\t" \ - "str x5, [%1], #8 \n\t" - -#define MULADDC_STOP \ - : "+r" (c), "+r" (d), "+r" (s) \ - : "r" (b) \ - : "x4", "x5", "x6", "x7", "cc" \ - ); - -#endif /* Aarch64 */ - -#if defined(__mc68020__) || defined(__mcpu32__) - -#define MULADDC_INIT \ - asm( \ - "movl %3, %%a2 \n\t" \ - "movl %4, %%a3 \n\t" \ - "movl %5, %%d3 \n\t" \ - "movl %6, %%d2 \n\t" \ - "moveq #0, %%d0 \n\t" - -#define MULADDC_CORE \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d4:%%d1 \n\t" \ - "addl %%d3, %%d1 \n\t" \ - "addxl %%d0, %%d4 \n\t" \ - "moveq #0, %%d3 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "addxl %%d4, %%d3 \n\t" - -#define MULADDC_STOP \ - "movl %%d3, %0 \n\t" \ - "movl %%a3, %1 \n\t" \ - "movl %%a2, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "d0", "d1", "d2", "d3", "d4", "a2", "a3" \ - ); - -#define MULADDC_HUIT \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d4:%%d1 \n\t" \ - "addxl %%d3, %%d1 \n\t" \ - "addxl %%d0, %%d4 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d3:%%d1 \n\t" \ - "addxl %%d4, %%d1 \n\t" \ - "addxl %%d0, %%d3 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d4:%%d1 \n\t" \ - "addxl %%d3, %%d1 \n\t" \ - "addxl %%d0, %%d4 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d3:%%d1 \n\t" \ - "addxl %%d4, %%d1 \n\t" \ - "addxl %%d0, %%d3 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d4:%%d1 \n\t" \ - "addxl %%d3, %%d1 \n\t" \ - "addxl %%d0, %%d4 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d3:%%d1 \n\t" \ - "addxl %%d4, %%d1 \n\t" \ - "addxl %%d0, %%d3 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d4:%%d1 \n\t" \ - "addxl %%d3, %%d1 \n\t" \ - "addxl %%d0, %%d4 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "movel %%a2@+, %%d1 \n\t" \ - "mulul %%d2, %%d3:%%d1 \n\t" \ - "addxl %%d4, %%d1 \n\t" \ - "addxl %%d0, %%d3 \n\t" \ - "addl %%d1, %%a3@+ \n\t" \ - "addxl %%d0, %%d3 \n\t" - -#endif /* MC68000 */ - -#if defined(__powerpc64__) || defined(__ppc64__) - -#if defined(__MACH__) && defined(__APPLE__) - -#define MULADDC_INIT \ - asm( \ - "ld r3, %3 \n\t" \ - "ld r4, %4 \n\t" \ - "ld r5, %5 \n\t" \ - "ld r6, %6 \n\t" \ - "addi r3, r3, -8 \n\t" \ - "addi r4, r4, -8 \n\t" \ - "addic r5, r5, 0 \n\t" - -#define MULADDC_CORE \ - "ldu r7, 8(r3) \n\t" \ - "mulld r8, r7, r6 \n\t" \ - "mulhdu r9, r7, r6 \n\t" \ - "adde r8, r8, r5 \n\t" \ - "ld r7, 8(r4) \n\t" \ - "addze r5, r9 \n\t" \ - "addc r8, r8, r7 \n\t" \ - "stdu r8, 8(r4) \n\t" - -#define MULADDC_STOP \ - "addze r5, r5 \n\t" \ - "addi r4, r4, 8 \n\t" \ - "addi r3, r3, 8 \n\t" \ - "std r5, %0 \n\t" \ - "std r4, %1 \n\t" \ - "std r3, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ - ); - - -#else /* __MACH__ && __APPLE__ */ - -#define MULADDC_INIT \ - asm( \ - "ld %%r3, %3 \n\t" \ - "ld %%r4, %4 \n\t" \ - "ld %%r5, %5 \n\t" \ - "ld %%r6, %6 \n\t" \ - "addi %%r3, %%r3, -8 \n\t" \ - "addi %%r4, %%r4, -8 \n\t" \ - "addic %%r5, %%r5, 0 \n\t" - -#define MULADDC_CORE \ - "ldu %%r7, 8(%%r3) \n\t" \ - "mulld %%r8, %%r7, %%r6 \n\t" \ - "mulhdu %%r9, %%r7, %%r6 \n\t" \ - "adde %%r8, %%r8, %%r5 \n\t" \ - "ld %%r7, 8(%%r4) \n\t" \ - "addze %%r5, %%r9 \n\t" \ - "addc %%r8, %%r8, %%r7 \n\t" \ - "stdu %%r8, 8(%%r4) \n\t" - -#define MULADDC_STOP \ - "addze %%r5, %%r5 \n\t" \ - "addi %%r4, %%r4, 8 \n\t" \ - "addi %%r3, %%r3, 8 \n\t" \ - "std %%r5, %0 \n\t" \ - "std %%r4, %1 \n\t" \ - "std %%r3, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ - ); - -#endif /* __MACH__ && __APPLE__ */ - -#elif defined(__powerpc__) || defined(__ppc__) /* end PPC64/begin PPC32 */ - -#if defined(__MACH__) && defined(__APPLE__) - -#define MULADDC_INIT \ - asm( \ - "lwz r3, %3 \n\t" \ - "lwz r4, %4 \n\t" \ - "lwz r5, %5 \n\t" \ - "lwz r6, %6 \n\t" \ - "addi r3, r3, -4 \n\t" \ - "addi r4, r4, -4 \n\t" \ - "addic r5, r5, 0 \n\t" - -#define MULADDC_CORE \ - "lwzu r7, 4(r3) \n\t" \ - "mullw r8, r7, r6 \n\t" \ - "mulhwu r9, r7, r6 \n\t" \ - "adde r8, r8, r5 \n\t" \ - "lwz r7, 4(r4) \n\t" \ - "addze r5, r9 \n\t" \ - "addc r8, r8, r7 \n\t" \ - "stwu r8, 4(r4) \n\t" - -#define MULADDC_STOP \ - "addze r5, r5 \n\t" \ - "addi r4, r4, 4 \n\t" \ - "addi r3, r3, 4 \n\t" \ - "stw r5, %0 \n\t" \ - "stw r4, %1 \n\t" \ - "stw r3, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ - ); - -#else /* __MACH__ && __APPLE__ */ - -#define MULADDC_INIT \ - asm( \ - "lwz %%r3, %3 \n\t" \ - "lwz %%r4, %4 \n\t" \ - "lwz %%r5, %5 \n\t" \ - "lwz %%r6, %6 \n\t" \ - "addi %%r3, %%r3, -4 \n\t" \ - "addi %%r4, %%r4, -4 \n\t" \ - "addic %%r5, %%r5, 0 \n\t" - -#define MULADDC_CORE \ - "lwzu %%r7, 4(%%r3) \n\t" \ - "mullw %%r8, %%r7, %%r6 \n\t" \ - "mulhwu %%r9, %%r7, %%r6 \n\t" \ - "adde %%r8, %%r8, %%r5 \n\t" \ - "lwz %%r7, 4(%%r4) \n\t" \ - "addze %%r5, %%r9 \n\t" \ - "addc %%r8, %%r8, %%r7 \n\t" \ - "stwu %%r8, 4(%%r4) \n\t" - -#define MULADDC_STOP \ - "addze %%r5, %%r5 \n\t" \ - "addi %%r4, %%r4, 4 \n\t" \ - "addi %%r3, %%r3, 4 \n\t" \ - "stw %%r5, %0 \n\t" \ - "stw %%r4, %1 \n\t" \ - "stw %%r3, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r3", "r4", "r5", "r6", "r7", "r8", "r9" \ - ); - -#endif /* __MACH__ && __APPLE__ */ - -#endif /* PPC32 */ - -/* - * The Sparc(64) assembly is reported to be broken. - * Disable it for now, until we're able to fix it. - */ -#if 0 && defined(__sparc__) -#if defined(__sparc64__) - -#define MULADDC_INIT \ - asm( \ - "ldx %3, %%o0 \n\t" \ - "ldx %4, %%o1 \n\t" \ - "ld %5, %%o2 \n\t" \ - "ld %6, %%o3 \n\t" - -#define MULADDC_CORE \ - "ld [%%o0], %%o4 \n\t" \ - "inc 4, %%o0 \n\t" \ - "ld [%%o1], %%o5 \n\t" \ - "umul %%o3, %%o4, %%o4 \n\t" \ - "addcc %%o4, %%o2, %%o4 \n\t" \ - "rd %%y, %%g1 \n\t" \ - "addx %%g1, 0, %%g1 \n\t" \ - "addcc %%o4, %%o5, %%o4 \n\t" \ - "st %%o4, [%%o1] \n\t" \ - "addx %%g1, 0, %%o2 \n\t" \ - "inc 4, %%o1 \n\t" - - #define MULADDC_STOP \ - "st %%o2, %0 \n\t" \ - "stx %%o1, %1 \n\t" \ - "stx %%o0, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "g1", "o0", "o1", "o2", "o3", "o4", \ - "o5" \ - ); - -#else /* __sparc64__ */ - -#define MULADDC_INIT \ - asm( \ - "ld %3, %%o0 \n\t" \ - "ld %4, %%o1 \n\t" \ - "ld %5, %%o2 \n\t" \ - "ld %6, %%o3 \n\t" - -#define MULADDC_CORE \ - "ld [%%o0], %%o4 \n\t" \ - "inc 4, %%o0 \n\t" \ - "ld [%%o1], %%o5 \n\t" \ - "umul %%o3, %%o4, %%o4 \n\t" \ - "addcc %%o4, %%o2, %%o4 \n\t" \ - "rd %%y, %%g1 \n\t" \ - "addx %%g1, 0, %%g1 \n\t" \ - "addcc %%o4, %%o5, %%o4 \n\t" \ - "st %%o4, [%%o1] \n\t" \ - "addx %%g1, 0, %%o2 \n\t" \ - "inc 4, %%o1 \n\t" - -#define MULADDC_STOP \ - "st %%o2, %0 \n\t" \ - "st %%o1, %1 \n\t" \ - "st %%o0, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "g1", "o0", "o1", "o2", "o3", "o4", \ - "o5" \ - ); - -#endif /* __sparc64__ */ -#endif /* __sparc__ */ - -#if defined(__microblaze__) || defined(microblaze) - -#define MULADDC_INIT \ - asm( \ - "lwi r3, %3 \n\t" \ - "lwi r4, %4 \n\t" \ - "lwi r5, %5 \n\t" \ - "lwi r6, %6 \n\t" \ - "andi r7, r6, 0xffff \n\t" \ - "bsrli r6, r6, 16 \n\t" - -#define MULADDC_CORE \ - "lhui r8, r3, 0 \n\t" \ - "addi r3, r3, 2 \n\t" \ - "lhui r9, r3, 0 \n\t" \ - "addi r3, r3, 2 \n\t" \ - "mul r10, r9, r6 \n\t" \ - "mul r11, r8, r7 \n\t" \ - "mul r12, r9, r7 \n\t" \ - "mul r13, r8, r6 \n\t" \ - "bsrli r8, r10, 16 \n\t" \ - "bsrli r9, r11, 16 \n\t" \ - "add r13, r13, r8 \n\t" \ - "add r13, r13, r9 \n\t" \ - "bslli r10, r10, 16 \n\t" \ - "bslli r11, r11, 16 \n\t" \ - "add r12, r12, r10 \n\t" \ - "addc r13, r13, r0 \n\t" \ - "add r12, r12, r11 \n\t" \ - "addc r13, r13, r0 \n\t" \ - "lwi r10, r4, 0 \n\t" \ - "add r12, r12, r10 \n\t" \ - "addc r13, r13, r0 \n\t" \ - "add r12, r12, r5 \n\t" \ - "addc r5, r13, r0 \n\t" \ - "swi r12, r4, 0 \n\t" \ - "addi r4, r4, 4 \n\t" - -#define MULADDC_STOP \ - "swi r5, %0 \n\t" \ - "swi r4, %1 \n\t" \ - "swi r3, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r3", "r4", "r5", "r6", "r7", "r8", \ - "r9", "r10", "r11", "r12", "r13" \ - ); - -#endif /* MicroBlaze */ - -#if defined(__tricore__) - -#define MULADDC_INIT \ - asm( \ - "ld.a %%a2, %3 \n\t" \ - "ld.a %%a3, %4 \n\t" \ - "ld.w %%d4, %5 \n\t" \ - "ld.w %%d1, %6 \n\t" \ - "xor %%d5, %%d5 \n\t" - -#define MULADDC_CORE \ - "ld.w %%d0, [%%a2+] \n\t" \ - "madd.u %%e2, %%e4, %%d0, %%d1 \n\t" \ - "ld.w %%d0, [%%a3] \n\t" \ - "addx %%d2, %%d2, %%d0 \n\t" \ - "addc %%d3, %%d3, 0 \n\t" \ - "mov %%d4, %%d3 \n\t" \ - "st.w [%%a3+], %%d2 \n\t" - -#define MULADDC_STOP \ - "st.w %0, %%d4 \n\t" \ - "st.a %1, %%a3 \n\t" \ - "st.a %2, %%a2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "d0", "d1", "e2", "d4", "a2", "a3" \ - ); - -#endif /* TriCore */ - -/* - * Note, gcc -O0 by default uses r7 for the frame pointer, so it complains about - * our use of r7 below, unless -fomit-frame-pointer is passed. - * - * On the other hand, -fomit-frame-pointer is implied by any -Ox options with - * x !=0, which we can detect using __OPTIMIZE__ (which is also defined by - * clang and armcc5 under the same conditions). - * - * So, only use the optimized assembly below for optimized build, which avoids - * the build error and is pretty reasonable anyway. - */ -#if defined(__GNUC__) && !defined(__OPTIMIZE__) -#define MULADDC_CANNOT_USE_R7 -#endif - -#if defined(__arm__) && !defined(MULADDC_CANNOT_USE_R7) - -#if defined(__thumb__) && !defined(__thumb2__) - -#define MULADDC_INIT \ - asm( \ - "ldr r0, %3 \n\t" \ - "ldr r1, %4 \n\t" \ - "ldr r2, %5 \n\t" \ - "ldr r3, %6 \n\t" \ - "lsr r7, r3, #16 \n\t" \ - "mov r9, r7 \n\t" \ - "lsl r7, r3, #16 \n\t" \ - "lsr r7, r7, #16 \n\t" \ - "mov r8, r7 \n\t" - -#define MULADDC_CORE \ - "ldmia r0!, {r6} \n\t" \ - "lsr r7, r6, #16 \n\t" \ - "lsl r6, r6, #16 \n\t" \ - "lsr r6, r6, #16 \n\t" \ - "mov r4, r8 \n\t" \ - "mul r4, r6 \n\t" \ - "mov r3, r9 \n\t" \ - "mul r6, r3 \n\t" \ - "mov r5, r9 \n\t" \ - "mul r5, r7 \n\t" \ - "mov r3, r8 \n\t" \ - "mul r7, r3 \n\t" \ - "lsr r3, r6, #16 \n\t" \ - "add r5, r5, r3 \n\t" \ - "lsr r3, r7, #16 \n\t" \ - "add r5, r5, r3 \n\t" \ - "add r4, r4, r2 \n\t" \ - "mov r2, #0 \n\t" \ - "adc r5, r2 \n\t" \ - "lsl r3, r6, #16 \n\t" \ - "add r4, r4, r3 \n\t" \ - "adc r5, r2 \n\t" \ - "lsl r3, r7, #16 \n\t" \ - "add r4, r4, r3 \n\t" \ - "adc r5, r2 \n\t" \ - "ldr r3, [r1] \n\t" \ - "add r4, r4, r3 \n\t" \ - "adc r2, r5 \n\t" \ - "stmia r1!, {r4} \n\t" - -#define MULADDC_STOP \ - "str r2, %0 \n\t" \ - "str r1, %1 \n\t" \ - "str r0, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r0", "r1", "r2", "r3", "r4", "r5", \ - "r6", "r7", "r8", "r9", "cc" \ - ); - -#elif (__ARM_ARCH >= 6) && \ - defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) - -#define MULADDC_INIT \ - asm( - -#define MULADDC_CORE \ - "ldr r0, [%0], #4 \n\t" \ - "ldr r1, [%1] \n\t" \ - "umaal r1, %2, %3, r0 \n\t" \ - "str r1, [%1], #4 \n\t" - -#define MULADDC_STOP \ - : "=r" (s), "=r" (d), "=r" (c) \ - : "r" (b), "0" (s), "1" (d), "2" (c) \ - : "r0", "r1", "memory" \ - ); - -#else - -#define MULADDC_INIT \ - asm( \ - "ldr r0, %3 \n\t" \ - "ldr r1, %4 \n\t" \ - "ldr r2, %5 \n\t" \ - "ldr r3, %6 \n\t" - -#define MULADDC_CORE \ - "ldr r4, [r0], #4 \n\t" \ - "mov r5, #0 \n\t" \ - "ldr r6, [r1] \n\t" \ - "umlal r2, r5, r3, r4 \n\t" \ - "adds r7, r6, r2 \n\t" \ - "adc r2, r5, #0 \n\t" \ - "str r7, [r1], #4 \n\t" - -#define MULADDC_STOP \ - "str r2, %0 \n\t" \ - "str r1, %1 \n\t" \ - "str r0, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "r0", "r1", "r2", "r3", "r4", "r5", \ - "r6", "r7", "cc" \ - ); - -#endif /* Thumb */ - -#endif /* ARMv3 */ - -#if defined(__alpha__) - -#define MULADDC_INIT \ - asm( \ - "ldq $1, %3 \n\t" \ - "ldq $2, %4 \n\t" \ - "ldq $3, %5 \n\t" \ - "ldq $4, %6 \n\t" - -#define MULADDC_CORE \ - "ldq $6, 0($1) \n\t" \ - "addq $1, 8, $1 \n\t" \ - "mulq $6, $4, $7 \n\t" \ - "umulh $6, $4, $6 \n\t" \ - "addq $7, $3, $7 \n\t" \ - "cmpult $7, $3, $3 \n\t" \ - "ldq $5, 0($2) \n\t" \ - "addq $7, $5, $7 \n\t" \ - "cmpult $7, $5, $5 \n\t" \ - "stq $7, 0($2) \n\t" \ - "addq $2, 8, $2 \n\t" \ - "addq $6, $3, $3 \n\t" \ - "addq $5, $3, $3 \n\t" - -#define MULADDC_STOP \ - "stq $3, %0 \n\t" \ - "stq $2, %1 \n\t" \ - "stq $1, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "$1", "$2", "$3", "$4", "$5", "$6", "$7" \ - ); -#endif /* Alpha */ - -#if defined(__mips__) && !defined(__mips64) - -#define MULADDC_INIT \ - asm( \ - "lw $10, %3 \n\t" \ - "lw $11, %4 \n\t" \ - "lw $12, %5 \n\t" \ - "lw $13, %6 \n\t" - -#define MULADDC_CORE \ - "lw $14, 0($10) \n\t" \ - "multu $13, $14 \n\t" \ - "addi $10, $10, 4 \n\t" \ - "mflo $14 \n\t" \ - "mfhi $9 \n\t" \ - "addu $14, $12, $14 \n\t" \ - "lw $15, 0($11) \n\t" \ - "sltu $12, $14, $12 \n\t" \ - "addu $15, $14, $15 \n\t" \ - "sltu $14, $15, $14 \n\t" \ - "addu $12, $12, $9 \n\t" \ - "sw $15, 0($11) \n\t" \ - "addu $12, $12, $14 \n\t" \ - "addi $11, $11, 4 \n\t" - -#define MULADDC_STOP \ - "sw $12, %0 \n\t" \ - "sw $11, %1 \n\t" \ - "sw $10, %2 \n\t" \ - : "=m" (c), "=m" (d), "=m" (s) \ - : "m" (s), "m" (d), "m" (c), "m" (b) \ - : "$9", "$10", "$11", "$12", "$13", "$14", "$15", "lo", "hi" \ - ); - -#endif /* MIPS */ -#endif /* GNUC */ - -#if (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__) - -#define MULADDC_INIT \ - __asm mov esi, s \ - __asm mov edi, d \ - __asm mov ecx, c \ - __asm mov ebx, b - -#define MULADDC_CORE \ - __asm lodsd \ - __asm mul ebx \ - __asm add eax, ecx \ - __asm adc edx, 0 \ - __asm add eax, [edi] \ - __asm adc edx, 0 \ - __asm mov ecx, edx \ - __asm stosd - -#if defined(MBEDTLS_HAVE_SSE2) - -#define EMIT __asm _emit - -#define MULADDC_HUIT \ - EMIT 0x0F EMIT 0x6E EMIT 0xC9 \ - EMIT 0x0F EMIT 0x6E EMIT 0xC3 \ - EMIT 0x0F EMIT 0x6E EMIT 0x1F \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCB \ - EMIT 0x0F EMIT 0x6E EMIT 0x16 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xD0 \ - EMIT 0x0F EMIT 0x6E EMIT 0x66 EMIT 0x04 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xE0 \ - EMIT 0x0F EMIT 0x6E EMIT 0x76 EMIT 0x08 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xF0 \ - EMIT 0x0F EMIT 0x6E EMIT 0x7E EMIT 0x0C \ - EMIT 0x0F EMIT 0xF4 EMIT 0xF8 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCA \ - EMIT 0x0F EMIT 0x6E EMIT 0x5F EMIT 0x04 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xDC \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x08 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xEE \ - EMIT 0x0F EMIT 0x6E EMIT 0x67 EMIT 0x0C \ - EMIT 0x0F EMIT 0xD4 EMIT 0xFC \ - EMIT 0x0F EMIT 0x7E EMIT 0x0F \ - EMIT 0x0F EMIT 0x6E EMIT 0x56 EMIT 0x10 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xD0 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0x6E EMIT 0x66 EMIT 0x14 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xE0 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCB \ - EMIT 0x0F EMIT 0x6E EMIT 0x76 EMIT 0x18 \ - EMIT 0x0F EMIT 0xF4 EMIT 0xF0 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x04 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0x6E EMIT 0x5E EMIT 0x1C \ - EMIT 0x0F EMIT 0xF4 EMIT 0xD8 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCD \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x10 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xD5 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x08 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCF \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x14 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xE5 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x0C \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCA \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x18 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xF5 \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x10 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCC \ - EMIT 0x0F EMIT 0x6E EMIT 0x6F EMIT 0x1C \ - EMIT 0x0F EMIT 0xD4 EMIT 0xDD \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x14 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCE \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x18 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0xD4 EMIT 0xCB \ - EMIT 0x0F EMIT 0x7E EMIT 0x4F EMIT 0x1C \ - EMIT 0x83 EMIT 0xC7 EMIT 0x20 \ - EMIT 0x83 EMIT 0xC6 EMIT 0x20 \ - EMIT 0x0F EMIT 0x73 EMIT 0xD1 EMIT 0x20 \ - EMIT 0x0F EMIT 0x7E EMIT 0xC9 - -#define MULADDC_STOP \ - EMIT 0x0F EMIT 0x77 \ - __asm mov c, ecx \ - __asm mov d, edi \ - __asm mov s, esi \ - -#else - -#define MULADDC_STOP \ - __asm mov c, ecx \ - __asm mov d, edi \ - __asm mov s, esi \ - -#endif /* SSE2 */ -#endif /* MSVC */ - -#endif /* MBEDTLS_HAVE_ASM */ - -#if !defined(MULADDC_CORE) -#if defined(MBEDTLS_HAVE_UDBL) - -#define MULADDC_INIT \ -{ \ - mbedtls_t_udbl r; \ - mbedtls_mpi_uint r0, r1; - -#define MULADDC_CORE \ - r = *(s++) * (mbedtls_t_udbl) b; \ - r0 = (mbedtls_mpi_uint) r; \ - r1 = (mbedtls_mpi_uint)( r >> biL ); \ - r0 += c; r1 += (r0 < c); \ - r0 += *d; r1 += (r0 < *d); \ - c = r1; *(d++) = r0; - -#define MULADDC_STOP \ -} - -#else -#define MULADDC_INIT \ -{ \ - mbedtls_mpi_uint s0, s1, b0, b1; \ - mbedtls_mpi_uint r0, r1, rx, ry; \ - b0 = ( b << biH ) >> biH; \ - b1 = ( b >> biH ); - -#define MULADDC_CORE \ - s0 = ( *s << biH ) >> biH; \ - s1 = ( *s >> biH ); s++; \ - rx = s0 * b1; r0 = s0 * b0; \ - ry = s1 * b0; r1 = s1 * b1; \ - r1 += ( rx >> biH ); \ - r1 += ( ry >> biH ); \ - rx <<= biH; ry <<= biH; \ - r0 += rx; r1 += (r0 < rx); \ - r0 += ry; r1 += (r0 < ry); \ - r0 += c; r1 += (r0 < c); \ - r0 += *d; r1 += (r0 < *d); \ - c = r1; *(d++) = r0; - -#define MULADDC_STOP \ -} - -#endif /* C (generic) */ -#endif /* C (longlong) */ - -#endif /* bn_mul.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/camellia.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/camellia.h deleted file mode 100644 index a8324543c..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/camellia.h +++ /dev/null @@ -1,326 +0,0 @@ -/** - * \file camellia.h - * - * \brief Camellia block cipher - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_CAMELLIA_H -#define MBEDTLS_CAMELLIA_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#include "mbedtls/platform_util.h" - -#define MBEDTLS_CAMELLIA_ENCRYPT 1 -#define MBEDTLS_CAMELLIA_DECRYPT 0 - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( -0x0024 ) -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ -#define MBEDTLS_ERR_CAMELLIA_BAD_INPUT_DATA -0x0024 /**< Bad input data. */ - -#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026 /**< Invalid data input length. */ - -/* MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED is deprecated and should not be used. - */ -#define MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED -0x0027 /**< Camellia hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_CAMELLIA_ALT) -// Regular implementation -// - -/** - * \brief CAMELLIA context structure - */ -typedef struct mbedtls_camellia_context -{ - int nr; /*!< number of rounds */ - uint32_t rk[68]; /*!< CAMELLIA round keys */ -} -mbedtls_camellia_context; - -#else /* MBEDTLS_CAMELLIA_ALT */ -#include "camellia_alt.h" -#endif /* MBEDTLS_CAMELLIA_ALT */ - -/** - * \brief Initialize a CAMELLIA context. - * - * \param ctx The CAMELLIA context to be initialized. - * This must not be \c NULL. - */ -void mbedtls_camellia_init( mbedtls_camellia_context *ctx ); - -/** - * \brief Clear a CAMELLIA context. - * - * \param ctx The CAMELLIA context to be cleared. This may be \c NULL, - * in which case this function returns immediately. If it is not - * \c NULL, it must be initialized. - */ -void mbedtls_camellia_free( mbedtls_camellia_context *ctx ); - -/** - * \brief Perform a CAMELLIA key schedule operation for encryption. - * - * \param ctx The CAMELLIA context to use. This must be initialized. - * \param key The encryption key to use. This must be a readable buffer - * of size \p keybits Bits. - * \param keybits The length of \p key in Bits. This must be either \c 128, - * \c 192 or \c 256. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_camellia_setkey_enc( mbedtls_camellia_context *ctx, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief Perform a CAMELLIA key schedule operation for decryption. - * - * \param ctx The CAMELLIA context to use. This must be initialized. - * \param key The decryption key. This must be a readable buffer - * of size \p keybits Bits. - * \param keybits The length of \p key in Bits. This must be either \c 128, - * \c 192 or \c 256. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_camellia_setkey_dec( mbedtls_camellia_context *ctx, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief Perform a CAMELLIA-ECB block encryption/decryption operation. - * - * \param ctx The CAMELLIA context to use. This must be initialized - * and bound to a key. - * \param mode The mode of operation. This must be either - * #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT. - * \param input The input block. This must be a readable buffer - * of size \c 16 Bytes. - * \param output The output block. This must be a writable buffer - * of size \c 16 Bytes. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_camellia_crypt_ecb( mbedtls_camellia_context *ctx, - int mode, - const unsigned char input[16], - unsigned char output[16] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief Perform a CAMELLIA-CBC buffer encryption/decryption operation. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx The CAMELLIA context to use. This must be initialized - * and bound to a key. - * \param mode The mode of operation. This must be either - * #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT. - * \param length The length in Bytes of the input data \p input. - * This must be a multiple of \c 16 Bytes. - * \param iv The initialization vector. This must be a read/write buffer - * of length \c 16 Bytes. It is updated to allow streaming - * use as explained above. - * \param input The buffer holding the input data. This must point to a - * readable buffer of length \p length Bytes. - * \param output The buffer holding the output data. This must point to a - * writable buffer of length \p length Bytes. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_camellia_crypt_cbc( mbedtls_camellia_context *ctx, - int mode, - size_t length, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -#if defined(MBEDTLS_CIPHER_MODE_CFB) -/** - * \brief Perform a CAMELLIA-CFB128 buffer encryption/decryption - * operation. - * - * \note Due to the nature of CFB mode, you should use the same - * key for both encryption and decryption. In particular, calls - * to this function should be preceded by a key-schedule via - * mbedtls_camellia_setkey_enc() regardless of whether \p mode - * is #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT. - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx The CAMELLIA context to use. This must be initialized - * and bound to a key. - * \param mode The mode of operation. This must be either - * #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT. - * \param length The length of the input data \p input. Any value is allowed. - * \param iv_off The current offset in the IV. This must be smaller - * than \c 16 Bytes. It is updated after this call to allow - * the aforementioned streaming usage. - * \param iv The initialization vector. This must be a read/write buffer - * of length \c 16 Bytes. It is updated after this call to - * allow the aforementioned streaming usage. - * \param input The buffer holding the input data. This must be a readable - * buffer of size \p length Bytes. - * \param output The buffer to hold the output data. This must be a writable - * buffer of length \p length Bytes. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_camellia_crypt_cfb128( mbedtls_camellia_context *ctx, - int mode, - size_t length, - size_t *iv_off, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CFB */ - -#if defined(MBEDTLS_CIPHER_MODE_CTR) -/** - * \brief Perform a CAMELLIA-CTR buffer encryption/decryption operation. - * - * *note Due to the nature of CTR mode, you should use the same - * key for both encryption and decryption. In particular, calls - * to this function should be preceded by a key-schedule via - * mbedtls_camellia_setkey_enc() regardless of whether \p mode - * is #MBEDTLS_CAMELLIA_ENCRYPT or #MBEDTLS_CAMELLIA_DECRYPT. - * - * \warning You must never reuse a nonce value with the same key. Doing so - * would void the encryption for the two messages encrypted with - * the same nonce and key. - * - * There are two common strategies for managing nonces with CTR: - * - * 1. You can handle everything as a single message processed over - * successive calls to this function. In that case, you want to - * set \p nonce_counter and \p nc_off to 0 for the first call, and - * then preserve the values of \p nonce_counter, \p nc_off and \p - * stream_block across calls to this function as they will be - * updated by this function. - * - * With this strategy, you must not encrypt more than 2**128 - * blocks of data with the same key. - * - * 2. You can encrypt separate messages by dividing the \p - * nonce_counter buffer in two areas: the first one used for a - * per-message nonce, handled by yourself, and the second one - * updated by this function internally. - * - * For example, you might reserve the first \c 12 Bytes for the - * per-message nonce, and the last \c 4 Bytes for internal use. - * In that case, before calling this function on a new message you - * need to set the first \c 12 Bytes of \p nonce_counter to your - * chosen nonce value, the last four to \c 0, and \p nc_off to \c 0 - * (which will cause \p stream_block to be ignored). That way, you - * can encrypt at most \c 2**96 messages of up to \c 2**32 blocks - * each with the same key. - * - * The per-message nonce (or information sufficient to reconstruct - * it) needs to be communicated with the ciphertext and must be - * unique. The recommended way to ensure uniqueness is to use a - * message counter. An alternative is to generate random nonces, - * but this limits the number of messages that can be securely - * encrypted: for example, with 96-bit random nonces, you should - * not encrypt more than 2**32 messages with the same key. - * - * Note that for both stategies, sizes are measured in blocks and - * that a CAMELLIA block is \c 16 Bytes. - * - * \warning Upon return, \p stream_block contains sensitive data. Its - * content must not be written to insecure storage and should be - * securely discarded as soon as it's no longer needed. - * - * \param ctx The CAMELLIA context to use. This must be initialized - * and bound to a key. - * \param length The length of the input data \p input in Bytes. - * Any value is allowed. - * \param nc_off The offset in the current \p stream_block (for resuming - * within current cipher stream). The offset pointer to - * should be \c 0 at the start of a stream. It is updated - * at the end of this call. - * \param nonce_counter The 128-bit nonce and counter. This must be a read/write - * buffer of length \c 16 Bytes. - * \param stream_block The saved stream-block for resuming. This must be a - * read/write buffer of length \c 16 Bytes. - * \param input The input data stream. This must be a readable buffer of - * size \p length Bytes. - * \param output The output data stream. This must be a writable buffer - * of size \p length Bytes. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_camellia_crypt_ctr( mbedtls_camellia_context *ctx, - size_t length, - size_t *nc_off, - unsigned char nonce_counter[16], - unsigned char stream_block[16], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CTR */ - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_camellia_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* camellia.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ccm.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ccm.h deleted file mode 100644 index ceac36ca3..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ccm.h +++ /dev/null @@ -1,310 +0,0 @@ -/** - * \file ccm.h - * - * \brief This file provides an API for the CCM authenticated encryption - * mode for block ciphers. - * - * CCM combines Counter mode encryption with CBC-MAC authentication - * for 128-bit block ciphers. - * - * Input to CCM includes the following elements: - *
  • Payload - data that is both authenticated and encrypted.
  • - *
  • Associated data (Adata) - data that is authenticated but not - * encrypted, For example, a header.
  • - *
  • Nonce - A unique value that is assigned to the payload and the - * associated data.
- * - * Definition of CCM: - * http://csrc.nist.gov/publications/nistpubs/800-38C/SP800-38C_updated-July20_2007.pdf - * RFC 3610 "Counter with CBC-MAC (CCM)" - * - * Related: - * RFC 5116 "An Interface and Algorithms for Authenticated Encryption" - * - * Definition of CCM*: - * IEEE 802.15.4 - IEEE Standard for Local and metropolitan area networks - * Integer representation is fixed most-significant-octet-first order and - * the representation of octets is most-significant-bit-first order. This is - * consistent with RFC 3610. - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CCM_H -#define MBEDTLS_CCM_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/cipher.h" - -#define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D /**< Bad input parameters to the function. */ -#define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F /**< Authenticated decryption failed. */ - -/* MBEDTLS_ERR_CCM_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_CCM_HW_ACCEL_FAILED -0x0011 /**< CCM hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_CCM_ALT) -// Regular implementation -// - -/** - * \brief The CCM context-type definition. The CCM context is passed - * to the APIs called. - */ -typedef struct mbedtls_ccm_context -{ - mbedtls_cipher_context_t cipher_ctx; /*!< The cipher context used. */ -} -mbedtls_ccm_context; - -#else /* MBEDTLS_CCM_ALT */ -#include "ccm_alt.h" -#endif /* MBEDTLS_CCM_ALT */ - -/** - * \brief This function initializes the specified CCM context, - * to make references valid, and prepare the context - * for mbedtls_ccm_setkey() or mbedtls_ccm_free(). - * - * \param ctx The CCM context to initialize. This must not be \c NULL. - */ -void mbedtls_ccm_init( mbedtls_ccm_context *ctx ); - -/** - * \brief This function initializes the CCM context set in the - * \p ctx parameter and sets the encryption key. - * - * \param ctx The CCM context to initialize. This must be an initialized - * context. - * \param cipher The 128-bit block cipher to use. - * \param key The encryption key. This must not be \c NULL. - * \param keybits The key size in bits. This must be acceptable by the cipher. - * - * \return \c 0 on success. - * \return A CCM or cipher-specific error code on failure. - */ -int mbedtls_ccm_setkey( mbedtls_ccm_context *ctx, - mbedtls_cipher_id_t cipher, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function releases and clears the specified CCM context - * and underlying cipher sub-context. - * - * \param ctx The CCM context to clear. If this is \c NULL, the function - * has no effect. Otherwise, this must be initialized. - */ -void mbedtls_ccm_free( mbedtls_ccm_context *ctx ); - -/** - * \brief This function encrypts a buffer using CCM. - * - * \note The tag is written to a separate buffer. To concatenate - * the \p tag with the \p output, as done in RFC-3610: - * Counter with CBC-MAC (CCM), use - * \p tag = \p output + \p length, and make sure that the - * output buffer is at least \p length + \p tag_len wide. - * - * \param ctx The CCM context to use for encryption. This must be - * initialized and bound to a key. - * \param length The length of the input data in Bytes. - * \param iv The initialization vector (nonce). This must be a readable - * buffer of at least \p iv_len Bytes. - * \param iv_len The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12, - * or 13. The length L of the message length field is - * 15 - \p iv_len. - * \param add The additional data field. If \p add_len is greater than - * zero, \p add must be a readable buffer of at least that - * length. - * \param add_len The length of additional data in Bytes. - * This must be less than `2^16 - 2^8`. - * \param input The buffer holding the input data. If \p length is greater - * than zero, \p input must be a readable buffer of at least - * that length. - * \param output The buffer holding the output data. If \p length is greater - * than zero, \p output must be a writable buffer of at least - * that length. - * \param tag The buffer holding the authentication field. This must be a - * readable buffer of at least \p tag_len Bytes. - * \param tag_len The length of the authentication field to generate in Bytes: - * 4, 6, 8, 10, 12, 14 or 16. - * - * \return \c 0 on success. - * \return A CCM or cipher-specific error code on failure. - */ -int mbedtls_ccm_encrypt_and_tag( mbedtls_ccm_context *ctx, size_t length, - const unsigned char *iv, size_t iv_len, - const unsigned char *add, size_t add_len, - const unsigned char *input, unsigned char *output, - unsigned char *tag, size_t tag_len ); - -/** - * \brief This function encrypts a buffer using CCM*. - * - * \note The tag is written to a separate buffer. To concatenate - * the \p tag with the \p output, as done in RFC-3610: - * Counter with CBC-MAC (CCM), use - * \p tag = \p output + \p length, and make sure that the - * output buffer is at least \p length + \p tag_len wide. - * - * \note When using this function in a variable tag length context, - * the tag length has to be encoded into the \p iv passed to - * this function. - * - * \param ctx The CCM context to use for encryption. This must be - * initialized and bound to a key. - * \param length The length of the input data in Bytes. - * \param iv The initialization vector (nonce). This must be a readable - * buffer of at least \p iv_len Bytes. - * \param iv_len The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12, - * or 13. The length L of the message length field is - * 15 - \p iv_len. - * \param add The additional data field. This must be a readable buffer of - * at least \p add_len Bytes. - * \param add_len The length of additional data in Bytes. - * This must be less than 2^16 - 2^8. - * \param input The buffer holding the input data. If \p length is greater - * than zero, \p input must be a readable buffer of at least - * that length. - * \param output The buffer holding the output data. If \p length is greater - * than zero, \p output must be a writable buffer of at least - * that length. - * \param tag The buffer holding the authentication field. This must be a - * readable buffer of at least \p tag_len Bytes. - * \param tag_len The length of the authentication field to generate in Bytes: - * 0, 4, 6, 8, 10, 12, 14 or 16. - * - * \warning Passing \c 0 as \p tag_len means that the message is no - * longer authenticated. - * - * \return \c 0 on success. - * \return A CCM or cipher-specific error code on failure. - */ -int mbedtls_ccm_star_encrypt_and_tag( mbedtls_ccm_context *ctx, size_t length, - const unsigned char *iv, size_t iv_len, - const unsigned char *add, size_t add_len, - const unsigned char *input, unsigned char *output, - unsigned char *tag, size_t tag_len ); - -/** - * \brief This function performs a CCM authenticated decryption of a - * buffer. - * - * \param ctx The CCM context to use for decryption. This must be - * initialized and bound to a key. - * \param length The length of the input data in Bytes. - * \param iv The initialization vector (nonce). This must be a readable - * buffer of at least \p iv_len Bytes. - * \param iv_len The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12, - * or 13. The length L of the message length field is - * 15 - \p iv_len. - * \param add The additional data field. This must be a readable buffer - * of at least that \p add_len Bytes.. - * \param add_len The length of additional data in Bytes. - * This must be less than 2^16 - 2^8. - * \param input The buffer holding the input data. If \p length is greater - * than zero, \p input must be a readable buffer of at least - * that length. - * \param output The buffer holding the output data. If \p length is greater - * than zero, \p output must be a writable buffer of at least - * that length. - * \param tag The buffer holding the authentication field. This must be a - * readable buffer of at least \p tag_len Bytes. - * \param tag_len The length of the authentication field to generate in Bytes: - * 4, 6, 8, 10, 12, 14 or 16. - * - * \return \c 0 on success. This indicates that the message is authentic. - * \return #MBEDTLS_ERR_CCM_AUTH_FAILED if the tag does not match. - * \return A cipher-specific error code on calculation failure. - */ -int mbedtls_ccm_auth_decrypt( mbedtls_ccm_context *ctx, size_t length, - const unsigned char *iv, size_t iv_len, - const unsigned char *add, size_t add_len, - const unsigned char *input, unsigned char *output, - const unsigned char *tag, size_t tag_len ); - -/** - * \brief This function performs a CCM* authenticated decryption of a - * buffer. - * - * \note When using this function in a variable tag length context, - * the tag length has to be decoded from \p iv and passed to - * this function as \p tag_len. (\p tag needs to be adjusted - * accordingly.) - * - * \param ctx The CCM context to use for decryption. This must be - * initialized and bound to a key. - * \param length The length of the input data in Bytes. - * \param iv The initialization vector (nonce). This must be a readable - * buffer of at least \p iv_len Bytes. - * \param iv_len The length of the nonce in Bytes: 7, 8, 9, 10, 11, 12, - * or 13. The length L of the message length field is - * 15 - \p iv_len. - * \param add The additional data field. This must be a readable buffer of - * at least that \p add_len Bytes. - * \param add_len The length of additional data in Bytes. - * This must be less than 2^16 - 2^8. - * \param input The buffer holding the input data. If \p length is greater - * than zero, \p input must be a readable buffer of at least - * that length. - * \param output The buffer holding the output data. If \p length is greater - * than zero, \p output must be a writable buffer of at least - * that length. - * \param tag The buffer holding the authentication field. This must be a - * readable buffer of at least \p tag_len Bytes. - * \param tag_len The length of the authentication field in Bytes. - * 0, 4, 6, 8, 10, 12, 14 or 16. - * - * \warning Passing \c 0 as \p tag_len means that the message is nos - * longer authenticated. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CCM_AUTH_FAILED if the tag does not match. - * \return A cipher-specific error code on calculation failure. - */ -int mbedtls_ccm_star_auth_decrypt( mbedtls_ccm_context *ctx, size_t length, - const unsigned char *iv, size_t iv_len, - const unsigned char *add, size_t add_len, - const unsigned char *input, unsigned char *output, - const unsigned char *tag, size_t tag_len ); - -#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C) -/** - * \brief The CCM checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_ccm_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CCM_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ccm_alt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ccm_alt.h deleted file mode 100644 index 2d9733f35..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ccm_alt.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef MBEDTLS_CCM_ALT_H -#define MBEDTLS_CCM_ALT_H - -#if defined(MBEDTLS_CONFIG_FILE) -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include -#include "mbedtls/cipher.h" - -#if defined (MBEDTLS_CCM_ALT) - -#define MBEDTLS_ERR_CCM_BAD_INPUT -0x000D /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_CCM_AUTH_FAILED -0x000F /**< Authenticated decryption failed. */ - -/* The Size of the CCM context.*/ -#define MBEDTLS_CCM_CONTEXT_SIZE_IN_WORDS (29) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The CCM context-type definition. The CCM context is passed - * to the APIs called. - */ -typedef struct { - uint32_t buf[MBEDTLS_CCM_CONTEXT_SIZE_IN_WORDS]; -} -mbedtls_ccm_context; - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CCM_ALT */ - -#endif /* MBEDTLS_CCM_ALT_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/certs.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/certs.h deleted file mode 100644 index 8beb380ff..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/certs.h +++ /dev/null @@ -1,252 +0,0 @@ -/** - * \file certs.h - * - * \brief Sample certificates and DHM parameters for testing - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_CERTS_H -#define MBEDTLS_CERTS_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* List of all PEM-encoded CA certificates, terminated by NULL; - * PEM encoded if MBEDTLS_PEM_PARSE_C is enabled, DER encoded - * otherwise. */ -extern const char * mbedtls_test_cas[]; -extern const size_t mbedtls_test_cas_len[]; - -/* List of all DER-encoded CA certificates, terminated by NULL */ -extern const unsigned char * mbedtls_test_cas_der[]; -extern const size_t mbedtls_test_cas_der_len[]; - -#if defined(MBEDTLS_PEM_PARSE_C) -/* Concatenation of all CA certificates in PEM format if available */ -extern const char mbedtls_test_cas_pem[]; -extern const size_t mbedtls_test_cas_pem_len; -#endif /* MBEDTLS_PEM_PARSE_C */ - -/* - * CA test certificates - */ - -extern const char mbedtls_test_ca_crt_ec_pem[]; -extern const char mbedtls_test_ca_key_ec_pem[]; -extern const char mbedtls_test_ca_pwd_ec_pem[]; -extern const char mbedtls_test_ca_key_rsa_pem[]; -extern const char mbedtls_test_ca_pwd_rsa_pem[]; -extern const char mbedtls_test_ca_crt_rsa_sha1_pem[]; -extern const char mbedtls_test_ca_crt_rsa_sha256_pem[]; - -extern const unsigned char mbedtls_test_ca_crt_ec_der[]; -extern const unsigned char mbedtls_test_ca_key_ec_der[]; -extern const unsigned char mbedtls_test_ca_key_rsa_der[]; -extern const unsigned char mbedtls_test_ca_crt_rsa_sha1_der[]; -extern const unsigned char mbedtls_test_ca_crt_rsa_sha256_der[]; - -extern const size_t mbedtls_test_ca_crt_ec_pem_len; -extern const size_t mbedtls_test_ca_key_ec_pem_len; -extern const size_t mbedtls_test_ca_pwd_ec_pem_len; -extern const size_t mbedtls_test_ca_key_rsa_pem_len; -extern const size_t mbedtls_test_ca_pwd_rsa_pem_len; -extern const size_t mbedtls_test_ca_crt_rsa_sha1_pem_len; -extern const size_t mbedtls_test_ca_crt_rsa_sha256_pem_len; - -extern const size_t mbedtls_test_ca_crt_ec_der_len; -extern const size_t mbedtls_test_ca_key_ec_der_len; -extern const size_t mbedtls_test_ca_pwd_ec_der_len; -extern const size_t mbedtls_test_ca_key_rsa_der_len; -extern const size_t mbedtls_test_ca_pwd_rsa_der_len; -extern const size_t mbedtls_test_ca_crt_rsa_sha1_der_len; -extern const size_t mbedtls_test_ca_crt_rsa_sha256_der_len; - -/* Config-dependent dispatch between PEM and DER encoding - * (PEM if enabled, otherwise DER) */ - -extern const char mbedtls_test_ca_crt_ec[]; -extern const char mbedtls_test_ca_key_ec[]; -extern const char mbedtls_test_ca_pwd_ec[]; -extern const char mbedtls_test_ca_key_rsa[]; -extern const char mbedtls_test_ca_pwd_rsa[]; -extern const char mbedtls_test_ca_crt_rsa_sha1[]; -extern const char mbedtls_test_ca_crt_rsa_sha256[]; - -extern const size_t mbedtls_test_ca_crt_ec_len; -extern const size_t mbedtls_test_ca_key_ec_len; -extern const size_t mbedtls_test_ca_pwd_ec_len; -extern const size_t mbedtls_test_ca_key_rsa_len; -extern const size_t mbedtls_test_ca_pwd_rsa_len; -extern const size_t mbedtls_test_ca_crt_rsa_sha1_len; -extern const size_t mbedtls_test_ca_crt_rsa_sha256_len; - -/* Config-dependent dispatch between SHA-1 and SHA-256 - * (SHA-256 if enabled, otherwise SHA-1) */ - -extern const char mbedtls_test_ca_crt_rsa[]; -extern const size_t mbedtls_test_ca_crt_rsa_len; - -/* Config-dependent dispatch between EC and RSA - * (RSA if enabled, otherwise EC) */ - -extern const char * mbedtls_test_ca_crt; -extern const char * mbedtls_test_ca_key; -extern const char * mbedtls_test_ca_pwd; -extern const size_t mbedtls_test_ca_crt_len; -extern const size_t mbedtls_test_ca_key_len; -extern const size_t mbedtls_test_ca_pwd_len; - -/* - * Server test certificates - */ - -extern const char mbedtls_test_srv_crt_ec_pem[]; -extern const char mbedtls_test_srv_key_ec_pem[]; -extern const char mbedtls_test_srv_pwd_ec_pem[]; -extern const char mbedtls_test_srv_key_rsa_pem[]; -extern const char mbedtls_test_srv_pwd_rsa_pem[]; -extern const char mbedtls_test_srv_crt_rsa_sha1_pem[]; -extern const char mbedtls_test_srv_crt_rsa_sha256_pem[]; - -extern const unsigned char mbedtls_test_srv_crt_ec_der[]; -extern const unsigned char mbedtls_test_srv_key_ec_der[]; -extern const unsigned char mbedtls_test_srv_key_rsa_der[]; -extern const unsigned char mbedtls_test_srv_crt_rsa_sha1_der[]; -extern const unsigned char mbedtls_test_srv_crt_rsa_sha256_der[]; - -extern const size_t mbedtls_test_srv_crt_ec_pem_len; -extern const size_t mbedtls_test_srv_key_ec_pem_len; -extern const size_t mbedtls_test_srv_pwd_ec_pem_len; -extern const size_t mbedtls_test_srv_key_rsa_pem_len; -extern const size_t mbedtls_test_srv_pwd_rsa_pem_len; -extern const size_t mbedtls_test_srv_crt_rsa_sha1_pem_len; -extern const size_t mbedtls_test_srv_crt_rsa_sha256_pem_len; - -extern const size_t mbedtls_test_srv_crt_ec_der_len; -extern const size_t mbedtls_test_srv_key_ec_der_len; -extern const size_t mbedtls_test_srv_pwd_ec_der_len; -extern const size_t mbedtls_test_srv_key_rsa_der_len; -extern const size_t mbedtls_test_srv_pwd_rsa_der_len; -extern const size_t mbedtls_test_srv_crt_rsa_sha1_der_len; -extern const size_t mbedtls_test_srv_crt_rsa_sha256_der_len; - -/* Config-dependent dispatch between PEM and DER encoding - * (PEM if enabled, otherwise DER) */ - -extern const char mbedtls_test_srv_crt_ec[]; -extern const char mbedtls_test_srv_key_ec[]; -extern const char mbedtls_test_srv_pwd_ec[]; -extern const char mbedtls_test_srv_key_rsa[]; -extern const char mbedtls_test_srv_pwd_rsa[]; -extern const char mbedtls_test_srv_crt_rsa_sha1[]; -extern const char mbedtls_test_srv_crt_rsa_sha256[]; - -extern const size_t mbedtls_test_srv_crt_ec_len; -extern const size_t mbedtls_test_srv_key_ec_len; -extern const size_t mbedtls_test_srv_pwd_ec_len; -extern const size_t mbedtls_test_srv_key_rsa_len; -extern const size_t mbedtls_test_srv_pwd_rsa_len; -extern const size_t mbedtls_test_srv_crt_rsa_sha1_len; -extern const size_t mbedtls_test_srv_crt_rsa_sha256_len; - -/* Config-dependent dispatch between SHA-1 and SHA-256 - * (SHA-256 if enabled, otherwise SHA-1) */ - -extern const char mbedtls_test_srv_crt_rsa[]; -extern const size_t mbedtls_test_srv_crt_rsa_len; - -/* Config-dependent dispatch between EC and RSA - * (RSA if enabled, otherwise EC) */ - -extern const char * mbedtls_test_srv_crt; -extern const char * mbedtls_test_srv_key; -extern const char * mbedtls_test_srv_pwd; -extern const size_t mbedtls_test_srv_crt_len; -extern const size_t mbedtls_test_srv_key_len; -extern const size_t mbedtls_test_srv_pwd_len; - -/* - * Client test certificates - */ - -extern const char mbedtls_test_cli_crt_ec_pem[]; -extern const char mbedtls_test_cli_key_ec_pem[]; -extern const char mbedtls_test_cli_pwd_ec_pem[]; -extern const char mbedtls_test_cli_key_rsa_pem[]; -extern const char mbedtls_test_cli_pwd_rsa_pem[]; -extern const char mbedtls_test_cli_crt_rsa_pem[]; - -extern const unsigned char mbedtls_test_cli_crt_ec_der[]; -extern const unsigned char mbedtls_test_cli_key_ec_der[]; -extern const unsigned char mbedtls_test_cli_key_rsa_der[]; -extern const unsigned char mbedtls_test_cli_crt_rsa_der[]; - -extern const size_t mbedtls_test_cli_crt_ec_pem_len; -extern const size_t mbedtls_test_cli_key_ec_pem_len; -extern const size_t mbedtls_test_cli_pwd_ec_pem_len; -extern const size_t mbedtls_test_cli_key_rsa_pem_len; -extern const size_t mbedtls_test_cli_pwd_rsa_pem_len; -extern const size_t mbedtls_test_cli_crt_rsa_pem_len; - -extern const size_t mbedtls_test_cli_crt_ec_der_len; -extern const size_t mbedtls_test_cli_key_ec_der_len; -extern const size_t mbedtls_test_cli_key_rsa_der_len; -extern const size_t mbedtls_test_cli_crt_rsa_der_len; - -/* Config-dependent dispatch between PEM and DER encoding - * (PEM if enabled, otherwise DER) */ - -extern const char mbedtls_test_cli_crt_ec[]; -extern const char mbedtls_test_cli_key_ec[]; -extern const char mbedtls_test_cli_pwd_ec[]; -extern const char mbedtls_test_cli_key_rsa[]; -extern const char mbedtls_test_cli_pwd_rsa[]; -extern const char mbedtls_test_cli_crt_rsa[]; - -extern const size_t mbedtls_test_cli_crt_ec_len; -extern const size_t mbedtls_test_cli_key_ec_len; -extern const size_t mbedtls_test_cli_pwd_ec_len; -extern const size_t mbedtls_test_cli_key_rsa_len; -extern const size_t mbedtls_test_cli_pwd_rsa_len; -extern const size_t mbedtls_test_cli_crt_rsa_len; - -/* Config-dependent dispatch between EC and RSA - * (RSA if enabled, otherwise EC) */ - -extern const char * mbedtls_test_cli_crt; -extern const char * mbedtls_test_cli_key; -extern const char * mbedtls_test_cli_pwd; -extern const size_t mbedtls_test_cli_crt_len; -extern const size_t mbedtls_test_cli_key_len; -extern const size_t mbedtls_test_cli_pwd_len; - -#ifdef __cplusplus -} -#endif - -#endif /* certs.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chacha20.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chacha20.h deleted file mode 100644 index 696d400ea..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chacha20.h +++ /dev/null @@ -1,227 +0,0 @@ -/** - * \file chacha20.h - * - * \brief This file contains ChaCha20 definitions and functions. - * - * ChaCha20 is a stream cipher that can encrypt and decrypt - * information. ChaCha was created by Daniel Bernstein as a variant of - * its Salsa cipher https://cr.yp.to/chacha/chacha-20080128.pdf - * ChaCha20 is the variant with 20 rounds, that was also standardized - * in RFC 7539. - * - * \author Daniel King - */ - -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CHACHA20_H -#define MBEDTLS_CHACHA20_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA -0x0051 /**< Invalid input parameter(s). */ - -/* MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE is deprecated and should not be - * used. */ -#define MBEDTLS_ERR_CHACHA20_FEATURE_UNAVAILABLE -0x0053 /**< Feature not available. For example, s part of the API is not implemented. */ - -/* MBEDTLS_ERR_CHACHA20_HW_ACCEL_FAILED is deprecated and should not be used. - */ -#define MBEDTLS_ERR_CHACHA20_HW_ACCEL_FAILED -0x0055 /**< Chacha20 hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_CHACHA20_ALT) - -typedef struct mbedtls_chacha20_context -{ - uint32_t state[16]; /*! The state (before round operations). */ - uint8_t keystream8[64]; /*! Leftover keystream bytes. */ - size_t keystream_bytes_used; /*! Number of keystream bytes already used. */ -} -mbedtls_chacha20_context; - -#else /* MBEDTLS_CHACHA20_ALT */ -#include "chacha20_alt.h" -#endif /* MBEDTLS_CHACHA20_ALT */ - -/** - * \brief This function initializes the specified ChaCha20 context. - * - * It must be the first API called before using - * the context. - * - * It is usually followed by calls to - * \c mbedtls_chacha20_setkey() and - * \c mbedtls_chacha20_starts(), then one or more calls to - * to \c mbedtls_chacha20_update(), and finally to - * \c mbedtls_chacha20_free(). - * - * \param ctx The ChaCha20 context to initialize. - * This must not be \c NULL. - */ -void mbedtls_chacha20_init( mbedtls_chacha20_context *ctx ); - -/** - * \brief This function releases and clears the specified - * ChaCha20 context. - * - * \param ctx The ChaCha20 context to clear. This may be \c NULL, - * in which case this function is a no-op. If it is not - * \c NULL, it must point to an initialized context. - * - */ -void mbedtls_chacha20_free( mbedtls_chacha20_context *ctx ); - -/** - * \brief This function sets the encryption/decryption key. - * - * \note After using this function, you must also call - * \c mbedtls_chacha20_starts() to set a nonce before you - * start encrypting/decrypting data with - * \c mbedtls_chacha_update(). - * - * \param ctx The ChaCha20 context to which the key should be bound. - * It must be initialized. - * \param key The encryption/decryption key. This must be \c 32 Bytes - * in length. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA if ctx or key is NULL. - */ -int mbedtls_chacha20_setkey( mbedtls_chacha20_context *ctx, - const unsigned char key[32] ); - -/** - * \brief This function sets the nonce and initial counter value. - * - * \note A ChaCha20 context can be re-used with the same key by - * calling this function to change the nonce. - * - * \warning You must never use the same nonce twice with the same key. - * This would void any confidentiality guarantees for the - * messages encrypted with the same nonce and key. - * - * \param ctx The ChaCha20 context to which the nonce should be bound. - * It must be initialized and bound to a key. - * \param nonce The nonce. This must be \c 12 Bytes in size. - * \param counter The initial counter value. This is usually \c 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA if ctx or nonce is - * NULL. - */ -int mbedtls_chacha20_starts( mbedtls_chacha20_context* ctx, - const unsigned char nonce[12], - uint32_t counter ); - -/** - * \brief This function encrypts or decrypts data. - * - * Since ChaCha20 is a stream cipher, the same operation is - * used for encrypting and decrypting data. - * - * \note The \p input and \p output pointers must either be equal or - * point to non-overlapping buffers. - * - * \note \c mbedtls_chacha20_setkey() and - * \c mbedtls_chacha20_starts() must be called at least once - * to setup the context before this function can be called. - * - * \note This function can be called multiple times in a row in - * order to encrypt of decrypt data piecewise with the same - * key and nonce. - * - * \param ctx The ChaCha20 context to use for encryption or decryption. - * It must be initialized and bound to a key and nonce. - * \param size The length of the input data in Bytes. - * \param input The buffer holding the input data. - * This pointer can be \c NULL if `size == 0`. - * \param output The buffer holding the output data. - * This must be able to hold \p size Bytes. - * This pointer can be \c NULL if `size == 0`. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_chacha20_update( mbedtls_chacha20_context *ctx, - size_t size, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function encrypts or decrypts data with ChaCha20 and - * the given key and nonce. - * - * Since ChaCha20 is a stream cipher, the same operation is - * used for encrypting and decrypting data. - * - * \warning You must never use the same (key, nonce) pair more than - * once. This would void any confidentiality guarantees for - * the messages encrypted with the same nonce and key. - * - * \note The \p input and \p output pointers must either be equal or - * point to non-overlapping buffers. - * - * \param key The encryption/decryption key. - * This must be \c 32 Bytes in length. - * \param nonce The nonce. This must be \c 12 Bytes in size. - * \param counter The initial counter value. This is usually \c 0. - * \param size The length of the input data in Bytes. - * \param input The buffer holding the input data. - * This pointer can be \c NULL if `size == 0`. - * \param output The buffer holding the output data. - * This must be able to hold \p size Bytes. - * This pointer can be \c NULL if `size == 0`. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_chacha20_crypt( const unsigned char key[32], - const unsigned char nonce[12], - uint32_t counter, - size_t size, - const unsigned char* input, - unsigned char* output ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief The ChaCha20 checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_chacha20_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CHACHA20_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chacha20_alt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chacha20_alt.h deleted file mode 100644 index 36bb3e144..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chacha20_alt.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef MBEDTLS_CHACHA20_ALT_H -#define MBEDTLS_CHACHA20_ALT_H - -#if defined(MBEDTLS_CONFIG_FILE) -#include MBEDTLS_CONFIG_FILE -#endif - - -#include -#include - - -#ifdef __cplusplus -extern "C" -{ -#endif - -/************************ Defines ******************************/ - -/*! The size of the ChaCha user-context in words. */ -#define MBEDTLS_CHACHA_USER_CTX_SIZE_IN_WORDS 17 -/*! The size of the ChaCha block in Bytes. */ -#define MBEDTLS_CHACHA_BLOCK_SIZE_BYTES 64 -/*! The size of the ChaCha block in Bytes. As defined in rfc7539 */ -#define MBEDTLS_CHACHA_NONCE_SIZE_BYTES 12 -/*! The size of the ChaCha key in Bytes. */ -#define MBEDTLS_CHACHA_KEY_SIZE_BYTES 32 -/*! Internal type to identify 12 byte nonce */ -#define MBEDTLS_CHACHA_NONCE_SIZE_12BYTE_TYPE 1 - -/*! The definition of the 12-Byte array of the nonce buffer. */ -typedef uint8_t mbedtls_chacha_nonce[MBEDTLS_CHACHA_NONCE_SIZE_BYTES]; - -/*! The definition of the key buffer of the ChaCha engine. */ -typedef uint8_t mbedtls_chacha_key[MBEDTLS_CHACHA_KEY_SIZE_BYTES]; - -#if defined(MBEDTLS_CHACHA20_ALT) - -typedef struct -{ - uint32_t buf[MBEDTLS_CHACHA_USER_CTX_SIZE_IN_WORDS]; -} -mbedtls_chacha20_context; - -#endif - -#ifdef __cplusplus -} -#endif - - -#endif /* MBEDTLS_CHACHA20_ALT_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chachapoly.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chachapoly.h deleted file mode 100644 index 97f1c58c0..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chachapoly.h +++ /dev/null @@ -1,359 +0,0 @@ -/** - * \file chachapoly.h - * - * \brief This file contains the AEAD-ChaCha20-Poly1305 definitions and - * functions. - * - * ChaCha20-Poly1305 is an algorithm for Authenticated Encryption - * with Associated Data (AEAD) that can be used to encrypt and - * authenticate data. It is based on ChaCha20 and Poly1305 by Daniel - * Bernstein and was standardized in RFC 7539. - * - * \author Daniel King - */ - -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CHACHAPOLY_H -#define MBEDTLS_CHACHAPOLY_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -/* for shared error codes */ -#include "mbedtls/poly1305.h" - -#define MBEDTLS_ERR_CHACHAPOLY_BAD_STATE -0x0054 /**< The requested operation is not permitted in the current state. */ -#define MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED -0x0056 /**< Authenticated decryption failed: data was not authentic. */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum -{ - MBEDTLS_CHACHAPOLY_ENCRYPT, /**< The mode value for performing encryption. */ - MBEDTLS_CHACHAPOLY_DECRYPT /**< The mode value for performing decryption. */ -} -mbedtls_chachapoly_mode_t; - -#if !defined(MBEDTLS_CHACHAPOLY_ALT) - -#include "mbedtls/chacha20.h" - -typedef struct mbedtls_chachapoly_context -{ - mbedtls_chacha20_context chacha20_ctx; /**< The ChaCha20 context. */ - mbedtls_poly1305_context poly1305_ctx; /**< The Poly1305 context. */ - uint64_t aad_len; /**< The length (bytes) of the Additional Authenticated Data. */ - uint64_t ciphertext_len; /**< The length (bytes) of the ciphertext. */ - int state; /**< The current state of the context. */ - mbedtls_chachapoly_mode_t mode; /**< Cipher mode (encrypt or decrypt). */ -} -mbedtls_chachapoly_context; - -#else /* !MBEDTLS_CHACHAPOLY_ALT */ -#include "chachapoly_alt.h" -#endif /* !MBEDTLS_CHACHAPOLY_ALT */ - -/** - * \brief This function initializes the specified ChaCha20-Poly1305 context. - * - * It must be the first API called before using - * the context. It must be followed by a call to - * \c mbedtls_chachapoly_setkey() before any operation can be - * done, and to \c mbedtls_chachapoly_free() once all - * operations with that context have been finished. - * - * In order to encrypt or decrypt full messages at once, for - * each message you should make a single call to - * \c mbedtls_chachapoly_crypt_and_tag() or - * \c mbedtls_chachapoly_auth_decrypt(). - * - * In order to encrypt messages piecewise, for each - * message you should make a call to - * \c mbedtls_chachapoly_starts(), then 0 or more calls to - * \c mbedtls_chachapoly_update_aad(), then 0 or more calls to - * \c mbedtls_chachapoly_update(), then one call to - * \c mbedtls_chachapoly_finish(). - * - * \warning Decryption with the piecewise API is discouraged! Always - * use \c mbedtls_chachapoly_auth_decrypt() when possible! - * - * If however this is not possible because the data is too - * large to fit in memory, you need to: - * - * - call \c mbedtls_chachapoly_starts() and (if needed) - * \c mbedtls_chachapoly_update_aad() as above, - * - call \c mbedtls_chachapoly_update() multiple times and - * ensure its output (the plaintext) is NOT used in any other - * way than placing it in temporary storage at this point, - * - call \c mbedtls_chachapoly_finish() to compute the - * authentication tag and compared it in constant time to the - * tag received with the ciphertext. - * - * If the tags are not equal, you must immediately discard - * all previous outputs of \c mbedtls_chachapoly_update(), - * otherwise you can now safely use the plaintext. - * - * \param ctx The ChachaPoly context to initialize. Must not be \c NULL. - */ -void mbedtls_chachapoly_init( mbedtls_chachapoly_context *ctx ); - -/** - * \brief This function releases and clears the specified - * ChaCha20-Poly1305 context. - * - * \param ctx The ChachaPoly context to clear. This may be \c NULL, in which - * case this function is a no-op. - */ -void mbedtls_chachapoly_free( mbedtls_chachapoly_context *ctx ); - -/** - * \brief This function sets the ChaCha20-Poly1305 - * symmetric encryption key. - * - * \param ctx The ChaCha20-Poly1305 context to which the key should be - * bound. This must be initialized. - * \param key The \c 256 Bit (\c 32 Bytes) key. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_chachapoly_setkey( mbedtls_chachapoly_context *ctx, - const unsigned char key[32] ); - -/** - * \brief This function starts a ChaCha20-Poly1305 encryption or - * decryption operation. - * - * \warning You must never use the same nonce twice with the same key. - * This would void any confidentiality and authenticity - * guarantees for the messages encrypted with the same nonce - * and key. - * - * \note If the context is being used for AAD only (no data to - * encrypt or decrypt) then \p mode can be set to any value. - * - * \warning Decryption with the piecewise API is discouraged, see the - * warning on \c mbedtls_chachapoly_init(). - * - * \param ctx The ChaCha20-Poly1305 context. This must be initialized - * and bound to a key. - * \param nonce The nonce/IV to use for the message. - * This must be a redable buffer of length \c 12 Bytes. - * \param mode The operation to perform: #MBEDTLS_CHACHAPOLY_ENCRYPT or - * #MBEDTLS_CHACHAPOLY_DECRYPT (discouraged, see warning). - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_chachapoly_starts( mbedtls_chachapoly_context *ctx, - const unsigned char nonce[12], - mbedtls_chachapoly_mode_t mode ); - -/** - * \brief This function feeds additional data to be authenticated - * into an ongoing ChaCha20-Poly1305 operation. - * - * The Additional Authenticated Data (AAD), also called - * Associated Data (AD) is only authenticated but not - * encrypted nor included in the encrypted output. It is - * usually transmitted separately from the ciphertext or - * computed locally by each party. - * - * \note This function is called before data is encrypted/decrypted. - * I.e. call this function to process the AAD before calling - * \c mbedtls_chachapoly_update(). - * - * You may call this function multiple times to process - * an arbitrary amount of AAD. It is permitted to call - * this function 0 times, if no AAD is used. - * - * This function cannot be called any more if data has - * been processed by \c mbedtls_chachapoly_update(), - * or if the context has been finished. - * - * \warning Decryption with the piecewise API is discouraged, see the - * warning on \c mbedtls_chachapoly_init(). - * - * \param ctx The ChaCha20-Poly1305 context. This must be initialized - * and bound to a key. - * \param aad_len The length in Bytes of the AAD. The length has no - * restrictions. - * \param aad Buffer containing the AAD. - * This pointer can be \c NULL if `aad_len == 0`. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA - * if \p ctx or \p aad are NULL. - * \return #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE - * if the operations has not been started or has been - * finished, or if the AAD has been finished. - */ -int mbedtls_chachapoly_update_aad( mbedtls_chachapoly_context *ctx, - const unsigned char *aad, - size_t aad_len ); - -/** - * \brief Thus function feeds data to be encrypted or decrypted - * into an on-going ChaCha20-Poly1305 - * operation. - * - * The direction (encryption or decryption) depends on the - * mode that was given when calling - * \c mbedtls_chachapoly_starts(). - * - * You may call this function multiple times to process - * an arbitrary amount of data. It is permitted to call - * this function 0 times, if no data is to be encrypted - * or decrypted. - * - * \warning Decryption with the piecewise API is discouraged, see the - * warning on \c mbedtls_chachapoly_init(). - * - * \param ctx The ChaCha20-Poly1305 context to use. This must be initialized. - * \param len The length (in bytes) of the data to encrypt or decrypt. - * \param input The buffer containing the data to encrypt or decrypt. - * This pointer can be \c NULL if `len == 0`. - * \param output The buffer to where the encrypted or decrypted data is - * written. This must be able to hold \p len bytes. - * This pointer can be \c NULL if `len == 0`. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE - * if the operation has not been started or has been - * finished. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_chachapoly_update( mbedtls_chachapoly_context *ctx, - size_t len, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function finished the ChaCha20-Poly1305 operation and - * generates the MAC (authentication tag). - * - * \param ctx The ChaCha20-Poly1305 context to use. This must be initialized. - * \param mac The buffer to where the 128-bit (16 bytes) MAC is written. - * - * \warning Decryption with the piecewise API is discouraged, see the - * warning on \c mbedtls_chachapoly_init(). - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE - * if the operation has not been started or has been - * finished. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_chachapoly_finish( mbedtls_chachapoly_context *ctx, - unsigned char mac[16] ); - -/** - * \brief This function performs a complete ChaCha20-Poly1305 - * authenticated encryption with the previously-set key. - * - * \note Before using this function, you must set the key with - * \c mbedtls_chachapoly_setkey(). - * - * \warning You must never use the same nonce twice with the same key. - * This would void any confidentiality and authenticity - * guarantees for the messages encrypted with the same nonce - * and key. - * - * \param ctx The ChaCha20-Poly1305 context to use (holds the key). - * This must be initialized. - * \param length The length (in bytes) of the data to encrypt or decrypt. - * \param nonce The 96-bit (12 bytes) nonce/IV to use. - * \param aad The buffer containing the additional authenticated - * data (AAD). This pointer can be \c NULL if `aad_len == 0`. - * \param aad_len The length (in bytes) of the AAD data to process. - * \param input The buffer containing the data to encrypt or decrypt. - * This pointer can be \c NULL if `ilen == 0`. - * \param output The buffer to where the encrypted or decrypted data - * is written. This pointer can be \c NULL if `ilen == 0`. - * \param tag The buffer to where the computed 128-bit (16 bytes) MAC - * is written. This must not be \c NULL. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_chachapoly_encrypt_and_tag( mbedtls_chachapoly_context *ctx, - size_t length, - const unsigned char nonce[12], - const unsigned char *aad, - size_t aad_len, - const unsigned char *input, - unsigned char *output, - unsigned char tag[16] ); - -/** - * \brief This function performs a complete ChaCha20-Poly1305 - * authenticated decryption with the previously-set key. - * - * \note Before using this function, you must set the key with - * \c mbedtls_chachapoly_setkey(). - * - * \param ctx The ChaCha20-Poly1305 context to use (holds the key). - * \param length The length (in Bytes) of the data to decrypt. - * \param nonce The \c 96 Bit (\c 12 bytes) nonce/IV to use. - * \param aad The buffer containing the additional authenticated data (AAD). - * This pointer can be \c NULL if `aad_len == 0`. - * \param aad_len The length (in bytes) of the AAD data to process. - * \param tag The buffer holding the authentication tag. - * This must be a readable buffer of length \c 16 Bytes. - * \param input The buffer containing the data to decrypt. - * This pointer can be \c NULL if `ilen == 0`. - * \param output The buffer to where the decrypted data is written. - * This pointer can be \c NULL if `ilen == 0`. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED - * if the data was not authentic. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_chachapoly_auth_decrypt( mbedtls_chachapoly_context *ctx, - size_t length, - const unsigned char nonce[12], - const unsigned char *aad, - size_t aad_len, - const unsigned char tag[16], - const unsigned char *input, - unsigned char *output ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief The ChaCha20-Poly1305 checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_chachapoly_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CHACHAPOLY_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chachapoly_alt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chachapoly_alt.h deleted file mode 100644 index 3e80ed417..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/chachapoly_alt.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef MBEDTLS_CHACHAPOLY_ALT_H -#define MBEDTLS_CHACHAPOLY_ALT_H - -#if defined(MBEDTLS_CONFIG_FILE) -#include MBEDTLS_CONFIG_FILE -#endif - - -#ifdef __cplusplus -extern "C" -{ -#endif - -/************************ Defines ******************************/ - -#if defined(MBEDTLS_CHACHAPOLY_ALT) - - -#define MBEDTLS_CHACHAPOLY_KEY_SIZE_BYTES 32 - - -typedef struct mbedtls_chachapoly_context -{ - unsigned char key[MBEDTLS_CHACHAPOLY_KEY_SIZE_BYTES]; -} -mbedtls_chachapoly_context; - -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif - - -#endif /* MBEDTLS_CHACHAPOLY_ALT_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/check_config.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/check_config.h deleted file mode 100644 index f2148a8b5..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/check_config.h +++ /dev/null @@ -1,860 +0,0 @@ -/** - * \file check_config.h - * - * \brief Consistency checks for configuration options - */ -/* - * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -/* - * It is recommended to include this file from your config.h - * in order to catch dependency issues early. - */ - -#ifndef MBEDTLS_CHECK_CONFIG_H -#define MBEDTLS_CHECK_CONFIG_H - -/* - * We assume CHAR_BIT is 8 in many places. In practice, this is true on our - * target platforms, so not an issue, but let's just be extra sure. - */ -#include -#if CHAR_BIT != 8 -#error "mbed TLS requires a platform with 8-bit chars" -#endif - -#if defined(_WIN32) -#if !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_C is required on Windows" -#endif - -/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as - * it would confuse config.py. */ -#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \ - !defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) -#define MBEDTLS_PLATFORM_SNPRINTF_ALT -#endif - -#if !defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) && \ - !defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) -#define MBEDTLS_PLATFORM_VSNPRINTF_ALT -#endif -#endif /* _WIN32 */ - -#if defined(TARGET_LIKE_MBED) && \ - ( defined(MBEDTLS_NET_C) || defined(MBEDTLS_TIMING_C) ) -#error "The NET and TIMING modules are not available for mbed OS - please use the network and timing functions provided by mbed OS" -#endif - -#if defined(MBEDTLS_DEPRECATED_WARNING) && \ - !defined(__GNUC__) && !defined(__clang__) -#error "MBEDTLS_DEPRECATED_WARNING only works with GCC and Clang" -#endif - -#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_HAVE_TIME) -#error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" -#endif - -#if defined(MBEDTLS_AESNI_C) && !defined(MBEDTLS_HAVE_ASM) -#error "MBEDTLS_AESNI_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) -#error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_DHM_C) && !defined(MBEDTLS_BIGNUM_C) -#error "MBEDTLS_DHM_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT) && !defined(MBEDTLS_SSL_TRUNCATED_HMAC) -#error "MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_CMAC_C) && \ - !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_DES_C) -#error "MBEDTLS_CMAC_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_NIST_KW_C) && \ - ( !defined(MBEDTLS_AES_C) || !defined(MBEDTLS_CIPHER_C) ) -#error "MBEDTLS_NIST_KW_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECDH_C) && !defined(MBEDTLS_ECP_C) -#error "MBEDTLS_ECDH_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECDSA_C) && \ - ( !defined(MBEDTLS_ECP_C) || \ - !defined(MBEDTLS_ASN1_PARSE_C) || \ - !defined(MBEDTLS_ASN1_WRITE_C) ) -#error "MBEDTLS_ECDSA_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECJPAKE_C) && \ - ( !defined(MBEDTLS_ECP_C) || !defined(MBEDTLS_MD_C) ) -#error "MBEDTLS_ECJPAKE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_RESTARTABLE) && \ - ( defined(MBEDTLS_USE_PSA_CRYPTO) || \ - defined(MBEDTLS_ECDH_COMPUTE_SHARED_ALT) || \ - defined(MBEDTLS_ECDH_GEN_PUBLIC_ALT) || \ - defined(MBEDTLS_ECDSA_SIGN_ALT) || \ - defined(MBEDTLS_ECDSA_VERIFY_ALT) || \ - defined(MBEDTLS_ECDSA_GENKEY_ALT) || \ - defined(MBEDTLS_ECP_INTERNAL_ALT) || \ - defined(MBEDTLS_ECP_ALT) ) -#error "MBEDTLS_ECP_RESTARTABLE defined, but it cannot coexist with an alternative or PSA-based ECP implementation" -#endif - -#if defined(MBEDTLS_ECP_RESTARTABLE) && \ - ! defined(MBEDTLS_ECDH_LEGACY_CONTEXT) -#error "MBEDTLS_ECP_RESTARTABLE defined, but not MBEDTLS_ECDH_LEGACY_CONTEXT" -#endif - -#if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED) && \ - defined(MBEDTLS_ECDH_LEGACY_CONTEXT) -#error "MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED defined, but MBEDTLS_ECDH_LEGACY_CONTEXT not disabled" -#endif - -#if defined(MBEDTLS_ECDSA_DETERMINISTIC) && !defined(MBEDTLS_HMAC_DRBG_C) -#error "MBEDTLS_ECDSA_DETERMINISTIC defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_C) && ( !defined(MBEDTLS_BIGNUM_C) || ( \ - !defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED) && \ - !defined(MBEDTLS_ECP_DP_CURVE448_ENABLED) ) ) -#error "MBEDTLS_ECP_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_C) && !( \ - defined(MBEDTLS_ECP_ALT) || \ - defined(MBEDTLS_CTR_DRBG_C) || \ - defined(MBEDTLS_HMAC_DRBG_C) || \ - defined(MBEDTLS_ECP_NO_INTERNAL_RNG)) -#error "MBEDTLS_ECP_C requires a DRBG module unless MBEDTLS_ECP_NO_INTERNAL_RNG is defined or an alternative implementation is used" -#endif - -#if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_ASN1_PARSE_C) -#error "MBEDTLS_PK_PARSE_C defined, but not all prerequesites" -#endif - -#if defined(MBEDTLS_ENTROPY_C) && (!defined(MBEDTLS_SHA512_C) && \ - !defined(MBEDTLS_SHA256_C)) -#error "MBEDTLS_ENTROPY_C defined, but not all prerequisites" -#endif -#if defined(MBEDTLS_ENTROPY_C) && defined(MBEDTLS_SHA512_C) && \ - defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 64) -#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" -#endif -#if defined(MBEDTLS_ENTROPY_C) && \ - ( !defined(MBEDTLS_SHA512_C) || defined(MBEDTLS_ENTROPY_FORCE_SHA256) ) \ - && defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) && (MBEDTLS_CTR_DRBG_ENTROPY_LEN > 32) -#error "MBEDTLS_CTR_DRBG_ENTROPY_LEN value too high" -#endif -#if defined(MBEDTLS_ENTROPY_C) && \ - defined(MBEDTLS_ENTROPY_FORCE_SHA256) && !defined(MBEDTLS_SHA256_C) -#error "MBEDTLS_ENTROPY_FORCE_SHA256 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ - ( !defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) ) -#error "MBEDTLS_TEST_NULL_ENTROPY defined, but not all prerequisites" -#endif -#if defined(MBEDTLS_TEST_NULL_ENTROPY) && \ - ( defined(MBEDTLS_ENTROPY_NV_SEED) || defined(MBEDTLS_ENTROPY_HARDWARE_ALT) || \ - defined(MBEDTLS_HAVEGE_C) ) -#error "MBEDTLS_TEST_NULL_ENTROPY defined, but entropy sources too" -#endif - -#if defined(MBEDTLS_GCM_C) && ( \ - !defined(MBEDTLS_AES_C) && !defined(MBEDTLS_CAMELLIA_C) && !defined(MBEDTLS_ARIA_C) ) -#error "MBEDTLS_GCM_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT) -#error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C) -#error "MBEDTLS_HAVEGE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_HKDF_C) && !defined(MBEDTLS_MD_C) -#error "MBEDTLS_HKDF_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_HMAC_DRBG_C) && !defined(MBEDTLS_MD_C) -#error "MBEDTLS_HMAC_DRBG_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) && !defined(MBEDTLS_DHM_C) -#error "MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) && \ - !defined(MBEDTLS_ECDH_C) -#error "MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) && \ - ( !defined(MBEDTLS_DHM_C) || !defined(MBEDTLS_RSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_RSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ - !defined(MBEDTLS_X509_CRT_PARSE_C) ) -#error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) && \ - ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ - !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) && \ - ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_X509_CRT_PARSE_C) || \ - !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_KEY_EXCHANGE_RSA_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) && \ - ( !defined(MBEDTLS_ECJPAKE_C) || !defined(MBEDTLS_SHA256_C) || \ - !defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) ) -#error "MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) && \ - !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) && \ - ( !defined(MBEDTLS_SHA256_C) && \ - !defined(MBEDTLS_SHA512_C) && \ - !defined(MBEDTLS_SHA1_C) ) -#error "!MBEDTLS_SSL_KEEP_PEER_CERTIFICATE requires MBEDTLS_SHA512_C, MBEDTLS_SHA256_C or MBEDTLS_SHA1_C" -#endif - -#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) && \ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_MEMORY_BUFFER_ALLOC_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_MEMORY_BACKTRACE) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) -#error "MBEDTLS_MEMORY_BACKTRACE defined, but not all prerequesites" -#endif - -#if defined(MBEDTLS_MEMORY_DEBUG) && !defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C) -#error "MBEDTLS_MEMORY_DEBUG defined, but not all prerequesites" -#endif - -#if defined(MBEDTLS_PADLOCK_C) && !defined(MBEDTLS_HAVE_ASM) -#error "MBEDTLS_PADLOCK_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PEM_PARSE_C) && !defined(MBEDTLS_BASE64_C) -#error "MBEDTLS_PEM_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PEM_WRITE_C) && !defined(MBEDTLS_BASE64_C) -#error "MBEDTLS_PEM_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PK_C) && \ - ( !defined(MBEDTLS_RSA_C) && !defined(MBEDTLS_ECP_C) ) -#error "MBEDTLS_PK_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PK_PARSE_C) && !defined(MBEDTLS_PK_C) -#error "MBEDTLS_PK_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PK_WRITE_C) && !defined(MBEDTLS_PK_C) -#error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PKCS11_C) && !defined(MBEDTLS_PK_C) -#error "MBEDTLS_PKCS11_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PKCS11_C) -#if defined(MBEDTLS_DEPRECATED_REMOVED) -#error "MBEDTLS_PKCS11_C is deprecated and will be removed in a future version of Mbed TLS" -#elif defined(MBEDTLS_DEPRECATED_WARNING) -#warning "MBEDTLS_PKCS11_C is deprecated and will be removed in a future version of Mbed TLS" -#endif -#endif /* MBEDTLS_PKCS11_C */ - -#if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_EXIT_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_EXIT) ||\ - defined(MBEDTLS_PLATFORM_EXIT_ALT) ) -#error "MBEDTLS_PLATFORM_EXIT_MACRO and MBEDTLS_PLATFORM_STD_EXIT/MBEDTLS_PLATFORM_EXIT_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_ALT) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ - defined(MBEDTLS_PLATFORM_TIME_ALT) ) -#error "MBEDTLS_PLATFORM_TIME_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_TIME) ||\ - defined(MBEDTLS_PLATFORM_TIME_ALT) ) -#error "MBEDTLS_PLATFORM_TIME_TYPE_MACRO and MBEDTLS_PLATFORM_STD_TIME/MBEDTLS_PLATFORM_TIME_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_FPRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_FPRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_FPRINTF) ||\ - defined(MBEDTLS_PLATFORM_FPRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_FPRINTF_MACRO and MBEDTLS_PLATFORM_STD_FPRINTF/MBEDTLS_PLATFORM_FPRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_PLATFORM_FREE_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) &&\ - defined(MBEDTLS_PLATFORM_STD_FREE) -#error "MBEDTLS_PLATFORM_FREE_MACRO and MBEDTLS_PLATFORM_STD_FREE cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && !defined(MBEDTLS_PLATFORM_CALLOC_MACRO) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO must be defined if MBEDTLS_PLATFORM_FREE_MACRO is" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_PLATFORM_MEMORY) ) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&\ - defined(MBEDTLS_PLATFORM_STD_CALLOC) -#error "MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_STD_CALLOC cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && !defined(MBEDTLS_PLATFORM_FREE_MACRO) -#error "MBEDTLS_PLATFORM_FREE_MACRO must be defined if MBEDTLS_PLATFORM_CALLOC_MACRO is" -#endif - -#if defined(MBEDTLS_PLATFORM_MEMORY) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_MEMORY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_PRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_PRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_PRINTF) ||\ - defined(MBEDTLS_PLATFORM_PRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_PRINTF_MACRO and MBEDTLS_PLATFORM_STD_PRINTF/MBEDTLS_PLATFORM_PRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_SNPRINTF_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) && !defined(MBEDTLS_PLATFORM_C) -#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_SNPRINTF) ||\ - defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) ) -#error "MBEDTLS_PLATFORM_SNPRINTF_MACRO and MBEDTLS_PLATFORM_STD_SNPRINTF/MBEDTLS_PLATFORM_SNPRINTF_ALT cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) &&\ - !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) -#error "MBEDTLS_PLATFORM_STD_MEM_HDR defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_CALLOC) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_CALLOC defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_FREE) && !defined(MBEDTLS_PLATFORM_MEMORY) -#error "MBEDTLS_PLATFORM_STD_FREE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_EXIT) &&\ - !defined(MBEDTLS_PLATFORM_EXIT_ALT) -#error "MBEDTLS_PLATFORM_STD_EXIT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_TIME) &&\ - ( !defined(MBEDTLS_PLATFORM_TIME_ALT) ||\ - !defined(MBEDTLS_HAVE_TIME) ) -#error "MBEDTLS_PLATFORM_STD_TIME defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_FPRINTF) &&\ - !defined(MBEDTLS_PLATFORM_FPRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_FPRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_PRINTF) &&\ - !defined(MBEDTLS_PLATFORM_PRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_PRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_SNPRINTF) &&\ - !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) -#error "MBEDTLS_PLATFORM_STD_SNPRINTF defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_ENTROPY_NV_SEED) &&\ - ( !defined(MBEDTLS_PLATFORM_C) || !defined(MBEDTLS_ENTROPY_C) ) -#error "MBEDTLS_ENTROPY_NV_SEED defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) &&\ - !defined(MBEDTLS_ENTROPY_NV_SEED) -#error "MBEDTLS_PLATFORM_NV_SEED_ALT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) &&\ - !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) -#error "MBEDTLS_PLATFORM_STD_NV_SEED_READ defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) &&\ - !defined(MBEDTLS_PLATFORM_NV_SEED_ALT) -#error "MBEDTLS_PLATFORM_STD_NV_SEED_WRITE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) ||\ - defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) -#error "MBEDTLS_PLATFORM_NV_SEED_READ_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_READ cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) &&\ - ( defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) ||\ - defined(MBEDTLS_PLATFORM_NV_SEED_ALT) ) -#error "MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO and MBEDTLS_PLATFORM_STD_NV_SEED_WRITE cannot be defined simultaneously" -#endif - -#if defined(MBEDTLS_PSA_CRYPTO_C) && \ - !( defined(MBEDTLS_CTR_DRBG_C) && \ - defined(MBEDTLS_ENTROPY_C) ) -#error "MBEDTLS_PSA_CRYPTO_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PSA_CRYPTO_SPM) && !defined(MBEDTLS_PSA_CRYPTO_C) -#error "MBEDTLS_PSA_CRYPTO_SPM defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PSA_CRYPTO_SE_C) && \ - ! ( defined(MBEDTLS_PSA_CRYPTO_C) && \ - defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) ) -#error "MBEDTLS_PSA_CRYPTO_SE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \ - ! defined(MBEDTLS_PSA_CRYPTO_C) -#error "MBEDTLS_PSA_CRYPTO_STORAGE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ - !( defined(MBEDTLS_PSA_CRYPTO_STORAGE_C) && \ - defined(MBEDTLS_ENTROPY_NV_SEED) ) -#error "MBEDTLS_PSA_INJECT_ENTROPY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_PSA_INJECT_ENTROPY) && \ - !defined(MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES) -#error "MBEDTLS_PSA_INJECT_ENTROPY is not compatible with actual entropy sources" -#endif - -#if defined(MBEDTLS_PSA_ITS_FILE_C) && \ - !defined(MBEDTLS_FS_IO) -#error "MBEDTLS_PSA_ITS_FILE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ - !defined(MBEDTLS_OID_C) ) -#error "MBEDTLS_RSA_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_RSA_C) && ( !defined(MBEDTLS_PKCS1_V21) && \ - !defined(MBEDTLS_PKCS1_V15) ) -#error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled" -#endif - -#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) && \ - ( !defined(MBEDTLS_RSA_C) || !defined(MBEDTLS_PKCS1_V21) ) -#error "MBEDTLS_X509_RSASSA_PSS_SUPPORT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SHA512_NO_SHA384) && !defined(MBEDTLS_SHA512_C) -#error "MBEDTLS_SHA512_NO_SHA384 defined without MBEDTLS_SHA512_C" -#endif - -#if defined(MBEDTLS_SSL_PROTO_SSL3) && ( !defined(MBEDTLS_MD5_C) || \ - !defined(MBEDTLS_SHA1_C) ) -#error "MBEDTLS_SSL_PROTO_SSL3 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1) && ( !defined(MBEDTLS_MD5_C) || \ - !defined(MBEDTLS_SHA1_C) ) -#error "MBEDTLS_SSL_PROTO_TLS1 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1_1) && ( !defined(MBEDTLS_MD5_C) || \ - !defined(MBEDTLS_SHA1_C) ) -#error "MBEDTLS_SSL_PROTO_TLS1_1 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && ( !defined(MBEDTLS_SHA1_C) && \ - !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) ) -#error "MBEDTLS_SSL_PROTO_TLS1_2 defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL) && ( !defined(MBEDTLS_HKDF_C) && \ - !defined(MBEDTLS_SHA256_C) && !defined(MBEDTLS_SHA512_C) ) -#error "MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL defined, but not all prerequisites" -#endif - -#if (defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \ - defined(MBEDTLS_SSL_PROTO_TLS1_1) || defined(MBEDTLS_SSL_PROTO_TLS1_2)) && \ - !(defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) ) -#error "One or more versions of the TLS protocol are enabled " \ - "but no key exchange methods defined with MBEDTLS_KEY_EXCHANGE_xxxx" -#endif - -#if defined(MBEDTLS_SSL_PROTO_DTLS) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2) -#error "MBEDTLS_SSL_PROTO_DTLS defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_CLI_C) && !defined(MBEDTLS_SSL_TLS_C) -#error "MBEDTLS_SSL_CLI_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && ( !defined(MBEDTLS_CIPHER_C) || \ - !defined(MBEDTLS_MD_C) ) -#error "MBEDTLS_SSL_TLS_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_SRV_C) && !defined(MBEDTLS_SSL_TLS_C) -#error "MBEDTLS_SSL_SRV_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && (!defined(MBEDTLS_SSL_PROTO_SSL3) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1) && !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2)) -#error "MBEDTLS_SSL_TLS_C defined, but no protocols are active" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ - defined(MBEDTLS_SSL_PROTO_TLS1_1) && !defined(MBEDTLS_SSL_PROTO_TLS1)) -#error "Illegal protocol selection" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_TLS1) && \ - defined(MBEDTLS_SSL_PROTO_TLS1_2) && !defined(MBEDTLS_SSL_PROTO_TLS1_1)) -#error "Illegal protocol selection" -#endif - -#if defined(MBEDTLS_SSL_TLS_C) && (defined(MBEDTLS_SSL_PROTO_SSL3) && \ - defined(MBEDTLS_SSL_PROTO_TLS1_2) && (!defined(MBEDTLS_SSL_PROTO_TLS1) || \ - !defined(MBEDTLS_SSL_PROTO_TLS1_1))) -#error "Illegal protocol selection" -#endif - -#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && !defined(MBEDTLS_SSL_PROTO_DTLS) -#error "MBEDTLS_SSL_DTLS_HELLO_VERIFY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE) && \ - !defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) -#error "MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) && \ - ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) -#error "MBEDTLS_SSL_DTLS_ANTI_REPLAY defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ - ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) -#error "MBEDTLS_SSL_DTLS_CONNECTION_ID defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ - defined(MBEDTLS_SSL_CID_IN_LEN_MAX) && \ - MBEDTLS_SSL_CID_IN_LEN_MAX > 255 -#error "MBEDTLS_SSL_CID_IN_LEN_MAX too large (max 255)" -#endif - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) && \ - defined(MBEDTLS_SSL_CID_OUT_LEN_MAX) && \ - MBEDTLS_SSL_CID_OUT_LEN_MAX > 255 -#error "MBEDTLS_SSL_CID_OUT_LEN_MAX too large (max 255)" -#endif - -#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) && \ - ( !defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ) -#error "MBEDTLS_SSL_DTLS_BADMAC_LIMIT defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2) -#error "MBEDTLS_SSL_ENCRYPT_THEN_MAC defined, but not all prerequsites" -#endif - -#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_1) && \ - !defined(MBEDTLS_SSL_PROTO_TLS1_2) -#error "MBEDTLS_SSL_EXTENDED_MASTER_SECRET defined, but not all prerequsites" -#endif - -#if defined(MBEDTLS_SSL_TICKET_C) && !defined(MBEDTLS_CIPHER_C) -#error "MBEDTLS_SSL_TICKET_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) && \ - !defined(MBEDTLS_SSL_PROTO_SSL3) && !defined(MBEDTLS_SSL_PROTO_TLS1) -#error "MBEDTLS_SSL_CBC_RECORD_SPLITTING defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) && \ - !defined(MBEDTLS_X509_CRT_PARSE_C) -#error "MBEDTLS_SSL_SERVER_NAME_INDICATION defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_THREADING_PTHREAD) -#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) -#error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites" -#endif -#define MBEDTLS_THREADING_IMPL -#endif - -#if defined(MBEDTLS_THREADING_ALT) -#if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) -#error "MBEDTLS_THREADING_ALT defined, but not all prerequisites" -#endif -#define MBEDTLS_THREADING_IMPL -#endif - -#if defined(MBEDTLS_THREADING_C) && !defined(MBEDTLS_THREADING_IMPL) -#error "MBEDTLS_THREADING_C defined, single threading implementation required" -#endif -#undef MBEDTLS_THREADING_IMPL - -#if defined(MBEDTLS_USE_PSA_CRYPTO) && !defined(MBEDTLS_PSA_CRYPTO_C) -#error "MBEDTLS_USE_PSA_CRYPTO defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_VERSION_FEATURES) && !defined(MBEDTLS_VERSION_C) -#error "MBEDTLS_VERSION_FEATURES defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_USE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ - !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_PARSE_C) || \ - !defined(MBEDTLS_PK_PARSE_C) ) -#error "MBEDTLS_X509_USE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CREATE_C) && ( !defined(MBEDTLS_BIGNUM_C) || \ - !defined(MBEDTLS_OID_C) || !defined(MBEDTLS_ASN1_WRITE_C) || \ - !defined(MBEDTLS_PK_WRITE_C) ) -#error "MBEDTLS_X509_CREATE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_CERTS_C) && !defined(MBEDTLS_X509_USE_C) -#error "MBEDTLS_CERTS_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) -#error "MBEDTLS_X509_CRT_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CRL_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) -#error "MBEDTLS_X509_CRL_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CSR_PARSE_C) && ( !defined(MBEDTLS_X509_USE_C) ) -#error "MBEDTLS_X509_CSR_PARSE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CRT_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) -#error "MBEDTLS_X509_CRT_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_X509_CSR_WRITE_C) && ( !defined(MBEDTLS_X509_CREATE_C) ) -#error "MBEDTLS_X509_CSR_WRITE_C defined, but not all prerequisites" -#endif - -#if defined(MBEDTLS_HAVE_INT32) && defined(MBEDTLS_HAVE_INT64) -#error "MBEDTLS_HAVE_INT32 and MBEDTLS_HAVE_INT64 cannot be defined simultaneously" -#endif /* MBEDTLS_HAVE_INT32 && MBEDTLS_HAVE_INT64 */ - -#if ( defined(MBEDTLS_HAVE_INT32) || defined(MBEDTLS_HAVE_INT64) ) && \ - defined(MBEDTLS_HAVE_ASM) -#error "MBEDTLS_HAVE_INT32/MBEDTLS_HAVE_INT64 and MBEDTLS_HAVE_ASM cannot be defined simultaneously" -#endif /* (MBEDTLS_HAVE_INT32 || MBEDTLS_HAVE_INT64) && MBEDTLS_HAVE_ASM */ - -#if defined(MBEDTLS_SSL_PROTO_SSL3) -#if defined(MBEDTLS_DEPRECATED_REMOVED) -#error "MBEDTLS_SSL_PROTO_SSL3 is deprecated and will be removed in a future version of Mbed TLS" -#elif defined(MBEDTLS_DEPRECATED_WARNING) -#warning "MBEDTLS_SSL_PROTO_SSL3 is deprecated and will be removed in a future version of Mbed TLS" -#endif -#endif /* MBEDTLS_SSL_PROTO_SSL3 */ - -#if defined(MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO) -#if defined(MBEDTLS_DEPRECATED_REMOVED) -#error "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO is deprecated and will be removed in a future version of Mbed TLS" -#elif defined(MBEDTLS_DEPRECATED_WARNING) -#warning "MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO is deprecated and will be removed in a future version of Mbed TLS" -#endif -#endif /* MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO */ - -#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) -#if defined(MBEDTLS_DEPRECATED_REMOVED) -#error "MBEDTLS_SSL_HW_RECORD_ACCEL is deprecated and will be removed in a future version of Mbed TLS" -#elif defined(MBEDTLS_DEPRECATED_WARNING) -#warning "MBEDTLS_SSL_HW_RECORD_ACCEL is deprecated and will be removed in a future version of Mbed TLS" -#endif /* MBEDTLS_DEPRECATED_REMOVED */ -#endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */ - -/* - * Avoid warning from -pedantic. This is a convenient place for this - * workaround since this is included by every single file before the - * #if defined(MBEDTLS_xxx_C) that results in empty translation units. - */ -typedef int mbedtls_iso_c_forbids_empty_translation_units; - -#endif /* MBEDTLS_CHECK_CONFIG_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cipher.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cipher.h deleted file mode 100644 index 96efd937f..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cipher.h +++ /dev/null @@ -1,926 +0,0 @@ -/** - * \file cipher.h - * - * \brief This file contains an abstraction interface for use with the cipher - * primitives provided by the library. It provides a common interface to all of - * the available cipher operations. - * - * \author Adriaan de Jong - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CIPHER_H -#define MBEDTLS_CIPHER_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include "mbedtls/platform_util.h" - -#if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CCM_C) || defined(MBEDTLS_CHACHAPOLY_C) -#define MBEDTLS_CIPHER_MODE_AEAD -#endif - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -#define MBEDTLS_CIPHER_MODE_WITH_PADDING -#endif - -#if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_NULL_CIPHER) || \ - defined(MBEDTLS_CHACHA20_C) -#define MBEDTLS_CIPHER_MODE_STREAM -#endif - -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - -#define MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE -0x6080 /**< The selected feature is not available. */ -#define MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA -0x6100 /**< Bad input parameters. */ -#define MBEDTLS_ERR_CIPHER_ALLOC_FAILED -0x6180 /**< Failed to allocate memory. */ -#define MBEDTLS_ERR_CIPHER_INVALID_PADDING -0x6200 /**< Input data contains invalid padding and is rejected. */ -#define MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED -0x6280 /**< Decryption of block requires a full block. */ -#define MBEDTLS_ERR_CIPHER_AUTH_FAILED -0x6300 /**< Authentication failed (for AEAD modes). */ -#define MBEDTLS_ERR_CIPHER_INVALID_CONTEXT -0x6380 /**< The context is invalid. For example, because it was freed. */ - -/* MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_CIPHER_HW_ACCEL_FAILED -0x6400 /**< Cipher hardware accelerator failed. */ - -#define MBEDTLS_CIPHER_VARIABLE_IV_LEN 0x01 /**< Cipher accepts IVs of variable length. */ -#define MBEDTLS_CIPHER_VARIABLE_KEY_LEN 0x02 /**< Cipher accepts keys of variable length. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Supported cipher types. - * - * \warning RC4 and DES are considered weak ciphers and their use - * constitutes a security risk. Arm recommends considering stronger - * ciphers instead. - */ -typedef enum { - MBEDTLS_CIPHER_ID_NONE = 0, /**< Placeholder to mark the end of cipher ID lists. */ - MBEDTLS_CIPHER_ID_NULL, /**< The identity cipher, treated as a stream cipher. */ - MBEDTLS_CIPHER_ID_AES, /**< The AES cipher. */ - MBEDTLS_CIPHER_ID_DES, /**< The DES cipher. */ - MBEDTLS_CIPHER_ID_3DES, /**< The Triple DES cipher. */ - MBEDTLS_CIPHER_ID_CAMELLIA, /**< The Camellia cipher. */ - MBEDTLS_CIPHER_ID_BLOWFISH, /**< The Blowfish cipher. */ - MBEDTLS_CIPHER_ID_ARC4, /**< The RC4 cipher. */ - MBEDTLS_CIPHER_ID_ARIA, /**< The Aria cipher. */ - MBEDTLS_CIPHER_ID_CHACHA20, /**< The ChaCha20 cipher. */ -} mbedtls_cipher_id_t; - -/** - * \brief Supported {cipher type, cipher mode} pairs. - * - * \warning RC4 and DES are considered weak ciphers and their use - * constitutes a security risk. Arm recommends considering stronger - * ciphers instead. - */ -typedef enum { - MBEDTLS_CIPHER_NONE = 0, /**< Placeholder to mark the end of cipher-pair lists. */ - MBEDTLS_CIPHER_NULL, /**< The identity stream cipher. */ - MBEDTLS_CIPHER_AES_128_ECB, /**< AES cipher with 128-bit ECB mode. */ - MBEDTLS_CIPHER_AES_192_ECB, /**< AES cipher with 192-bit ECB mode. */ - MBEDTLS_CIPHER_AES_256_ECB, /**< AES cipher with 256-bit ECB mode. */ - MBEDTLS_CIPHER_AES_128_CBC, /**< AES cipher with 128-bit CBC mode. */ - MBEDTLS_CIPHER_AES_192_CBC, /**< AES cipher with 192-bit CBC mode. */ - MBEDTLS_CIPHER_AES_256_CBC, /**< AES cipher with 256-bit CBC mode. */ - MBEDTLS_CIPHER_AES_128_CFB128, /**< AES cipher with 128-bit CFB128 mode. */ - MBEDTLS_CIPHER_AES_192_CFB128, /**< AES cipher with 192-bit CFB128 mode. */ - MBEDTLS_CIPHER_AES_256_CFB128, /**< AES cipher with 256-bit CFB128 mode. */ - MBEDTLS_CIPHER_AES_128_CTR, /**< AES cipher with 128-bit CTR mode. */ - MBEDTLS_CIPHER_AES_192_CTR, /**< AES cipher with 192-bit CTR mode. */ - MBEDTLS_CIPHER_AES_256_CTR, /**< AES cipher with 256-bit CTR mode. */ - MBEDTLS_CIPHER_AES_128_GCM, /**< AES cipher with 128-bit GCM mode. */ - MBEDTLS_CIPHER_AES_192_GCM, /**< AES cipher with 192-bit GCM mode. */ - MBEDTLS_CIPHER_AES_256_GCM, /**< AES cipher with 256-bit GCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_ECB, /**< Camellia cipher with 128-bit ECB mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_ECB, /**< Camellia cipher with 192-bit ECB mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_ECB, /**< Camellia cipher with 256-bit ECB mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_CBC, /**< Camellia cipher with 128-bit CBC mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_CBC, /**< Camellia cipher with 192-bit CBC mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_CBC, /**< Camellia cipher with 256-bit CBC mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_CFB128, /**< Camellia cipher with 128-bit CFB128 mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_CFB128, /**< Camellia cipher with 192-bit CFB128 mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_CFB128, /**< Camellia cipher with 256-bit CFB128 mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_CTR, /**< Camellia cipher with 128-bit CTR mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_CTR, /**< Camellia cipher with 192-bit CTR mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_CTR, /**< Camellia cipher with 256-bit CTR mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_GCM, /**< Camellia cipher with 128-bit GCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_GCM, /**< Camellia cipher with 192-bit GCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_GCM, /**< Camellia cipher with 256-bit GCM mode. */ - MBEDTLS_CIPHER_DES_ECB, /**< DES cipher with ECB mode. */ - MBEDTLS_CIPHER_DES_CBC, /**< DES cipher with CBC mode. */ - MBEDTLS_CIPHER_DES_EDE_ECB, /**< DES cipher with EDE ECB mode. */ - MBEDTLS_CIPHER_DES_EDE_CBC, /**< DES cipher with EDE CBC mode. */ - MBEDTLS_CIPHER_DES_EDE3_ECB, /**< DES cipher with EDE3 ECB mode. */ - MBEDTLS_CIPHER_DES_EDE3_CBC, /**< DES cipher with EDE3 CBC mode. */ - MBEDTLS_CIPHER_BLOWFISH_ECB, /**< Blowfish cipher with ECB mode. */ - MBEDTLS_CIPHER_BLOWFISH_CBC, /**< Blowfish cipher with CBC mode. */ - MBEDTLS_CIPHER_BLOWFISH_CFB64, /**< Blowfish cipher with CFB64 mode. */ - MBEDTLS_CIPHER_BLOWFISH_CTR, /**< Blowfish cipher with CTR mode. */ - MBEDTLS_CIPHER_ARC4_128, /**< RC4 cipher with 128-bit mode. */ - MBEDTLS_CIPHER_AES_128_CCM, /**< AES cipher with 128-bit CCM mode. */ - MBEDTLS_CIPHER_AES_192_CCM, /**< AES cipher with 192-bit CCM mode. */ - MBEDTLS_CIPHER_AES_256_CCM, /**< AES cipher with 256-bit CCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_128_CCM, /**< Camellia cipher with 128-bit CCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_192_CCM, /**< Camellia cipher with 192-bit CCM mode. */ - MBEDTLS_CIPHER_CAMELLIA_256_CCM, /**< Camellia cipher with 256-bit CCM mode. */ - MBEDTLS_CIPHER_ARIA_128_ECB, /**< Aria cipher with 128-bit key and ECB mode. */ - MBEDTLS_CIPHER_ARIA_192_ECB, /**< Aria cipher with 192-bit key and ECB mode. */ - MBEDTLS_CIPHER_ARIA_256_ECB, /**< Aria cipher with 256-bit key and ECB mode. */ - MBEDTLS_CIPHER_ARIA_128_CBC, /**< Aria cipher with 128-bit key and CBC mode. */ - MBEDTLS_CIPHER_ARIA_192_CBC, /**< Aria cipher with 192-bit key and CBC mode. */ - MBEDTLS_CIPHER_ARIA_256_CBC, /**< Aria cipher with 256-bit key and CBC mode. */ - MBEDTLS_CIPHER_ARIA_128_CFB128, /**< Aria cipher with 128-bit key and CFB-128 mode. */ - MBEDTLS_CIPHER_ARIA_192_CFB128, /**< Aria cipher with 192-bit key and CFB-128 mode. */ - MBEDTLS_CIPHER_ARIA_256_CFB128, /**< Aria cipher with 256-bit key and CFB-128 mode. */ - MBEDTLS_CIPHER_ARIA_128_CTR, /**< Aria cipher with 128-bit key and CTR mode. */ - MBEDTLS_CIPHER_ARIA_192_CTR, /**< Aria cipher with 192-bit key and CTR mode. */ - MBEDTLS_CIPHER_ARIA_256_CTR, /**< Aria cipher with 256-bit key and CTR mode. */ - MBEDTLS_CIPHER_ARIA_128_GCM, /**< Aria cipher with 128-bit key and GCM mode. */ - MBEDTLS_CIPHER_ARIA_192_GCM, /**< Aria cipher with 192-bit key and GCM mode. */ - MBEDTLS_CIPHER_ARIA_256_GCM, /**< Aria cipher with 256-bit key and GCM mode. */ - MBEDTLS_CIPHER_ARIA_128_CCM, /**< Aria cipher with 128-bit key and CCM mode. */ - MBEDTLS_CIPHER_ARIA_192_CCM, /**< Aria cipher with 192-bit key and CCM mode. */ - MBEDTLS_CIPHER_ARIA_256_CCM, /**< Aria cipher with 256-bit key and CCM mode. */ - MBEDTLS_CIPHER_AES_128_OFB, /**< AES 128-bit cipher in OFB mode. */ - MBEDTLS_CIPHER_AES_192_OFB, /**< AES 192-bit cipher in OFB mode. */ - MBEDTLS_CIPHER_AES_256_OFB, /**< AES 256-bit cipher in OFB mode. */ - MBEDTLS_CIPHER_AES_128_XTS, /**< AES 128-bit cipher in XTS block mode. */ - MBEDTLS_CIPHER_AES_256_XTS, /**< AES 256-bit cipher in XTS block mode. */ - MBEDTLS_CIPHER_CHACHA20, /**< ChaCha20 stream cipher. */ - MBEDTLS_CIPHER_CHACHA20_POLY1305, /**< ChaCha20-Poly1305 AEAD cipher. */ - MBEDTLS_CIPHER_AES_128_KW, /**< AES cipher with 128-bit NIST KW mode. */ - MBEDTLS_CIPHER_AES_192_KW, /**< AES cipher with 192-bit NIST KW mode. */ - MBEDTLS_CIPHER_AES_256_KW, /**< AES cipher with 256-bit NIST KW mode. */ - MBEDTLS_CIPHER_AES_128_KWP, /**< AES cipher with 128-bit NIST KWP mode. */ - MBEDTLS_CIPHER_AES_192_KWP, /**< AES cipher with 192-bit NIST KWP mode. */ - MBEDTLS_CIPHER_AES_256_KWP, /**< AES cipher with 256-bit NIST KWP mode. */ -} mbedtls_cipher_type_t; - -/** Supported cipher modes. */ -typedef enum { - MBEDTLS_MODE_NONE = 0, /**< None. */ - MBEDTLS_MODE_ECB, /**< The ECB cipher mode. */ - MBEDTLS_MODE_CBC, /**< The CBC cipher mode. */ - MBEDTLS_MODE_CFB, /**< The CFB cipher mode. */ - MBEDTLS_MODE_OFB, /**< The OFB cipher mode. */ - MBEDTLS_MODE_CTR, /**< The CTR cipher mode. */ - MBEDTLS_MODE_GCM, /**< The GCM cipher mode. */ - MBEDTLS_MODE_STREAM, /**< The stream cipher mode. */ - MBEDTLS_MODE_CCM, /**< The CCM cipher mode. */ - MBEDTLS_MODE_XTS, /**< The XTS cipher mode. */ - MBEDTLS_MODE_CHACHAPOLY, /**< The ChaCha-Poly cipher mode. */ - MBEDTLS_MODE_KW, /**< The SP800-38F KW mode */ - MBEDTLS_MODE_KWP, /**< The SP800-38F KWP mode */ -} mbedtls_cipher_mode_t; - -/** Supported cipher padding types. */ -typedef enum { - MBEDTLS_PADDING_PKCS7 = 0, /**< PKCS7 padding (default). */ - MBEDTLS_PADDING_ONE_AND_ZEROS, /**< ISO/IEC 7816-4 padding. */ - MBEDTLS_PADDING_ZEROS_AND_LEN, /**< ANSI X.923 padding. */ - MBEDTLS_PADDING_ZEROS, /**< Zero padding (not reversible). */ - MBEDTLS_PADDING_NONE, /**< Never pad (full blocks only). */ -} mbedtls_cipher_padding_t; - -/** Type of operation. */ -typedef enum { - MBEDTLS_OPERATION_NONE = -1, - MBEDTLS_DECRYPT = 0, - MBEDTLS_ENCRYPT, -} mbedtls_operation_t; - -enum { - /** Undefined key length. */ - MBEDTLS_KEY_LENGTH_NONE = 0, - /** Key length, in bits (including parity), for DES keys. */ - MBEDTLS_KEY_LENGTH_DES = 64, - /** Key length in bits, including parity, for DES in two-key EDE. */ - MBEDTLS_KEY_LENGTH_DES_EDE = 128, - /** Key length in bits, including parity, for DES in three-key EDE. */ - MBEDTLS_KEY_LENGTH_DES_EDE3 = 192, -}; - -/** Maximum length of any IV, in Bytes. */ -#define MBEDTLS_MAX_IV_LENGTH 16 -/** Maximum block size of any cipher, in Bytes. */ -#define MBEDTLS_MAX_BLOCK_LENGTH 16 - -/** - * Base cipher information (opaque struct). - */ -typedef struct mbedtls_cipher_base_t mbedtls_cipher_base_t; - -/** - * CMAC context (opaque struct). - */ -typedef struct mbedtls_cmac_context_t mbedtls_cmac_context_t; - -/** - * Cipher information. Allows calling cipher functions - * in a generic way. - */ -typedef struct mbedtls_cipher_info_t -{ - /** Full cipher identifier. For example, - * MBEDTLS_CIPHER_AES_256_CBC. - */ - mbedtls_cipher_type_t type; - - /** The cipher mode. For example, MBEDTLS_MODE_CBC. */ - mbedtls_cipher_mode_t mode; - - /** The cipher key length, in bits. This is the - * default length for variable sized ciphers. - * Includes parity bits for ciphers like DES. - */ - unsigned int key_bitlen; - - /** Name of the cipher. */ - const char * name; - - /** IV or nonce size, in Bytes. - * For ciphers that accept variable IV sizes, - * this is the recommended size. - */ - unsigned int iv_size; - - /** Bitflag comprised of MBEDTLS_CIPHER_VARIABLE_IV_LEN and - * MBEDTLS_CIPHER_VARIABLE_KEY_LEN indicating whether the - * cipher supports variable IV or variable key sizes, respectively. - */ - int flags; - - /** The block size, in Bytes. */ - unsigned int block_size; - - /** Struct for base cipher information and functions. */ - const mbedtls_cipher_base_t *base; - -} mbedtls_cipher_info_t; - -/** - * Generic cipher context. - */ -typedef struct mbedtls_cipher_context_t -{ - /** Information about the associated cipher. */ - const mbedtls_cipher_info_t *cipher_info; - - /** Key length to use. */ - int key_bitlen; - - /** Operation that the key of the context has been - * initialized for. - */ - mbedtls_operation_t operation; - -#if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING) - /** Padding functions to use, if relevant for - * the specific cipher mode. - */ - void (*add_padding)( unsigned char *output, size_t olen, size_t data_len ); - int (*get_padding)( unsigned char *input, size_t ilen, size_t *data_len ); -#endif - - /** Buffer for input that has not been processed yet. */ - unsigned char unprocessed_data[MBEDTLS_MAX_BLOCK_LENGTH]; - - /** Number of Bytes that have not been processed yet. */ - size_t unprocessed_len; - - /** Current IV or NONCE_COUNTER for CTR-mode, data unit (or sector) number - * for XTS-mode. */ - unsigned char iv[MBEDTLS_MAX_IV_LENGTH]; - - /** IV size in Bytes, for ciphers with variable-length IVs. */ - size_t iv_size; - - /** The cipher-specific context. */ - void *cipher_ctx; - -#if defined(MBEDTLS_CMAC_C) - /** CMAC-specific context. */ - mbedtls_cmac_context_t *cmac_ctx; -#endif - -#if defined(MBEDTLS_USE_PSA_CRYPTO) - /** Indicates whether the cipher operations should be performed - * by Mbed TLS' own crypto library or an external implementation - * of the PSA Crypto API. - * This is unset if the cipher context was established through - * mbedtls_cipher_setup(), and set if it was established through - * mbedtls_cipher_setup_psa(). - */ - unsigned char psa_enabled; -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -} mbedtls_cipher_context_t; - -/** - * \brief This function retrieves the list of ciphers supported - * by the generic cipher module. - * - * For any cipher identifier in the returned list, you can - * obtain the corresponding generic cipher information structure - * via mbedtls_cipher_info_from_type(), which can then be used - * to prepare a cipher context via mbedtls_cipher_setup(). - * - * - * \return A statically-allocated array of cipher identifiers - * of type cipher_type_t. The last entry is zero. - */ -const int *mbedtls_cipher_list( void ); - -/** - * \brief This function retrieves the cipher-information - * structure associated with the given cipher name. - * - * \param cipher_name Name of the cipher to search for. This must not be - * \c NULL. - * - * \return The cipher information structure associated with the - * given \p cipher_name. - * \return \c NULL if the associated cipher information is not found. - */ -const mbedtls_cipher_info_t *mbedtls_cipher_info_from_string( const char *cipher_name ); - -/** - * \brief This function retrieves the cipher-information - * structure associated with the given cipher type. - * - * \param cipher_type Type of the cipher to search for. - * - * \return The cipher information structure associated with the - * given \p cipher_type. - * \return \c NULL if the associated cipher information is not found. - */ -const mbedtls_cipher_info_t *mbedtls_cipher_info_from_type( const mbedtls_cipher_type_t cipher_type ); - -/** - * \brief This function retrieves the cipher-information - * structure associated with the given cipher ID, - * key size and mode. - * - * \param cipher_id The ID of the cipher to search for. For example, - * #MBEDTLS_CIPHER_ID_AES. - * \param key_bitlen The length of the key in bits. - * \param mode The cipher mode. For example, #MBEDTLS_MODE_CBC. - * - * \return The cipher information structure associated with the - * given \p cipher_id. - * \return \c NULL if the associated cipher information is not found. - */ -const mbedtls_cipher_info_t *mbedtls_cipher_info_from_values( const mbedtls_cipher_id_t cipher_id, - int key_bitlen, - const mbedtls_cipher_mode_t mode ); - -/** - * \brief This function initializes a \p cipher_context as NONE. - * - * \param ctx The context to be initialized. This must not be \c NULL. - */ -void mbedtls_cipher_init( mbedtls_cipher_context_t *ctx ); - -/** - * \brief This function frees and clears the cipher-specific - * context of \p ctx. Freeing \p ctx itself remains the - * responsibility of the caller. - * - * \param ctx The context to be freed. If this is \c NULL, the - * function has no effect, otherwise this must point to an - * initialized context. - */ -void mbedtls_cipher_free( mbedtls_cipher_context_t *ctx ); - - -/** - * \brief This function initializes a cipher context for - * use with the given cipher primitive. - * - * \param ctx The context to initialize. This must be initialized. - * \param cipher_info The cipher to use. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_ALLOC_FAILED if allocation of the - * cipher-specific context fails. - * - * \internal Currently, the function also clears the structure. - * In future versions, the caller will be required to call - * mbedtls_cipher_init() on the structure first. - */ -int mbedtls_cipher_setup( mbedtls_cipher_context_t *ctx, - const mbedtls_cipher_info_t *cipher_info ); - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -/** - * \brief This function initializes a cipher context for - * PSA-based use with the given cipher primitive. - * - * \note See #MBEDTLS_USE_PSA_CRYPTO for information on PSA. - * - * \param ctx The context to initialize. May not be \c NULL. - * \param cipher_info The cipher to use. - * \param taglen For AEAD ciphers, the length in bytes of the - * authentication tag to use. Subsequent uses of - * mbedtls_cipher_auth_encrypt() or - * mbedtls_cipher_auth_decrypt() must provide - * the same tag length. - * For non-AEAD ciphers, the value must be \c 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_ALLOC_FAILED if allocation of the - * cipher-specific context fails. - */ -int mbedtls_cipher_setup_psa( mbedtls_cipher_context_t *ctx, - const mbedtls_cipher_info_t *cipher_info, - size_t taglen ); -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -/** - * \brief This function returns the block size of the given cipher. - * - * \param ctx The context of the cipher. This must be initialized. - * - * \return The block size of the underlying cipher. - * \return \c 0 if \p ctx has not been initialized. - */ -static inline unsigned int mbedtls_cipher_get_block_size( - const mbedtls_cipher_context_t *ctx ) -{ - MBEDTLS_INTERNAL_VALIDATE_RET( ctx != NULL, 0 ); - if( ctx->cipher_info == NULL ) - return 0; - - return ctx->cipher_info->block_size; -} - -/** - * \brief This function returns the mode of operation for - * the cipher. For example, MBEDTLS_MODE_CBC. - * - * \param ctx The context of the cipher. This must be initialized. - * - * \return The mode of operation. - * \return #MBEDTLS_MODE_NONE if \p ctx has not been initialized. - */ -static inline mbedtls_cipher_mode_t mbedtls_cipher_get_cipher_mode( - const mbedtls_cipher_context_t *ctx ) -{ - MBEDTLS_INTERNAL_VALIDATE_RET( ctx != NULL, MBEDTLS_MODE_NONE ); - if( ctx->cipher_info == NULL ) - return MBEDTLS_MODE_NONE; - - return ctx->cipher_info->mode; -} - -/** - * \brief This function returns the size of the IV or nonce - * of the cipher, in Bytes. - * - * \param ctx The context of the cipher. This must be initialized. - * - * \return The recommended IV size if no IV has been set. - * \return \c 0 for ciphers not using an IV or a nonce. - * \return The actual size if an IV has been set. - */ -static inline int mbedtls_cipher_get_iv_size( - const mbedtls_cipher_context_t *ctx ) -{ - MBEDTLS_INTERNAL_VALIDATE_RET( ctx != NULL, 0 ); - if( ctx->cipher_info == NULL ) - return 0; - - if( ctx->iv_size != 0 ) - return (int) ctx->iv_size; - - return (int) ctx->cipher_info->iv_size; -} - -/** - * \brief This function returns the type of the given cipher. - * - * \param ctx The context of the cipher. This must be initialized. - * - * \return The type of the cipher. - * \return #MBEDTLS_CIPHER_NONE if \p ctx has not been initialized. - */ -static inline mbedtls_cipher_type_t mbedtls_cipher_get_type( - const mbedtls_cipher_context_t *ctx ) -{ - MBEDTLS_INTERNAL_VALIDATE_RET( - ctx != NULL, MBEDTLS_CIPHER_NONE ); - if( ctx->cipher_info == NULL ) - return MBEDTLS_CIPHER_NONE; - - return ctx->cipher_info->type; -} - -/** - * \brief This function returns the name of the given cipher - * as a string. - * - * \param ctx The context of the cipher. This must be initialized. - * - * \return The name of the cipher. - * \return NULL if \p ctx has not been not initialized. - */ -static inline const char *mbedtls_cipher_get_name( - const mbedtls_cipher_context_t *ctx ) -{ - MBEDTLS_INTERNAL_VALIDATE_RET( ctx != NULL, 0 ); - if( ctx->cipher_info == NULL ) - return 0; - - return ctx->cipher_info->name; -} - -/** - * \brief This function returns the key length of the cipher. - * - * \param ctx The context of the cipher. This must be initialized. - * - * \return The key length of the cipher in bits. - * \return #MBEDTLS_KEY_LENGTH_NONE if ctx \p has not been - * initialized. - */ -static inline int mbedtls_cipher_get_key_bitlen( - const mbedtls_cipher_context_t *ctx ) -{ - MBEDTLS_INTERNAL_VALIDATE_RET( - ctx != NULL, MBEDTLS_KEY_LENGTH_NONE ); - if( ctx->cipher_info == NULL ) - return MBEDTLS_KEY_LENGTH_NONE; - - return (int) ctx->cipher_info->key_bitlen; -} - -/** - * \brief This function returns the operation of the given cipher. - * - * \param ctx The context of the cipher. This must be initialized. - * - * \return The type of operation: #MBEDTLS_ENCRYPT or #MBEDTLS_DECRYPT. - * \return #MBEDTLS_OPERATION_NONE if \p ctx has not been initialized. - */ -static inline mbedtls_operation_t mbedtls_cipher_get_operation( - const mbedtls_cipher_context_t *ctx ) -{ - MBEDTLS_INTERNAL_VALIDATE_RET( - ctx != NULL, MBEDTLS_OPERATION_NONE ); - if( ctx->cipher_info == NULL ) - return MBEDTLS_OPERATION_NONE; - - return ctx->operation; -} - -/** - * \brief This function sets the key to use with the given context. - * - * \param ctx The generic cipher context. This must be initialized and - * bound to a cipher information structure. - * \param key The key to use. This must be a readable buffer of at - * least \p key_bitlen Bits. - * \param key_bitlen The key length to use, in Bits. - * \param operation The operation that the key will be used for: - * #MBEDTLS_ENCRYPT or #MBEDTLS_DECRYPT. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_setkey( mbedtls_cipher_context_t *ctx, - const unsigned char *key, - int key_bitlen, - const mbedtls_operation_t operation ); - -#if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING) -/** - * \brief This function sets the padding mode, for cipher modes - * that use padding. - * - * The default passing mode is PKCS7 padding. - * - * \param ctx The generic cipher context. This must be initialized and - * bound to a cipher information structure. - * \param mode The padding mode. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE - * if the selected padding mode is not supported. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA if the cipher mode - * does not support padding. - */ -int mbedtls_cipher_set_padding_mode( mbedtls_cipher_context_t *ctx, - mbedtls_cipher_padding_t mode ); -#endif /* MBEDTLS_CIPHER_MODE_WITH_PADDING */ - -/** - * \brief This function sets the initialization vector (IV) - * or nonce. - * - * \note Some ciphers do not use IVs nor nonce. For these - * ciphers, this function has no effect. - * - * \param ctx The generic cipher context. This must be initialized and - * bound to a cipher information structure. - * \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. This - * must be a readable buffer of at least \p iv_len Bytes. - * \param iv_len The IV length for ciphers with variable-size IV. - * This parameter is discarded by ciphers with fixed-size IV. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - */ -int mbedtls_cipher_set_iv( mbedtls_cipher_context_t *ctx, - const unsigned char *iv, - size_t iv_len ); - -/** - * \brief This function resets the cipher state. - * - * \param ctx The generic cipher context. This must be initialized. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - */ -int mbedtls_cipher_reset( mbedtls_cipher_context_t *ctx ); - -#if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CHACHAPOLY_C) -/** - * \brief This function adds additional data for AEAD ciphers. - * Currently supported with GCM and ChaCha20+Poly1305. - * This must be called exactly once, after - * mbedtls_cipher_reset(). - * - * \param ctx The generic cipher context. This must be initialized. - * \param ad The additional data to use. This must be a readable - * buffer of at least \p ad_len Bytes. - * \param ad_len The length of \p ad in Bytes. - * - * \return \c 0 on success. - * \return A specific error code on failure. - */ -int mbedtls_cipher_update_ad( mbedtls_cipher_context_t *ctx, - const unsigned char *ad, size_t ad_len ); -#endif /* MBEDTLS_GCM_C || MBEDTLS_CHACHAPOLY_C */ - -/** - * \brief The generic cipher update function. It encrypts or - * decrypts using the given cipher context. Writes as - * many block-sized blocks of data as possible to output. - * Any data that cannot be written immediately is either - * added to the next block, or flushed when - * mbedtls_cipher_finish() is called. - * Exception: For MBEDTLS_MODE_ECB, expects a single block - * in size. For example, 16 Bytes for AES. - * - * \note If the underlying cipher is used in GCM mode, all calls - * to this function, except for the last one before - * mbedtls_cipher_finish(), must have \p ilen as a - * multiple of the block size of the cipher. - * - * \param ctx The generic cipher context. This must be initialized and - * bound to a key. - * \param input The buffer holding the input data. This must be a - * readable buffer of at least \p ilen Bytes. - * \param ilen The length of the input data. - * \param output The buffer for the output data. This must be able to - * hold at least `ilen + block_size`. This must not be the - * same buffer as \p input. - * \param olen The length of the output data, to be updated with the - * actual number of Bytes written. This must not be - * \c NULL. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE on an - * unsupported mode for a cipher. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_update( mbedtls_cipher_context_t *ctx, - const unsigned char *input, - size_t ilen, unsigned char *output, - size_t *olen ); - -/** - * \brief The generic cipher finalization function. If data still - * needs to be flushed from an incomplete block, the data - * contained in it is padded to the size of - * the last block, and written to the \p output buffer. - * - * \param ctx The generic cipher context. This must be initialized and - * bound to a key. - * \param output The buffer to write data to. This needs to be a writable - * buffer of at least \p block_size Bytes. - * \param olen The length of the data written to the \p output buffer. - * This may not be \c NULL. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED on decryption - * expecting a full block but not receiving one. - * \return #MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding - * while decrypting. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_finish( mbedtls_cipher_context_t *ctx, - unsigned char *output, size_t *olen ); - -#if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CHACHAPOLY_C) -/** - * \brief This function writes a tag for AEAD ciphers. - * Currently supported with GCM and ChaCha20+Poly1305. - * This must be called after mbedtls_cipher_finish(). - * - * \param ctx The generic cipher context. This must be initialized, - * bound to a key, and have just completed a cipher - * operation through mbedtls_cipher_finish() the tag for - * which should be written. - * \param tag The buffer to write the tag to. This must be a writable - * buffer of at least \p tag_len Bytes. - * \param tag_len The length of the tag to write. - * - * \return \c 0 on success. - * \return A specific error code on failure. - */ -int mbedtls_cipher_write_tag( mbedtls_cipher_context_t *ctx, - unsigned char *tag, size_t tag_len ); - -/** - * \brief This function checks the tag for AEAD ciphers. - * Currently supported with GCM and ChaCha20+Poly1305. - * This must be called after mbedtls_cipher_finish(). - * - * \param ctx The generic cipher context. This must be initialized. - * \param tag The buffer holding the tag. This must be a readable - * buffer of at least \p tag_len Bytes. - * \param tag_len The length of the tag to check. - * - * \return \c 0 on success. - * \return A specific error code on failure. - */ -int mbedtls_cipher_check_tag( mbedtls_cipher_context_t *ctx, - const unsigned char *tag, size_t tag_len ); -#endif /* MBEDTLS_GCM_C || MBEDTLS_CHACHAPOLY_C */ - -/** - * \brief The generic all-in-one encryption/decryption function, - * for all ciphers except AEAD constructs. - * - * \param ctx The generic cipher context. This must be initialized. - * \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. - * This must be a readable buffer of at least \p iv_len - * Bytes. - * \param iv_len The IV length for ciphers with variable-size IV. - * This parameter is discarded by ciphers with fixed-size - * IV. - * \param input The buffer holding the input data. This must be a - * readable buffer of at least \p ilen Bytes. - * \param ilen The length of the input data in Bytes. - * \param output The buffer for the output data. This must be able to - * hold at least `ilen + block_size`. This must not be the - * same buffer as \p input. - * \param olen The length of the output data, to be updated with the - * actual number of Bytes written. This must not be - * \c NULL. - * - * \note Some ciphers do not use IVs nor nonce. For these - * ciphers, use \p iv = NULL and \p iv_len = 0. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED on decryption - * expecting a full block but not receiving one. - * \return #MBEDTLS_ERR_CIPHER_INVALID_PADDING on invalid padding - * while decrypting. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_crypt( mbedtls_cipher_context_t *ctx, - const unsigned char *iv, size_t iv_len, - const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen ); - -#if defined(MBEDTLS_CIPHER_MODE_AEAD) -/** - * \brief The generic autenticated encryption (AEAD) function. - * - * \param ctx The generic cipher context. This must be initialized and - * bound to a key. - * \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. - * This must be a readable buffer of at least \p iv_len - * Bytes. - * \param iv_len The IV length for ciphers with variable-size IV. - * This parameter is discarded by ciphers with fixed-size IV. - * \param ad The additional data to authenticate. This must be a - * readable buffer of at least \p ad_len Bytes. - * \param ad_len The length of \p ad. - * \param input The buffer holding the input data. This must be a - * readable buffer of at least \p ilen Bytes. - * \param ilen The length of the input data. - * \param output The buffer for the output data. This must be able to - * hold at least \p ilen Bytes. - * \param olen The length of the output data, to be updated with the - * actual number of Bytes written. This must not be - * \c NULL. - * \param tag The buffer for the authentication tag. This must be a - * writable buffer of at least \p tag_len Bytes. - * \param tag_len The desired length of the authentication tag. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_auth_encrypt( mbedtls_cipher_context_t *ctx, - const unsigned char *iv, size_t iv_len, - const unsigned char *ad, size_t ad_len, - const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, - unsigned char *tag, size_t tag_len ); - -/** - * \brief The generic autenticated decryption (AEAD) function. - * - * \note If the data is not authentic, then the output buffer - * is zeroed out to prevent the unauthentic plaintext being - * used, making this interface safer. - * - * \param ctx The generic cipher context. This must be initialized and - * and bound to a key. - * \param iv The IV to use, or NONCE_COUNTER for CTR-mode ciphers. - * This must be a readable buffer of at least \p iv_len - * Bytes. - * \param iv_len The IV length for ciphers with variable-size IV. - * This parameter is discarded by ciphers with fixed-size IV. - * \param ad The additional data to be authenticated. This must be a - * readable buffer of at least \p ad_len Bytes. - * \param ad_len The length of \p ad. - * \param input The buffer holding the input data. This must be a - * readable buffer of at least \p ilen Bytes. - * \param ilen The length of the input data. - * \param output The buffer for the output data. - * This must be able to hold at least \p ilen Bytes. - * \param olen The length of the output data, to be updated with the - * actual number of Bytes written. This must not be - * \c NULL. - * \param tag The buffer holding the authentication tag. This must be - * a readable buffer of at least \p tag_len Bytes. - * \param tag_len The length of the authentication tag. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on - * parameter-verification failure. - * \return #MBEDTLS_ERR_CIPHER_AUTH_FAILED if data is not authentic. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_auth_decrypt( mbedtls_cipher_context_t *ctx, - const unsigned char *iv, size_t iv_len, - const unsigned char *ad, size_t ad_len, - const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, - const unsigned char *tag, size_t tag_len ); -#endif /* MBEDTLS_CIPHER_MODE_AEAD */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CIPHER_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cipher_internal.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cipher_internal.h deleted file mode 100644 index 5930f0e2a..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cipher_internal.h +++ /dev/null @@ -1,152 +0,0 @@ -/** - * \file cipher_internal.h - * - * \brief Cipher wrappers. - * - * \author Adriaan de Jong - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_CIPHER_WRAP_H -#define MBEDTLS_CIPHER_WRAP_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/cipher.h" - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "psa/crypto.h" -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Base cipher information. The non-mode specific functions and values. - */ -struct mbedtls_cipher_base_t -{ - /** Base Cipher type (e.g. MBEDTLS_CIPHER_ID_AES) */ - mbedtls_cipher_id_t cipher; - - /** Encrypt using ECB */ - int (*ecb_func)( void *ctx, mbedtls_operation_t mode, - const unsigned char *input, unsigned char *output ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) - /** Encrypt using CBC */ - int (*cbc_func)( void *ctx, mbedtls_operation_t mode, size_t length, - unsigned char *iv, const unsigned char *input, - unsigned char *output ); -#endif - -#if defined(MBEDTLS_CIPHER_MODE_CFB) - /** Encrypt using CFB (Full length) */ - int (*cfb_func)( void *ctx, mbedtls_operation_t mode, size_t length, size_t *iv_off, - unsigned char *iv, const unsigned char *input, - unsigned char *output ); -#endif - -#if defined(MBEDTLS_CIPHER_MODE_OFB) - /** Encrypt using OFB (Full length) */ - int (*ofb_func)( void *ctx, size_t length, size_t *iv_off, - unsigned char *iv, - const unsigned char *input, - unsigned char *output ); -#endif - -#if defined(MBEDTLS_CIPHER_MODE_CTR) - /** Encrypt using CTR */ - int (*ctr_func)( void *ctx, size_t length, size_t *nc_off, - unsigned char *nonce_counter, unsigned char *stream_block, - const unsigned char *input, unsigned char *output ); -#endif - -#if defined(MBEDTLS_CIPHER_MODE_XTS) - /** Encrypt or decrypt using XTS. */ - int (*xts_func)( void *ctx, mbedtls_operation_t mode, size_t length, - const unsigned char data_unit[16], - const unsigned char *input, unsigned char *output ); -#endif - -#if defined(MBEDTLS_CIPHER_MODE_STREAM) - /** Encrypt using STREAM */ - int (*stream_func)( void *ctx, size_t length, - const unsigned char *input, unsigned char *output ); -#endif - - /** Set key for encryption purposes */ - int (*setkey_enc_func)( void *ctx, const unsigned char *key, - unsigned int key_bitlen ); - - /** Set key for decryption purposes */ - int (*setkey_dec_func)( void *ctx, const unsigned char *key, - unsigned int key_bitlen); - - /** Allocate a new context */ - void * (*ctx_alloc_func)( void ); - - /** Free the given context */ - void (*ctx_free_func)( void *ctx ); - -}; - -typedef struct -{ - mbedtls_cipher_type_t type; - const mbedtls_cipher_info_t *info; -} mbedtls_cipher_definition_t; - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -typedef enum -{ - MBEDTLS_CIPHER_PSA_KEY_UNSET = 0, - MBEDTLS_CIPHER_PSA_KEY_OWNED, /* Used for PSA-based cipher contexts which */ - /* use raw key material internally imported */ - /* as a volatile key, and which hence need */ - /* to destroy that key when the context is */ - /* freed. */ - MBEDTLS_CIPHER_PSA_KEY_NOT_OWNED, /* Used for PSA-based cipher contexts */ - /* which use a key provided by the */ - /* user, and which hence will not be */ - /* destroyed when the context is freed. */ -} mbedtls_cipher_psa_key_ownership; - -typedef struct -{ - psa_algorithm_t alg; - psa_key_handle_t slot; - mbedtls_cipher_psa_key_ownership slot_state; -} mbedtls_cipher_context_psa; -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -extern const mbedtls_cipher_definition_t mbedtls_cipher_definitions[]; - -extern int mbedtls_cipher_supported[]; - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CIPHER_WRAP_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cmac.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cmac.h deleted file mode 100644 index 792fbdc33..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/cmac.h +++ /dev/null @@ -1,213 +0,0 @@ -/** - * \file cmac.h - * - * \brief This file contains CMAC definitions and functions. - * - * The Cipher-based Message Authentication Code (CMAC) Mode for - * Authentication is defined in RFC-4493: The AES-CMAC Algorithm. - */ -/* - * Copyright (C) 2015-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CMAC_H -#define MBEDTLS_CMAC_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/cipher.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_CMAC_HW_ACCEL_FAILED -0x007A /**< CMAC hardware accelerator failed. */ - -#define MBEDTLS_AES_BLOCK_SIZE 16 -#define MBEDTLS_DES3_BLOCK_SIZE 8 - -#if defined(MBEDTLS_AES_C) -#define MBEDTLS_CIPHER_BLKSIZE_MAX 16 /**< The longest block used by CMAC is that of AES. */ -#else -#define MBEDTLS_CIPHER_BLKSIZE_MAX 8 /**< The longest block used by CMAC is that of 3DES. */ -#endif - -#if !defined(MBEDTLS_CMAC_ALT) - -/** - * The CMAC context structure. - */ -struct mbedtls_cmac_context_t -{ - /** The internal state of the CMAC algorithm. */ - unsigned char state[MBEDTLS_CIPHER_BLKSIZE_MAX]; - - /** Unprocessed data - either data that was not block aligned and is still - * pending processing, or the final block. */ - unsigned char unprocessed_block[MBEDTLS_CIPHER_BLKSIZE_MAX]; - - /** The length of data pending processing. */ - size_t unprocessed_len; -}; - -#else /* !MBEDTLS_CMAC_ALT */ -#include "cmac_alt.h" -#endif /* !MBEDTLS_CMAC_ALT */ - -/** - * \brief This function sets the CMAC key, and prepares to authenticate - * the input data. - * Must be called with an initialized cipher context. - * - * \param ctx The cipher context used for the CMAC operation, initialized - * as one of the following types: MBEDTLS_CIPHER_AES_128_ECB, - * MBEDTLS_CIPHER_AES_192_ECB, MBEDTLS_CIPHER_AES_256_ECB, - * or MBEDTLS_CIPHER_DES_EDE3_ECB. - * \param key The CMAC key. - * \param keybits The length of the CMAC key in bits. - * Must be supported by the cipher. - * - * \return \c 0 on success. - * \return A cipher-specific error code on failure. - */ -int mbedtls_cipher_cmac_starts( mbedtls_cipher_context_t *ctx, - const unsigned char *key, size_t keybits ); - -/** - * \brief This function feeds an input buffer into an ongoing CMAC - * computation. - * - * It is called between mbedtls_cipher_cmac_starts() or - * mbedtls_cipher_cmac_reset(), and mbedtls_cipher_cmac_finish(). - * Can be called repeatedly. - * - * \param ctx The cipher context used for the CMAC operation. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA - * if parameter verification fails. - */ -int mbedtls_cipher_cmac_update( mbedtls_cipher_context_t *ctx, - const unsigned char *input, size_t ilen ); - -/** - * \brief This function finishes the CMAC operation, and writes - * the result to the output buffer. - * - * It is called after mbedtls_cipher_cmac_update(). - * It can be followed by mbedtls_cipher_cmac_reset() and - * mbedtls_cipher_cmac_update(), or mbedtls_cipher_free(). - * - * \param ctx The cipher context used for the CMAC operation. - * \param output The output buffer for the CMAC checksum result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA - * if parameter verification fails. - */ -int mbedtls_cipher_cmac_finish( mbedtls_cipher_context_t *ctx, - unsigned char *output ); - -/** - * \brief This function prepares the authentication of another - * message with the same key as the previous CMAC - * operation. - * - * It is called after mbedtls_cipher_cmac_finish() - * and before mbedtls_cipher_cmac_update(). - * - * \param ctx The cipher context used for the CMAC operation. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA - * if parameter verification fails. - */ -int mbedtls_cipher_cmac_reset( mbedtls_cipher_context_t *ctx ); - -/** - * \brief This function calculates the full generic CMAC - * on the input buffer with the provided key. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The CMAC result is calculated as - * output = generic CMAC(cmac key, input buffer). - * - * - * \param cipher_info The cipher information. - * \param key The CMAC key. - * \param keylen The length of the CMAC key in bits. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The buffer for the generic CMAC result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA - * if parameter verification fails. - */ -int mbedtls_cipher_cmac( const mbedtls_cipher_info_t *cipher_info, - const unsigned char *key, size_t keylen, - const unsigned char *input, size_t ilen, - unsigned char *output ); - -#if defined(MBEDTLS_AES_C) -/** - * \brief This function implements the AES-CMAC-PRF-128 pseudorandom - * function, as defined in - * RFC-4615: The Advanced Encryption Standard-Cipher-based - * Message Authentication Code-Pseudo-Random Function-128 - * (AES-CMAC-PRF-128) Algorithm for the Internet Key - * Exchange Protocol (IKE). - * - * \param key The key to use. - * \param key_len The key length in Bytes. - * \param input The buffer holding the input data. - * \param in_len The length of the input data in Bytes. - * \param output The buffer holding the generated 16 Bytes of - * pseudorandom output. - * - * \return \c 0 on success. - */ -int mbedtls_aes_cmac_prf_128( const unsigned char *key, size_t key_len, - const unsigned char *input, size_t in_len, - unsigned char output[16] ); -#endif /* MBEDTLS_AES_C */ - -#if defined(MBEDTLS_SELF_TEST) && ( defined(MBEDTLS_AES_C) || defined(MBEDTLS_DES_C) ) -/** - * \brief The CMAC checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_cmac_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST && ( MBEDTLS_AES_C || MBEDTLS_DES_C ) */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_CMAC_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/compat-1.3.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/compat-1.3.h deleted file mode 100644 index b268734be..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/compat-1.3.h +++ /dev/null @@ -1,2531 +0,0 @@ -/** - * \file compat-1.3.h - * - * \brief Compatibility definitions for using mbed TLS with client code written - * for the PolarSSL naming conventions. - * - * \deprecated Use the new names directly instead - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#if ! defined(MBEDTLS_DEPRECATED_REMOVED) - -#if defined(MBEDTLS_DEPRECATED_WARNING) -#warning "Including compat-1.3.h is deprecated" -#endif - -#ifndef MBEDTLS_COMPAT13_H -#define MBEDTLS_COMPAT13_H - -/* - * config.h options - */ -#if defined MBEDTLS_AESNI_C -#define POLARSSL_AESNI_C MBEDTLS_AESNI_C -#endif -#if defined MBEDTLS_AES_ALT -#define POLARSSL_AES_ALT MBEDTLS_AES_ALT -#endif -#if defined MBEDTLS_AES_C -#define POLARSSL_AES_C MBEDTLS_AES_C -#endif -#if defined MBEDTLS_AES_ROM_TABLES -#define POLARSSL_AES_ROM_TABLES MBEDTLS_AES_ROM_TABLES -#endif -#if defined MBEDTLS_ARC4_ALT -#define POLARSSL_ARC4_ALT MBEDTLS_ARC4_ALT -#endif -#if defined MBEDTLS_ARC4_C -#define POLARSSL_ARC4_C MBEDTLS_ARC4_C -#endif -#if defined MBEDTLS_ASN1_PARSE_C -#define POLARSSL_ASN1_PARSE_C MBEDTLS_ASN1_PARSE_C -#endif -#if defined MBEDTLS_ASN1_WRITE_C -#define POLARSSL_ASN1_WRITE_C MBEDTLS_ASN1_WRITE_C -#endif -#if defined MBEDTLS_BASE64_C -#define POLARSSL_BASE64_C MBEDTLS_BASE64_C -#endif -#if defined MBEDTLS_BIGNUM_C -#define POLARSSL_BIGNUM_C MBEDTLS_BIGNUM_C -#endif -#if defined MBEDTLS_BLOWFISH_ALT -#define POLARSSL_BLOWFISH_ALT MBEDTLS_BLOWFISH_ALT -#endif -#if defined MBEDTLS_BLOWFISH_C -#define POLARSSL_BLOWFISH_C MBEDTLS_BLOWFISH_C -#endif -#if defined MBEDTLS_CAMELLIA_ALT -#define POLARSSL_CAMELLIA_ALT MBEDTLS_CAMELLIA_ALT -#endif -#if defined MBEDTLS_CAMELLIA_C -#define POLARSSL_CAMELLIA_C MBEDTLS_CAMELLIA_C -#endif -#if defined MBEDTLS_CAMELLIA_SMALL_MEMORY -#define POLARSSL_CAMELLIA_SMALL_MEMORY MBEDTLS_CAMELLIA_SMALL_MEMORY -#endif -#if defined MBEDTLS_CCM_C -#define POLARSSL_CCM_C MBEDTLS_CCM_C -#endif -#if defined MBEDTLS_CERTS_C -#define POLARSSL_CERTS_C MBEDTLS_CERTS_C -#endif -#if defined MBEDTLS_CIPHER_C -#define POLARSSL_CIPHER_C MBEDTLS_CIPHER_C -#endif -#if defined MBEDTLS_CIPHER_MODE_CBC -#define POLARSSL_CIPHER_MODE_CBC MBEDTLS_CIPHER_MODE_CBC -#endif -#if defined MBEDTLS_CIPHER_MODE_CFB -#define POLARSSL_CIPHER_MODE_CFB MBEDTLS_CIPHER_MODE_CFB -#endif -#if defined MBEDTLS_CIPHER_MODE_CTR -#define POLARSSL_CIPHER_MODE_CTR MBEDTLS_CIPHER_MODE_CTR -#endif -#if defined MBEDTLS_CIPHER_NULL_CIPHER -#define POLARSSL_CIPHER_NULL_CIPHER MBEDTLS_CIPHER_NULL_CIPHER -#endif -#if defined MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS -#define POLARSSL_CIPHER_PADDING_ONE_AND_ZEROS MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS -#endif -#if defined MBEDTLS_CIPHER_PADDING_PKCS7 -#define POLARSSL_CIPHER_PADDING_PKCS7 MBEDTLS_CIPHER_PADDING_PKCS7 -#endif -#if defined MBEDTLS_CIPHER_PADDING_ZEROS -#define POLARSSL_CIPHER_PADDING_ZEROS MBEDTLS_CIPHER_PADDING_ZEROS -#endif -#if defined MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN -#define POLARSSL_CIPHER_PADDING_ZEROS_AND_LEN MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN -#endif -#if defined MBEDTLS_CTR_DRBG_C -#define POLARSSL_CTR_DRBG_C MBEDTLS_CTR_DRBG_C -#endif -#if defined MBEDTLS_DEBUG_C -#define POLARSSL_DEBUG_C MBEDTLS_DEBUG_C -#endif -#if defined MBEDTLS_DEPRECATED_REMOVED -#define POLARSSL_DEPRECATED_REMOVED MBEDTLS_DEPRECATED_REMOVED -#endif -#if defined MBEDTLS_DEPRECATED_WARNING -#define POLARSSL_DEPRECATED_WARNING MBEDTLS_DEPRECATED_WARNING -#endif -#if defined MBEDTLS_DES_ALT -#define POLARSSL_DES_ALT MBEDTLS_DES_ALT -#endif -#if defined MBEDTLS_DES_C -#define POLARSSL_DES_C MBEDTLS_DES_C -#endif -#if defined MBEDTLS_DHM_C -#define POLARSSL_DHM_C MBEDTLS_DHM_C -#endif -#if defined MBEDTLS_ECDH_C -#define POLARSSL_ECDH_C MBEDTLS_ECDH_C -#endif -#if defined MBEDTLS_ECDSA_C -#define POLARSSL_ECDSA_C MBEDTLS_ECDSA_C -#endif -#if defined MBEDTLS_ECDSA_DETERMINISTIC -#define POLARSSL_ECDSA_DETERMINISTIC MBEDTLS_ECDSA_DETERMINISTIC -#endif -#if defined MBEDTLS_ECP_C -#define POLARSSL_ECP_C MBEDTLS_ECP_C -#endif -#if defined MBEDTLS_ECP_DP_BP256R1_ENABLED -#define POLARSSL_ECP_DP_BP256R1_ENABLED MBEDTLS_ECP_DP_BP256R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_BP384R1_ENABLED -#define POLARSSL_ECP_DP_BP384R1_ENABLED MBEDTLS_ECP_DP_BP384R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_BP512R1_ENABLED -#define POLARSSL_ECP_DP_BP512R1_ENABLED MBEDTLS_ECP_DP_BP512R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_CURVE25519_ENABLED -#define POLARSSL_ECP_DP_M255_ENABLED MBEDTLS_ECP_DP_CURVE25519_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP192K1_ENABLED -#define POLARSSL_ECP_DP_SECP192K1_ENABLED MBEDTLS_ECP_DP_SECP192K1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP192R1_ENABLED -#define POLARSSL_ECP_DP_SECP192R1_ENABLED MBEDTLS_ECP_DP_SECP192R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP224K1_ENABLED -#define POLARSSL_ECP_DP_SECP224K1_ENABLED MBEDTLS_ECP_DP_SECP224K1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP224R1_ENABLED -#define POLARSSL_ECP_DP_SECP224R1_ENABLED MBEDTLS_ECP_DP_SECP224R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP256K1_ENABLED -#define POLARSSL_ECP_DP_SECP256K1_ENABLED MBEDTLS_ECP_DP_SECP256K1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP256R1_ENABLED -#define POLARSSL_ECP_DP_SECP256R1_ENABLED MBEDTLS_ECP_DP_SECP256R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP384R1_ENABLED -#define POLARSSL_ECP_DP_SECP384R1_ENABLED MBEDTLS_ECP_DP_SECP384R1_ENABLED -#endif -#if defined MBEDTLS_ECP_DP_SECP521R1_ENABLED -#define POLARSSL_ECP_DP_SECP521R1_ENABLED MBEDTLS_ECP_DP_SECP521R1_ENABLED -#endif -#if defined MBEDTLS_ECP_FIXED_POINT_OPTIM -#define POLARSSL_ECP_FIXED_POINT_OPTIM MBEDTLS_ECP_FIXED_POINT_OPTIM -#endif -#if defined MBEDTLS_ECP_MAX_BITS -#define POLARSSL_ECP_MAX_BITS MBEDTLS_ECP_MAX_BITS -#endif -#if defined MBEDTLS_ECP_NIST_OPTIM -#define POLARSSL_ECP_NIST_OPTIM MBEDTLS_ECP_NIST_OPTIM -#endif -#if defined MBEDTLS_ECP_WINDOW_SIZE -#define POLARSSL_ECP_WINDOW_SIZE MBEDTLS_ECP_WINDOW_SIZE -#endif -#if defined MBEDTLS_ENABLE_WEAK_CIPHERSUITES -#define POLARSSL_ENABLE_WEAK_CIPHERSUITES MBEDTLS_ENABLE_WEAK_CIPHERSUITES -#endif -#if defined MBEDTLS_ENTROPY_C -#define POLARSSL_ENTROPY_C MBEDTLS_ENTROPY_C -#endif -#if defined MBEDTLS_ENTROPY_FORCE_SHA256 -#define POLARSSL_ENTROPY_FORCE_SHA256 MBEDTLS_ENTROPY_FORCE_SHA256 -#endif -#if defined MBEDTLS_ERROR_C -#define POLARSSL_ERROR_C MBEDTLS_ERROR_C -#endif -#if defined MBEDTLS_ERROR_STRERROR_DUMMY -#define POLARSSL_ERROR_STRERROR_DUMMY MBEDTLS_ERROR_STRERROR_DUMMY -#endif -#if defined MBEDTLS_FS_IO -#define POLARSSL_FS_IO MBEDTLS_FS_IO -#endif -#if defined MBEDTLS_GCM_C -#define POLARSSL_GCM_C MBEDTLS_GCM_C -#endif -#if defined MBEDTLS_GENPRIME -#define POLARSSL_GENPRIME MBEDTLS_GENPRIME -#endif -#if defined MBEDTLS_HAVEGE_C -#define POLARSSL_HAVEGE_C MBEDTLS_HAVEGE_C -#endif -#if defined MBEDTLS_HAVE_ASM -#define POLARSSL_HAVE_ASM MBEDTLS_HAVE_ASM -#endif -#if defined MBEDTLS_HAVE_SSE2 -#define POLARSSL_HAVE_SSE2 MBEDTLS_HAVE_SSE2 -#endif -#if defined MBEDTLS_HAVE_TIME -#define POLARSSL_HAVE_TIME MBEDTLS_HAVE_TIME -#endif -#if defined MBEDTLS_HMAC_DRBG_C -#define POLARSSL_HMAC_DRBG_C MBEDTLS_HMAC_DRBG_C -#endif -#if defined MBEDTLS_HMAC_DRBG_MAX_INPUT -#define POLARSSL_HMAC_DRBG_MAX_INPUT MBEDTLS_HMAC_DRBG_MAX_INPUT -#endif -#if defined MBEDTLS_HMAC_DRBG_MAX_REQUEST -#define POLARSSL_HMAC_DRBG_MAX_REQUEST MBEDTLS_HMAC_DRBG_MAX_REQUEST -#endif -#if defined MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT -#define POLARSSL_HMAC_DRBG_MAX_SEED_INPUT MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT -#endif -#if defined MBEDTLS_HMAC_DRBG_RESEED_INTERVAL -#define POLARSSL_HMAC_DRBG_RESEED_INTERVAL MBEDTLS_HMAC_DRBG_RESEED_INTERVAL -#endif -#if defined MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED -#define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_DHE_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -#define POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_PSK_ENABLED -#define POLARSSL_KEY_EXCHANGE_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_PSK_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -#define POLARSSL_KEY_EXCHANGE_RSA_ENABLED MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -#endif -#if defined MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -#define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -#endif -#if defined MBEDTLS_MD2_ALT -#define POLARSSL_MD2_ALT MBEDTLS_MD2_ALT -#endif -#if defined MBEDTLS_MD2_C -#define POLARSSL_MD2_C MBEDTLS_MD2_C -#endif -#if defined MBEDTLS_MD2_PROCESS_ALT -#define POLARSSL_MD2_PROCESS_ALT MBEDTLS_MD2_PROCESS_ALT -#endif -#if defined MBEDTLS_MD4_ALT -#define POLARSSL_MD4_ALT MBEDTLS_MD4_ALT -#endif -#if defined MBEDTLS_MD4_C -#define POLARSSL_MD4_C MBEDTLS_MD4_C -#endif -#if defined MBEDTLS_MD4_PROCESS_ALT -#define POLARSSL_MD4_PROCESS_ALT MBEDTLS_MD4_PROCESS_ALT -#endif -#if defined MBEDTLS_MD5_ALT -#define POLARSSL_MD5_ALT MBEDTLS_MD5_ALT -#endif -#if defined MBEDTLS_MD5_C -#define POLARSSL_MD5_C MBEDTLS_MD5_C -#endif -#if defined MBEDTLS_MD5_PROCESS_ALT -#define POLARSSL_MD5_PROCESS_ALT MBEDTLS_MD5_PROCESS_ALT -#endif -#if defined MBEDTLS_MD_C -#define POLARSSL_MD_C MBEDTLS_MD_C -#endif -#if defined MBEDTLS_MEMORY_ALIGN_MULTIPLE -#define POLARSSL_MEMORY_ALIGN_MULTIPLE MBEDTLS_MEMORY_ALIGN_MULTIPLE -#endif -#if defined MBEDTLS_MEMORY_BACKTRACE -#define POLARSSL_MEMORY_BACKTRACE MBEDTLS_MEMORY_BACKTRACE -#endif -#if defined MBEDTLS_MEMORY_BUFFER_ALLOC_C -#define POLARSSL_MEMORY_BUFFER_ALLOC_C MBEDTLS_MEMORY_BUFFER_ALLOC_C -#endif -#if defined MBEDTLS_MEMORY_DEBUG -#define POLARSSL_MEMORY_DEBUG MBEDTLS_MEMORY_DEBUG -#endif -#if defined MBEDTLS_MPI_MAX_SIZE -#define POLARSSL_MPI_MAX_SIZE MBEDTLS_MPI_MAX_SIZE -#endif -#if defined MBEDTLS_MPI_WINDOW_SIZE -#define POLARSSL_MPI_WINDOW_SIZE MBEDTLS_MPI_WINDOW_SIZE -#endif -#if defined MBEDTLS_NET_C -#define POLARSSL_NET_C MBEDTLS_NET_C -#endif -#if defined MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES -#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES -#endif -#if defined MBEDTLS_NO_PLATFORM_ENTROPY -#define POLARSSL_NO_PLATFORM_ENTROPY MBEDTLS_NO_PLATFORM_ENTROPY -#endif -#if defined MBEDTLS_OID_C -#define POLARSSL_OID_C MBEDTLS_OID_C -#endif -#if defined MBEDTLS_PADLOCK_C -#define POLARSSL_PADLOCK_C MBEDTLS_PADLOCK_C -#endif -#if defined MBEDTLS_PEM_PARSE_C -#define POLARSSL_PEM_PARSE_C MBEDTLS_PEM_PARSE_C -#endif -#if defined MBEDTLS_PEM_WRITE_C -#define POLARSSL_PEM_WRITE_C MBEDTLS_PEM_WRITE_C -#endif -#if defined MBEDTLS_PKCS11_C -#define POLARSSL_PKCS11_C MBEDTLS_PKCS11_C -#endif -#if defined MBEDTLS_PKCS12_C -#define POLARSSL_PKCS12_C MBEDTLS_PKCS12_C -#endif -#if defined MBEDTLS_PKCS1_V15 -#define POLARSSL_PKCS1_V15 MBEDTLS_PKCS1_V15 -#endif -#if defined MBEDTLS_PKCS1_V21 -#define POLARSSL_PKCS1_V21 MBEDTLS_PKCS1_V21 -#endif -#if defined MBEDTLS_PKCS5_C -#define POLARSSL_PKCS5_C MBEDTLS_PKCS5_C -#endif -#if defined MBEDTLS_PK_C -#define POLARSSL_PK_C MBEDTLS_PK_C -#endif -#if defined MBEDTLS_PK_PARSE_C -#define POLARSSL_PK_PARSE_C MBEDTLS_PK_PARSE_C -#endif -#if defined MBEDTLS_PK_PARSE_EC_EXTENDED -#define POLARSSL_PK_PARSE_EC_EXTENDED MBEDTLS_PK_PARSE_EC_EXTENDED -#endif -#if defined MBEDTLS_PK_RSA_ALT_SUPPORT -#define POLARSSL_PK_RSA_ALT_SUPPORT MBEDTLS_PK_RSA_ALT_SUPPORT -#endif -#if defined MBEDTLS_PK_WRITE_C -#define POLARSSL_PK_WRITE_C MBEDTLS_PK_WRITE_C -#endif -#if defined MBEDTLS_PLATFORM_C -#define POLARSSL_PLATFORM_C MBEDTLS_PLATFORM_C -#endif -#if defined MBEDTLS_PLATFORM_EXIT_ALT -#define POLARSSL_PLATFORM_EXIT_ALT MBEDTLS_PLATFORM_EXIT_ALT -#endif -#if defined MBEDTLS_PLATFORM_EXIT_MACRO -#define POLARSSL_PLATFORM_EXIT_MACRO MBEDTLS_PLATFORM_EXIT_MACRO -#endif -#if defined MBEDTLS_PLATFORM_FPRINTF_ALT -#define POLARSSL_PLATFORM_FPRINTF_ALT MBEDTLS_PLATFORM_FPRINTF_ALT -#endif -#if defined MBEDTLS_PLATFORM_FPRINTF_MACRO -#define POLARSSL_PLATFORM_FPRINTF_MACRO MBEDTLS_PLATFORM_FPRINTF_MACRO -#endif -#if defined MBEDTLS_PLATFORM_FREE_MACRO -#define POLARSSL_PLATFORM_FREE_MACRO MBEDTLS_PLATFORM_FREE_MACRO -#endif -#if defined MBEDTLS_PLATFORM_MEMORY -#define POLARSSL_PLATFORM_MEMORY MBEDTLS_PLATFORM_MEMORY -#endif -#if defined MBEDTLS_PLATFORM_NO_STD_FUNCTIONS -#define POLARSSL_PLATFORM_NO_STD_FUNCTIONS MBEDTLS_PLATFORM_NO_STD_FUNCTIONS -#endif -#if defined MBEDTLS_PLATFORM_PRINTF_ALT -#define POLARSSL_PLATFORM_PRINTF_ALT MBEDTLS_PLATFORM_PRINTF_ALT -#endif -#if defined MBEDTLS_PLATFORM_PRINTF_MACRO -#define POLARSSL_PLATFORM_PRINTF_MACRO MBEDTLS_PLATFORM_PRINTF_MACRO -#endif -#if defined MBEDTLS_PLATFORM_SNPRINTF_ALT -#define POLARSSL_PLATFORM_SNPRINTF_ALT MBEDTLS_PLATFORM_SNPRINTF_ALT -#endif -#if defined MBEDTLS_PLATFORM_SNPRINTF_MACRO -#define POLARSSL_PLATFORM_SNPRINTF_MACRO MBEDTLS_PLATFORM_SNPRINTF_MACRO -#endif -#if defined MBEDTLS_PLATFORM_STD_EXIT -#define POLARSSL_PLATFORM_STD_EXIT MBEDTLS_PLATFORM_STD_EXIT -#endif -#if defined MBEDTLS_PLATFORM_STD_FPRINTF -#define POLARSSL_PLATFORM_STD_FPRINTF MBEDTLS_PLATFORM_STD_FPRINTF -#endif -#if defined MBEDTLS_PLATFORM_STD_FREE -#define POLARSSL_PLATFORM_STD_FREE MBEDTLS_PLATFORM_STD_FREE -#endif -#if defined MBEDTLS_PLATFORM_STD_MEM_HDR -#define POLARSSL_PLATFORM_STD_MEM_HDR MBEDTLS_PLATFORM_STD_MEM_HDR -#endif -#if defined MBEDTLS_PLATFORM_STD_PRINTF -#define POLARSSL_PLATFORM_STD_PRINTF MBEDTLS_PLATFORM_STD_PRINTF -#endif -#if defined MBEDTLS_PLATFORM_STD_SNPRINTF -#define POLARSSL_PLATFORM_STD_SNPRINTF MBEDTLS_PLATFORM_STD_SNPRINTF -#endif -#if defined MBEDTLS_PSK_MAX_LEN -#define POLARSSL_PSK_MAX_LEN MBEDTLS_PSK_MAX_LEN -#endif -#if defined MBEDTLS_REMOVE_ARC4_CIPHERSUITES -#define POLARSSL_REMOVE_ARC4_CIPHERSUITES MBEDTLS_REMOVE_ARC4_CIPHERSUITES -#endif -#if defined MBEDTLS_RIPEMD160_ALT -#define POLARSSL_RIPEMD160_ALT MBEDTLS_RIPEMD160_ALT -#endif -#if defined MBEDTLS_RIPEMD160_C -#define POLARSSL_RIPEMD160_C MBEDTLS_RIPEMD160_C -#endif -#if defined MBEDTLS_RIPEMD160_PROCESS_ALT -#define POLARSSL_RIPEMD160_PROCESS_ALT MBEDTLS_RIPEMD160_PROCESS_ALT -#endif -#if defined MBEDTLS_RSA_C -#define POLARSSL_RSA_C MBEDTLS_RSA_C -#endif -#if defined MBEDTLS_RSA_NO_CRT -#define POLARSSL_RSA_NO_CRT MBEDTLS_RSA_NO_CRT -#endif -#if defined MBEDTLS_SELF_TEST -#define POLARSSL_SELF_TEST MBEDTLS_SELF_TEST -#endif -#if defined MBEDTLS_SHA1_ALT -#define POLARSSL_SHA1_ALT MBEDTLS_SHA1_ALT -#endif -#if defined MBEDTLS_SHA1_C -#define POLARSSL_SHA1_C MBEDTLS_SHA1_C -#endif -#if defined MBEDTLS_SHA1_PROCESS_ALT -#define POLARSSL_SHA1_PROCESS_ALT MBEDTLS_SHA1_PROCESS_ALT -#endif -#if defined MBEDTLS_SHA256_ALT -#define POLARSSL_SHA256_ALT MBEDTLS_SHA256_ALT -#endif -#if defined MBEDTLS_SHA256_C -#define POLARSSL_SHA256_C MBEDTLS_SHA256_C -#endif -#if defined MBEDTLS_SHA256_PROCESS_ALT -#define POLARSSL_SHA256_PROCESS_ALT MBEDTLS_SHA256_PROCESS_ALT -#endif -#if defined MBEDTLS_SHA512_ALT -#define POLARSSL_SHA512_ALT MBEDTLS_SHA512_ALT -#endif -#if defined MBEDTLS_SHA512_C -#define POLARSSL_SHA512_C MBEDTLS_SHA512_C -#endif -#if defined MBEDTLS_SHA512_PROCESS_ALT -#define POLARSSL_SHA512_PROCESS_ALT MBEDTLS_SHA512_PROCESS_ALT -#endif -#if defined MBEDTLS_SSL_ALL_ALERT_MESSAGES -#define POLARSSL_SSL_ALL_ALERT_MESSAGES MBEDTLS_SSL_ALL_ALERT_MESSAGES -#endif -#if defined MBEDTLS_SSL_ALPN -#define POLARSSL_SSL_ALPN MBEDTLS_SSL_ALPN -#endif -#if defined MBEDTLS_SSL_CACHE_C -#define POLARSSL_SSL_CACHE_C MBEDTLS_SSL_CACHE_C -#endif -#if defined MBEDTLS_SSL_CBC_RECORD_SPLITTING -#define POLARSSL_SSL_CBC_RECORD_SPLITTING MBEDTLS_SSL_CBC_RECORD_SPLITTING -#endif -#if defined MBEDTLS_SSL_CLI_C -#define POLARSSL_SSL_CLI_C MBEDTLS_SSL_CLI_C -#endif -#if defined MBEDTLS_SSL_COOKIE_C -#define POLARSSL_SSL_COOKIE_C MBEDTLS_SSL_COOKIE_C -#endif -#if defined MBEDTLS_SSL_COOKIE_TIMEOUT -#define POLARSSL_SSL_COOKIE_TIMEOUT MBEDTLS_SSL_COOKIE_TIMEOUT -#endif -#if defined MBEDTLS_SSL_DEBUG_ALL -#define POLARSSL_SSL_DEBUG_ALL MBEDTLS_SSL_DEBUG_ALL -#endif -#if defined MBEDTLS_SSL_DTLS_ANTI_REPLAY -#define POLARSSL_SSL_DTLS_ANTI_REPLAY MBEDTLS_SSL_DTLS_ANTI_REPLAY -#endif -#if defined MBEDTLS_SSL_DTLS_BADMAC_LIMIT -#define POLARSSL_SSL_DTLS_BADMAC_LIMIT MBEDTLS_SSL_DTLS_BADMAC_LIMIT -#endif -#if defined MBEDTLS_SSL_DTLS_HELLO_VERIFY -#define POLARSSL_SSL_DTLS_HELLO_VERIFY MBEDTLS_SSL_DTLS_HELLO_VERIFY -#endif -#if defined MBEDTLS_SSL_ENCRYPT_THEN_MAC -#define POLARSSL_SSL_ENCRYPT_THEN_MAC MBEDTLS_SSL_ENCRYPT_THEN_MAC -#endif -#if defined MBEDTLS_SSL_EXTENDED_MASTER_SECRET -#define POLARSSL_SSL_EXTENDED_MASTER_SECRET MBEDTLS_SSL_EXTENDED_MASTER_SECRET -#endif -#if defined MBEDTLS_SSL_FALLBACK_SCSV -#define POLARSSL_SSL_FALLBACK_SCSV MBEDTLS_SSL_FALLBACK_SCSV -#endif -#if defined MBEDTLS_SSL_HW_RECORD_ACCEL -#define POLARSSL_SSL_HW_RECORD_ACCEL MBEDTLS_SSL_HW_RECORD_ACCEL -#endif -#if defined MBEDTLS_SSL_MAX_FRAGMENT_LENGTH -#define POLARSSL_SSL_MAX_FRAGMENT_LENGTH MBEDTLS_SSL_MAX_FRAGMENT_LENGTH -#endif -#if defined MBEDTLS_SSL_PROTO_DTLS -#define POLARSSL_SSL_PROTO_DTLS MBEDTLS_SSL_PROTO_DTLS -#endif -#if defined MBEDTLS_SSL_PROTO_SSL3 -#define POLARSSL_SSL_PROTO_SSL3 MBEDTLS_SSL_PROTO_SSL3 -#endif -#if defined MBEDTLS_SSL_PROTO_TLS1 -#define POLARSSL_SSL_PROTO_TLS1 MBEDTLS_SSL_PROTO_TLS1 -#endif -#if defined MBEDTLS_SSL_PROTO_TLS1_1 -#define POLARSSL_SSL_PROTO_TLS1_1 MBEDTLS_SSL_PROTO_TLS1_1 -#endif -#if defined MBEDTLS_SSL_PROTO_TLS1_2 -#define POLARSSL_SSL_PROTO_TLS1_2 MBEDTLS_SSL_PROTO_TLS1_2 -#endif -#if defined MBEDTLS_SSL_RENEGOTIATION -#define POLARSSL_SSL_RENEGOTIATION MBEDTLS_SSL_RENEGOTIATION -#endif -#if defined MBEDTLS_SSL_SERVER_NAME_INDICATION -#define POLARSSL_SSL_SERVER_NAME_INDICATION MBEDTLS_SSL_SERVER_NAME_INDICATION -#endif -#if defined MBEDTLS_SSL_SESSION_TICKETS -#define POLARSSL_SSL_SESSION_TICKETS MBEDTLS_SSL_SESSION_TICKETS -#endif -#if defined MBEDTLS_SSL_SRV_C -#define POLARSSL_SSL_SRV_C MBEDTLS_SSL_SRV_C -#endif -#if defined MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE -#define POLARSSL_SSL_SRV_RESPECT_CLIENT_PREFERENCE MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE -#endif -#if defined MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO -#define POLARSSL_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO -#endif -#if defined MBEDTLS_SSL_TLS_C -#define POLARSSL_SSL_TLS_C MBEDTLS_SSL_TLS_C -#endif -#if defined MBEDTLS_SSL_TRUNCATED_HMAC -#define POLARSSL_SSL_TRUNCATED_HMAC MBEDTLS_SSL_TRUNCATED_HMAC -#endif -#if defined MBEDTLS_THREADING_ALT -#define POLARSSL_THREADING_ALT MBEDTLS_THREADING_ALT -#endif -#if defined MBEDTLS_THREADING_C -#define POLARSSL_THREADING_C MBEDTLS_THREADING_C -#endif -#if defined MBEDTLS_THREADING_PTHREAD -#define POLARSSL_THREADING_PTHREAD MBEDTLS_THREADING_PTHREAD -#endif -#if defined MBEDTLS_TIMING_ALT -#define POLARSSL_TIMING_ALT MBEDTLS_TIMING_ALT -#endif -#if defined MBEDTLS_TIMING_C -#define POLARSSL_TIMING_C MBEDTLS_TIMING_C -#endif -#if defined MBEDTLS_VERSION_C -#define POLARSSL_VERSION_C MBEDTLS_VERSION_C -#endif -#if defined MBEDTLS_VERSION_FEATURES -#define POLARSSL_VERSION_FEATURES MBEDTLS_VERSION_FEATURES -#endif -#if defined MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 -#define POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3 MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 -#endif -#if defined MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION -#define POLARSSL_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION -#endif -#if defined MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE -#define POLARSSL_X509_CHECK_EXTENDED_KEY_USAGE MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE -#endif -#if defined MBEDTLS_X509_CHECK_KEY_USAGE -#define POLARSSL_X509_CHECK_KEY_USAGE MBEDTLS_X509_CHECK_KEY_USAGE -#endif -#if defined MBEDTLS_X509_CREATE_C -#define POLARSSL_X509_CREATE_C MBEDTLS_X509_CREATE_C -#endif -#if defined MBEDTLS_X509_CRL_PARSE_C -#define POLARSSL_X509_CRL_PARSE_C MBEDTLS_X509_CRL_PARSE_C -#endif -#if defined MBEDTLS_X509_CRT_PARSE_C -#define POLARSSL_X509_CRT_PARSE_C MBEDTLS_X509_CRT_PARSE_C -#endif -#if defined MBEDTLS_X509_CRT_WRITE_C -#define POLARSSL_X509_CRT_WRITE_C MBEDTLS_X509_CRT_WRITE_C -#endif -#if defined MBEDTLS_X509_CSR_PARSE_C -#define POLARSSL_X509_CSR_PARSE_C MBEDTLS_X509_CSR_PARSE_C -#endif -#if defined MBEDTLS_X509_CSR_WRITE_C -#define POLARSSL_X509_CSR_WRITE_C MBEDTLS_X509_CSR_WRITE_C -#endif -#if defined MBEDTLS_X509_MAX_INTERMEDIATE_CA -#define POLARSSL_X509_MAX_INTERMEDIATE_CA MBEDTLS_X509_MAX_INTERMEDIATE_CA -#endif -#if defined MBEDTLS_X509_RSASSA_PSS_SUPPORT -#define POLARSSL_X509_RSASSA_PSS_SUPPORT MBEDTLS_X509_RSASSA_PSS_SUPPORT -#endif -#if defined MBEDTLS_X509_USE_C -#define POLARSSL_X509_USE_C MBEDTLS_X509_USE_C -#endif -#if defined MBEDTLS_XTEA_ALT -#define POLARSSL_XTEA_ALT MBEDTLS_XTEA_ALT -#endif -#if defined MBEDTLS_XTEA_C -#define POLARSSL_XTEA_C MBEDTLS_XTEA_C -#endif -#if defined MBEDTLS_ZLIB_SUPPORT -#define POLARSSL_ZLIB_SUPPORT MBEDTLS_ZLIB_SUPPORT -#endif - -/* - * Misc names (macros, types, functions, enum constants...) - */ -#define AES_DECRYPT MBEDTLS_AES_DECRYPT -#define AES_ENCRYPT MBEDTLS_AES_ENCRYPT -#define ASN1_BIT_STRING MBEDTLS_ASN1_BIT_STRING -#define ASN1_BMP_STRING MBEDTLS_ASN1_BMP_STRING -#define ASN1_BOOLEAN MBEDTLS_ASN1_BOOLEAN -#define ASN1_CHK_ADD MBEDTLS_ASN1_CHK_ADD -#define ASN1_CONSTRUCTED MBEDTLS_ASN1_CONSTRUCTED -#define ASN1_CONTEXT_SPECIFIC MBEDTLS_ASN1_CONTEXT_SPECIFIC -#define ASN1_GENERALIZED_TIME MBEDTLS_ASN1_GENERALIZED_TIME -#define ASN1_IA5_STRING MBEDTLS_ASN1_IA5_STRING -#define ASN1_INTEGER MBEDTLS_ASN1_INTEGER -#define ASN1_NULL MBEDTLS_ASN1_NULL -#define ASN1_OCTET_STRING MBEDTLS_ASN1_OCTET_STRING -#define ASN1_OID MBEDTLS_ASN1_OID -#define ASN1_PRIMITIVE MBEDTLS_ASN1_PRIMITIVE -#define ASN1_PRINTABLE_STRING MBEDTLS_ASN1_PRINTABLE_STRING -#define ASN1_SEQUENCE MBEDTLS_ASN1_SEQUENCE -#define ASN1_SET MBEDTLS_ASN1_SET -#define ASN1_T61_STRING MBEDTLS_ASN1_T61_STRING -#define ASN1_UNIVERSAL_STRING MBEDTLS_ASN1_UNIVERSAL_STRING -#define ASN1_UTC_TIME MBEDTLS_ASN1_UTC_TIME -#define ASN1_UTF8_STRING MBEDTLS_ASN1_UTF8_STRING -#define BADCERT_CN_MISMATCH MBEDTLS_X509_BADCERT_CN_MISMATCH -#define BADCERT_EXPIRED MBEDTLS_X509_BADCERT_EXPIRED -#define BADCERT_FUTURE MBEDTLS_X509_BADCERT_FUTURE -#define BADCERT_MISSING MBEDTLS_X509_BADCERT_MISSING -#define BADCERT_NOT_TRUSTED MBEDTLS_X509_BADCERT_NOT_TRUSTED -#define BADCERT_OTHER MBEDTLS_X509_BADCERT_OTHER -#define BADCERT_REVOKED MBEDTLS_X509_BADCERT_REVOKED -#define BADCERT_SKIP_VERIFY MBEDTLS_X509_BADCERT_SKIP_VERIFY -#define BADCRL_EXPIRED MBEDTLS_X509_BADCRL_EXPIRED -#define BADCRL_FUTURE MBEDTLS_X509_BADCRL_FUTURE -#define BADCRL_NOT_TRUSTED MBEDTLS_X509_BADCRL_NOT_TRUSTED -#define BLOWFISH_BLOCKSIZE MBEDTLS_BLOWFISH_BLOCKSIZE -#define BLOWFISH_DECRYPT MBEDTLS_BLOWFISH_DECRYPT -#define BLOWFISH_ENCRYPT MBEDTLS_BLOWFISH_ENCRYPT -#define BLOWFISH_MAX_KEY MBEDTLS_BLOWFISH_MAX_KEY_BITS -#define BLOWFISH_MIN_KEY MBEDTLS_BLOWFISH_MIN_KEY_BITS -#define BLOWFISH_ROUNDS MBEDTLS_BLOWFISH_ROUNDS -#define CAMELLIA_DECRYPT MBEDTLS_CAMELLIA_DECRYPT -#define CAMELLIA_ENCRYPT MBEDTLS_CAMELLIA_ENCRYPT -#define COLLECT_SIZE MBEDTLS_HAVEGE_COLLECT_SIZE -#define CTR_DRBG_BLOCKSIZE MBEDTLS_CTR_DRBG_BLOCKSIZE -#define CTR_DRBG_ENTROPY_LEN MBEDTLS_CTR_DRBG_ENTROPY_LEN -#define CTR_DRBG_KEYBITS MBEDTLS_CTR_DRBG_KEYBITS -#define CTR_DRBG_KEYSIZE MBEDTLS_CTR_DRBG_KEYSIZE -#define CTR_DRBG_MAX_INPUT MBEDTLS_CTR_DRBG_MAX_INPUT -#define CTR_DRBG_MAX_REQUEST MBEDTLS_CTR_DRBG_MAX_REQUEST -#define CTR_DRBG_MAX_SEED_INPUT MBEDTLS_CTR_DRBG_MAX_SEED_INPUT -#define CTR_DRBG_PR_OFF MBEDTLS_CTR_DRBG_PR_OFF -#define CTR_DRBG_PR_ON MBEDTLS_CTR_DRBG_PR_ON -#define CTR_DRBG_RESEED_INTERVAL MBEDTLS_CTR_DRBG_RESEED_INTERVAL -#define CTR_DRBG_SEEDLEN MBEDTLS_CTR_DRBG_SEEDLEN -#define DEPRECATED MBEDTLS_DEPRECATED -#define DES_DECRYPT MBEDTLS_DES_DECRYPT -#define DES_ENCRYPT MBEDTLS_DES_ENCRYPT -#define DES_KEY_SIZE MBEDTLS_DES_KEY_SIZE -#define ENTROPY_BLOCK_SIZE MBEDTLS_ENTROPY_BLOCK_SIZE -#define ENTROPY_MAX_GATHER MBEDTLS_ENTROPY_MAX_GATHER -#define ENTROPY_MAX_SEED_SIZE MBEDTLS_ENTROPY_MAX_SEED_SIZE -#define ENTROPY_MAX_SOURCES MBEDTLS_ENTROPY_MAX_SOURCES -#define ENTROPY_MIN_HARDCLOCK MBEDTLS_ENTROPY_MIN_HARDCLOCK -#define ENTROPY_MIN_HAVEGE MBEDTLS_ENTROPY_MIN_HAVEGE -#define ENTROPY_MIN_PLATFORM MBEDTLS_ENTROPY_MIN_PLATFORM -#define ENTROPY_SOURCE_MANUAL MBEDTLS_ENTROPY_SOURCE_MANUAL -#define EXT_AUTHORITY_KEY_IDENTIFIER MBEDTLS_X509_EXT_AUTHORITY_KEY_IDENTIFIER -#define EXT_BASIC_CONSTRAINTS MBEDTLS_X509_EXT_BASIC_CONSTRAINTS -#define EXT_CERTIFICATE_POLICIES MBEDTLS_X509_EXT_CERTIFICATE_POLICIES -#define EXT_CRL_DISTRIBUTION_POINTS MBEDTLS_X509_EXT_CRL_DISTRIBUTION_POINTS -#define EXT_EXTENDED_KEY_USAGE MBEDTLS_X509_EXT_EXTENDED_KEY_USAGE -#define EXT_FRESHEST_CRL MBEDTLS_X509_EXT_FRESHEST_CRL -#define EXT_INIHIBIT_ANYPOLICY MBEDTLS_X509_EXT_INIHIBIT_ANYPOLICY -#define EXT_ISSUER_ALT_NAME MBEDTLS_X509_EXT_ISSUER_ALT_NAME -#define EXT_KEY_USAGE MBEDTLS_X509_EXT_KEY_USAGE -#define EXT_NAME_CONSTRAINTS MBEDTLS_X509_EXT_NAME_CONSTRAINTS -#define EXT_NS_CERT_TYPE MBEDTLS_X509_EXT_NS_CERT_TYPE -#define EXT_POLICY_CONSTRAINTS MBEDTLS_X509_EXT_POLICY_CONSTRAINTS -#define EXT_POLICY_MAPPINGS MBEDTLS_X509_EXT_POLICY_MAPPINGS -#define EXT_SUBJECT_ALT_NAME MBEDTLS_X509_EXT_SUBJECT_ALT_NAME -#define EXT_SUBJECT_DIRECTORY_ATTRS MBEDTLS_X509_EXT_SUBJECT_DIRECTORY_ATTRS -#define EXT_SUBJECT_KEY_IDENTIFIER MBEDTLS_X509_EXT_SUBJECT_KEY_IDENTIFIER -#define GCM_DECRYPT MBEDTLS_GCM_DECRYPT -#define GCM_ENCRYPT MBEDTLS_GCM_ENCRYPT -#define KU_CRL_SIGN MBEDTLS_X509_KU_CRL_SIGN -#define KU_DATA_ENCIPHERMENT MBEDTLS_X509_KU_DATA_ENCIPHERMENT -#define KU_DIGITAL_SIGNATURE MBEDTLS_X509_KU_DIGITAL_SIGNATURE -#define KU_KEY_AGREEMENT MBEDTLS_X509_KU_KEY_AGREEMENT -#define KU_KEY_CERT_SIGN MBEDTLS_X509_KU_KEY_CERT_SIGN -#define KU_KEY_ENCIPHERMENT MBEDTLS_X509_KU_KEY_ENCIPHERMENT -#define KU_NON_REPUDIATION MBEDTLS_X509_KU_NON_REPUDIATION -#define LN_2_DIV_LN_10_SCALE100 MBEDTLS_LN_2_DIV_LN_10_SCALE100 -#define MEMORY_VERIFY_ALLOC MBEDTLS_MEMORY_VERIFY_ALLOC -#define MEMORY_VERIFY_ALWAYS MBEDTLS_MEMORY_VERIFY_ALWAYS -#define MEMORY_VERIFY_FREE MBEDTLS_MEMORY_VERIFY_FREE -#define MEMORY_VERIFY_NONE MBEDTLS_MEMORY_VERIFY_NONE -#define MPI_CHK MBEDTLS_MPI_CHK -#define NET_PROTO_TCP MBEDTLS_NET_PROTO_TCP -#define NET_PROTO_UDP MBEDTLS_NET_PROTO_UDP -#define NS_CERT_TYPE_EMAIL MBEDTLS_X509_NS_CERT_TYPE_EMAIL -#define NS_CERT_TYPE_EMAIL_CA MBEDTLS_X509_NS_CERT_TYPE_EMAIL_CA -#define NS_CERT_TYPE_OBJECT_SIGNING MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING -#define NS_CERT_TYPE_OBJECT_SIGNING_CA MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING_CA -#define NS_CERT_TYPE_RESERVED MBEDTLS_X509_NS_CERT_TYPE_RESERVED -#define NS_CERT_TYPE_SSL_CA MBEDTLS_X509_NS_CERT_TYPE_SSL_CA -#define NS_CERT_TYPE_SSL_CLIENT MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT -#define NS_CERT_TYPE_SSL_SERVER MBEDTLS_X509_NS_CERT_TYPE_SSL_SERVER -#define OID_ANSI_X9_62 MBEDTLS_OID_ANSI_X9_62 -#define OID_ANSI_X9_62_FIELD_TYPE MBEDTLS_OID_ANSI_X9_62_FIELD_TYPE -#define OID_ANSI_X9_62_PRIME_FIELD MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD -#define OID_ANSI_X9_62_SIG MBEDTLS_OID_ANSI_X9_62_SIG -#define OID_ANSI_X9_62_SIG_SHA2 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 -#define OID_ANY_EXTENDED_KEY_USAGE MBEDTLS_OID_ANY_EXTENDED_KEY_USAGE -#define OID_AT MBEDTLS_OID_AT -#define OID_AT_CN MBEDTLS_OID_AT_CN -#define OID_AT_COUNTRY MBEDTLS_OID_AT_COUNTRY -#define OID_AT_DN_QUALIFIER MBEDTLS_OID_AT_DN_QUALIFIER -#define OID_AT_GENERATION_QUALIFIER MBEDTLS_OID_AT_GENERATION_QUALIFIER -#define OID_AT_GIVEN_NAME MBEDTLS_OID_AT_GIVEN_NAME -#define OID_AT_INITIALS MBEDTLS_OID_AT_INITIALS -#define OID_AT_LOCALITY MBEDTLS_OID_AT_LOCALITY -#define OID_AT_ORGANIZATION MBEDTLS_OID_AT_ORGANIZATION -#define OID_AT_ORG_UNIT MBEDTLS_OID_AT_ORG_UNIT -#define OID_AT_POSTAL_ADDRESS MBEDTLS_OID_AT_POSTAL_ADDRESS -#define OID_AT_POSTAL_CODE MBEDTLS_OID_AT_POSTAL_CODE -#define OID_AT_PSEUDONYM MBEDTLS_OID_AT_PSEUDONYM -#define OID_AT_SERIAL_NUMBER MBEDTLS_OID_AT_SERIAL_NUMBER -#define OID_AT_STATE MBEDTLS_OID_AT_STATE -#define OID_AT_SUR_NAME MBEDTLS_OID_AT_SUR_NAME -#define OID_AT_TITLE MBEDTLS_OID_AT_TITLE -#define OID_AT_UNIQUE_IDENTIFIER MBEDTLS_OID_AT_UNIQUE_IDENTIFIER -#define OID_AUTHORITY_KEY_IDENTIFIER MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER -#define OID_BASIC_CONSTRAINTS MBEDTLS_OID_BASIC_CONSTRAINTS -#define OID_CERTICOM MBEDTLS_OID_CERTICOM -#define OID_CERTIFICATE_POLICIES MBEDTLS_OID_CERTIFICATE_POLICIES -#define OID_CLIENT_AUTH MBEDTLS_OID_CLIENT_AUTH -#define OID_CMP MBEDTLS_OID_CMP -#define OID_CODE_SIGNING MBEDTLS_OID_CODE_SIGNING -#define OID_COUNTRY_US MBEDTLS_OID_COUNTRY_US -#define OID_CRL_DISTRIBUTION_POINTS MBEDTLS_OID_CRL_DISTRIBUTION_POINTS -#define OID_CRL_NUMBER MBEDTLS_OID_CRL_NUMBER -#define OID_DES_CBC MBEDTLS_OID_DES_CBC -#define OID_DES_EDE3_CBC MBEDTLS_OID_DES_EDE3_CBC -#define OID_DIGEST_ALG_MD2 MBEDTLS_OID_DIGEST_ALG_MD2 -#define OID_DIGEST_ALG_MD4 MBEDTLS_OID_DIGEST_ALG_MD4 -#define OID_DIGEST_ALG_MD5 MBEDTLS_OID_DIGEST_ALG_MD5 -#define OID_DIGEST_ALG_SHA1 MBEDTLS_OID_DIGEST_ALG_SHA1 -#define OID_DIGEST_ALG_SHA224 MBEDTLS_OID_DIGEST_ALG_SHA224 -#define OID_DIGEST_ALG_SHA256 MBEDTLS_OID_DIGEST_ALG_SHA256 -#define OID_DIGEST_ALG_SHA384 MBEDTLS_OID_DIGEST_ALG_SHA384 -#define OID_DIGEST_ALG_SHA512 MBEDTLS_OID_DIGEST_ALG_SHA512 -#define OID_DOMAIN_COMPONENT MBEDTLS_OID_DOMAIN_COMPONENT -#define OID_ECDSA_SHA1 MBEDTLS_OID_ECDSA_SHA1 -#define OID_ECDSA_SHA224 MBEDTLS_OID_ECDSA_SHA224 -#define OID_ECDSA_SHA256 MBEDTLS_OID_ECDSA_SHA256 -#define OID_ECDSA_SHA384 MBEDTLS_OID_ECDSA_SHA384 -#define OID_ECDSA_SHA512 MBEDTLS_OID_ECDSA_SHA512 -#define OID_EC_ALG_ECDH MBEDTLS_OID_EC_ALG_ECDH -#define OID_EC_ALG_UNRESTRICTED MBEDTLS_OID_EC_ALG_UNRESTRICTED -#define OID_EC_BRAINPOOL_V1 MBEDTLS_OID_EC_BRAINPOOL_V1 -#define OID_EC_GRP_BP256R1 MBEDTLS_OID_EC_GRP_BP256R1 -#define OID_EC_GRP_BP384R1 MBEDTLS_OID_EC_GRP_BP384R1 -#define OID_EC_GRP_BP512R1 MBEDTLS_OID_EC_GRP_BP512R1 -#define OID_EC_GRP_SECP192K1 MBEDTLS_OID_EC_GRP_SECP192K1 -#define OID_EC_GRP_SECP192R1 MBEDTLS_OID_EC_GRP_SECP192R1 -#define OID_EC_GRP_SECP224K1 MBEDTLS_OID_EC_GRP_SECP224K1 -#define OID_EC_GRP_SECP224R1 MBEDTLS_OID_EC_GRP_SECP224R1 -#define OID_EC_GRP_SECP256K1 MBEDTLS_OID_EC_GRP_SECP256K1 -#define OID_EC_GRP_SECP256R1 MBEDTLS_OID_EC_GRP_SECP256R1 -#define OID_EC_GRP_SECP384R1 MBEDTLS_OID_EC_GRP_SECP384R1 -#define OID_EC_GRP_SECP521R1 MBEDTLS_OID_EC_GRP_SECP521R1 -#define OID_EMAIL_PROTECTION MBEDTLS_OID_EMAIL_PROTECTION -#define OID_EXTENDED_KEY_USAGE MBEDTLS_OID_EXTENDED_KEY_USAGE -#define OID_FRESHEST_CRL MBEDTLS_OID_FRESHEST_CRL -#define OID_GOV MBEDTLS_OID_GOV -#define OID_HMAC_SHA1 MBEDTLS_OID_HMAC_SHA1 -#define OID_ID_CE MBEDTLS_OID_ID_CE -#define OID_INIHIBIT_ANYPOLICY MBEDTLS_OID_INIHIBIT_ANYPOLICY -#define OID_ISO_CCITT_DS MBEDTLS_OID_ISO_CCITT_DS -#define OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ISO_IDENTIFIED_ORG -#define OID_ISO_ITU_COUNTRY MBEDTLS_OID_ISO_ITU_COUNTRY -#define OID_ISO_ITU_US_ORG MBEDTLS_OID_ISO_ITU_US_ORG -#define OID_ISO_MEMBER_BODIES MBEDTLS_OID_ISO_MEMBER_BODIES -#define OID_ISSUER_ALT_NAME MBEDTLS_OID_ISSUER_ALT_NAME -#define OID_KEY_USAGE MBEDTLS_OID_KEY_USAGE -#define OID_KP MBEDTLS_OID_KP -#define OID_MGF1 MBEDTLS_OID_MGF1 -#define OID_NAME_CONSTRAINTS MBEDTLS_OID_NAME_CONSTRAINTS -#define OID_NETSCAPE MBEDTLS_OID_NETSCAPE -#define OID_NS_BASE_URL MBEDTLS_OID_NS_BASE_URL -#define OID_NS_CA_POLICY_URL MBEDTLS_OID_NS_CA_POLICY_URL -#define OID_NS_CA_REVOCATION_URL MBEDTLS_OID_NS_CA_REVOCATION_URL -#define OID_NS_CERT MBEDTLS_OID_NS_CERT -#define OID_NS_CERT_SEQUENCE MBEDTLS_OID_NS_CERT_SEQUENCE -#define OID_NS_CERT_TYPE MBEDTLS_OID_NS_CERT_TYPE -#define OID_NS_COMMENT MBEDTLS_OID_NS_COMMENT -#define OID_NS_DATA_TYPE MBEDTLS_OID_NS_DATA_TYPE -#define OID_NS_RENEWAL_URL MBEDTLS_OID_NS_RENEWAL_URL -#define OID_NS_REVOCATION_URL MBEDTLS_OID_NS_REVOCATION_URL -#define OID_NS_SSL_SERVER_NAME MBEDTLS_OID_NS_SSL_SERVER_NAME -#define OID_OCSP_SIGNING MBEDTLS_OID_OCSP_SIGNING -#define OID_OIW_SECSIG MBEDTLS_OID_OIW_SECSIG -#define OID_OIW_SECSIG_ALG MBEDTLS_OID_OIW_SECSIG_ALG -#define OID_OIW_SECSIG_SHA1 MBEDTLS_OID_OIW_SECSIG_SHA1 -#define OID_ORGANIZATION MBEDTLS_OID_ORGANIZATION -#define OID_ORG_ANSI_X9_62 MBEDTLS_OID_ORG_ANSI_X9_62 -#define OID_ORG_CERTICOM MBEDTLS_OID_ORG_CERTICOM -#define OID_ORG_DOD MBEDTLS_OID_ORG_DOD -#define OID_ORG_GOV MBEDTLS_OID_ORG_GOV -#define OID_ORG_NETSCAPE MBEDTLS_OID_ORG_NETSCAPE -#define OID_ORG_OIW MBEDTLS_OID_ORG_OIW -#define OID_ORG_RSA_DATA_SECURITY MBEDTLS_OID_ORG_RSA_DATA_SECURITY -#define OID_ORG_TELETRUST MBEDTLS_OID_ORG_TELETRUST -#define OID_PKCS MBEDTLS_OID_PKCS -#define OID_PKCS1 MBEDTLS_OID_PKCS1 -#define OID_PKCS12 MBEDTLS_OID_PKCS12 -#define OID_PKCS12_PBE MBEDTLS_OID_PKCS12_PBE -#define OID_PKCS12_PBE_SHA1_DES2_EDE_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_DES2_EDE_CBC -#define OID_PKCS12_PBE_SHA1_DES3_EDE_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_DES3_EDE_CBC -#define OID_PKCS12_PBE_SHA1_RC2_128_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_128_CBC -#define OID_PKCS12_PBE_SHA1_RC2_40_CBC MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_40_CBC -#define OID_PKCS12_PBE_SHA1_RC4_128 MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_128 -#define OID_PKCS12_PBE_SHA1_RC4_40 MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_40 -#define OID_PKCS1_MD2 MBEDTLS_OID_PKCS1_MD2 -#define OID_PKCS1_MD4 MBEDTLS_OID_PKCS1_MD4 -#define OID_PKCS1_MD5 MBEDTLS_OID_PKCS1_MD5 -#define OID_PKCS1_RSA MBEDTLS_OID_PKCS1_RSA -#define OID_PKCS1_SHA1 MBEDTLS_OID_PKCS1_SHA1 -#define OID_PKCS1_SHA224 MBEDTLS_OID_PKCS1_SHA224 -#define OID_PKCS1_SHA256 MBEDTLS_OID_PKCS1_SHA256 -#define OID_PKCS1_SHA384 MBEDTLS_OID_PKCS1_SHA384 -#define OID_PKCS1_SHA512 MBEDTLS_OID_PKCS1_SHA512 -#define OID_PKCS5 MBEDTLS_OID_PKCS5 -#define OID_PKCS5_PBES2 MBEDTLS_OID_PKCS5_PBES2 -#define OID_PKCS5_PBE_MD2_DES_CBC MBEDTLS_OID_PKCS5_PBE_MD2_DES_CBC -#define OID_PKCS5_PBE_MD2_RC2_CBC MBEDTLS_OID_PKCS5_PBE_MD2_RC2_CBC -#define OID_PKCS5_PBE_MD5_DES_CBC MBEDTLS_OID_PKCS5_PBE_MD5_DES_CBC -#define OID_PKCS5_PBE_MD5_RC2_CBC MBEDTLS_OID_PKCS5_PBE_MD5_RC2_CBC -#define OID_PKCS5_PBE_SHA1_DES_CBC MBEDTLS_OID_PKCS5_PBE_SHA1_DES_CBC -#define OID_PKCS5_PBE_SHA1_RC2_CBC MBEDTLS_OID_PKCS5_PBE_SHA1_RC2_CBC -#define OID_PKCS5_PBKDF2 MBEDTLS_OID_PKCS5_PBKDF2 -#define OID_PKCS5_PBMAC1 MBEDTLS_OID_PKCS5_PBMAC1 -#define OID_PKCS9 MBEDTLS_OID_PKCS9 -#define OID_PKCS9_CSR_EXT_REQ MBEDTLS_OID_PKCS9_CSR_EXT_REQ -#define OID_PKCS9_EMAIL MBEDTLS_OID_PKCS9_EMAIL -#define OID_PKIX MBEDTLS_OID_PKIX -#define OID_POLICY_CONSTRAINTS MBEDTLS_OID_POLICY_CONSTRAINTS -#define OID_POLICY_MAPPINGS MBEDTLS_OID_POLICY_MAPPINGS -#define OID_PRIVATE_KEY_USAGE_PERIOD MBEDTLS_OID_PRIVATE_KEY_USAGE_PERIOD -#define OID_RSASSA_PSS MBEDTLS_OID_RSASSA_PSS -#define OID_RSA_COMPANY MBEDTLS_OID_RSA_COMPANY -#define OID_RSA_SHA_OBS MBEDTLS_OID_RSA_SHA_OBS -#define OID_SERVER_AUTH MBEDTLS_OID_SERVER_AUTH -#define OID_SIZE MBEDTLS_OID_SIZE -#define OID_SUBJECT_ALT_NAME MBEDTLS_OID_SUBJECT_ALT_NAME -#define OID_SUBJECT_DIRECTORY_ATTRS MBEDTLS_OID_SUBJECT_DIRECTORY_ATTRS -#define OID_SUBJECT_KEY_IDENTIFIER MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER -#define OID_TELETRUST MBEDTLS_OID_TELETRUST -#define OID_TIME_STAMPING MBEDTLS_OID_TIME_STAMPING -#define PADLOCK_ACE MBEDTLS_PADLOCK_ACE -#define PADLOCK_ALIGN16 MBEDTLS_PADLOCK_ALIGN16 -#define PADLOCK_PHE MBEDTLS_PADLOCK_PHE -#define PADLOCK_PMM MBEDTLS_PADLOCK_PMM -#define PADLOCK_RNG MBEDTLS_PADLOCK_RNG -#define PKCS12_DERIVE_IV MBEDTLS_PKCS12_DERIVE_IV -#define PKCS12_DERIVE_KEY MBEDTLS_PKCS12_DERIVE_KEY -#define PKCS12_DERIVE_MAC_KEY MBEDTLS_PKCS12_DERIVE_MAC_KEY -#define PKCS12_PBE_DECRYPT MBEDTLS_PKCS12_PBE_DECRYPT -#define PKCS12_PBE_ENCRYPT MBEDTLS_PKCS12_PBE_ENCRYPT -#define PKCS5_DECRYPT MBEDTLS_PKCS5_DECRYPT -#define PKCS5_ENCRYPT MBEDTLS_PKCS5_ENCRYPT -#define POLARSSL_AESNI_AES MBEDTLS_AESNI_AES -#define POLARSSL_AESNI_CLMUL MBEDTLS_AESNI_CLMUL -#define POLARSSL_AESNI_H MBEDTLS_AESNI_H -#define POLARSSL_AES_H MBEDTLS_AES_H -#define POLARSSL_ARC4_H MBEDTLS_ARC4_H -#define POLARSSL_ASN1_H MBEDTLS_ASN1_H -#define POLARSSL_ASN1_WRITE_H MBEDTLS_ASN1_WRITE_H -#define POLARSSL_BASE64_H MBEDTLS_BASE64_H -#define POLARSSL_BIGNUM_H MBEDTLS_BIGNUM_H -#define POLARSSL_BLOWFISH_H MBEDTLS_BLOWFISH_H -#define POLARSSL_BN_MUL_H MBEDTLS_BN_MUL_H -#define POLARSSL_CAMELLIA_H MBEDTLS_CAMELLIA_H -#define POLARSSL_CCM_H MBEDTLS_CCM_H -#define POLARSSL_CERTS_H MBEDTLS_CERTS_H -#define POLARSSL_CHECK_CONFIG_H MBEDTLS_CHECK_CONFIG_H -#define POLARSSL_CIPHERSUITE_NODTLS MBEDTLS_CIPHERSUITE_NODTLS -#define POLARSSL_CIPHERSUITE_SHORT_TAG MBEDTLS_CIPHERSUITE_SHORT_TAG -#define POLARSSL_CIPHERSUITE_WEAK MBEDTLS_CIPHERSUITE_WEAK -#define POLARSSL_CIPHER_AES_128_CBC MBEDTLS_CIPHER_AES_128_CBC -#define POLARSSL_CIPHER_AES_128_CCM MBEDTLS_CIPHER_AES_128_CCM -#define POLARSSL_CIPHER_AES_128_CFB128 MBEDTLS_CIPHER_AES_128_CFB128 -#define POLARSSL_CIPHER_AES_128_CTR MBEDTLS_CIPHER_AES_128_CTR -#define POLARSSL_CIPHER_AES_128_ECB MBEDTLS_CIPHER_AES_128_ECB -#define POLARSSL_CIPHER_AES_128_GCM MBEDTLS_CIPHER_AES_128_GCM -#define POLARSSL_CIPHER_AES_192_CBC MBEDTLS_CIPHER_AES_192_CBC -#define POLARSSL_CIPHER_AES_192_CCM MBEDTLS_CIPHER_AES_192_CCM -#define POLARSSL_CIPHER_AES_192_CFB128 MBEDTLS_CIPHER_AES_192_CFB128 -#define POLARSSL_CIPHER_AES_192_CTR MBEDTLS_CIPHER_AES_192_CTR -#define POLARSSL_CIPHER_AES_192_ECB MBEDTLS_CIPHER_AES_192_ECB -#define POLARSSL_CIPHER_AES_192_GCM MBEDTLS_CIPHER_AES_192_GCM -#define POLARSSL_CIPHER_AES_256_CBC MBEDTLS_CIPHER_AES_256_CBC -#define POLARSSL_CIPHER_AES_256_CCM MBEDTLS_CIPHER_AES_256_CCM -#define POLARSSL_CIPHER_AES_256_CFB128 MBEDTLS_CIPHER_AES_256_CFB128 -#define POLARSSL_CIPHER_AES_256_CTR MBEDTLS_CIPHER_AES_256_CTR -#define POLARSSL_CIPHER_AES_256_ECB MBEDTLS_CIPHER_AES_256_ECB -#define POLARSSL_CIPHER_AES_256_GCM MBEDTLS_CIPHER_AES_256_GCM -#define POLARSSL_CIPHER_ARC4_128 MBEDTLS_CIPHER_ARC4_128 -#define POLARSSL_CIPHER_BLOWFISH_CBC MBEDTLS_CIPHER_BLOWFISH_CBC -#define POLARSSL_CIPHER_BLOWFISH_CFB64 MBEDTLS_CIPHER_BLOWFISH_CFB64 -#define POLARSSL_CIPHER_BLOWFISH_CTR MBEDTLS_CIPHER_BLOWFISH_CTR -#define POLARSSL_CIPHER_BLOWFISH_ECB MBEDTLS_CIPHER_BLOWFISH_ECB -#define POLARSSL_CIPHER_CAMELLIA_128_CBC MBEDTLS_CIPHER_CAMELLIA_128_CBC -#define POLARSSL_CIPHER_CAMELLIA_128_CCM MBEDTLS_CIPHER_CAMELLIA_128_CCM -#define POLARSSL_CIPHER_CAMELLIA_128_CFB128 MBEDTLS_CIPHER_CAMELLIA_128_CFB128 -#define POLARSSL_CIPHER_CAMELLIA_128_CTR MBEDTLS_CIPHER_CAMELLIA_128_CTR -#define POLARSSL_CIPHER_CAMELLIA_128_ECB MBEDTLS_CIPHER_CAMELLIA_128_ECB -#define POLARSSL_CIPHER_CAMELLIA_128_GCM MBEDTLS_CIPHER_CAMELLIA_128_GCM -#define POLARSSL_CIPHER_CAMELLIA_192_CBC MBEDTLS_CIPHER_CAMELLIA_192_CBC -#define POLARSSL_CIPHER_CAMELLIA_192_CCM MBEDTLS_CIPHER_CAMELLIA_192_CCM -#define POLARSSL_CIPHER_CAMELLIA_192_CFB128 MBEDTLS_CIPHER_CAMELLIA_192_CFB128 -#define POLARSSL_CIPHER_CAMELLIA_192_CTR MBEDTLS_CIPHER_CAMELLIA_192_CTR -#define POLARSSL_CIPHER_CAMELLIA_192_ECB MBEDTLS_CIPHER_CAMELLIA_192_ECB -#define POLARSSL_CIPHER_CAMELLIA_192_GCM MBEDTLS_CIPHER_CAMELLIA_192_GCM -#define POLARSSL_CIPHER_CAMELLIA_256_CBC MBEDTLS_CIPHER_CAMELLIA_256_CBC -#define POLARSSL_CIPHER_CAMELLIA_256_CCM MBEDTLS_CIPHER_CAMELLIA_256_CCM -#define POLARSSL_CIPHER_CAMELLIA_256_CFB128 MBEDTLS_CIPHER_CAMELLIA_256_CFB128 -#define POLARSSL_CIPHER_CAMELLIA_256_CTR MBEDTLS_CIPHER_CAMELLIA_256_CTR -#define POLARSSL_CIPHER_CAMELLIA_256_ECB MBEDTLS_CIPHER_CAMELLIA_256_ECB -#define POLARSSL_CIPHER_CAMELLIA_256_GCM MBEDTLS_CIPHER_CAMELLIA_256_GCM -#define POLARSSL_CIPHER_DES_CBC MBEDTLS_CIPHER_DES_CBC -#define POLARSSL_CIPHER_DES_ECB MBEDTLS_CIPHER_DES_ECB -#define POLARSSL_CIPHER_DES_EDE3_CBC MBEDTLS_CIPHER_DES_EDE3_CBC -#define POLARSSL_CIPHER_DES_EDE3_ECB MBEDTLS_CIPHER_DES_EDE3_ECB -#define POLARSSL_CIPHER_DES_EDE_CBC MBEDTLS_CIPHER_DES_EDE_CBC -#define POLARSSL_CIPHER_DES_EDE_ECB MBEDTLS_CIPHER_DES_EDE_ECB -#define POLARSSL_CIPHER_H MBEDTLS_CIPHER_H -#define POLARSSL_CIPHER_ID_3DES MBEDTLS_CIPHER_ID_3DES -#define POLARSSL_CIPHER_ID_AES MBEDTLS_CIPHER_ID_AES -#define POLARSSL_CIPHER_ID_ARC4 MBEDTLS_CIPHER_ID_ARC4 -#define POLARSSL_CIPHER_ID_BLOWFISH MBEDTLS_CIPHER_ID_BLOWFISH -#define POLARSSL_CIPHER_ID_CAMELLIA MBEDTLS_CIPHER_ID_CAMELLIA -#define POLARSSL_CIPHER_ID_DES MBEDTLS_CIPHER_ID_DES -#define POLARSSL_CIPHER_ID_NONE MBEDTLS_CIPHER_ID_NONE -#define POLARSSL_CIPHER_ID_NULL MBEDTLS_CIPHER_ID_NULL -#define POLARSSL_CIPHER_MODE_AEAD MBEDTLS_CIPHER_MODE_AEAD -#define POLARSSL_CIPHER_MODE_STREAM MBEDTLS_CIPHER_MODE_STREAM -#define POLARSSL_CIPHER_MODE_WITH_PADDING MBEDTLS_CIPHER_MODE_WITH_PADDING -#define POLARSSL_CIPHER_NONE MBEDTLS_CIPHER_NONE -#define POLARSSL_CIPHER_NULL MBEDTLS_CIPHER_NULL -#define POLARSSL_CIPHER_VARIABLE_IV_LEN MBEDTLS_CIPHER_VARIABLE_IV_LEN -#define POLARSSL_CIPHER_VARIABLE_KEY_LEN MBEDTLS_CIPHER_VARIABLE_KEY_LEN -#define POLARSSL_CIPHER_WRAP_H MBEDTLS_CIPHER_WRAP_H -#define POLARSSL_CONFIG_H MBEDTLS_CONFIG_H -#define POLARSSL_CTR_DRBG_H MBEDTLS_CTR_DRBG_H -#define POLARSSL_DEBUG_H MBEDTLS_DEBUG_H -#define POLARSSL_DECRYPT MBEDTLS_DECRYPT -#define POLARSSL_DES_H MBEDTLS_DES_H -#define POLARSSL_DHM_H MBEDTLS_DHM_H -#define POLARSSL_DHM_RFC3526_MODP_2048_G MBEDTLS_DHM_RFC3526_MODP_2048_G -#define POLARSSL_DHM_RFC3526_MODP_2048_P MBEDTLS_DHM_RFC3526_MODP_2048_P -#define POLARSSL_DHM_RFC3526_MODP_3072_G MBEDTLS_DHM_RFC3526_MODP_3072_G -#define POLARSSL_DHM_RFC3526_MODP_3072_P MBEDTLS_DHM_RFC3526_MODP_3072_P -#define POLARSSL_DHM_RFC5114_MODP_2048_G MBEDTLS_DHM_RFC5114_MODP_2048_G -#define POLARSSL_DHM_RFC5114_MODP_2048_P MBEDTLS_DHM_RFC5114_MODP_2048_P -#define POLARSSL_ECDH_H MBEDTLS_ECDH_H -#define POLARSSL_ECDH_OURS MBEDTLS_ECDH_OURS -#define POLARSSL_ECDH_THEIRS MBEDTLS_ECDH_THEIRS -#define POLARSSL_ECDSA_H MBEDTLS_ECDSA_H -#define POLARSSL_ECP_DP_BP256R1 MBEDTLS_ECP_DP_BP256R1 -#define POLARSSL_ECP_DP_BP384R1 MBEDTLS_ECP_DP_BP384R1 -#define POLARSSL_ECP_DP_BP512R1 MBEDTLS_ECP_DP_BP512R1 -#define POLARSSL_ECP_DP_M255 MBEDTLS_ECP_DP_CURVE25519 -#define POLARSSL_ECP_DP_MAX MBEDTLS_ECP_DP_MAX -#define POLARSSL_ECP_DP_NONE MBEDTLS_ECP_DP_NONE -#define POLARSSL_ECP_DP_SECP192K1 MBEDTLS_ECP_DP_SECP192K1 -#define POLARSSL_ECP_DP_SECP192R1 MBEDTLS_ECP_DP_SECP192R1 -#define POLARSSL_ECP_DP_SECP224K1 MBEDTLS_ECP_DP_SECP224K1 -#define POLARSSL_ECP_DP_SECP224R1 MBEDTLS_ECP_DP_SECP224R1 -#define POLARSSL_ECP_DP_SECP256K1 MBEDTLS_ECP_DP_SECP256K1 -#define POLARSSL_ECP_DP_SECP256R1 MBEDTLS_ECP_DP_SECP256R1 -#define POLARSSL_ECP_DP_SECP384R1 MBEDTLS_ECP_DP_SECP384R1 -#define POLARSSL_ECP_DP_SECP521R1 MBEDTLS_ECP_DP_SECP521R1 -#define POLARSSL_ECP_H MBEDTLS_ECP_H -#define POLARSSL_ECP_MAX_BYTES MBEDTLS_ECP_MAX_BYTES -#define POLARSSL_ECP_MAX_PT_LEN MBEDTLS_ECP_MAX_PT_LEN -#define POLARSSL_ECP_PF_COMPRESSED MBEDTLS_ECP_PF_COMPRESSED -#define POLARSSL_ECP_PF_UNCOMPRESSED MBEDTLS_ECP_PF_UNCOMPRESSED -#define POLARSSL_ECP_TLS_NAMED_CURVE MBEDTLS_ECP_TLS_NAMED_CURVE -#define POLARSSL_ENCRYPT MBEDTLS_ENCRYPT -#define POLARSSL_ENTROPY_H MBEDTLS_ENTROPY_H -#define POLARSSL_ENTROPY_POLL_H MBEDTLS_ENTROPY_POLL_H -#define POLARSSL_ENTROPY_SHA256_ACCUMULATOR MBEDTLS_ENTROPY_SHA256_ACCUMULATOR -#define POLARSSL_ENTROPY_SHA512_ACCUMULATOR MBEDTLS_ENTROPY_SHA512_ACCUMULATOR -#define POLARSSL_ERROR_H MBEDTLS_ERROR_H -#define POLARSSL_ERR_AES_INVALID_INPUT_LENGTH MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -#define POLARSSL_ERR_AES_INVALID_KEY_LENGTH MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -#define POLARSSL_ERR_ASN1_BUF_TOO_SMALL MBEDTLS_ERR_ASN1_BUF_TOO_SMALL -#define POLARSSL_ERR_ASN1_INVALID_DATA MBEDTLS_ERR_ASN1_INVALID_DATA -#define POLARSSL_ERR_ASN1_INVALID_LENGTH MBEDTLS_ERR_ASN1_INVALID_LENGTH -#define POLARSSL_ERR_ASN1_LENGTH_MISMATCH MBEDTLS_ERR_ASN1_LENGTH_MISMATCH -#define POLARSSL_ERR_ASN1_MALLOC_FAILED MBEDTLS_ERR_ASN1_ALLOC_FAILED -#define POLARSSL_ERR_ASN1_OUT_OF_DATA MBEDTLS_ERR_ASN1_OUT_OF_DATA -#define POLARSSL_ERR_ASN1_UNEXPECTED_TAG MBEDTLS_ERR_ASN1_UNEXPECTED_TAG -#define POLARSSL_ERR_BASE64_BUFFER_TOO_SMALL MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL -#define POLARSSL_ERR_BASE64_INVALID_CHARACTER MBEDTLS_ERR_BASE64_INVALID_CHARACTER -#define POLARSSL_ERR_BLOWFISH_INVALID_INPUT_LENGTH MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -#define POLARSSL_ERR_BLOWFISH_INVALID_KEY_LENGTH MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH -#define POLARSSL_ERR_CAMELLIA_INVALID_INPUT_LENGTH MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -#define POLARSSL_ERR_CAMELLIA_INVALID_KEY_LENGTH MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH -#define POLARSSL_ERR_CCM_AUTH_FAILED MBEDTLS_ERR_CCM_AUTH_FAILED -#define POLARSSL_ERR_CCM_BAD_INPUT MBEDTLS_ERR_CCM_BAD_INPUT -#define POLARSSL_ERR_CIPHER_ALLOC_FAILED MBEDTLS_ERR_CIPHER_ALLOC_FAILED -#define POLARSSL_ERR_CIPHER_AUTH_FAILED MBEDTLS_ERR_CIPHER_AUTH_FAILED -#define POLARSSL_ERR_CIPHER_BAD_INPUT_DATA MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA -#define POLARSSL_ERR_CIPHER_FEATURE_UNAVAILABLE MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_CIPHER_FULL_BLOCK_EXPECTED MBEDTLS_ERR_CIPHER_FULL_BLOCK_EXPECTED -#define POLARSSL_ERR_CIPHER_INVALID_PADDING MBEDTLS_ERR_CIPHER_INVALID_PADDING -#define POLARSSL_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED -#define POLARSSL_ERR_CTR_DRBG_FILE_IO_ERROR MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR -#define POLARSSL_ERR_CTR_DRBG_INPUT_TOO_BIG MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG -#define POLARSSL_ERR_CTR_DRBG_REQUEST_TOO_BIG MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG -#define POLARSSL_ERR_DES_INVALID_INPUT_LENGTH MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH -#define POLARSSL_ERR_DHM_BAD_INPUT_DATA MBEDTLS_ERR_DHM_BAD_INPUT_DATA -#define POLARSSL_ERR_DHM_CALC_SECRET_FAILED MBEDTLS_ERR_DHM_CALC_SECRET_FAILED -#define POLARSSL_ERR_DHM_FILE_IO_ERROR MBEDTLS_ERR_DHM_FILE_IO_ERROR -#define POLARSSL_ERR_DHM_INVALID_FORMAT MBEDTLS_ERR_DHM_INVALID_FORMAT -#define POLARSSL_ERR_DHM_MAKE_PARAMS_FAILED MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED -#define POLARSSL_ERR_DHM_MAKE_PUBLIC_FAILED MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED -#define POLARSSL_ERR_DHM_MALLOC_FAILED MBEDTLS_ERR_DHM_ALLOC_FAILED -#define POLARSSL_ERR_DHM_READ_PARAMS_FAILED MBEDTLS_ERR_DHM_READ_PARAMS_FAILED -#define POLARSSL_ERR_DHM_READ_PUBLIC_FAILED MBEDTLS_ERR_DHM_READ_PUBLIC_FAILED -#define POLARSSL_ERR_ECP_BAD_INPUT_DATA MBEDTLS_ERR_ECP_BAD_INPUT_DATA -#define POLARSSL_ERR_ECP_BUFFER_TOO_SMALL MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL -#define POLARSSL_ERR_ECP_FEATURE_UNAVAILABLE MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_ECP_INVALID_KEY MBEDTLS_ERR_ECP_INVALID_KEY -#define POLARSSL_ERR_ECP_MALLOC_FAILED MBEDTLS_ERR_ECP_ALLOC_FAILED -#define POLARSSL_ERR_ECP_RANDOM_FAILED MBEDTLS_ERR_ECP_RANDOM_FAILED -#define POLARSSL_ERR_ECP_SIG_LEN_MISMATCH MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH -#define POLARSSL_ERR_ECP_VERIFY_FAILED MBEDTLS_ERR_ECP_VERIFY_FAILED -#define POLARSSL_ERR_ENTROPY_FILE_IO_ERROR MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR -#define POLARSSL_ERR_ENTROPY_MAX_SOURCES MBEDTLS_ERR_ENTROPY_MAX_SOURCES -#define POLARSSL_ERR_ENTROPY_NO_SOURCES_DEFINED MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED -#define POLARSSL_ERR_ENTROPY_SOURCE_FAILED MBEDTLS_ERR_ENTROPY_SOURCE_FAILED -#define POLARSSL_ERR_GCM_AUTH_FAILED MBEDTLS_ERR_GCM_AUTH_FAILED -#define POLARSSL_ERR_GCM_BAD_INPUT MBEDTLS_ERR_GCM_BAD_INPUT -#define POLARSSL_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED -#define POLARSSL_ERR_HMAC_DRBG_FILE_IO_ERROR MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR -#define POLARSSL_ERR_HMAC_DRBG_INPUT_TOO_BIG MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG -#define POLARSSL_ERR_HMAC_DRBG_REQUEST_TOO_BIG MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG -#define POLARSSL_ERR_MD_ALLOC_FAILED MBEDTLS_ERR_MD_ALLOC_FAILED -#define POLARSSL_ERR_MD_BAD_INPUT_DATA MBEDTLS_ERR_MD_BAD_INPUT_DATA -#define POLARSSL_ERR_MD_FEATURE_UNAVAILABLE MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_MD_FILE_IO_ERROR MBEDTLS_ERR_MD_FILE_IO_ERROR -#define POLARSSL_ERR_MPI_BAD_INPUT_DATA MBEDTLS_ERR_MPI_BAD_INPUT_DATA -#define POLARSSL_ERR_MPI_BUFFER_TOO_SMALL MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL -#define POLARSSL_ERR_MPI_DIVISION_BY_ZERO MBEDTLS_ERR_MPI_DIVISION_BY_ZERO -#define POLARSSL_ERR_MPI_FILE_IO_ERROR MBEDTLS_ERR_MPI_FILE_IO_ERROR -#define POLARSSL_ERR_MPI_INVALID_CHARACTER MBEDTLS_ERR_MPI_INVALID_CHARACTER -#define POLARSSL_ERR_MPI_MALLOC_FAILED MBEDTLS_ERR_MPI_ALLOC_FAILED -#define POLARSSL_ERR_MPI_NEGATIVE_VALUE MBEDTLS_ERR_MPI_NEGATIVE_VALUE -#define POLARSSL_ERR_MPI_NOT_ACCEPTABLE MBEDTLS_ERR_MPI_NOT_ACCEPTABLE -#define POLARSSL_ERR_NET_ACCEPT_FAILED MBEDTLS_ERR_NET_ACCEPT_FAILED -#define POLARSSL_ERR_NET_BIND_FAILED MBEDTLS_ERR_NET_BIND_FAILED -#define POLARSSL_ERR_NET_CONNECT_FAILED MBEDTLS_ERR_NET_CONNECT_FAILED -#define POLARSSL_ERR_NET_CONN_RESET MBEDTLS_ERR_NET_CONN_RESET -#define POLARSSL_ERR_NET_LISTEN_FAILED MBEDTLS_ERR_NET_LISTEN_FAILED -#define POLARSSL_ERR_NET_RECV_FAILED MBEDTLS_ERR_NET_RECV_FAILED -#define POLARSSL_ERR_NET_SEND_FAILED MBEDTLS_ERR_NET_SEND_FAILED -#define POLARSSL_ERR_NET_SOCKET_FAILED MBEDTLS_ERR_NET_SOCKET_FAILED -#define POLARSSL_ERR_NET_TIMEOUT MBEDTLS_ERR_SSL_TIMEOUT -#define POLARSSL_ERR_NET_UNKNOWN_HOST MBEDTLS_ERR_NET_UNKNOWN_HOST -#define POLARSSL_ERR_NET_WANT_READ MBEDTLS_ERR_SSL_WANT_READ -#define POLARSSL_ERR_NET_WANT_WRITE MBEDTLS_ERR_SSL_WANT_WRITE -#define POLARSSL_ERR_OID_BUF_TOO_SMALL MBEDTLS_ERR_OID_BUF_TOO_SMALL -#define POLARSSL_ERR_OID_NOT_FOUND MBEDTLS_ERR_OID_NOT_FOUND -#define POLARSSL_ERR_PADLOCK_DATA_MISALIGNED MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -#define POLARSSL_ERR_PEM_BAD_INPUT_DATA MBEDTLS_ERR_PEM_BAD_INPUT_DATA -#define POLARSSL_ERR_PEM_FEATURE_UNAVAILABLE MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_PEM_INVALID_DATA MBEDTLS_ERR_PEM_INVALID_DATA -#define POLARSSL_ERR_PEM_INVALID_ENC_IV MBEDTLS_ERR_PEM_INVALID_ENC_IV -#define POLARSSL_ERR_PEM_MALLOC_FAILED MBEDTLS_ERR_PEM_ALLOC_FAILED -#define POLARSSL_ERR_PEM_NO_HEADER_FOOTER_PRESENT MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT -#define POLARSSL_ERR_PEM_PASSWORD_MISMATCH MBEDTLS_ERR_PEM_PASSWORD_MISMATCH -#define POLARSSL_ERR_PEM_PASSWORD_REQUIRED MBEDTLS_ERR_PEM_PASSWORD_REQUIRED -#define POLARSSL_ERR_PEM_UNKNOWN_ENC_ALG MBEDTLS_ERR_PEM_UNKNOWN_ENC_ALG -#define POLARSSL_ERR_PKCS12_BAD_INPUT_DATA MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -#define POLARSSL_ERR_PKCS12_FEATURE_UNAVAILABLE MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_PKCS12_PASSWORD_MISMATCH MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH -#define POLARSSL_ERR_PKCS12_PBE_INVALID_FORMAT MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT -#define POLARSSL_ERR_PKCS5_BAD_INPUT_DATA MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -#define POLARSSL_ERR_PKCS5_FEATURE_UNAVAILABLE MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_PKCS5_INVALID_FORMAT MBEDTLS_ERR_PKCS5_INVALID_FORMAT -#define POLARSSL_ERR_PKCS5_PASSWORD_MISMATCH MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH -#define POLARSSL_ERR_PK_BAD_INPUT_DATA MBEDTLS_ERR_PK_BAD_INPUT_DATA -#define POLARSSL_ERR_PK_FEATURE_UNAVAILABLE MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_PK_FILE_IO_ERROR MBEDTLS_ERR_PK_FILE_IO_ERROR -#define POLARSSL_ERR_PK_INVALID_ALG MBEDTLS_ERR_PK_INVALID_ALG -#define POLARSSL_ERR_PK_INVALID_PUBKEY MBEDTLS_ERR_PK_INVALID_PUBKEY -#define POLARSSL_ERR_PK_KEY_INVALID_FORMAT MBEDTLS_ERR_PK_KEY_INVALID_FORMAT -#define POLARSSL_ERR_PK_KEY_INVALID_VERSION MBEDTLS_ERR_PK_KEY_INVALID_VERSION -#define POLARSSL_ERR_PK_MALLOC_FAILED MBEDTLS_ERR_PK_ALLOC_FAILED -#define POLARSSL_ERR_PK_PASSWORD_MISMATCH MBEDTLS_ERR_PK_PASSWORD_MISMATCH -#define POLARSSL_ERR_PK_PASSWORD_REQUIRED MBEDTLS_ERR_PK_PASSWORD_REQUIRED -#define POLARSSL_ERR_PK_SIG_LEN_MISMATCH MBEDTLS_ERR_PK_SIG_LEN_MISMATCH -#define POLARSSL_ERR_PK_TYPE_MISMATCH MBEDTLS_ERR_PK_TYPE_MISMATCH -#define POLARSSL_ERR_PK_UNKNOWN_NAMED_CURVE MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE -#define POLARSSL_ERR_PK_UNKNOWN_PK_ALG MBEDTLS_ERR_PK_UNKNOWN_PK_ALG -#define POLARSSL_ERR_RSA_BAD_INPUT_DATA MBEDTLS_ERR_RSA_BAD_INPUT_DATA -#define POLARSSL_ERR_RSA_INVALID_PADDING MBEDTLS_ERR_RSA_INVALID_PADDING -#define POLARSSL_ERR_RSA_KEY_CHECK_FAILED MBEDTLS_ERR_RSA_KEY_CHECK_FAILED -#define POLARSSL_ERR_RSA_KEY_GEN_FAILED MBEDTLS_ERR_RSA_KEY_GEN_FAILED -#define POLARSSL_ERR_RSA_OUTPUT_TOO_LARGE MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE -#define POLARSSL_ERR_RSA_PRIVATE_FAILED MBEDTLS_ERR_RSA_PRIVATE_FAILED -#define POLARSSL_ERR_RSA_PUBLIC_FAILED MBEDTLS_ERR_RSA_PUBLIC_FAILED -#define POLARSSL_ERR_RSA_RNG_FAILED MBEDTLS_ERR_RSA_RNG_FAILED -#define POLARSSL_ERR_RSA_VERIFY_FAILED MBEDTLS_ERR_RSA_VERIFY_FAILED -#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE -#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST -#define POLARSSL_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY -#define POLARSSL_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC -#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_HELLO MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO -#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE -#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS -#define POLARSSL_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP -#define POLARSSL_ERR_SSL_BAD_HS_FINISHED MBEDTLS_ERR_SSL_BAD_HS_FINISHED -#define POLARSSL_ERR_SSL_BAD_HS_NEW_SESSION_TICKET MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET -#define POLARSSL_ERR_SSL_BAD_HS_PROTOCOL_VERSION MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION -#define POLARSSL_ERR_SSL_BAD_HS_SERVER_HELLO MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO -#define POLARSSL_ERR_SSL_BAD_HS_SERVER_HELLO_DONE MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE -#define POLARSSL_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE -#define POLARSSL_ERR_SSL_BAD_INPUT_DATA MBEDTLS_ERR_SSL_BAD_INPUT_DATA -#define POLARSSL_ERR_SSL_BUFFER_TOO_SMALL MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL -#define POLARSSL_ERR_SSL_CA_CHAIN_REQUIRED MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED -#define POLARSSL_ERR_SSL_CERTIFICATE_REQUIRED MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED -#define POLARSSL_ERR_SSL_CERTIFICATE_TOO_LARGE MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE -#define POLARSSL_ERR_SSL_COMPRESSION_FAILED MBEDTLS_ERR_SSL_COMPRESSION_FAILED -#define POLARSSL_ERR_SSL_CONN_EOF MBEDTLS_ERR_SSL_CONN_EOF -#define POLARSSL_ERR_SSL_COUNTER_WRAPPING MBEDTLS_ERR_SSL_COUNTER_WRAPPING -#define POLARSSL_ERR_SSL_FATAL_ALERT_MESSAGE MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE -#define POLARSSL_ERR_SSL_FEATURE_UNAVAILABLE MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_SSL_HELLO_VERIFY_REQUIRED MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED -#define POLARSSL_ERR_SSL_HW_ACCEL_FAILED MBEDTLS_ERR_SSL_HW_ACCEL_FAILED -#define POLARSSL_ERR_SSL_HW_ACCEL_FALLTHROUGH MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH -#define POLARSSL_ERR_SSL_INTERNAL_ERROR MBEDTLS_ERR_SSL_INTERNAL_ERROR -#define POLARSSL_ERR_SSL_INVALID_MAC MBEDTLS_ERR_SSL_INVALID_MAC -#define POLARSSL_ERR_SSL_INVALID_RECORD MBEDTLS_ERR_SSL_INVALID_RECORD -#define POLARSSL_ERR_SSL_MALLOC_FAILED MBEDTLS_ERR_SSL_ALLOC_FAILED -#define POLARSSL_ERR_SSL_NO_CIPHER_CHOSEN MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN -#define POLARSSL_ERR_SSL_NO_CLIENT_CERTIFICATE MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE -#define POLARSSL_ERR_SSL_NO_RNG MBEDTLS_ERR_SSL_NO_RNG -#define POLARSSL_ERR_SSL_NO_USABLE_CIPHERSUITE MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE -#define POLARSSL_ERR_SSL_PEER_CLOSE_NOTIFY MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY -#define POLARSSL_ERR_SSL_PEER_VERIFY_FAILED MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED -#define POLARSSL_ERR_SSL_PK_TYPE_MISMATCH MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH -#define POLARSSL_ERR_SSL_PRIVATE_KEY_REQUIRED MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED -#define POLARSSL_ERR_SSL_SESSION_TICKET_EXPIRED MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED -#define POLARSSL_ERR_SSL_UNEXPECTED_MESSAGE MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE -#define POLARSSL_ERR_SSL_UNKNOWN_CIPHER MBEDTLS_ERR_SSL_UNKNOWN_CIPHER -#define POLARSSL_ERR_SSL_UNKNOWN_IDENTITY MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY -#define POLARSSL_ERR_SSL_WAITING_SERVER_HELLO_RENEGO MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO -#define POLARSSL_ERR_THREADING_BAD_INPUT_DATA MBEDTLS_ERR_THREADING_BAD_INPUT_DATA -#define POLARSSL_ERR_THREADING_FEATURE_UNAVAILABLE MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_THREADING_MUTEX_ERROR MBEDTLS_ERR_THREADING_MUTEX_ERROR -#define POLARSSL_ERR_X509_BAD_INPUT_DATA MBEDTLS_ERR_X509_BAD_INPUT_DATA -#define POLARSSL_ERR_X509_CERT_UNKNOWN_FORMAT MBEDTLS_ERR_X509_CERT_UNKNOWN_FORMAT -#define POLARSSL_ERR_X509_CERT_VERIFY_FAILED MBEDTLS_ERR_X509_CERT_VERIFY_FAILED -#define POLARSSL_ERR_X509_FEATURE_UNAVAILABLE MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE -#define POLARSSL_ERR_X509_FILE_IO_ERROR MBEDTLS_ERR_X509_FILE_IO_ERROR -#define POLARSSL_ERR_X509_INVALID_ALG MBEDTLS_ERR_X509_INVALID_ALG -#define POLARSSL_ERR_X509_INVALID_DATE MBEDTLS_ERR_X509_INVALID_DATE -#define POLARSSL_ERR_X509_INVALID_EXTENSIONS MBEDTLS_ERR_X509_INVALID_EXTENSIONS -#define POLARSSL_ERR_X509_INVALID_FORMAT MBEDTLS_ERR_X509_INVALID_FORMAT -#define POLARSSL_ERR_X509_INVALID_NAME MBEDTLS_ERR_X509_INVALID_NAME -#define POLARSSL_ERR_X509_INVALID_SERIAL MBEDTLS_ERR_X509_INVALID_SERIAL -#define POLARSSL_ERR_X509_INVALID_SIGNATURE MBEDTLS_ERR_X509_INVALID_SIGNATURE -#define POLARSSL_ERR_X509_INVALID_VERSION MBEDTLS_ERR_X509_INVALID_VERSION -#define POLARSSL_ERR_X509_MALLOC_FAILED MBEDTLS_ERR_X509_ALLOC_FAILED -#define POLARSSL_ERR_X509_SIG_MISMATCH MBEDTLS_ERR_X509_SIG_MISMATCH -#define POLARSSL_ERR_X509_UNKNOWN_OID MBEDTLS_ERR_X509_UNKNOWN_OID -#define POLARSSL_ERR_X509_UNKNOWN_SIG_ALG MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG -#define POLARSSL_ERR_X509_UNKNOWN_VERSION MBEDTLS_ERR_X509_UNKNOWN_VERSION -#define POLARSSL_ERR_XTEA_INVALID_INPUT_LENGTH MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH -#define POLARSSL_GCM_H MBEDTLS_GCM_H -#define POLARSSL_HAVEGE_H MBEDTLS_HAVEGE_H -#define POLARSSL_HAVE_INT32 MBEDTLS_HAVE_INT32 -#define POLARSSL_HAVE_INT64 MBEDTLS_HAVE_INT64 -#define POLARSSL_HAVE_UDBL MBEDTLS_HAVE_UDBL -#define POLARSSL_HAVE_X86 MBEDTLS_HAVE_X86 -#define POLARSSL_HAVE_X86_64 MBEDTLS_HAVE_X86_64 -#define POLARSSL_HMAC_DRBG_H MBEDTLS_HMAC_DRBG_H -#define POLARSSL_HMAC_DRBG_PR_OFF MBEDTLS_HMAC_DRBG_PR_OFF -#define POLARSSL_HMAC_DRBG_PR_ON MBEDTLS_HMAC_DRBG_PR_ON -#define POLARSSL_KEY_EXCHANGE_DHE_PSK MBEDTLS_KEY_EXCHANGE_DHE_PSK -#define POLARSSL_KEY_EXCHANGE_DHE_RSA MBEDTLS_KEY_EXCHANGE_DHE_RSA -#define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA -#define POLARSSL_KEY_EXCHANGE_ECDHE_PSK MBEDTLS_KEY_EXCHANGE_ECDHE_PSK -#define POLARSSL_KEY_EXCHANGE_ECDHE_RSA MBEDTLS_KEY_EXCHANGE_ECDHE_RSA -#define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA -#define POLARSSL_KEY_EXCHANGE_ECDH_RSA MBEDTLS_KEY_EXCHANGE_ECDH_RSA -#define POLARSSL_KEY_EXCHANGE_NONE MBEDTLS_KEY_EXCHANGE_NONE -#define POLARSSL_KEY_EXCHANGE_PSK MBEDTLS_KEY_EXCHANGE_PSK -#define POLARSSL_KEY_EXCHANGE_RSA MBEDTLS_KEY_EXCHANGE_RSA -#define POLARSSL_KEY_EXCHANGE_RSA_PSK MBEDTLS_KEY_EXCHANGE_RSA_PSK -#define POLARSSL_KEY_EXCHANGE__SOME__ECDHE_ENABLED MBEDTLS_KEY_EXCHANGE_SOME_ECDHE_ENABLED -#define POLARSSL_KEY_EXCHANGE__SOME__PSK_ENABLED MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED -#define POLARSSL_KEY_EXCHANGE__WITH_CERT__ENABLED MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED -#define POLARSSL_KEY_LENGTH_DES MBEDTLS_KEY_LENGTH_DES -#define POLARSSL_KEY_LENGTH_DES_EDE MBEDTLS_KEY_LENGTH_DES_EDE -#define POLARSSL_KEY_LENGTH_DES_EDE3 MBEDTLS_KEY_LENGTH_DES_EDE3 -#define POLARSSL_KEY_LENGTH_NONE MBEDTLS_KEY_LENGTH_NONE -#define POLARSSL_MAX_BLOCK_LENGTH MBEDTLS_MAX_BLOCK_LENGTH -#define POLARSSL_MAX_IV_LENGTH MBEDTLS_MAX_IV_LENGTH -#define POLARSSL_MD2_H MBEDTLS_MD2_H -#define POLARSSL_MD4_H MBEDTLS_MD4_H -#define POLARSSL_MD5_H MBEDTLS_MD5_H -#define POLARSSL_MD_H MBEDTLS_MD_H -#define POLARSSL_MD_MAX_SIZE MBEDTLS_MD_MAX_SIZE -#define POLARSSL_MD_MD2 MBEDTLS_MD_MD2 -#define POLARSSL_MD_MD4 MBEDTLS_MD_MD4 -#define POLARSSL_MD_MD5 MBEDTLS_MD_MD5 -#define POLARSSL_MD_NONE MBEDTLS_MD_NONE -#define POLARSSL_MD_RIPEMD160 MBEDTLS_MD_RIPEMD160 -#define POLARSSL_MD_SHA1 MBEDTLS_MD_SHA1 -#define POLARSSL_MD_SHA224 MBEDTLS_MD_SHA224 -#define POLARSSL_MD_SHA256 MBEDTLS_MD_SHA256 -#define POLARSSL_MD_SHA384 MBEDTLS_MD_SHA384 -#define POLARSSL_MD_SHA512 MBEDTLS_MD_SHA512 -#define POLARSSL_MD_WRAP_H MBEDTLS_MD_WRAP_H -#define POLARSSL_MEMORY_BUFFER_ALLOC_H MBEDTLS_MEMORY_BUFFER_ALLOC_H -#define POLARSSL_MODE_CBC MBEDTLS_MODE_CBC -#define POLARSSL_MODE_CCM MBEDTLS_MODE_CCM -#define POLARSSL_MODE_CFB MBEDTLS_MODE_CFB -#define POLARSSL_MODE_CTR MBEDTLS_MODE_CTR -#define POLARSSL_MODE_ECB MBEDTLS_MODE_ECB -#define POLARSSL_MODE_GCM MBEDTLS_MODE_GCM -#define POLARSSL_MODE_NONE MBEDTLS_MODE_NONE -#define POLARSSL_MODE_OFB MBEDTLS_MODE_OFB -#define POLARSSL_MODE_STREAM MBEDTLS_MODE_STREAM -#define POLARSSL_MPI_MAX_BITS MBEDTLS_MPI_MAX_BITS -#define POLARSSL_MPI_MAX_BITS_SCALE100 MBEDTLS_MPI_MAX_BITS_SCALE100 -#define POLARSSL_MPI_MAX_LIMBS MBEDTLS_MPI_MAX_LIMBS -#define POLARSSL_MPI_RW_BUFFER_SIZE MBEDTLS_MPI_RW_BUFFER_SIZE -#define POLARSSL_NET_H MBEDTLS_NET_SOCKETS_H -#define POLARSSL_NET_LISTEN_BACKLOG MBEDTLS_NET_LISTEN_BACKLOG -#define POLARSSL_OID_H MBEDTLS_OID_H -#define POLARSSL_OPERATION_NONE MBEDTLS_OPERATION_NONE -#define POLARSSL_PADDING_NONE MBEDTLS_PADDING_NONE -#define POLARSSL_PADDING_ONE_AND_ZEROS MBEDTLS_PADDING_ONE_AND_ZEROS -#define POLARSSL_PADDING_PKCS7 MBEDTLS_PADDING_PKCS7 -#define POLARSSL_PADDING_ZEROS MBEDTLS_PADDING_ZEROS -#define POLARSSL_PADDING_ZEROS_AND_LEN MBEDTLS_PADDING_ZEROS_AND_LEN -#define POLARSSL_PADLOCK_H MBEDTLS_PADLOCK_H -#define POLARSSL_PEM_H MBEDTLS_PEM_H -#define POLARSSL_PKCS11_H MBEDTLS_PKCS11_H -#define POLARSSL_PKCS12_H MBEDTLS_PKCS12_H -#define POLARSSL_PKCS5_H MBEDTLS_PKCS5_H -#define POLARSSL_PK_DEBUG_ECP MBEDTLS_PK_DEBUG_ECP -#define POLARSSL_PK_DEBUG_MAX_ITEMS MBEDTLS_PK_DEBUG_MAX_ITEMS -#define POLARSSL_PK_DEBUG_MPI MBEDTLS_PK_DEBUG_MPI -#define POLARSSL_PK_DEBUG_NONE MBEDTLS_PK_DEBUG_NONE -#define POLARSSL_PK_ECDSA MBEDTLS_PK_ECDSA -#define POLARSSL_PK_ECKEY MBEDTLS_PK_ECKEY -#define POLARSSL_PK_ECKEY_DH MBEDTLS_PK_ECKEY_DH -#define POLARSSL_PK_H MBEDTLS_PK_H -#define POLARSSL_PK_NONE MBEDTLS_PK_NONE -#define POLARSSL_PK_RSA MBEDTLS_PK_RSA -#define POLARSSL_PK_RSASSA_PSS MBEDTLS_PK_RSASSA_PSS -#define POLARSSL_PK_RSA_ALT MBEDTLS_PK_RSA_ALT -#define POLARSSL_PK_WRAP_H MBEDTLS_PK_WRAP_H -#define POLARSSL_PLATFORM_H MBEDTLS_PLATFORM_H -#define POLARSSL_PREMASTER_SIZE MBEDTLS_PREMASTER_SIZE -#define POLARSSL_RIPEMD160_H MBEDTLS_RIPEMD160_H -#define POLARSSL_RSA_H MBEDTLS_RSA_H -#define POLARSSL_SHA1_H MBEDTLS_SHA1_H -#define POLARSSL_SHA256_H MBEDTLS_SHA256_H -#define POLARSSL_SHA512_H MBEDTLS_SHA512_H -#define POLARSSL_SSL_CACHE_H MBEDTLS_SSL_CACHE_H -#define POLARSSL_SSL_CIPHERSUITES_H MBEDTLS_SSL_CIPHERSUITES_H -#define POLARSSL_SSL_COOKIE_H MBEDTLS_SSL_COOKIE_H -#define POLARSSL_SSL_H MBEDTLS_SSL_H -#define POLARSSL_THREADING_H MBEDTLS_THREADING_H -#define POLARSSL_THREADING_IMPL MBEDTLS_THREADING_IMPL -#define POLARSSL_TIMING_H MBEDTLS_TIMING_H -#define POLARSSL_VERSION_H MBEDTLS_VERSION_H -#define POLARSSL_VERSION_MAJOR MBEDTLS_VERSION_MAJOR -#define POLARSSL_VERSION_MINOR MBEDTLS_VERSION_MINOR -#define POLARSSL_VERSION_NUMBER MBEDTLS_VERSION_NUMBER -#define POLARSSL_VERSION_PATCH MBEDTLS_VERSION_PATCH -#define POLARSSL_VERSION_STRING MBEDTLS_VERSION_STRING -#define POLARSSL_VERSION_STRING_FULL MBEDTLS_VERSION_STRING_FULL -#define POLARSSL_X509_CRL_H MBEDTLS_X509_CRL_H -#define POLARSSL_X509_CRT_H MBEDTLS_X509_CRT_H -#define POLARSSL_X509_CSR_H MBEDTLS_X509_CSR_H -#define POLARSSL_X509_H MBEDTLS_X509_H -#define POLARSSL_XTEA_H MBEDTLS_XTEA_H -#define RSA_CRYPT MBEDTLS_RSA_CRYPT -#define RSA_PKCS_V15 MBEDTLS_RSA_PKCS_V15 -#define RSA_PKCS_V21 MBEDTLS_RSA_PKCS_V21 -#define RSA_PRIVATE MBEDTLS_RSA_PRIVATE -#define RSA_PUBLIC MBEDTLS_RSA_PUBLIC -#define RSA_SALT_LEN_ANY MBEDTLS_RSA_SALT_LEN_ANY -#define RSA_SIGN MBEDTLS_RSA_SIGN -#define SSL_ALERT_LEVEL_FATAL MBEDTLS_SSL_ALERT_LEVEL_FATAL -#define SSL_ALERT_LEVEL_WARNING MBEDTLS_SSL_ALERT_LEVEL_WARNING -#define SSL_ALERT_MSG_ACCESS_DENIED MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED -#define SSL_ALERT_MSG_BAD_CERT MBEDTLS_SSL_ALERT_MSG_BAD_CERT -#define SSL_ALERT_MSG_BAD_RECORD_MAC MBEDTLS_SSL_ALERT_MSG_BAD_RECORD_MAC -#define SSL_ALERT_MSG_CERT_EXPIRED MBEDTLS_SSL_ALERT_MSG_CERT_EXPIRED -#define SSL_ALERT_MSG_CERT_REVOKED MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED -#define SSL_ALERT_MSG_CERT_UNKNOWN MBEDTLS_SSL_ALERT_MSG_CERT_UNKNOWN -#define SSL_ALERT_MSG_CLOSE_NOTIFY MBEDTLS_SSL_ALERT_MSG_CLOSE_NOTIFY -#define SSL_ALERT_MSG_DECODE_ERROR MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR -#define SSL_ALERT_MSG_DECOMPRESSION_FAILURE MBEDTLS_SSL_ALERT_MSG_DECOMPRESSION_FAILURE -#define SSL_ALERT_MSG_DECRYPTION_FAILED MBEDTLS_SSL_ALERT_MSG_DECRYPTION_FAILED -#define SSL_ALERT_MSG_DECRYPT_ERROR MBEDTLS_SSL_ALERT_MSG_DECRYPT_ERROR -#define SSL_ALERT_MSG_EXPORT_RESTRICTION MBEDTLS_SSL_ALERT_MSG_EXPORT_RESTRICTION -#define SSL_ALERT_MSG_HANDSHAKE_FAILURE MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE -#define SSL_ALERT_MSG_ILLEGAL_PARAMETER MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER -#define SSL_ALERT_MSG_INAPROPRIATE_FALLBACK MBEDTLS_SSL_ALERT_MSG_INAPROPRIATE_FALLBACK -#define SSL_ALERT_MSG_INSUFFICIENT_SECURITY MBEDTLS_SSL_ALERT_MSG_INSUFFICIENT_SECURITY -#define SSL_ALERT_MSG_INTERNAL_ERROR MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR -#define SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL MBEDTLS_SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL -#define SSL_ALERT_MSG_NO_CERT MBEDTLS_SSL_ALERT_MSG_NO_CERT -#define SSL_ALERT_MSG_NO_RENEGOTIATION MBEDTLS_SSL_ALERT_MSG_NO_RENEGOTIATION -#define SSL_ALERT_MSG_PROTOCOL_VERSION MBEDTLS_SSL_ALERT_MSG_PROTOCOL_VERSION -#define SSL_ALERT_MSG_RECORD_OVERFLOW MBEDTLS_SSL_ALERT_MSG_RECORD_OVERFLOW -#define SSL_ALERT_MSG_UNEXPECTED_MESSAGE MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE -#define SSL_ALERT_MSG_UNKNOWN_CA MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA -#define SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY MBEDTLS_SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY -#define SSL_ALERT_MSG_UNRECOGNIZED_NAME MBEDTLS_SSL_ALERT_MSG_UNRECOGNIZED_NAME -#define SSL_ALERT_MSG_UNSUPPORTED_CERT MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT -#define SSL_ALERT_MSG_UNSUPPORTED_EXT MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_EXT -#define SSL_ALERT_MSG_USER_CANCELED MBEDTLS_SSL_ALERT_MSG_USER_CANCELED -#define SSL_ANTI_REPLAY_DISABLED MBEDTLS_SSL_ANTI_REPLAY_DISABLED -#define SSL_ANTI_REPLAY_ENABLED MBEDTLS_SSL_ANTI_REPLAY_ENABLED -#define SSL_ARC4_DISABLED MBEDTLS_SSL_ARC4_DISABLED -#define SSL_ARC4_ENABLED MBEDTLS_SSL_ARC4_ENABLED -#define SSL_BUFFER_LEN ( ( ( MBEDTLS_SSL_IN_BUFFER_LEN ) < ( MBEDTLS_SSL_OUT_BUFFER_LEN ) ) \ - ? ( MBEDTLS_SSL_IN_BUFFER_LEN ) : ( MBEDTLS_SSL_OUT_BUFFER_LEN ) ) -#define SSL_CACHE_DEFAULT_MAX_ENTRIES MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES -#define SSL_CACHE_DEFAULT_TIMEOUT MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT -#define SSL_CBC_RECORD_SPLITTING_DISABLED MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED -#define SSL_CBC_RECORD_SPLITTING_ENABLED MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED -#define SSL_CERTIFICATE_REQUEST MBEDTLS_SSL_CERTIFICATE_REQUEST -#define SSL_CERTIFICATE_VERIFY MBEDTLS_SSL_CERTIFICATE_VERIFY -#define SSL_CERT_TYPE_ECDSA_SIGN MBEDTLS_SSL_CERT_TYPE_ECDSA_SIGN -#define SSL_CERT_TYPE_RSA_SIGN MBEDTLS_SSL_CERT_TYPE_RSA_SIGN -#define SSL_CHANNEL_INBOUND MBEDTLS_SSL_CHANNEL_INBOUND -#define SSL_CHANNEL_OUTBOUND MBEDTLS_SSL_CHANNEL_OUTBOUND -#define SSL_CIPHERSUITES MBEDTLS_SSL_CIPHERSUITES -#define SSL_CLIENT_CERTIFICATE MBEDTLS_SSL_CLIENT_CERTIFICATE -#define SSL_CLIENT_CHANGE_CIPHER_SPEC MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC -#define SSL_CLIENT_FINISHED MBEDTLS_SSL_CLIENT_FINISHED -#define SSL_CLIENT_HELLO MBEDTLS_SSL_CLIENT_HELLO -#define SSL_CLIENT_KEY_EXCHANGE MBEDTLS_SSL_CLIENT_KEY_EXCHANGE -#define SSL_COMPRESSION_ADD MBEDTLS_SSL_COMPRESSION_ADD -#define SSL_COMPRESS_DEFLATE MBEDTLS_SSL_COMPRESS_DEFLATE -#define SSL_COMPRESS_NULL MBEDTLS_SSL_COMPRESS_NULL -#define SSL_DEBUG_BUF MBEDTLS_SSL_DEBUG_BUF -#define SSL_DEBUG_CRT MBEDTLS_SSL_DEBUG_CRT -#define SSL_DEBUG_ECP MBEDTLS_SSL_DEBUG_ECP -#define SSL_DEBUG_MPI MBEDTLS_SSL_DEBUG_MPI -#define SSL_DEBUG_MSG MBEDTLS_SSL_DEBUG_MSG -#define SSL_DEBUG_RET MBEDTLS_SSL_DEBUG_RET -#define SSL_DEFAULT_TICKET_LIFETIME MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME -#define SSL_DTLS_TIMEOUT_DFL_MAX MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MAX -#define SSL_DTLS_TIMEOUT_DFL_MIN MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MIN -#define SSL_EMPTY_RENEGOTIATION_INFO MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO -#define SSL_ETM_DISABLED MBEDTLS_SSL_ETM_DISABLED -#define SSL_ETM_ENABLED MBEDTLS_SSL_ETM_ENABLED -#define SSL_EXTENDED_MS_DISABLED MBEDTLS_SSL_EXTENDED_MS_DISABLED -#define SSL_EXTENDED_MS_ENABLED MBEDTLS_SSL_EXTENDED_MS_ENABLED -#define SSL_FALLBACK_SCSV MBEDTLS_SSL_FALLBACK_SCSV -#define SSL_FLUSH_BUFFERS MBEDTLS_SSL_FLUSH_BUFFERS -#define SSL_HANDSHAKE_OVER MBEDTLS_SSL_HANDSHAKE_OVER -#define SSL_HANDSHAKE_WRAPUP MBEDTLS_SSL_HANDSHAKE_WRAPUP -#define SSL_HASH_MD5 MBEDTLS_SSL_HASH_MD5 -#define SSL_HASH_NONE MBEDTLS_SSL_HASH_NONE -#define SSL_HASH_SHA1 MBEDTLS_SSL_HASH_SHA1 -#define SSL_HASH_SHA224 MBEDTLS_SSL_HASH_SHA224 -#define SSL_HASH_SHA256 MBEDTLS_SSL_HASH_SHA256 -#define SSL_HASH_SHA384 MBEDTLS_SSL_HASH_SHA384 -#define SSL_HASH_SHA512 MBEDTLS_SSL_HASH_SHA512 -#define SSL_HELLO_REQUEST MBEDTLS_SSL_HELLO_REQUEST -#define SSL_HS_CERTIFICATE MBEDTLS_SSL_HS_CERTIFICATE -#define SSL_HS_CERTIFICATE_REQUEST MBEDTLS_SSL_HS_CERTIFICATE_REQUEST -#define SSL_HS_CERTIFICATE_VERIFY MBEDTLS_SSL_HS_CERTIFICATE_VERIFY -#define SSL_HS_CLIENT_HELLO MBEDTLS_SSL_HS_CLIENT_HELLO -#define SSL_HS_CLIENT_KEY_EXCHANGE MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE -#define SSL_HS_FINISHED MBEDTLS_SSL_HS_FINISHED -#define SSL_HS_HELLO_REQUEST MBEDTLS_SSL_HS_HELLO_REQUEST -#define SSL_HS_HELLO_VERIFY_REQUEST MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST -#define SSL_HS_NEW_SESSION_TICKET MBEDTLS_SSL_HS_NEW_SESSION_TICKET -#define SSL_HS_SERVER_HELLO MBEDTLS_SSL_HS_SERVER_HELLO -#define SSL_HS_SERVER_HELLO_DONE MBEDTLS_SSL_HS_SERVER_HELLO_DONE -#define SSL_HS_SERVER_KEY_EXCHANGE MBEDTLS_SSL_HS_SERVER_KEY_EXCHANGE -#define SSL_INITIAL_HANDSHAKE MBEDTLS_SSL_INITIAL_HANDSHAKE -#define SSL_IS_CLIENT MBEDTLS_SSL_IS_CLIENT -#define SSL_IS_FALLBACK MBEDTLS_SSL_IS_FALLBACK -#define SSL_IS_NOT_FALLBACK MBEDTLS_SSL_IS_NOT_FALLBACK -#define SSL_IS_SERVER MBEDTLS_SSL_IS_SERVER -#define SSL_LEGACY_ALLOW_RENEGOTIATION MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION -#define SSL_LEGACY_BREAK_HANDSHAKE MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE -#define SSL_LEGACY_NO_RENEGOTIATION MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION -#define SSL_LEGACY_RENEGOTIATION MBEDTLS_SSL_LEGACY_RENEGOTIATION -#define SSL_MAC_ADD MBEDTLS_SSL_MAC_ADD -#define SSL_MAJOR_VERSION_3 MBEDTLS_SSL_MAJOR_VERSION_3 -#define SSL_MAX_CONTENT_LEN MBEDTLS_SSL_MAX_CONTENT_LEN -#define SSL_MAX_FRAG_LEN_1024 MBEDTLS_SSL_MAX_FRAG_LEN_1024 -#define SSL_MAX_FRAG_LEN_2048 MBEDTLS_SSL_MAX_FRAG_LEN_2048 -#define SSL_MAX_FRAG_LEN_4096 MBEDTLS_SSL_MAX_FRAG_LEN_4096 -#define SSL_MAX_FRAG_LEN_512 MBEDTLS_SSL_MAX_FRAG_LEN_512 -#define SSL_MAX_FRAG_LEN_INVALID MBEDTLS_SSL_MAX_FRAG_LEN_INVALID -#define SSL_MAX_FRAG_LEN_NONE MBEDTLS_SSL_MAX_FRAG_LEN_NONE -#define SSL_MAX_MAJOR_VERSION MBEDTLS_SSL_MAX_MAJOR_VERSION -#define SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MAX_MINOR_VERSION -#define SSL_MINOR_VERSION_0 MBEDTLS_SSL_MINOR_VERSION_0 -#define SSL_MINOR_VERSION_1 MBEDTLS_SSL_MINOR_VERSION_1 -#define SSL_MINOR_VERSION_2 MBEDTLS_SSL_MINOR_VERSION_2 -#define SSL_MINOR_VERSION_3 MBEDTLS_SSL_MINOR_VERSION_3 -#define SSL_MIN_MAJOR_VERSION MBEDTLS_SSL_MIN_MAJOR_VERSION -#define SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MIN_MINOR_VERSION -#define SSL_MSG_ALERT MBEDTLS_SSL_MSG_ALERT -#define SSL_MSG_APPLICATION_DATA MBEDTLS_SSL_MSG_APPLICATION_DATA -#define SSL_MSG_CHANGE_CIPHER_SPEC MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC -#define SSL_MSG_HANDSHAKE MBEDTLS_SSL_MSG_HANDSHAKE -#define SSL_PADDING_ADD MBEDTLS_SSL_PADDING_ADD -#define SSL_RENEGOTIATION MBEDTLS_SSL_RENEGOTIATION -#define SSL_RENEGOTIATION_DISABLED MBEDTLS_SSL_RENEGOTIATION_DISABLED -#define SSL_RENEGOTIATION_DONE MBEDTLS_SSL_RENEGOTIATION_DONE -#define SSL_RENEGOTIATION_ENABLED MBEDTLS_SSL_RENEGOTIATION_ENABLED -#define SSL_RENEGOTIATION_NOT_ENFORCED MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED -#define SSL_RENEGOTIATION_PENDING MBEDTLS_SSL_RENEGOTIATION_PENDING -#define SSL_RENEGO_MAX_RECORDS_DEFAULT MBEDTLS_SSL_RENEGO_MAX_RECORDS_DEFAULT -#define SSL_RETRANS_FINISHED MBEDTLS_SSL_RETRANS_FINISHED -#define SSL_RETRANS_PREPARING MBEDTLS_SSL_RETRANS_PREPARING -#define SSL_RETRANS_SENDING MBEDTLS_SSL_RETRANS_SENDING -#define SSL_RETRANS_WAITING MBEDTLS_SSL_RETRANS_WAITING -#define SSL_SECURE_RENEGOTIATION MBEDTLS_SSL_SECURE_RENEGOTIATION -#define SSL_SERVER_CERTIFICATE MBEDTLS_SSL_SERVER_CERTIFICATE -#define SSL_SERVER_CHANGE_CIPHER_SPEC MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC -#define SSL_SERVER_FINISHED MBEDTLS_SSL_SERVER_FINISHED -#define SSL_SERVER_HELLO MBEDTLS_SSL_SERVER_HELLO -#define SSL_SERVER_HELLO_DONE MBEDTLS_SSL_SERVER_HELLO_DONE -#define SSL_SERVER_HELLO_VERIFY_REQUEST_SENT MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT -#define SSL_SERVER_KEY_EXCHANGE MBEDTLS_SSL_SERVER_KEY_EXCHANGE -#define SSL_SERVER_NEW_SESSION_TICKET MBEDTLS_SSL_SERVER_NEW_SESSION_TICKET -#define SSL_SESSION_TICKETS_DISABLED MBEDTLS_SSL_SESSION_TICKETS_DISABLED -#define SSL_SESSION_TICKETS_ENABLED MBEDTLS_SSL_SESSION_TICKETS_ENABLED -#define SSL_SIG_ANON MBEDTLS_SSL_SIG_ANON -#define SSL_SIG_ECDSA MBEDTLS_SSL_SIG_ECDSA -#define SSL_SIG_RSA MBEDTLS_SSL_SIG_RSA -#define SSL_TRANSPORT_DATAGRAM MBEDTLS_SSL_TRANSPORT_DATAGRAM -#define SSL_TRANSPORT_STREAM MBEDTLS_SSL_TRANSPORT_STREAM -#define SSL_TRUNCATED_HMAC_LEN MBEDTLS_SSL_TRUNCATED_HMAC_LEN -#define SSL_TRUNC_HMAC_DISABLED MBEDTLS_SSL_TRUNC_HMAC_DISABLED -#define SSL_TRUNC_HMAC_ENABLED MBEDTLS_SSL_TRUNC_HMAC_ENABLED -#define SSL_VERIFY_DATA_MAX_LEN MBEDTLS_SSL_VERIFY_DATA_MAX_LEN -#define SSL_VERIFY_NONE MBEDTLS_SSL_VERIFY_NONE -#define SSL_VERIFY_OPTIONAL MBEDTLS_SSL_VERIFY_OPTIONAL -#define SSL_VERIFY_REQUIRED MBEDTLS_SSL_VERIFY_REQUIRED -#define TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA -#define TLS_DHE_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA -#define TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 -#define TLS_DHE_PSK_WITH_AES_128_CCM MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM -#define TLS_DHE_PSK_WITH_AES_128_CCM_8 MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8 -#define TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 -#define TLS_DHE_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA -#define TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 -#define TLS_DHE_PSK_WITH_AES_256_CCM MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM -#define TLS_DHE_PSK_WITH_AES_256_CCM_8 MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8 -#define TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 -#define TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_DHE_PSK_WITH_NULL_SHA MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA -#define TLS_DHE_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 -#define TLS_DHE_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 -#define TLS_DHE_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA -#define TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA -#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA -#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 -#define TLS_DHE_RSA_WITH_AES_128_CCM MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM -#define TLS_DHE_RSA_WITH_AES_128_CCM_8 MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8 -#define TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 -#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA -#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 -#define TLS_DHE_RSA_WITH_AES_256_CCM MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM -#define TLS_DHE_RSA_WITH_AES_256_CCM_8 MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8 -#define TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 -#define TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA -#define TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA -#define TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 -#define TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_DHE_RSA_WITH_DES_CBC_SHA MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA -#define TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA -#define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA -#define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 -#define TLS_ECDHE_ECDSA_WITH_AES_128_CCM MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM -#define TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 -#define TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 -#define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA -#define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 -#define TLS_ECDHE_ECDSA_WITH_AES_256_CCM MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM -#define TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 -#define TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 -#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_ECDHE_ECDSA_WITH_NULL_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA -#define TLS_ECDHE_ECDSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA -#define TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA -#define TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA -#define TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 -#define TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA -#define TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 -#define TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_ECDHE_PSK_WITH_NULL_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA -#define TLS_ECDHE_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 -#define TLS_ECDHE_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 -#define TLS_ECDHE_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA -#define TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA -#define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA -#define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 -#define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 -#define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA -#define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 -#define TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 -#define TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_ECDHE_RSA_WITH_NULL_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA -#define TLS_ECDHE_RSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA -#define TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA -#define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA -#define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 -#define TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 -#define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA -#define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 -#define TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 -#define TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_ECDH_ECDSA_WITH_NULL_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA -#define TLS_ECDH_ECDSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA -#define TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA -#define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA -#define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 -#define TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 -#define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA -#define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 -#define TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 -#define TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_ECDH_RSA_WITH_NULL_SHA MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA -#define TLS_ECDH_RSA_WITH_RC4_128_SHA MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA -#define TLS_EXT_ALPN MBEDTLS_TLS_EXT_ALPN -#define TLS_EXT_ENCRYPT_THEN_MAC MBEDTLS_TLS_EXT_ENCRYPT_THEN_MAC -#define TLS_EXT_EXTENDED_MASTER_SECRET MBEDTLS_TLS_EXT_EXTENDED_MASTER_SECRET -#define TLS_EXT_MAX_FRAGMENT_LENGTH MBEDTLS_TLS_EXT_MAX_FRAGMENT_LENGTH -#define TLS_EXT_RENEGOTIATION_INFO MBEDTLS_TLS_EXT_RENEGOTIATION_INFO -#define TLS_EXT_SERVERNAME MBEDTLS_TLS_EXT_SERVERNAME -#define TLS_EXT_SERVERNAME_HOSTNAME MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME -#define TLS_EXT_SESSION_TICKET MBEDTLS_TLS_EXT_SESSION_TICKET -#define TLS_EXT_SIG_ALG MBEDTLS_TLS_EXT_SIG_ALG -#define TLS_EXT_SUPPORTED_ELLIPTIC_CURVES MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES -#define TLS_EXT_SUPPORTED_POINT_FORMATS MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS -#define TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT -#define TLS_EXT_TRUNCATED_HMAC MBEDTLS_TLS_EXT_TRUNCATED_HMAC -#define TLS_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA -#define TLS_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA -#define TLS_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 -#define TLS_PSK_WITH_AES_128_CCM MBEDTLS_TLS_PSK_WITH_AES_128_CCM -#define TLS_PSK_WITH_AES_128_CCM_8 MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 -#define TLS_PSK_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 -#define TLS_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA -#define TLS_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 -#define TLS_PSK_WITH_AES_256_CCM MBEDTLS_TLS_PSK_WITH_AES_256_CCM -#define TLS_PSK_WITH_AES_256_CCM_8 MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8 -#define TLS_PSK_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 -#define TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_PSK_WITH_NULL_SHA MBEDTLS_TLS_PSK_WITH_NULL_SHA -#define TLS_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_PSK_WITH_NULL_SHA256 -#define TLS_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_PSK_WITH_NULL_SHA384 -#define TLS_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_PSK_WITH_RC4_128_SHA -#define TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA -#define TLS_RSA_PSK_WITH_AES_128_CBC_SHA MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA -#define TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 -#define TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 -#define TLS_RSA_PSK_WITH_AES_256_CBC_SHA MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA -#define TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 -#define TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 -#define TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 -#define TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_RSA_PSK_WITH_NULL_SHA MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA -#define TLS_RSA_PSK_WITH_NULL_SHA256 MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 -#define TLS_RSA_PSK_WITH_NULL_SHA384 MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 -#define TLS_RSA_PSK_WITH_RC4_128_SHA MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA -#define TLS_RSA_WITH_3DES_EDE_CBC_SHA MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA -#define TLS_RSA_WITH_AES_128_CBC_SHA MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA -#define TLS_RSA_WITH_AES_128_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 -#define TLS_RSA_WITH_AES_128_CCM MBEDTLS_TLS_RSA_WITH_AES_128_CCM -#define TLS_RSA_WITH_AES_128_CCM_8 MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8 -#define TLS_RSA_WITH_AES_128_GCM_SHA256 MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 -#define TLS_RSA_WITH_AES_256_CBC_SHA MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA -#define TLS_RSA_WITH_AES_256_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 -#define TLS_RSA_WITH_AES_256_CCM MBEDTLS_TLS_RSA_WITH_AES_256_CCM -#define TLS_RSA_WITH_AES_256_CCM_8 MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8 -#define TLS_RSA_WITH_AES_256_GCM_SHA384 MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 -#define TLS_RSA_WITH_CAMELLIA_128_CBC_SHA MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA -#define TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 -#define TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 -#define TLS_RSA_WITH_CAMELLIA_256_CBC_SHA MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA -#define TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 -#define TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 -#define TLS_RSA_WITH_DES_CBC_SHA MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA -#define TLS_RSA_WITH_NULL_MD5 MBEDTLS_TLS_RSA_WITH_NULL_MD5 -#define TLS_RSA_WITH_NULL_SHA MBEDTLS_TLS_RSA_WITH_NULL_SHA -#define TLS_RSA_WITH_NULL_SHA256 MBEDTLS_TLS_RSA_WITH_NULL_SHA256 -#define TLS_RSA_WITH_RC4_128_MD5 MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 -#define TLS_RSA_WITH_RC4_128_SHA MBEDTLS_TLS_RSA_WITH_RC4_128_SHA -#define X509_CRT_VERSION_1 MBEDTLS_X509_CRT_VERSION_1 -#define X509_CRT_VERSION_2 MBEDTLS_X509_CRT_VERSION_2 -#define X509_CRT_VERSION_3 MBEDTLS_X509_CRT_VERSION_3 -#define X509_FORMAT_DER MBEDTLS_X509_FORMAT_DER -#define X509_FORMAT_PEM MBEDTLS_X509_FORMAT_PEM -#define X509_MAX_DN_NAME_SIZE MBEDTLS_X509_MAX_DN_NAME_SIZE -#define X509_RFC5280_MAX_SERIAL_LEN MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN -#define X509_RFC5280_UTC_TIME_LEN MBEDTLS_X509_RFC5280_UTC_TIME_LEN -#define XTEA_DECRYPT MBEDTLS_XTEA_DECRYPT -#define XTEA_ENCRYPT MBEDTLS_XTEA_ENCRYPT -#define _asn1_bitstring mbedtls_asn1_bitstring -#define _asn1_buf mbedtls_asn1_buf -#define _asn1_named_data mbedtls_asn1_named_data -#define _asn1_sequence mbedtls_asn1_sequence -#define _ssl_cache_context mbedtls_ssl_cache_context -#define _ssl_cache_entry mbedtls_ssl_cache_entry -#define _ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t -#define _ssl_context mbedtls_ssl_context -#define _ssl_flight_item mbedtls_ssl_flight_item -#define _ssl_handshake_params mbedtls_ssl_handshake_params -#define _ssl_key_cert mbedtls_ssl_key_cert -#define _ssl_premaster_secret mbedtls_ssl_premaster_secret -#define _ssl_session mbedtls_ssl_session -#define _ssl_transform mbedtls_ssl_transform -#define _x509_crl mbedtls_x509_crl -#define _x509_crl_entry mbedtls_x509_crl_entry -#define _x509_crt mbedtls_x509_crt -#define _x509_csr mbedtls_x509_csr -#define _x509_time mbedtls_x509_time -#define _x509write_cert mbedtls_x509write_cert -#define _x509write_csr mbedtls_x509write_csr -#define aes_context mbedtls_aes_context -#define aes_crypt_cbc mbedtls_aes_crypt_cbc -#define aes_crypt_cfb128 mbedtls_aes_crypt_cfb128 -#define aes_crypt_cfb8 mbedtls_aes_crypt_cfb8 -#define aes_crypt_ctr mbedtls_aes_crypt_ctr -#define aes_crypt_ecb mbedtls_aes_crypt_ecb -#define aes_free mbedtls_aes_free -#define aes_init mbedtls_aes_init -#define aes_self_test mbedtls_aes_self_test -#define aes_setkey_dec mbedtls_aes_setkey_dec -#define aes_setkey_enc mbedtls_aes_setkey_enc -#define aesni_crypt_ecb mbedtls_aesni_crypt_ecb -#define aesni_gcm_mult mbedtls_aesni_gcm_mult -#define aesni_inverse_key mbedtls_aesni_inverse_key -#define aesni_setkey_enc mbedtls_aesni_setkey_enc -#define aesni_supports mbedtls_aesni_has_support -#define alarmed mbedtls_timing_alarmed -#define arc4_context mbedtls_arc4_context -#define arc4_crypt mbedtls_arc4_crypt -#define arc4_free mbedtls_arc4_free -#define arc4_init mbedtls_arc4_init -#define arc4_self_test mbedtls_arc4_self_test -#define arc4_setup mbedtls_arc4_setup -#define asn1_bitstring mbedtls_asn1_bitstring -#define asn1_buf mbedtls_asn1_buf -#define asn1_find_named_data mbedtls_asn1_find_named_data -#define asn1_free_named_data mbedtls_asn1_free_named_data -#define asn1_free_named_data_list mbedtls_asn1_free_named_data_list -#define asn1_get_alg mbedtls_asn1_get_alg -#define asn1_get_alg_null mbedtls_asn1_get_alg_null -#define asn1_get_bitstring mbedtls_asn1_get_bitstring -#define asn1_get_bitstring_null mbedtls_asn1_get_bitstring_null -#define asn1_get_bool mbedtls_asn1_get_bool -#define asn1_get_int mbedtls_asn1_get_int -#define asn1_get_len mbedtls_asn1_get_len -#define asn1_get_mpi mbedtls_asn1_get_mpi -#define asn1_get_sequence_of mbedtls_asn1_get_sequence_of -#define asn1_get_tag mbedtls_asn1_get_tag -#define asn1_named_data mbedtls_asn1_named_data -#define asn1_sequence mbedtls_asn1_sequence -#define asn1_store_named_data mbedtls_asn1_store_named_data -#define asn1_write_algorithm_identifier mbedtls_asn1_write_algorithm_identifier -#define asn1_write_bitstring mbedtls_asn1_write_bitstring -#define asn1_write_bool mbedtls_asn1_write_bool -#define asn1_write_ia5_string mbedtls_asn1_write_ia5_string -#define asn1_write_int mbedtls_asn1_write_int -#define asn1_write_len mbedtls_asn1_write_len -#define asn1_write_mpi mbedtls_asn1_write_mpi -#define asn1_write_null mbedtls_asn1_write_null -#define asn1_write_octet_string mbedtls_asn1_write_octet_string -#define asn1_write_oid mbedtls_asn1_write_oid -#define asn1_write_printable_string mbedtls_asn1_write_printable_string -#define asn1_write_raw_buffer mbedtls_asn1_write_raw_buffer -#define asn1_write_tag mbedtls_asn1_write_tag -#define base64_decode mbedtls_base64_decode -#define base64_encode mbedtls_base64_encode -#define base64_self_test mbedtls_base64_self_test -#define blowfish_context mbedtls_blowfish_context -#define blowfish_crypt_cbc mbedtls_blowfish_crypt_cbc -#define blowfish_crypt_cfb64 mbedtls_blowfish_crypt_cfb64 -#define blowfish_crypt_ctr mbedtls_blowfish_crypt_ctr -#define blowfish_crypt_ecb mbedtls_blowfish_crypt_ecb -#define blowfish_free mbedtls_blowfish_free -#define blowfish_init mbedtls_blowfish_init -#define blowfish_setkey mbedtls_blowfish_setkey -#define camellia_context mbedtls_camellia_context -#define camellia_crypt_cbc mbedtls_camellia_crypt_cbc -#define camellia_crypt_cfb128 mbedtls_camellia_crypt_cfb128 -#define camellia_crypt_ctr mbedtls_camellia_crypt_ctr -#define camellia_crypt_ecb mbedtls_camellia_crypt_ecb -#define camellia_free mbedtls_camellia_free -#define camellia_init mbedtls_camellia_init -#define camellia_self_test mbedtls_camellia_self_test -#define camellia_setkey_dec mbedtls_camellia_setkey_dec -#define camellia_setkey_enc mbedtls_camellia_setkey_enc -#define ccm_auth_decrypt mbedtls_ccm_auth_decrypt -#define ccm_context mbedtls_ccm_context -#define ccm_encrypt_and_tag mbedtls_ccm_encrypt_and_tag -#define ccm_free mbedtls_ccm_free -#define ccm_init mbedtls_ccm_init -#define ccm_self_test mbedtls_ccm_self_test -#define cipher_auth_decrypt mbedtls_cipher_auth_decrypt -#define cipher_auth_encrypt mbedtls_cipher_auth_encrypt -#define cipher_base_t mbedtls_cipher_base_t -#define cipher_check_tag mbedtls_cipher_check_tag -#define cipher_context_t mbedtls_cipher_context_t -#define cipher_crypt mbedtls_cipher_crypt -#define cipher_definition_t mbedtls_cipher_definition_t -#define cipher_definitions mbedtls_cipher_definitions -#define cipher_finish mbedtls_cipher_finish -#define cipher_free mbedtls_cipher_free -#define cipher_get_block_size mbedtls_cipher_get_block_size -#define cipher_get_cipher_mode mbedtls_cipher_get_cipher_mode -#define cipher_get_iv_size mbedtls_cipher_get_iv_size -#define cipher_get_key_size mbedtls_cipher_get_key_bitlen -#define cipher_get_name mbedtls_cipher_get_name -#define cipher_get_operation mbedtls_cipher_get_operation -#define cipher_get_type mbedtls_cipher_get_type -#define cipher_id_t mbedtls_cipher_id_t -#define cipher_info_from_string mbedtls_cipher_info_from_string -#define cipher_info_from_type mbedtls_cipher_info_from_type -#define cipher_info_from_values mbedtls_cipher_info_from_values -#define cipher_info_t mbedtls_cipher_info_t -#define cipher_init mbedtls_cipher_init -#define cipher_init_ctx mbedtls_cipher_setup -#define cipher_list mbedtls_cipher_list -#define cipher_mode_t mbedtls_cipher_mode_t -#define cipher_padding_t mbedtls_cipher_padding_t -#define cipher_reset mbedtls_cipher_reset -#define cipher_set_iv mbedtls_cipher_set_iv -#define cipher_set_padding_mode mbedtls_cipher_set_padding_mode -#define cipher_setkey mbedtls_cipher_setkey -#define cipher_type_t mbedtls_cipher_type_t -#define cipher_update mbedtls_cipher_update -#define cipher_update_ad mbedtls_cipher_update_ad -#define cipher_write_tag mbedtls_cipher_write_tag -#define ctr_drbg_context mbedtls_ctr_drbg_context -#define ctr_drbg_free mbedtls_ctr_drbg_free -#define ctr_drbg_init mbedtls_ctr_drbg_init -#define ctr_drbg_random mbedtls_ctr_drbg_random -#define ctr_drbg_random_with_add mbedtls_ctr_drbg_random_with_add -#define ctr_drbg_reseed mbedtls_ctr_drbg_reseed -#define ctr_drbg_self_test mbedtls_ctr_drbg_self_test -#define ctr_drbg_set_entropy_len mbedtls_ctr_drbg_set_entropy_len -#define ctr_drbg_set_prediction_resistance mbedtls_ctr_drbg_set_prediction_resistance -#define ctr_drbg_set_reseed_interval mbedtls_ctr_drbg_set_reseed_interval -#define ctr_drbg_update mbedtls_ctr_drbg_update -#define ctr_drbg_update_seed_file mbedtls_ctr_drbg_update_seed_file -#define ctr_drbg_write_seed_file mbedtls_ctr_drbg_write_seed_file -#define debug_print_buf mbedtls_debug_print_buf -#define debug_print_crt mbedtls_debug_print_crt -#define debug_print_ecp mbedtls_debug_print_ecp -#define debug_print_mpi mbedtls_debug_print_mpi -#define debug_print_msg mbedtls_debug_print_msg -#define debug_print_ret mbedtls_debug_print_ret -#define debug_set_threshold mbedtls_debug_set_threshold -#define des3_context mbedtls_des3_context -#define des3_crypt_cbc mbedtls_des3_crypt_cbc -#define des3_crypt_ecb mbedtls_des3_crypt_ecb -#define des3_free mbedtls_des3_free -#define des3_init mbedtls_des3_init -#define des3_set2key_dec mbedtls_des3_set2key_dec -#define des3_set2key_enc mbedtls_des3_set2key_enc -#define des3_set3key_dec mbedtls_des3_set3key_dec -#define des3_set3key_enc mbedtls_des3_set3key_enc -#define des_context mbedtls_des_context -#define des_crypt_cbc mbedtls_des_crypt_cbc -#define des_crypt_ecb mbedtls_des_crypt_ecb -#define des_free mbedtls_des_free -#define des_init mbedtls_des_init -#define des_key_check_key_parity mbedtls_des_key_check_key_parity -#define des_key_check_weak mbedtls_des_key_check_weak -#define des_key_set_parity mbedtls_des_key_set_parity -#define des_self_test mbedtls_des_self_test -#define des_setkey_dec mbedtls_des_setkey_dec -#define des_setkey_enc mbedtls_des_setkey_enc -#define dhm_calc_secret mbedtls_dhm_calc_secret -#define dhm_context mbedtls_dhm_context -#define dhm_free mbedtls_dhm_free -#define dhm_init mbedtls_dhm_init -#define dhm_make_params mbedtls_dhm_make_params -#define dhm_make_public mbedtls_dhm_make_public -#define dhm_parse_dhm mbedtls_dhm_parse_dhm -#define dhm_parse_dhmfile mbedtls_dhm_parse_dhmfile -#define dhm_read_params mbedtls_dhm_read_params -#define dhm_read_public mbedtls_dhm_read_public -#define dhm_self_test mbedtls_dhm_self_test -#define ecdh_calc_secret mbedtls_ecdh_calc_secret -#define ecdh_compute_shared mbedtls_ecdh_compute_shared -#define ecdh_context mbedtls_ecdh_context -#define ecdh_free mbedtls_ecdh_free -#define ecdh_gen_public mbedtls_ecdh_gen_public -#define ecdh_get_params mbedtls_ecdh_get_params -#define ecdh_init mbedtls_ecdh_init -#define ecdh_make_params mbedtls_ecdh_make_params -#define ecdh_make_public mbedtls_ecdh_make_public -#define ecdh_read_params mbedtls_ecdh_read_params -#define ecdh_read_public mbedtls_ecdh_read_public -#define ecdh_side mbedtls_ecdh_side -#define ecdsa_context mbedtls_ecdsa_context -#define ecdsa_free mbedtls_ecdsa_free -#define ecdsa_from_keypair mbedtls_ecdsa_from_keypair -#define ecdsa_genkey mbedtls_ecdsa_genkey -#define ecdsa_info mbedtls_ecdsa_info -#define ecdsa_init mbedtls_ecdsa_init -#define ecdsa_read_signature mbedtls_ecdsa_read_signature -#define ecdsa_sign mbedtls_ecdsa_sign -#define ecdsa_sign_det mbedtls_ecdsa_sign_det -#define ecdsa_verify mbedtls_ecdsa_verify -#define ecdsa_write_signature mbedtls_ecdsa_write_signature -#define ecdsa_write_signature_det mbedtls_ecdsa_write_signature_det -#define eckey_info mbedtls_eckey_info -#define eckeydh_info mbedtls_eckeydh_info -#define ecp_check_privkey mbedtls_ecp_check_privkey -#define ecp_check_pub_priv mbedtls_ecp_check_pub_priv -#define ecp_check_pubkey mbedtls_ecp_check_pubkey -#define ecp_copy mbedtls_ecp_copy -#define ecp_curve_info mbedtls_ecp_curve_info -#define ecp_curve_info_from_grp_id mbedtls_ecp_curve_info_from_grp_id -#define ecp_curve_info_from_name mbedtls_ecp_curve_info_from_name -#define ecp_curve_info_from_tls_id mbedtls_ecp_curve_info_from_tls_id -#define ecp_curve_list mbedtls_ecp_curve_list -#define ecp_gen_key mbedtls_ecp_gen_key -#define ecp_gen_keypair mbedtls_ecp_gen_keypair -#define ecp_group mbedtls_ecp_group -#define ecp_group_copy mbedtls_ecp_group_copy -#define ecp_group_free mbedtls_ecp_group_free -#define ecp_group_id mbedtls_ecp_group_id -#define ecp_group_init mbedtls_ecp_group_init -#define ecp_grp_id_list mbedtls_ecp_grp_id_list -#define ecp_is_zero mbedtls_ecp_is_zero -#define ecp_keypair mbedtls_ecp_keypair -#define ecp_keypair_free mbedtls_ecp_keypair_free -#define ecp_keypair_init mbedtls_ecp_keypair_init -#define ecp_mul mbedtls_ecp_mul -#define ecp_point mbedtls_ecp_point -#define ecp_point_free mbedtls_ecp_point_free -#define ecp_point_init mbedtls_ecp_point_init -#define ecp_point_read_binary mbedtls_ecp_point_read_binary -#define ecp_point_read_string mbedtls_ecp_point_read_string -#define ecp_point_write_binary mbedtls_ecp_point_write_binary -#define ecp_self_test mbedtls_ecp_self_test -#define ecp_set_zero mbedtls_ecp_set_zero -#define ecp_tls_read_group mbedtls_ecp_tls_read_group -#define ecp_tls_read_point mbedtls_ecp_tls_read_point -#define ecp_tls_write_group mbedtls_ecp_tls_write_group -#define ecp_tls_write_point mbedtls_ecp_tls_write_point -#define ecp_use_known_dp mbedtls_ecp_group_load -#define entropy_add_source mbedtls_entropy_add_source -#define entropy_context mbedtls_entropy_context -#define entropy_free mbedtls_entropy_free -#define entropy_func mbedtls_entropy_func -#define entropy_gather mbedtls_entropy_gather -#define entropy_init mbedtls_entropy_init -#define entropy_self_test mbedtls_entropy_self_test -#define entropy_update_manual mbedtls_entropy_update_manual -#define entropy_update_seed_file mbedtls_entropy_update_seed_file -#define entropy_write_seed_file mbedtls_entropy_write_seed_file -#define error_strerror mbedtls_strerror -#define f_source_ptr mbedtls_entropy_f_source_ptr -#define gcm_auth_decrypt mbedtls_gcm_auth_decrypt -#define gcm_context mbedtls_gcm_context -#define gcm_crypt_and_tag mbedtls_gcm_crypt_and_tag -#define gcm_finish mbedtls_gcm_finish -#define gcm_free mbedtls_gcm_free -#define gcm_init mbedtls_gcm_init -#define gcm_self_test mbedtls_gcm_self_test -#define gcm_starts mbedtls_gcm_starts -#define gcm_update mbedtls_gcm_update -#define get_timer mbedtls_timing_get_timer -#define hardclock mbedtls_timing_hardclock -#define hardclock_poll mbedtls_hardclock_poll -#define havege_free mbedtls_havege_free -#define havege_init mbedtls_havege_init -#define havege_poll mbedtls_havege_poll -#define havege_random mbedtls_havege_random -#define havege_state mbedtls_havege_state -#define hmac_drbg_context mbedtls_hmac_drbg_context -#define hmac_drbg_free mbedtls_hmac_drbg_free -#define hmac_drbg_init mbedtls_hmac_drbg_init -#define hmac_drbg_random mbedtls_hmac_drbg_random -#define hmac_drbg_random_with_add mbedtls_hmac_drbg_random_with_add -#define hmac_drbg_reseed mbedtls_hmac_drbg_reseed -#define hmac_drbg_self_test mbedtls_hmac_drbg_self_test -#define hmac_drbg_set_entropy_len mbedtls_hmac_drbg_set_entropy_len -#define hmac_drbg_set_prediction_resistance mbedtls_hmac_drbg_set_prediction_resistance -#define hmac_drbg_set_reseed_interval mbedtls_hmac_drbg_set_reseed_interval -#define hmac_drbg_update mbedtls_hmac_drbg_update -#define hmac_drbg_update_seed_file mbedtls_hmac_drbg_update_seed_file -#define hmac_drbg_write_seed_file mbedtls_hmac_drbg_write_seed_file -#define hr_time mbedtls_timing_hr_time -#define key_exchange_type_t mbedtls_key_exchange_type_t -#define md mbedtls_md -#define md2 mbedtls_md2 -#define md2_context mbedtls_md2_context -#define md2_finish mbedtls_md2_finish -#define md2_free mbedtls_md2_free -#define md2_info mbedtls_md2_info -#define md2_init mbedtls_md2_init -#define md2_process mbedtls_md2_process -#define md2_self_test mbedtls_md2_self_test -#define md2_starts mbedtls_md2_starts -#define md2_update mbedtls_md2_update -#define md4 mbedtls_md4 -#define md4_context mbedtls_md4_context -#define md4_finish mbedtls_md4_finish -#define md4_free mbedtls_md4_free -#define md4_info mbedtls_md4_info -#define md4_init mbedtls_md4_init -#define md4_process mbedtls_md4_process -#define md4_self_test mbedtls_md4_self_test -#define md4_starts mbedtls_md4_starts -#define md4_update mbedtls_md4_update -#define md5 mbedtls_md5 -#define md5_context mbedtls_md5_context -#define md5_finish mbedtls_md5_finish -#define md5_free mbedtls_md5_free -#define md5_info mbedtls_md5_info -#define md5_init mbedtls_md5_init -#define md5_process mbedtls_md5_process -#define md5_self_test mbedtls_md5_self_test -#define md5_starts mbedtls_md5_starts -#define md5_update mbedtls_md5_update -#define md_context_t mbedtls_md_context_t -#define md_file mbedtls_md_file -#define md_finish mbedtls_md_finish -#define md_free mbedtls_md_free -#define md_get_name mbedtls_md_get_name -#define md_get_size mbedtls_md_get_size -#define md_get_type mbedtls_md_get_type -#define md_hmac mbedtls_md_hmac -#define md_hmac_finish mbedtls_md_hmac_finish -#define md_hmac_reset mbedtls_md_hmac_reset -#define md_hmac_starts mbedtls_md_hmac_starts -#define md_hmac_update mbedtls_md_hmac_update -#define md_info_from_string mbedtls_md_info_from_string -#define md_info_from_type mbedtls_md_info_from_type -#define md_info_t mbedtls_md_info_t -#define md_init mbedtls_md_init -#define md_init_ctx mbedtls_md_init_ctx -#define md_list mbedtls_md_list -#define md_process mbedtls_md_process -#define md_starts mbedtls_md_starts -#define md_type_t mbedtls_md_type_t -#define md_update mbedtls_md_update -#define memory_buffer_alloc_cur_get mbedtls_memory_buffer_alloc_cur_get -#define memory_buffer_alloc_free mbedtls_memory_buffer_alloc_free -#define memory_buffer_alloc_init mbedtls_memory_buffer_alloc_init -#define memory_buffer_alloc_max_get mbedtls_memory_buffer_alloc_max_get -#define memory_buffer_alloc_max_reset mbedtls_memory_buffer_alloc_max_reset -#define memory_buffer_alloc_self_test mbedtls_memory_buffer_alloc_self_test -#define memory_buffer_alloc_status mbedtls_memory_buffer_alloc_status -#define memory_buffer_alloc_verify mbedtls_memory_buffer_alloc_verify -#define memory_buffer_set_verify mbedtls_memory_buffer_set_verify -#define mpi mbedtls_mpi -#define mpi_add_abs mbedtls_mpi_add_abs -#define mpi_add_int mbedtls_mpi_add_int -#define mpi_add_mpi mbedtls_mpi_add_mpi -#define mpi_cmp_abs mbedtls_mpi_cmp_abs -#define mpi_cmp_int mbedtls_mpi_cmp_int -#define mpi_cmp_mpi mbedtls_mpi_cmp_mpi -#define mpi_copy mbedtls_mpi_copy -#define mpi_div_int mbedtls_mpi_div_int -#define mpi_div_mpi mbedtls_mpi_div_mpi -#define mpi_exp_mod mbedtls_mpi_exp_mod -#define mpi_fill_random mbedtls_mpi_fill_random -#define mpi_free mbedtls_mpi_free -#define mpi_gcd mbedtls_mpi_gcd -#define mpi_gen_prime mbedtls_mpi_gen_prime -#define mpi_get_bit mbedtls_mpi_get_bit -#define mpi_grow mbedtls_mpi_grow -#define mpi_init mbedtls_mpi_init -#define mpi_inv_mod mbedtls_mpi_inv_mod -#define mpi_is_prime mbedtls_mpi_is_prime -#define mpi_lsb mbedtls_mpi_lsb -#define mpi_lset mbedtls_mpi_lset -#define mpi_mod_int mbedtls_mpi_mod_int -#define mpi_mod_mpi mbedtls_mpi_mod_mpi -#define mpi_msb mbedtls_mpi_bitlen -#define mpi_mul_int mbedtls_mpi_mul_int -#define mpi_mul_mpi mbedtls_mpi_mul_mpi -#define mpi_read_binary mbedtls_mpi_read_binary -#define mpi_read_file mbedtls_mpi_read_file -#define mpi_read_string mbedtls_mpi_read_string -#define mpi_safe_cond_assign mbedtls_mpi_safe_cond_assign -#define mpi_safe_cond_swap mbedtls_mpi_safe_cond_swap -#define mpi_self_test mbedtls_mpi_self_test -#define mpi_set_bit mbedtls_mpi_set_bit -#define mpi_shift_l mbedtls_mpi_shift_l -#define mpi_shift_r mbedtls_mpi_shift_r -#define mpi_shrink mbedtls_mpi_shrink -#define mpi_size mbedtls_mpi_size -#define mpi_sub_abs mbedtls_mpi_sub_abs -#define mpi_sub_int mbedtls_mpi_sub_int -#define mpi_sub_mpi mbedtls_mpi_sub_mpi -#define mpi_swap mbedtls_mpi_swap -#define mpi_write_binary mbedtls_mpi_write_binary -#define mpi_write_file mbedtls_mpi_write_file -#define mpi_write_string mbedtls_mpi_write_string -#define net_accept mbedtls_net_accept -#define net_bind mbedtls_net_bind -#define net_close mbedtls_net_free -#define net_connect mbedtls_net_connect -#define net_recv mbedtls_net_recv -#define net_recv_timeout mbedtls_net_recv_timeout -#define net_send mbedtls_net_send -#define net_set_block mbedtls_net_set_block -#define net_set_nonblock mbedtls_net_set_nonblock -#define net_usleep mbedtls_net_usleep -#define oid_descriptor_t mbedtls_oid_descriptor_t -#define oid_get_attr_short_name mbedtls_oid_get_attr_short_name -#define oid_get_cipher_alg mbedtls_oid_get_cipher_alg -#define oid_get_ec_grp mbedtls_oid_get_ec_grp -#define oid_get_extended_key_usage mbedtls_oid_get_extended_key_usage -#define oid_get_md_alg mbedtls_oid_get_md_alg -#define oid_get_numeric_string mbedtls_oid_get_numeric_string -#define oid_get_oid_by_ec_grp mbedtls_oid_get_oid_by_ec_grp -#define oid_get_oid_by_md mbedtls_oid_get_oid_by_md -#define oid_get_oid_by_pk_alg mbedtls_oid_get_oid_by_pk_alg -#define oid_get_oid_by_sig_alg mbedtls_oid_get_oid_by_sig_alg -#define oid_get_pk_alg mbedtls_oid_get_pk_alg -#define oid_get_pkcs12_pbe_alg mbedtls_oid_get_pkcs12_pbe_alg -#define oid_get_sig_alg mbedtls_oid_get_sig_alg -#define oid_get_sig_alg_desc mbedtls_oid_get_sig_alg_desc -#define oid_get_x509_ext_type mbedtls_oid_get_x509_ext_type -#define operation_t mbedtls_operation_t -#define padlock_supports mbedtls_padlock_has_support -#define padlock_xcryptcbc mbedtls_padlock_xcryptcbc -#define padlock_xcryptecb mbedtls_padlock_xcryptecb -#define pem_context mbedtls_pem_context -#define pem_free mbedtls_pem_free -#define pem_init mbedtls_pem_init -#define pem_read_buffer mbedtls_pem_read_buffer -#define pem_write_buffer mbedtls_pem_write_buffer -#define pk_can_do mbedtls_pk_can_do -#define pk_check_pair mbedtls_pk_check_pair -#define pk_context mbedtls_pk_context -#define pk_debug mbedtls_pk_debug -#define pk_debug_item mbedtls_pk_debug_item -#define pk_debug_type mbedtls_pk_debug_type -#define pk_decrypt mbedtls_pk_decrypt -#define pk_ec mbedtls_pk_ec -#define pk_encrypt mbedtls_pk_encrypt -#define pk_free mbedtls_pk_free -#define pk_get_len mbedtls_pk_get_len -#define pk_get_name mbedtls_pk_get_name -#define pk_get_size mbedtls_pk_get_bitlen -#define pk_get_type mbedtls_pk_get_type -#define pk_info_from_type mbedtls_pk_info_from_type -#define pk_info_t mbedtls_pk_info_t -#define pk_init mbedtls_pk_init -#define pk_init_ctx mbedtls_pk_setup -#define pk_init_ctx_rsa_alt mbedtls_pk_setup_rsa_alt -#define pk_load_file mbedtls_pk_load_file -#define pk_parse_key mbedtls_pk_parse_key -#define pk_parse_keyfile mbedtls_pk_parse_keyfile -#define pk_parse_public_key mbedtls_pk_parse_public_key -#define pk_parse_public_keyfile mbedtls_pk_parse_public_keyfile -#define pk_parse_subpubkey mbedtls_pk_parse_subpubkey -#define pk_rsa mbedtls_pk_rsa -#define pk_rsa_alt_decrypt_func mbedtls_pk_rsa_alt_decrypt_func -#define pk_rsa_alt_key_len_func mbedtls_pk_rsa_alt_key_len_func -#define pk_rsa_alt_sign_func mbedtls_pk_rsa_alt_sign_func -#define pk_rsassa_pss_options mbedtls_pk_rsassa_pss_options -#define pk_sign mbedtls_pk_sign -#define pk_type_t mbedtls_pk_type_t -#define pk_verify mbedtls_pk_verify -#define pk_verify_ext mbedtls_pk_verify_ext -#define pk_write_key_der mbedtls_pk_write_key_der -#define pk_write_key_pem mbedtls_pk_write_key_pem -#define pk_write_pubkey mbedtls_pk_write_pubkey -#define pk_write_pubkey_der mbedtls_pk_write_pubkey_der -#define pk_write_pubkey_pem mbedtls_pk_write_pubkey_pem -#define pkcs11_context mbedtls_pkcs11_context -#define pkcs11_decrypt mbedtls_pkcs11_decrypt -#define pkcs11_priv_key_free mbedtls_pkcs11_priv_key_free -#define pkcs11_priv_key_init mbedtls_pkcs11_priv_key_bind -#define pkcs11_sign mbedtls_pkcs11_sign -#define pkcs11_x509_cert_init mbedtls_pkcs11_x509_cert_bind -#define pkcs12_derivation mbedtls_pkcs12_derivation -#define pkcs12_pbe mbedtls_pkcs12_pbe -#define pkcs12_pbe_sha1_rc4_128 mbedtls_pkcs12_pbe_sha1_rc4_128 -#define pkcs5_pbes2 mbedtls_pkcs5_pbes2 -#define pkcs5_pbkdf2_hmac mbedtls_pkcs5_pbkdf2_hmac -#define pkcs5_self_test mbedtls_pkcs5_self_test -#define platform_entropy_poll mbedtls_platform_entropy_poll -#define platform_set_exit mbedtls_platform_set_exit -#define platform_set_fprintf mbedtls_platform_set_fprintf -#define platform_set_printf mbedtls_platform_set_printf -#define platform_set_snprintf mbedtls_platform_set_snprintf -#define polarssl_exit mbedtls_exit -#define polarssl_fprintf mbedtls_fprintf -#define polarssl_free mbedtls_free -#define polarssl_mutex_free mbedtls_mutex_free -#define polarssl_mutex_init mbedtls_mutex_init -#define polarssl_mutex_lock mbedtls_mutex_lock -#define polarssl_mutex_unlock mbedtls_mutex_unlock -#define polarssl_printf mbedtls_printf -#define polarssl_snprintf mbedtls_snprintf -#define polarssl_strerror mbedtls_strerror -#define ripemd160 mbedtls_ripemd160 -#define ripemd160_context mbedtls_ripemd160_context -#define ripemd160_finish mbedtls_ripemd160_finish -#define ripemd160_free mbedtls_ripemd160_free -#define ripemd160_info mbedtls_ripemd160_info -#define ripemd160_init mbedtls_ripemd160_init -#define ripemd160_process mbedtls_ripemd160_process -#define ripemd160_self_test mbedtls_ripemd160_self_test -#define ripemd160_starts mbedtls_ripemd160_starts -#define ripemd160_update mbedtls_ripemd160_update -#define rsa_alt_context mbedtls_rsa_alt_context -#define rsa_alt_info mbedtls_rsa_alt_info -#define rsa_check_privkey mbedtls_rsa_check_privkey -#define rsa_check_pub_priv mbedtls_rsa_check_pub_priv -#define rsa_check_pubkey mbedtls_rsa_check_pubkey -#define rsa_context mbedtls_rsa_context -#define rsa_copy mbedtls_rsa_copy -#define rsa_free mbedtls_rsa_free -#define rsa_gen_key mbedtls_rsa_gen_key -#define rsa_info mbedtls_rsa_info -#define rsa_init mbedtls_rsa_init -#define rsa_pkcs1_decrypt mbedtls_rsa_pkcs1_decrypt -#define rsa_pkcs1_encrypt mbedtls_rsa_pkcs1_encrypt -#define rsa_pkcs1_sign mbedtls_rsa_pkcs1_sign -#define rsa_pkcs1_verify mbedtls_rsa_pkcs1_verify -#define rsa_private mbedtls_rsa_private -#define rsa_public mbedtls_rsa_public -#define rsa_rsaes_oaep_decrypt mbedtls_rsa_rsaes_oaep_decrypt -#define rsa_rsaes_oaep_encrypt mbedtls_rsa_rsaes_oaep_encrypt -#define rsa_rsaes_pkcs1_v15_decrypt mbedtls_rsa_rsaes_pkcs1_v15_decrypt -#define rsa_rsaes_pkcs1_v15_encrypt mbedtls_rsa_rsaes_pkcs1_v15_encrypt -#define rsa_rsassa_pkcs1_v15_sign mbedtls_rsa_rsassa_pkcs1_v15_sign -#define rsa_rsassa_pkcs1_v15_verify mbedtls_rsa_rsassa_pkcs1_v15_verify -#define rsa_rsassa_pss_sign mbedtls_rsa_rsassa_pss_sign -#define rsa_rsassa_pss_verify mbedtls_rsa_rsassa_pss_verify -#define rsa_rsassa_pss_verify_ext mbedtls_rsa_rsassa_pss_verify_ext -#define rsa_self_test mbedtls_rsa_self_test -#define rsa_set_padding mbedtls_rsa_set_padding -#define safer_memcmp mbedtls_ssl_safer_memcmp -#define set_alarm mbedtls_set_alarm -#define sha1 mbedtls_sha1 -#define sha1_context mbedtls_sha1_context -#define sha1_finish mbedtls_sha1_finish -#define sha1_free mbedtls_sha1_free -#define sha1_info mbedtls_sha1_info -#define sha1_init mbedtls_sha1_init -#define sha1_process mbedtls_sha1_process -#define sha1_self_test mbedtls_sha1_self_test -#define sha1_starts mbedtls_sha1_starts -#define sha1_update mbedtls_sha1_update -#define sha224_info mbedtls_sha224_info -#define sha256 mbedtls_sha256 -#define sha256_context mbedtls_sha256_context -#define sha256_finish mbedtls_sha256_finish -#define sha256_free mbedtls_sha256_free -#define sha256_info mbedtls_sha256_info -#define sha256_init mbedtls_sha256_init -#define sha256_process mbedtls_sha256_process -#define sha256_self_test mbedtls_sha256_self_test -#define sha256_starts mbedtls_sha256_starts -#define sha256_update mbedtls_sha256_update -#define sha384_info mbedtls_sha384_info -#define sha512 mbedtls_sha512 -#define sha512_context mbedtls_sha512_context -#define sha512_finish mbedtls_sha512_finish -#define sha512_free mbedtls_sha512_free -#define sha512_info mbedtls_sha512_info -#define sha512_init mbedtls_sha512_init -#define sha512_process mbedtls_sha512_process -#define sha512_self_test mbedtls_sha512_self_test -#define sha512_starts mbedtls_sha512_starts -#define sha512_update mbedtls_sha512_update -#define source_state mbedtls_entropy_source_state -#define ssl_cache_context mbedtls_ssl_cache_context -#define ssl_cache_entry mbedtls_ssl_cache_entry -#define ssl_cache_free mbedtls_ssl_cache_free -#define ssl_cache_get mbedtls_ssl_cache_get -#define ssl_cache_init mbedtls_ssl_cache_init -#define ssl_cache_set mbedtls_ssl_cache_set -#define ssl_cache_set_max_entries mbedtls_ssl_cache_set_max_entries -#define ssl_cache_set_timeout mbedtls_ssl_cache_set_timeout -#define ssl_check_cert_usage mbedtls_ssl_check_cert_usage -#define ssl_ciphersuite_from_id mbedtls_ssl_ciphersuite_from_id -#define ssl_ciphersuite_from_string mbedtls_ssl_ciphersuite_from_string -#define ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t -#define ssl_ciphersuite_uses_ec mbedtls_ssl_ciphersuite_uses_ec -#define ssl_ciphersuite_uses_psk mbedtls_ssl_ciphersuite_uses_psk -#define ssl_close_notify mbedtls_ssl_close_notify -#define ssl_context mbedtls_ssl_context -#define ssl_cookie_check mbedtls_ssl_cookie_check -#define ssl_cookie_check_t mbedtls_ssl_cookie_check_t -#define ssl_cookie_ctx mbedtls_ssl_cookie_ctx -#define ssl_cookie_free mbedtls_ssl_cookie_free -#define ssl_cookie_init mbedtls_ssl_cookie_init -#define ssl_cookie_set_timeout mbedtls_ssl_cookie_set_timeout -#define ssl_cookie_setup mbedtls_ssl_cookie_setup -#define ssl_cookie_write mbedtls_ssl_cookie_write -#define ssl_cookie_write_t mbedtls_ssl_cookie_write_t -#define ssl_derive_keys mbedtls_ssl_derive_keys -#define ssl_dtls_replay_check mbedtls_ssl_dtls_replay_check -#define ssl_dtls_replay_update mbedtls_ssl_dtls_replay_update -#define ssl_fetch_input mbedtls_ssl_fetch_input -#define ssl_flight_item mbedtls_ssl_flight_item -#define ssl_flush_output mbedtls_ssl_flush_output -#define ssl_free mbedtls_ssl_free -#define ssl_get_alpn_protocol mbedtls_ssl_get_alpn_protocol -#define ssl_get_bytes_avail mbedtls_ssl_get_bytes_avail -#define ssl_get_ciphersuite mbedtls_ssl_get_ciphersuite -#define ssl_get_ciphersuite_id mbedtls_ssl_get_ciphersuite_id -#define ssl_get_ciphersuite_name mbedtls_ssl_get_ciphersuite_name -#define ssl_get_ciphersuite_sig_pk_alg mbedtls_ssl_get_ciphersuite_sig_pk_alg -#define ssl_get_peer_cert mbedtls_ssl_get_peer_cert -#define ssl_get_record_expansion mbedtls_ssl_get_record_expansion -#define ssl_get_session mbedtls_ssl_get_session -#define ssl_get_verify_result mbedtls_ssl_get_verify_result -#define ssl_get_version mbedtls_ssl_get_version -#define ssl_handshake mbedtls_ssl_handshake -#define ssl_handshake_client_step mbedtls_ssl_handshake_client_step -#define ssl_handshake_free mbedtls_ssl_handshake_free -#define ssl_handshake_params mbedtls_ssl_handshake_params -#define ssl_handshake_server_step mbedtls_ssl_handshake_server_step -#define ssl_handshake_step mbedtls_ssl_handshake_step -#define ssl_handshake_wrapup mbedtls_ssl_handshake_wrapup -#define ssl_hdr_len mbedtls_ssl_hdr_len -#define ssl_hs_hdr_len mbedtls_ssl_hs_hdr_len -#define ssl_hw_record_activate mbedtls_ssl_hw_record_activate -#define ssl_hw_record_finish mbedtls_ssl_hw_record_finish -#define ssl_hw_record_init mbedtls_ssl_hw_record_init -#define ssl_hw_record_read mbedtls_ssl_hw_record_read -#define ssl_hw_record_reset mbedtls_ssl_hw_record_reset -#define ssl_hw_record_write mbedtls_ssl_hw_record_write -#define ssl_init mbedtls_ssl_init -#define ssl_key_cert mbedtls_ssl_key_cert -#define ssl_legacy_renegotiation mbedtls_ssl_conf_legacy_renegotiation -#define ssl_list_ciphersuites mbedtls_ssl_list_ciphersuites -#define ssl_md_alg_from_hash mbedtls_ssl_md_alg_from_hash -#define ssl_optimize_checksum mbedtls_ssl_optimize_checksum -#define ssl_own_cert mbedtls_ssl_own_cert -#define ssl_own_key mbedtls_ssl_own_key -#define ssl_parse_certificate mbedtls_ssl_parse_certificate -#define ssl_parse_change_cipher_spec mbedtls_ssl_parse_change_cipher_spec -#define ssl_parse_finished mbedtls_ssl_parse_finished -#define ssl_pk_alg_from_sig mbedtls_ssl_pk_alg_from_sig -#define ssl_pkcs11_decrypt mbedtls_ssl_pkcs11_decrypt -#define ssl_pkcs11_key_len mbedtls_ssl_pkcs11_key_len -#define ssl_pkcs11_sign mbedtls_ssl_pkcs11_sign -#define ssl_psk_derive_premaster mbedtls_ssl_psk_derive_premaster -#define ssl_read mbedtls_ssl_read -#define ssl_read_record mbedtls_ssl_read_record -#define ssl_read_version mbedtls_ssl_read_version -#define ssl_recv_flight_completed mbedtls_ssl_recv_flight_completed -#define ssl_renegotiate mbedtls_ssl_renegotiate -#define ssl_resend mbedtls_ssl_resend -#define ssl_reset_checksum mbedtls_ssl_reset_checksum -#define ssl_send_alert_message mbedtls_ssl_send_alert_message -#define ssl_send_fatal_handshake_failure mbedtls_ssl_send_fatal_handshake_failure -#define ssl_send_flight_completed mbedtls_ssl_send_flight_completed -#define ssl_session mbedtls_ssl_session -#define ssl_session_free mbedtls_ssl_session_free -#define ssl_session_init mbedtls_ssl_session_init -#define ssl_session_reset mbedtls_ssl_session_reset -#define ssl_set_alpn_protocols mbedtls_ssl_conf_alpn_protocols -#define ssl_set_arc4_support mbedtls_ssl_conf_arc4_support -#define ssl_set_authmode mbedtls_ssl_conf_authmode -#define ssl_set_bio mbedtls_ssl_set_bio -#define ssl_set_ca_chain mbedtls_ssl_conf_ca_chain -#define ssl_set_cbc_record_splitting mbedtls_ssl_conf_cbc_record_splitting -#define ssl_set_ciphersuites mbedtls_ssl_conf_ciphersuites -#define ssl_set_ciphersuites_for_version mbedtls_ssl_conf_ciphersuites_for_version -#define ssl_set_client_transport_id mbedtls_ssl_set_client_transport_id -#define ssl_set_curves mbedtls_ssl_conf_curves -#define ssl_set_dbg mbedtls_ssl_conf_dbg -#define ssl_set_dh_param mbedtls_ssl_conf_dh_param -#define ssl_set_dh_param_ctx mbedtls_ssl_conf_dh_param_ctx -#define ssl_set_dtls_anti_replay mbedtls_ssl_conf_dtls_anti_replay -#define ssl_set_dtls_badmac_limit mbedtls_ssl_conf_dtls_badmac_limit -#define ssl_set_dtls_cookies mbedtls_ssl_conf_dtls_cookies -#define ssl_set_encrypt_then_mac mbedtls_ssl_conf_encrypt_then_mac -#define ssl_set_endpoint mbedtls_ssl_conf_endpoint -#define ssl_set_extended_master_secret mbedtls_ssl_conf_extended_master_secret -#define ssl_set_fallback mbedtls_ssl_conf_fallback -#define ssl_set_handshake_timeout mbedtls_ssl_conf_handshake_timeout -#define ssl_set_hostname mbedtls_ssl_set_hostname -#define ssl_set_max_frag_len mbedtls_ssl_conf_max_frag_len -#define ssl_set_max_version mbedtls_ssl_conf_max_version -#define ssl_set_min_version mbedtls_ssl_conf_min_version -#define ssl_set_own_cert mbedtls_ssl_conf_own_cert -#define ssl_set_psk mbedtls_ssl_conf_psk -#define ssl_set_psk_cb mbedtls_ssl_conf_psk_cb -#define ssl_set_renegotiation mbedtls_ssl_conf_renegotiation -#define ssl_set_renegotiation_enforced mbedtls_ssl_conf_renegotiation_enforced -#define ssl_set_renegotiation_period mbedtls_ssl_conf_renegotiation_period -#define ssl_set_rng mbedtls_ssl_conf_rng -#define ssl_set_session mbedtls_ssl_set_session -#define ssl_set_session_cache mbedtls_ssl_conf_session_cache -#define ssl_set_session_tickets mbedtls_ssl_conf_session_tickets -#define ssl_set_sni mbedtls_ssl_conf_sni -#define ssl_set_transport mbedtls_ssl_conf_transport -#define ssl_set_truncated_hmac mbedtls_ssl_conf_truncated_hmac -#define ssl_set_verify mbedtls_ssl_conf_verify -#define ssl_sig_from_pk mbedtls_ssl_sig_from_pk -#define ssl_states mbedtls_ssl_states -#define ssl_transform mbedtls_ssl_transform -#define ssl_transform_free mbedtls_ssl_transform_free -#define ssl_write mbedtls_ssl_write -#define ssl_write_certificate mbedtls_ssl_write_certificate -#define ssl_write_change_cipher_spec mbedtls_ssl_write_change_cipher_spec -#define ssl_write_finished mbedtls_ssl_write_finished -#define ssl_write_record mbedtls_ssl_write_record -#define ssl_write_version mbedtls_ssl_write_version -#define supported_ciphers mbedtls_cipher_supported -#define t_sint mbedtls_mpi_sint -#define t_udbl mbedtls_t_udbl -#define t_uint mbedtls_mpi_uint -#define test_ca_crt mbedtls_test_ca_crt -#define test_ca_crt_ec mbedtls_test_ca_crt_ec -#define test_ca_crt_rsa mbedtls_test_ca_crt_rsa -#define test_ca_key mbedtls_test_ca_key -#define test_ca_key_ec mbedtls_test_ca_key_ec -#define test_ca_key_rsa mbedtls_test_ca_key_rsa -#define test_ca_list mbedtls_test_cas_pem -#define test_ca_pwd mbedtls_test_ca_pwd -#define test_ca_pwd_ec mbedtls_test_ca_pwd_ec -#define test_ca_pwd_rsa mbedtls_test_ca_pwd_rsa -#define test_cli_crt mbedtls_test_cli_crt -#define test_cli_crt_ec mbedtls_test_cli_crt_ec -#define test_cli_crt_rsa mbedtls_test_cli_crt_rsa -#define test_cli_key mbedtls_test_cli_key -#define test_cli_key_ec mbedtls_test_cli_key_ec -#define test_cli_key_rsa mbedtls_test_cli_key_rsa -#define test_srv_crt mbedtls_test_srv_crt -#define test_srv_crt_ec mbedtls_test_srv_crt_ec -#define test_srv_crt_rsa mbedtls_test_srv_crt_rsa -#define test_srv_key mbedtls_test_srv_key -#define test_srv_key_ec mbedtls_test_srv_key_ec -#define test_srv_key_rsa mbedtls_test_srv_key_rsa -#define threading_mutex_t mbedtls_threading_mutex_t -#define threading_set_alt mbedtls_threading_set_alt -#define timing_self_test mbedtls_timing_self_test -#define version_check_feature mbedtls_version_check_feature -#define version_get_number mbedtls_version_get_number -#define version_get_string mbedtls_version_get_string -#define version_get_string_full mbedtls_version_get_string_full -#define x509_bitstring mbedtls_x509_bitstring -#define x509_buf mbedtls_x509_buf -#define x509_crl mbedtls_x509_crl -#define x509_crl_entry mbedtls_x509_crl_entry -#define x509_crl_free mbedtls_x509_crl_free -#define x509_crl_info mbedtls_x509_crl_info -#define x509_crl_init mbedtls_x509_crl_init -#define x509_crl_parse mbedtls_x509_crl_parse -#define x509_crl_parse_der mbedtls_x509_crl_parse_der -#define x509_crl_parse_file mbedtls_x509_crl_parse_file -#define x509_crt mbedtls_x509_crt -#define x509_crt_check_extended_key_usage mbedtls_x509_crt_check_extended_key_usage -#define x509_crt_check_key_usage mbedtls_x509_crt_check_key_usage -#define x509_crt_free mbedtls_x509_crt_free -#define x509_crt_info mbedtls_x509_crt_info -#define x509_crt_init mbedtls_x509_crt_init -#define x509_crt_parse mbedtls_x509_crt_parse -#define x509_crt_parse_der mbedtls_x509_crt_parse_der -#define x509_crt_parse_file mbedtls_x509_crt_parse_file -#define x509_crt_parse_path mbedtls_x509_crt_parse_path -#define x509_crt_revoked mbedtls_x509_crt_is_revoked -#define x509_crt_verify mbedtls_x509_crt_verify -#define x509_csr mbedtls_x509_csr -#define x509_csr_free mbedtls_x509_csr_free -#define x509_csr_info mbedtls_x509_csr_info -#define x509_csr_init mbedtls_x509_csr_init -#define x509_csr_parse mbedtls_x509_csr_parse -#define x509_csr_parse_der mbedtls_x509_csr_parse_der -#define x509_csr_parse_file mbedtls_x509_csr_parse_file -#define x509_dn_gets mbedtls_x509_dn_gets -#define x509_get_alg mbedtls_x509_get_alg -#define x509_get_alg_null mbedtls_x509_get_alg_null -#define x509_get_ext mbedtls_x509_get_ext -#define x509_get_name mbedtls_x509_get_name -#define x509_get_rsassa_pss_params mbedtls_x509_get_rsassa_pss_params -#define x509_get_serial mbedtls_x509_get_serial -#define x509_get_sig mbedtls_x509_get_sig -#define x509_get_sig_alg mbedtls_x509_get_sig_alg -#define x509_get_time mbedtls_x509_get_time -#define x509_key_size_helper mbedtls_x509_key_size_helper -#define x509_name mbedtls_x509_name -#define x509_self_test mbedtls_x509_self_test -#define x509_sequence mbedtls_x509_sequence -#define x509_serial_gets mbedtls_x509_serial_gets -#define x509_set_extension mbedtls_x509_set_extension -#define x509_sig_alg_gets mbedtls_x509_sig_alg_gets -#define x509_string_to_names mbedtls_x509_string_to_names -#define x509_time mbedtls_x509_time -#define x509_time_expired mbedtls_x509_time_is_past -#define x509_time_future mbedtls_x509_time_is_future -#define x509_write_extensions mbedtls_x509_write_extensions -#define x509_write_names mbedtls_x509_write_names -#define x509_write_sig mbedtls_x509_write_sig -#define x509write_cert mbedtls_x509write_cert -#define x509write_crt_der mbedtls_x509write_crt_der -#define x509write_crt_free mbedtls_x509write_crt_free -#define x509write_crt_init mbedtls_x509write_crt_init -#define x509write_crt_pem mbedtls_x509write_crt_pem -#define x509write_crt_set_authority_key_identifier mbedtls_x509write_crt_set_authority_key_identifier -#define x509write_crt_set_basic_constraints mbedtls_x509write_crt_set_basic_constraints -#define x509write_crt_set_extension mbedtls_x509write_crt_set_extension -#define x509write_crt_set_issuer_key mbedtls_x509write_crt_set_issuer_key -#define x509write_crt_set_issuer_name mbedtls_x509write_crt_set_issuer_name -#define x509write_crt_set_key_usage mbedtls_x509write_crt_set_key_usage -#define x509write_crt_set_md_alg mbedtls_x509write_crt_set_md_alg -#define x509write_crt_set_ns_cert_type mbedtls_x509write_crt_set_ns_cert_type -#define x509write_crt_set_serial mbedtls_x509write_crt_set_serial -#define x509write_crt_set_subject_key mbedtls_x509write_crt_set_subject_key -#define x509write_crt_set_subject_key_identifier mbedtls_x509write_crt_set_subject_key_identifier -#define x509write_crt_set_subject_name mbedtls_x509write_crt_set_subject_name -#define x509write_crt_set_validity mbedtls_x509write_crt_set_validity -#define x509write_crt_set_version mbedtls_x509write_crt_set_version -#define x509write_csr mbedtls_x509write_csr -#define x509write_csr_der mbedtls_x509write_csr_der -#define x509write_csr_free mbedtls_x509write_csr_free -#define x509write_csr_init mbedtls_x509write_csr_init -#define x509write_csr_pem mbedtls_x509write_csr_pem -#define x509write_csr_set_extension mbedtls_x509write_csr_set_extension -#define x509write_csr_set_key mbedtls_x509write_csr_set_key -#define x509write_csr_set_key_usage mbedtls_x509write_csr_set_key_usage -#define x509write_csr_set_md_alg mbedtls_x509write_csr_set_md_alg -#define x509write_csr_set_ns_cert_type mbedtls_x509write_csr_set_ns_cert_type -#define x509write_csr_set_subject_name mbedtls_x509write_csr_set_subject_name -#define xtea_context mbedtls_xtea_context -#define xtea_crypt_cbc mbedtls_xtea_crypt_cbc -#define xtea_crypt_ecb mbedtls_xtea_crypt_ecb -#define xtea_free mbedtls_xtea_free -#define xtea_init mbedtls_xtea_init -#define xtea_self_test mbedtls_xtea_self_test -#define xtea_setup mbedtls_xtea_setup - -#endif /* compat-1.3.h */ -#endif /* MBEDTLS_DEPRECATED_REMOVED */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/config.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/config.h deleted file mode 100644 index e00c546e5..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/config.h +++ /dev/null @@ -1,3770 +0,0 @@ -/** - * \file config.h - * - * \brief Configuration options (set of defines) - * - * This set of compile-time options may be used to enable - * or disable features selectively, and reduce the global - * memory footprint. - */ -/* - * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CONFIG_H -#define MBEDTLS_CONFIG_H - -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif - -/** - * \name SECTION: System support - * - * This section sets system specific settings. - * \{ - */ - -/** - * \def MBEDTLS_HAVE_ASM - * - * The compiler has support for asm(). - * - * Requires support for asm() in compiler. - * - * Used in: - * library/aria.c - * library/timing.c - * include/mbedtls/bn_mul.h - * - * Required by: - * MBEDTLS_AESNI_C - * MBEDTLS_PADLOCK_C - * - * Comment to disable the use of assembly code. - */ -#define MBEDTLS_HAVE_ASM - -/** - * \def MBEDTLS_NO_UDBL_DIVISION - * - * The platform lacks support for double-width integer division (64-bit - * division on a 32-bit platform, 128-bit division on a 64-bit platform). - * - * Used in: - * include/mbedtls/bignum.h - * library/bignum.c - * - * The bignum code uses double-width division to speed up some operations. - * Double-width division is often implemented in software that needs to - * be linked with the program. The presence of a double-width integer - * type is usually detected automatically through preprocessor macros, - * but the automatic detection cannot know whether the code needs to - * and can be linked with an implementation of division for that type. - * By default division is assumed to be usable if the type is present. - * Uncomment this option to prevent the use of double-width division. - * - * Note that division for the native integer type is always required. - * Furthermore, a 64-bit type is always required even on a 32-bit - * platform, but it need not support multiplication or division. In some - * cases it is also desirable to disable some double-width operations. For - * example, if double-width division is implemented in software, disabling - * it can reduce code size in some embedded targets. - */ -//#define MBEDTLS_NO_UDBL_DIVISION - -/** - * \def MBEDTLS_NO_64BIT_MULTIPLICATION - * - * The platform lacks support for 32x32 -> 64-bit multiplication. - * - * Used in: - * library/poly1305.c - * - * Some parts of the library may use multiplication of two unsigned 32-bit - * operands with a 64-bit result in order to speed up computations. On some - * platforms, this is not available in hardware and has to be implemented in - * software, usually in a library provided by the toolchain. - * - * Sometimes it is not desirable to have to link to that library. This option - * removes the dependency of that library on platforms that lack a hardware - * 64-bit multiplier by embedding a software implementation in Mbed TLS. - * - * Note that depending on the compiler, this may decrease performance compared - * to using the library function provided by the toolchain. - */ -//#define MBEDTLS_NO_64BIT_MULTIPLICATION - -/** - * \def MBEDTLS_HAVE_SSE2 - * - * CPU supports SSE2 instruction set. - * - * Uncomment if the CPU supports SSE2 (IA-32 specific). - */ -//#define MBEDTLS_HAVE_SSE2 - -/** - * \def MBEDTLS_HAVE_TIME - * - * System has time.h and time(). - * The time does not need to be correct, only time differences are used, - * by contrast with MBEDTLS_HAVE_TIME_DATE - * - * Defining MBEDTLS_HAVE_TIME allows you to specify MBEDTLS_PLATFORM_TIME_ALT, - * MBEDTLS_PLATFORM_TIME_MACRO, MBEDTLS_PLATFORM_TIME_TYPE_MACRO and - * MBEDTLS_PLATFORM_STD_TIME. - * - * Comment if your system does not support time functions - */ -#define MBEDTLS_HAVE_TIME - -/** - * \def MBEDTLS_HAVE_TIME_DATE - * - * System has time.h, time(), and an implementation for - * mbedtls_platform_gmtime_r() (see below). - * The time needs to be correct (not necessarily very accurate, but at least - * the date should be correct). This is used to verify the validity period of - * X.509 certificates. - * - * Comment if your system does not have a correct clock. - * - * \note mbedtls_platform_gmtime_r() is an abstraction in platform_util.h that - * behaves similarly to the gmtime_r() function from the C standard. Refer to - * the documentation for mbedtls_platform_gmtime_r() for more information. - * - * \note It is possible to configure an implementation for - * mbedtls_platform_gmtime_r() at compile-time by using the macro - * MBEDTLS_PLATFORM_GMTIME_R_ALT. - */ -#define MBEDTLS_HAVE_TIME_DATE - -/** - * \def MBEDTLS_PLATFORM_MEMORY - * - * Enable the memory allocation layer. - * - * By default mbed TLS uses the system-provided calloc() and free(). - * This allows different allocators (self-implemented or provided) to be - * provided to the platform abstraction layer. - * - * Enabling MBEDTLS_PLATFORM_MEMORY without the - * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide - * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative calloc() and - * free() function pointer at runtime. - * - * Enabling MBEDTLS_PLATFORM_MEMORY and specifying - * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the - * alternate function at compile time. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Enable this layer to allow use of alternative memory allocators. - */ -//#define MBEDTLS_PLATFORM_MEMORY - -/** - * \def MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - * - * Do not assign standard functions in the platform layer (e.g. calloc() to - * MBEDTLS_PLATFORM_STD_CALLOC and printf() to MBEDTLS_PLATFORM_STD_PRINTF) - * - * This makes sure there are no linking errors on platforms that do not support - * these functions. You will HAVE to provide alternatives, either at runtime - * via the platform_set_xxx() functions or at compile time by setting - * the MBEDTLS_PLATFORM_STD_XXX defines, or enabling a - * MBEDTLS_PLATFORM_XXX_MACRO. - * - * Requires: MBEDTLS_PLATFORM_C - * - * Uncomment to prevent default assignment of standard functions in the - * platform layer. - */ -//#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS - -/** - * \def MBEDTLS_PLATFORM_EXIT_ALT - * - * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the - * function in the platform abstraction layer. - * - * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will - * provide a function "mbedtls_platform_set_printf()" that allows you to set an - * alternative printf function pointer. - * - * All these define require MBEDTLS_PLATFORM_C to be defined! - * - * \note MBEDTLS_PLATFORM_SNPRINTF_ALT is required on Windows; - * it will be enabled automatically by check_config.h - * - * \warning MBEDTLS_PLATFORM_XXX_ALT cannot be defined at the same time as - * MBEDTLS_PLATFORM_XXX_MACRO! - * - * Requires: MBEDTLS_PLATFORM_TIME_ALT requires MBEDTLS_HAVE_TIME - * - * Uncomment a macro to enable alternate implementation of specific base - * platform function - */ -//#define MBEDTLS_PLATFORM_EXIT_ALT -//#define MBEDTLS_PLATFORM_TIME_ALT -//#define MBEDTLS_PLATFORM_FPRINTF_ALT -//#define MBEDTLS_PLATFORM_PRINTF_ALT -//#define MBEDTLS_PLATFORM_SNPRINTF_ALT -//#define MBEDTLS_PLATFORM_VSNPRINTF_ALT -//#define MBEDTLS_PLATFORM_NV_SEED_ALT -//#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT - -/** - * \def MBEDTLS_DEPRECATED_WARNING - * - * Mark deprecated functions and features so that they generate a warning if - * used. Functionality deprecated in one version will usually be removed in the - * next version. You can enable this to help you prepare the transition to a - * new major version by making sure your code is not using this functionality. - * - * This only works with GCC and Clang. With other compilers, you may want to - * use MBEDTLS_DEPRECATED_REMOVED - * - * Uncomment to get warnings on using deprecated functions and features. - */ -//#define MBEDTLS_DEPRECATED_WARNING - -/** - * \def MBEDTLS_DEPRECATED_REMOVED - * - * Remove deprecated functions and features so that they generate an error if - * used. Functionality deprecated in one version will usually be removed in the - * next version. You can enable this to help you prepare the transition to a - * new major version by making sure your code is not using this functionality. - * - * Uncomment to get errors on using deprecated functions and features. - */ -//#define MBEDTLS_DEPRECATED_REMOVED - -/** - * \def MBEDTLS_CHECK_PARAMS - * - * This configuration option controls whether the library validates more of - * the parameters passed to it. - * - * When this flag is not defined, the library only attempts to validate an - * input parameter if: (1) they may come from the outside world (such as the - * network, the filesystem, etc.) or (2) not validating them could result in - * internal memory errors such as overflowing a buffer controlled by the - * library. On the other hand, it doesn't attempt to validate parameters whose - * values are fully controlled by the application (such as pointers). - * - * When this flag is defined, the library additionally attempts to validate - * parameters that are fully controlled by the application, and should always - * be valid if the application code is fully correct and trusted. - * - * For example, when a function accepts as input a pointer to a buffer that may - * contain untrusted data, and its documentation mentions that this pointer - * must not be NULL: - * - The pointer is checked to be non-NULL only if this option is enabled. - * - The content of the buffer is always validated. - * - * When this flag is defined, if a library function receives a parameter that - * is invalid: - * 1. The function will invoke the macro MBEDTLS_PARAM_FAILED(). - * 2. If MBEDTLS_PARAM_FAILED() did not terminate the program, the function - * will immediately return. If the function returns an Mbed TLS error code, - * the error code in this case is MBEDTLS_ERR_xxx_BAD_INPUT_DATA. - * - * When defining this flag, you also need to arrange a definition for - * MBEDTLS_PARAM_FAILED(). You can do this by any of the following methods: - * - By default, the library defines MBEDTLS_PARAM_FAILED() to call a - * function mbedtls_param_failed(), but the library does not define this - * function. If you do not make any other arrangements, you must provide - * the function mbedtls_param_failed() in your application. - * See `platform_util.h` for its prototype. - * - If you enable the macro #MBEDTLS_CHECK_PARAMS_ASSERT, then the - * library defines MBEDTLS_PARAM_FAILED(\c cond) to be `assert(cond)`. - * You can still supply an alternative definition of - * MBEDTLS_PARAM_FAILED(), which may call `assert`. - * - If you define a macro MBEDTLS_PARAM_FAILED() before including `config.h` - * or you uncomment the definition of MBEDTLS_PARAM_FAILED() in `config.h`, - * the library will call the macro that you defined and will not supply - * its own version. Note that if MBEDTLS_PARAM_FAILED() calls `assert`, - * you need to enable #MBEDTLS_CHECK_PARAMS_ASSERT so that library source - * files include ``. - * - * Uncomment to enable validation of application-controlled parameters. - */ -//#define MBEDTLS_CHECK_PARAMS - -/** - * \def MBEDTLS_CHECK_PARAMS_ASSERT - * - * Allow MBEDTLS_PARAM_FAILED() to call `assert`, and make it default to - * `assert`. This macro is only used if #MBEDTLS_CHECK_PARAMS is defined. - * - * If this macro is not defined, then MBEDTLS_PARAM_FAILED() defaults to - * calling a function mbedtls_param_failed(). See the documentation of - * #MBEDTLS_CHECK_PARAMS for details. - * - * Uncomment to allow MBEDTLS_PARAM_FAILED() to call `assert`. - */ -//#define MBEDTLS_CHECK_PARAMS_ASSERT - -/* \} name SECTION: System support */ - -/** - * \name SECTION: mbed TLS feature support - * - * This section sets support for features that are or are not needed - * within the modules that are enabled. - * \{ - */ - -/** - * \def MBEDTLS_TIMING_ALT - * - * Uncomment to provide your own alternate implementation for mbedtls_timing_hardclock(), - * mbedtls_timing_get_timer(), mbedtls_set_alarm(), mbedtls_set/get_delay() - * - * Only works if you have MBEDTLS_TIMING_C enabled. - * - * You will need to provide a header "timing_alt.h" and an implementation at - * compile time. - */ -//#define MBEDTLS_TIMING_ALT - -/** - * \def MBEDTLS_AES_ALT - * - * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your - * alternate core implementation of a symmetric crypto, an arithmetic or hash - * module (e.g. platform specific assembly optimized implementations). Keep - * in mind that the function prototypes should remain the same. - * - * This replaces the whole module. If you only want to replace one of the - * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer - * provide the "struct mbedtls_aes_context" definition and omit the base - * function declarations and implementations. "aes_alt.h" will be included from - * "aes.h" to include the new function definitions. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * module. - * - * \warning MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and their - * use constitutes a security risk. If possible, we recommend - * avoiding dependencies on them, and considering stronger message - * digests and ciphers instead. - * - */ -//#define MBEDTLS_AES_ALT -//#define MBEDTLS_ARC4_ALT -//#define MBEDTLS_ARIA_ALT -//#define MBEDTLS_BLOWFISH_ALT -//#define MBEDTLS_CAMELLIA_ALT -//#define MBEDTLS_CCM_ALT -//#define MBEDTLS_CHACHA20_ALT -//#define MBEDTLS_CHACHAPOLY_ALT -//#define MBEDTLS_CMAC_ALT -//#define MBEDTLS_DES_ALT -//#define MBEDTLS_DHM_ALT -//#define MBEDTLS_ECJPAKE_ALT -//#define MBEDTLS_GCM_ALT -//#define MBEDTLS_NIST_KW_ALT -//#define MBEDTLS_MD2_ALT -//#define MBEDTLS_MD4_ALT -//#define MBEDTLS_MD5_ALT -//#define MBEDTLS_POLY1305_ALT -//#define MBEDTLS_RIPEMD160_ALT -//#define MBEDTLS_RSA_ALT -//#define MBEDTLS_SHA1_ALT -//#define MBEDTLS_SHA256_ALT -//#define MBEDTLS_SHA512_ALT -//#define MBEDTLS_XTEA_ALT - -/* - * When replacing the elliptic curve module, pleace consider, that it is - * implemented with two .c files: - * - ecp.c - * - ecp_curves.c - * You can replace them very much like all the other MBEDTLS__MODULE_NAME__ALT - * macros as described above. The only difference is that you have to make sure - * that you provide functionality for both .c files. - */ -//#define MBEDTLS_ECP_ALT - -/** - * \def MBEDTLS_MD2_PROCESS_ALT - * - * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you - * alternate core implementation of symmetric crypto or hash function. Keep in - * mind that function prototypes should remain the same. - * - * This replaces only one function. The header file from mbed TLS is still - * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags. - * - * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will - * no longer provide the mbedtls_sha1_process() function, but it will still provide - * the other function (using your mbedtls_sha1_process() function) and the definition - * of mbedtls_sha1_context, so your implementation of mbedtls_sha1_process must be compatible - * with this definition. - * - * \note Because of a signature change, the core AES encryption and decryption routines are - * currently named mbedtls_aes_internal_encrypt and mbedtls_aes_internal_decrypt, - * respectively. When setting up alternative implementations, these functions should - * be overridden, but the wrapper functions mbedtls_aes_decrypt and mbedtls_aes_encrypt - * must stay untouched. - * - * \note If you use the AES_xxx_ALT macros, then is is recommended to also set - * MBEDTLS_AES_ROM_TABLES in order to help the linker garbage-collect the AES - * tables. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - * - * \warning MD2, MD4, MD5, DES and SHA-1 are considered weak and their use - * constitutes a security risk. If possible, we recommend avoiding - * dependencies on them, and considering stronger message digests - * and ciphers instead. - * - * \warning If both MBEDTLS_ECDSA_SIGN_ALT and MBEDTLS_ECDSA_DETERMINISTIC are - * enabled, then the deterministic ECDH signature functions pass the - * the static HMAC-DRBG as RNG to mbedtls_ecdsa_sign(). Therefore - * alternative implementations should use the RNG only for generating - * the ephemeral key and nothing else. If this is not possible, then - * MBEDTLS_ECDSA_DETERMINISTIC should be disabled and an alternative - * implementation should be provided for mbedtls_ecdsa_sign_det_ext() - * (and for mbedtls_ecdsa_sign_det() too if backward compatibility is - * desirable). - * - */ -//#define MBEDTLS_MD2_PROCESS_ALT -//#define MBEDTLS_MD4_PROCESS_ALT -//#define MBEDTLS_MD5_PROCESS_ALT -//#define MBEDTLS_RIPEMD160_PROCESS_ALT -//#define MBEDTLS_SHA1_PROCESS_ALT -//#define MBEDTLS_SHA256_PROCESS_ALT -//#define MBEDTLS_SHA512_PROCESS_ALT -//#define MBEDTLS_DES_SETKEY_ALT -//#define MBEDTLS_DES_CRYPT_ECB_ALT -//#define MBEDTLS_DES3_CRYPT_ECB_ALT -//#define MBEDTLS_AES_SETKEY_ENC_ALT -//#define MBEDTLS_AES_SETKEY_DEC_ALT -//#define MBEDTLS_AES_ENCRYPT_ALT -//#define MBEDTLS_AES_DECRYPT_ALT -//#define MBEDTLS_ECDH_GEN_PUBLIC_ALT -//#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT -//#define MBEDTLS_ECDSA_VERIFY_ALT -//#define MBEDTLS_ECDSA_SIGN_ALT -//#define MBEDTLS_ECDSA_GENKEY_ALT - -/** - * \def MBEDTLS_ECP_INTERNAL_ALT - * - * Expose a part of the internal interface of the Elliptic Curve Point module. - * - * MBEDTLS_ECP__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use your - * alternative core implementation of elliptic curve arithmetic. Keep in mind - * that function prototypes should remain the same. - * - * This partially replaces one function. The header file from mbed TLS is still - * used, in contrast to the MBEDTLS_ECP_ALT flag. The original implementation - * is still present and it is used for group structures not supported by the - * alternative. - * - * Any of these options become available by defining MBEDTLS_ECP_INTERNAL_ALT - * and implementing the following functions: - * unsigned char mbedtls_internal_ecp_grp_capable( - * const mbedtls_ecp_group *grp ) - * int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp ) - * void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp ) - * The mbedtls_internal_ecp_grp_capable function should return 1 if the - * replacement functions implement arithmetic for the given group and 0 - * otherwise. - * The functions mbedtls_internal_ecp_init and mbedtls_internal_ecp_free are - * called before and after each point operation and provide an opportunity to - * implement optimized set up and tear down instructions. - * - * Example: In case you uncomment MBEDTLS_ECP_INTERNAL_ALT and - * MBEDTLS_ECP_DOUBLE_JAC_ALT, mbed TLS will still provide the ecp_double_jac - * function, but will use your mbedtls_internal_ecp_double_jac if the group is - * supported (your mbedtls_internal_ecp_grp_capable function returns 1 when - * receives it as an argument). If the group is not supported then the original - * implementation is used. The other functions and the definition of - * mbedtls_ecp_group and mbedtls_ecp_point will not change, so your - * implementation of mbedtls_internal_ecp_double_jac and - * mbedtls_internal_ecp_grp_capable must be compatible with this definition. - * - * Uncomment a macro to enable alternate implementation of the corresponding - * function. - */ -/* Required for all the functions in this section */ -//#define MBEDTLS_ECP_INTERNAL_ALT -/* Support for Weierstrass curves with Jacobi representation */ -//#define MBEDTLS_ECP_RANDOMIZE_JAC_ALT -//#define MBEDTLS_ECP_ADD_MIXED_ALT -//#define MBEDTLS_ECP_DOUBLE_JAC_ALT -//#define MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT -//#define MBEDTLS_ECP_NORMALIZE_JAC_ALT -/* Support for curves with Montgomery arithmetic */ -//#define MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT -//#define MBEDTLS_ECP_RANDOMIZE_MXZ_ALT -//#define MBEDTLS_ECP_NORMALIZE_MXZ_ALT - -/** - * \def MBEDTLS_TEST_NULL_ENTROPY - * - * Enables testing and use of mbed TLS without any configured entropy sources. - * This permits use of the library on platforms before an entropy source has - * been integrated (see for example the MBEDTLS_ENTROPY_HARDWARE_ALT or the - * MBEDTLS_ENTROPY_NV_SEED switches). - * - * WARNING! This switch MUST be disabled in production builds, and is suitable - * only for development. - * Enabling the switch negates any security provided by the library. - * - * Requires MBEDTLS_ENTROPY_C, MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - * - */ -//#define MBEDTLS_TEST_NULL_ENTROPY - -/** - * \def MBEDTLS_ENTROPY_HARDWARE_ALT - * - * Uncomment this macro to let mbed TLS use your own implementation of a - * hardware entropy collector. - * - * Your function must be called \c mbedtls_hardware_poll(), have the same - * prototype as declared in entropy_poll.h, and accept NULL as first argument. - * - * Uncomment to use your own hardware entropy collector. - */ -//#define MBEDTLS_ENTROPY_HARDWARE_ALT - -/** - * \def MBEDTLS_AES_ROM_TABLES - * - * Use precomputed AES tables stored in ROM. - * - * Uncomment this macro to use precomputed AES tables stored in ROM. - * Comment this macro to generate AES tables in RAM at runtime. - * - * Tradeoff: Using precomputed ROM tables reduces RAM usage by ~8kb - * (or ~2kb if \c MBEDTLS_AES_FEWER_TABLES is used) and reduces the - * initialization time before the first AES operation can be performed. - * It comes at the cost of additional ~8kb ROM use (resp. ~2kb if \c - * MBEDTLS_AES_FEWER_TABLES below is used), and potentially degraded - * performance if ROM access is slower than RAM access. - * - * This option is independent of \c MBEDTLS_AES_FEWER_TABLES. - * - */ -//#define MBEDTLS_AES_ROM_TABLES - -/** - * \def MBEDTLS_AES_FEWER_TABLES - * - * Use less ROM/RAM for AES tables. - * - * Uncommenting this macro omits 75% of the AES tables from - * ROM / RAM (depending on the value of \c MBEDTLS_AES_ROM_TABLES) - * by computing their values on the fly during operations - * (the tables are entry-wise rotations of one another). - * - * Tradeoff: Uncommenting this reduces the RAM / ROM footprint - * by ~6kb but at the cost of more arithmetic operations during - * runtime. Specifically, one has to compare 4 accesses within - * different tables to 4 accesses with additional arithmetic - * operations within the same table. The performance gain/loss - * depends on the system and memory details. - * - * This option is independent of \c MBEDTLS_AES_ROM_TABLES. - * - */ -//#define MBEDTLS_AES_FEWER_TABLES - -/** - * \def MBEDTLS_CAMELLIA_SMALL_MEMORY - * - * Use less ROM for the Camellia implementation (saves about 768 bytes). - * - * Uncomment this macro to use less memory for Camellia. - */ -//#define MBEDTLS_CAMELLIA_SMALL_MEMORY - -/** - * \def MBEDTLS_CIPHER_MODE_CBC - * - * Enable Cipher Block Chaining mode (CBC) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CBC - -/** - * \def MBEDTLS_CIPHER_MODE_CFB - * - * Enable Cipher Feedback mode (CFB) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CFB - -/** - * \def MBEDTLS_CIPHER_MODE_CTR - * - * Enable Counter Block Cipher mode (CTR) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_CTR - -/** - * \def MBEDTLS_CIPHER_MODE_OFB - * - * Enable Output Feedback mode (OFB) for symmetric ciphers. - */ -#define MBEDTLS_CIPHER_MODE_OFB - -/** - * \def MBEDTLS_CIPHER_MODE_XTS - * - * Enable Xor-encrypt-xor with ciphertext stealing mode (XTS) for AES. - */ -#define MBEDTLS_CIPHER_MODE_XTS - -/** - * \def MBEDTLS_CIPHER_NULL_CIPHER - * - * Enable NULL cipher. - * Warning: Only do so when you know what you are doing. This allows for - * encryption or channels without any security! - * - * Requires MBEDTLS_ENABLE_WEAK_CIPHERSUITES as well to enable - * the following ciphersuites: - * MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_WITH_NULL_SHA - * MBEDTLS_TLS_RSA_WITH_NULL_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA - * MBEDTLS_TLS_PSK_WITH_NULL_SHA384 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA256 - * MBEDTLS_TLS_PSK_WITH_NULL_SHA - * - * Uncomment this macro to enable the NULL cipher and ciphersuites - */ -//#define MBEDTLS_CIPHER_NULL_CIPHER - -/** - * \def MBEDTLS_CIPHER_PADDING_PKCS7 - * - * MBEDTLS_CIPHER_PADDING_XXX: Uncomment or comment macros to add support for - * specific padding modes in the cipher layer with cipher modes that support - * padding (e.g. CBC) - * - * If you disable all padding modes, only full blocks can be used with CBC. - * - * Enable padding modes in the cipher layer. - */ -#define MBEDTLS_CIPHER_PADDING_PKCS7 -#define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS -#define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN -#define MBEDTLS_CIPHER_PADDING_ZEROS - -/** \def MBEDTLS_CTR_DRBG_USE_128_BIT_KEY - * - * Uncomment this macro to use a 128-bit key in the CTR_DRBG module. - * By default, CTR_DRBG uses a 256-bit key. - */ -//#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY - -/** - * \def MBEDTLS_ENABLE_WEAK_CIPHERSUITES - * - * Enable weak ciphersuites in SSL / TLS. - * Warning: Only do so when you know what you are doing. This allows for - * channels with virtually no security at all! - * - * This enables the following ciphersuites: - * MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA - * - * Uncomment this macro to enable weak ciphersuites - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -//#define MBEDTLS_ENABLE_WEAK_CIPHERSUITES - -/** - * \def MBEDTLS_REMOVE_ARC4_CIPHERSUITES - * - * Remove RC4 ciphersuites by default in SSL / TLS. - * This flag removes the ciphersuites based on RC4 from the default list as - * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible to - * enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including them - * explicitly. - * - * Uncomment this macro to remove RC4 ciphersuites by default. - */ -#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES - -/** - * \def MBEDTLS_REMOVE_3DES_CIPHERSUITES - * - * Remove 3DES ciphersuites by default in SSL / TLS. - * This flag removes the ciphersuites based on 3DES from the default list as - * returned by mbedtls_ssl_list_ciphersuites(). However, it is still possible - * to enable (some of) them with mbedtls_ssl_conf_ciphersuites() by including - * them explicitly. - * - * A man-in-the-browser attacker can recover authentication tokens sent through - * a TLS connection using a 3DES based cipher suite (see "On the Practical - * (In-)Security of 64-bit Block Ciphers" by Karthikeyan Bhargavan and Gaëtan - * Leurent, see https://sweet32.info/SWEET32_CCS16.pdf). If this attack falls - * in your threat model or you are unsure, then you should keep this option - * enabled to remove 3DES based cipher suites. - * - * Comment this macro to keep 3DES in the default ciphersuite list. - */ -#define MBEDTLS_REMOVE_3DES_CIPHERSUITES - -/** - * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED - * - * MBEDTLS_ECP_XXXX_ENABLED: Enables specific curves within the Elliptic Curve - * module. By default all supported curves are enabled. - * - * Comment macros to disable the curve and functions for it - */ -#define MBEDTLS_ECP_DP_SECP192R1_ENABLED -#define MBEDTLS_ECP_DP_SECP224R1_ENABLED -#define MBEDTLS_ECP_DP_SECP256R1_ENABLED -#define MBEDTLS_ECP_DP_SECP384R1_ENABLED -#define MBEDTLS_ECP_DP_SECP521R1_ENABLED -#define MBEDTLS_ECP_DP_SECP192K1_ENABLED -#define MBEDTLS_ECP_DP_SECP224K1_ENABLED -#define MBEDTLS_ECP_DP_SECP256K1_ENABLED -#define MBEDTLS_ECP_DP_BP256R1_ENABLED -#define MBEDTLS_ECP_DP_BP384R1_ENABLED -#define MBEDTLS_ECP_DP_BP512R1_ENABLED -#define MBEDTLS_ECP_DP_CURVE25519_ENABLED -#define MBEDTLS_ECP_DP_CURVE448_ENABLED - -/** - * \def MBEDTLS_ECP_NIST_OPTIM - * - * Enable specific 'modulo p' routines for each NIST prime. - * Depending on the prime and architecture, makes operations 4 to 8 times - * faster on the corresponding curve. - * - * Comment this macro to disable NIST curves optimisation. - */ -#define MBEDTLS_ECP_NIST_OPTIM - -/** - * \def MBEDTLS_ECP_NO_INTERNAL_RNG - * - * When this option is disabled, mbedtls_ecp_mul() will make use of an - * internal RNG when called with a NULL \c f_rng argument, in order to protect - * against some side-channel attacks. - * - * This protection introduces a dependency of the ECP module on one of the - * DRBG modules. For very constrained implementations that don't require this - * protection (for example, because you're only doing signature verification, - * so not manipulating any secret, or because local/physical side-channel - * attacks are outside your threat model), it might be desirable to get rid of - * that dependency. - * - * \warning Enabling this option makes some uses of ECP vulnerable to some - * side-channel attacks. Only enable it if you know that's not a problem for - * your use case. - * - * Uncomment this macro to disable some counter-measures in ECP. - */ -//#define MBEDTLS_ECP_NO_INTERNAL_RNG - -/** - * \def MBEDTLS_ECP_RESTARTABLE - * - * Enable "non-blocking" ECC operations that can return early and be resumed. - * - * This allows various functions to pause by returning - * #MBEDTLS_ERR_ECP_IN_PROGRESS (or, for functions in the SSL module, - * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS) and then be called later again in - * order to further progress and eventually complete their operation. This is - * controlled through mbedtls_ecp_set_max_ops() which limits the maximum - * number of ECC operations a function may perform before pausing; see - * mbedtls_ecp_set_max_ops() for more information. - * - * This is useful in non-threaded environments if you want to avoid blocking - * for too long on ECC (and, hence, X.509 or SSL/TLS) operations. - * - * Uncomment this macro to enable restartable ECC computations. - * - * \note This option only works with the default software implementation of - * elliptic curve functionality. It is incompatible with - * MBEDTLS_ECP_ALT, MBEDTLS_ECDH_XXX_ALT, MBEDTLS_ECDSA_XXX_ALT - * and MBEDTLS_ECDH_LEGACY_CONTEXT. - */ -//#define MBEDTLS_ECP_RESTARTABLE - -/** - * \def MBEDTLS_ECDH_LEGACY_CONTEXT - * - * Use a backward compatible ECDH context. - * - * Mbed TLS supports two formats for ECDH contexts (#mbedtls_ecdh_context - * defined in `ecdh.h`). For most applications, the choice of format makes - * no difference, since all library functions can work with either format, - * except that the new format is incompatible with MBEDTLS_ECP_RESTARTABLE. - - * The new format used when this option is disabled is smaller - * (56 bytes on a 32-bit platform). In future versions of the library, it - * will support alternative implementations of ECDH operations. - * The new format is incompatible with applications that access - * context fields directly and with restartable ECP operations. - * - * Define this macro if you enable MBEDTLS_ECP_RESTARTABLE or if you - * want to access ECDH context fields directly. Otherwise you should - * comment out this macro definition. - * - * This option has no effect if #MBEDTLS_ECDH_C is not enabled. - * - * \note This configuration option is experimental. Future versions of the - * library may modify the way the ECDH context layout is configured - * and may modify the layout of the new context type. - */ -#define MBEDTLS_ECDH_LEGACY_CONTEXT - -/** - * \def MBEDTLS_ECDSA_DETERMINISTIC - * - * Enable deterministic ECDSA (RFC 6979). - * Standard ECDSA is "fragile" in the sense that lack of entropy when signing - * may result in a compromise of the long-term signing key. This is avoided by - * the deterministic variant. - * - * Requires: MBEDTLS_HMAC_DRBG_C - * - * Comment this macro to disable deterministic ECDSA. - */ -#define MBEDTLS_ECDSA_DETERMINISTIC - -/** - * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - * - * Enable the PSK based ciphersuite modes in SSL / TLS. - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - * - * Enable the DHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -#define MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - * - * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - * - * Enable the RSA-PSK based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED - * - * Enable the RSA-only based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - */ -#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED - * - * Enable the DHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_DHM_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -#define MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - * - * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, - * MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - * - * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C, - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - */ -#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - * - * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - * - * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS. - * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - */ -#define MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED - -/** - * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - * - * Enable the ECJPAKE based ciphersuite modes in SSL / TLS. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Requires: MBEDTLS_ECJPAKE_C - * MBEDTLS_SHA256_C - * MBEDTLS_ECP_DP_SECP256R1_ENABLED - * - * This enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 - */ -//#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED - -/** - * \def MBEDTLS_PK_PARSE_EC_EXTENDED - * - * Enhance support for reading EC keys using variants of SEC1 not allowed by - * RFC 5915 and RFC 5480. - * - * Currently this means parsing the SpecifiedECDomain choice of EC - * parameters (only known groups are supported, not arbitrary domains, to - * avoid validation issues). - * - * Disable if you only need to support RFC 5915 + 5480 key formats. - */ -#define MBEDTLS_PK_PARSE_EC_EXTENDED - -/** - * \def MBEDTLS_ERROR_STRERROR_DUMMY - * - * Enable a dummy error function to make use of mbedtls_strerror() in - * third party libraries easier when MBEDTLS_ERROR_C is disabled - * (no effect when MBEDTLS_ERROR_C is enabled). - * - * You can safely disable this if MBEDTLS_ERROR_C is enabled, or if you're - * not using mbedtls_strerror() or error_strerror() in your application. - * - * Disable if you run into name conflicts and want to really remove the - * mbedtls_strerror() - */ -#define MBEDTLS_ERROR_STRERROR_DUMMY - -/** - * \def MBEDTLS_GENPRIME - * - * Enable the prime-number generation code. - * - * Requires: MBEDTLS_BIGNUM_C - */ -#define MBEDTLS_GENPRIME - -/** - * \def MBEDTLS_FS_IO - * - * Enable functions that use the filesystem. - */ -#define MBEDTLS_FS_IO - -/** - * \def MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - * - * Do not add default entropy sources. These are the platform specific, - * mbedtls_timing_hardclock and HAVEGE based poll functions. - * - * This is useful to have more control over the added entropy sources in an - * application. - * - * Uncomment this macro to prevent loading of default entropy functions. - */ -//#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES - -/** - * \def MBEDTLS_NO_PLATFORM_ENTROPY - * - * Do not use built-in platform entropy functions. - * This is useful if your platform does not support - * standards like the /dev/urandom or Windows CryptoAPI. - * - * Uncomment this macro to disable the built-in platform entropy functions. - */ -//#define MBEDTLS_NO_PLATFORM_ENTROPY - -/** - * \def MBEDTLS_ENTROPY_FORCE_SHA256 - * - * Force the entropy accumulator to use a SHA-256 accumulator instead of the - * default SHA-512 based one (if both are available). - * - * Requires: MBEDTLS_SHA256_C - * - * On 32-bit systems SHA-256 can be much faster than SHA-512. Use this option - * if you have performance concerns. - * - * This option is only useful if both MBEDTLS_SHA256_C and - * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. - */ -//#define MBEDTLS_ENTROPY_FORCE_SHA256 - -/** - * \def MBEDTLS_ENTROPY_NV_SEED - * - * Enable the non-volatile (NV) seed file-based entropy source. - * (Also enables the NV seed read/write functions in the platform layer) - * - * This is crucial (if not required) on systems that do not have a - * cryptographic entropy source (in hardware or kernel) available. - * - * Requires: MBEDTLS_ENTROPY_C, MBEDTLS_PLATFORM_C - * - * \note The read/write functions that are used by the entropy source are - * determined in the platform layer, and can be modified at runtime and/or - * compile-time depending on the flags (MBEDTLS_PLATFORM_NV_SEED_*) used. - * - * \note If you use the default implementation functions that read a seedfile - * with regular fopen(), please make sure you make a seedfile with the - * proper name (defined in MBEDTLS_PLATFORM_STD_NV_SEED_FILE) and at - * least MBEDTLS_ENTROPY_BLOCK_SIZE bytes in size that can be read from - * and written to or you will get an entropy source error! The default - * implementation will only use the first MBEDTLS_ENTROPY_BLOCK_SIZE - * bytes from the file. - * - * \note The entropy collector will write to the seed file before entropy is - * given to an external source, to update it. - */ -//#define MBEDTLS_ENTROPY_NV_SEED - -/* MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER - * - * In PSA key storage, encode the owner of the key. - * - * This is only meaningful when building the library as part of a - * multi-client service. When you activate this option, you must provide - * an implementation of the type psa_key_owner_id_t and a translation - * from psa_key_file_id_t to file name in all the storage backends that - * you wish to support. - * - * Note that this option is meant for internal use only and may be removed - * without notice. - */ -//#define MBEDTLS_PSA_CRYPTO_KEY_FILE_ID_ENCODES_OWNER - -/** - * \def MBEDTLS_MEMORY_DEBUG - * - * Enable debugging of buffer allocator memory issues. Automatically prints - * (to stderr) all (fatal) messages on memory allocation issues. Enables - * function for 'debug output' of allocated memory. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Uncomment this macro to let the buffer allocator print out error messages. - */ -//#define MBEDTLS_MEMORY_DEBUG - -/** - * \def MBEDTLS_MEMORY_BACKTRACE - * - * Include backtrace information with each allocated block. - * - * Requires: MBEDTLS_MEMORY_BUFFER_ALLOC_C - * GLIBC-compatible backtrace() an backtrace_symbols() support - * - * Uncomment this macro to include backtrace information - */ -//#define MBEDTLS_MEMORY_BACKTRACE - -/** - * \def MBEDTLS_PK_RSA_ALT_SUPPORT - * - * Support external private RSA keys (eg from a HSM) in the PK layer. - * - * Comment this macro to disable support for external private RSA keys. - */ -#define MBEDTLS_PK_RSA_ALT_SUPPORT - -/** - * \def MBEDTLS_PKCS1_V15 - * - * Enable support for PKCS#1 v1.5 encoding. - * - * Requires: MBEDTLS_RSA_C - * - * This enables support for PKCS#1 v1.5 operations. - */ -#define MBEDTLS_PKCS1_V15 - -/** - * \def MBEDTLS_PKCS1_V21 - * - * Enable support for PKCS#1 v2.1 encoding. - * - * Requires: MBEDTLS_MD_C, MBEDTLS_RSA_C - * - * This enables support for RSAES-OAEP and RSASSA-PSS operations. - */ -#define MBEDTLS_PKCS1_V21 - -/** - * \def MBEDTLS_PSA_CRYPTO_SPM - * - * When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is built for SPM (Secure - * Partition Manager) integration which separates the code into two parts: a - * NSPE (Non-Secure Process Environment) and an SPE (Secure Process - * Environment). - * - * Module: library/psa_crypto.c - * Requires: MBEDTLS_PSA_CRYPTO_C - * - */ -//#define MBEDTLS_PSA_CRYPTO_SPM - -/** - * \def MBEDTLS_PSA_INJECT_ENTROPY - * - * Enable support for entropy injection at first boot. This feature is - * required on systems that do not have a built-in entropy source (TRNG). - * This feature is currently not supported on systems that have a built-in - * entropy source. - * - * Requires: MBEDTLS_PSA_CRYPTO_STORAGE_C, MBEDTLS_ENTROPY_NV_SEED - * - */ -//#define MBEDTLS_PSA_INJECT_ENTROPY - -/** - * \def MBEDTLS_RSA_NO_CRT - * - * Do not use the Chinese Remainder Theorem - * for the RSA private operation. - * - * Uncomment this macro to disable the use of CRT in RSA. - * - */ -//#define MBEDTLS_RSA_NO_CRT - -/** - * \def MBEDTLS_SELF_TEST - * - * Enable the checkup functions (*_self_test). - */ -#define MBEDTLS_SELF_TEST - -/** - * \def MBEDTLS_SHA256_SMALLER - * - * Enable an implementation of SHA-256 that has lower ROM footprint but also - * lower performance. - * - * The default implementation is meant to be a reasonnable compromise between - * performance and size. This version optimizes more aggressively for size at - * the expense of performance. Eg on Cortex-M4 it reduces the size of - * mbedtls_sha256_process() from ~2KB to ~0.5KB for a performance hit of about - * 30%. - * - * Uncomment to enable the smaller implementation of SHA256. - */ -//#define MBEDTLS_SHA256_SMALLER - -/** - * \def MBEDTLS_SHA512_SMALLER - * - * Enable an implementation of SHA-512 that has lower ROM footprint but also - * lower performance. - * - * Uncomment to enable the smaller implementation of SHA512. - */ -//#define MBEDTLS_SHA512_SMALLER - -/** - * \def MBEDTLS_SHA512_NO_SHA384 - * - * Disable the SHA-384 option of the SHA-512 module. Use this to save some - * code size on devices that don't use SHA-384. - * - * Requires: MBEDTLS_SHA512_C - * - * Uncomment to disable SHA-384 - */ -//#define MBEDTLS_SHA512_NO_SHA384 - -/** - * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES - * - * Enable sending of alert messages in case of encountered errors as per RFC. - * If you choose not to send the alert messages, mbed TLS can still communicate - * with other servers, only debugging of failures is harder. - * - * The advantage of not sending alert messages, is that no information is given - * about reasons for failures thus preventing adversaries of gaining intel. - * - * Enable sending of all alert messages - */ -#define MBEDTLS_SSL_ALL_ALERT_MESSAGES - -/** - * \def MBEDTLS_SSL_RECORD_CHECKING - * - * Enable the function mbedtls_ssl_check_record() which can be used to check - * the validity and authenticity of an incoming record, to verify that it has - * not been seen before. These checks are performed without modifying the - * externally visible state of the SSL context. - * - * See mbedtls_ssl_check_record() for more information. - * - * Uncomment to enable support for record checking. - */ -#define MBEDTLS_SSL_RECORD_CHECKING - -/** - * \def MBEDTLS_SSL_DTLS_CONNECTION_ID - * - * Enable support for the DTLS Connection ID extension - * (version draft-ietf-tls-dtls-connection-id-05, - * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05) - * which allows to identify DTLS connections across changes - * in the underlying transport. - * - * Setting this option enables the SSL APIs `mbedtls_ssl_set_cid()`, - * `mbedtls_ssl_get_peer_cid()` and `mbedtls_ssl_conf_cid()`. - * See the corresponding documentation for more information. - * - * \warning The Connection ID extension is still in draft state. - * We make no stability promises for the availability - * or the shape of the API controlled by this option. - * - * The maximum lengths of outgoing and incoming CIDs can be configured - * through the options - * - MBEDTLS_SSL_CID_OUT_LEN_MAX - * - MBEDTLS_SSL_CID_IN_LEN_MAX. - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - * - * Uncomment to enable the Connection ID extension. - */ -//#define MBEDTLS_SSL_DTLS_CONNECTION_ID - -/** - * \def MBEDTLS_SSL_ASYNC_PRIVATE - * - * Enable asynchronous external private key operations in SSL. This allows - * you to configure an SSL connection to call an external cryptographic - * module to perform private key operations instead of performing the - * operation inside the library. - * - */ -//#define MBEDTLS_SSL_ASYNC_PRIVATE - -/** - * \def MBEDTLS_SSL_CONTEXT_SERIALIZATION - * - * Enable serialization of the TLS context structures, through use of the - * functions mbedtls_ssl_context_save() and mbedtls_ssl_context_load(). - * - * This pair of functions allows one side of a connection to serialize the - * context associated with the connection, then free or re-use that context - * while the serialized state is persisted elsewhere, and finally deserialize - * that state to a live context for resuming read/write operations on the - * connection. From a protocol perspective, the state of the connection is - * unaffected, in particular this is entirely transparent to the peer. - * - * Note: this is distinct from TLS session resumption, which is part of the - * protocol and fully visible by the peer. TLS session resumption enables - * establishing new connections associated to a saved session with shorter, - * lighter handshakes, while context serialization is a local optimization in - * handling a single, potentially long-lived connection. - * - * Enabling these APIs makes some SSL structures larger, as 64 extra bytes are - * saved after the handshake to allow for more efficient serialization, so if - * you don't need this feature you'll save RAM by disabling it. - * - * Comment to disable the context serialization APIs. - */ -#define MBEDTLS_SSL_CONTEXT_SERIALIZATION - -/** - * \def MBEDTLS_SSL_DEBUG_ALL - * - * Enable the debug messages in SSL module for all issues. - * Debug messages have been disabled in some places to prevent timing - * attacks due to (unbalanced) debugging function calls. - * - * If you need all error reporting you should enable this during debugging, - * but remove this for production servers that should log as well. - * - * Uncomment this macro to report all debug messages on errors introducing - * a timing side-channel. - * - */ -//#define MBEDTLS_SSL_DEBUG_ALL - -/** \def MBEDTLS_SSL_ENCRYPT_THEN_MAC - * - * Enable support for Encrypt-then-MAC, RFC 7366. - * - * This allows peers that both support it to use a more robust protection for - * ciphersuites using CBC, providing deep resistance against timing attacks - * on the padding or underlying cipher. - * - * This only affects CBC ciphersuites, and is useless if none is defined. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1 or - * MBEDTLS_SSL_PROTO_TLS1_1 or - * MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Encrypt-then-MAC - */ -#define MBEDTLS_SSL_ENCRYPT_THEN_MAC - -/** \def MBEDTLS_SSL_EXTENDED_MASTER_SECRET - * - * Enable support for RFC 7627: Session Hash and Extended Master Secret - * Extension. - * - * This was introduced as "the proper fix" to the Triple Handshake familiy of - * attacks, but it is recommended to always use it (even if you disable - * renegotiation), since it actually fixes a more fundamental issue in the - * original SSL/TLS design, and has implications beyond Triple Handshake. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1 or - * MBEDTLS_SSL_PROTO_TLS1_1 or - * MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for Extended Master Secret. - */ -#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET - -/** - * \def MBEDTLS_SSL_FALLBACK_SCSV - * - * Enable support for RFC 7507: Fallback Signaling Cipher Suite Value (SCSV) - * for Preventing Protocol Downgrade Attacks. - * - * For servers, it is recommended to always enable this, unless you support - * only one version of TLS, or know for sure that none of your clients - * implements a fallback strategy. - * - * For clients, you only need this if you're using a fallback strategy, which - * is not recommended in the first place, unless you absolutely need it to - * interoperate with buggy (version-intolerant) servers. - * - * Comment this macro to disable support for FALLBACK_SCSV - */ -#define MBEDTLS_SSL_FALLBACK_SCSV - -/** - * \def MBEDTLS_SSL_KEEP_PEER_CERTIFICATE - * - * This option controls the availability of the API mbedtls_ssl_get_peer_cert() - * giving access to the peer's certificate after completion of the handshake. - * - * Unless you need mbedtls_ssl_peer_cert() in your application, it is - * recommended to disable this option for reduced RAM usage. - * - * \note If this option is disabled, mbedtls_ssl_get_peer_cert() is still - * defined, but always returns \c NULL. - * - * \note This option has no influence on the protection against the - * triple handshake attack. Even if it is disabled, Mbed TLS will - * still ensure that certificates do not change during renegotiation, - * for exaple by keeping a hash of the peer's certificate. - * - * Comment this macro to disable storing the peer's certificate - * after the handshake. - */ -#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE - -/** - * \def MBEDTLS_SSL_HW_RECORD_ACCEL - * - * Enable hooking functions in SSL module for hardware acceleration of - * individual records. - * - * \deprecated This option is deprecated and will be removed in a future - * version of Mbed TLS. - * - * Uncomment this macro to enable hooking functions. - */ -//#define MBEDTLS_SSL_HW_RECORD_ACCEL - -/** - * \def MBEDTLS_SSL_CBC_RECORD_SPLITTING - * - * Enable 1/n-1 record splitting for CBC mode in SSLv3 and TLS 1.0. - * - * This is a countermeasure to the BEAST attack, which also minimizes the risk - * of interoperability issues compared to sending 0-length records. - * - * Comment this macro to disable 1/n-1 record splitting. - */ -#define MBEDTLS_SSL_CBC_RECORD_SPLITTING - -/** - * \def MBEDTLS_SSL_RENEGOTIATION - * - * Enable support for TLS renegotiation. - * - * The two main uses of renegotiation are (1) refresh keys on long-lived - * connections and (2) client authentication after the initial handshake. - * If you don't need renegotiation, it's probably better to disable it, since - * it has been associated with security issues in the past and is easy to - * misuse/misunderstand. - * - * Comment this to disable support for renegotiation. - * - * \note Even if this option is disabled, both client and server are aware - * of the Renegotiation Indication Extension (RFC 5746) used to - * prevent the SSL renegotiation attack (see RFC 5746 Sect. 1). - * (See \c mbedtls_ssl_conf_legacy_renegotiation for the - * configuration of this extension). - * - */ -#define MBEDTLS_SSL_RENEGOTIATION - -/** - * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - * - * Enable support for receiving and parsing SSLv2 Client Hello messages for the - * SSL Server module (MBEDTLS_SSL_SRV_C). - * - * \deprecated This option is deprecated and will be removed in a future - * version of Mbed TLS. - * - * Uncomment this macro to enable support for SSLv2 Client Hello messages. - */ -//#define MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO - -/** - * \def MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE - * - * Pick the ciphersuite according to the client's preferences rather than ours - * in the SSL Server module (MBEDTLS_SSL_SRV_C). - * - * Uncomment this macro to respect client's ciphersuite order - */ -//#define MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE - -/** - * \def MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - * - * Enable support for RFC 6066 max_fragment_length extension in SSL. - * - * Comment this macro to disable support for the max_fragment_length extension - */ -#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH - -/** - * \def MBEDTLS_SSL_PROTO_SSL3 - * - * Enable support for SSL 3.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * \deprecated This option is deprecated and will be removed in a future - * version of Mbed TLS. - * - * Comment this macro to disable support for SSL 3.0 - */ -//#define MBEDTLS_SSL_PROTO_SSL3 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1 - * - * Enable support for TLS 1.0. - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.0 - */ -#define MBEDTLS_SSL_PROTO_TLS1 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_1 - * - * Enable support for TLS 1.1 (and DTLS 1.0 if DTLS is enabled). - * - * Requires: MBEDTLS_MD5_C - * MBEDTLS_SHA1_C - * - * Comment this macro to disable support for TLS 1.1 / DTLS 1.0 - */ -#define MBEDTLS_SSL_PROTO_TLS1_1 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_2 - * - * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled). - * - * Requires: MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C - * (Depends on ciphersuites) - * - * Comment this macro to disable support for TLS 1.2 / DTLS 1.2 - */ -#define MBEDTLS_SSL_PROTO_TLS1_2 - -/** - * \def MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL - * - * This macro is used to selectively enable experimental parts - * of the code that contribute to the ongoing development of - * the prototype TLS 1.3 and DTLS 1.3 implementation, and provide - * no other purpose. - * - * \warning TLS 1.3 and DTLS 1.3 aren't yet supported in Mbed TLS, - * and no feature exposed through this macro is part of the - * public API. In particular, features under the control - * of this macro are experimental and don't come with any - * stability guarantees. - * - * Uncomment this macro to enable experimental and partial - * functionality specific to TLS 1.3. - */ -//#define MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL - -/** - * \def MBEDTLS_SSL_PROTO_DTLS - * - * Enable support for DTLS (all available versions). - * - * Enable this and MBEDTLS_SSL_PROTO_TLS1_1 to enable DTLS 1.0, - * and/or this and MBEDTLS_SSL_PROTO_TLS1_2 to enable DTLS 1.2. - * - * Requires: MBEDTLS_SSL_PROTO_TLS1_1 - * or MBEDTLS_SSL_PROTO_TLS1_2 - * - * Comment this macro to disable support for DTLS - */ -#define MBEDTLS_SSL_PROTO_DTLS - -/** - * \def MBEDTLS_SSL_ALPN - * - * Enable support for RFC 7301 Application Layer Protocol Negotiation. - * - * Comment this macro to disable support for ALPN. - */ -#define MBEDTLS_SSL_ALPN - -/** - * \def MBEDTLS_SSL_DTLS_ANTI_REPLAY - * - * Enable support for the anti-replay mechanism in DTLS. - * - * Requires: MBEDTLS_SSL_TLS_C - * MBEDTLS_SSL_PROTO_DTLS - * - * \warning Disabling this is often a security risk! - * See mbedtls_ssl_conf_dtls_anti_replay() for details. - * - * Comment this to disable anti-replay in DTLS. - */ -#define MBEDTLS_SSL_DTLS_ANTI_REPLAY - -/** - * \def MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Enable support for HelloVerifyRequest on DTLS servers. - * - * This feature is highly recommended to prevent DTLS servers being used as - * amplifiers in DoS attacks against other hosts. It should always be enabled - * unless you know for sure amplification cannot be a problem in the - * environment in which your server operates. - * - * \warning Disabling this can ba a security risk! (see above) - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - * - * Comment this to disable support for HelloVerifyRequest. - */ -#define MBEDTLS_SSL_DTLS_HELLO_VERIFY - -/** - * \def MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - * - * Enable server-side support for clients that reconnect from the same port. - * - * Some clients unexpectedly close the connection and try to reconnect using the - * same source port. This needs special support from the server to handle the - * new connection securely, as described in section 4.2.8 of RFC 6347. This - * flag enables that support. - * - * Requires: MBEDTLS_SSL_DTLS_HELLO_VERIFY - * - * Comment this to disable support for clients reusing the source port. - */ -#define MBEDTLS_SSL_DTLS_CLIENT_PORT_REUSE - -/** - * \def MBEDTLS_SSL_DTLS_BADMAC_LIMIT - * - * Enable support for a limit of records with bad MAC. - * - * See mbedtls_ssl_conf_dtls_badmac_limit(). - * - * Requires: MBEDTLS_SSL_PROTO_DTLS - */ -#define MBEDTLS_SSL_DTLS_BADMAC_LIMIT - -/** - * \def MBEDTLS_SSL_SESSION_TICKETS - * - * Enable support for RFC 5077 session tickets in SSL. - * Client-side, provides full support for session tickets (maintenance of a - * session store remains the responsibility of the application, though). - * Server-side, you also need to provide callbacks for writing and parsing - * tickets, including authenticated encryption and key management. Example - * callbacks are provided by MBEDTLS_SSL_TICKET_C. - * - * Comment this macro to disable support for SSL session tickets - */ -#define MBEDTLS_SSL_SESSION_TICKETS - -/** - * \def MBEDTLS_SSL_EXPORT_KEYS - * - * Enable support for exporting key block and master secret. - * This is required for certain users of TLS, e.g. EAP-TLS. - * - * Comment this macro to disable support for key export - */ -#define MBEDTLS_SSL_EXPORT_KEYS - -/** - * \def MBEDTLS_SSL_SERVER_NAME_INDICATION - * - * Enable support for RFC 6066 server name indication (SNI) in SSL. - * - * Requires: MBEDTLS_X509_CRT_PARSE_C - * - * Comment this macro to disable support for server name indication in SSL - */ -#define MBEDTLS_SSL_SERVER_NAME_INDICATION - -/** - * \def MBEDTLS_SSL_TRUNCATED_HMAC - * - * Enable support for RFC 6066 truncated HMAC in SSL. - * - * Comment this macro to disable support for truncated HMAC in SSL - */ -#define MBEDTLS_SSL_TRUNCATED_HMAC - -/** - * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT - * - * Fallback to old (pre-2.7), non-conforming implementation of the truncated - * HMAC extension which also truncates the HMAC key. Note that this option is - * only meant for a transitory upgrade period and will be removed in a future - * version of the library. - * - * \warning The old implementation is non-compliant and has a security weakness - * (2^80 brute force attack on the HMAC key used for a single, - * uninterrupted connection). This should only be enabled temporarily - * when (1) the use of truncated HMAC is essential in order to save - * bandwidth, and (2) the peer is an Mbed TLS stack that doesn't use - * the fixed implementation yet (pre-2.7). - * - * \deprecated This option is deprecated and will be removed in a - * future version of Mbed TLS. - * - * Uncomment to fallback to old, non-compliant truncated HMAC implementation. - * - * Requires: MBEDTLS_SSL_TRUNCATED_HMAC - */ -//#define MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT - -/** - * \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH - * - * Enable modifying the maximum I/O buffer size. - */ -//#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH - -/** - * \def MBEDTLS_TEST_HOOKS - * - * Enable features for invasive testing such as introspection functions and - * hooks for fault injection. This enables additional unit tests. - * - * Merely enabling this feature should not change the behavior of the product. - * It only adds new code, and new branching points where the default behavior - * is the same as when this feature is disabled. - * However, this feature increases the attack surface: there is an added - * risk of vulnerabilities, and more gadgets that can make exploits easier. - * Therefore this feature must never be enabled in production. - * - * See `docs/architecture/testing/mbed-crypto-invasive-testing.md` for more - * information. - * - * Uncomment to enable invasive tests. - */ -//#define MBEDTLS_TEST_HOOKS - -/** - * \def MBEDTLS_THREADING_ALT - * - * Provide your own alternate threading implementation. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to allow your own alternate threading implementation. - */ -//#define MBEDTLS_THREADING_ALT - -/** - * \def MBEDTLS_THREADING_PTHREAD - * - * Enable the pthread wrapper layer for the threading layer. - * - * Requires: MBEDTLS_THREADING_C - * - * Uncomment this to enable pthread mutexes. - */ -//#define MBEDTLS_THREADING_PTHREAD - -/** - * \def MBEDTLS_USE_PSA_CRYPTO - * - * Make the X.509 and TLS library use PSA for cryptographic operations, and - * enable new APIs for using keys handled by PSA Crypto. - * - * \note Development of this option is currently in progress, and parts of Mbed - * TLS's X.509 and TLS modules are not ported to PSA yet. However, these parts - * will still continue to work as usual, so enabling this option should not - * break backwards compatibility. - * - * \warning The PSA Crypto API is in beta stage. While you're welcome to - * experiment using it, incompatible API changes are still possible, and some - * parts may not have reached the same quality as the rest of Mbed TLS yet. - * - * \warning This option enables new Mbed TLS APIs that are dependent on the - * PSA Crypto API, so can't come with the same stability guarantees as the - * rest of the Mbed TLS APIs. You're welcome to experiment with them, but for - * now, access to these APIs is opt-in (via enabling the present option), in - * order to clearly differentiate them from the stable Mbed TLS APIs. - * - * Requires: MBEDTLS_PSA_CRYPTO_C. - * - * Uncomment this to enable internal use of PSA Crypto and new associated APIs. - */ -//#define MBEDTLS_USE_PSA_CRYPTO - -/** - * \def MBEDTLS_VERSION_FEATURES - * - * Allow run-time checking of compile-time enabled features. Thus allowing users - * to check at run-time if the library is for instance compiled with threading - * support via mbedtls_version_check_feature(). - * - * Requires: MBEDTLS_VERSION_C - * - * Comment this to disable run-time checking and save ROM space - */ -#define MBEDTLS_VERSION_FEATURES - -/** - * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 - * - * If set, the X509 parser will not break-off when parsing an X509 certificate - * and encountering an extension in a v1 or v2 certificate. - * - * Uncomment to prevent an error. - */ -//#define MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 - -/** - * \def MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION - * - * If set, the X509 parser will not break-off when parsing an X509 certificate - * and encountering an unknown critical extension. - * - * \warning Depending on your PKI use, enabling this can be a security risk! - * - * Uncomment to prevent an error. - */ -//#define MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION - -/** - * \def MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK - * - * If set, this enables the X.509 API `mbedtls_x509_crt_verify_with_ca_cb()` - * and the SSL API `mbedtls_ssl_conf_ca_cb()` which allow users to configure - * the set of trusted certificates through a callback instead of a linked - * list. - * - * This is useful for example in environments where a large number of trusted - * certificates is present and storing them in a linked list isn't efficient - * enough, or when the set of trusted certificates changes frequently. - * - * See the documentation of `mbedtls_x509_crt_verify_with_ca_cb()` and - * `mbedtls_ssl_conf_ca_cb()` for more information. - * - * Uncomment to enable trusted certificate callbacks. - */ -//#define MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK - -/** - * \def MBEDTLS_X509_CHECK_KEY_USAGE - * - * Enable verification of the keyUsage extension (CA and leaf certificates). - * - * Disabling this avoids problems with mis-issued and/or misused - * (intermediate) CA and leaf certificates. - * - * \warning Depending on your PKI use, disabling this can be a security risk! - * - * Comment to skip keyUsage checking for both CA and leaf certificates. - */ -#define MBEDTLS_X509_CHECK_KEY_USAGE - -/** - * \def MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE - * - * Enable verification of the extendedKeyUsage extension (leaf certificates). - * - * Disabling this avoids problems with mis-issued and/or misused certificates. - * - * \warning Depending on your PKI use, disabling this can be a security risk! - * - * Comment to skip extendedKeyUsage checking for certificates. - */ -#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE - -/** - * \def MBEDTLS_X509_RSASSA_PSS_SUPPORT - * - * Enable parsing and verification of X.509 certificates, CRLs and CSRS - * signed with RSASSA-PSS (aka PKCS#1 v2.1). - * - * Comment this macro to disallow using RSASSA-PSS in certificates. - */ -#define MBEDTLS_X509_RSASSA_PSS_SUPPORT - -/** - * \def MBEDTLS_ZLIB_SUPPORT - * - * If set, the SSL/TLS module uses ZLIB to support compression and - * decompression of packet data. - * - * \warning TLS-level compression MAY REDUCE SECURITY! See for example the - * CRIME attack. Before enabling this option, you should examine with care if - * CRIME or similar exploits may be applicable to your use case. - * - * \note Currently compression can't be used with DTLS. - * - * \deprecated This feature is deprecated and will be removed - * in the next major revision of the library. - * - * Used in: library/ssl_tls.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * This feature requires zlib library and headers to be present. - * - * Uncomment to enable use of ZLIB - */ -//#define MBEDTLS_ZLIB_SUPPORT -/* \} name SECTION: mbed TLS feature support */ - -/** - * \name SECTION: mbed TLS modules - * - * This section enables or disables entire modules in mbed TLS - * \{ - */ - -/** - * \def MBEDTLS_AESNI_C - * - * Enable AES-NI support on x86-64. - * - * Module: library/aesni.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the AES-NI instructions on x86-64 - */ -#define MBEDTLS_AESNI_C - -/** - * \def MBEDTLS_AES_C - * - * Enable the AES block cipher. - * - * Module: library/aes.c - * Caller: library/cipher.c - * library/pem.c - * library/ctr_drbg.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA - * - * PEM_PARSE uses AES for decrypting encrypted keys. - */ -#define MBEDTLS_AES_C - -/** - * \def MBEDTLS_ARC4_C - * - * Enable the ARCFOUR stream cipher. - * - * Module: library/arc4.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_SHA - * MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 - * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA - * MBEDTLS_TLS_PSK_WITH_RC4_128_SHA - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. If possible, we recommend avoidng dependencies on - * it, and considering stronger ciphers instead. - * - */ -#define MBEDTLS_ARC4_C - -/** - * \def MBEDTLS_ASN1_PARSE_C - * - * Enable the generic ASN1 parser. - * - * Module: library/asn1.c - * Caller: library/x509.c - * library/dhm.c - * library/pkcs12.c - * library/pkcs5.c - * library/pkparse.c - */ -#define MBEDTLS_ASN1_PARSE_C - -/** - * \def MBEDTLS_ASN1_WRITE_C - * - * Enable the generic ASN1 writer. - * - * Module: library/asn1write.c - * Caller: library/ecdsa.c - * library/pkwrite.c - * library/x509_create.c - * library/x509write_crt.c - * library/x509write_csr.c - */ -#define MBEDTLS_ASN1_WRITE_C - -/** - * \def MBEDTLS_BASE64_C - * - * Enable the Base64 module. - * - * Module: library/base64.c - * Caller: library/pem.c - * - * This module is required for PEM support (required by X.509). - */ -#define MBEDTLS_BASE64_C - -/** - * \def MBEDTLS_BIGNUM_C - * - * Enable the multi-precision integer library. - * - * Module: library/bignum.c - * Caller: library/dhm.c - * library/ecp.c - * library/ecdsa.c - * library/rsa.c - * library/rsa_internal.c - * library/ssl_tls.c - * - * This module is required for RSA, DHM and ECC (ECDH, ECDSA) support. - */ -#define MBEDTLS_BIGNUM_C - -/** - * \def MBEDTLS_BLOWFISH_C - * - * Enable the Blowfish block cipher. - * - * Module: library/blowfish.c - */ -#define MBEDTLS_BLOWFISH_C - -/** - * \def MBEDTLS_CAMELLIA_C - * - * Enable the Camellia block cipher. - * - * Module: library/camellia.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 - */ -#define MBEDTLS_CAMELLIA_C - -/** - * \def MBEDTLS_ARIA_C - * - * Enable the ARIA block cipher. - * - * Module: library/aria.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * - * MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 - * MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 - * MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 - * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 - * MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 - */ -//#define MBEDTLS_ARIA_C - -/** - * \def MBEDTLS_CCM_C - * - * Enable the Counter with CBC-MAC (CCM) mode for 128-bit block cipher. - * - * Module: library/ccm.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C - * - * This module enables the AES-CCM ciphersuites, if other requisites are - * enabled as well. - */ -#define MBEDTLS_CCM_C - -/** - * \def MBEDTLS_CERTS_C - * - * Enable the test certificates. - * - * Module: library/certs.c - * Caller: - * - * This module is used for testing (ssl_client/server). - */ -#define MBEDTLS_CERTS_C - -/** - * \def MBEDTLS_CHACHA20_C - * - * Enable the ChaCha20 stream cipher. - * - * Module: library/chacha20.c - */ -#define MBEDTLS_CHACHA20_C - -/** - * \def MBEDTLS_CHACHAPOLY_C - * - * Enable the ChaCha20-Poly1305 AEAD algorithm. - * - * Module: library/chachapoly.c - * - * This module requires: MBEDTLS_CHACHA20_C, MBEDTLS_POLY1305_C - */ -#define MBEDTLS_CHACHAPOLY_C - -/** - * \def MBEDTLS_CIPHER_C - * - * Enable the generic cipher layer. - * - * Module: library/cipher.c - * Caller: library/ssl_tls.c - * - * Uncomment to enable generic cipher wrappers. - */ -#define MBEDTLS_CIPHER_C - -/** - * \def MBEDTLS_CMAC_C - * - * Enable the CMAC (Cipher-based Message Authentication Code) mode for block - * ciphers. - * - * Module: library/cmac.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_DES_C - * - */ -//#define MBEDTLS_CMAC_C - -/** - * \def MBEDTLS_CTR_DRBG_C - * - * Enable the CTR_DRBG AES-based random generator. - * The CTR_DRBG generator uses AES-256 by default. - * To use AES-128 instead, enable \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY above. - * - * \note To achieve a 256-bit security strength with CTR_DRBG, - * you must use AES-256 *and* use sufficient entropy. - * See ctr_drbg.h for more details. - * - * Module: library/ctr_drbg.c - * Caller: - * - * Requires: MBEDTLS_AES_C - * - * This module provides the CTR_DRBG AES random number generator. - */ -#define MBEDTLS_CTR_DRBG_C - -/** - * \def MBEDTLS_DEBUG_C - * - * Enable the debug functions. - * - * Module: library/debug.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module provides debugging functions. - */ -#define MBEDTLS_DEBUG_C - -/** - * \def MBEDTLS_DES_C - * - * Enable the DES block cipher. - * - * Module: library/des.c - * Caller: library/pem.c - * library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA - * MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA - * - * PEM_PARSE uses DES/3DES for decrypting encrypted keys. - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers instead. - */ -#define MBEDTLS_DES_C - -/** - * \def MBEDTLS_DHM_C - * - * Enable the Diffie-Hellman-Merkle module. - * - * Module: library/dhm.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is used by the following key exchanges: - * DHE-RSA, DHE-PSK - * - * \warning Using DHE constitutes a security risk as it - * is not possible to validate custom DH parameters. - * If possible, it is recommended users should consider - * preferring other methods of key exchange. - * See dhm.h for more details. - * - */ -#define MBEDTLS_DHM_C - -/** - * \def MBEDTLS_ECDH_C - * - * Enable the elliptic curve Diffie-Hellman library. - * - * Module: library/ecdh.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK - * - * Requires: MBEDTLS_ECP_C - */ -#define MBEDTLS_ECDH_C - -/** - * \def MBEDTLS_ECDSA_C - * - * Enable the elliptic curve DSA library. - * - * Module: library/ecdsa.c - * Caller: - * - * This module is used by the following key exchanges: - * ECDHE-ECDSA - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C - */ -#define MBEDTLS_ECDSA_C - -/** - * \def MBEDTLS_ECJPAKE_C - * - * Enable the elliptic curve J-PAKE library. - * - * \warning This is currently experimental. EC J-PAKE support is based on the - * Thread v1.0.0 specification; incompatible changes to the specification - * might still happen. For this reason, this is disabled by default. - * - * Module: library/ecjpake.c - * Caller: - * - * This module is used by the following key exchanges: - * ECJPAKE - * - * Requires: MBEDTLS_ECP_C, MBEDTLS_MD_C - */ -//#define MBEDTLS_ECJPAKE_C - -/** - * \def MBEDTLS_ECP_C - * - * Enable the elliptic curve over GF(p) library. - * - * Module: library/ecp.c - * Caller: library/ecdh.c - * library/ecdsa.c - * library/ecjpake.c - * - * Requires: MBEDTLS_BIGNUM_C and at least one MBEDTLS_ECP_DP_XXX_ENABLED - */ -#define MBEDTLS_ECP_C - -/** - * \def MBEDTLS_ENTROPY_C - * - * Enable the platform-specific entropy code. - * - * Module: library/entropy.c - * Caller: - * - * Requires: MBEDTLS_SHA512_C or MBEDTLS_SHA256_C - * - * This module provides a generic entropy pool - */ -#define MBEDTLS_ENTROPY_C - -/** - * \def MBEDTLS_ERROR_C - * - * Enable error code to error string conversion. - * - * Module: library/error.c - * Caller: - * - * This module enables mbedtls_strerror(). - */ -#define MBEDTLS_ERROR_C - -/** - * \def MBEDTLS_GCM_C - * - * Enable the Galois/Counter Mode (GCM). - * - * Module: library/gcm.c - * - * Requires: MBEDTLS_AES_C or MBEDTLS_CAMELLIA_C or MBEDTLS_ARIA_C - * - * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other - * requisites are enabled as well. - */ -#define MBEDTLS_GCM_C - -/** - * \def MBEDTLS_HAVEGE_C - * - * Enable the HAVEGE random generator. - * - * Warning: the HAVEGE random generator is not suitable for virtualized - * environments - * - * Warning: the HAVEGE random generator is dependent on timing and specific - * processor traits. It is therefore not advised to use HAVEGE as - * your applications primary random generator or primary entropy pool - * input. As a secondary input to your entropy pool, it IS able add - * the (limited) extra entropy it provides. - * - * Module: library/havege.c - * Caller: - * - * Requires: MBEDTLS_TIMING_C - * - * Uncomment to enable the HAVEGE random generator. - */ -//#define MBEDTLS_HAVEGE_C - -/** - * \def MBEDTLS_HKDF_C - * - * Enable the HKDF algorithm (RFC 5869). - * - * Module: library/hkdf.c - * Caller: - * - * Requires: MBEDTLS_MD_C - * - * This module adds support for the Hashed Message Authentication Code - * (HMAC)-based key derivation function (HKDF). - */ -#define MBEDTLS_HKDF_C - -/** - * \def MBEDTLS_HMAC_DRBG_C - * - * Enable the HMAC_DRBG random generator. - * - * Module: library/hmac_drbg.c - * Caller: - * - * Requires: MBEDTLS_MD_C - * - * Uncomment to enable the HMAC_DRBG random number geerator. - */ -#define MBEDTLS_HMAC_DRBG_C - -/** - * \def MBEDTLS_NIST_KW_C - * - * Enable the Key Wrapping mode for 128-bit block ciphers, - * as defined in NIST SP 800-38F. Only KW and KWP modes - * are supported. At the moment, only AES is approved by NIST. - * - * Module: library/nist_kw.c - * - * Requires: MBEDTLS_AES_C and MBEDTLS_CIPHER_C - */ -//#define MBEDTLS_NIST_KW_C - -/** - * \def MBEDTLS_MD_C - * - * Enable the generic message digest layer. - * - * Module: library/md.c - * Caller: - * - * Uncomment to enable generic message digest wrappers. - */ -#define MBEDTLS_MD_C - -/** - * \def MBEDTLS_MD2_C - * - * Enable the MD2 hash algorithm. - * - * Module: library/md2.c - * Caller: - * - * Uncomment to enable support for (rare) MD2-signed X.509 certs. - * - * \warning MD2 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -//#define MBEDTLS_MD2_C - -/** - * \def MBEDTLS_MD4_C - * - * Enable the MD4 hash algorithm. - * - * Module: library/md4.c - * Caller: - * - * Uncomment to enable support for (rare) MD4-signed X.509 certs. - * - * \warning MD4 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -//#define MBEDTLS_MD4_C - -/** - * \def MBEDTLS_MD5_C - * - * Enable the MD5 hash algorithm. - * - * Module: library/md5.c - * Caller: library/md.c - * library/pem.c - * library/ssl_tls.c - * - * This module is required for SSL/TLS up to version 1.1, and for TLS 1.2 - * depending on the handshake parameters. Further, it is used for checking - * MD5-signed certificates, and for PBKDF1 when decrypting PEM-encoded - * encrypted keys. - * - * \warning MD5 is considered a weak message digest and its use constitutes a - * security risk. If possible, we recommend avoiding dependencies on - * it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_MD5_C - -/** - * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C - * - * Enable the buffer allocator implementation that makes use of a (stack) - * based buffer to 'allocate' dynamic memory. (replaces calloc() and free() - * calls) - * - * Module: library/memory_buffer_alloc.c - * - * Requires: MBEDTLS_PLATFORM_C - * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS) - * - * Enable this module to enable the buffer memory allocator. - */ -//#define MBEDTLS_MEMORY_BUFFER_ALLOC_C - -/** - * \def MBEDTLS_NET_C - * - * Enable the TCP and UDP over IPv6/IPv4 networking routines. - * - * \note This module only works on POSIX/Unix (including Linux, BSD and OS X) - * and Windows. For other platforms, you'll want to disable it, and write your - * own networking callbacks to be passed to \c mbedtls_ssl_set_bio(). - * - * \note See also our Knowledge Base article about porting to a new - * environment: - * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS - * - * Module: library/net_sockets.c - * - * This module provides networking routines. - */ -#define MBEDTLS_NET_C - -/** - * \def MBEDTLS_OID_C - * - * Enable the OID database. - * - * Module: library/oid.c - * Caller: library/asn1write.c - * library/pkcs5.c - * library/pkparse.c - * library/pkwrite.c - * library/rsa.c - * library/x509.c - * library/x509_create.c - * library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * This modules translates between OIDs and internal values. - */ -#define MBEDTLS_OID_C - -/** - * \def MBEDTLS_PADLOCK_C - * - * Enable VIA Padlock support on x86. - * - * Module: library/padlock.c - * Caller: library/aes.c - * - * Requires: MBEDTLS_HAVE_ASM - * - * This modules adds support for the VIA PadLock on x86. - */ -#define MBEDTLS_PADLOCK_C - -/** - * \def MBEDTLS_PEM_PARSE_C - * - * Enable PEM decoding / parsing. - * - * Module: library/pem.c - * Caller: library/dhm.c - * library/pkparse.c - * library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for decoding / parsing PEM files. - */ -#define MBEDTLS_PEM_PARSE_C - -/** - * \def MBEDTLS_PEM_WRITE_C - * - * Enable PEM encoding / writing. - * - * Module: library/pem.c - * Caller: library/pkwrite.c - * library/x509write_crt.c - * library/x509write_csr.c - * - * Requires: MBEDTLS_BASE64_C - * - * This modules adds support for encoding / writing PEM files. - */ -#define MBEDTLS_PEM_WRITE_C - -/** - * \def MBEDTLS_PK_C - * - * Enable the generic public (asymetric) key layer. - * - * Module: library/pk.c - * Caller: library/ssl_tls.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * Requires: MBEDTLS_RSA_C or MBEDTLS_ECP_C - * - * Uncomment to enable generic public key wrappers. - */ -#define MBEDTLS_PK_C - -/** - * \def MBEDTLS_PK_PARSE_C - * - * Enable the generic public (asymetric) key parser. - * - * Module: library/pkparse.c - * Caller: library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key parse functions. - */ -#define MBEDTLS_PK_PARSE_C - -/** - * \def MBEDTLS_PK_WRITE_C - * - * Enable the generic public (asymetric) key writer. - * - * Module: library/pkwrite.c - * Caller: library/x509write.c - * - * Requires: MBEDTLS_PK_C - * - * Uncomment to enable generic public key write functions. - */ -#define MBEDTLS_PK_WRITE_C - -/** - * \def MBEDTLS_PKCS5_C - * - * Enable PKCS#5 functions. - * - * Module: library/pkcs5.c - * - * Requires: MBEDTLS_MD_C - * - * This module adds support for the PKCS#5 functions. - */ -#define MBEDTLS_PKCS5_C - -/** - * \def MBEDTLS_PKCS11_C - * - * Enable wrapper for PKCS#11 smartcard support via the pkcs11-helper library. - * - * \deprecated This option is deprecated and will be removed in a future - * version of Mbed TLS. - * - * Module: library/pkcs11.c - * Caller: library/pk.c - * - * Requires: MBEDTLS_PK_C - * - * This module enables SSL/TLS PKCS #11 smartcard support. - * Requires the presence of the PKCS#11 helper library (libpkcs11-helper) - */ -//#define MBEDTLS_PKCS11_C - -/** - * \def MBEDTLS_PKCS12_C - * - * Enable PKCS#12 PBE functions. - * Adds algorithms for parsing PKCS#8 encrypted private keys - * - * Module: library/pkcs12.c - * Caller: library/pkparse.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * Can use: MBEDTLS_ARC4_C - * - * This module enables PKCS#12 functions. - */ -#define MBEDTLS_PKCS12_C - -/** - * \def MBEDTLS_PLATFORM_C - * - * Enable the platform abstraction layer that allows you to re-assign - * functions like calloc(), free(), snprintf(), printf(), fprintf(), exit(). - * - * Enabling MBEDTLS_PLATFORM_C enables to use of MBEDTLS_PLATFORM_XXX_ALT - * or MBEDTLS_PLATFORM_XXX_MACRO directives, allowing the functions mentioned - * above to be specified at runtime or compile time respectively. - * - * \note This abstraction layer must be enabled on Windows (including MSYS2) - * as other module rely on it for a fixed snprintf implementation. - * - * Module: library/platform.c - * Caller: Most other .c files - * - * This module enables abstraction of common (libc) functions. - */ -#define MBEDTLS_PLATFORM_C - -/** - * \def MBEDTLS_POLY1305_C - * - * Enable the Poly1305 MAC algorithm. - * - * Module: library/poly1305.c - * Caller: library/chachapoly.c - */ -#define MBEDTLS_POLY1305_C - -/** - * \def MBEDTLS_PSA_CRYPTO_C - * - * Enable the Platform Security Architecture cryptography API. - * - * \warning The PSA Crypto API is still beta status. While you're welcome to - * experiment using it, incompatible API changes are still possible, and some - * parts may not have reached the same quality as the rest of Mbed TLS yet. - * - * Module: library/psa_crypto.c - * - * Requires: MBEDTLS_CTR_DRBG_C, MBEDTLS_ENTROPY_C - * - */ -#define MBEDTLS_PSA_CRYPTO_C - -/** - * \def MBEDTLS_PSA_CRYPTO_SE_C - * - * Enable secure element support in the Platform Security Architecture - * cryptography API. - * - * \warning This feature is not yet suitable for production. It is provided - * for API evaluation and testing purposes only. - * - * Module: library/psa_crypto_se.c - * - * Requires: MBEDTLS_PSA_CRYPTO_C, MBEDTLS_PSA_CRYPTO_STORAGE_C - * - */ -//#define MBEDTLS_PSA_CRYPTO_SE_C - -/** - * \def MBEDTLS_PSA_CRYPTO_STORAGE_C - * - * Enable the Platform Security Architecture persistent key storage. - * - * Module: library/psa_crypto_storage.c - * - * Requires: MBEDTLS_PSA_CRYPTO_C, - * either MBEDTLS_PSA_ITS_FILE_C or a native implementation of - * the PSA ITS interface - */ -#define MBEDTLS_PSA_CRYPTO_STORAGE_C - -/** - * \def MBEDTLS_PSA_ITS_FILE_C - * - * Enable the emulation of the Platform Security Architecture - * Internal Trusted Storage (PSA ITS) over files. - * - * Module: library/psa_its_file.c - * - * Requires: MBEDTLS_FS_IO - */ -#define MBEDTLS_PSA_ITS_FILE_C - -/** - * \def MBEDTLS_RIPEMD160_C - * - * Enable the RIPEMD-160 hash algorithm. - * - * Module: library/ripemd160.c - * Caller: library/md.c - * - */ -#define MBEDTLS_RIPEMD160_C - -/** - * \def MBEDTLS_RSA_C - * - * Enable the RSA public-key cryptosystem. - * - * Module: library/rsa.c - * library/rsa_internal.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509.c - * - * This module is used by the following key exchanges: - * RSA, DHE-RSA, ECDHE-RSA, RSA-PSK - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C - */ -#define MBEDTLS_RSA_C - -/** - * \def MBEDTLS_SHA1_C - * - * Enable the SHA1 cryptographic hash algorithm. - * - * Module: library/sha1.c - * Caller: library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * library/x509write_crt.c - * - * This module is required for SSL/TLS up to version 1.1, for TLS 1.2 - * depending on the handshake parameters, and for SHA1-signed certificates. - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_SHA1_C - -/** - * \def MBEDTLS_SHA256_C - * - * Enable the SHA-224 and SHA-256 cryptographic hash algorithms. - * - * Module: library/sha256.c - * Caller: library/entropy.c - * library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * This module adds support for SHA-224 and SHA-256. - * This module is required for the SSL/TLS 1.2 PRF function. - */ -#define MBEDTLS_SHA256_C - -/** - * \def MBEDTLS_SHA512_C - * - * Enable the SHA-384 and SHA-512 cryptographic hash algorithms. - * - * Module: library/sha512.c - * Caller: library/entropy.c - * library/md.c - * library/ssl_cli.c - * library/ssl_srv.c - * - * This module adds support for SHA-384 and SHA-512. - */ -#define MBEDTLS_SHA512_C - -/** - * \def MBEDTLS_SSL_CACHE_C - * - * Enable simple SSL cache implementation. - * - * Module: library/ssl_cache.c - * Caller: - * - * Requires: MBEDTLS_SSL_CACHE_C - */ -#define MBEDTLS_SSL_CACHE_C - -/** - * \def MBEDTLS_SSL_COOKIE_C - * - * Enable basic implementation of DTLS cookies for hello verification. - * - * Module: library/ssl_cookie.c - * Caller: - */ -#define MBEDTLS_SSL_COOKIE_C - -/** - * \def MBEDTLS_SSL_TICKET_C - * - * Enable an implementation of TLS server-side callbacks for session tickets. - * - * Module: library/ssl_ticket.c - * Caller: - * - * Requires: MBEDTLS_CIPHER_C - */ -#define MBEDTLS_SSL_TICKET_C - -/** - * \def MBEDTLS_SSL_CLI_C - * - * Enable the SSL/TLS client code. - * - * Module: library/ssl_cli.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS client support. - */ -#define MBEDTLS_SSL_CLI_C - -/** - * \def MBEDTLS_SSL_SRV_C - * - * Enable the SSL/TLS server code. - * - * Module: library/ssl_srv.c - * Caller: - * - * Requires: MBEDTLS_SSL_TLS_C - * - * This module is required for SSL/TLS server support. - */ -#define MBEDTLS_SSL_SRV_C - -/** - * \def MBEDTLS_SSL_TLS_C - * - * Enable the generic SSL/TLS code. - * - * Module: library/ssl_tls.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * - * Requires: MBEDTLS_CIPHER_C, MBEDTLS_MD_C - * and at least one of the MBEDTLS_SSL_PROTO_XXX defines - * - * This module is required for SSL/TLS. - */ -#define MBEDTLS_SSL_TLS_C - -/** - * \def MBEDTLS_THREADING_C - * - * Enable the threading abstraction layer. - * By default mbed TLS assumes it is used in a non-threaded environment or that - * contexts are not shared between threads. If you do intend to use contexts - * between threads, you will need to enable this layer to prevent race - * conditions. See also our Knowledge Base article about threading: - * https://tls.mbed.org/kb/development/thread-safety-and-multi-threading - * - * Module: library/threading.c - * - * This allows different threading implementations (self-implemented or - * provided). - * - * You will have to enable either MBEDTLS_THREADING_ALT or - * MBEDTLS_THREADING_PTHREAD. - * - * Enable this layer to allow use of mutexes within mbed TLS - */ -//#define MBEDTLS_THREADING_C - -/** - * \def MBEDTLS_TIMING_C - * - * Enable the semi-portable timing interface. - * - * \note The provided implementation only works on POSIX/Unix (including Linux, - * BSD and OS X) and Windows. On other platforms, you can either disable that - * module and provide your own implementations of the callbacks needed by - * \c mbedtls_ssl_set_timer_cb() for DTLS, or leave it enabled and provide - * your own implementation of the whole module by setting - * \c MBEDTLS_TIMING_ALT in the current file. - * - * \note See also our Knowledge Base article about porting to a new - * environment: - * https://tls.mbed.org/kb/how-to/how-do-i-port-mbed-tls-to-a-new-environment-OS - * - * Module: library/timing.c - * Caller: library/havege.c - * - * This module is used by the HAVEGE random number generator. - */ -#define MBEDTLS_TIMING_C - -/** - * \def MBEDTLS_VERSION_C - * - * Enable run-time version information. - * - * Module: library/version.c - * - * This module provides run-time version information. - */ -#define MBEDTLS_VERSION_C - -/** - * \def MBEDTLS_X509_USE_C - * - * Enable X.509 core for using certificates. - * - * Module: library/x509.c - * Caller: library/x509_crl.c - * library/x509_crt.c - * library/x509_csr.c - * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, - * MBEDTLS_PK_PARSE_C - * - * This module is required for the X.509 parsing modules. - */ -#define MBEDTLS_X509_USE_C - -/** - * \def MBEDTLS_X509_CRT_PARSE_C - * - * Enable X.509 certificate parsing. - * - * Module: library/x509_crt.c - * Caller: library/ssl_cli.c - * library/ssl_srv.c - * library/ssl_tls.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 certificate parsing. - */ -#define MBEDTLS_X509_CRT_PARSE_C - -/** - * \def MBEDTLS_X509_CRL_PARSE_C - * - * Enable X.509 CRL parsing. - * - * Module: library/x509_crl.c - * Caller: library/x509_crt.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is required for X.509 CRL parsing. - */ -#define MBEDTLS_X509_CRL_PARSE_C - -/** - * \def MBEDTLS_X509_CSR_PARSE_C - * - * Enable X.509 Certificate Signing Request (CSR) parsing. - * - * Module: library/x509_csr.c - * Caller: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_USE_C - * - * This module is used for reading X.509 certificate request. - */ -#define MBEDTLS_X509_CSR_PARSE_C - -/** - * \def MBEDTLS_X509_CREATE_C - * - * Enable X.509 core for creating certificates. - * - * Module: library/x509_create.c - * - * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C, MBEDTLS_PK_WRITE_C - * - * This module is the basis for creating X.509 certificates and CSRs. - */ -#define MBEDTLS_X509_CREATE_C - -/** - * \def MBEDTLS_X509_CRT_WRITE_C - * - * Enable creating X.509 certificates. - * - * Module: library/x509_crt_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate creation. - */ -#define MBEDTLS_X509_CRT_WRITE_C - -/** - * \def MBEDTLS_X509_CSR_WRITE_C - * - * Enable creating X.509 Certificate Signing Requests (CSR). - * - * Module: library/x509_csr_write.c - * - * Requires: MBEDTLS_X509_CREATE_C - * - * This module is required for X.509 certificate request writing. - */ -#define MBEDTLS_X509_CSR_WRITE_C - -/** - * \def MBEDTLS_XTEA_C - * - * Enable the XTEA block cipher. - * - * Module: library/xtea.c - * Caller: - */ -#define MBEDTLS_XTEA_C - -/* \} name SECTION: mbed TLS modules */ - -/** - * \name SECTION: Module configuration options - * - * This section allows for the setting of module specific sizes and - * configuration options. The default values are already present in the - * relevant header files and should suffice for the regular use cases. - * - * Our advice is to enable options and change their values here - * only if you have a good reason and know the consequences. - * - * Please check the respective header file for documentation on these - * parameters (to prevent duplicate documentation). - * \{ - */ - -/* MPI / BIGNUM options */ -//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */ -//#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */ - -/* CTR_DRBG options */ -//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */ -//#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -//#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -//#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -//#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ - -/* HMAC_DRBG options */ -//#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -//#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -//#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -//#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ - -/* ECP options */ -//#define MBEDTLS_ECP_MAX_BITS 521 /**< Maximum bit size of groups */ -//#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< Maximum window size used */ -//#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up */ - -/* Entropy options */ -//#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */ -//#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */ -//#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Default minimum number of bytes required for the hardware entropy source mbedtls_hardware_poll() before entropy is released */ - -/* Memory buffer allocator options */ -//#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ - -/* Platform options */ -//#define MBEDTLS_PLATFORM_STD_MEM_HDR /**< Header to include if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS is defined. Don't define if no header is needed. */ -//#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< Default allocator to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_FREE free /**< Default free to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT exit /**< Default exit to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_TIME time /**< Default time to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< Default fprintf to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< Default printf to use, can be undefined */ -/* Note: your snprintf must correctly zero-terminate the buffer! */ -//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< Default snprintf to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS 0 /**< Default exit value to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE 1 /**< Default exit value to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" /**< Seed file to read/write with default implementation */ - -/* To Use Function Macros MBEDTLS_PLATFORM_C must be enabled */ -/* MBEDTLS_PLATFORM_XXX_MACRO and MBEDTLS_PLATFORM_XXX_ALT cannot both be defined */ -//#define MBEDTLS_PLATFORM_CALLOC_MACRO calloc /**< Default allocator macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_FREE_MACRO free /**< Default free macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_EXIT_MACRO exit /**< Default exit macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_TIME_MACRO time /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_TIME_TYPE_MACRO time_t /**< Default time macro to use, can be undefined. MBEDTLS_HAVE_TIME must be enabled */ -//#define MBEDTLS_PLATFORM_FPRINTF_MACRO fprintf /**< Default fprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_PRINTF_MACRO printf /**< Default printf macro to use, can be undefined */ -/* Note: your snprintf must correctly zero-terminate the buffer! */ -//#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf /**< Default snprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_VSNPRINTF_MACRO vsnprintf /**< Default vsnprintf macro to use, can be undefined */ -//#define MBEDTLS_PLATFORM_NV_SEED_READ_MACRO mbedtls_platform_std_nv_seed_read /**< Default nv_seed_read function to use, can be undefined */ -//#define MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO mbedtls_platform_std_nv_seed_write /**< Default nv_seed_write function to use, can be undefined */ - -/** - * \brief This macro is invoked by the library when an invalid parameter - * is detected that is only checked with #MBEDTLS_CHECK_PARAMS - * (see the documentation of that option for context). - * - * When you leave this undefined here, the library provides - * a default definition. If the macro #MBEDTLS_CHECK_PARAMS_ASSERT - * is defined, the default definition is `assert(cond)`, - * otherwise the default definition calls a function - * mbedtls_param_failed(). This function is declared in - * `platform_util.h` for the benefit of the library, but - * you need to define in your application. - * - * When you define this here, this replaces the default - * definition in platform_util.h (which no longer declares the - * function mbedtls_param_failed()) and it is your responsibility - * to make sure this macro expands to something suitable (in - * particular, that all the necessary declarations are visible - * from within the library - you can ensure that by providing - * them in this file next to the macro definition). - * If you define this macro to call `assert`, also define - * #MBEDTLS_CHECK_PARAMS_ASSERT so that library source files - * include ``. - * - * Note that you may define this macro to expand to nothing, in - * which case you don't have to worry about declarations or - * definitions. However, you will then be notified about invalid - * parameters only in non-void functions, and void function will - * just silently return early on invalid parameters, which - * partially negates the benefits of enabling - * #MBEDTLS_CHECK_PARAMS in the first place, so is discouraged. - * - * \param cond The expression that should evaluate to true, but doesn't. - */ -//#define MBEDTLS_PARAM_FAILED( cond ) assert( cond ) - -/* SSL Cache options */ -//#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /**< 1 day */ -//#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /**< Maximum entries in cache */ - -/* SSL options */ - -/** \def MBEDTLS_SSL_MAX_CONTENT_LEN - * - * Maximum length (in bytes) of incoming and outgoing plaintext fragments. - * - * This determines the size of both the incoming and outgoing TLS I/O buffers - * in such a way that both are capable of holding the specified amount of - * plaintext data, regardless of the protection mechanism used. - * - * To configure incoming and outgoing I/O buffers separately, use - * #MBEDTLS_SSL_IN_CONTENT_LEN and #MBEDTLS_SSL_OUT_CONTENT_LEN, - * which overwrite the value set by this option. - * - * \note When using a value less than the default of 16KB on the client, it is - * recommended to use the Maximum Fragment Length (MFL) extension to - * inform the server about this limitation. On the server, there - * is no supported, standardized way of informing the client about - * restriction on the maximum size of incoming messages, and unless - * the limitation has been communicated by other means, it is recommended - * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN - * while keeping the default value of 16KB for the incoming buffer. - * - * Uncomment to set the maximum plaintext size of both - * incoming and outgoing I/O buffers. - */ -//#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 - -/** \def MBEDTLS_SSL_IN_CONTENT_LEN - * - * Maximum length (in bytes) of incoming plaintext fragments. - * - * This determines the size of the incoming TLS I/O buffer in such a way - * that it is capable of holding the specified amount of plaintext data, - * regardless of the protection mechanism used. - * - * If this option is undefined, it inherits its value from - * #MBEDTLS_SSL_MAX_CONTENT_LEN. - * - * \note When using a value less than the default of 16KB on the client, it is - * recommended to use the Maximum Fragment Length (MFL) extension to - * inform the server about this limitation. On the server, there - * is no supported, standardized way of informing the client about - * restriction on the maximum size of incoming messages, and unless - * the limitation has been communicated by other means, it is recommended - * to only change the outgoing buffer size #MBEDTLS_SSL_OUT_CONTENT_LEN - * while keeping the default value of 16KB for the incoming buffer. - * - * Uncomment to set the maximum plaintext size of the incoming I/O buffer - * independently of the outgoing I/O buffer. - */ -//#define MBEDTLS_SSL_IN_CONTENT_LEN 16384 - -/** \def MBEDTLS_SSL_CID_IN_LEN_MAX - * - * The maximum length of CIDs used for incoming DTLS messages. - * - */ -//#define MBEDTLS_SSL_CID_IN_LEN_MAX 32 - -/** \def MBEDTLS_SSL_CID_OUT_LEN_MAX - * - * The maximum length of CIDs used for outgoing DTLS messages. - * - */ -//#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32 - -/** \def MBEDTLS_SSL_CID_PADDING_GRANULARITY - * - * This option controls the use of record plaintext padding - * when using the Connection ID extension in DTLS 1.2. - * - * The padding will always be chosen so that the length of the - * padded plaintext is a multiple of the value of this option. - * - * Note: A value of \c 1 means that no padding will be used - * for outgoing records. - * - * Note: On systems lacking division instructions, - * a power of two should be preferred. - * - */ -//#define MBEDTLS_SSL_CID_PADDING_GRANULARITY 16 - -/** \def MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY - * - * This option controls the use of record plaintext padding - * in TLS 1.3. - * - * The padding will always be chosen so that the length of the - * padded plaintext is a multiple of the value of this option. - * - * Note: A value of \c 1 means that no padding will be used - * for outgoing records. - * - * Note: On systems lacking division instructions, - * a power of two should be preferred. - */ -//#define MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY 1 - -/** \def MBEDTLS_SSL_OUT_CONTENT_LEN - * - * Maximum length (in bytes) of outgoing plaintext fragments. - * - * This determines the size of the outgoing TLS I/O buffer in such a way - * that it is capable of holding the specified amount of plaintext data, - * regardless of the protection mechanism used. - * - * If this option undefined, it inherits its value from - * #MBEDTLS_SSL_MAX_CONTENT_LEN. - * - * It is possible to save RAM by setting a smaller outward buffer, while keeping - * the default inward 16384 byte buffer to conform to the TLS specification. - * - * The minimum required outward buffer size is determined by the handshake - * protocol's usage. Handshaking will fail if the outward buffer is too small. - * The specific size requirement depends on the configured ciphers and any - * certificate data which is sent during the handshake. - * - * Uncomment to set the maximum plaintext size of the outgoing I/O buffer - * independently of the incoming I/O buffer. - */ -//#define MBEDTLS_SSL_OUT_CONTENT_LEN 16384 - -/** \def MBEDTLS_SSL_DTLS_MAX_BUFFERING - * - * Maximum number of heap-allocated bytes for the purpose of - * DTLS handshake message reassembly and future message buffering. - * - * This should be at least 9/8 * MBEDTLSSL_IN_CONTENT_LEN - * to account for a reassembled handshake message of maximum size, - * together with its reassembly bitmap. - * - * A value of 2 * MBEDTLS_SSL_IN_CONTENT_LEN (32768 by default) - * should be sufficient for all practical situations as it allows - * to reassembly a large handshake message (such as a certificate) - * while buffering multiple smaller handshake messages. - * - */ -//#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768 - -//#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */ -//#define MBEDTLS_PSK_MAX_LEN 32 /**< Max size of TLS pre-shared keys, in bytes (default 256 bits) */ -//#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ - -/** - * Complete list of ciphersuites to use, in order of preference. - * - * \warning No dependency checking is done on that field! This option can only - * be used to restrict the set of available ciphersuites. It is your - * responsibility to make sure the needed modules are active. - * - * Use this to save a few hundred bytes of ROM (default ordering of all - * available ciphersuites) and a few to a few hundred bytes of RAM. - * - * The value below is only an example, not the default. - */ -//#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 - -/* X509 options */ -//#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 /**< Maximum number of intermediate CAs in a verification chain. */ -//#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 /**< Maximum length of a path/filename string in bytes including the null terminator character ('\0'). */ - -/** - * Allow SHA-1 in the default TLS configuration for certificate signing. - * Without this build-time option, SHA-1 support must be activated explicitly - * through mbedtls_ssl_conf_cert_profile. Turning on this option is not - * recommended because of it is possible to generate SHA-1 collisions, however - * this may be safe for legacy infrastructure where additional controls apply. - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -//#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES - -/** - * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake - * signature and ciphersuite selection. Without this build-time option, SHA-1 - * support must be activated explicitly through mbedtls_ssl_conf_sig_hashes. - * The use of SHA-1 in TLS <= 1.1 and in HMAC-SHA-1 is always allowed by - * default. At the time of writing, there is no practical attack on the use - * of SHA-1 in handshake signatures, hence this option is turned on by default - * to preserve compatibility with existing peers, but the general - * warning applies nonetheless: - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. If possible, we recommend avoiding dependencies - * on it, and considering stronger message digests instead. - * - */ -#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE - -/** - * Uncomment the macro to let mbed TLS use your alternate implementation of - * mbedtls_platform_zeroize(). This replaces the default implementation in - * platform_util.c. - * - * mbedtls_platform_zeroize() is a widely used function across the library to - * zero a block of memory. The implementation is expected to be secure in the - * sense that it has been written to prevent the compiler from removing calls - * to mbedtls_platform_zeroize() as part of redundant code elimination - * optimizations. However, it is difficult to guarantee that calls to - * mbedtls_platform_zeroize() will not be optimized by the compiler as older - * versions of the C language standards do not provide a secure implementation - * of memset(). Therefore, MBEDTLS_PLATFORM_ZEROIZE_ALT enables users to - * configure their own implementation of mbedtls_platform_zeroize(), for - * example by using directives specific to their compiler, features from newer - * C standards (e.g using memset_s() in C11) or calling a secure memset() from - * their system (e.g explicit_bzero() in BSD). - */ -//#define MBEDTLS_PLATFORM_ZEROIZE_ALT - -/** - * Uncomment the macro to let Mbed TLS use your alternate implementation of - * mbedtls_platform_gmtime_r(). This replaces the default implementation in - * platform_util.c. - * - * gmtime() is not a thread-safe function as defined in the C standard. The - * library will try to use safer implementations of this function, such as - * gmtime_r() when available. However, if Mbed TLS cannot identify the target - * system, the implementation of mbedtls_platform_gmtime_r() will default to - * using the standard gmtime(). In this case, calls from the library to - * gmtime() will be guarded by the global mutex mbedtls_threading_gmtime_mutex - * if MBEDTLS_THREADING_C is enabled. We recommend that calls from outside the - * library are also guarded with this mutex to avoid race conditions. However, - * if the macro MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, Mbed TLS will - * unconditionally use the implementation for mbedtls_platform_gmtime_r() - * supplied at compile time. - */ -//#define MBEDTLS_PLATFORM_GMTIME_R_ALT - -/** - * Enable the verified implementations of ECDH primitives from Project Everest - * (currently only Curve25519). This feature changes the layout of ECDH - * contexts and therefore is a compatibility break for applications that access - * fields of a mbedtls_ecdh_context structure directly. See also - * MBEDTLS_ECDH_LEGACY_CONTEXT in include/mbedtls/ecdh.h. - */ -//#define MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED - -/* \} name SECTION: Customisation configuration options */ - -/* Target and application specific configurations - * - * Allow user to override any previous default. - * - */ -#if defined(MBEDTLS_USER_CONFIG_FILE) -#include MBEDTLS_USER_CONFIG_FILE -#endif - -#include "mbedtls/check_config.h" - -#endif /* MBEDTLS_CONFIG_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ctr_drbg.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ctr_drbg.h deleted file mode 100644 index 234e6a036..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ctr_drbg.h +++ /dev/null @@ -1,562 +0,0 @@ -/** - * \file ctr_drbg.h - * - * \brief This file contains definitions and functions for the - * CTR_DRBG pseudorandom generator. - * - * CTR_DRBG is a standardized way of building a PRNG from a block-cipher - * in counter mode operation, as defined in NIST SP 800-90A: - * Recommendation for Random Number Generation Using Deterministic Random - * Bit Generators. - * - * The Mbed TLS implementation of CTR_DRBG uses AES-256 (default) or AES-128 - * (if \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY is enabled at compile time) - * as the underlying block cipher, with a derivation function. - * - * The security strength as defined in NIST SP 800-90A is - * 128 bits when AES-128 is used (\c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY enabled) - * and 256 bits otherwise, provided that #MBEDTLS_CTR_DRBG_ENTROPY_LEN is - * kept at its default value (and not overridden in config.h) and that the - * DRBG instance is set up with default parameters. - * See the documentation of mbedtls_ctr_drbg_seed() for more - * information. - */ -/* - * Copyright (C) 2006-2019, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_CTR_DRBG_H -#define MBEDTLS_CTR_DRBG_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/aes.h" - -#if defined(MBEDTLS_THREADING_C) -#include "mbedtls/threading.h" -#endif - -#define MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED -0x0034 /**< The entropy source failed. */ -#define MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG -0x0036 /**< The requested random buffer length is too big. */ -#define MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG -0x0038 /**< The input (entropy + additional data) is too large. */ -#define MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR -0x003A /**< Read or write error in file. */ - -#define MBEDTLS_CTR_DRBG_BLOCKSIZE 16 /**< The block size used by the cipher. */ - -#if defined(MBEDTLS_CTR_DRBG_USE_128_BIT_KEY) -#define MBEDTLS_CTR_DRBG_KEYSIZE 16 -/**< The key size in bytes used by the cipher. - * - * Compile-time choice: 16 bytes (128 bits) - * because #MBEDTLS_CTR_DRBG_USE_128_BIT_KEY is enabled. - */ -#else -#define MBEDTLS_CTR_DRBG_KEYSIZE 32 -/**< The key size in bytes used by the cipher. - * - * Compile-time choice: 32 bytes (256 bits) - * because \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY is disabled. - */ -#endif - -#define MBEDTLS_CTR_DRBG_KEYBITS ( MBEDTLS_CTR_DRBG_KEYSIZE * 8 ) /**< The key size for the DRBG operation, in bits. */ -#define MBEDTLS_CTR_DRBG_SEEDLEN ( MBEDTLS_CTR_DRBG_KEYSIZE + MBEDTLS_CTR_DRBG_BLOCKSIZE ) /**< The seed length, calculated as (counter + AES key). */ - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them using the compiler command - * line. - * \{ - */ - -/** \def MBEDTLS_CTR_DRBG_ENTROPY_LEN - * - * \brief The amount of entropy used per seed by default, in bytes. - */ -#if !defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) -#if defined(MBEDTLS_SHA512_C) && !defined(MBEDTLS_ENTROPY_FORCE_SHA256) -/** This is 48 bytes because the entropy module uses SHA-512 - * (\c MBEDTLS_ENTROPY_FORCE_SHA256 is disabled). - */ -#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 - -#else /* defined(MBEDTLS_SHA512_C) && !defined(MBEDTLS_ENTROPY_FORCE_SHA256) */ - -/** This is 32 bytes because the entropy module uses SHA-256 - * (the SHA512 module is disabled or - * \c MBEDTLS_ENTROPY_FORCE_SHA256 is enabled). - */ -#if !defined(MBEDTLS_CTR_DRBG_USE_128_BIT_KEY) -/** \warning To achieve a 256-bit security strength, you must pass a nonce - * to mbedtls_ctr_drbg_seed(). - */ -#endif /* !defined(MBEDTLS_CTR_DRBG_USE_128_BIT_KEY) */ -#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 32 -#endif /* defined(MBEDTLS_SHA512_C) && !defined(MBEDTLS_ENTROPY_FORCE_SHA256) */ -#endif /* !defined(MBEDTLS_CTR_DRBG_ENTROPY_LEN) */ - -#if !defined(MBEDTLS_CTR_DRBG_RESEED_INTERVAL) -#define MBEDTLS_CTR_DRBG_RESEED_INTERVAL 10000 -/**< The interval before reseed is performed by default. */ -#endif - -#if !defined(MBEDTLS_CTR_DRBG_MAX_INPUT) -#define MBEDTLS_CTR_DRBG_MAX_INPUT 256 -/**< The maximum number of additional input Bytes. */ -#endif - -#if !defined(MBEDTLS_CTR_DRBG_MAX_REQUEST) -#define MBEDTLS_CTR_DRBG_MAX_REQUEST 1024 -/**< The maximum number of requested Bytes per call. */ -#endif - -#if !defined(MBEDTLS_CTR_DRBG_MAX_SEED_INPUT) -#define MBEDTLS_CTR_DRBG_MAX_SEED_INPUT 384 -/**< The maximum size of seed or reseed buffer in bytes. */ -#endif - -/* \} name SECTION: Module settings */ - -#define MBEDTLS_CTR_DRBG_PR_OFF 0 -/**< Prediction resistance is disabled. */ -#define MBEDTLS_CTR_DRBG_PR_ON 1 -/**< Prediction resistance is enabled. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if MBEDTLS_CTR_DRBG_ENTROPY_LEN >= MBEDTLS_CTR_DRBG_KEYSIZE * 3 / 2 -/** The default length of the nonce read from the entropy source. - * - * This is \c 0 because a single read from the entropy source is sufficient - * to include a nonce. - * See the documentation of mbedtls_ctr_drbg_seed() for more information. - */ -#define MBEDTLS_CTR_DRBG_ENTROPY_NONCE_LEN 0 -#else -/** The default length of the nonce read from the entropy source. - * - * This is half of the default entropy length because a single read from - * the entropy source does not provide enough material to form a nonce. - * See the documentation of mbedtls_ctr_drbg_seed() for more information. - */ -#define MBEDTLS_CTR_DRBG_ENTROPY_NONCE_LEN ( MBEDTLS_CTR_DRBG_ENTROPY_LEN + 1 ) / 2 -#endif - -/** - * \brief The CTR_DRBG context structure. - */ -typedef struct mbedtls_ctr_drbg_context -{ - unsigned char counter[16]; /*!< The counter (V). */ - int reseed_counter; /*!< The reseed counter. - * This is the number of requests that have - * been made since the last (re)seeding, - * minus one. - * Before the initial seeding, this field - * contains the amount of entropy in bytes - * to use as a nonce for the initial seeding, - * or -1 if no nonce length has been explicitly - * set (see mbedtls_ctr_drbg_set_nonce_len()). - */ - int prediction_resistance; /*!< This determines whether prediction - resistance is enabled, that is - whether to systematically reseed before - each random generation. */ - size_t entropy_len; /*!< The amount of entropy grabbed on each - seed or reseed operation, in bytes. */ - int reseed_interval; /*!< The reseed interval. - * This is the maximum number of requests - * that can be made between reseedings. */ - - mbedtls_aes_context aes_ctx; /*!< The AES context. */ - - /* - * Callbacks (Entropy) - */ - int (*f_entropy)(void *, unsigned char *, size_t); - /*!< The entropy callback function. */ - - void *p_entropy; /*!< The context for the entropy function. */ - -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; -#endif -} -mbedtls_ctr_drbg_context; - -/** - * \brief This function initializes the CTR_DRBG context, - * and prepares it for mbedtls_ctr_drbg_seed() - * or mbedtls_ctr_drbg_free(). - * - * \param ctx The CTR_DRBG context to initialize. - */ -void mbedtls_ctr_drbg_init( mbedtls_ctr_drbg_context *ctx ); - -/** - * \brief This function seeds and sets up the CTR_DRBG - * entropy source for future reseeds. - * - * A typical choice for the \p f_entropy and \p p_entropy parameters is - * to use the entropy module: - * - \p f_entropy is mbedtls_entropy_func(); - * - \p p_entropy is an instance of ::mbedtls_entropy_context initialized - * with mbedtls_entropy_init() (which registers the platform's default - * entropy sources). - * - * The entropy length is #MBEDTLS_CTR_DRBG_ENTROPY_LEN by default. - * You can override it by calling mbedtls_ctr_drbg_set_entropy_len(). - * - * The entropy nonce length is: - * - \c 0 if the entropy length is at least 3/2 times the entropy length, - * which guarantees that the security strength is the maximum permitted - * by the key size and entropy length according to NIST SP 800-90A §10.2.1; - * - Half the entropy length otherwise. - * You can override it by calling mbedtls_ctr_drbg_set_nonce_len(). - * With the default entropy length, the entropy nonce length is - * #MBEDTLS_CTR_DRBG_ENTROPY_NONCE_LEN. - * - * You can provide a nonce and personalization string in addition to the - * entropy source, to make this instantiation as unique as possible. - * See SP 800-90A §8.6.7 for more details about nonces. - * - * The _seed_material_ value passed to the derivation function in - * the CTR_DRBG Instantiate Process described in NIST SP 800-90A §10.2.1.3.2 - * is the concatenation of the following strings: - * - A string obtained by calling \p f_entropy function for the entropy - * length. - */ -#if MBEDTLS_CTR_DRBG_ENTROPY_NONCE_LEN == 0 -/** - * - If mbedtls_ctr_drbg_set_nonce_len() has been called, a string - * obtained by calling \p f_entropy function for the specified length. - */ -#else -/** - * - A string obtained by calling \p f_entropy function for the entropy nonce - * length. If the entropy nonce length is \c 0, this function does not - * make a second call to \p f_entropy. - */ -#endif -/** - * - The \p custom string. - * - * \note To achieve the nominal security strength permitted - * by CTR_DRBG, the entropy length must be: - * - at least 16 bytes for a 128-bit strength - * (maximum achievable strength when using AES-128); - * - at least 32 bytes for a 256-bit strength - * (maximum achievable strength when using AES-256). - * - * In addition, if you do not pass a nonce in \p custom, - * the sum of the entropy length - * and the entropy nonce length must be: - * - at least 24 bytes for a 128-bit strength - * (maximum achievable strength when using AES-128); - * - at least 48 bytes for a 256-bit strength - * (maximum achievable strength when using AES-256). - * - * \param ctx The CTR_DRBG context to seed. - * It must have been initialized with - * mbedtls_ctr_drbg_init(). - * After a successful call to mbedtls_ctr_drbg_seed(), - * you may not call mbedtls_ctr_drbg_seed() again on - * the same context unless you call - * mbedtls_ctr_drbg_free() and mbedtls_ctr_drbg_init() - * again first. - * \param f_entropy The entropy callback, taking as arguments the - * \p p_entropy context, the buffer to fill, and the - * length of the buffer. - * \p f_entropy is always called with a buffer size - * less than or equal to the entropy length. - * \param p_entropy The entropy context to pass to \p f_entropy. - * \param custom The personalization string. - * This can be \c NULL, in which case the personalization - * string is empty regardless of the value of \p len. - * \param len The length of the personalization string. - * This must be at most - * #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT - * - #MBEDTLS_CTR_DRBG_ENTROPY_LEN. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED on failure. - */ -int mbedtls_ctr_drbg_seed( mbedtls_ctr_drbg_context *ctx, - int (*f_entropy)(void *, unsigned char *, size_t), - void *p_entropy, - const unsigned char *custom, - size_t len ); - -/** - * \brief This function clears CTR_CRBG context data. - * - * \param ctx The CTR_DRBG context to clear. - */ -void mbedtls_ctr_drbg_free( mbedtls_ctr_drbg_context *ctx ); - -/** - * \brief This function turns prediction resistance on or off. - * The default value is off. - * - * \note If enabled, entropy is gathered at the beginning of - * every call to mbedtls_ctr_drbg_random_with_add() - * or mbedtls_ctr_drbg_random(). - * Only use this if your entropy source has sufficient - * throughput. - * - * \param ctx The CTR_DRBG context. - * \param resistance #MBEDTLS_CTR_DRBG_PR_ON or #MBEDTLS_CTR_DRBG_PR_OFF. - */ -void mbedtls_ctr_drbg_set_prediction_resistance( mbedtls_ctr_drbg_context *ctx, - int resistance ); - -/** - * \brief This function sets the amount of entropy grabbed on each - * seed or reseed. - * - * The default value is #MBEDTLS_CTR_DRBG_ENTROPY_LEN. - * - * \note The security strength of CTR_DRBG is bounded by the - * entropy length. Thus: - * - When using AES-256 - * (\c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY is disabled, - * which is the default), - * \p len must be at least 32 (in bytes) - * to achieve a 256-bit strength. - * - When using AES-128 - * (\c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY is enabled) - * \p len must be at least 16 (in bytes) - * to achieve a 128-bit strength. - * - * \param ctx The CTR_DRBG context. - * \param len The amount of entropy to grab, in bytes. - * This must be at most #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT - * and at most the maximum length accepted by the - * entropy function that is set in the context. - */ -void mbedtls_ctr_drbg_set_entropy_len( mbedtls_ctr_drbg_context *ctx, - size_t len ); - -/** - * \brief This function sets the amount of entropy grabbed - * as a nonce for the initial seeding. - * - * Call this function before calling mbedtls_ctr_drbg_seed() to read - * a nonce from the entropy source during the initial seeding. - * - * \param ctx The CTR_DRBG context. - * \param len The amount of entropy to grab for the nonce, in bytes. - * This must be at most #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT - * and at most the maximum length accepted by the - * entropy function that is set in the context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG if \p len is - * more than #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED - * if the initial seeding has already taken place. - */ -int mbedtls_ctr_drbg_set_nonce_len( mbedtls_ctr_drbg_context *ctx, - size_t len ); - -/** - * \brief This function sets the reseed interval. - * - * The reseed interval is the number of calls to mbedtls_ctr_drbg_random() - * or mbedtls_ctr_drbg_random_with_add() after which the entropy function - * is called again. - * - * The default value is #MBEDTLS_CTR_DRBG_RESEED_INTERVAL. - * - * \param ctx The CTR_DRBG context. - * \param interval The reseed interval. - */ -void mbedtls_ctr_drbg_set_reseed_interval( mbedtls_ctr_drbg_context *ctx, - int interval ); - -/** - * \brief This function reseeds the CTR_DRBG context, that is - * extracts data from the entropy source. - * - * \param ctx The CTR_DRBG context. - * \param additional Additional data to add to the state. Can be \c NULL. - * \param len The length of the additional data. - * This must be less than - * #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT - \c entropy_len - * where \c entropy_len is the entropy length - * configured for the context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED on failure. - */ -int mbedtls_ctr_drbg_reseed( mbedtls_ctr_drbg_context *ctx, - const unsigned char *additional, size_t len ); - -/** - * \brief This function updates the state of the CTR_DRBG context. - * - * \param ctx The CTR_DRBG context. - * \param additional The data to update the state with. This must not be - * \c NULL unless \p add_len is \c 0. - * \param add_len Length of \p additional in bytes. This must be at - * most #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG if - * \p add_len is more than - * #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT. - * \return An error from the underlying AES cipher on failure. - */ -int mbedtls_ctr_drbg_update_ret( mbedtls_ctr_drbg_context *ctx, - const unsigned char *additional, - size_t add_len ); - -/** - * \brief This function updates a CTR_DRBG instance with additional - * data and uses it to generate random data. - * - * This function automatically reseeds if the reseed counter is exceeded - * or prediction resistance is enabled. - * - * \param p_rng The CTR_DRBG context. This must be a pointer to a - * #mbedtls_ctr_drbg_context structure. - * \param output The buffer to fill. - * \param output_len The length of the buffer in bytes. - * \param additional Additional data to update. Can be \c NULL, in which - * case the additional data is empty regardless of - * the value of \p add_len. - * \param add_len The length of the additional data - * if \p additional is not \c NULL. - * This must be less than #MBEDTLS_CTR_DRBG_MAX_INPUT - * and less than - * #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT - \c entropy_len - * where \c entropy_len is the entropy length - * configured for the context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED or - * #MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG on failure. - */ -int mbedtls_ctr_drbg_random_with_add( void *p_rng, - unsigned char *output, size_t output_len, - const unsigned char *additional, size_t add_len ); - -/** - * \brief This function uses CTR_DRBG to generate random data. - * - * This function automatically reseeds if the reseed counter is exceeded - * or prediction resistance is enabled. - * - * - * \param p_rng The CTR_DRBG context. This must be a pointer to a - * #mbedtls_ctr_drbg_context structure. - * \param output The buffer to fill. - * \param output_len The length of the buffer in bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED or - * #MBEDTLS_ERR_CTR_DRBG_REQUEST_TOO_BIG on failure. - */ -int mbedtls_ctr_drbg_random( void *p_rng, - unsigned char *output, size_t output_len ); - - -#if ! defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function updates the state of the CTR_DRBG context. - * - * \deprecated Superseded by mbedtls_ctr_drbg_update_ret() - * in 2.16.0. - * - * \note If \p add_len is greater than - * #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT, only the first - * #MBEDTLS_CTR_DRBG_MAX_SEED_INPUT Bytes are used. - * The remaining Bytes are silently discarded. - * - * \param ctx The CTR_DRBG context. - * \param additional The data to update the state with. - * \param add_len Length of \p additional data. - */ -MBEDTLS_DEPRECATED void mbedtls_ctr_drbg_update( - mbedtls_ctr_drbg_context *ctx, - const unsigned char *additional, - size_t add_len ); -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -#if defined(MBEDTLS_FS_IO) -/** - * \brief This function writes a seed file. - * - * \param ctx The CTR_DRBG context. - * \param path The name of the file. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR on file error. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED on reseed - * failure. - */ -int mbedtls_ctr_drbg_write_seed_file( mbedtls_ctr_drbg_context *ctx, const char *path ); - -/** - * \brief This function reads and updates a seed file. The seed - * is added to this instance. - * - * \param ctx The CTR_DRBG context. - * \param path The name of the file. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_CTR_DRBG_FILE_IO_ERROR on file error. - * \return #MBEDTLS_ERR_CTR_DRBG_ENTROPY_SOURCE_FAILED on - * reseed failure. - * \return #MBEDTLS_ERR_CTR_DRBG_INPUT_TOO_BIG if the existing - * seed file is too large. - */ -int mbedtls_ctr_drbg_update_seed_file( mbedtls_ctr_drbg_context *ctx, const char *path ); -#endif /* MBEDTLS_FS_IO */ - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief The CTR_DRBG checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_ctr_drbg_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* ctr_drbg.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/debug.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/debug.h deleted file mode 100644 index ce2c274e9..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/debug.h +++ /dev/null @@ -1,264 +0,0 @@ -/** - * \file debug.h - * - * \brief Functions for controlling and providing debug output from the library. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_DEBUG_H -#define MBEDTLS_DEBUG_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/ssl.h" - -#if defined(MBEDTLS_ECP_C) -#include "mbedtls/ecp.h" -#endif - -#if defined(MBEDTLS_DEBUG_C) - -#define MBEDTLS_DEBUG_STRIP_PARENS( ... ) __VA_ARGS__ - -#define MBEDTLS_SSL_DEBUG_MSG( level, args ) \ - mbedtls_debug_print_msg( ssl, level, __FILE__, __LINE__, \ - MBEDTLS_DEBUG_STRIP_PARENS args ) - -#define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) \ - mbedtls_debug_print_ret( ssl, level, __FILE__, __LINE__, text, ret ) - -#define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) \ - mbedtls_debug_print_buf( ssl, level, __FILE__, __LINE__, text, buf, len ) - -#if defined(MBEDTLS_BIGNUM_C) -#define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) \ - mbedtls_debug_print_mpi( ssl, level, __FILE__, __LINE__, text, X ) -#endif - -#if defined(MBEDTLS_ECP_C) -#define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) \ - mbedtls_debug_print_ecp( ssl, level, __FILE__, __LINE__, text, X ) -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -#define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) \ - mbedtls_debug_print_crt( ssl, level, __FILE__, __LINE__, text, crt ) -#endif - -#if defined(MBEDTLS_ECDH_C) -#define MBEDTLS_SSL_DEBUG_ECDH( level, ecdh, attr ) \ - mbedtls_debug_printf_ecdh( ssl, level, __FILE__, __LINE__, ecdh, attr ) -#endif - -#else /* MBEDTLS_DEBUG_C */ - -#define MBEDTLS_SSL_DEBUG_MSG( level, args ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_RET( level, text, ret ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_BUF( level, text, buf, len ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_MPI( level, text, X ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_ECP( level, text, X ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_CRT( level, text, crt ) do { } while( 0 ) -#define MBEDTLS_SSL_DEBUG_ECDH( level, ecdh, attr ) do { } while( 0 ) - -#endif /* MBEDTLS_DEBUG_C */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Set the threshold error level to handle globally all debug output. - * Debug messages that have a level over the threshold value are - * discarded. - * (Default value: 0 = No debug ) - * - * \param threshold theshold level of messages to filter on. Messages at a - * higher level will be discarded. - * - Debug levels - * - 0 No debug - * - 1 Error - * - 2 State change - * - 3 Informational - * - 4 Verbose - */ -void mbedtls_debug_set_threshold( int threshold ); - -/** - * \brief Print a message to the debug output. This function is always used - * through the MBEDTLS_SSL_DEBUG_MSG() macro, which supplies the ssl - * context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the message has occurred in - * \param line line number the message has occurred at - * \param format format specifier, in printf format - * \param ... variables used by the format specifier - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_msg( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const char *format, ... ); - -/** - * \brief Print the return value of a function to the debug output. This - * function is always used through the MBEDTLS_SSL_DEBUG_RET() macro, - * which supplies the ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text the name of the function that returned the error - * \param ret the return code value - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_ret( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const char *text, int ret ); - -/** - * \brief Output a buffer of size len bytes to the debug output. This function - * is always used through the MBEDTLS_SSL_DEBUG_BUF() macro, - * which supplies the ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text a name or label for the buffer being dumped. Normally the - * variable or buffer name - * \param buf the buffer to be outputted - * \param len length of the buffer - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_buf( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, const char *text, - const unsigned char *buf, size_t len ); - -#if defined(MBEDTLS_BIGNUM_C) -/** - * \brief Print a MPI variable to the debug output. This function is always - * used through the MBEDTLS_SSL_DEBUG_MPI() macro, which supplies the - * ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text a name or label for the MPI being output. Normally the - * variable name - * \param X the MPI variable - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_mpi( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const char *text, const mbedtls_mpi *X ); -#endif - -#if defined(MBEDTLS_ECP_C) -/** - * \brief Print an ECP point to the debug output. This function is always - * used through the MBEDTLS_SSL_DEBUG_ECP() macro, which supplies the - * ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text a name or label for the ECP point being output. Normally the - * variable name - * \param X the ECP point - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_ecp( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const char *text, const mbedtls_ecp_point *X ); -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Print a X.509 certificate structure to the debug output. This - * function is always used through the MBEDTLS_SSL_DEBUG_CRT() macro, - * which supplies the ssl context, file and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param text a name or label for the certificate being output - * \param crt X.509 certificate structure - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_print_crt( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const char *text, const mbedtls_x509_crt *crt ); -#endif - -#if defined(MBEDTLS_ECDH_C) -typedef enum -{ - MBEDTLS_DEBUG_ECDH_Q, - MBEDTLS_DEBUG_ECDH_QP, - MBEDTLS_DEBUG_ECDH_Z, -} mbedtls_debug_ecdh_attr; - -/** - * \brief Print a field of the ECDH structure in the SSL context to the debug - * output. This function is always used through the - * MBEDTLS_SSL_DEBUG_ECDH() macro, which supplies the ssl context, file - * and line number parameters. - * - * \param ssl SSL context - * \param level error level of the debug message - * \param file file the error has occurred in - * \param line line number the error has occurred in - * \param ecdh the ECDH context - * \param attr the identifier of the attribute being output - * - * \attention This function is intended for INTERNAL usage within the - * library only. - */ -void mbedtls_debug_printf_ecdh( const mbedtls_ssl_context *ssl, int level, - const char *file, int line, - const mbedtls_ecdh_context *ecdh, - mbedtls_debug_ecdh_attr attr ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* debug.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/des.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/des.h deleted file mode 100644 index 1c80b5365..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/des.h +++ /dev/null @@ -1,356 +0,0 @@ -/** - * \file des.h - * - * \brief DES block cipher - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - */ -#ifndef MBEDTLS_DES_H -#define MBEDTLS_DES_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_DES_ENCRYPT 1 -#define MBEDTLS_DES_DECRYPT 0 - -#define MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH -0x0032 /**< The data input has an invalid length. */ - -/* MBEDTLS_ERR_DES_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_DES_HW_ACCEL_FAILED -0x0033 /**< DES hardware accelerator failed. */ - -#define MBEDTLS_DES_KEY_SIZE 8 - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_DES_ALT) -// Regular implementation -// - -/** - * \brief DES context structure - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -typedef struct mbedtls_des_context -{ - uint32_t sk[32]; /*!< DES subkeys */ -} -mbedtls_des_context; - -/** - * \brief Triple-DES context structure - */ -typedef struct mbedtls_des3_context -{ - uint32_t sk[96]; /*!< 3DES subkeys */ -} -mbedtls_des3_context; - -#else /* MBEDTLS_DES_ALT */ -#include "des_alt.h" -#endif /* MBEDTLS_DES_ALT */ - -/** - * \brief Initialize DES context - * - * \param ctx DES context to be initialized - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -void mbedtls_des_init( mbedtls_des_context *ctx ); - -/** - * \brief Clear DES context - * - * \param ctx DES context to be cleared - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -void mbedtls_des_free( mbedtls_des_context *ctx ); - -/** - * \brief Initialize Triple-DES context - * - * \param ctx DES3 context to be initialized - */ -void mbedtls_des3_init( mbedtls_des3_context *ctx ); - -/** - * \brief Clear Triple-DES context - * - * \param ctx DES3 context to be cleared - */ -void mbedtls_des3_free( mbedtls_des3_context *ctx ); - -/** - * \brief Set key parity on the given key to odd. - * - * DES keys are 56 bits long, but each byte is padded with - * a parity bit to allow verification. - * - * \param key 8-byte secret key - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -void mbedtls_des_key_set_parity( unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief Check that key parity on the given key is odd. - * - * DES keys are 56 bits long, but each byte is padded with - * a parity bit to allow verification. - * - * \param key 8-byte secret key - * - * \return 0 is parity was ok, 1 if parity was not correct. - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_key_check_key_parity( const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief Check that key is not a weak or semi-weak DES key - * - * \param key 8-byte secret key - * - * \return 0 if no weak key was found, 1 if a weak key was identified. - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_key_check_weak( const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief DES key schedule (56-bit, encryption) - * - * \param ctx DES context to be initialized - * \param key 8-byte secret key - * - * \return 0 - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_setkey_enc( mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief DES key schedule (56-bit, decryption) - * - * \param ctx DES context to be initialized - * \param key 8-byte secret key - * - * \return 0 - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_setkey_dec( mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -/** - * \brief Triple-DES key schedule (112-bit, encryption) - * - * \param ctx 3DES context to be initialized - * \param key 16-byte secret key - * - * \return 0 - */ -int mbedtls_des3_set2key_enc( mbedtls_des3_context *ctx, - const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] ); - -/** - * \brief Triple-DES key schedule (112-bit, decryption) - * - * \param ctx 3DES context to be initialized - * \param key 16-byte secret key - * - * \return 0 - */ -int mbedtls_des3_set2key_dec( mbedtls_des3_context *ctx, - const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2] ); - -/** - * \brief Triple-DES key schedule (168-bit, encryption) - * - * \param ctx 3DES context to be initialized - * \param key 24-byte secret key - * - * \return 0 - */ -int mbedtls_des3_set3key_enc( mbedtls_des3_context *ctx, - const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] ); - -/** - * \brief Triple-DES key schedule (168-bit, decryption) - * - * \param ctx 3DES context to be initialized - * \param key 24-byte secret key - * - * \return 0 - */ -int mbedtls_des3_set3key_dec( mbedtls_des3_context *ctx, - const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3] ); - -/** - * \brief DES-ECB block encryption/decryption - * - * \param ctx DES context - * \param input 64-bit input block - * \param output 64-bit output block - * - * \return 0 if successful - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_crypt_ecb( mbedtls_des_context *ctx, - const unsigned char input[8], - unsigned char output[8] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief DES-CBC buffer encryption/decryption - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx DES context - * \param mode MBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT - * \param length length of the input data - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -int mbedtls_des_crypt_cbc( mbedtls_des_context *ctx, - int mode, - size_t length, - unsigned char iv[8], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -/** - * \brief 3DES-ECB block encryption/decryption - * - * \param ctx 3DES context - * \param input 64-bit input block - * \param output 64-bit output block - * - * \return 0 if successful - */ -int mbedtls_des3_crypt_ecb( mbedtls_des3_context *ctx, - const unsigned char input[8], - unsigned char output[8] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief 3DES-CBC buffer encryption/decryption - * - * \note Upon exit, the content of the IV is updated so that you can - * call the function same function again on the following - * block(s) of data and get the same result as if it was - * encrypted in one call. This allows a "streaming" usage. - * If on the other hand you need to retain the contents of the - * IV, you should either save it manually or use the cipher - * module instead. - * - * \param ctx 3DES context - * \param mode MBEDTLS_DES_ENCRYPT or MBEDTLS_DES_DECRYPT - * \param length length of the input data - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if successful, or MBEDTLS_ERR_DES_INVALID_INPUT_LENGTH - */ -int mbedtls_des3_crypt_cbc( mbedtls_des3_context *ctx, - int mode, - size_t length, - unsigned char iv[8], - const unsigned char *input, - unsigned char *output ); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -/** - * \brief Internal function for key expansion. - * (Only exposed to allow overriding it, - * see MBEDTLS_DES_SETKEY_ALT) - * - * \param SK Round keys - * \param key Base key - * - * \warning DES is considered a weak cipher and its use constitutes a - * security risk. We recommend considering stronger ciphers - * instead. - */ -void mbedtls_des_setkey( uint32_t SK[32], - const unsigned char key[MBEDTLS_DES_KEY_SIZE] ); - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_des_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* des.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/dhm.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/dhm.h deleted file mode 100644 index 6dcfadd82..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/dhm.h +++ /dev/null @@ -1,1094 +0,0 @@ -/** - * \file dhm.h - * - * \brief This file contains Diffie-Hellman-Merkle (DHM) key exchange - * definitions and functions. - * - * Diffie-Hellman-Merkle (DHM) key exchange is defined in - * RFC-2631: Diffie-Hellman Key Agreement Method and - * Public-Key Cryptography Standards (PKCS) #3: Diffie - * Hellman Key Agreement Standard. - * - * RFC-3526: More Modular Exponential (MODP) Diffie-Hellman groups for - * Internet Key Exchange (IKE) defines a number of standardized - * Diffie-Hellman groups for IKE. - * - * RFC-5114: Additional Diffie-Hellman Groups for Use with IETF - * Standards defines a number of standardized Diffie-Hellman - * groups that can be used. - * - * \warning The security of the DHM key exchange relies on the proper choice - * of prime modulus - optimally, it should be a safe prime. The usage - * of non-safe primes both decreases the difficulty of the underlying - * discrete logarithm problem and can lead to small subgroup attacks - * leaking private exponent bits when invalid public keys are used - * and not detected. This is especially relevant if the same DHM - * parameters are reused for multiple key exchanges as in static DHM, - * while the criticality of small-subgroup attacks is lower for - * ephemeral DHM. - * - * \warning For performance reasons, the code does neither perform primality - * nor safe primality tests, nor the expensive checks for invalid - * subgroups. Moreover, even if these were performed, non-standardized - * primes cannot be trusted because of the possibility of backdoors - * that can't be effectively checked for. - * - * \warning Diffie-Hellman-Merkle is therefore a security risk when not using - * standardized primes generated using a trustworthy ("nothing up - * my sleeve") method, such as the RFC 3526 / 7919 primes. In the TLS - * protocol, DH parameters need to be negotiated, so using the default - * primes systematically is not always an option. If possible, use - * Elliptic Curve Diffie-Hellman (ECDH), which has better performance, - * and for which the TLS protocol mandates the use of standard - * parameters. - * - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_DHM_H -#define MBEDTLS_DHM_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif -#include "mbedtls/bignum.h" - -/* - * DHM Error codes - */ -#define MBEDTLS_ERR_DHM_BAD_INPUT_DATA -0x3080 /**< Bad input parameters. */ -#define MBEDTLS_ERR_DHM_READ_PARAMS_FAILED -0x3100 /**< Reading of the DHM parameters failed. */ -#define MBEDTLS_ERR_DHM_MAKE_PARAMS_FAILED -0x3180 /**< Making of the DHM parameters failed. */ -#define MBEDTLS_ERR_DHM_READ_PUBLIC_FAILED -0x3200 /**< Reading of the public values failed. */ -#define MBEDTLS_ERR_DHM_MAKE_PUBLIC_FAILED -0x3280 /**< Making of the public value failed. */ -#define MBEDTLS_ERR_DHM_CALC_SECRET_FAILED -0x3300 /**< Calculation of the DHM secret failed. */ -#define MBEDTLS_ERR_DHM_INVALID_FORMAT -0x3380 /**< The ASN.1 data is not formatted correctly. */ -#define MBEDTLS_ERR_DHM_ALLOC_FAILED -0x3400 /**< Allocation of memory failed. */ -#define MBEDTLS_ERR_DHM_FILE_IO_ERROR -0x3480 /**< Read or write of file failed. */ - -/* MBEDTLS_ERR_DHM_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_DHM_HW_ACCEL_FAILED -0x3500 /**< DHM hardware accelerator failed. */ - -#define MBEDTLS_ERR_DHM_SET_GROUP_FAILED -0x3580 /**< Setting the modulus and generator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_DHM_ALT) - -/** - * \brief The DHM context structure. - */ -typedef struct mbedtls_dhm_context -{ - size_t len; /*!< The size of \p P in Bytes. */ - mbedtls_mpi P; /*!< The prime modulus. */ - mbedtls_mpi G; /*!< The generator. */ - mbedtls_mpi X; /*!< Our secret value. */ - mbedtls_mpi GX; /*!< Our public key = \c G^X mod \c P. */ - mbedtls_mpi GY; /*!< The public key of the peer = \c G^Y mod \c P. */ - mbedtls_mpi K; /*!< The shared secret = \c G^(XY) mod \c P. */ - mbedtls_mpi RP; /*!< The cached value = \c R^2 mod \c P. */ - mbedtls_mpi Vi; /*!< The blinding value. */ - mbedtls_mpi Vf; /*!< The unblinding value. */ - mbedtls_mpi pX; /*!< The previous \c X. */ -} -mbedtls_dhm_context; - -#else /* MBEDTLS_DHM_ALT */ -#include "dhm_alt.h" -#endif /* MBEDTLS_DHM_ALT */ - -/** - * \brief This function initializes the DHM context. - * - * \param ctx The DHM context to initialize. - */ -void mbedtls_dhm_init( mbedtls_dhm_context *ctx ); - -/** - * \brief This function parses the DHM parameters in a - * TLS ServerKeyExchange handshake message - * (DHM modulus, generator, and public key). - * - * \note In a TLS handshake, this is the how the client - * sets up its DHM context from the server's public - * DHM key material. - * - * \param ctx The DHM context to use. This must be initialized. - * \param p On input, *p must be the start of the input buffer. - * On output, *p is updated to point to the end of the data - * that has been read. On success, this is the first byte - * past the end of the ServerKeyExchange parameters. - * On error, this is the point at which an error has been - * detected, which is usually not useful except to debug - * failures. - * \param end The end of the input buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_read_params( mbedtls_dhm_context *ctx, - unsigned char **p, - const unsigned char *end ); - -/** - * \brief This function generates a DHM key pair and exports its - * public part together with the DHM parameters in the format - * used in a TLS ServerKeyExchange handshake message. - * - * \note This function assumes that the DHM parameters \c ctx->P - * and \c ctx->G have already been properly set. For that, use - * mbedtls_dhm_set_group() below in conjunction with - * mbedtls_mpi_read_binary() and mbedtls_mpi_read_string(). - * - * \note In a TLS handshake, this is the how the server generates - * and exports its DHM key material. - * - * \param ctx The DHM context to use. This must be initialized - * and have the DHM parameters set. It may or may not - * already have imported the peer's public key. - * \param x_size The private key size in Bytes. - * \param olen The address at which to store the number of Bytes - * written on success. This must not be \c NULL. - * \param output The destination buffer. This must be a writable buffer of - * sufficient size to hold the reduced binary presentation of - * the modulus, the generator and the public key, each wrapped - * with a 2-byte length field. It is the responsibility of the - * caller to ensure that enough space is available. Refer to - * mbedtls_mpi_size() to computing the byte-size of an MPI. - * \param f_rng The RNG function. Must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng doesn't need a context parameter. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_make_params( mbedtls_dhm_context *ctx, int x_size, - unsigned char *output, size_t *olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function sets the prime modulus and generator. - * - * \note This function can be used to set \c ctx->P, \c ctx->G - * in preparation for mbedtls_dhm_make_params(). - * - * \param ctx The DHM context to configure. This must be initialized. - * \param P The MPI holding the DHM prime modulus. This must be - * an initialized MPI. - * \param G The MPI holding the DHM generator. This must be an - * initialized MPI. - * - * \return \c 0 if successful. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_set_group( mbedtls_dhm_context *ctx, - const mbedtls_mpi *P, - const mbedtls_mpi *G ); - -/** - * \brief This function imports the raw public value of the peer. - * - * \note In a TLS handshake, this is the how the server imports - * the Client's public DHM key. - * - * \param ctx The DHM context to use. This must be initialized and have - * its DHM parameters set, e.g. via mbedtls_dhm_set_group(). - * It may or may not already have generated its own private key. - * \param input The input buffer containing the \c G^Y value of the peer. - * This must be a readable buffer of size \p ilen Bytes. - * \param ilen The size of the input buffer \p input in Bytes. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_read_public( mbedtls_dhm_context *ctx, - const unsigned char *input, size_t ilen ); - -/** - * \brief This function creates a DHM key pair and exports - * the raw public key in big-endian format. - * - * \note The destination buffer is always fully written - * so as to contain a big-endian representation of G^X mod P. - * If it is larger than \c ctx->len, it is padded accordingly - * with zero-bytes at the beginning. - * - * \param ctx The DHM context to use. This must be initialized and - * have the DHM parameters set. It may or may not already - * have imported the peer's public key. - * \param x_size The private key size in Bytes. - * \param output The destination buffer. This must be a writable buffer of - * size \p olen Bytes. - * \param olen The length of the destination buffer. This must be at least - * equal to `ctx->len` (the size of \c P). - * \param f_rng The RNG function. This must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may be \c NULL - * if \p f_rng doesn't need a context argument. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_make_public( mbedtls_dhm_context *ctx, int x_size, - unsigned char *output, size_t olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function derives and exports the shared secret - * \c (G^Y)^X mod \c P. - * - * \note If \p f_rng is not \c NULL, it is used to blind the input as - * a countermeasure against timing attacks. Blinding is used - * only if our private key \c X is re-used, and not used - * otherwise. We recommend always passing a non-NULL - * \p f_rng argument. - * - * \param ctx The DHM context to use. This must be initialized - * and have its own private key generated and the peer's - * public key imported. - * \param output The buffer to write the generated shared key to. This - * must be a writable buffer of size \p output_size Bytes. - * \param output_size The size of the destination buffer. This must be at - * least the size of \c ctx->len (the size of \c P). - * \param olen On exit, holds the actual number of Bytes written. - * \param f_rng The RNG function, for blinding purposes. This may - * b \c NULL if blinding isn't needed. - * \param p_rng The RNG context. This may be \c NULL if \p f_rng - * doesn't need a context argument. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX error code on failure. - */ -int mbedtls_dhm_calc_secret( mbedtls_dhm_context *ctx, - unsigned char *output, size_t output_size, size_t *olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function frees and clears the components - * of a DHM context. - * - * \param ctx The DHM context to free and clear. This may be \c NULL, - * in which case this function is a no-op. If it is not \c NULL, - * it must point to an initialized DHM context. - */ -void mbedtls_dhm_free( mbedtls_dhm_context *ctx ); - -#if defined(MBEDTLS_ASN1_PARSE_C) -/** - * \brief This function parses DHM parameters in PEM or DER format. - * - * \param dhm The DHM context to import the DHM parameters into. - * This must be initialized. - * \param dhmin The input buffer. This must be a readable buffer of - * length \p dhminlen Bytes. - * \param dhminlen The size of the input buffer \p dhmin, including the - * terminating \c NULL Byte for PEM data. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX or \c MBEDTLS_ERR_PEM_XXX error - * code on failure. - */ -int mbedtls_dhm_parse_dhm( mbedtls_dhm_context *dhm, const unsigned char *dhmin, - size_t dhminlen ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief This function loads and parses DHM parameters from a file. - * - * \param dhm The DHM context to load the parameters to. - * This must be initialized. - * \param path The filename to read the DHM parameters from. - * This must not be \c NULL. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_DHM_XXX or \c MBEDTLS_ERR_PEM_XXX - * error code on failure. - */ -int mbedtls_dhm_parse_dhmfile( mbedtls_dhm_context *dhm, const char *path ); -#endif /* MBEDTLS_FS_IO */ -#endif /* MBEDTLS_ASN1_PARSE_C */ - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief The DMH checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_dhm_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ -#ifdef __cplusplus -} -#endif - -/** - * RFC 3526, RFC 5114 and RFC 7919 standardize a number of - * Diffie-Hellman groups, some of which are included here - * for use within the SSL/TLS module and the user's convenience - * when configuring the Diffie-Hellman parameters by hand - * through \c mbedtls_ssl_conf_dh_param. - * - * The following lists the source of the above groups in the standards: - * - RFC 5114 section 2.2: 2048-bit MODP Group with 224-bit Prime Order Subgroup - * - RFC 3526 section 3: 2048-bit MODP Group - * - RFC 3526 section 4: 3072-bit MODP Group - * - RFC 3526 section 5: 4096-bit MODP Group - * - RFC 7919 section A.1: ffdhe2048 - * - RFC 7919 section A.2: ffdhe3072 - * - RFC 7919 section A.3: ffdhe4096 - * - RFC 7919 section A.4: ffdhe6144 - * - RFC 7919 section A.5: ffdhe8192 - * - * The constants with suffix "_p" denote the chosen prime moduli, while - * the constants with suffix "_g" denote the chosen generator - * of the associated prime field. - * - * The constants further suffixed with "_bin" are provided in binary format, - * while all other constants represent null-terminated strings holding the - * hexadecimal presentation of the respective numbers. - * - * The primes from RFC 3526 and RFC 7919 have been generating by the following - * trust-worthy procedure: - * - Fix N in { 2048, 3072, 4096, 6144, 8192 } and consider the N-bit number - * the first and last 64 bits are all 1, and the remaining N - 128 bits of - * which are 0x7ff...ff. - * - Add the smallest multiple of the first N - 129 bits of the binary expansion - * of pi (for RFC 5236) or e (for RFC 7919) to this intermediate bit-string - * such that the resulting integer is a safe-prime. - * - The result is the respective RFC 3526 / 7919 prime, and the corresponding - * generator is always chosen to be 2 (which is a square for these prime, - * hence the corresponding subgroup has order (p-1)/2 and avoids leaking a - * bit in the private exponent). - * - */ - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) - -/** - * \warning The origin of the primes in RFC 5114 is not documented and - * their use therefore constitutes a security risk! - * - * \deprecated The hex-encoded primes from RFC 5114 are deprecated and are - * likely to be removed in a future version of the library without - * replacement. - */ - -/** - * The hexadecimal presentation of the prime underlying the - * 2048-bit MODP Group with 224-bit Prime Order Subgroup, as defined - * in RFC-5114: Additional Diffie-Hellman Groups for Use with - * IETF Standards. - */ -#define MBEDTLS_DHM_RFC5114_MODP_2048_P \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( \ - "AD107E1E9123A9D0D660FAA79559C51FA20D64E5683B9FD1" \ - "B54B1597B61D0A75E6FA141DF95A56DBAF9A3C407BA1DF15" \ - "EB3D688A309C180E1DE6B85A1274A0A66D3F8152AD6AC212" \ - "9037C9EDEFDA4DF8D91E8FEF55B7394B7AD5B7D0B6C12207" \ - "C9F98D11ED34DBF6C6BA0B2C8BBC27BE6A00E0A0B9C49708" \ - "B3BF8A317091883681286130BC8985DB1602E714415D9330" \ - "278273C7DE31EFDC7310F7121FD5A07415987D9ADC0A486D" \ - "CDF93ACC44328387315D75E198C641A480CD86A1B9E587E8" \ - "BE60E69CC928B2B9C52172E413042E9B23F10B0E16E79763" \ - "C9B53DCF4BA80A29E3FB73C16B8E75B97EF363E2FFA31F71" \ - "CF9DE5384E71B81C0AC4DFFE0C10E64F" ) - -/** - * The hexadecimal presentation of the chosen generator of the 2048-bit MODP - * Group with 224-bit Prime Order Subgroup, as defined in RFC-5114: - * Additional Diffie-Hellman Groups for Use with IETF Standards. - */ -#define MBEDTLS_DHM_RFC5114_MODP_2048_G \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( \ - "AC4032EF4F2D9AE39DF30B5C8FFDAC506CDEBE7B89998CAF" \ - "74866A08CFE4FFE3A6824A4E10B9A6F0DD921F01A70C4AFA" \ - "AB739D7700C29F52C57DB17C620A8652BE5E9001A8D66AD7" \ - "C17669101999024AF4D027275AC1348BB8A762D0521BC98A" \ - "E247150422EA1ED409939D54DA7460CDB5F6C6B250717CBE" \ - "F180EB34118E98D119529A45D6F834566E3025E316A330EF" \ - "BB77A86F0C1AB15B051AE3D428C8F8ACB70A8137150B8EEB" \ - "10E183EDD19963DDD9E263E4770589EF6AA21E7F5F2FF381" \ - "B539CCE3409D13CD566AFBB48D6C019181E1BCFE94B30269" \ - "EDFE72FE9B6AA4BD7B5A0F1C71CFFF4C19C418E1F6EC0179" \ - "81BC087F2A7065B384B890D3191F2BFA" ) - -/** - * The hexadecimal presentation of the prime underlying the 2048-bit MODP - * Group, as defined in RFC-3526: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - * - * \deprecated The hex-encoded primes from RFC 3625 are deprecated and - * superseded by the corresponding macros providing them as - * binary constants. Their hex-encoded constants are likely - * to be removed in a future version of the library. - * - */ -#define MBEDTLS_DHM_RFC3526_MODP_2048_P \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( \ - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \ - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \ - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \ - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \ - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" \ - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" \ - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" \ - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" \ - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" \ - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" \ - "15728E5A8AACAA68FFFFFFFFFFFFFFFF" ) - -/** - * The hexadecimal presentation of the chosen generator of the 2048-bit MODP - * Group, as defined in RFC-3526: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - */ -#define MBEDTLS_DHM_RFC3526_MODP_2048_G \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( "02" ) - -/** - * The hexadecimal presentation of the prime underlying the 3072-bit MODP - * Group, as defined in RFC-3072: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - */ -#define MBEDTLS_DHM_RFC3526_MODP_3072_P \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( \ - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \ - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \ - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \ - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \ - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" \ - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" \ - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" \ - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" \ - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" \ - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" \ - "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" \ - "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" \ - "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" \ - "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" \ - "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" \ - "43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF" ) - -/** - * The hexadecimal presentation of the chosen generator of the 3072-bit MODP - * Group, as defined in RFC-3526: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - */ -#define MBEDTLS_DHM_RFC3526_MODP_3072_G \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( "02" ) - -/** - * The hexadecimal presentation of the prime underlying the 4096-bit MODP - * Group, as defined in RFC-3526: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - */ -#define MBEDTLS_DHM_RFC3526_MODP_4096_P \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( \ - "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \ - "29024E088A67CC74020BBEA63B139B22514A08798E3404DD" \ - "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245" \ - "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED" \ - "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D" \ - "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F" \ - "83655D23DCA3AD961C62F356208552BB9ED529077096966D" \ - "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B" \ - "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9" \ - "DE2BCBF6955817183995497CEA956AE515D2261898FA0510" \ - "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64" \ - "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7" \ - "ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B" \ - "F12FFA06D98A0864D87602733EC86A64521F2B18177B200C" \ - "BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31" \ - "43DB5BFCE0FD108E4B82D120A92108011A723C12A787E6D7" \ - "88719A10BDBA5B2699C327186AF4E23C1A946834B6150BDA" \ - "2583E9CA2AD44CE8DBBBC2DB04DE8EF92E8EFC141FBECAA6" \ - "287C59474E6BC05D99B2964FA090C3A2233BA186515BE7ED" \ - "1F612970CEE2D7AFB81BDD762170481CD0069127D5B05AA9" \ - "93B4EA988D8FDDC186FFB7DC90A6C08F4DF435C934063199" \ - "FFFFFFFFFFFFFFFF" ) - -/** - * The hexadecimal presentation of the chosen generator of the 4096-bit MODP - * Group, as defined in RFC-3526: More Modular Exponential (MODP) - * Diffie-Hellman groups for Internet Key Exchange (IKE). - */ -#define MBEDTLS_DHM_RFC3526_MODP_4096_G \ - MBEDTLS_DEPRECATED_STRING_CONSTANT( "02" ) - -#endif /* MBEDTLS_DEPRECATED_REMOVED */ - -/* - * Trustworthy DHM parameters in binary form - */ - -#define MBEDTLS_DHM_RFC3526_MODP_2048_P_BIN { \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2,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0x46, 0x2E, 0x36, 0xCE, 0x3B, \ - 0xE3, 0x9E, 0x77, 0x2C, 0x18, 0x0E, 0x86, 0x03, \ - 0x9B, 0x27, 0x83, 0xA2, 0xEC, 0x07, 0xA2, 0x8F, \ - 0xB5, 0xC5, 0x5D, 0xF0, 0x6F, 0x4C, 0x52, 0xC9, \ - 0xDE, 0x2B, 0xCB, 0xF6, 0x95, 0x58, 0x17, 0x18, \ - 0x39, 0x95, 0x49, 0x7C, 0xEA, 0x95, 0x6A, 0xE5, \ - 0x15, 0xD2, 0x26, 0x18, 0x98, 0xFA, 0x05, 0x10, \ - 0x15, 0x72, 0x8E, 0x5A, 0x8A, 0xAC, 0xAA, 0x68, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } - -#define MBEDTLS_DHM_RFC3526_MODP_2048_G_BIN { 0x02 } - -#define MBEDTLS_DHM_RFC3526_MODP_3072_P_BIN { \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ - 0xC9, 0x0F, 0xDA, 0xA2, 0x21, 0x68, 0xC2, 0x34, \ - 0xC4, 0xC6, 0x62, 0x8B, 0x80, 0xDC, 0x1C, 0xD1, \ - 0x29, 0x02, 0x4E, 0x08, 0x8A, 0x67, 0xCC, 0x74, \ - 0x02, 0x0B, 0xBE, 0xA6, 0x3B, 0x13, 0x9B, 0x22, \ - 0x51, 0x4A, 0x08, 0x79, 0x8E, 0x34, 0x04, 0xDD, \ - 0xEF, 0x95, 0x19, 0xB3, 0xCD, 0x3A, 0x43, 0x1B, \ - 0x30, 0x2B, 0x0A, 0x6D, 0xF2, 0x5F, 0x14, 0x37, \ - 0x4F, 0xE1, 0x35, 0x6D, 0x6D, 0x51, 0xC2, 0x45, \ - 0xE4, 0x85, 0xB5, 0x76, 0x62, 0x5E, 0x7E, 0xC6, \ - 0xF4, 0x4C, 0x42, 0xE9, 0xA6, 0x37, 0xED, 0x6B, \ - 0x0B, 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 0x8A, 0x4F, 0xE8, \ - 0xB6, 0x85, 0x5D, 0xFE, 0x72, 0xB0, 0xA6, 0x6E, \ - 0xDE, 0xD2, 0xFB, 0xAB, 0xFB, 0xE5, 0x8A, 0x30, \ - 0xFA, 0xFA, 0xBE, 0x1C, 0x5D, 0x71, 0xA8, 0x7E, \ - 0x2F, 0x74, 0x1E, 0xF8, 0xC1, 0xFE, 0x86, 0xFE, \ - 0xA6, 0xBB, 0xFD, 0xE5, 0x30, 0x67, 0x7F, 0x0D, \ - 0x97, 0xD1, 0x1D, 0x49, 0xF7, 0xA8, 0x44, 0x3D, \ - 0x08, 0x22, 0xE5, 0x06, 0xA9, 0xF4, 0x61, 0x4E, \ - 0x01, 0x1E, 0x2A, 0x94, 0x83, 0x8F, 0xF8, 0x8C, \ - 0xD6, 0x8C, 0x8B, 0xB7, 0xC5, 0xC6, 0x42, 0x4C, \ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } - -#define MBEDTLS_DHM_RFC7919_FFDHE8192_G_BIN { 0x02 } - -#endif /* dhm.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecdh.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecdh.h deleted file mode 100644 index 3948d7c98..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecdh.h +++ /dev/null @@ -1,448 +0,0 @@ -/** - * \file ecdh.h - * - * \brief This file contains ECDH definitions and functions. - * - * The Elliptic Curve Diffie-Hellman (ECDH) protocol is an anonymous - * key agreement protocol allowing two parties to establish a shared - * secret over an insecure channel. Each party must have an - * elliptic-curve public–private key pair. - * - * For more information, see NIST SP 800-56A Rev. 2: Recommendation for - * Pair-Wise Key Establishment Schemes Using Discrete Logarithm - * Cryptography. - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_ECDH_H -#define MBEDTLS_ECDH_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/ecp.h" - -#if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED) -#undef MBEDTLS_ECDH_LEGACY_CONTEXT -#include "everest/everest.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Defines the source of the imported EC key. - */ -typedef enum -{ - MBEDTLS_ECDH_OURS, /**< Our key. */ - MBEDTLS_ECDH_THEIRS, /**< The key of the peer. */ -} mbedtls_ecdh_side; - -#if !defined(MBEDTLS_ECDH_LEGACY_CONTEXT) -/** - * Defines the ECDH implementation used. - * - * Later versions of the library may add new variants, therefore users should - * not make any assumptions about them. - */ -typedef enum -{ - MBEDTLS_ECDH_VARIANT_NONE = 0, /*!< Implementation not defined. */ - MBEDTLS_ECDH_VARIANT_MBEDTLS_2_0,/*!< The default Mbed TLS implementation */ -#if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED) - MBEDTLS_ECDH_VARIANT_EVEREST /*!< Everest implementation */ -#endif -} mbedtls_ecdh_variant; - -/** - * The context used by the default ECDH implementation. - * - * Later versions might change the structure of this context, therefore users - * should not make any assumptions about the structure of - * mbedtls_ecdh_context_mbed. - */ -typedef struct mbedtls_ecdh_context_mbed -{ - mbedtls_ecp_group grp; /*!< The elliptic curve used. */ - mbedtls_mpi d; /*!< The private key. */ - mbedtls_ecp_point Q; /*!< The public key. */ - mbedtls_ecp_point Qp; /*!< The value of the public key of the peer. */ - mbedtls_mpi z; /*!< The shared secret. */ -#if defined(MBEDTLS_ECP_RESTARTABLE) - mbedtls_ecp_restart_ctx rs; /*!< The restart context for EC computations. */ -#endif -} mbedtls_ecdh_context_mbed; -#endif - -/** - * - * \warning Performing multiple operations concurrently on the same - * ECDSA context is not supported; objects of this type - * should not be shared between multiple threads. - * \brief The ECDH context structure. - */ -typedef struct mbedtls_ecdh_context -{ -#if defined(MBEDTLS_ECDH_LEGACY_CONTEXT) - mbedtls_ecp_group grp; /*!< The elliptic curve used. */ - mbedtls_mpi d; /*!< The private key. */ - mbedtls_ecp_point Q; /*!< The public key. */ - mbedtls_ecp_point Qp; /*!< The value of the public key of the peer. */ - mbedtls_mpi z; /*!< The shared secret. */ - int point_format; /*!< The format of point export in TLS messages. */ - mbedtls_ecp_point Vi; /*!< The blinding value. */ - mbedtls_ecp_point Vf; /*!< The unblinding value. */ - mbedtls_mpi _d; /*!< The previous \p d. */ -#if defined(MBEDTLS_ECP_RESTARTABLE) - int restart_enabled; /*!< The flag for restartable mode. */ - mbedtls_ecp_restart_ctx rs; /*!< The restart context for EC computations. */ -#endif /* MBEDTLS_ECP_RESTARTABLE */ -#else - uint8_t point_format; /*!< The format of point export in TLS messages - as defined in RFC 4492. */ - mbedtls_ecp_group_id grp_id;/*!< The elliptic curve used. */ - mbedtls_ecdh_variant var; /*!< The ECDH implementation/structure used. */ - union - { - mbedtls_ecdh_context_mbed mbed_ecdh; -#if defined(MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED) - mbedtls_ecdh_context_everest everest_ecdh; -#endif - } ctx; /*!< Implementation-specific context. The - context in use is specified by the \c var - field. */ -#if defined(MBEDTLS_ECP_RESTARTABLE) - uint8_t restart_enabled; /*!< The flag for restartable mode. Functions of - an alternative implementation not supporting - restartable mode must return - MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED error - if this flag is set. */ -#endif /* MBEDTLS_ECP_RESTARTABLE */ -#endif /* MBEDTLS_ECDH_LEGACY_CONTEXT */ -} -mbedtls_ecdh_context; - -/** - * \brief Check whether a given group can be used for ECDH. - * - * \param gid The ECP group ID to check. - * - * \return \c 1 if the group can be used, \c 0 otherwise - */ -int mbedtls_ecdh_can_do( mbedtls_ecp_group_id gid ); - -/** - * \brief This function generates an ECDH keypair on an elliptic - * curve. - * - * This function performs the first of two core computations - * implemented during the ECDH key exchange. The second core - * computation is performed by mbedtls_ecdh_compute_shared(). - * - * \see ecp.h - * - * \param grp The ECP group to use. This must be initialized and have - * domain parameters loaded, for example through - * mbedtls_ecp_load() or mbedtls_ecp_tls_read_group(). - * \param d The destination MPI (private key). - * This must be initialized. - * \param Q The destination point (public key). - * This must be initialized. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL in case \p f_rng doesn't need a context argument. - * - * \return \c 0 on success. - * \return Another \c MBEDTLS_ERR_ECP_XXX or - * \c MBEDTLS_MPI_XXX error code on failure. - */ -int mbedtls_ecdh_gen_public( mbedtls_ecp_group *grp, mbedtls_mpi *d, mbedtls_ecp_point *Q, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function computes the shared secret. - * - * This function performs the second of two core computations - * implemented during the ECDH key exchange. The first core - * computation is performed by mbedtls_ecdh_gen_public(). - * - * \see ecp.h - * - * \note If \p f_rng is not NULL, it is used to implement - * countermeasures against side-channel attacks. - * For more information, see mbedtls_ecp_mul(). - * - * \param grp The ECP group to use. This must be initialized and have - * domain parameters loaded, for example through - * mbedtls_ecp_load() or mbedtls_ecp_tls_read_group(). - * \param z The destination MPI (shared secret). - * This must be initialized. - * \param Q The public key from another party. - * This must be initialized. - * \param d Our secret exponent (private key). - * This must be initialized. - * \param f_rng The RNG function. This may be \c NULL if randomization - * of intermediate results during the ECP computations is - * not needed (discouraged). See the documentation of - * mbedtls_ecp_mul() for more. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng is \c NULL or doesn't need a - * context argument. - * - * \return \c 0 on success. - * \return Another \c MBEDTLS_ERR_ECP_XXX or - * \c MBEDTLS_MPI_XXX error code on failure. - */ -int mbedtls_ecdh_compute_shared( mbedtls_ecp_group *grp, mbedtls_mpi *z, - const mbedtls_ecp_point *Q, const mbedtls_mpi *d, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function initializes an ECDH context. - * - * \param ctx The ECDH context to initialize. This must not be \c NULL. - */ -void mbedtls_ecdh_init( mbedtls_ecdh_context *ctx ); - -/** - * \brief This function sets up the ECDH context with the information - * given. - * - * This function should be called after mbedtls_ecdh_init() but - * before mbedtls_ecdh_make_params(). There is no need to call - * this function before mbedtls_ecdh_read_params(). - * - * This is the first function used by a TLS server for ECDHE - * ciphersuites. - * - * \param ctx The ECDH context to set up. This must be initialized. - * \param grp_id The group id of the group to set up the context for. - * - * \return \c 0 on success. - */ -int mbedtls_ecdh_setup( mbedtls_ecdh_context *ctx, - mbedtls_ecp_group_id grp_id ); - -/** - * \brief This function frees a context. - * - * \param ctx The context to free. This may be \c NULL, in which - * case this function does nothing. If it is not \c NULL, - * it must point to an initialized ECDH context. - */ -void mbedtls_ecdh_free( mbedtls_ecdh_context *ctx ); - -/** - * \brief This function generates an EC key pair and exports its - * in the format used in a TLS ServerKeyExchange handshake - * message. - * - * This is the second function used by a TLS server for ECDHE - * ciphersuites. (It is called after mbedtls_ecdh_setup().) - * - * \see ecp.h - * - * \param ctx The ECDH context to use. This must be initialized - * and bound to a group, for example via mbedtls_ecdh_setup(). - * \param olen The address at which to store the number of Bytes written. - * \param buf The destination buffer. This must be a writable buffer of - * length \p blen Bytes. - * \param blen The length of the destination buffer \p buf in Bytes. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL in case \p f_rng doesn't need a context argument. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of - * operations was reached: see \c mbedtls_ecp_set_max_ops(). - * \return Another \c MBEDTLS_ERR_ECP_XXX error code on failure. - */ -int mbedtls_ecdh_make_params( mbedtls_ecdh_context *ctx, size_t *olen, - unsigned char *buf, size_t blen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function parses the ECDHE parameters in a - * TLS ServerKeyExchange handshake message. - * - * \note In a TLS handshake, this is the how the client - * sets up its ECDHE context from the server's public - * ECDHE key material. - * - * \see ecp.h - * - * \param ctx The ECDHE context to use. This must be initialized. - * \param buf On input, \c *buf must be the start of the input buffer. - * On output, \c *buf is updated to point to the end of the - * data that has been read. On success, this is the first byte - * past the end of the ServerKeyExchange parameters. - * On error, this is the point at which an error has been - * detected, which is usually not useful except to debug - * failures. - * \param end The end of the input buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX error code on failure. - * - */ -int mbedtls_ecdh_read_params( mbedtls_ecdh_context *ctx, - const unsigned char **buf, - const unsigned char *end ); - -/** - * \brief This function sets up an ECDH context from an EC key. - * - * It is used by clients and servers in place of the - * ServerKeyEchange for static ECDH, and imports ECDH - * parameters from the EC key information of a certificate. - * - * \see ecp.h - * - * \param ctx The ECDH context to set up. This must be initialized. - * \param key The EC key to use. This must be initialized. - * \param side Defines the source of the key. Possible values are: - * - #MBEDTLS_ECDH_OURS: The key is ours. - * - #MBEDTLS_ECDH_THEIRS: The key is that of the peer. - * - * \return \c 0 on success. - * \return Another \c MBEDTLS_ERR_ECP_XXX error code on failure. - * - */ -int mbedtls_ecdh_get_params( mbedtls_ecdh_context *ctx, - const mbedtls_ecp_keypair *key, - mbedtls_ecdh_side side ); - -/** - * \brief This function generates a public key and exports it - * as a TLS ClientKeyExchange payload. - * - * This is the second function used by a TLS client for ECDH(E) - * ciphersuites. - * - * \see ecp.h - * - * \param ctx The ECDH context to use. This must be initialized - * and bound to a group, the latter usually by - * mbedtls_ecdh_read_params(). - * \param olen The address at which to store the number of Bytes written. - * This must not be \c NULL. - * \param buf The destination buffer. This must be a writable buffer - * of length \p blen Bytes. - * \param blen The size of the destination buffer \p buf in Bytes. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL in case \p f_rng doesn't need a context argument. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of - * operations was reached: see \c mbedtls_ecp_set_max_ops(). - * \return Another \c MBEDTLS_ERR_ECP_XXX error code on failure. - */ -int mbedtls_ecdh_make_public( mbedtls_ecdh_context *ctx, size_t *olen, - unsigned char *buf, size_t blen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function parses and processes the ECDHE payload of a - * TLS ClientKeyExchange message. - * - * This is the third function used by a TLS server for ECDH(E) - * ciphersuites. (It is called after mbedtls_ecdh_setup() and - * mbedtls_ecdh_make_params().) - * - * \see ecp.h - * - * \param ctx The ECDH context to use. This must be initialized - * and bound to a group, for example via mbedtls_ecdh_setup(). - * \param buf The pointer to the ClientKeyExchange payload. This must - * be a readable buffer of length \p blen Bytes. - * \param blen The length of the input buffer \p buf in Bytes. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX error code on failure. - */ -int mbedtls_ecdh_read_public( mbedtls_ecdh_context *ctx, - const unsigned char *buf, size_t blen ); - -/** - * \brief This function derives and exports the shared secret. - * - * This is the last function used by both TLS client - * and servers. - * - * \note If \p f_rng is not NULL, it is used to implement - * countermeasures against side-channel attacks. - * For more information, see mbedtls_ecp_mul(). - * - * \see ecp.h - - * \param ctx The ECDH context to use. This must be initialized - * and have its own private key generated and the peer's - * public key imported. - * \param olen The address at which to store the total number of - * Bytes written on success. This must not be \c NULL. - * \param buf The buffer to write the generated shared key to. This - * must be a writable buffer of size \p blen Bytes. - * \param blen The length of the destination buffer \p buf in Bytes. - * \param f_rng The RNG function, for blinding purposes. This may - * b \c NULL if blinding isn't needed. - * \param p_rng The RNG context. This may be \c NULL if \p f_rng - * doesn't need a context argument. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of - * operations was reached: see \c mbedtls_ecp_set_max_ops(). - * \return Another \c MBEDTLS_ERR_ECP_XXX error code on failure. - */ -int mbedtls_ecdh_calc_secret( mbedtls_ecdh_context *ctx, size_t *olen, - unsigned char *buf, size_t blen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -#if defined(MBEDTLS_ECP_RESTARTABLE) -/** - * \brief This function enables restartable EC computations for this - * context. (Default: disabled.) - * - * \see \c mbedtls_ecp_set_max_ops() - * - * \note It is not possible to safely disable restartable - * computations once enabled, except by free-ing the context, - * which cancels possible in-progress operations. - * - * \param ctx The ECDH context to use. This must be initialized. - */ -void mbedtls_ecdh_enable_restart( mbedtls_ecdh_context *ctx ); -#endif /* MBEDTLS_ECP_RESTARTABLE */ - -#ifdef __cplusplus -} -#endif - -#endif /* ecdh.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecdsa.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecdsa.h deleted file mode 100644 index b009e7345..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecdsa.h +++ /dev/null @@ -1,628 +0,0 @@ -/** - * \file ecdsa.h - * - * \brief This file contains ECDSA definitions and functions. - * - * The Elliptic Curve Digital Signature Algorithm (ECDSA) is defined in - * Standards for Efficient Cryptography Group (SECG): - * SEC1 Elliptic Curve Cryptography. - * The use of ECDSA for TLS is defined in RFC-4492: Elliptic Curve - * Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS). - * - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_ECDSA_H -#define MBEDTLS_ECDSA_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/ecp.h" -#include "mbedtls/md.h" - -/** - * \brief Maximum ECDSA signature size for a given curve bit size - * - * \param bits Curve size in bits - * \return Maximum signature size in bytes - * - * \note This macro returns a compile-time constant if its argument - * is one. It may evaluate its argument multiple times. - */ -/* - * Ecdsa-Sig-Value ::= SEQUENCE { - * r INTEGER, - * s INTEGER - * } - * - * For each of r and s, the value (V) may include an extra initial "0" bit. - */ -#define MBEDTLS_ECDSA_MAX_SIG_LEN( bits ) \ - ( /*T,L of SEQUENCE*/ ( ( bits ) >= 61 * 8 ? 3 : 2 ) + \ - /*T,L of r,s*/ 2 * ( ( ( bits ) >= 127 * 8 ? 3 : 2 ) + \ - /*V of r,s*/ ( ( bits ) + 8 ) / 8 ) ) - -/** The maximal size of an ECDSA signature in Bytes. */ -#define MBEDTLS_ECDSA_MAX_LEN MBEDTLS_ECDSA_MAX_SIG_LEN( MBEDTLS_ECP_MAX_BITS ) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The ECDSA context structure. - * - * \warning Performing multiple operations concurrently on the same - * ECDSA context is not supported; objects of this type - * should not be shared between multiple threads. - */ -typedef mbedtls_ecp_keypair mbedtls_ecdsa_context; - -#if defined(MBEDTLS_ECP_RESTARTABLE) - -/** - * \brief Internal restart context for ecdsa_verify() - * - * \note Opaque struct, defined in ecdsa.c - */ -typedef struct mbedtls_ecdsa_restart_ver mbedtls_ecdsa_restart_ver_ctx; - -/** - * \brief Internal restart context for ecdsa_sign() - * - * \note Opaque struct, defined in ecdsa.c - */ -typedef struct mbedtls_ecdsa_restart_sig mbedtls_ecdsa_restart_sig_ctx; - -#if defined(MBEDTLS_ECDSA_DETERMINISTIC) -/** - * \brief Internal restart context for ecdsa_sign_det() - * - * \note Opaque struct, defined in ecdsa.c - */ -typedef struct mbedtls_ecdsa_restart_det mbedtls_ecdsa_restart_det_ctx; -#endif - -/** - * \brief General context for resuming ECDSA operations - */ -typedef struct -{ - mbedtls_ecp_restart_ctx ecp; /*!< base context for ECP restart and - shared administrative info */ - mbedtls_ecdsa_restart_ver_ctx *ver; /*!< ecdsa_verify() sub-context */ - mbedtls_ecdsa_restart_sig_ctx *sig; /*!< ecdsa_sign() sub-context */ -#if defined(MBEDTLS_ECDSA_DETERMINISTIC) - mbedtls_ecdsa_restart_det_ctx *det; /*!< ecdsa_sign_det() sub-context */ -#endif -} mbedtls_ecdsa_restart_ctx; - -#else /* MBEDTLS_ECP_RESTARTABLE */ - -/* Now we can declare functions that take a pointer to that */ -typedef void mbedtls_ecdsa_restart_ctx; - -#endif /* MBEDTLS_ECP_RESTARTABLE */ - -/** - * \brief This function checks whether a given group can be used - * for ECDSA. - * - * \param gid The ECP group ID to check. - * - * \return \c 1 if the group can be used, \c 0 otherwise - */ -int mbedtls_ecdsa_can_do( mbedtls_ecp_group_id gid ); - -/** - * \brief This function computes the ECDSA signature of a - * previously-hashed message. - * - * \note The deterministic version implemented in - * mbedtls_ecdsa_sign_det() is usually preferred. - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated - * as defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.3, step 5. - * - * \see ecp.h - * - * \param grp The context for the elliptic curve to use. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param r The MPI context in which to store the first part - * the signature. This must be initialized. - * \param s The MPI context in which to store the second part - * the signature. This must be initialized. - * \param d The private signing key. This must be initialized. - * \param buf The content to be signed. This is usually the hash of - * the original data to be signed. This must be a readable - * buffer of length \p blen Bytes. It may be \c NULL if - * \p blen is zero. - * \param blen The length of \p buf in Bytes. - * \param f_rng The RNG function. This must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng doesn't need a context parameter. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX - * or \c MBEDTLS_MPI_XXX error code on failure. - */ -int mbedtls_ecdsa_sign( mbedtls_ecp_group *grp, mbedtls_mpi *r, mbedtls_mpi *s, - const mbedtls_mpi *d, const unsigned char *buf, size_t blen, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -#if defined(MBEDTLS_ECDSA_DETERMINISTIC) -#if ! defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function computes the ECDSA signature of a - * previously-hashed message, deterministic version. - * - * For more information, see RFC-6979: Deterministic - * Usage of the Digital Signature Algorithm (DSA) and Elliptic - * Curve Digital Signature Algorithm (ECDSA). - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.3, step 5. - * - * \warning Since the output of the internal RNG is always the same for - * the same key and message, this limits the efficiency of - * blinding and leaks information through side channels. For - * secure behavior use mbedtls_ecdsa_sign_det_ext() instead. - * - * (Optimally the blinding is a random value that is different - * on every execution. In this case the blinding is still - * random from the attackers perspective, but is the same on - * each execution. This means that this blinding does not - * prevent attackers from recovering secrets by combining - * several measurement traces, but may prevent some attacks - * that exploit relationships between secret data.) - * - * \see ecp.h - * - * \param grp The context for the elliptic curve to use. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param r The MPI context in which to store the first part - * the signature. This must be initialized. - * \param s The MPI context in which to store the second part - * the signature. This must be initialized. - * \param d The private signing key. This must be initialized - * and setup, for example through mbedtls_ecp_gen_privkey(). - * \param buf The hashed content to be signed. This must be a readable - * buffer of length \p blen Bytes. It may be \c NULL if - * \p blen is zero. - * \param blen The length of \p buf in Bytes. - * \param md_alg The hash algorithm used to hash the original data. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX - * error code on failure. - */ -int mbedtls_ecdsa_sign_det( mbedtls_ecp_group *grp, mbedtls_mpi *r, - mbedtls_mpi *s, const mbedtls_mpi *d, - const unsigned char *buf, size_t blen, - mbedtls_md_type_t md_alg ) MBEDTLS_DEPRECATED; -#undef MBEDTLS_DEPRECATED -#endif /* MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief This function computes the ECDSA signature of a - * previously-hashed message, deterministic version. - * - * For more information, see RFC-6979: Deterministic - * Usage of the Digital Signature Algorithm (DSA) and Elliptic - * Curve Digital Signature Algorithm (ECDSA). - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.3, step 5. - * - * \see ecp.h - * - * \param grp The context for the elliptic curve to use. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param r The MPI context in which to store the first part - * the signature. This must be initialized. - * \param s The MPI context in which to store the second part - * the signature. This must be initialized. - * \param d The private signing key. This must be initialized - * and setup, for example through mbedtls_ecp_gen_privkey(). - * \param buf The hashed content to be signed. This must be a readable - * buffer of length \p blen Bytes. It may be \c NULL if - * \p blen is zero. - * \param blen The length of \p buf in Bytes. - * \param md_alg The hash algorithm used to hash the original data. - * \param f_rng_blind The RNG function used for blinding. This must not be - * \c NULL. - * \param p_rng_blind The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng doesn't need a context parameter. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX - * error code on failure. - */ -int mbedtls_ecdsa_sign_det_ext( mbedtls_ecp_group *grp, mbedtls_mpi *r, - mbedtls_mpi *s, const mbedtls_mpi *d, - const unsigned char *buf, size_t blen, - mbedtls_md_type_t md_alg, - int (*f_rng_blind)(void *, unsigned char *, size_t), - void *p_rng_blind ); -#endif /* MBEDTLS_ECDSA_DETERMINISTIC */ - -/** - * \brief This function verifies the ECDSA signature of a - * previously-hashed message. - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.4, step 3. - * - * \see ecp.h - * - * \param grp The ECP group to use. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param buf The hashed content that was signed. This must be a readable - * buffer of length \p blen Bytes. It may be \c NULL if - * \p blen is zero. - * \param blen The length of \p buf in Bytes. - * \param Q The public key to use for verification. This must be - * initialized and setup. - * \param r The first integer of the signature. - * This must be initialized. - * \param s The second integer of the signature. - * This must be initialized. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the signature - * is invalid. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX - * error code on failure for any other reason. - */ -int mbedtls_ecdsa_verify( mbedtls_ecp_group *grp, - const unsigned char *buf, size_t blen, - const mbedtls_ecp_point *Q, const mbedtls_mpi *r, - const mbedtls_mpi *s); - -/** - * \brief This function computes the ECDSA signature and writes it - * to a buffer, serialized as defined in RFC-4492: - * Elliptic Curve Cryptography (ECC) Cipher Suites for - * Transport Layer Security (TLS). - * - * \warning It is not thread-safe to use the same context in - * multiple threads. - * - * \note The deterministic version is used if - * #MBEDTLS_ECDSA_DETERMINISTIC is defined. For more - * information, see RFC-6979: Deterministic Usage - * of the Digital Signature Algorithm (DSA) and Elliptic - * Curve Digital Signature Algorithm (ECDSA). - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.3, step 5. - * - * \see ecp.h - * - * \param ctx The ECDSA context to use. This must be initialized - * and have a group and private key bound to it, for example - * via mbedtls_ecdsa_genkey() or mbedtls_ecdsa_from_keypair(). - * \param md_alg The message digest that was used to hash the message. - * \param hash The message hash to be signed. This must be a readable - * buffer of length \p blen Bytes. - * \param hlen The length of the hash \p hash in Bytes. - * \param sig The buffer to which to write the signature. This must be a - * writable buffer of length at least twice as large as the - * size of the curve used, plus 9. For example, 73 Bytes if - * a 256-bit curve is used. A buffer length of - * #MBEDTLS_ECDSA_MAX_LEN is always safe. - * \param slen The address at which to store the actual length of - * the signature written. Must not be \c NULL. - * \param f_rng The RNG function. This must not be \c NULL if - * #MBEDTLS_ECDSA_DETERMINISTIC is unset. Otherwise, - * it is used only for blinding and may be set to \c NULL, but - * doing so is DEPRECATED. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng is \c NULL or doesn't use a context. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX, \c MBEDTLS_ERR_MPI_XXX or - * \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_ecdsa_write_signature( mbedtls_ecdsa_context *ctx, - mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hlen, - unsigned char *sig, size_t *slen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function computes the ECDSA signature and writes it - * to a buffer, in a restartable way. - * - * \see \c mbedtls_ecdsa_write_signature() - * - * \note This function is like \c mbedtls_ecdsa_write_signature() - * but it can return early and restart according to the limit - * set with \c mbedtls_ecp_set_max_ops() to reduce blocking. - * - * \param ctx The ECDSA context to use. This must be initialized - * and have a group and private key bound to it, for example - * via mbedtls_ecdsa_genkey() or mbedtls_ecdsa_from_keypair(). - * \param md_alg The message digest that was used to hash the message. - * \param hash The message hash to be signed. This must be a readable - * buffer of length \p blen Bytes. - * \param hlen The length of the hash \p hash in Bytes. - * \param sig The buffer to which to write the signature. This must be a - * writable buffer of length at least twice as large as the - * size of the curve used, plus 9. For example, 73 Bytes if - * a 256-bit curve is used. A buffer length of - * #MBEDTLS_ECDSA_MAX_LEN is always safe. - * \param slen The address at which to store the actual length of - * the signature written. Must not be \c NULL. - * \param f_rng The RNG function. This must not be \c NULL if - * #MBEDTLS_ECDSA_DETERMINISTIC is unset. Otherwise, - * it is unused and may be set to \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng is \c NULL or doesn't use a context. - * \param rs_ctx The restart context to use. This may be \c NULL to disable - * restarting. If it is not \c NULL, it must point to an - * initialized restart context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of - * operations was reached: see \c mbedtls_ecp_set_max_ops(). - * \return Another \c MBEDTLS_ERR_ECP_XXX, \c MBEDTLS_ERR_MPI_XXX or - * \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_ecdsa_write_signature_restartable( mbedtls_ecdsa_context *ctx, - mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hlen, - unsigned char *sig, size_t *slen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - mbedtls_ecdsa_restart_ctx *rs_ctx ); - -#if defined(MBEDTLS_ECDSA_DETERMINISTIC) -#if ! defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function computes an ECDSA signature and writes - * it to a buffer, serialized as defined in RFC-4492: - * Elliptic Curve Cryptography (ECC) Cipher Suites for - * Transport Layer Security (TLS). - * - * The deterministic version is defined in RFC-6979: - * Deterministic Usage of the Digital Signature Algorithm (DSA) - * and Elliptic Curve Digital Signature Algorithm (ECDSA). - * - * \warning It is not thread-safe to use the same context in - * multiple threads. - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.3, step 5. - * - * \see ecp.h - * - * \deprecated Superseded by mbedtls_ecdsa_write_signature() in - * Mbed TLS version 2.0 and later. - * - * \param ctx The ECDSA context to use. This must be initialized - * and have a group and private key bound to it, for example - * via mbedtls_ecdsa_genkey() or mbedtls_ecdsa_from_keypair(). - * \param hash The message hash to be signed. This must be a readable - * buffer of length \p blen Bytes. - * \param hlen The length of the hash \p hash in Bytes. - * \param sig The buffer to which to write the signature. This must be a - * writable buffer of length at least twice as large as the - * size of the curve used, plus 9. For example, 73 Bytes if - * a 256-bit curve is used. A buffer length of - * #MBEDTLS_ECDSA_MAX_LEN is always safe. - * \param slen The address at which to store the actual length of - * the signature written. Must not be \c NULL. - * \param md_alg The message digest that was used to hash the message. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX, \c MBEDTLS_ERR_MPI_XXX or - * \c MBEDTLS_ERR_ASN1_XXX error code on failure. - */ -int mbedtls_ecdsa_write_signature_det( mbedtls_ecdsa_context *ctx, - const unsigned char *hash, size_t hlen, - unsigned char *sig, size_t *slen, - mbedtls_md_type_t md_alg ) MBEDTLS_DEPRECATED; -#undef MBEDTLS_DEPRECATED -#endif /* MBEDTLS_DEPRECATED_REMOVED */ -#endif /* MBEDTLS_ECDSA_DETERMINISTIC */ - -/** - * \brief This function reads and verifies an ECDSA signature. - * - * \note If the bitlength of the message hash is larger than the - * bitlength of the group order, then the hash is truncated as - * defined in Standards for Efficient Cryptography Group - * (SECG): SEC1 Elliptic Curve Cryptography, section - * 4.1.4, step 3. - * - * \see ecp.h - * - * \param ctx The ECDSA context to use. This must be initialized - * and have a group and public key bound to it. - * \param hash The message hash that was signed. This must be a readable - * buffer of length \p size Bytes. - * \param hlen The size of the hash \p hash. - * \param sig The signature to read and verify. This must be a readable - * buffer of length \p slen Bytes. - * \param slen The size of \p sig in Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if signature is invalid. - * \return #MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH if there is a valid - * signature in \p sig, but its length is less than \p siglen. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_ERR_MPI_XXX - * error code on failure for any other reason. - */ -int mbedtls_ecdsa_read_signature( mbedtls_ecdsa_context *ctx, - const unsigned char *hash, size_t hlen, - const unsigned char *sig, size_t slen ); - -/** - * \brief This function reads and verifies an ECDSA signature, - * in a restartable way. - * - * \see \c mbedtls_ecdsa_read_signature() - * - * \note This function is like \c mbedtls_ecdsa_read_signature() - * but it can return early and restart according to the limit - * set with \c mbedtls_ecp_set_max_ops() to reduce blocking. - * - * \param ctx The ECDSA context to use. This must be initialized - * and have a group and public key bound to it. - * \param hash The message hash that was signed. This must be a readable - * buffer of length \p size Bytes. - * \param hlen The size of the hash \p hash. - * \param sig The signature to read and verify. This must be a readable - * buffer of length \p slen Bytes. - * \param slen The size of \p sig in Bytes. - * \param rs_ctx The restart context to use. This may be \c NULL to disable - * restarting. If it is not \c NULL, it must point to an - * initialized restart context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if signature is invalid. - * \return #MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH if there is a valid - * signature in \p sig, but its length is less than \p siglen. - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of - * operations was reached: see \c mbedtls_ecp_set_max_ops(). - * \return Another \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_ERR_MPI_XXX - * error code on failure for any other reason. - */ -int mbedtls_ecdsa_read_signature_restartable( mbedtls_ecdsa_context *ctx, - const unsigned char *hash, size_t hlen, - const unsigned char *sig, size_t slen, - mbedtls_ecdsa_restart_ctx *rs_ctx ); - -/** - * \brief This function generates an ECDSA keypair on the given curve. - * - * \see ecp.h - * - * \param ctx The ECDSA context to store the keypair in. - * This must be initialized. - * \param gid The elliptic curve to use. One of the various - * \c MBEDTLS_ECP_DP_XXX macros depending on configuration. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng doesn't need a context argument. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX code on failure. - */ -int mbedtls_ecdsa_genkey( mbedtls_ecdsa_context *ctx, mbedtls_ecp_group_id gid, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief This function sets up an ECDSA context from an EC key pair. - * - * \see ecp.h - * - * \param ctx The ECDSA context to setup. This must be initialized. - * \param key The EC key to use. This must be initialized and hold - * a private-public key pair or a public key. In the former - * case, the ECDSA context may be used for signature creation - * and verification after this call. In the latter case, it - * may be used for signature verification. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX code on failure. - */ -int mbedtls_ecdsa_from_keypair( mbedtls_ecdsa_context *ctx, - const mbedtls_ecp_keypair *key ); - -/** - * \brief This function initializes an ECDSA context. - * - * \param ctx The ECDSA context to initialize. - * This must not be \c NULL. - */ -void mbedtls_ecdsa_init( mbedtls_ecdsa_context *ctx ); - -/** - * \brief This function frees an ECDSA context. - * - * \param ctx The ECDSA context to free. This may be \c NULL, - * in which case this function does nothing. If it - * is not \c NULL, it must be initialized. - */ -void mbedtls_ecdsa_free( mbedtls_ecdsa_context *ctx ); - -#if defined(MBEDTLS_ECP_RESTARTABLE) -/** - * \brief Initialize a restart context. - * - * \param ctx The restart context to initialize. - * This must not be \c NULL. - */ -void mbedtls_ecdsa_restart_init( mbedtls_ecdsa_restart_ctx *ctx ); - -/** - * \brief Free the components of a restart context. - * - * \param ctx The restart context to free. This may be \c NULL, - * in which case this function does nothing. If it - * is not \c NULL, it must be initialized. - */ -void mbedtls_ecdsa_restart_free( mbedtls_ecdsa_restart_ctx *ctx ); -#endif /* MBEDTLS_ECP_RESTARTABLE */ - -#ifdef __cplusplus -} -#endif - -#endif /* ecdsa.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecjpake.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecjpake.h deleted file mode 100644 index 97387c3b4..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecjpake.h +++ /dev/null @@ -1,277 +0,0 @@ -/** - * \file ecjpake.h - * - * \brief Elliptic curve J-PAKE - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ECJPAKE_H -#define MBEDTLS_ECJPAKE_H - -/* - * J-PAKE is a password-authenticated key exchange that allows deriving a - * strong shared secret from a (potentially low entropy) pre-shared - * passphrase, with forward secrecy and mutual authentication. - * https://en.wikipedia.org/wiki/Password_Authenticated_Key_Exchange_by_Juggling - * - * This file implements the Elliptic Curve variant of J-PAKE, - * as defined in Chapter 7.4 of the Thread v1.0 Specification, - * available to members of the Thread Group http://threadgroup.org/ - * - * As the J-PAKE algorithm is inherently symmetric, so is our API. - * Each party needs to send its first round message, in any order, to the - * other party, then each sends its second round message, in any order. - * The payloads are serialized in a way suitable for use in TLS, but could - * also be use outside TLS. - */ -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/ecp.h" -#include "mbedtls/md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Roles in the EC J-PAKE exchange - */ -typedef enum { - MBEDTLS_ECJPAKE_CLIENT = 0, /**< Client */ - MBEDTLS_ECJPAKE_SERVER, /**< Server */ -} mbedtls_ecjpake_role; - -#if !defined(MBEDTLS_ECJPAKE_ALT) -/** - * EC J-PAKE context structure. - * - * J-PAKE is a symmetric protocol, except for the identifiers used in - * Zero-Knowledge Proofs, and the serialization of the second message - * (KeyExchange) as defined by the Thread spec. - * - * In order to benefit from this symmetry, we choose a different naming - * convetion from the Thread v1.0 spec. Correspondance is indicated in the - * description as a pair C: client name, S: server name - */ -typedef struct mbedtls_ecjpake_context -{ - const mbedtls_md_info_t *md_info; /**< Hash to use */ - mbedtls_ecp_group grp; /**< Elliptic curve */ - mbedtls_ecjpake_role role; /**< Are we client or server? */ - int point_format; /**< Format for point export */ - - mbedtls_ecp_point Xm1; /**< My public key 1 C: X1, S: X3 */ - mbedtls_ecp_point Xm2; /**< My public key 2 C: X2, S: X4 */ - mbedtls_ecp_point Xp1; /**< Peer public key 1 C: X3, S: X1 */ - mbedtls_ecp_point Xp2; /**< Peer public key 2 C: X4, S: X2 */ - mbedtls_ecp_point Xp; /**< Peer public key C: Xs, S: Xc */ - - mbedtls_mpi xm1; /**< My private key 1 C: x1, S: x3 */ - mbedtls_mpi xm2; /**< My private key 2 C: x2, S: x4 */ - - mbedtls_mpi s; /**< Pre-shared secret (passphrase) */ -} mbedtls_ecjpake_context; - -#else /* MBEDTLS_ECJPAKE_ALT */ -#include "ecjpake_alt.h" -#endif /* MBEDTLS_ECJPAKE_ALT */ - -/** - * \brief Initialize an ECJPAKE context. - * - * \param ctx The ECJPAKE context to initialize. - * This must not be \c NULL. - */ -void mbedtls_ecjpake_init( mbedtls_ecjpake_context *ctx ); - -/** - * \brief Set up an ECJPAKE context for use. - * - * \note Currently the only values for hash/curve allowed by the - * standard are #MBEDTLS_MD_SHA256/#MBEDTLS_ECP_DP_SECP256R1. - * - * \param ctx The ECJPAKE context to set up. This must be initialized. - * \param role The role of the caller. This must be either - * #MBEDTLS_ECJPAKE_CLIENT or #MBEDTLS_ECJPAKE_SERVER. - * \param hash The identifier of the hash function to use, - * for example #MBEDTLS_MD_SHA256. - * \param curve The identifier of the elliptic curve to use, - * for example #MBEDTLS_ECP_DP_SECP256R1. - * \param secret The pre-shared secret (passphrase). This must be - * a readable buffer of length \p len Bytes. It need - * only be valid for the duration of this call. - * \param len The length of the pre-shared secret \p secret. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_ecjpake_setup( mbedtls_ecjpake_context *ctx, - mbedtls_ecjpake_role role, - mbedtls_md_type_t hash, - mbedtls_ecp_group_id curve, - const unsigned char *secret, - size_t len ); - -/** - * \brief Check if an ECJPAKE context is ready for use. - * - * \param ctx The ECJPAKE context to check. This must be - * initialized. - * - * \return \c 0 if the context is ready for use. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA otherwise. - */ -int mbedtls_ecjpake_check( const mbedtls_ecjpake_context *ctx ); - -/** - * \brief Generate and write the first round message - * (TLS: contents of the Client/ServerHello extension, - * excluding extension type and length bytes). - * - * \param ctx The ECJPAKE context to use. This must be - * initialized and set up. - * \param buf The buffer to write the contents to. This must be a - * writable buffer of length \p len Bytes. - * \param len The length of \p buf in Bytes. - * \param olen The address at which to store the total number - * of Bytes written to \p buf. This must not be \c NULL. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG parameter to be passed to \p f_rng. This - * may be \c NULL if \p f_rng doesn't use a context. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_ecjpake_write_round_one( mbedtls_ecjpake_context *ctx, - unsigned char *buf, size_t len, size_t *olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Read and process the first round message - * (TLS: contents of the Client/ServerHello extension, - * excluding extension type and length bytes). - * - * \param ctx The ECJPAKE context to use. This must be initialized - * and set up. - * \param buf The buffer holding the first round message. This must - * be a readable buffer of length \p len Bytes. - * \param len The length in Bytes of \p buf. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_ecjpake_read_round_one( mbedtls_ecjpake_context *ctx, - const unsigned char *buf, - size_t len ); - -/** - * \brief Generate and write the second round message - * (TLS: contents of the Client/ServerKeyExchange). - * - * \param ctx The ECJPAKE context to use. This must be initialized, - * set up, and already have performed round one. - * \param buf The buffer to write the round two contents to. - * This must be a writable buffer of length \p len Bytes. - * \param len The size of \p buf in Bytes. - * \param olen The address at which to store the total number of Bytes - * written to \p buf. This must not be \c NULL. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG parameter to be passed to \p f_rng. This - * may be \c NULL if \p f_rng doesn't use a context. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_ecjpake_write_round_two( mbedtls_ecjpake_context *ctx, - unsigned char *buf, size_t len, size_t *olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Read and process the second round message - * (TLS: contents of the Client/ServerKeyExchange). - * - * \param ctx The ECJPAKE context to use. This must be initialized - * and set up and already have performed round one. - * \param buf The buffer holding the second round message. This must - * be a readable buffer of length \p len Bytes. - * \param len The length in Bytes of \p buf. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_ecjpake_read_round_two( mbedtls_ecjpake_context *ctx, - const unsigned char *buf, - size_t len ); - -/** - * \brief Derive the shared secret - * (TLS: Pre-Master Secret). - * - * \param ctx The ECJPAKE context to use. This must be initialized, - * set up and have performed both round one and two. - * \param buf The buffer to write the derived secret to. This must - * be a writable buffer of length \p len Bytes. - * \param len The length of \p buf in Bytes. - * \param olen The address at which to store the total number of Bytes - * written to \p buf. This must not be \c NULL. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG parameter to be passed to \p f_rng. This - * may be \c NULL if \p f_rng doesn't use a context. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_ecjpake_derive_secret( mbedtls_ecjpake_context *ctx, - unsigned char *buf, size_t len, size_t *olen, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This clears an ECJPAKE context and frees any - * embedded data structure. - * - * \param ctx The ECJPAKE context to free. This may be \c NULL, - * in which case this function does nothing. If it is not - * \c NULL, it must point to an initialized ECJPAKE context. - */ -void mbedtls_ecjpake_free( mbedtls_ecjpake_context *ctx ); - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if a test failed - */ -int mbedtls_ecjpake_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - - -#endif /* ecjpake.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp.h deleted file mode 100644 index 875e1f8d3..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp.h +++ /dev/null @@ -1,1188 +0,0 @@ -/** - * \file ecp.h - * - * \brief This file provides an API for Elliptic Curves over GF(P) (ECP). - * - * The use of ECP in cryptography and TLS is defined in - * Standards for Efficient Cryptography Group (SECG): SEC1 - * Elliptic Curve Cryptography and - * RFC-4492: Elliptic Curve Cryptography (ECC) Cipher Suites - * for Transport Layer Security (TLS). - * - * RFC-2409: The Internet Key Exchange (IKE) defines ECP - * group types. - * - */ - -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_ECP_H -#define MBEDTLS_ECP_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/bignum.h" - -/* - * ECP error codes - */ -#define MBEDTLS_ERR_ECP_BAD_INPUT_DATA -0x4F80 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL -0x4F00 /**< The buffer is too small to write to. */ -#define MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE -0x4E80 /**< The requested feature is not available, for example, the requested curve is not supported. */ -#define MBEDTLS_ERR_ECP_VERIFY_FAILED -0x4E00 /**< The signature is not valid. */ -#define MBEDTLS_ERR_ECP_ALLOC_FAILED -0x4D80 /**< Memory allocation failed. */ -#define MBEDTLS_ERR_ECP_RANDOM_FAILED -0x4D00 /**< Generation of random value, such as ephemeral key, failed. */ -#define MBEDTLS_ERR_ECP_INVALID_KEY -0x4C80 /**< Invalid private or public key. */ -#define MBEDTLS_ERR_ECP_SIG_LEN_MISMATCH -0x4C00 /**< The buffer contains a valid signature followed by more data. */ - -/* MBEDTLS_ERR_ECP_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_ECP_HW_ACCEL_FAILED -0x4B80 /**< The ECP hardware accelerator failed. */ - -#define MBEDTLS_ERR_ECP_IN_PROGRESS -0x4B00 /**< Operation in progress, call again with the same parameters to continue. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Domain-parameter identifiers: curve, subgroup, and generator. - * - * \note Only curves over prime fields are supported. - * - * \warning This library does not support validation of arbitrary domain - * parameters. Therefore, only standardized domain parameters from trusted - * sources should be used. See mbedtls_ecp_group_load(). - */ -typedef enum -{ - MBEDTLS_ECP_DP_NONE = 0, /*!< Curve not defined. */ - MBEDTLS_ECP_DP_SECP192R1, /*!< Domain parameters for the 192-bit curve defined by FIPS 186-4 and SEC1. */ - MBEDTLS_ECP_DP_SECP224R1, /*!< Domain parameters for the 224-bit curve defined by FIPS 186-4 and SEC1. */ - MBEDTLS_ECP_DP_SECP256R1, /*!< Domain parameters for the 256-bit curve defined by FIPS 186-4 and SEC1. */ - MBEDTLS_ECP_DP_SECP384R1, /*!< Domain parameters for the 384-bit curve defined by FIPS 186-4 and SEC1. */ - MBEDTLS_ECP_DP_SECP521R1, /*!< Domain parameters for the 521-bit curve defined by FIPS 186-4 and SEC1. */ - MBEDTLS_ECP_DP_BP256R1, /*!< Domain parameters for 256-bit Brainpool curve. */ - MBEDTLS_ECP_DP_BP384R1, /*!< Domain parameters for 384-bit Brainpool curve. */ - MBEDTLS_ECP_DP_BP512R1, /*!< Domain parameters for 512-bit Brainpool curve. */ - MBEDTLS_ECP_DP_CURVE25519, /*!< Domain parameters for Curve25519. */ - MBEDTLS_ECP_DP_SECP192K1, /*!< Domain parameters for 192-bit "Koblitz" curve. */ - MBEDTLS_ECP_DP_SECP224K1, /*!< Domain parameters for 224-bit "Koblitz" curve. */ - MBEDTLS_ECP_DP_SECP256K1, /*!< Domain parameters for 256-bit "Koblitz" curve. */ - MBEDTLS_ECP_DP_CURVE448, /*!< Domain parameters for Curve448. */ -} mbedtls_ecp_group_id; - -/** - * The number of supported curves, plus one for #MBEDTLS_ECP_DP_NONE. - * - * \note Montgomery curves are currently excluded. - */ -#define MBEDTLS_ECP_DP_MAX 12 - -/* - * Curve types - */ -typedef enum -{ - MBEDTLS_ECP_TYPE_NONE = 0, - MBEDTLS_ECP_TYPE_SHORT_WEIERSTRASS, /* y^2 = x^3 + a x + b */ - MBEDTLS_ECP_TYPE_MONTGOMERY, /* y^2 = x^3 + a x^2 + x */ -} mbedtls_ecp_curve_type; - -/** - * Curve information, for use by other modules. - */ -typedef struct mbedtls_ecp_curve_info -{ - mbedtls_ecp_group_id grp_id; /*!< An internal identifier. */ - uint16_t tls_id; /*!< The TLS NamedCurve identifier. */ - uint16_t bit_size; /*!< The curve size in bits. */ - const char *name; /*!< A human-friendly name. */ -} mbedtls_ecp_curve_info; - -/** - * \brief The ECP point structure, in Jacobian coordinates. - * - * \note All functions expect and return points satisfying - * the following condition: Z == 0 or - * Z == 1. Other values of \p Z are - * used only by internal functions. - * The point is zero, or "at infinity", if Z == 0. - * Otherwise, \p X and \p Y are its standard (affine) - * coordinates. - */ -typedef struct mbedtls_ecp_point -{ - mbedtls_mpi X; /*!< The X coordinate of the ECP point. */ - mbedtls_mpi Y; /*!< The Y coordinate of the ECP point. */ - mbedtls_mpi Z; /*!< The Z coordinate of the ECP point. */ -} -mbedtls_ecp_point; - -#if !defined(MBEDTLS_ECP_ALT) -/* - * default mbed TLS elliptic curve arithmetic implementation - * - * (in case MBEDTLS_ECP_ALT is defined then the developer has to provide an - * alternative implementation for the whole module and it will replace this - * one.) - */ - -/** - * \brief The ECP group structure. - * - * We consider two types of curve equations: - *
  • Short Weierstrass: y^2 = x^3 + A x + B mod P - * (SEC1 + RFC-4492)
  • - *
  • Montgomery: y^2 = x^3 + A x^2 + x mod P (Curve25519, - * Curve448)
- * In both cases, the generator (\p G) for a prime-order subgroup is fixed. - * - * For Short Weierstrass, this subgroup is the whole curve, and its - * cardinality is denoted by \p N. Our code requires that \p N is an - * odd prime as mbedtls_ecp_mul() requires an odd number, and - * mbedtls_ecdsa_sign() requires that it is prime for blinding purposes. - * - * For Montgomery curves, we do not store \p A, but (A + 2) / 4, - * which is the quantity used in the formulas. Additionally, \p nbits is - * not the size of \p N but the required size for private keys. - * - * If \p modp is NULL, reduction modulo \p P is done using a generic algorithm. - * Otherwise, \p modp must point to a function that takes an \p mbedtls_mpi in the - * range of 0..2^(2*pbits)-1, and transforms it in-place to an integer - * which is congruent mod \p P to the given MPI, and is close enough to \p pbits - * in size, so that it may be efficiently brought in the 0..P-1 range by a few - * additions or subtractions. Therefore, it is only an approximative modular - * reduction. It must return 0 on success and non-zero on failure. - * - * \note Alternative implementations must keep the group IDs distinct. If - * two group structures have the same ID, then they must be - * identical. - * - */ -typedef struct mbedtls_ecp_group -{ - mbedtls_ecp_group_id id; /*!< An internal group identifier. */ - mbedtls_mpi P; /*!< The prime modulus of the base field. */ - mbedtls_mpi A; /*!< For Short Weierstrass: \p A in the equation. For - Montgomery curves: (A + 2) / 4. */ - mbedtls_mpi B; /*!< For Short Weierstrass: \p B in the equation. - For Montgomery curves: unused. */ - mbedtls_ecp_point G; /*!< The generator of the subgroup used. */ - mbedtls_mpi N; /*!< The order of \p G. */ - size_t pbits; /*!< The number of bits in \p P.*/ - size_t nbits; /*!< For Short Weierstrass: The number of bits in \p P. - For Montgomery curves: the number of bits in the - private keys. */ - unsigned int h; /*!< \internal 1 if the constants are static. */ - int (*modp)(mbedtls_mpi *); /*!< The function for fast pseudo-reduction - mod \p P (see above).*/ - int (*t_pre)(mbedtls_ecp_point *, void *); /*!< Unused. */ - int (*t_post)(mbedtls_ecp_point *, void *); /*!< Unused. */ - void *t_data; /*!< Unused. */ - mbedtls_ecp_point *T; /*!< Pre-computed points for ecp_mul_comb(). */ - size_t T_size; /*!< The number of pre-computed points. */ -} -mbedtls_ecp_group; - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h, or define them using the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_ECP_MAX_BITS) -/** - * The maximum size of the groups, that is, of \c N and \c P. - */ -#define MBEDTLS_ECP_MAX_BITS 521 /**< The maximum size of groups, in bits. */ -#endif - -#define MBEDTLS_ECP_MAX_BYTES ( ( MBEDTLS_ECP_MAX_BITS + 7 ) / 8 ) -#define MBEDTLS_ECP_MAX_PT_LEN ( 2 * MBEDTLS_ECP_MAX_BYTES + 1 ) - -#if !defined(MBEDTLS_ECP_WINDOW_SIZE) -/* - * Maximum "window" size used for point multiplication. - * Default: 6. - * Minimum value: 2. Maximum value: 7. - * - * Result is an array of at most ( 1 << ( MBEDTLS_ECP_WINDOW_SIZE - 1 ) ) - * points used for point multiplication. This value is directly tied to EC - * peak memory usage, so decreasing it by one should roughly cut memory usage - * by two (if large curves are in use). - * - * Reduction in size may reduce speed, but larger curves are impacted first. - * Sample performances (in ECDHE handshakes/s, with FIXED_POINT_OPTIM = 1): - * w-size: 6 5 4 3 2 - * 521 145 141 135 120 97 - * 384 214 209 198 177 146 - * 256 320 320 303 262 226 - * 224 475 475 453 398 342 - * 192 640 640 633 587 476 - */ -#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< The maximum window size used. */ -#endif /* MBEDTLS_ECP_WINDOW_SIZE */ - -#if !defined(MBEDTLS_ECP_FIXED_POINT_OPTIM) -/* - * Trade memory for speed on fixed-point multiplication. - * - * This speeds up repeated multiplication of the generator (that is, the - * multiplication in ECDSA signatures, and half of the multiplications in - * ECDSA verification and ECDHE) by a factor roughly 3 to 4. - * - * The cost is increasing EC peak memory usage by a factor roughly 2. - * - * Change this value to 0 to reduce peak memory usage. - */ -#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up. */ -#endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ - -/* \} name SECTION: Module settings */ - -#else /* MBEDTLS_ECP_ALT */ -#include "ecp_alt.h" -#endif /* MBEDTLS_ECP_ALT */ - -#if defined(MBEDTLS_ECP_RESTARTABLE) - -/** - * \brief Internal restart context for multiplication - * - * \note Opaque struct - */ -typedef struct mbedtls_ecp_restart_mul mbedtls_ecp_restart_mul_ctx; - -/** - * \brief Internal restart context for ecp_muladd() - * - * \note Opaque struct - */ -typedef struct mbedtls_ecp_restart_muladd mbedtls_ecp_restart_muladd_ctx; - -/** - * \brief General context for resuming ECC operations - */ -typedef struct -{ - unsigned ops_done; /*!< current ops count */ - unsigned depth; /*!< call depth (0 = top-level) */ - mbedtls_ecp_restart_mul_ctx *rsm; /*!< ecp_mul_comb() sub-context */ - mbedtls_ecp_restart_muladd_ctx *ma; /*!< ecp_muladd() sub-context */ -} mbedtls_ecp_restart_ctx; - -/* - * Operation counts for restartable functions - */ -#define MBEDTLS_ECP_OPS_CHK 3 /*!< basic ops count for ecp_check_pubkey() */ -#define MBEDTLS_ECP_OPS_DBL 8 /*!< basic ops count for ecp_double_jac() */ -#define MBEDTLS_ECP_OPS_ADD 11 /*!< basic ops count for see ecp_add_mixed() */ -#define MBEDTLS_ECP_OPS_INV 120 /*!< empirical equivalent for mpi_mod_inv() */ - -/** - * \brief Internal; for restartable functions in other modules. - * Check and update basic ops budget. - * - * \param grp Group structure - * \param rs_ctx Restart context - * \param ops Number of basic ops to do - * - * \return \c 0 if doing \p ops basic ops is still allowed, - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS otherwise. - */ -int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp, - mbedtls_ecp_restart_ctx *rs_ctx, - unsigned ops ); - -/* Utility macro for checking and updating ops budget */ -#define MBEDTLS_ECP_BUDGET( ops ) \ - MBEDTLS_MPI_CHK( mbedtls_ecp_check_budget( grp, rs_ctx, \ - (unsigned) (ops) ) ); - -#else /* MBEDTLS_ECP_RESTARTABLE */ - -#define MBEDTLS_ECP_BUDGET( ops ) /* no-op; for compatibility */ - -/* We want to declare restartable versions of existing functions anyway */ -typedef void mbedtls_ecp_restart_ctx; - -#endif /* MBEDTLS_ECP_RESTARTABLE */ - -/** - * \brief The ECP key-pair structure. - * - * A generic key-pair that may be used for ECDSA and fixed ECDH, for example. - * - * \note Members are deliberately in the same order as in the - * ::mbedtls_ecdsa_context structure. - */ -typedef struct mbedtls_ecp_keypair -{ - mbedtls_ecp_group grp; /*!< Elliptic curve and base point */ - mbedtls_mpi d; /*!< our secret value */ - mbedtls_ecp_point Q; /*!< our public value */ -} -mbedtls_ecp_keypair; - -/* - * Point formats, from RFC 4492's enum ECPointFormat - */ -#define MBEDTLS_ECP_PF_UNCOMPRESSED 0 /**< Uncompressed point format. */ -#define MBEDTLS_ECP_PF_COMPRESSED 1 /**< Compressed point format. */ - -/* - * Some other constants from RFC 4492 - */ -#define MBEDTLS_ECP_TLS_NAMED_CURVE 3 /**< The named_curve of ECCurveType. */ - -#if defined(MBEDTLS_ECP_RESTARTABLE) -/** - * \brief Set the maximum number of basic operations done in a row. - * - * If more operations are needed to complete a computation, - * #MBEDTLS_ERR_ECP_IN_PROGRESS will be returned by the - * function performing the computation. It is then the - * caller's responsibility to either call again with the same - * parameters until it returns 0 or an error code; or to free - * the restart context if the operation is to be aborted. - * - * It is strictly required that all input parameters and the - * restart context be the same on successive calls for the - * same operation, but output parameters need not be the - * same; they must not be used until the function finally - * returns 0. - * - * This only applies to functions whose documentation - * mentions they may return #MBEDTLS_ERR_ECP_IN_PROGRESS (or - * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS for functions in the - * SSL module). For functions that accept a "restart context" - * argument, passing NULL disables restart and makes the - * function equivalent to the function with the same name - * with \c _restartable removed. For functions in the ECDH - * module, restart is disabled unless the function accepts - * an "ECDH context" argument and - * mbedtls_ecdh_enable_restart() was previously called on - * that context. For function in the SSL module, restart is - * only enabled for specific sides and key exchanges - * (currently only for clients and ECDHE-ECDSA). - * - * \param max_ops Maximum number of basic operations done in a row. - * Default: 0 (unlimited). - * Lower (non-zero) values mean ECC functions will block for - * a lesser maximum amount of time. - * - * \note A "basic operation" is defined as a rough equivalent of a - * multiplication in GF(p) for the NIST P-256 curve. - * As an indication, with default settings, a scalar - * multiplication (full run of \c mbedtls_ecp_mul()) is: - * - about 3300 basic operations for P-256 - * - about 9400 basic operations for P-384 - * - * \note Very low values are not always respected: sometimes - * functions need to block for a minimum number of - * operations, and will do so even if max_ops is set to a - * lower value. That minimum depends on the curve size, and - * can be made lower by decreasing the value of - * \c MBEDTLS_ECP_WINDOW_SIZE. As an indication, here is the - * lowest effective value for various curves and values of - * that parameter (w for short): - * w=6 w=5 w=4 w=3 w=2 - * P-256 208 208 160 136 124 - * P-384 682 416 320 272 248 - * P-521 1364 832 640 544 496 - * - * \note This setting is currently ignored by Curve25519. - */ -void mbedtls_ecp_set_max_ops( unsigned max_ops ); - -/** - * \brief Check if restart is enabled (max_ops != 0) - * - * \return \c 0 if \c max_ops == 0 (restart disabled) - * \return \c 1 otherwise (restart enabled) - */ -int mbedtls_ecp_restart_is_enabled( void ); -#endif /* MBEDTLS_ECP_RESTARTABLE */ - -/* - * Get the type of a curve - */ -mbedtls_ecp_curve_type mbedtls_ecp_get_type( const mbedtls_ecp_group *grp ); - -/** - * \brief This function retrieves the information defined in - * mbedtls_ecp_curve_info() for all supported curves in order - * of preference. - * - * \note This function returns information about all curves - * supported by the library. Some curves may not be - * supported for all algorithms. Call mbedtls_ecdh_can_do() - * or mbedtls_ecdsa_can_do() to check if a curve is - * supported for ECDH or ECDSA. - * - * \return A statically allocated array. The last entry is 0. - */ -const mbedtls_ecp_curve_info *mbedtls_ecp_curve_list( void ); - -/** - * \brief This function retrieves the list of internal group - * identifiers of all supported curves in the order of - * preference. - * - * \note This function returns information about all curves - * supported by the library. Some curves may not be - * supported for all algorithms. Call mbedtls_ecdh_can_do() - * or mbedtls_ecdsa_can_do() to check if a curve is - * supported for ECDH or ECDSA. - * - * \return A statically allocated array, - * terminated with MBEDTLS_ECP_DP_NONE. - */ -const mbedtls_ecp_group_id *mbedtls_ecp_grp_id_list( void ); - -/** - * \brief This function retrieves curve information from an internal - * group identifier. - * - * \param grp_id An \c MBEDTLS_ECP_DP_XXX value. - * - * \return The associated curve information on success. - * \return NULL on failure. - */ -const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_grp_id( mbedtls_ecp_group_id grp_id ); - -/** - * \brief This function retrieves curve information from a TLS - * NamedCurve value. - * - * \param tls_id An \c MBEDTLS_ECP_DP_XXX value. - * - * \return The associated curve information on success. - * \return NULL on failure. - */ -const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_tls_id( uint16_t tls_id ); - -/** - * \brief This function retrieves curve information from a - * human-readable name. - * - * \param name The human-readable name. - * - * \return The associated curve information on success. - * \return NULL on failure. - */ -const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_name( const char *name ); - -/** - * \brief This function initializes a point as zero. - * - * \param pt The point to initialize. - */ -void mbedtls_ecp_point_init( mbedtls_ecp_point *pt ); - -/** - * \brief This function initializes an ECP group context - * without loading any domain parameters. - * - * \note After this function is called, domain parameters - * for various ECP groups can be loaded through the - * mbedtls_ecp_group_load() or mbedtls_ecp_tls_read_group() - * functions. - */ -void mbedtls_ecp_group_init( mbedtls_ecp_group *grp ); - -/** - * \brief This function initializes a key pair as an invalid one. - * - * \param key The key pair to initialize. - */ -void mbedtls_ecp_keypair_init( mbedtls_ecp_keypair *key ); - -/** - * \brief This function frees the components of a point. - * - * \param pt The point to free. - */ -void mbedtls_ecp_point_free( mbedtls_ecp_point *pt ); - -/** - * \brief This function frees the components of an ECP group. - * - * \param grp The group to free. This may be \c NULL, in which - * case this function returns immediately. If it is not - * \c NULL, it must point to an initialized ECP group. - */ -void mbedtls_ecp_group_free( mbedtls_ecp_group *grp ); - -/** - * \brief This function frees the components of a key pair. - * - * \param key The key pair to free. This may be \c NULL, in which - * case this function returns immediately. If it is not - * \c NULL, it must point to an initialized ECP key pair. - */ -void mbedtls_ecp_keypair_free( mbedtls_ecp_keypair *key ); - -#if defined(MBEDTLS_ECP_RESTARTABLE) -/** - * \brief Initialize a restart context. - * - * \param ctx The restart context to initialize. This must - * not be \c NULL. - */ -void mbedtls_ecp_restart_init( mbedtls_ecp_restart_ctx *ctx ); - -/** - * \brief Free the components of a restart context. - * - * \param ctx The restart context to free. This may be \c NULL, in which - * case this function returns immediately. If it is not - * \c NULL, it must point to an initialized restart context. - */ -void mbedtls_ecp_restart_free( mbedtls_ecp_restart_ctx *ctx ); -#endif /* MBEDTLS_ECP_RESTARTABLE */ - -/** - * \brief This function copies the contents of point \p Q into - * point \p P. - * - * \param P The destination point. This must be initialized. - * \param Q The source point. This must be initialized. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - * \return Another negative error code for other kinds of failure. - */ -int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q ); - -/** - * \brief This function copies the contents of group \p src into - * group \p dst. - * - * \param dst The destination group. This must be initialized. - * \param src The source group. This must be initialized. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_group_copy( mbedtls_ecp_group *dst, - const mbedtls_ecp_group *src ); - -/** - * \brief This function sets a point to the point at infinity. - * - * \param pt The point to set. This must be initialized. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_set_zero( mbedtls_ecp_point *pt ); - -/** - * \brief This function checks if a point is the point at infinity. - * - * \param pt The point to test. This must be initialized. - * - * \return \c 1 if the point is zero. - * \return \c 0 if the point is non-zero. - * \return A negative error code on failure. - */ -int mbedtls_ecp_is_zero( mbedtls_ecp_point *pt ); - -/** - * \brief This function compares two points. - * - * \note This assumes that the points are normalized. Otherwise, - * they may compare as "not equal" even if they are. - * - * \param P The first point to compare. This must be initialized. - * \param Q The second point to compare. This must be initialized. - * - * \return \c 0 if the points are equal. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the points are not equal. - */ -int mbedtls_ecp_point_cmp( const mbedtls_ecp_point *P, - const mbedtls_ecp_point *Q ); - -/** - * \brief This function imports a non-zero point from two ASCII - * strings. - * - * \param P The destination point. This must be initialized. - * \param radix The numeric base of the input. - * \param x The first affine coordinate, as a null-terminated string. - * \param y The second affine coordinate, as a null-terminated string. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_MPI_XXX error code on failure. - */ -int mbedtls_ecp_point_read_string( mbedtls_ecp_point *P, int radix, - const char *x, const char *y ); - -/** - * \brief This function exports a point into unsigned binary data. - * - * \param grp The group to which the point should belong. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param P The point to export. This must be initialized. - * \param format The point format. This must be either - * #MBEDTLS_ECP_PF_COMPRESSED or #MBEDTLS_ECP_PF_UNCOMPRESSED. - * (For groups without these formats, this parameter is - * ignored. But it still has to be either of the above - * values.) - * \param olen The address at which to store the length of - * the output in Bytes. This must not be \c NULL. - * \param buf The output buffer. This must be a writable buffer - * of length \p buflen Bytes. - * \param buflen The length of the output buffer \p buf in Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL if the output buffer - * is too small to hold the point. - * \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the point format - * or the export for the given group is not implemented. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_point_write_binary( const mbedtls_ecp_group *grp, - const mbedtls_ecp_point *P, - int format, size_t *olen, - unsigned char *buf, size_t buflen ); - -/** - * \brief This function imports a point from unsigned binary data. - * - * \note This function does not check that the point actually - * belongs to the given group, see mbedtls_ecp_check_pubkey() - * for that. - * - * \param grp The group to which the point should belong. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param P The destination context to import the point to. - * This must be initialized. - * \param buf The input buffer. This must be a readable buffer - * of length \p ilen Bytes. - * \param ilen The length of the input buffer \p buf in Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the input is invalid. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - * \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the import for the - * given group is not implemented. - */ -int mbedtls_ecp_point_read_binary( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *P, - const unsigned char *buf, size_t ilen ); - -/** - * \brief This function imports a point from a TLS ECPoint record. - * - * \note On function return, \p *buf is updated to point immediately - * after the ECPoint record. - * - * \param grp The ECP group to use. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param pt The destination point. - * \param buf The address of the pointer to the start of the input buffer. - * \param len The length of the buffer. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_MPI_XXX error code on initialization - * failure. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid. - */ -int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *pt, - const unsigned char **buf, size_t len ); - -/** - * \brief This function exports a point as a TLS ECPoint record - * defined in RFC 4492, Section 5.4. - * - * \param grp The ECP group to use. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param pt The point to be exported. This must be initialized. - * \param format The point format to use. This must be either - * #MBEDTLS_ECP_PF_COMPRESSED or #MBEDTLS_ECP_PF_UNCOMPRESSED. - * \param olen The address at which to store the length in Bytes - * of the data written. - * \param buf The target buffer. This must be a writable buffer of - * length \p blen Bytes. - * \param blen The length of the target buffer \p buf in Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the input is invalid. - * \return #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL if the target buffer - * is too small to hold the exported point. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp, - const mbedtls_ecp_point *pt, - int format, size_t *olen, - unsigned char *buf, size_t blen ); - -/** - * \brief This function sets up an ECP group context - * from a standardized set of domain parameters. - * - * \note The index should be a value of the NamedCurve enum, - * as defined in RFC-4492: Elliptic Curve Cryptography - * (ECC) Cipher Suites for Transport Layer Security (TLS), - * usually in the form of an \c MBEDTLS_ECP_DP_XXX macro. - * - * \param grp The group context to setup. This must be initialized. - * \param id The identifier of the domain parameter set to load. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if \p id doesn't - * correspond to a known group. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_group_load( mbedtls_ecp_group *grp, mbedtls_ecp_group_id id ); - -/** - * \brief This function sets up an ECP group context from a TLS - * ECParameters record as defined in RFC 4492, Section 5.4. - * - * \note The read pointer \p buf is updated to point right after - * the ECParameters record on exit. - * - * \param grp The group context to setup. This must be initialized. - * \param buf The address of the pointer to the start of the input buffer. - * \param len The length of the input buffer \c *buf in Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid. - * \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the group is not - * recognized. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp, - const unsigned char **buf, size_t len ); - -/** - * \brief This function extracts an elliptic curve group ID from a - * TLS ECParameters record as defined in RFC 4492, Section 5.4. - * - * \note The read pointer \p buf is updated to point right after - * the ECParameters record on exit. - * - * \param grp The address at which to store the group id. - * This must not be \c NULL. - * \param buf The address of the pointer to the start of the input buffer. - * \param len The length of the input buffer \c *buf in Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid. - * \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the group is not - * recognized. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_tls_read_group_id( mbedtls_ecp_group_id *grp, - const unsigned char **buf, - size_t len ); -/** - * \brief This function exports an elliptic curve as a TLS - * ECParameters record as defined in RFC 4492, Section 5.4. - * - * \param grp The ECP group to be exported. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param olen The address at which to store the number of Bytes written. - * This must not be \c NULL. - * \param buf The buffer to write to. This must be a writable buffer - * of length \p blen Bytes. - * \param blen The length of the output buffer \p buf in Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL if the output - * buffer is too small to hold the exported group. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_tls_write_group( const mbedtls_ecp_group *grp, - size_t *olen, - unsigned char *buf, size_t blen ); - -/** - * \brief This function performs a scalar multiplication of a point - * by an integer: \p R = \p m * \p P. - * - * It is not thread-safe to use same group in multiple threads. - * - * \note To prevent timing attacks, this function - * executes the exact same sequence of base-field - * operations for any valid \p m. It avoids any if-branch or - * array index depending on the value of \p m. - * - * \note If \p f_rng is not NULL, it is used to randomize - * intermediate results to prevent potential timing attacks - * targeting these results. We recommend always providing - * a non-NULL \p f_rng. The overhead is negligible. - * Note: unless #MBEDTLS_ECP_NO_INTERNAL_RNG is defined, when - * \p f_rng is NULL, an internal RNG (seeded from the value - * of \p m) will be used instead. - * - * \param grp The ECP group to use. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param R The point in which to store the result of the calculation. - * This must be initialized. - * \param m The integer by which to multiply. This must be initialized. - * \param P The point to multiply. This must be initialized. - * \param f_rng The RNG function. This may be \c NULL if randomization - * of intermediate results isn't desired (discouraged). - * \param p_rng The RNG context to be passed to \p p_rng. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY if \p m is not a valid private - * key, or \p P is not a valid public key. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, - const mbedtls_mpi *m, const mbedtls_ecp_point *P, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief This function performs multiplication of a point by - * an integer: \p R = \p m * \p P in a restartable way. - * - * \see mbedtls_ecp_mul() - * - * \note This function does the same as \c mbedtls_ecp_mul(), but - * it can return early and restart according to the limit set - * with \c mbedtls_ecp_set_max_ops() to reduce blocking. - * - * \param grp The ECP group to use. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param R The point in which to store the result of the calculation. - * This must be initialized. - * \param m The integer by which to multiply. This must be initialized. - * \param P The point to multiply. This must be initialized. - * \param f_rng The RNG function. This may be \c NULL if randomization - * of intermediate results isn't desired (discouraged). - * \param p_rng The RNG context to be passed to \p p_rng. - * \param rs_ctx The restart context (NULL disables restart). - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY if \p m is not a valid private - * key, or \p P is not a valid public key. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of - * operations was reached: see \c mbedtls_ecp_set_max_ops(). - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, - const mbedtls_mpi *m, const mbedtls_ecp_point *P, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, - mbedtls_ecp_restart_ctx *rs_ctx ); - -/** - * \brief This function performs multiplication and addition of two - * points by integers: \p R = \p m * \p P + \p n * \p Q - * - * It is not thread-safe to use same group in multiple threads. - * - * \note In contrast to mbedtls_ecp_mul(), this function does not - * guarantee a constant execution flow and timing. - * - * \param grp The ECP group to use. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param R The point in which to store the result of the calculation. - * This must be initialized. - * \param m The integer by which to multiply \p P. - * This must be initialized. - * \param P The point to multiply by \p m. This must be initialized. - * \param n The integer by which to multiply \p Q. - * This must be initialized. - * \param Q The point to be multiplied by \p n. - * This must be initialized. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY if \p m or \p n are not - * valid private keys, or \p P or \p Q are not valid public - * keys. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_muladd( mbedtls_ecp_group *grp, mbedtls_ecp_point *R, - const mbedtls_mpi *m, const mbedtls_ecp_point *P, - const mbedtls_mpi *n, const mbedtls_ecp_point *Q ); - -/** - * \brief This function performs multiplication and addition of two - * points by integers: \p R = \p m * \p P + \p n * \p Q in a - * restartable way. - * - * \see \c mbedtls_ecp_muladd() - * - * \note This function works the same as \c mbedtls_ecp_muladd(), - * but it can return early and restart according to the limit - * set with \c mbedtls_ecp_set_max_ops() to reduce blocking. - * - * \param grp The ECP group to use. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param R The point in which to store the result of the calculation. - * This must be initialized. - * \param m The integer by which to multiply \p P. - * This must be initialized. - * \param P The point to multiply by \p m. This must be initialized. - * \param n The integer by which to multiply \p Q. - * This must be initialized. - * \param Q The point to be multiplied by \p n. - * This must be initialized. - * \param rs_ctx The restart context (NULL disables restart). - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY if \p m or \p n are not - * valid private keys, or \p P or \p Q are not valid public - * keys. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure. - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of - * operations was reached: see \c mbedtls_ecp_set_max_ops(). - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_muladd_restartable( - mbedtls_ecp_group *grp, mbedtls_ecp_point *R, - const mbedtls_mpi *m, const mbedtls_ecp_point *P, - const mbedtls_mpi *n, const mbedtls_ecp_point *Q, - mbedtls_ecp_restart_ctx *rs_ctx ); - -/** - * \brief This function checks that a point is a valid public key - * on this curve. - * - * It only checks that the point is non-zero, has - * valid coordinates and lies on the curve. It does not verify - * that it is indeed a multiple of \p G. This additional - * check is computationally more expensive, is not required - * by standards, and should not be necessary if the group - * used has a small cofactor. In particular, it is useless for - * the NIST groups which all have a cofactor of 1. - * - * \note This function uses bare components rather than an - * ::mbedtls_ecp_keypair structure, to ease use with other - * structures, such as ::mbedtls_ecdh_context or - * ::mbedtls_ecdsa_context. - * - * \param grp The ECP group the point should belong to. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param pt The point to check. This must be initialized. - * - * \return \c 0 if the point is a valid public key. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY if the point is not - * a valid public key for the given curve. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp, - const mbedtls_ecp_point *pt ); - -/** - * \brief This function checks that an \p mbedtls_mpi is a - * valid private key for this curve. - * - * \note This function uses bare components rather than an - * ::mbedtls_ecp_keypair structure to ease use with other - * structures, such as ::mbedtls_ecdh_context or - * ::mbedtls_ecdsa_context. - * - * \param grp The ECP group the private key should belong to. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param d The integer to check. This must be initialized. - * - * \return \c 0 if the point is a valid private key. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY if the point is not a valid - * private key for the given curve. - * \return Another negative error code on other kinds of failure. - */ -int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp, - const mbedtls_mpi *d ); - -/** - * \brief This function generates a private key. - * - * \param grp The ECP group to generate a private key for. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param d The destination MPI (secret part). This must be initialized. - * \param f_rng The RNG function. This must not be \c NULL. - * \param p_rng The RNG parameter to be passed to \p f_rng. This may be - * \c NULL if \p f_rng doesn't need a context argument. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code - * on failure. - */ -int mbedtls_ecp_gen_privkey( const mbedtls_ecp_group *grp, - mbedtls_mpi *d, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function generates a keypair with a configurable base - * point. - * - * \note This function uses bare components rather than an - * ::mbedtls_ecp_keypair structure to ease use with other - * structures, such as ::mbedtls_ecdh_context or - * ::mbedtls_ecdsa_context. - * - * \param grp The ECP group to generate a key pair for. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param G The base point to use. This must be initialized - * and belong to \p grp. It replaces the default base - * point \c grp->G used by mbedtls_ecp_gen_keypair(). - * \param d The destination MPI (secret part). - * This must be initialized. - * \param Q The destination point (public part). - * This must be initialized. - * \param f_rng The RNG function. This must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may - * be \c NULL if \p f_rng doesn't need a context argument. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code - * on failure. - */ -int mbedtls_ecp_gen_keypair_base( mbedtls_ecp_group *grp, - const mbedtls_ecp_point *G, - mbedtls_mpi *d, mbedtls_ecp_point *Q, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function generates an ECP keypair. - * - * \note This function uses bare components rather than an - * ::mbedtls_ecp_keypair structure to ease use with other - * structures, such as ::mbedtls_ecdh_context or - * ::mbedtls_ecdsa_context. - * - * \param grp The ECP group to generate a key pair for. - * This must be initialized and have group parameters - * set, for example through mbedtls_ecp_group_load(). - * \param d The destination MPI (secret part). - * This must be initialized. - * \param Q The destination point (public part). - * This must be initialized. - * \param f_rng The RNG function. This must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may - * be \c NULL if \p f_rng doesn't need a context argument. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code - * on failure. - */ -int mbedtls_ecp_gen_keypair( mbedtls_ecp_group *grp, mbedtls_mpi *d, - mbedtls_ecp_point *Q, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function generates an ECP key. - * - * \param grp_id The ECP group identifier. - * \param key The destination key. This must be initialized. - * \param f_rng The RNG function to use. This must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may - * be \c NULL if \p f_rng doesn't need a context argument. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code - * on failure. - */ -int mbedtls_ecp_gen_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief This function reads an elliptic curve private key. - * - * \param grp_id The ECP group identifier. - * \param key The destination key. - * \param buf The the buffer containing the binary representation of the - * key. (Big endian integer for Weierstrass curves, byte - * string for Montgomery curves.) - * \param buflen The length of the buffer in bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_ECP_INVALID_KEY error if the key is - * invalid. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed. - * \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the operation for - * the group is not implemented. - * \return Another negative error code on different kinds of failure. - */ -int mbedtls_ecp_read_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key, - const unsigned char *buf, size_t buflen ); -/** - * \brief This function checks that the keypair objects - * \p pub and \p prv have the same group and the - * same public point, and that the private key in - * \p prv is consistent with the public key. - * - * \param pub The keypair structure holding the public key. This - * must be initialized. If it contains a private key, that - * part is ignored. - * \param prv The keypair structure holding the full keypair. - * This must be initialized. - * - * \return \c 0 on success, meaning that the keys are valid and match. - * \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the keys are invalid or do not match. - * \return An \c MBEDTLS_ERR_ECP_XXX or an \c MBEDTLS_ERR_MPI_XXX - * error code on calculation failure. - */ -int mbedtls_ecp_check_pub_priv( const mbedtls_ecp_keypair *pub, - const mbedtls_ecp_keypair *prv ); - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief The ECP checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_ecp_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* ecp.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp_alt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp_alt.h deleted file mode 100644 index 328845377..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp_alt.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ -#ifndef MBEDTLS_ECP_ALT_H -#define MBEDTLS_ECP_ALT_H - -#if defined(MBEDTLS_ECP_ALT) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * The content of the structure in this ALT implementation is - * exactly the same as ecp.h, but the type must be provided - * here as MBEDTLS_ECP_ALT is set - */ - -/** - * \brief The ECP group structure. - * - * We consider two types of curve equations: - *
  • Short Weierstrass: y^2 = x^3 + A x + B mod P - * (SEC1 + RFC-4492)
  • - *
  • Montgomery: y^2 = x^3 + A x^2 + x mod P (Curve25519, - * Curve448)
- * In both cases, the generator (\p G) for a prime-order subgroup is fixed. - * - * For Short Weierstrass, this subgroup is the whole curve, and its - * cardinality is denoted by \p N. Our code requires that \p N is an - * odd prime as mbedtls_ecp_mul() requires an odd number, and - * mbedtls_ecdsa_sign() requires that it is prime for blinding purposes. - * - * For Montgomery curves, we do not store \p A, but (A + 2) / 4, - * which is the quantity used in the formulas. Additionally, \p nbits is - * not the size of \p N but the required size for private keys. - * - * If \p modp is NULL, reduction modulo \p P is done using a generic algorithm. - * Otherwise, \p modp must point to a function that takes an \p mbedtls_mpi in the - * range of 0..2^(2*pbits)-1, and transforms it in-place to an integer - * which is congruent mod \p P to the given MPI, and is close enough to \p pbits - * in size, so that it may be efficiently brought in the 0..P-1 range by a few - * additions or subtractions. Therefore, it is only an approximative modular - * reduction. It must return 0 on success and non-zero on failure. - * - * \note Alternative implementations must keep the group IDs distinct. If - * two group structures have the same ID, then they must be - * identical. - * - */ -typedef struct mbedtls_ecp_group -{ - mbedtls_ecp_group_id id; /*!< An internal group identifier. */ - mbedtls_mpi P; /*!< The prime modulus of the base field. */ - mbedtls_mpi A; /*!< For Short Weierstrass: \p A in the equation. For - Montgomery curves: (A + 2) / 4. */ - mbedtls_mpi B; /*!< For Short Weierstrass: \p B in the equation. - For Montgomery curves: unused. */ - mbedtls_ecp_point G; /*!< The generator of the subgroup used. */ - mbedtls_mpi N; /*!< The order of \p G. */ - size_t pbits; /*!< The number of bits in \p P.*/ - size_t nbits; /*!< For Short Weierstrass: The number of bits in \p P. - For Montgomery curves: the number of bits in the - private keys. */ - unsigned int h; /*!< \internal 1 if the constants are static. */ - int (*modp)(mbedtls_mpi *); /*!< The function for fast pseudo-reduction - mod \p P (see above).*/ - int (*t_pre)(mbedtls_ecp_point *, void *); /*!< Unused. */ - int (*t_post)(mbedtls_ecp_point *, void *); /*!< Unused. */ - void *t_data; /*!< Unused. */ - mbedtls_ecp_point *T; /*!< Pre-computed points for ecp_mul_comb(). */ - size_t T_size; /*!< The number of pre-computed points. */ -} -mbedtls_ecp_group; - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h, or define them using the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_ECP_MAX_BITS) -/** - * The maximum size of the groups, that is, of \c N and \c P. - */ -#define MBEDTLS_ECP_MAX_BITS 521 /**< The maximum size of groups, in bits. */ -#endif - -#define MBEDTLS_ECP_MAX_BYTES ( ( MBEDTLS_ECP_MAX_BITS + 7 ) / 8 ) -#define MBEDTLS_ECP_MAX_PT_LEN ( 2 * MBEDTLS_ECP_MAX_BYTES + 1 ) - -#if !defined(MBEDTLS_ECP_WINDOW_SIZE) -/* - * Maximum "window" size used for point multiplication. - * Default: 6. - * Minimum value: 2. Maximum value: 7. - * - * Result is an array of at most ( 1 << ( MBEDTLS_ECP_WINDOW_SIZE - 1 ) ) - * points used for point multiplication. This value is directly tied to EC - * peak memory usage, so decreasing it by one should roughly cut memory usage - * by two (if large curves are in use). - * - * Reduction in size may reduce speed, but larger curves are impacted first. - * Sample performances (in ECDHE handshakes/s, with FIXED_POINT_OPTIM = 1): - * w-size: 6 5 4 3 2 - * 521 145 141 135 120 97 - * 384 214 209 198 177 146 - * 256 320 320 303 262 226 - * 224 475 475 453 398 342 - * 192 640 640 633 587 476 - */ -#define MBEDTLS_ECP_WINDOW_SIZE 6 /**< The maximum window size used. */ -#endif /* MBEDTLS_ECP_WINDOW_SIZE */ - -#if !defined(MBEDTLS_ECP_FIXED_POINT_OPTIM) -/* - * Trade memory for speed on fixed-point multiplication. - * - * This speeds up repeated multiplication of the generator (that is, the - * multiplication in ECDSA signatures, and half of the multiplications in - * ECDSA verification and ECDHE) by a factor roughly 3 to 4. - * - * The cost is increasing EC peak memory usage by a factor roughly 2. - * - * Change this value to 0 to reduce peak memory usage. - */ -#define MBEDTLS_ECP_FIXED_POINT_OPTIM 1 /**< Enable fixed-point speed-up. */ -#endif /* MBEDTLS_ECP_FIXED_POINT_OPTIM */ - -/* \} name SECTION: Module settings */ - -#define MBEDTLS_ECP_BUDGET( ops ) /* no-op; for compatibility */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_ECP_ALT */ - -#endif /* MBEDTLS_ECP_ALT_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp_internal.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp_internal.h deleted file mode 100644 index 3b6fbf112..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ecp_internal.h +++ /dev/null @@ -1,299 +0,0 @@ -/** - * \file ecp_internal.h - * - * \brief Function declarations for alternative implementation of elliptic curve - * point arithmetic. - */ -/* - * Copyright (C) 2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -/* - * References: - * - * [1] BERNSTEIN, Daniel J. Curve25519: new Diffie-Hellman speed records. - * - * - * [2] CORON, Jean-S'ebastien. Resistance against differential power analysis - * for elliptic curve cryptosystems. In : Cryptographic Hardware and - * Embedded Systems. Springer Berlin Heidelberg, 1999. p. 292-302. - * - * - * [3] HEDABOU, Mustapha, PINEL, Pierre, et B'EN'ETEAU, Lucien. A comb method to - * render ECC resistant against Side Channel Attacks. IACR Cryptology - * ePrint Archive, 2004, vol. 2004, p. 342. - * - * - * [4] Certicom Research. SEC 2: Recommended Elliptic Curve Domain Parameters. - * - * - * [5] HANKERSON, Darrel, MENEZES, Alfred J., VANSTONE, Scott. Guide to Elliptic - * Curve Cryptography. - * - * [6] Digital Signature Standard (DSS), FIPS 186-4. - * - * - * [7] Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer - * Security (TLS), RFC 4492. - * - * - * [8] - * - * [9] COHEN, Henri. A Course in Computational Algebraic Number Theory. - * Springer Science & Business Media, 1 Aug 2000 - */ - -#ifndef MBEDTLS_ECP_INTERNAL_H -#define MBEDTLS_ECP_INTERNAL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#if defined(MBEDTLS_ECP_INTERNAL_ALT) - -/** - * \brief Indicate if the Elliptic Curve Point module extension can - * handle the group. - * - * \param grp The pointer to the elliptic curve group that will be the - * basis of the cryptographic computations. - * - * \return Non-zero if successful. - */ -unsigned char mbedtls_internal_ecp_grp_capable( const mbedtls_ecp_group *grp ); - -/** - * \brief Initialise the Elliptic Curve Point module extension. - * - * If mbedtls_internal_ecp_grp_capable returns true for a - * group, this function has to be able to initialise the - * module for it. - * - * This module can be a driver to a crypto hardware - * accelerator, for which this could be an initialise function. - * - * \param grp The pointer to the group the module needs to be - * initialised for. - * - * \return 0 if successful. - */ -int mbedtls_internal_ecp_init( const mbedtls_ecp_group *grp ); - -/** - * \brief Frees and deallocates the Elliptic Curve Point module - * extension. - * - * \param grp The pointer to the group the module was initialised for. - */ -void mbedtls_internal_ecp_free( const mbedtls_ecp_group *grp ); - -#if defined(ECP_SHORTWEIERSTRASS) - -#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) -/** - * \brief Randomize jacobian coordinates: - * (X, Y, Z) -> (l^2 X, l^3 Y, l Z) for random l. - * - * \param grp Pointer to the group representing the curve. - * - * \param pt The point on the curve to be randomised, given with Jacobian - * coordinates. - * - * \param f_rng A function pointer to the random number generator. - * - * \param p_rng A pointer to the random number generator state. - * - * \return 0 if successful. - */ -int mbedtls_internal_ecp_randomize_jac( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *pt, int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -#endif - -#if defined(MBEDTLS_ECP_ADD_MIXED_ALT) -/** - * \brief Addition: R = P + Q, mixed affine-Jacobian coordinates. - * - * The coordinates of Q must be normalized (= affine), - * but those of P don't need to. R is not normalized. - * - * This function is used only as a subrutine of - * ecp_mul_comb(). - * - * Special cases: (1) P or Q is zero, (2) R is zero, - * (3) P == Q. - * None of these cases can happen as intermediate step in - * ecp_mul_comb(): - * - at each step, P, Q and R are multiples of the base - * point, the factor being less than its order, so none of - * them is zero; - * - Q is an odd multiple of the base point, P an even - * multiple, due to the choice of precomputed points in the - * modified comb method. - * So branches for these cases do not leak secret information. - * - * We accept Q->Z being unset (saving memory in tables) as - * meaning 1. - * - * Cost in field operations if done by [5] 3.22: - * 1A := 8M + 3S - * - * \param grp Pointer to the group representing the curve. - * - * \param R Pointer to a point structure to hold the result. - * - * \param P Pointer to the first summand, given with Jacobian - * coordinates - * - * \param Q Pointer to the second summand, given with affine - * coordinates. - * - * \return 0 if successful. - */ -int mbedtls_internal_ecp_add_mixed( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *R, const mbedtls_ecp_point *P, - const mbedtls_ecp_point *Q ); -#endif - -/** - * \brief Point doubling R = 2 P, Jacobian coordinates. - * - * Cost: 1D := 3M + 4S (A == 0) - * 4M + 4S (A == -3) - * 3M + 6S + 1a otherwise - * when the implementation is based on the "dbl-1998-cmo-2" - * doubling formulas in [8] and standard optimizations are - * applied when curve parameter A is one of { 0, -3 }. - * - * \param grp Pointer to the group representing the curve. - * - * \param R Pointer to a point structure to hold the result. - * - * \param P Pointer to the point that has to be doubled, given with - * Jacobian coordinates. - * - * \return 0 if successful. - */ -#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) -int mbedtls_internal_ecp_double_jac( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *R, const mbedtls_ecp_point *P ); -#endif - -/** - * \brief Normalize jacobian coordinates of an array of (pointers to) - * points. - * - * Using Montgomery's trick to perform only one inversion mod P - * the cost is: - * 1N(t) := 1I + (6t - 3)M + 1S - * (See for example Algorithm 10.3.4. in [9]) - * - * This function is used only as a subrutine of - * ecp_mul_comb(). - * - * Warning: fails (returning an error) if one of the points is - * zero! - * This should never happen, see choice of w in ecp_mul_comb(). - * - * \param grp Pointer to the group representing the curve. - * - * \param T Array of pointers to the points to normalise. - * - * \param t_len Number of elements in the array. - * - * \return 0 if successful, - * an error if one of the points is zero. - */ -#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) -int mbedtls_internal_ecp_normalize_jac_many( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *T[], size_t t_len ); -#endif - -/** - * \brief Normalize jacobian coordinates so that Z == 0 || Z == 1. - * - * Cost in field operations if done by [5] 3.2.1: - * 1N := 1I + 3M + 1S - * - * \param grp Pointer to the group representing the curve. - * - * \param pt pointer to the point to be normalised. This is an - * input/output parameter. - * - * \return 0 if successful. - */ -#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) -int mbedtls_internal_ecp_normalize_jac( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *pt ); -#endif - -#endif /* ECP_SHORTWEIERSTRASS */ - -#if defined(ECP_MONTGOMERY) - -#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) -int mbedtls_internal_ecp_double_add_mxz( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *R, mbedtls_ecp_point *S, const mbedtls_ecp_point *P, - const mbedtls_ecp_point *Q, const mbedtls_mpi *d ); -#endif - -/** - * \brief Randomize projective x/z coordinates: - * (X, Z) -> (l X, l Z) for random l - * - * \param grp pointer to the group representing the curve - * - * \param P the point on the curve to be randomised given with - * projective coordinates. This is an input/output parameter. - * - * \param f_rng a function pointer to the random number generator - * - * \param p_rng a pointer to the random number generator state - * - * \return 0 if successful - */ -#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) -int mbedtls_internal_ecp_randomize_mxz( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *P, int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -#endif - -/** - * \brief Normalize Montgomery x/z coordinates: X = X/Z, Z = 1. - * - * \param grp pointer to the group representing the curve - * - * \param P pointer to the point to be normalised. This is an - * input/output parameter. - * - * \return 0 if successful - */ -#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) -int mbedtls_internal_ecp_normalize_mxz( const mbedtls_ecp_group *grp, - mbedtls_ecp_point *P ); -#endif - -#endif /* ECP_MONTGOMERY */ - -#endif /* MBEDTLS_ECP_INTERNAL_ALT */ - -#endif /* ecp_internal.h */ - diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/entropy.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/entropy.h deleted file mode 100644 index 06aaffaf7..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/entropy.h +++ /dev/null @@ -1,289 +0,0 @@ -/** - * \file entropy.h - * - * \brief Entropy accumulator implementation - */ -/* - * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ENTROPY_H -#define MBEDTLS_ENTROPY_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#if defined(MBEDTLS_SHA512_C) && !defined(MBEDTLS_ENTROPY_FORCE_SHA256) -#include "mbedtls/sha512.h" -#define MBEDTLS_ENTROPY_SHA512_ACCUMULATOR -#else -#if defined(MBEDTLS_SHA256_C) -#define MBEDTLS_ENTROPY_SHA256_ACCUMULATOR -#include "mbedtls/sha256.h" -#endif -#endif - -#if defined(MBEDTLS_THREADING_C) -#include "mbedtls/threading.h" -#endif - -#if defined(MBEDTLS_HAVEGE_C) -#include "mbedtls/havege.h" -#endif - -#define MBEDTLS_ERR_ENTROPY_SOURCE_FAILED -0x003C /**< Critical entropy source failure. */ -#define MBEDTLS_ERR_ENTROPY_MAX_SOURCES -0x003E /**< No more sources can be added. */ -#define MBEDTLS_ERR_ENTROPY_NO_SOURCES_DEFINED -0x0040 /**< No sources have been added to poll. */ -#define MBEDTLS_ERR_ENTROPY_NO_STRONG_SOURCE -0x003D /**< No strong sources have been added to poll. */ -#define MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR -0x003F /**< Read/write error in file. */ - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_ENTROPY_MAX_SOURCES) -#define MBEDTLS_ENTROPY_MAX_SOURCES 20 /**< Maximum number of sources supported */ -#endif - -#if !defined(MBEDTLS_ENTROPY_MAX_GATHER) -#define MBEDTLS_ENTROPY_MAX_GATHER 128 /**< Maximum amount requested from entropy sources */ -#endif - -/* \} name SECTION: Module settings */ - -#if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR) -#define MBEDTLS_ENTROPY_BLOCK_SIZE 64 /**< Block size of entropy accumulator (SHA-512) */ -#else -#define MBEDTLS_ENTROPY_BLOCK_SIZE 32 /**< Block size of entropy accumulator (SHA-256) */ -#endif - -#define MBEDTLS_ENTROPY_MAX_SEED_SIZE 1024 /**< Maximum size of seed we read from seed file */ -#define MBEDTLS_ENTROPY_SOURCE_MANUAL MBEDTLS_ENTROPY_MAX_SOURCES - -#define MBEDTLS_ENTROPY_SOURCE_STRONG 1 /**< Entropy source is strong */ -#define MBEDTLS_ENTROPY_SOURCE_WEAK 0 /**< Entropy source is weak */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Entropy poll callback pointer - * - * \param data Callback-specific data pointer - * \param output Data to fill - * \param len Maximum size to provide - * \param olen The actual amount of bytes put into the buffer (Can be 0) - * - * \return 0 if no critical failures occurred, - * MBEDTLS_ERR_ENTROPY_SOURCE_FAILED otherwise - */ -typedef int (*mbedtls_entropy_f_source_ptr)(void *data, unsigned char *output, size_t len, - size_t *olen); - -/** - * \brief Entropy source state - */ -typedef struct mbedtls_entropy_source_state -{ - mbedtls_entropy_f_source_ptr f_source; /**< The entropy source callback */ - void * p_source; /**< The callback data pointer */ - size_t size; /**< Amount received in bytes */ - size_t threshold; /**< Minimum bytes required before release */ - int strong; /**< Is the source strong? */ -} -mbedtls_entropy_source_state; - -/** - * \brief Entropy context structure - */ -typedef struct mbedtls_entropy_context -{ - int accumulator_started; -#if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR) - mbedtls_sha512_context accumulator; -#else - mbedtls_sha256_context accumulator; -#endif - int source_count; - mbedtls_entropy_source_state source[MBEDTLS_ENTROPY_MAX_SOURCES]; -#if defined(MBEDTLS_HAVEGE_C) - mbedtls_havege_state havege_data; -#endif -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; /*!< mutex */ -#endif -#if defined(MBEDTLS_ENTROPY_NV_SEED) - int initial_entropy_run; -#endif -} -mbedtls_entropy_context; - -/** - * \brief Initialize the context - * - * \param ctx Entropy context to initialize - */ -void mbedtls_entropy_init( mbedtls_entropy_context *ctx ); - -/** - * \brief Free the data in the context - * - * \param ctx Entropy context to free - */ -void mbedtls_entropy_free( mbedtls_entropy_context *ctx ); - -/** - * \brief Adds an entropy source to poll - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param ctx Entropy context - * \param f_source Entropy function - * \param p_source Function data - * \param threshold Minimum required from source before entropy is released - * ( with mbedtls_entropy_func() ) (in bytes) - * \param strong MBEDTLS_ENTROPY_SOURCE_STRONG or - * MBEDTLS_ENTROPY_SOURCE_WEAK. - * At least one strong source needs to be added. - * Weaker sources (such as the cycle counter) can be used as - * a complement. - * - * \return 0 if successful or MBEDTLS_ERR_ENTROPY_MAX_SOURCES - */ -int mbedtls_entropy_add_source( mbedtls_entropy_context *ctx, - mbedtls_entropy_f_source_ptr f_source, void *p_source, - size_t threshold, int strong ); - -/** - * \brief Trigger an extra gather poll for the accumulator - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param ctx Entropy context - * - * \return 0 if successful, or MBEDTLS_ERR_ENTROPY_SOURCE_FAILED - */ -int mbedtls_entropy_gather( mbedtls_entropy_context *ctx ); - -/** - * \brief Retrieve entropy from the accumulator - * (Maximum length: MBEDTLS_ENTROPY_BLOCK_SIZE) - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param data Entropy context - * \param output Buffer to fill - * \param len Number of bytes desired, must be at most MBEDTLS_ENTROPY_BLOCK_SIZE - * - * \return 0 if successful, or MBEDTLS_ERR_ENTROPY_SOURCE_FAILED - */ -int mbedtls_entropy_func( void *data, unsigned char *output, size_t len ); - -/** - * \brief Add data to the accumulator manually - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param ctx Entropy context - * \param data Data to add - * \param len Length of data - * - * \return 0 if successful - */ -int mbedtls_entropy_update_manual( mbedtls_entropy_context *ctx, - const unsigned char *data, size_t len ); - -#if defined(MBEDTLS_ENTROPY_NV_SEED) -/** - * \brief Trigger an update of the seed file in NV by using the - * current entropy pool. - * - * \param ctx Entropy context - * - * \return 0 if successful - */ -int mbedtls_entropy_update_nv_seed( mbedtls_entropy_context *ctx ); -#endif /* MBEDTLS_ENTROPY_NV_SEED */ - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Write a seed file - * - * \param ctx Entropy context - * \param path Name of the file - * - * \return 0 if successful, - * MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR on file error, or - * MBEDTLS_ERR_ENTROPY_SOURCE_FAILED - */ -int mbedtls_entropy_write_seed_file( mbedtls_entropy_context *ctx, const char *path ); - -/** - * \brief Read and update a seed file. Seed is added to this - * instance. No more than MBEDTLS_ENTROPY_MAX_SEED_SIZE bytes are - * read from the seed file. The rest is ignored. - * - * \param ctx Entropy context - * \param path Name of the file - * - * \return 0 if successful, - * MBEDTLS_ERR_ENTROPY_FILE_IO_ERROR on file error, - * MBEDTLS_ERR_ENTROPY_SOURCE_FAILED - */ -int mbedtls_entropy_update_seed_file( mbedtls_entropy_context *ctx, const char *path ); -#endif /* MBEDTLS_FS_IO */ - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine - * - * This module self-test also calls the entropy self-test, - * mbedtls_entropy_source_self_test(); - * - * \return 0 if successful, or 1 if a test failed - */ -int mbedtls_entropy_self_test( int verbose ); - -#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) -/** - * \brief Checkup routine - * - * Verifies the integrity of the hardware entropy source - * provided by the function 'mbedtls_hardware_poll()'. - * - * Note this is the only hardware entropy source that is known - * at link time, and other entropy sources configured - * dynamically at runtime by the function - * mbedtls_entropy_add_source() will not be tested. - * - * \return 0 if successful, or 1 if a test failed - */ -int mbedtls_entropy_source_self_test( int verbose ); -#endif /* MBEDTLS_ENTROPY_HARDWARE_ALT */ -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* entropy.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/entropy_poll.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/entropy_poll.h deleted file mode 100644 index ba42805f0..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/entropy_poll.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - * \file entropy_poll.h - * - * \brief Platform-specific and custom entropy polling functions - */ -/* - * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ENTROPY_POLL_H -#define MBEDTLS_ENTROPY_POLL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Default thresholds for built-in sources, in bytes - */ -#define MBEDTLS_ENTROPY_MIN_PLATFORM 32 /**< Minimum for platform source */ -#define MBEDTLS_ENTROPY_MIN_HAVEGE 32 /**< Minimum for HAVEGE */ -#define MBEDTLS_ENTROPY_MIN_HARDCLOCK 4 /**< Minimum for mbedtls_timing_hardclock() */ -#if !defined(MBEDTLS_ENTROPY_MIN_HARDWARE) -#define MBEDTLS_ENTROPY_MIN_HARDWARE 32 /**< Minimum for the hardware source */ -#endif - -/** - * \brief Entropy poll callback that provides 0 entropy. - */ -#if defined(MBEDTLS_TEST_NULL_ENTROPY) - int mbedtls_null_entropy_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#if !defined(MBEDTLS_NO_PLATFORM_ENTROPY) -/** - * \brief Platform-specific entropy poll callback - */ -int mbedtls_platform_entropy_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#if defined(MBEDTLS_HAVEGE_C) -/** - * \brief HAVEGE based entropy poll callback - * - * Requires an HAVEGE state as its data pointer. - */ -int mbedtls_havege_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#if defined(MBEDTLS_TIMING_C) -/** - * \brief mbedtls_timing_hardclock-based entropy poll callback - */ -int mbedtls_hardclock_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT) -/** - * \brief Entropy poll callback for a hardware source - * - * \warning This is not provided by mbed TLS! - * See \c MBEDTLS_ENTROPY_HARDWARE_ALT in config.h. - * - * \note This must accept NULL as its first argument. - */ -int mbedtls_hardware_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#if defined(MBEDTLS_ENTROPY_NV_SEED) -/** - * \brief Entropy poll callback for a non-volatile seed file - * - * \note This must accept NULL as its first argument. - */ -int mbedtls_nv_seed_poll( void *data, - unsigned char *output, size_t len, size_t *olen ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* entropy_poll.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/error.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/error.h deleted file mode 100644 index 428800188..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/error.h +++ /dev/null @@ -1,164 +0,0 @@ -/** - * \file error.h - * - * \brief Error to string translation - */ -/* - * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_ERROR_H -#define MBEDTLS_ERROR_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -/** - * Error code layout. - * - * Currently we try to keep all error codes within the negative space of 16 - * bits signed integers to support all platforms (-0x0001 - -0x7FFF). In - * addition we'd like to give two layers of information on the error if - * possible. - * - * For that purpose the error codes are segmented in the following manner: - * - * 16 bit error code bit-segmentation - * - * 1 bit - Unused (sign bit) - * 3 bits - High level module ID - * 5 bits - Module-dependent error code - * 7 bits - Low level module errors - * - * For historical reasons, low-level error codes are divided in even and odd, - * even codes were assigned first, and -1 is reserved for other errors. - * - * Low-level module errors (0x0002-0x007E, 0x0001-0x007F) - * - * Module Nr Codes assigned - * ERROR 2 0x006E 0x0001 - * MPI 7 0x0002-0x0010 - * GCM 3 0x0012-0x0014 0x0013-0x0013 - * BLOWFISH 3 0x0016-0x0018 0x0017-0x0017 - * THREADING 3 0x001A-0x001E - * AES 5 0x0020-0x0022 0x0021-0x0025 - * CAMELLIA 3 0x0024-0x0026 0x0027-0x0027 - * XTEA 2 0x0028-0x0028 0x0029-0x0029 - * BASE64 2 0x002A-0x002C - * OID 1 0x002E-0x002E 0x000B-0x000B - * PADLOCK 1 0x0030-0x0030 - * DES 2 0x0032-0x0032 0x0033-0x0033 - * CTR_DBRG 4 0x0034-0x003A - * ENTROPY 3 0x003C-0x0040 0x003D-0x003F - * NET 13 0x0042-0x0052 0x0043-0x0049 - * ARIA 4 0x0058-0x005E - * ASN1 7 0x0060-0x006C - * CMAC 1 0x007A-0x007A - * PBKDF2 1 0x007C-0x007C - * HMAC_DRBG 4 0x0003-0x0009 - * CCM 3 0x000D-0x0011 - * ARC4 1 0x0019-0x0019 - * MD2 1 0x002B-0x002B - * MD4 1 0x002D-0x002D - * MD5 1 0x002F-0x002F - * RIPEMD160 1 0x0031-0x0031 - * SHA1 1 0x0035-0x0035 0x0073-0x0073 - * SHA256 1 0x0037-0x0037 0x0074-0x0074 - * SHA512 1 0x0039-0x0039 0x0075-0x0075 - * CHACHA20 3 0x0051-0x0055 - * POLY1305 3 0x0057-0x005B - * CHACHAPOLY 2 0x0054-0x0056 - * PLATFORM 2 0x0070-0x0072 - * - * High-level module nr (3 bits - 0x0...-0x7...) - * Name ID Nr of Errors - * PEM 1 9 - * PKCS#12 1 4 (Started from top) - * X509 2 20 - * PKCS5 2 4 (Started from top) - * DHM 3 11 - * PK 3 15 (Started from top) - * RSA 4 11 - * ECP 4 10 (Started from top) - * MD 5 5 - * HKDF 5 1 (Started from top) - * SSL 5 2 (Started from 0x5F00) - * CIPHER 6 8 (Started from 0x6080) - * SSL 6 24 (Started from top, plus 0x6000) - * SSL 7 32 - * - * Module dependent error code (5 bits 0x.00.-0x.F8.) - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#define MBEDTLS_ERR_ERROR_GENERIC_ERROR -0x0001 /**< Generic error */ -#define MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED -0x006E /**< This is a bug in the library */ - -/** - * \brief Translate a mbed TLS error code into a string representation, - * Result is truncated if necessary and always includes a terminating - * null byte. - * - * \param errnum error code - * \param buffer buffer to place representation in - * \param buflen length of the buffer - */ -void mbedtls_strerror( int errnum, char *buffer, size_t buflen ); - -/** - * \brief Translate the high-level part of an Mbed TLS error code into a string - * representation. - * - * This function returns a const pointer to an un-modifiable string. The caller - * must not try to modify the string. It is intended to be used mostly for - * logging purposes. - * - * \param error_code error code - * - * \return The string representation of the error code, or \c NULL if the error - * code is unknown. - */ -const char * mbedtls_high_level_strerr( int error_code ); - -/** - * \brief Translate the low-level part of an Mbed TLS error code into a string - * representation. - * - * This function returns a const pointer to an un-modifiable string. The caller - * must not try to modify the string. It is intended to be used mostly for - * logging purposes. - * - * \param error_code error code - * - * \return The string representation of the error code, or \c NULL if the error - * code is unknown. - */ -const char * mbedtls_low_level_strerr( int error_code ); - -#ifdef __cplusplus -} -#endif - -#endif /* error.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/gcm.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/gcm.h deleted file mode 100644 index a71a2af46..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/gcm.h +++ /dev/null @@ -1,326 +0,0 @@ -/** - * \file gcm.h - * - * \brief This file contains GCM definitions and functions. - * - * The Galois/Counter Mode (GCM) for 128-bit block ciphers is defined - * in D. McGrew, J. Viega, The Galois/Counter Mode of Operation - * (GCM), Natl. Inst. Stand. Technol. - * - * For more information on GCM, see NIST SP 800-38D: Recommendation for - * Block Cipher Modes of Operation: Galois/Counter Mode (GCM) and GMAC. - * - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_GCM_H -#define MBEDTLS_GCM_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/cipher.h" - -#include - -#define MBEDTLS_GCM_ENCRYPT 1 -#define MBEDTLS_GCM_DECRYPT 0 - -#define MBEDTLS_ERR_GCM_AUTH_FAILED -0x0012 /**< Authenticated decryption failed. */ - -/* MBEDTLS_ERR_GCM_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_GCM_HW_ACCEL_FAILED -0x0013 /**< GCM hardware accelerator failed. */ - -#define MBEDTLS_ERR_GCM_BAD_INPUT -0x0014 /**< Bad input parameters to function. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_GCM_ALT) - -/** - * \brief The GCM context structure. - */ -typedef struct mbedtls_gcm_context -{ - mbedtls_cipher_context_t cipher_ctx; /*!< The cipher context used. */ - uint64_t HL[16]; /*!< Precalculated HTable low. */ - uint64_t HH[16]; /*!< Precalculated HTable high. */ - uint64_t len; /*!< The total length of the encrypted data. */ - uint64_t add_len; /*!< The total length of the additional data. */ - unsigned char base_ectr[16]; /*!< The first ECTR for tag. */ - unsigned char y[16]; /*!< The Y working value. */ - unsigned char buf[16]; /*!< The buf working value. */ - int mode; /*!< The operation to perform: - #MBEDTLS_GCM_ENCRYPT or - #MBEDTLS_GCM_DECRYPT. */ -} -mbedtls_gcm_context; - -#else /* !MBEDTLS_GCM_ALT */ -#include "gcm_alt.h" -#endif /* !MBEDTLS_GCM_ALT */ - -/** - * \brief This function initializes the specified GCM context, - * to make references valid, and prepares the context - * for mbedtls_gcm_setkey() or mbedtls_gcm_free(). - * - * The function does not bind the GCM context to a particular - * cipher, nor set the key. For this purpose, use - * mbedtls_gcm_setkey(). - * - * \param ctx The GCM context to initialize. This must not be \c NULL. - */ -void mbedtls_gcm_init( mbedtls_gcm_context *ctx ); - -/** - * \brief This function associates a GCM context with a - * cipher algorithm and a key. - * - * \param ctx The GCM context. This must be initialized. - * \param cipher The 128-bit block cipher to use. - * \param key The encryption key. This must be a readable buffer of at - * least \p keybits bits. - * \param keybits The key size in bits. Valid options are: - *
  • 128 bits
  • - *
  • 192 bits
  • - *
  • 256 bits
- * - * \return \c 0 on success. - * \return A cipher-specific error code on failure. - */ -int mbedtls_gcm_setkey( mbedtls_gcm_context *ctx, - mbedtls_cipher_id_t cipher, - const unsigned char *key, - unsigned int keybits ); - -/** - * \brief This function performs GCM encryption or decryption of a buffer. - * - * \note For encryption, the output buffer can be the same as the - * input buffer. For decryption, the output buffer cannot be - * the same as input buffer. If the buffers overlap, the output - * buffer must trail at least 8 Bytes behind the input buffer. - * - * \warning When this function performs a decryption, it outputs the - * authentication tag and does not verify that the data is - * authentic. You should use this function to perform encryption - * only. For decryption, use mbedtls_gcm_auth_decrypt() instead. - * - * \param ctx The GCM context to use for encryption or decryption. This - * must be initialized. - * \param mode The operation to perform: - * - #MBEDTLS_GCM_ENCRYPT to perform authenticated encryption. - * The ciphertext is written to \p output and the - * authentication tag is written to \p tag. - * - #MBEDTLS_GCM_DECRYPT to perform decryption. - * The plaintext is written to \p output and the - * authentication tag is written to \p tag. - * Note that this mode is not recommended, because it does - * not verify the authenticity of the data. For this reason, - * you should use mbedtls_gcm_auth_decrypt() instead of - * calling this function in decryption mode. - * \param length The length of the input data, which is equal to the length - * of the output data. - * \param iv The initialization vector. This must be a readable buffer of - * at least \p iv_len Bytes. - * \param iv_len The length of the IV. - * \param add The buffer holding the additional data. This must be of at - * least that size in Bytes. - * \param add_len The length of the additional data. - * \param input The buffer holding the input data. If \p length is greater - * than zero, this must be a readable buffer of at least that - * size in Bytes. - * \param output The buffer for holding the output data. If \p length is greater - * than zero, this must be a writable buffer of at least that - * size in Bytes. - * \param tag_len The length of the tag to generate. - * \param tag The buffer for holding the tag. This must be a readable - * buffer of at least \p tag_len Bytes. - * - * \return \c 0 if the encryption or decryption was performed - * successfully. Note that in #MBEDTLS_GCM_DECRYPT mode, - * this does not indicate that the data is authentic. - * \return #MBEDTLS_ERR_GCM_BAD_INPUT if the lengths or pointers are - * not valid or a cipher-specific error code if the encryption - * or decryption failed. - */ -int mbedtls_gcm_crypt_and_tag( mbedtls_gcm_context *ctx, - int mode, - size_t length, - const unsigned char *iv, - size_t iv_len, - const unsigned char *add, - size_t add_len, - const unsigned char *input, - unsigned char *output, - size_t tag_len, - unsigned char *tag ); - -/** - * \brief This function performs a GCM authenticated decryption of a - * buffer. - * - * \note For decryption, the output buffer cannot be the same as - * input buffer. If the buffers overlap, the output buffer - * must trail at least 8 Bytes behind the input buffer. - * - * \param ctx The GCM context. This must be initialized. - * \param length The length of the ciphertext to decrypt, which is also - * the length of the decrypted plaintext. - * \param iv The initialization vector. This must be a readable buffer - * of at least \p iv_len Bytes. - * \param iv_len The length of the IV. - * \param add The buffer holding the additional data. This must be of at - * least that size in Bytes. - * \param add_len The length of the additional data. - * \param tag The buffer holding the tag to verify. This must be a - * readable buffer of at least \p tag_len Bytes. - * \param tag_len The length of the tag to verify. - * \param input The buffer holding the ciphertext. If \p length is greater - * than zero, this must be a readable buffer of at least that - * size. - * \param output The buffer for holding the decrypted plaintext. If \p length - * is greater than zero, this must be a writable buffer of at - * least that size. - * - * \return \c 0 if successful and authenticated. - * \return #MBEDTLS_ERR_GCM_AUTH_FAILED if the tag does not match. - * \return #MBEDTLS_ERR_GCM_BAD_INPUT if the lengths or pointers are - * not valid or a cipher-specific error code if the decryption - * failed. - */ -int mbedtls_gcm_auth_decrypt( mbedtls_gcm_context *ctx, - size_t length, - const unsigned char *iv, - size_t iv_len, - const unsigned char *add, - size_t add_len, - const unsigned char *tag, - size_t tag_len, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function starts a GCM encryption or decryption - * operation. - * - * \param ctx The GCM context. This must be initialized. - * \param mode The operation to perform: #MBEDTLS_GCM_ENCRYPT or - * #MBEDTLS_GCM_DECRYPT. - * \param iv The initialization vector. This must be a readable buffer of - * at least \p iv_len Bytes. - * \param iv_len The length of the IV. - * \param add The buffer holding the additional data, or \c NULL - * if \p add_len is \c 0. - * \param add_len The length of the additional data. If \c 0, - * \p add may be \c NULL. - * - * \return \c 0 on success. - */ -int mbedtls_gcm_starts( mbedtls_gcm_context *ctx, - int mode, - const unsigned char *iv, - size_t iv_len, - const unsigned char *add, - size_t add_len ); - -/** - * \brief This function feeds an input buffer into an ongoing GCM - * encryption or decryption operation. - * - * ` The function expects input to be a multiple of 16 - * Bytes. Only the last call before calling - * mbedtls_gcm_finish() can be less than 16 Bytes. - * - * \note For decryption, the output buffer cannot be the same as - * input buffer. If the buffers overlap, the output buffer - * must trail at least 8 Bytes behind the input buffer. - * - * \param ctx The GCM context. This must be initialized. - * \param length The length of the input data. This must be a multiple of - * 16 except in the last call before mbedtls_gcm_finish(). - * \param input The buffer holding the input data. If \p length is greater - * than zero, this must be a readable buffer of at least that - * size in Bytes. - * \param output The buffer for holding the output data. If \p length is - * greater than zero, this must be a writable buffer of at - * least that size in Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_GCM_BAD_INPUT on failure. - */ -int mbedtls_gcm_update( mbedtls_gcm_context *ctx, - size_t length, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function finishes the GCM operation and generates - * the authentication tag. - * - * It wraps up the GCM stream, and generates the - * tag. The tag can have a maximum length of 16 Bytes. - * - * \param ctx The GCM context. This must be initialized. - * \param tag The buffer for holding the tag. This must be a readable - * buffer of at least \p tag_len Bytes. - * \param tag_len The length of the tag to generate. This must be at least - * four. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_GCM_BAD_INPUT on failure. - */ -int mbedtls_gcm_finish( mbedtls_gcm_context *ctx, - unsigned char *tag, - size_t tag_len ); - -/** - * \brief This function clears a GCM context and the underlying - * cipher sub-context. - * - * \param ctx The GCM context to clear. If this is \c NULL, the call has - * no effect. Otherwise, this must be initialized. - */ -void mbedtls_gcm_free( mbedtls_gcm_context *ctx ); - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief The GCM checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_gcm_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - - -#endif /* gcm.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/havege.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/havege.h deleted file mode 100644 index acd7e489a..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/havege.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * \file havege.h - * - * \brief HAVEGE: HArdware Volatile Entropy Gathering and Expansion - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_HAVEGE_H -#define MBEDTLS_HAVEGE_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_HAVEGE_COLLECT_SIZE 1024 - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief HAVEGE state structure - */ -typedef struct mbedtls_havege_state -{ - uint32_t PT1, PT2, offset[2]; - uint32_t pool[MBEDTLS_HAVEGE_COLLECT_SIZE]; - uint32_t WALK[8192]; -} -mbedtls_havege_state; - -/** - * \brief HAVEGE initialization - * - * \param hs HAVEGE state to be initialized - */ -void mbedtls_havege_init( mbedtls_havege_state *hs ); - -/** - * \brief Clear HAVEGE state - * - * \param hs HAVEGE state to be cleared - */ -void mbedtls_havege_free( mbedtls_havege_state *hs ); - -/** - * \brief HAVEGE rand function - * - * \param p_rng A HAVEGE state - * \param output Buffer to fill - * \param len Length of buffer - * - * \return 0 - */ -int mbedtls_havege_random( void *p_rng, unsigned char *output, size_t len ); - -#ifdef __cplusplus -} -#endif - -#endif /* havege.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/hkdf.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/hkdf.h deleted file mode 100644 index 77a99ab6b..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/hkdf.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - * \file hkdf.h - * - * \brief This file contains the HKDF interface. - * - * The HMAC-based Extract-and-Expand Key Derivation Function (HKDF) is - * specified by RFC 5869. - */ -/* - * Copyright (C) 2018-2019, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_HKDF_H -#define MBEDTLS_HKDF_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/md.h" - -/** - * \name HKDF Error codes - * \{ - */ -#define MBEDTLS_ERR_HKDF_BAD_INPUT_DATA -0x5F80 /**< Bad input parameters to function. */ -/* \} name */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief This is the HMAC-based Extract-and-Expand Key Derivation Function - * (HKDF). - * - * \param md A hash function; md.size denotes the length of the hash - * function output in bytes. - * \param salt An optional salt value (a non-secret random value); - * if the salt is not provided, a string of all zeros of - * md.size length is used as the salt. - * \param salt_len The length in bytes of the optional \p salt. - * \param ikm The input keying material. - * \param ikm_len The length in bytes of \p ikm. - * \param info An optional context and application specific information - * string. This can be a zero-length string. - * \param info_len The length of \p info in bytes. - * \param okm The output keying material of \p okm_len bytes. - * \param okm_len The length of the output keying material in bytes. This - * must be less than or equal to 255 * md.size bytes. - * - * \return 0 on success. - * \return #MBEDTLS_ERR_HKDF_BAD_INPUT_DATA when the parameters are invalid. - * \return An MBEDTLS_ERR_MD_* error for errors returned from the underlying - * MD layer. - */ -int mbedtls_hkdf( const mbedtls_md_info_t *md, const unsigned char *salt, - size_t salt_len, const unsigned char *ikm, size_t ikm_len, - const unsigned char *info, size_t info_len, - unsigned char *okm, size_t okm_len ); - -/** - * \brief Take the input keying material \p ikm and extract from it a - * fixed-length pseudorandom key \p prk. - * - * \warning This function should only be used if the security of it has been - * studied and established in that particular context (eg. TLS 1.3 - * key schedule). For standard HKDF security guarantees use - * \c mbedtls_hkdf instead. - * - * \param md A hash function; md.size denotes the length of the - * hash function output in bytes. - * \param salt An optional salt value (a non-secret random value); - * if the salt is not provided, a string of all zeros - * of md.size length is used as the salt. - * \param salt_len The length in bytes of the optional \p salt. - * \param ikm The input keying material. - * \param ikm_len The length in bytes of \p ikm. - * \param[out] prk A pseudorandom key of at least md.size bytes. - * - * \return 0 on success. - * \return #MBEDTLS_ERR_HKDF_BAD_INPUT_DATA when the parameters are invalid. - * \return An MBEDTLS_ERR_MD_* error for errors returned from the underlying - * MD layer. - */ -int mbedtls_hkdf_extract( const mbedtls_md_info_t *md, - const unsigned char *salt, size_t salt_len, - const unsigned char *ikm, size_t ikm_len, - unsigned char *prk ); - -/** - * \brief Expand the supplied \p prk into several additional pseudorandom - * keys, which is the output of the HKDF. - * - * \warning This function should only be used if the security of it has been - * studied and established in that particular context (eg. TLS 1.3 - * key schedule). For standard HKDF security guarantees use - * \c mbedtls_hkdf instead. - * - * \param md A hash function; md.size denotes the length of the hash - * function output in bytes. - * \param prk A pseudorandom key of at least md.size bytes. \p prk is - * usually the output from the HKDF extract step. - * \param prk_len The length in bytes of \p prk. - * \param info An optional context and application specific information - * string. This can be a zero-length string. - * \param info_len The length of \p info in bytes. - * \param okm The output keying material of \p okm_len bytes. - * \param okm_len The length of the output keying material in bytes. This - * must be less than or equal to 255 * md.size bytes. - * - * \return 0 on success. - * \return #MBEDTLS_ERR_HKDF_BAD_INPUT_DATA when the parameters are invalid. - * \return An MBEDTLS_ERR_MD_* error for errors returned from the underlying - * MD layer. - */ -int mbedtls_hkdf_expand( const mbedtls_md_info_t *md, const unsigned char *prk, - size_t prk_len, const unsigned char *info, - size_t info_len, unsigned char *okm, size_t okm_len ); - -#ifdef __cplusplus -} -#endif - -#endif /* hkdf.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/hmac_drbg.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/hmac_drbg.h deleted file mode 100644 index 00be9df40..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/hmac_drbg.h +++ /dev/null @@ -1,415 +0,0 @@ -/** - * \file hmac_drbg.h - * - * \brief The HMAC_DRBG pseudorandom generator. - * - * This module implements the HMAC_DRBG pseudorandom generator described - * in NIST SP 800-90A: Recommendation for Random Number Generation Using - * Deterministic Random Bit Generators. - */ -/* - * Copyright (C) 2006-2019, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_HMAC_DRBG_H -#define MBEDTLS_HMAC_DRBG_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/md.h" - -#if defined(MBEDTLS_THREADING_C) -#include "mbedtls/threading.h" -#endif - -/* - * Error codes - */ -#define MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG -0x0003 /**< Too many random requested in single call. */ -#define MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG -0x0005 /**< Input too large (Entropy + additional). */ -#define MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR -0x0007 /**< Read/write error in file. */ -#define MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED -0x0009 /**< The entropy source failed. */ - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_HMAC_DRBG_RESEED_INTERVAL) -#define MBEDTLS_HMAC_DRBG_RESEED_INTERVAL 10000 /**< Interval before reseed is performed by default */ -#endif - -#if !defined(MBEDTLS_HMAC_DRBG_MAX_INPUT) -#define MBEDTLS_HMAC_DRBG_MAX_INPUT 256 /**< Maximum number of additional input bytes */ -#endif - -#if !defined(MBEDTLS_HMAC_DRBG_MAX_REQUEST) -#define MBEDTLS_HMAC_DRBG_MAX_REQUEST 1024 /**< Maximum number of requested bytes per call */ -#endif - -#if !defined(MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT) -#define MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT 384 /**< Maximum size of (re)seed buffer */ -#endif - -/* \} name SECTION: Module settings */ - -#define MBEDTLS_HMAC_DRBG_PR_OFF 0 /**< No prediction resistance */ -#define MBEDTLS_HMAC_DRBG_PR_ON 1 /**< Prediction resistance enabled */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * HMAC_DRBG context. - */ -typedef struct mbedtls_hmac_drbg_context -{ - /* Working state: the key K is not stored explicitly, - * but is implied by the HMAC context */ - mbedtls_md_context_t md_ctx; /*!< HMAC context (inc. K) */ - unsigned char V[MBEDTLS_MD_MAX_SIZE]; /*!< V in the spec */ - int reseed_counter; /*!< reseed counter */ - - /* Administrative state */ - size_t entropy_len; /*!< entropy bytes grabbed on each (re)seed */ - int prediction_resistance; /*!< enable prediction resistance (Automatic - reseed before every random generation) */ - int reseed_interval; /*!< reseed interval */ - - /* Callbacks */ - int (*f_entropy)(void *, unsigned char *, size_t); /*!< entropy function */ - void *p_entropy; /*!< context for the entropy function */ - -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; -#endif -} mbedtls_hmac_drbg_context; - -/** - * \brief HMAC_DRBG context initialization. - * - * This function makes the context ready for mbedtls_hmac_drbg_seed(), - * mbedtls_hmac_drbg_seed_buf() or mbedtls_hmac_drbg_free(). - * - * \param ctx HMAC_DRBG context to be initialized. - */ -void mbedtls_hmac_drbg_init( mbedtls_hmac_drbg_context *ctx ); - -/** - * \brief HMAC_DRBG initial seeding. - * - * Set the initial seed and set up the entropy source for future reseeds. - * - * A typical choice for the \p f_entropy and \p p_entropy parameters is - * to use the entropy module: - * - \p f_entropy is mbedtls_entropy_func(); - * - \p p_entropy is an instance of ::mbedtls_entropy_context initialized - * with mbedtls_entropy_init() (which registers the platform's default - * entropy sources). - * - * You can provide a personalization string in addition to the - * entropy source, to make this instantiation as unique as possible. - * - * \note By default, the security strength as defined by NIST is: - * - 128 bits if \p md_info is SHA-1; - * - 192 bits if \p md_info is SHA-224; - * - 256 bits if \p md_info is SHA-256, SHA-384 or SHA-512. - * Note that SHA-256 is just as efficient as SHA-224. - * The security strength can be reduced if a smaller - * entropy length is set with - * mbedtls_hmac_drbg_set_entropy_len(). - * - * \note The default entropy length is the security strength - * (converted from bits to bytes). You can override - * it by calling mbedtls_hmac_drbg_set_entropy_len(). - * - * \note During the initial seeding, this function calls - * the entropy source to obtain a nonce - * whose length is half the entropy length. - * - * \param ctx HMAC_DRBG context to be seeded. - * \param md_info MD algorithm to use for HMAC_DRBG. - * \param f_entropy The entropy callback, taking as arguments the - * \p p_entropy context, the buffer to fill, and the - * length of the buffer. - * \p f_entropy is always called with a length that is - * less than or equal to the entropy length. - * \param p_entropy The entropy context to pass to \p f_entropy. - * \param custom The personalization string. - * This can be \c NULL, in which case the personalization - * string is empty regardless of the value of \p len. - * \param len The length of the personalization string. - * This must be at most #MBEDTLS_HMAC_DRBG_MAX_INPUT - * and also at most - * #MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT - \p entropy_len * 3 / 2 - * where \p entropy_len is the entropy length - * described above. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA if \p md_info is - * invalid. - * \return #MBEDTLS_ERR_MD_ALLOC_FAILED if there was not enough - * memory to allocate context data. - * \return #MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED - * if the call to \p f_entropy failed. - */ -int mbedtls_hmac_drbg_seed( mbedtls_hmac_drbg_context *ctx, - const mbedtls_md_info_t * md_info, - int (*f_entropy)(void *, unsigned char *, size_t), - void *p_entropy, - const unsigned char *custom, - size_t len ); - -/** - * \brief Initilisation of simpified HMAC_DRBG (never reseeds). - * - * This function is meant for use in algorithms that need a pseudorandom - * input such as deterministic ECDSA. - * - * \param ctx HMAC_DRBG context to be initialised. - * \param md_info MD algorithm to use for HMAC_DRBG. - * \param data Concatenation of the initial entropy string and - * the additional data. - * \param data_len Length of \p data in bytes. - * - * \return \c 0 if successful. or - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA if \p md_info is - * invalid. - * \return #MBEDTLS_ERR_MD_ALLOC_FAILED if there was not enough - * memory to allocate context data. - */ -int mbedtls_hmac_drbg_seed_buf( mbedtls_hmac_drbg_context *ctx, - const mbedtls_md_info_t * md_info, - const unsigned char *data, size_t data_len ); - -/** - * \brief This function turns prediction resistance on or off. - * The default value is off. - * - * \note If enabled, entropy is gathered at the beginning of - * every call to mbedtls_hmac_drbg_random_with_add() - * or mbedtls_hmac_drbg_random(). - * Only use this if your entropy source has sufficient - * throughput. - * - * \param ctx The HMAC_DRBG context. - * \param resistance #MBEDTLS_HMAC_DRBG_PR_ON or #MBEDTLS_HMAC_DRBG_PR_OFF. - */ -void mbedtls_hmac_drbg_set_prediction_resistance( mbedtls_hmac_drbg_context *ctx, - int resistance ); - -/** - * \brief This function sets the amount of entropy grabbed on each - * seed or reseed. - * - * See the documentation of mbedtls_hmac_drbg_seed() for the default value. - * - * \param ctx The HMAC_DRBG context. - * \param len The amount of entropy to grab, in bytes. - */ -void mbedtls_hmac_drbg_set_entropy_len( mbedtls_hmac_drbg_context *ctx, - size_t len ); - -/** - * \brief Set the reseed interval. - * - * The reseed interval is the number of calls to mbedtls_hmac_drbg_random() - * or mbedtls_hmac_drbg_random_with_add() after which the entropy function - * is called again. - * - * The default value is #MBEDTLS_HMAC_DRBG_RESEED_INTERVAL. - * - * \param ctx The HMAC_DRBG context. - * \param interval The reseed interval. - */ -void mbedtls_hmac_drbg_set_reseed_interval( mbedtls_hmac_drbg_context *ctx, - int interval ); - -/** - * \brief This function updates the state of the HMAC_DRBG context. - * - * \param ctx The HMAC_DRBG context. - * \param additional The data to update the state with. - * If this is \c NULL, there is no additional data. - * \param add_len Length of \p additional in bytes. - * Unused if \p additional is \c NULL. - * - * \return \c 0 on success, or an error from the underlying - * hash calculation. - */ -int mbedtls_hmac_drbg_update_ret( mbedtls_hmac_drbg_context *ctx, - const unsigned char *additional, size_t add_len ); - -/** - * \brief This function reseeds the HMAC_DRBG context, that is - * extracts data from the entropy source. - * - * \param ctx The HMAC_DRBG context. - * \param additional Additional data to add to the state. - * If this is \c NULL, there is no additional data - * and \p len should be \c 0. - * \param len The length of the additional data. - * This must be at most #MBEDTLS_HMAC_DRBG_MAX_INPUT - * and also at most - * #MBEDTLS_HMAC_DRBG_MAX_SEED_INPUT - \p entropy_len - * where \p entropy_len is the entropy length - * (see mbedtls_hmac_drbg_set_entropy_len()). - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED - * if a call to the entropy function failed. - */ -int mbedtls_hmac_drbg_reseed( mbedtls_hmac_drbg_context *ctx, - const unsigned char *additional, size_t len ); - -/** - * \brief This function updates an HMAC_DRBG instance with additional - * data and uses it to generate random data. - * - * This function automatically reseeds if the reseed counter is exceeded - * or prediction resistance is enabled. - * - * \param p_rng The HMAC_DRBG context. This must be a pointer to a - * #mbedtls_hmac_drbg_context structure. - * \param output The buffer to fill. - * \param output_len The length of the buffer in bytes. - * This must be at most #MBEDTLS_HMAC_DRBG_MAX_REQUEST. - * \param additional Additional data to update with. - * If this is \c NULL, there is no additional data - * and \p add_len should be \c 0. - * \param add_len The length of the additional data. - * This must be at most #MBEDTLS_HMAC_DRBG_MAX_INPUT. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED - * if a call to the entropy source failed. - * \return #MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG if - * \p output_len > #MBEDTLS_HMAC_DRBG_MAX_REQUEST. - * \return #MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG if - * \p add_len > #MBEDTLS_HMAC_DRBG_MAX_INPUT. - */ -int mbedtls_hmac_drbg_random_with_add( void *p_rng, - unsigned char *output, size_t output_len, - const unsigned char *additional, - size_t add_len ); - -/** - * \brief This function uses HMAC_DRBG to generate random data. - * - * This function automatically reseeds if the reseed counter is exceeded - * or prediction resistance is enabled. - * - * \param p_rng The HMAC_DRBG context. This must be a pointer to a - * #mbedtls_hmac_drbg_context structure. - * \param output The buffer to fill. - * \param out_len The length of the buffer in bytes. - * This must be at most #MBEDTLS_HMAC_DRBG_MAX_REQUEST. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED - * if a call to the entropy source failed. - * \return #MBEDTLS_ERR_HMAC_DRBG_REQUEST_TOO_BIG if - * \p out_len > #MBEDTLS_HMAC_DRBG_MAX_REQUEST. - */ -int mbedtls_hmac_drbg_random( void *p_rng, unsigned char *output, size_t out_len ); - -/** - * \brief Free an HMAC_DRBG context - * - * \param ctx The HMAC_DRBG context to free. - */ -void mbedtls_hmac_drbg_free( mbedtls_hmac_drbg_context *ctx ); - -#if ! defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function updates the state of the HMAC_DRBG context. - * - * \deprecated Superseded by mbedtls_hmac_drbg_update_ret() - * in 2.16.0. - * - * \param ctx The HMAC_DRBG context. - * \param additional The data to update the state with. - * If this is \c NULL, there is no additional data. - * \param add_len Length of \p additional in bytes. - * Unused if \p additional is \c NULL. - */ -MBEDTLS_DEPRECATED void mbedtls_hmac_drbg_update( - mbedtls_hmac_drbg_context *ctx, - const unsigned char *additional, size_t add_len ); -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -#if defined(MBEDTLS_FS_IO) -/** - * \brief This function writes a seed file. - * - * \param ctx The HMAC_DRBG context. - * \param path The name of the file. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR on file error. - * \return #MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED on reseed - * failure. - */ -int mbedtls_hmac_drbg_write_seed_file( mbedtls_hmac_drbg_context *ctx, const char *path ); - -/** - * \brief This function reads and updates a seed file. The seed - * is added to this instance. - * - * \param ctx The HMAC_DRBG context. - * \param path The name of the file. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_HMAC_DRBG_FILE_IO_ERROR on file error. - * \return #MBEDTLS_ERR_HMAC_DRBG_ENTROPY_SOURCE_FAILED on - * reseed failure. - * \return #MBEDTLS_ERR_HMAC_DRBG_INPUT_TOO_BIG if the existing - * seed file is too large. - */ -int mbedtls_hmac_drbg_update_seed_file( mbedtls_hmac_drbg_context *ctx, const char *path ); -#endif /* MBEDTLS_FS_IO */ - - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief The HMAC_DRBG Checkup routine. - * - * \return \c 0 if successful. - * \return \c 1 if the test failed. - */ -int mbedtls_hmac_drbg_self_test( int verbose ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* hmac_drbg.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md.h deleted file mode 100644 index 7e70778ce..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md.h +++ /dev/null @@ -1,476 +0,0 @@ - /** - * \file md.h - * - * \brief This file contains the generic message-digest wrapper. - * - * \author Adriaan de Jong - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_MD_H -#define MBEDTLS_MD_H - -#include - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE -0x5080 /**< The selected feature is not available. */ -#define MBEDTLS_ERR_MD_BAD_INPUT_DATA -0x5100 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_MD_ALLOC_FAILED -0x5180 /**< Failed to allocate memory. */ -#define MBEDTLS_ERR_MD_FILE_IO_ERROR -0x5200 /**< Opening or reading of file failed. */ - -/* MBEDTLS_ERR_MD_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_MD_HW_ACCEL_FAILED -0x5280 /**< MD hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Supported message digests. - * - * \warning MD2, MD4, MD5 and SHA-1 are considered weak message digests and - * their use constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -typedef enum { - MBEDTLS_MD_NONE=0, /**< None. */ - MBEDTLS_MD_MD2, /**< The MD2 message digest. */ - MBEDTLS_MD_MD4, /**< The MD4 message digest. */ - MBEDTLS_MD_MD5, /**< The MD5 message digest. */ - MBEDTLS_MD_SHA1, /**< The SHA-1 message digest. */ - MBEDTLS_MD_SHA224, /**< The SHA-224 message digest. */ - MBEDTLS_MD_SHA256, /**< The SHA-256 message digest. */ - MBEDTLS_MD_SHA384, /**< The SHA-384 message digest. */ - MBEDTLS_MD_SHA512, /**< The SHA-512 message digest. */ - MBEDTLS_MD_RIPEMD160, /**< The RIPEMD-160 message digest. */ -} mbedtls_md_type_t; - -#if defined(MBEDTLS_SHA512_C) -#define MBEDTLS_MD_MAX_SIZE 64 /* longest known is SHA512 */ -#else -#define MBEDTLS_MD_MAX_SIZE 32 /* longest known is SHA256 or less */ -#endif - -#if defined(MBEDTLS_SHA512_C) -#define MBEDTLS_MD_MAX_BLOCK_SIZE 128 -#else -#define MBEDTLS_MD_MAX_BLOCK_SIZE 64 -#endif - -/** - * Opaque struct defined in md_internal.h. - */ -typedef struct mbedtls_md_info_t mbedtls_md_info_t; - -/** - * The generic message-digest context. - */ -typedef struct mbedtls_md_context_t -{ - /** Information about the associated message digest. */ - const mbedtls_md_info_t *md_info; - - /** The digest-specific context. */ - void *md_ctx; - - /** The HMAC part of the context. */ - void *hmac_ctx; -} mbedtls_md_context_t; - -/** - * \brief This function returns the list of digests supported by the - * generic digest module. - * - * \note The list starts with the strongest available hashes. - * - * \return A statically allocated array of digests. Each element - * in the returned list is an integer belonging to the - * message-digest enumeration #mbedtls_md_type_t. - * The last entry is 0. - */ -const int *mbedtls_md_list( void ); - -/** - * \brief This function returns the message-digest information - * associated with the given digest name. - * - * \param md_name The name of the digest to search for. - * - * \return The message-digest information associated with \p md_name. - * \return NULL if the associated message-digest information is not found. - */ -const mbedtls_md_info_t *mbedtls_md_info_from_string( const char *md_name ); - -/** - * \brief This function returns the message-digest information - * associated with the given digest type. - * - * \param md_type The type of digest to search for. - * - * \return The message-digest information associated with \p md_type. - * \return NULL if the associated message-digest information is not found. - */ -const mbedtls_md_info_t *mbedtls_md_info_from_type( mbedtls_md_type_t md_type ); - -/** - * \brief This function initializes a message-digest context without - * binding it to a particular message-digest algorithm. - * - * This function should always be called first. It prepares the - * context for mbedtls_md_setup() for binding it to a - * message-digest algorithm. - */ -void mbedtls_md_init( mbedtls_md_context_t *ctx ); - -/** - * \brief This function clears the internal structure of \p ctx and - * frees any embedded internal structure, but does not free - * \p ctx itself. - * - * If you have called mbedtls_md_setup() on \p ctx, you must - * call mbedtls_md_free() when you are no longer using the - * context. - * Calling this function if you have previously - * called mbedtls_md_init() and nothing else is optional. - * You must not call this function if you have not called - * mbedtls_md_init(). - */ -void mbedtls_md_free( mbedtls_md_context_t *ctx ); - -#if ! defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function selects the message digest algorithm to use, - * and allocates internal structures. - * - * It should be called after mbedtls_md_init() or mbedtls_md_free(). - * Makes it necessary to call mbedtls_md_free() later. - * - * \deprecated Superseded by mbedtls_md_setup() in 2.0.0 - * - * \param ctx The context to set up. - * \param md_info The information structure of the message-digest algorithm - * to use. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - * \return #MBEDTLS_ERR_MD_ALLOC_FAILED on memory-allocation failure. - */ -int mbedtls_md_init_ctx( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info ) MBEDTLS_DEPRECATED; -#undef MBEDTLS_DEPRECATED -#endif /* MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief This function selects the message digest algorithm to use, - * and allocates internal structures. - * - * It should be called after mbedtls_md_init() or - * mbedtls_md_free(). Makes it necessary to call - * mbedtls_md_free() later. - * - * \param ctx The context to set up. - * \param md_info The information structure of the message-digest algorithm - * to use. - * \param hmac Defines if HMAC is used. 0: HMAC is not used (saves some memory), - * or non-zero: HMAC is used with this context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - * \return #MBEDTLS_ERR_MD_ALLOC_FAILED on memory-allocation failure. - */ -int mbedtls_md_setup( mbedtls_md_context_t *ctx, const mbedtls_md_info_t *md_info, int hmac ); - -/** - * \brief This function clones the state of an message-digest - * context. - * - * \note You must call mbedtls_md_setup() on \c dst before calling - * this function. - * - * \note The two contexts must have the same type, - * for example, both are SHA-256. - * - * \warning This function clones the message-digest state, not the - * HMAC state. - * - * \param dst The destination context. - * \param src The context to be cloned. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification failure. - */ -int mbedtls_md_clone( mbedtls_md_context_t *dst, - const mbedtls_md_context_t *src ); - -/** - * \brief This function extracts the message-digest size from the - * message-digest information structure. - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * - * \return The size of the message-digest output in Bytes. - */ -unsigned char mbedtls_md_get_size( const mbedtls_md_info_t *md_info ); - -/** - * \brief This function extracts the message-digest type from the - * message-digest information structure. - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * - * \return The type of the message digest. - */ -mbedtls_md_type_t mbedtls_md_get_type( const mbedtls_md_info_t *md_info ); - -/** - * \brief This function extracts the message-digest name from the - * message-digest information structure. - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * - * \return The name of the message digest. - */ -const char *mbedtls_md_get_name( const mbedtls_md_info_t *md_info ); - -/** - * \brief This function starts a message-digest computation. - * - * You must call this function after setting up the context - * with mbedtls_md_setup(), and before passing data with - * mbedtls_md_update(). - * - * \param ctx The generic message-digest context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_starts( mbedtls_md_context_t *ctx ); - -/** - * \brief This function feeds an input buffer into an ongoing - * message-digest computation. - * - * You must call mbedtls_md_starts() before calling this - * function. You may call this function multiple times. - * Afterwards, call mbedtls_md_finish(). - * - * \param ctx The generic message-digest context. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_update( mbedtls_md_context_t *ctx, const unsigned char *input, size_t ilen ); - -/** - * \brief This function finishes the digest operation, - * and writes the result to the output buffer. - * - * Call this function after a call to mbedtls_md_starts(), - * followed by any number of calls to mbedtls_md_update(). - * Afterwards, you may either clear the context with - * mbedtls_md_free(), or call mbedtls_md_starts() to reuse - * the context for another digest operation with the same - * algorithm. - * - * \param ctx The generic message-digest context. - * \param output The buffer for the generic message-digest checksum result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_finish( mbedtls_md_context_t *ctx, unsigned char *output ); - -/** - * \brief This function calculates the message-digest of a buffer, - * with respect to a configurable message-digest algorithm - * in a single call. - * - * The result is calculated as - * Output = message_digest(input buffer). - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * \param input The buffer holding the data. - * \param ilen The length of the input data. - * \param output The generic message-digest checksum result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md( const mbedtls_md_info_t *md_info, const unsigned char *input, size_t ilen, - unsigned char *output ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief This function calculates the message-digest checksum - * result of the contents of the provided file. - * - * The result is calculated as - * Output = message_digest(file contents). - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * \param path The input file name. - * \param output The generic message-digest checksum result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_FILE_IO_ERROR on an I/O error accessing - * the file pointed by \p path. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA if \p md_info was NULL. - */ -int mbedtls_md_file( const mbedtls_md_info_t *md_info, const char *path, - unsigned char *output ); -#endif /* MBEDTLS_FS_IO */ - -/** - * \brief This function sets the HMAC key and prepares to - * authenticate a new message. - * - * Call this function after mbedtls_md_setup(), to use - * the MD context for an HMAC calculation, then call - * mbedtls_md_hmac_update() to provide the input data, and - * mbedtls_md_hmac_finish() to get the HMAC value. - * - * \param ctx The message digest context containing an embedded HMAC - * context. - * \param key The HMAC secret key. - * \param keylen The length of the HMAC key in Bytes. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_hmac_starts( mbedtls_md_context_t *ctx, const unsigned char *key, - size_t keylen ); - -/** - * \brief This function feeds an input buffer into an ongoing HMAC - * computation. - * - * Call mbedtls_md_hmac_starts() or mbedtls_md_hmac_reset() - * before calling this function. - * You may call this function multiple times to pass the - * input piecewise. - * Afterwards, call mbedtls_md_hmac_finish(). - * - * \param ctx The message digest context containing an embedded HMAC - * context. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_hmac_update( mbedtls_md_context_t *ctx, const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the HMAC operation, and writes - * the result to the output buffer. - * - * Call this function after mbedtls_md_hmac_starts() and - * mbedtls_md_hmac_update() to get the HMAC value. Afterwards - * you may either call mbedtls_md_free() to clear the context, - * or call mbedtls_md_hmac_reset() to reuse the context with - * the same HMAC key. - * - * \param ctx The message digest context containing an embedded HMAC - * context. - * \param output The generic HMAC checksum result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_hmac_finish( mbedtls_md_context_t *ctx, unsigned char *output); - -/** - * \brief This function prepares to authenticate a new message with - * the same key as the previous HMAC operation. - * - * You may call this function after mbedtls_md_hmac_finish(). - * Afterwards call mbedtls_md_hmac_update() to pass the new - * input. - * - * \param ctx The message digest context containing an embedded HMAC - * context. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_hmac_reset( mbedtls_md_context_t *ctx ); - -/** - * \brief This function calculates the full generic HMAC - * on the input buffer with the provided key. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The HMAC result is calculated as - * output = generic HMAC(hmac key, input buffer). - * - * \param md_info The information structure of the message-digest algorithm - * to use. - * \param key The HMAC secret key. - * \param keylen The length of the HMAC secret key in Bytes. - * \param input The buffer holding the input data. - * \param ilen The length of the input data. - * \param output The generic HMAC result. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA on parameter-verification - * failure. - */ -int mbedtls_md_hmac( const mbedtls_md_info_t *md_info, const unsigned char *key, size_t keylen, - const unsigned char *input, size_t ilen, - unsigned char *output ); - -/* Internal use */ -int mbedtls_md_process( mbedtls_md_context_t *ctx, const unsigned char *data ); - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_MD_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md2.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md2.h deleted file mode 100644 index df1d5f7e6..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md2.h +++ /dev/null @@ -1,306 +0,0 @@ -/** - * \file md2.h - * - * \brief MD2 message digest algorithm (hash function) - * - * \warning MD2 is considered a weak message digest and its use constitutes a - * security risk. We recommend considering stronger message digests - * instead. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - */ -#ifndef MBEDTLS_MD2_H -#define MBEDTLS_MD2_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -/* MBEDTLS_ERR_MD2_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_MD2_HW_ACCEL_FAILED -0x002B /**< MD2 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_MD2_ALT) -// Regular implementation -// - -/** - * \brief MD2 context structure - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -typedef struct mbedtls_md2_context -{ - unsigned char cksum[16]; /*!< checksum of the data block */ - unsigned char state[48]; /*!< intermediate digest state */ - unsigned char buffer[16]; /*!< data block being processed */ - size_t left; /*!< amount of data in buffer */ -} -mbedtls_md2_context; - -#else /* MBEDTLS_MD2_ALT */ -#include "md2_alt.h" -#endif /* MBEDTLS_MD2_ALT */ - -/** - * \brief Initialize MD2 context - * - * \param ctx MD2 context to be initialized - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md2_init( mbedtls_md2_context *ctx ); - -/** - * \brief Clear MD2 context - * - * \param ctx MD2 context to be cleared - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md2_free( mbedtls_md2_context *ctx ); - -/** - * \brief Clone (the state of) an MD2 context - * - * \param dst The destination context - * \param src The context to be cloned - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md2_clone( mbedtls_md2_context *dst, - const mbedtls_md2_context *src ); - -/** - * \brief MD2 context setup - * - * \param ctx context to be initialized - * - * \return 0 if successful - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md2_starts_ret( mbedtls_md2_context *ctx ); - -/** - * \brief MD2 process buffer - * - * \param ctx MD2 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \return 0 if successful - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md2_update_ret( mbedtls_md2_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD2 final digest - * - * \param ctx MD2 context - * \param output MD2 checksum result - * - * \return 0 if successful - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md2_finish_ret( mbedtls_md2_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD2 process data block (internal use only) - * - * \param ctx MD2 context - * - * \return 0 if successful - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_internal_md2_process( mbedtls_md2_context *ctx ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief MD2 context setup - * - * \deprecated Superseded by mbedtls_md2_starts_ret() in 2.7.0 - * - * \param ctx context to be initialized - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md2_starts( mbedtls_md2_context *ctx ); - -/** - * \brief MD2 process buffer - * - * \deprecated Superseded by mbedtls_md2_update_ret() in 2.7.0 - * - * \param ctx MD2 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md2_update( mbedtls_md2_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD2 final digest - * - * \deprecated Superseded by mbedtls_md2_finish_ret() in 2.7.0 - * - * \param ctx MD2 context - * \param output MD2 checksum result - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md2_finish( mbedtls_md2_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD2 process data block (internal use only) - * - * \deprecated Superseded by mbedtls_internal_md2_process() in 2.7.0 - * - * \param ctx MD2 context - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md2_process( mbedtls_md2_context *ctx ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Output = MD2( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD2 checksum result - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md2_ret( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Output = MD2( input buffer ) - * - * \deprecated Superseded by mbedtls_md2_ret() in 2.7.0 - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD2 checksum result - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md2( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - * - * \warning MD2 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md2_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_md2.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md4.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md4.h deleted file mode 100644 index e7accd455..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md4.h +++ /dev/null @@ -1,311 +0,0 @@ -/** - * \file md4.h - * - * \brief MD4 message digest algorithm (hash function) - * - * \warning MD4 is considered a weak message digest and its use constitutes a - * security risk. We recommend considering stronger message digests - * instead. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - */ -#ifndef MBEDTLS_MD4_H -#define MBEDTLS_MD4_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -/* MBEDTLS_ERR_MD4_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_MD4_HW_ACCEL_FAILED -0x002D /**< MD4 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_MD4_ALT) -// Regular implementation -// - -/** - * \brief MD4 context structure - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -typedef struct mbedtls_md4_context -{ - uint32_t total[2]; /*!< number of bytes processed */ - uint32_t state[4]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ -} -mbedtls_md4_context; - -#else /* MBEDTLS_MD4_ALT */ -#include "md4_alt.h" -#endif /* MBEDTLS_MD4_ALT */ - -/** - * \brief Initialize MD4 context - * - * \param ctx MD4 context to be initialized - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md4_init( mbedtls_md4_context *ctx ); - -/** - * \brief Clear MD4 context - * - * \param ctx MD4 context to be cleared - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md4_free( mbedtls_md4_context *ctx ); - -/** - * \brief Clone (the state of) an MD4 context - * - * \param dst The destination context - * \param src The context to be cloned - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md4_clone( mbedtls_md4_context *dst, - const mbedtls_md4_context *src ); - -/** - * \brief MD4 context setup - * - * \param ctx context to be initialized - * - * \return 0 if successful - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - */ -int mbedtls_md4_starts_ret( mbedtls_md4_context *ctx ); - -/** - * \brief MD4 process buffer - * - * \param ctx MD4 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \return 0 if successful - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md4_update_ret( mbedtls_md4_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD4 final digest - * - * \param ctx MD4 context - * \param output MD4 checksum result - * - * \return 0 if successful - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md4_finish_ret( mbedtls_md4_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD4 process data block (internal use only) - * - * \param ctx MD4 context - * \param data buffer holding one block of data - * - * \return 0 if successful - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_internal_md4_process( mbedtls_md4_context *ctx, - const unsigned char data[64] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief MD4 context setup - * - * \deprecated Superseded by mbedtls_md4_starts_ret() in 2.7.0 - * - * \param ctx context to be initialized - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md4_starts( mbedtls_md4_context *ctx ); - -/** - * \brief MD4 process buffer - * - * \deprecated Superseded by mbedtls_md4_update_ret() in 2.7.0 - * - * \param ctx MD4 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md4_update( mbedtls_md4_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD4 final digest - * - * \deprecated Superseded by mbedtls_md4_finish_ret() in 2.7.0 - * - * \param ctx MD4 context - * \param output MD4 checksum result - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md4_finish( mbedtls_md4_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD4 process data block (internal use only) - * - * \deprecated Superseded by mbedtls_internal_md4_process() in 2.7.0 - * - * \param ctx MD4 context - * \param data buffer holding one block of data - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md4_process( mbedtls_md4_context *ctx, - const unsigned char data[64] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Output = MD4( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD4 checksum result - * - * \return 0 if successful - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md4_ret( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Output = MD4( input buffer ) - * - * \deprecated Superseded by mbedtls_md4_ret() in 2.7.0 - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD4 checksum result - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md4( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md4_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_md4.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md5.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md5.h deleted file mode 100644 index 4206c1fbf..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md5.h +++ /dev/null @@ -1,311 +0,0 @@ -/** - * \file md5.h - * - * \brief MD5 message digest algorithm (hash function) - * - * \warning MD5 is considered a weak message digest and its use constitutes a - * security risk. We recommend considering stronger message - * digests instead. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_MD5_H -#define MBEDTLS_MD5_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -/* MBEDTLS_ERR_MD5_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_MD5_HW_ACCEL_FAILED -0x002F /**< MD5 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_MD5_ALT) -// Regular implementation -// - -/** - * \brief MD5 context structure - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -typedef struct mbedtls_md5_context -{ - uint32_t total[2]; /*!< number of bytes processed */ - uint32_t state[4]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ -} -mbedtls_md5_context; - -#else /* MBEDTLS_MD5_ALT */ -#include "md5_alt.h" -#endif /* MBEDTLS_MD5_ALT */ - -/** - * \brief Initialize MD5 context - * - * \param ctx MD5 context to be initialized - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md5_init( mbedtls_md5_context *ctx ); - -/** - * \brief Clear MD5 context - * - * \param ctx MD5 context to be cleared - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md5_free( mbedtls_md5_context *ctx ); - -/** - * \brief Clone (the state of) an MD5 context - * - * \param dst The destination context - * \param src The context to be cloned - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -void mbedtls_md5_clone( mbedtls_md5_context *dst, - const mbedtls_md5_context *src ); - -/** - * \brief MD5 context setup - * - * \param ctx context to be initialized - * - * \return 0 if successful - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md5_starts_ret( mbedtls_md5_context *ctx ); - -/** - * \brief MD5 process buffer - * - * \param ctx MD5 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \return 0 if successful - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md5_update_ret( mbedtls_md5_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD5 final digest - * - * \param ctx MD5 context - * \param output MD5 checksum result - * - * \return 0 if successful - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md5_finish_ret( mbedtls_md5_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD5 process data block (internal use only) - * - * \param ctx MD5 context - * \param data buffer holding one block of data - * - * \return 0 if successful - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_internal_md5_process( mbedtls_md5_context *ctx, - const unsigned char data[64] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief MD5 context setup - * - * \deprecated Superseded by mbedtls_md5_starts_ret() in 2.7.0 - * - * \param ctx context to be initialized - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md5_starts( mbedtls_md5_context *ctx ); - -/** - * \brief MD5 process buffer - * - * \deprecated Superseded by mbedtls_md5_update_ret() in 2.7.0 - * - * \param ctx MD5 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md5_update( mbedtls_md5_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief MD5 final digest - * - * \deprecated Superseded by mbedtls_md5_finish_ret() in 2.7.0 - * - * \param ctx MD5 context - * \param output MD5 checksum result - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md5_finish( mbedtls_md5_context *ctx, - unsigned char output[16] ); - -/** - * \brief MD5 process data block (internal use only) - * - * \deprecated Superseded by mbedtls_internal_md5_process() in 2.7.0 - * - * \param ctx MD5 context - * \param data buffer holding one block of data - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md5_process( mbedtls_md5_context *ctx, - const unsigned char data[64] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Output = MD5( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD5 checksum result - * - * \return 0 if successful - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md5_ret( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Output = MD5( input buffer ) - * - * \deprecated Superseded by mbedtls_md5_ret() in 2.7.0 - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output MD5 checksum result - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -MBEDTLS_DEPRECATED void mbedtls_md5( const unsigned char *input, - size_t ilen, - unsigned char output[16] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - * - * \warning MD5 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -int mbedtls_md5_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_md5.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md_internal.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md_internal.h deleted file mode 100644 index 0922dff9d..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/md_internal.h +++ /dev/null @@ -1,92 +0,0 @@ -/** - * \file md_internal.h - * - * \brief Message digest wrappers. - * - * \warning This in an internal header. Do not include directly. - * - * \author Adriaan de Jong - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_MD_WRAP_H -#define MBEDTLS_MD_WRAP_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Message digest information. - * Allows message digest functions to be called in a generic way. - */ -struct mbedtls_md_info_t -{ - /** Name of the message digest */ - const char * name; - - /** Digest identifier */ - mbedtls_md_type_t type; - - /** Output length of the digest function in bytes */ - unsigned char size; - - /** Block length of the digest function in bytes */ - unsigned char block_size; -}; - -#if defined(MBEDTLS_MD2_C) -extern const mbedtls_md_info_t mbedtls_md2_info; -#endif -#if defined(MBEDTLS_MD4_C) -extern const mbedtls_md_info_t mbedtls_md4_info; -#endif -#if defined(MBEDTLS_MD5_C) -extern const mbedtls_md_info_t mbedtls_md5_info; -#endif -#if defined(MBEDTLS_RIPEMD160_C) -extern const mbedtls_md_info_t mbedtls_ripemd160_info; -#endif -#if defined(MBEDTLS_SHA1_C) -extern const mbedtls_md_info_t mbedtls_sha1_info; -#endif -#if defined(MBEDTLS_SHA256_C) -extern const mbedtls_md_info_t mbedtls_sha224_info; -extern const mbedtls_md_info_t mbedtls_sha256_info; -#endif -#if defined(MBEDTLS_SHA512_C) -#if !defined(MBEDTLS_SHA512_NO_SHA384) -extern const mbedtls_md_info_t mbedtls_sha384_info; -#endif -extern const mbedtls_md_info_t mbedtls_sha512_info; -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_MD_WRAP_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/memory_buffer_alloc.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/memory_buffer_alloc.h deleted file mode 100644 index 8e77f6f7c..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/memory_buffer_alloc.h +++ /dev/null @@ -1,151 +0,0 @@ -/** - * \file memory_buffer_alloc.h - * - * \brief Buffer-based memory allocator - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_MEMORY_BUFFER_ALLOC_H -#define MBEDTLS_MEMORY_BUFFER_ALLOC_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_MEMORY_ALIGN_MULTIPLE) -#define MBEDTLS_MEMORY_ALIGN_MULTIPLE 4 /**< Align on multiples of this value */ -#endif - -/* \} name SECTION: Module settings */ - -#define MBEDTLS_MEMORY_VERIFY_NONE 0 -#define MBEDTLS_MEMORY_VERIFY_ALLOC (1 << 0) -#define MBEDTLS_MEMORY_VERIFY_FREE (1 << 1) -#define MBEDTLS_MEMORY_VERIFY_ALWAYS (MBEDTLS_MEMORY_VERIFY_ALLOC | MBEDTLS_MEMORY_VERIFY_FREE) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Initialize use of stack-based memory allocator. - * The stack-based allocator does memory management inside the - * presented buffer and does not call calloc() and free(). - * It sets the global mbedtls_calloc() and mbedtls_free() pointers - * to its own functions. - * (Provided mbedtls_calloc() and mbedtls_free() are thread-safe if - * MBEDTLS_THREADING_C is defined) - * - * \note This code is not optimized and provides a straight-forward - * implementation of a stack-based memory allocator. - * - * \param buf buffer to use as heap - * \param len size of the buffer - */ -void mbedtls_memory_buffer_alloc_init( unsigned char *buf, size_t len ); - -/** - * \brief Free the mutex for thread-safety and clear remaining memory - */ -void mbedtls_memory_buffer_alloc_free( void ); - -/** - * \brief Determine when the allocator should automatically verify the state - * of the entire chain of headers / meta-data. - * (Default: MBEDTLS_MEMORY_VERIFY_NONE) - * - * \param verify One of MBEDTLS_MEMORY_VERIFY_NONE, MBEDTLS_MEMORY_VERIFY_ALLOC, - * MBEDTLS_MEMORY_VERIFY_FREE or MBEDTLS_MEMORY_VERIFY_ALWAYS - */ -void mbedtls_memory_buffer_set_verify( int verify ); - -#if defined(MBEDTLS_MEMORY_DEBUG) -/** - * \brief Print out the status of the allocated memory (primarily for use - * after a program should have de-allocated all memory) - * Prints out a list of 'still allocated' blocks and their stack - * trace if MBEDTLS_MEMORY_BACKTRACE is defined. - */ -void mbedtls_memory_buffer_alloc_status( void ); - -/** - * \brief Get the peak heap usage so far - * - * \param max_used Peak number of bytes in use or committed. This - * includes bytes in allocated blocks too small to split - * into smaller blocks but larger than the requested size. - * \param max_blocks Peak number of blocks in use, including free and used - */ -void mbedtls_memory_buffer_alloc_max_get( size_t *max_used, size_t *max_blocks ); - -/** - * \brief Reset peak statistics - */ -void mbedtls_memory_buffer_alloc_max_reset( void ); - -/** - * \brief Get the current heap usage - * - * \param cur_used Current number of bytes in use or committed. This - * includes bytes in allocated blocks too small to split - * into smaller blocks but larger than the requested size. - * \param cur_blocks Current number of blocks in use, including free and used - */ -void mbedtls_memory_buffer_alloc_cur_get( size_t *cur_used, size_t *cur_blocks ); -#endif /* MBEDTLS_MEMORY_DEBUG */ - -/** - * \brief Verifies that all headers in the memory buffer are correct - * and contain sane values. Helps debug buffer-overflow errors. - * - * Prints out first failure if MBEDTLS_MEMORY_DEBUG is defined. - * Prints out full header information if MBEDTLS_MEMORY_DEBUG - * is defined. (Includes stack trace information for each block if - * MBEDTLS_MEMORY_BACKTRACE is defined as well). - * - * \return 0 if verified, 1 otherwise - */ -int mbedtls_memory_buffer_alloc_verify( void ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if a test failed - */ -int mbedtls_memory_buffer_alloc_self_test( int verbose ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* memory_buffer_alloc.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/net.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/net.h deleted file mode 100644 index 341aae84a..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/net.h +++ /dev/null @@ -1,37 +0,0 @@ -/** - * \file net.h - * - * \brief Deprecated header file that includes net_sockets.h - * - * \deprecated Superseded by mbedtls/net_sockets.h - */ -/* - * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#include "mbedtls/net_sockets.h" -#if defined(MBEDTLS_DEPRECATED_WARNING) -#warning "Deprecated header file: Superseded by mbedtls/net_sockets.h" -#endif /* MBEDTLS_DEPRECATED_WARNING */ -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/net_sockets.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/net_sockets.h deleted file mode 100644 index adb589ee9..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/net_sockets.h +++ /dev/null @@ -1,278 +0,0 @@ -/** - * \file net_sockets.h - * - * \brief Network sockets abstraction layer to integrate Mbed TLS into a - * BSD-style sockets API. - * - * The network sockets module provides an example integration of the - * Mbed TLS library into a BSD sockets implementation. The module is - * intended to be an example of how Mbed TLS can be integrated into a - * networking stack, as well as to be Mbed TLS's network integration - * for its supported platforms. - * - * The module is intended only to be used with the Mbed TLS library and - * is not intended to be used by third party application software - * directly. - * - * The supported platforms are as follows: - * * Microsoft Windows and Windows CE - * * POSIX/Unix platforms including Linux, OS X - * - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_NET_SOCKETS_H -#define MBEDTLS_NET_SOCKETS_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/ssl.h" - -#include -#include - -#define MBEDTLS_ERR_NET_SOCKET_FAILED -0x0042 /**< Failed to open a socket. */ -#define MBEDTLS_ERR_NET_CONNECT_FAILED -0x0044 /**< The connection to the given server / port failed. */ -#define MBEDTLS_ERR_NET_BIND_FAILED -0x0046 /**< Binding of the socket failed. */ -#define MBEDTLS_ERR_NET_LISTEN_FAILED -0x0048 /**< Could not listen on the socket. */ -#define MBEDTLS_ERR_NET_ACCEPT_FAILED -0x004A /**< Could not accept the incoming connection. */ -#define MBEDTLS_ERR_NET_RECV_FAILED -0x004C /**< Reading information from the socket failed. */ -#define MBEDTLS_ERR_NET_SEND_FAILED -0x004E /**< Sending information through the socket failed. */ -#define MBEDTLS_ERR_NET_CONN_RESET -0x0050 /**< Connection was reset by peer. */ -#define MBEDTLS_ERR_NET_UNKNOWN_HOST -0x0052 /**< Failed to get an IP address for the given hostname. */ -#define MBEDTLS_ERR_NET_BUFFER_TOO_SMALL -0x0043 /**< Buffer is too small to hold the data. */ -#define MBEDTLS_ERR_NET_INVALID_CONTEXT -0x0045 /**< The context is invalid, eg because it was free()ed. */ -#define MBEDTLS_ERR_NET_POLL_FAILED -0x0047 /**< Polling the net context failed. */ -#define MBEDTLS_ERR_NET_BAD_INPUT_DATA -0x0049 /**< Input invalid. */ - -#define MBEDTLS_NET_LISTEN_BACKLOG 10 /**< The backlog that listen() should use. */ - -#define MBEDTLS_NET_PROTO_TCP 0 /**< The TCP transport protocol */ -#define MBEDTLS_NET_PROTO_UDP 1 /**< The UDP transport protocol */ - -#define MBEDTLS_NET_POLL_READ 1 /**< Used in \c mbedtls_net_poll to check for pending data */ -#define MBEDTLS_NET_POLL_WRITE 2 /**< Used in \c mbedtls_net_poll to check if write possible */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Wrapper type for sockets. - * - * Currently backed by just a file descriptor, but might be more in the future - * (eg two file descriptors for combined IPv4 + IPv6 support, or additional - * structures for hand-made UDP demultiplexing). - */ -typedef struct mbedtls_net_context -{ - int fd; /**< The underlying file descriptor */ -} -mbedtls_net_context; - -/** - * \brief Initialize a context - * Just makes the context ready to be used or freed safely. - * - * \param ctx Context to initialize - */ -void mbedtls_net_init( mbedtls_net_context *ctx ); - -/** - * \brief Initiate a connection with host:port in the given protocol - * - * \param ctx Socket to use - * \param host Host to connect to - * \param port Port to connect to - * \param proto Protocol: MBEDTLS_NET_PROTO_TCP or MBEDTLS_NET_PROTO_UDP - * - * \return 0 if successful, or one of: - * MBEDTLS_ERR_NET_SOCKET_FAILED, - * MBEDTLS_ERR_NET_UNKNOWN_HOST, - * MBEDTLS_ERR_NET_CONNECT_FAILED - * - * \note Sets the socket in connected mode even with UDP. - */ -int mbedtls_net_connect( mbedtls_net_context *ctx, const char *host, const char *port, int proto ); - -/** - * \brief Create a receiving socket on bind_ip:port in the chosen - * protocol. If bind_ip == NULL, all interfaces are bound. - * - * \param ctx Socket to use - * \param bind_ip IP to bind to, can be NULL - * \param port Port number to use - * \param proto Protocol: MBEDTLS_NET_PROTO_TCP or MBEDTLS_NET_PROTO_UDP - * - * \return 0 if successful, or one of: - * MBEDTLS_ERR_NET_SOCKET_FAILED, - * MBEDTLS_ERR_NET_BIND_FAILED, - * MBEDTLS_ERR_NET_LISTEN_FAILED - * - * \note Regardless of the protocol, opens the sockets and binds it. - * In addition, make the socket listening if protocol is TCP. - */ -int mbedtls_net_bind( mbedtls_net_context *ctx, const char *bind_ip, const char *port, int proto ); - -/** - * \brief Accept a connection from a remote client - * - * \param bind_ctx Relevant socket - * \param client_ctx Will contain the connected client socket - * \param client_ip Will contain the client IP address, can be NULL - * \param buf_size Size of the client_ip buffer - * \param ip_len Will receive the size of the client IP written, - * can be NULL if client_ip is null - * - * \return 0 if successful, or - * MBEDTLS_ERR_NET_ACCEPT_FAILED, or - * MBEDTLS_ERR_NET_BUFFER_TOO_SMALL if buf_size is too small, - * MBEDTLS_ERR_SSL_WANT_READ if bind_fd was set to - * non-blocking and accept() would block. - */ -int mbedtls_net_accept( mbedtls_net_context *bind_ctx, - mbedtls_net_context *client_ctx, - void *client_ip, size_t buf_size, size_t *ip_len ); - -/** - * \brief Check and wait for the context to be ready for read/write - * - * \param ctx Socket to check - * \param rw Bitflag composed of MBEDTLS_NET_POLL_READ and - * MBEDTLS_NET_POLL_WRITE specifying the events - * to wait for: - * - If MBEDTLS_NET_POLL_READ is set, the function - * will return as soon as the net context is available - * for reading. - * - If MBEDTLS_NET_POLL_WRITE is set, the function - * will return as soon as the net context is available - * for writing. - * \param timeout Maximal amount of time to wait before returning, - * in milliseconds. If \c timeout is zero, the - * function returns immediately. If \c timeout is - * -1u, the function blocks potentially indefinitely. - * - * \return Bitmask composed of MBEDTLS_NET_POLL_READ/WRITE - * on success or timeout, or a negative return code otherwise. - */ -int mbedtls_net_poll( mbedtls_net_context *ctx, uint32_t rw, uint32_t timeout ); - -/** - * \brief Set the socket blocking - * - * \param ctx Socket to set - * - * \return 0 if successful, or a non-zero error code - */ -int mbedtls_net_set_block( mbedtls_net_context *ctx ); - -/** - * \brief Set the socket non-blocking - * - * \param ctx Socket to set - * - * \return 0 if successful, or a non-zero error code - */ -int mbedtls_net_set_nonblock( mbedtls_net_context *ctx ); - -/** - * \brief Portable usleep helper - * - * \param usec Amount of microseconds to sleep - * - * \note Real amount of time slept will not be less than - * select()'s timeout granularity (typically, 10ms). - */ -void mbedtls_net_usleep( unsigned long usec ); - -/** - * \brief Read at most 'len' characters. If no error occurs, - * the actual amount read is returned. - * - * \param ctx Socket - * \param buf The buffer to write to - * \param len Maximum length of the buffer - * - * \return the number of bytes received, - * or a non-zero error code; with a non-blocking socket, - * MBEDTLS_ERR_SSL_WANT_READ indicates read() would block. - */ -int mbedtls_net_recv( void *ctx, unsigned char *buf, size_t len ); - -/** - * \brief Write at most 'len' characters. If no error occurs, - * the actual amount read is returned. - * - * \param ctx Socket - * \param buf The buffer to read from - * \param len The length of the buffer - * - * \return the number of bytes sent, - * or a non-zero error code; with a non-blocking socket, - * MBEDTLS_ERR_SSL_WANT_WRITE indicates write() would block. - */ -int mbedtls_net_send( void *ctx, const unsigned char *buf, size_t len ); - -/** - * \brief Read at most 'len' characters, blocking for at most - * 'timeout' seconds. If no error occurs, the actual amount - * read is returned. - * - * \param ctx Socket - * \param buf The buffer to write to - * \param len Maximum length of the buffer - * \param timeout Maximum number of milliseconds to wait for data - * 0 means no timeout (wait forever) - * - * \return the number of bytes received, - * or a non-zero error code: - * MBEDTLS_ERR_SSL_TIMEOUT if the operation timed out, - * MBEDTLS_ERR_SSL_WANT_READ if interrupted by a signal. - * - * \note This function will block (until data becomes available or - * timeout is reached) even if the socket is set to - * non-blocking. Handling timeouts with non-blocking reads - * requires a different strategy. - */ -int mbedtls_net_recv_timeout( void *ctx, unsigned char *buf, size_t len, - uint32_t timeout ); - -/** - * \brief Closes down the connection and free associated data - * - * \param ctx The context to close - */ -void mbedtls_net_close( mbedtls_net_context *ctx ); - -/** - * \brief Gracefully shutdown the connection and free associated data - * - * \param ctx The context to free - */ -void mbedtls_net_free( mbedtls_net_context *ctx ); - -#ifdef __cplusplus -} -#endif - -#endif /* net_sockets.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/nist_kw.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/nist_kw.h deleted file mode 100644 index b39406f44..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/nist_kw.h +++ /dev/null @@ -1,184 +0,0 @@ -/** - * \file nist_kw.h - * - * \brief This file provides an API for key wrapping (KW) and key wrapping with - * padding (KWP) as defined in NIST SP 800-38F. - * https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38F.pdf - * - * Key wrapping specifies a deterministic authenticated-encryption mode - * of operation, according to NIST SP 800-38F: Recommendation for - * Block Cipher Modes of Operation: Methods for Key Wrapping. Its - * purpose is to protect cryptographic keys. - * - * Its equivalent is RFC 3394 for KW, and RFC 5649 for KWP. - * https://tools.ietf.org/html/rfc3394 - * https://tools.ietf.org/html/rfc5649 - * - */ -/* - * Copyright (C) 2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_NIST_KW_H -#define MBEDTLS_NIST_KW_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/cipher.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum -{ - MBEDTLS_KW_MODE_KW = 0, - MBEDTLS_KW_MODE_KWP = 1 -} mbedtls_nist_kw_mode_t; - -#if !defined(MBEDTLS_NIST_KW_ALT) -// Regular implementation -// - -/** - * \brief The key wrapping context-type definition. The key wrapping context is passed - * to the APIs called. - * - * \note The definition of this type may change in future library versions. - * Don't make any assumptions on this context! - */ -typedef struct { - mbedtls_cipher_context_t cipher_ctx; /*!< The cipher context used. */ -} mbedtls_nist_kw_context; - -#else /* MBEDTLS_NIST_key wrapping_ALT */ -#include "nist_kw_alt.h" -#endif /* MBEDTLS_NIST_KW_ALT */ - -/** - * \brief This function initializes the specified key wrapping context - * to make references valid and prepare the context - * for mbedtls_nist_kw_setkey() or mbedtls_nist_kw_free(). - * - * \param ctx The key wrapping context to initialize. - * - */ -void mbedtls_nist_kw_init( mbedtls_nist_kw_context *ctx ); - -/** - * \brief This function initializes the key wrapping context set in the - * \p ctx parameter and sets the encryption key. - * - * \param ctx The key wrapping context. - * \param cipher The 128-bit block cipher to use. Only AES is supported. - * \param key The Key Encryption Key (KEK). - * \param keybits The KEK size in bits. This must be acceptable by the cipher. - * \param is_wrap Specify whether the operation within the context is wrapping or unwrapping - * - * \return \c 0 on success. - * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for any invalid input. - * \return \c MBEDTLS_ERR_CIPHER_FEATURE_UNAVAILABLE for 128-bit block ciphers - * which are not supported. - * \return cipher-specific error code on failure of the underlying cipher. - */ -int mbedtls_nist_kw_setkey( mbedtls_nist_kw_context *ctx, - mbedtls_cipher_id_t cipher, - const unsigned char *key, - unsigned int keybits, - const int is_wrap ); - -/** - * \brief This function releases and clears the specified key wrapping context - * and underlying cipher sub-context. - * - * \param ctx The key wrapping context to clear. - */ -void mbedtls_nist_kw_free( mbedtls_nist_kw_context *ctx ); - -/** - * \brief This function encrypts a buffer using key wrapping. - * - * \param ctx The key wrapping context to use for encryption. - * \param mode The key wrapping mode to use (MBEDTLS_KW_MODE_KW or MBEDTLS_KW_MODE_KWP) - * \param input The buffer holding the input data. - * \param in_len The length of the input data in Bytes. - * The input uses units of 8 Bytes called semiblocks. - *
  • For KW mode: a multiple of 8 bytes between 16 and 2^57-8 inclusive.
  • - *
  • For KWP mode: any length between 1 and 2^32-1 inclusive.
- * \param[out] output The buffer holding the output data. - *
  • For KW mode: Must be at least 8 bytes larger than \p in_len.
  • - *
  • For KWP mode: Must be at least 8 bytes larger rounded up to a multiple of - * 8 bytes for KWP (15 bytes at most).
- * \param[out] out_len The number of bytes written to the output buffer. \c 0 on failure. - * \param[in] out_size The capacity of the output buffer. - * - * \return \c 0 on success. - * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for invalid input length. - * \return cipher-specific error code on failure of the underlying cipher. - */ -int mbedtls_nist_kw_wrap( mbedtls_nist_kw_context *ctx, mbedtls_nist_kw_mode_t mode, - const unsigned char *input, size_t in_len, - unsigned char *output, size_t* out_len, size_t out_size ); - -/** - * \brief This function decrypts a buffer using key wrapping. - * - * \param ctx The key wrapping context to use for decryption. - * \param mode The key wrapping mode to use (MBEDTLS_KW_MODE_KW or MBEDTLS_KW_MODE_KWP) - * \param input The buffer holding the input data. - * \param in_len The length of the input data in Bytes. - * The input uses units of 8 Bytes called semiblocks. - * The input must be a multiple of semiblocks. - *
  • For KW mode: a multiple of 8 bytes between 24 and 2^57 inclusive.
  • - *
  • For KWP mode: a multiple of 8 bytes between 16 and 2^32 inclusive.
- * \param[out] output The buffer holding the output data. - * The output buffer's minimal length is 8 bytes shorter than \p in_len. - * \param[out] out_len The number of bytes written to the output buffer. \c 0 on failure. - * For KWP mode, the length could be up to 15 bytes shorter than \p in_len, - * depending on how much padding was added to the data. - * \param[in] out_size The capacity of the output buffer. - * - * \return \c 0 on success. - * \return \c MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA for invalid input length. - * \return \c MBEDTLS_ERR_CIPHER_AUTH_FAILED for verification failure of the ciphertext. - * \return cipher-specific error code on failure of the underlying cipher. - */ -int mbedtls_nist_kw_unwrap( mbedtls_nist_kw_context *ctx, mbedtls_nist_kw_mode_t mode, - const unsigned char *input, size_t in_len, - unsigned char *output, size_t* out_len, size_t out_size); - - -#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C) -/** - * \brief The key wrapping checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_nist_kw_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST && MBEDTLS_AES_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_NIST_KW_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/oid.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/oid.h deleted file mode 100644 index 59ce0206b..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/oid.h +++ /dev/null @@ -1,649 +0,0 @@ -/** - * \file oid.h - * - * \brief Object Identifier (OID) database - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_OID_H -#define MBEDTLS_OID_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/asn1.h" -#include "mbedtls/pk.h" - -#include - -#if defined(MBEDTLS_CIPHER_C) -#include "mbedtls/cipher.h" -#endif - -#if defined(MBEDTLS_MD_C) -#include "mbedtls/md.h" -#endif - -#define MBEDTLS_ERR_OID_NOT_FOUND -0x002E /**< OID is not found. */ -#define MBEDTLS_ERR_OID_BUF_TOO_SMALL -0x000B /**< output buffer is too small */ - -/* This is for the benefit of X.509, but defined here in order to avoid - * having a "backwards" include of x.509.h here */ -/* - * X.509 extension types (internal, arbitrary values for bitsets) - */ -#define MBEDTLS_OID_X509_EXT_AUTHORITY_KEY_IDENTIFIER (1 << 0) -#define MBEDTLS_OID_X509_EXT_SUBJECT_KEY_IDENTIFIER (1 << 1) -#define MBEDTLS_OID_X509_EXT_KEY_USAGE (1 << 2) -#define MBEDTLS_OID_X509_EXT_CERTIFICATE_POLICIES (1 << 3) -#define MBEDTLS_OID_X509_EXT_POLICY_MAPPINGS (1 << 4) -#define MBEDTLS_OID_X509_EXT_SUBJECT_ALT_NAME (1 << 5) -#define MBEDTLS_OID_X509_EXT_ISSUER_ALT_NAME (1 << 6) -#define MBEDTLS_OID_X509_EXT_SUBJECT_DIRECTORY_ATTRS (1 << 7) -#define MBEDTLS_OID_X509_EXT_BASIC_CONSTRAINTS (1 << 8) -#define MBEDTLS_OID_X509_EXT_NAME_CONSTRAINTS (1 << 9) -#define MBEDTLS_OID_X509_EXT_POLICY_CONSTRAINTS (1 << 10) -#define MBEDTLS_OID_X509_EXT_EXTENDED_KEY_USAGE (1 << 11) -#define MBEDTLS_OID_X509_EXT_CRL_DISTRIBUTION_POINTS (1 << 12) -#define MBEDTLS_OID_X509_EXT_INIHIBIT_ANYPOLICY (1 << 13) -#define MBEDTLS_OID_X509_EXT_FRESHEST_CRL (1 << 14) -#define MBEDTLS_OID_X509_EXT_NS_CERT_TYPE (1 << 16) - -/* - * Top level OID tuples - */ -#define MBEDTLS_OID_ISO_MEMBER_BODIES "\x2a" /* {iso(1) member-body(2)} */ -#define MBEDTLS_OID_ISO_IDENTIFIED_ORG "\x2b" /* {iso(1) identified-organization(3)} */ -#define MBEDTLS_OID_ISO_CCITT_DS "\x55" /* {joint-iso-ccitt(2) ds(5)} */ -#define MBEDTLS_OID_ISO_ITU_COUNTRY "\x60" /* {joint-iso-itu-t(2) country(16)} */ - -/* - * ISO Member bodies OID parts - */ -#define MBEDTLS_OID_COUNTRY_US "\x86\x48" /* {us(840)} */ -#define MBEDTLS_OID_ORG_RSA_DATA_SECURITY "\x86\xf7\x0d" /* {rsadsi(113549)} */ -#define MBEDTLS_OID_RSA_COMPANY MBEDTLS_OID_ISO_MEMBER_BODIES MBEDTLS_OID_COUNTRY_US \ - MBEDTLS_OID_ORG_RSA_DATA_SECURITY /* {iso(1) member-body(2) us(840) rsadsi(113549)} */ -#define MBEDTLS_OID_ORG_ANSI_X9_62 "\xce\x3d" /* ansi-X9-62(10045) */ -#define MBEDTLS_OID_ANSI_X9_62 MBEDTLS_OID_ISO_MEMBER_BODIES MBEDTLS_OID_COUNTRY_US \ - MBEDTLS_OID_ORG_ANSI_X9_62 - -/* - * ISO Identified organization OID parts - */ -#define MBEDTLS_OID_ORG_DOD "\x06" /* {dod(6)} */ -#define MBEDTLS_OID_ORG_OIW "\x0e" -#define MBEDTLS_OID_OIW_SECSIG MBEDTLS_OID_ORG_OIW "\x03" -#define MBEDTLS_OID_OIW_SECSIG_ALG MBEDTLS_OID_OIW_SECSIG "\x02" -#define MBEDTLS_OID_OIW_SECSIG_SHA1 MBEDTLS_OID_OIW_SECSIG_ALG "\x1a" -#define MBEDTLS_OID_ORG_CERTICOM "\x81\x04" /* certicom(132) */ -#define MBEDTLS_OID_CERTICOM MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ORG_CERTICOM -#define MBEDTLS_OID_ORG_TELETRUST "\x24" /* teletrust(36) */ -#define MBEDTLS_OID_TELETRUST MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ORG_TELETRUST - -/* - * ISO ITU OID parts - */ -#define MBEDTLS_OID_ORGANIZATION "\x01" /* {organization(1)} */ -#define MBEDTLS_OID_ISO_ITU_US_ORG MBEDTLS_OID_ISO_ITU_COUNTRY MBEDTLS_OID_COUNTRY_US MBEDTLS_OID_ORGANIZATION /* {joint-iso-itu-t(2) country(16) us(840) organization(1)} */ - -#define MBEDTLS_OID_ORG_GOV "\x65" /* {gov(101)} */ -#define MBEDTLS_OID_GOV MBEDTLS_OID_ISO_ITU_US_ORG MBEDTLS_OID_ORG_GOV /* {joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101)} */ - -#define MBEDTLS_OID_ORG_NETSCAPE "\x86\xF8\x42" /* {netscape(113730)} */ -#define MBEDTLS_OID_NETSCAPE MBEDTLS_OID_ISO_ITU_US_ORG MBEDTLS_OID_ORG_NETSCAPE /* Netscape OID {joint-iso-itu-t(2) country(16) us(840) organization(1) netscape(113730)} */ - -/* ISO arc for standard certificate and CRL extensions */ -#define MBEDTLS_OID_ID_CE MBEDTLS_OID_ISO_CCITT_DS "\x1D" /**< id-ce OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 29} */ - -#define MBEDTLS_OID_NIST_ALG MBEDTLS_OID_GOV "\x03\x04" /** { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) */ - -/** - * Private Internet Extensions - * { iso(1) identified-organization(3) dod(6) internet(1) - * security(5) mechanisms(5) pkix(7) } - */ -#define MBEDTLS_OID_INTERNET MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_ORG_DOD "\x01" -#define MBEDTLS_OID_PKIX MBEDTLS_OID_INTERNET "\x05\x05\x07" - -/* - * Arc for standard naming attributes - */ -#define MBEDTLS_OID_AT MBEDTLS_OID_ISO_CCITT_DS "\x04" /**< id-at OBJECT IDENTIFIER ::= {joint-iso-ccitt(2) ds(5) 4} */ -#define MBEDTLS_OID_AT_CN MBEDTLS_OID_AT "\x03" /**< id-at-commonName AttributeType:= {id-at 3} */ -#define MBEDTLS_OID_AT_SUR_NAME MBEDTLS_OID_AT "\x04" /**< id-at-surName AttributeType:= {id-at 4} */ -#define MBEDTLS_OID_AT_SERIAL_NUMBER MBEDTLS_OID_AT "\x05" /**< id-at-serialNumber AttributeType:= {id-at 5} */ -#define MBEDTLS_OID_AT_COUNTRY MBEDTLS_OID_AT "\x06" /**< id-at-countryName AttributeType:= {id-at 6} */ -#define MBEDTLS_OID_AT_LOCALITY MBEDTLS_OID_AT "\x07" /**< id-at-locality AttributeType:= {id-at 7} */ -#define MBEDTLS_OID_AT_STATE MBEDTLS_OID_AT "\x08" /**< id-at-state AttributeType:= {id-at 8} */ -#define MBEDTLS_OID_AT_ORGANIZATION MBEDTLS_OID_AT "\x0A" /**< id-at-organizationName AttributeType:= {id-at 10} */ -#define MBEDTLS_OID_AT_ORG_UNIT MBEDTLS_OID_AT "\x0B" /**< id-at-organizationalUnitName AttributeType:= {id-at 11} */ -#define MBEDTLS_OID_AT_TITLE MBEDTLS_OID_AT "\x0C" /**< id-at-title AttributeType:= {id-at 12} */ -#define MBEDTLS_OID_AT_POSTAL_ADDRESS MBEDTLS_OID_AT "\x10" /**< id-at-postalAddress AttributeType:= {id-at 16} */ -#define MBEDTLS_OID_AT_POSTAL_CODE MBEDTLS_OID_AT "\x11" /**< id-at-postalCode AttributeType:= {id-at 17} */ -#define MBEDTLS_OID_AT_GIVEN_NAME MBEDTLS_OID_AT "\x2A" /**< id-at-givenName AttributeType:= {id-at 42} */ -#define MBEDTLS_OID_AT_INITIALS MBEDTLS_OID_AT "\x2B" /**< id-at-initials AttributeType:= {id-at 43} */ -#define MBEDTLS_OID_AT_GENERATION_QUALIFIER MBEDTLS_OID_AT "\x2C" /**< id-at-generationQualifier AttributeType:= {id-at 44} */ -#define MBEDTLS_OID_AT_UNIQUE_IDENTIFIER MBEDTLS_OID_AT "\x2D" /**< id-at-uniqueIdentifier AttributType:= {id-at 45} */ -#define MBEDTLS_OID_AT_DN_QUALIFIER MBEDTLS_OID_AT "\x2E" /**< id-at-dnQualifier AttributeType:= {id-at 46} */ -#define MBEDTLS_OID_AT_PSEUDONYM MBEDTLS_OID_AT "\x41" /**< id-at-pseudonym AttributeType:= {id-at 65} */ - -#define MBEDTLS_OID_DOMAIN_COMPONENT "\x09\x92\x26\x89\x93\xF2\x2C\x64\x01\x19" /** id-domainComponent AttributeType:= {itu-t(0) data(9) pss(2342) ucl(19200300) pilot(100) pilotAttributeType(1) domainComponent(25)} */ - -/* - * OIDs for standard certificate extensions - */ -#define MBEDTLS_OID_AUTHORITY_KEY_IDENTIFIER MBEDTLS_OID_ID_CE "\x23" /**< id-ce-authorityKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 35 } */ -#define MBEDTLS_OID_SUBJECT_KEY_IDENTIFIER MBEDTLS_OID_ID_CE "\x0E" /**< id-ce-subjectKeyIdentifier OBJECT IDENTIFIER ::= { id-ce 14 } */ -#define MBEDTLS_OID_KEY_USAGE MBEDTLS_OID_ID_CE "\x0F" /**< id-ce-keyUsage OBJECT IDENTIFIER ::= { id-ce 15 } */ -#define MBEDTLS_OID_CERTIFICATE_POLICIES MBEDTLS_OID_ID_CE "\x20" /**< id-ce-certificatePolicies OBJECT IDENTIFIER ::= { id-ce 32 } */ -#define MBEDTLS_OID_POLICY_MAPPINGS MBEDTLS_OID_ID_CE "\x21" /**< id-ce-policyMappings OBJECT IDENTIFIER ::= { id-ce 33 } */ -#define MBEDTLS_OID_SUBJECT_ALT_NAME MBEDTLS_OID_ID_CE "\x11" /**< id-ce-subjectAltName OBJECT IDENTIFIER ::= { id-ce 17 } */ -#define MBEDTLS_OID_ISSUER_ALT_NAME MBEDTLS_OID_ID_CE "\x12" /**< id-ce-issuerAltName OBJECT IDENTIFIER ::= { id-ce 18 } */ -#define MBEDTLS_OID_SUBJECT_DIRECTORY_ATTRS MBEDTLS_OID_ID_CE "\x09" /**< id-ce-subjectDirectoryAttributes OBJECT IDENTIFIER ::= { id-ce 9 } */ -#define MBEDTLS_OID_BASIC_CONSTRAINTS MBEDTLS_OID_ID_CE "\x13" /**< id-ce-basicConstraints OBJECT IDENTIFIER ::= { id-ce 19 } */ -#define MBEDTLS_OID_NAME_CONSTRAINTS MBEDTLS_OID_ID_CE "\x1E" /**< id-ce-nameConstraints OBJECT IDENTIFIER ::= { id-ce 30 } */ -#define MBEDTLS_OID_POLICY_CONSTRAINTS MBEDTLS_OID_ID_CE "\x24" /**< id-ce-policyConstraints OBJECT IDENTIFIER ::= { id-ce 36 } */ -#define MBEDTLS_OID_EXTENDED_KEY_USAGE MBEDTLS_OID_ID_CE "\x25" /**< id-ce-extKeyUsage OBJECT IDENTIFIER ::= { id-ce 37 } */ -#define MBEDTLS_OID_CRL_DISTRIBUTION_POINTS MBEDTLS_OID_ID_CE "\x1F" /**< id-ce-cRLDistributionPoints OBJECT IDENTIFIER ::= { id-ce 31 } */ -#define MBEDTLS_OID_INIHIBIT_ANYPOLICY MBEDTLS_OID_ID_CE "\x36" /**< id-ce-inhibitAnyPolicy OBJECT IDENTIFIER ::= { id-ce 54 } */ -#define MBEDTLS_OID_FRESHEST_CRL MBEDTLS_OID_ID_CE "\x2E" /**< id-ce-freshestCRL OBJECT IDENTIFIER ::= { id-ce 46 } */ - -/* - * Certificate policies - */ -#define MBEDTLS_OID_ANY_POLICY MBEDTLS_OID_CERTIFICATE_POLICIES "\x00" /**< anyPolicy OBJECT IDENTIFIER ::= { id-ce-certificatePolicies 0 } */ - -/* - * Netscape certificate extensions - */ -#define MBEDTLS_OID_NS_CERT MBEDTLS_OID_NETSCAPE "\x01" -#define MBEDTLS_OID_NS_CERT_TYPE MBEDTLS_OID_NS_CERT "\x01" -#define MBEDTLS_OID_NS_BASE_URL MBEDTLS_OID_NS_CERT "\x02" -#define MBEDTLS_OID_NS_REVOCATION_URL MBEDTLS_OID_NS_CERT "\x03" -#define MBEDTLS_OID_NS_CA_REVOCATION_URL MBEDTLS_OID_NS_CERT "\x04" -#define MBEDTLS_OID_NS_RENEWAL_URL MBEDTLS_OID_NS_CERT "\x07" -#define MBEDTLS_OID_NS_CA_POLICY_URL MBEDTLS_OID_NS_CERT "\x08" -#define MBEDTLS_OID_NS_SSL_SERVER_NAME MBEDTLS_OID_NS_CERT "\x0C" -#define MBEDTLS_OID_NS_COMMENT MBEDTLS_OID_NS_CERT "\x0D" -#define MBEDTLS_OID_NS_DATA_TYPE MBEDTLS_OID_NETSCAPE "\x02" -#define MBEDTLS_OID_NS_CERT_SEQUENCE MBEDTLS_OID_NS_DATA_TYPE "\x05" - -/* - * OIDs for CRL extensions - */ -#define MBEDTLS_OID_PRIVATE_KEY_USAGE_PERIOD MBEDTLS_OID_ID_CE "\x10" -#define MBEDTLS_OID_CRL_NUMBER MBEDTLS_OID_ID_CE "\x14" /**< id-ce-cRLNumber OBJECT IDENTIFIER ::= { id-ce 20 } */ - -/* - * X.509 v3 Extended key usage OIDs - */ -#define MBEDTLS_OID_ANY_EXTENDED_KEY_USAGE MBEDTLS_OID_EXTENDED_KEY_USAGE "\x00" /**< anyExtendedKeyUsage OBJECT IDENTIFIER ::= { id-ce-extKeyUsage 0 } */ - -#define MBEDTLS_OID_KP MBEDTLS_OID_PKIX "\x03" /**< id-kp OBJECT IDENTIFIER ::= { id-pkix 3 } */ -#define MBEDTLS_OID_SERVER_AUTH MBEDTLS_OID_KP "\x01" /**< id-kp-serverAuth OBJECT IDENTIFIER ::= { id-kp 1 } */ -#define MBEDTLS_OID_CLIENT_AUTH MBEDTLS_OID_KP "\x02" /**< id-kp-clientAuth OBJECT IDENTIFIER ::= { id-kp 2 } */ -#define MBEDTLS_OID_CODE_SIGNING MBEDTLS_OID_KP "\x03" /**< id-kp-codeSigning OBJECT IDENTIFIER ::= { id-kp 3 } */ -#define MBEDTLS_OID_EMAIL_PROTECTION MBEDTLS_OID_KP "\x04" /**< id-kp-emailProtection OBJECT IDENTIFIER ::= { id-kp 4 } */ -#define MBEDTLS_OID_TIME_STAMPING MBEDTLS_OID_KP "\x08" /**< id-kp-timeStamping OBJECT IDENTIFIER ::= { id-kp 8 } */ -#define MBEDTLS_OID_OCSP_SIGNING MBEDTLS_OID_KP "\x09" /**< id-kp-OCSPSigning OBJECT IDENTIFIER ::= { id-kp 9 } */ - -/** - * Wi-SUN Alliance Field Area Network - * { iso(1) identified-organization(3) dod(6) internet(1) - * private(4) enterprise(1) WiSUN(45605) FieldAreaNetwork(1) } - */ -#define MBEDTLS_OID_WISUN_FAN MBEDTLS_OID_INTERNET "\x04\x01\x82\xe4\x25\x01" - -#define MBEDTLS_OID_ON MBEDTLS_OID_PKIX "\x08" /**< id-on OBJECT IDENTIFIER ::= { id-pkix 8 } */ -#define MBEDTLS_OID_ON_HW_MODULE_NAME MBEDTLS_OID_ON "\x04" /**< id-on-hardwareModuleName OBJECT IDENTIFIER ::= { id-on 4 } */ - -/* - * PKCS definition OIDs - */ - -#define MBEDTLS_OID_PKCS MBEDTLS_OID_RSA_COMPANY "\x01" /**< pkcs OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) 1 } */ -#define MBEDTLS_OID_PKCS1 MBEDTLS_OID_PKCS "\x01" /**< pkcs-1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 1 } */ -#define MBEDTLS_OID_PKCS5 MBEDTLS_OID_PKCS "\x05" /**< pkcs-5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 5 } */ -#define MBEDTLS_OID_PKCS9 MBEDTLS_OID_PKCS "\x09" /**< pkcs-9 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 9 } */ -#define MBEDTLS_OID_PKCS12 MBEDTLS_OID_PKCS "\x0c" /**< pkcs-12 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) 12 } */ - -/* - * PKCS#1 OIDs - */ -#define MBEDTLS_OID_PKCS1_RSA MBEDTLS_OID_PKCS1 "\x01" /**< rsaEncryption OBJECT IDENTIFIER ::= { pkcs-1 1 } */ -#define MBEDTLS_OID_PKCS1_MD2 MBEDTLS_OID_PKCS1 "\x02" /**< md2WithRSAEncryption ::= { pkcs-1 2 } */ -#define MBEDTLS_OID_PKCS1_MD4 MBEDTLS_OID_PKCS1 "\x03" /**< md4WithRSAEncryption ::= { pkcs-1 3 } */ -#define MBEDTLS_OID_PKCS1_MD5 MBEDTLS_OID_PKCS1 "\x04" /**< md5WithRSAEncryption ::= { pkcs-1 4 } */ -#define MBEDTLS_OID_PKCS1_SHA1 MBEDTLS_OID_PKCS1 "\x05" /**< sha1WithRSAEncryption ::= { pkcs-1 5 } */ -#define MBEDTLS_OID_PKCS1_SHA224 MBEDTLS_OID_PKCS1 "\x0e" /**< sha224WithRSAEncryption ::= { pkcs-1 14 } */ -#define MBEDTLS_OID_PKCS1_SHA256 MBEDTLS_OID_PKCS1 "\x0b" /**< sha256WithRSAEncryption ::= { pkcs-1 11 } */ -#define MBEDTLS_OID_PKCS1_SHA384 MBEDTLS_OID_PKCS1 "\x0c" /**< sha384WithRSAEncryption ::= { pkcs-1 12 } */ -#define MBEDTLS_OID_PKCS1_SHA512 MBEDTLS_OID_PKCS1 "\x0d" /**< sha512WithRSAEncryption ::= { pkcs-1 13 } */ - -#define MBEDTLS_OID_RSA_SHA_OBS "\x2B\x0E\x03\x02\x1D" - -#define MBEDTLS_OID_PKCS9_EMAIL MBEDTLS_OID_PKCS9 "\x01" /**< emailAddress AttributeType ::= { pkcs-9 1 } */ - -/* RFC 4055 */ -#define MBEDTLS_OID_RSASSA_PSS MBEDTLS_OID_PKCS1 "\x0a" /**< id-RSASSA-PSS ::= { pkcs-1 10 } */ -#define MBEDTLS_OID_MGF1 MBEDTLS_OID_PKCS1 "\x08" /**< id-mgf1 ::= { pkcs-1 8 } */ - -/* - * Digest algorithms - */ -#define MBEDTLS_OID_DIGEST_ALG_MD2 MBEDTLS_OID_RSA_COMPANY "\x02\x02" /**< id-mbedtls_md2 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 2 } */ -#define MBEDTLS_OID_DIGEST_ALG_MD4 MBEDTLS_OID_RSA_COMPANY "\x02\x04" /**< id-mbedtls_md4 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 4 } */ -#define MBEDTLS_OID_DIGEST_ALG_MD5 MBEDTLS_OID_RSA_COMPANY "\x02\x05" /**< id-mbedtls_md5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 5 } */ -#define MBEDTLS_OID_DIGEST_ALG_SHA1 MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_OIW_SECSIG_SHA1 /**< id-mbedtls_sha1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 26 } */ -#define MBEDTLS_OID_DIGEST_ALG_SHA224 MBEDTLS_OID_NIST_ALG "\x02\x04" /**< id-sha224 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 4 } */ -#define MBEDTLS_OID_DIGEST_ALG_SHA256 MBEDTLS_OID_NIST_ALG "\x02\x01" /**< id-mbedtls_sha256 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 1 } */ - -#define MBEDTLS_OID_DIGEST_ALG_SHA384 MBEDTLS_OID_NIST_ALG "\x02\x02" /**< id-sha384 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 2 } */ - -#define MBEDTLS_OID_DIGEST_ALG_SHA512 MBEDTLS_OID_NIST_ALG "\x02\x03" /**< id-mbedtls_sha512 OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistalgorithm(4) hashalgs(2) 3 } */ - -#define MBEDTLS_OID_DIGEST_ALG_RIPEMD160 MBEDTLS_OID_TELETRUST "\x03\x02\x01" /**< id-ripemd160 OBJECT IDENTIFIER :: { iso(1) identified-organization(3) teletrust(36) algorithm(3) hashAlgorithm(2) ripemd160(1) } */ - -#define MBEDTLS_OID_HMAC_SHA1 MBEDTLS_OID_RSA_COMPANY "\x02\x07" /**< id-hmacWithSHA1 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 7 } */ - -#define MBEDTLS_OID_HMAC_SHA224 MBEDTLS_OID_RSA_COMPANY "\x02\x08" /**< id-hmacWithSHA224 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 8 } */ - -#define MBEDTLS_OID_HMAC_SHA256 MBEDTLS_OID_RSA_COMPANY "\x02\x09" /**< id-hmacWithSHA256 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 9 } */ - -#define MBEDTLS_OID_HMAC_SHA384 MBEDTLS_OID_RSA_COMPANY "\x02\x0A" /**< id-hmacWithSHA384 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 10 } */ - -#define MBEDTLS_OID_HMAC_SHA512 MBEDTLS_OID_RSA_COMPANY "\x02\x0B" /**< id-hmacWithSHA512 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2) 11 } */ - -/* - * Encryption algorithms - */ -#define MBEDTLS_OID_DES_CBC MBEDTLS_OID_ISO_IDENTIFIED_ORG MBEDTLS_OID_OIW_SECSIG_ALG "\x07" /**< desCBC OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2) 7 } */ -#define MBEDTLS_OID_DES_EDE3_CBC MBEDTLS_OID_RSA_COMPANY "\x03\x07" /**< des-ede3-cbc OBJECT IDENTIFIER ::= { iso(1) member-body(2) -- us(840) rsadsi(113549) encryptionAlgorithm(3) 7 } */ -#define MBEDTLS_OID_AES MBEDTLS_OID_NIST_ALG "\x01" /** aes OBJECT IDENTIFIER ::= { joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) 1 } */ - -/* - * Key Wrapping algorithms - */ -/* - * RFC 5649 - */ -#define MBEDTLS_OID_AES128_KW MBEDTLS_OID_AES "\x05" /** id-aes128-wrap OBJECT IDENTIFIER ::= { aes 5 } */ -#define MBEDTLS_OID_AES128_KWP MBEDTLS_OID_AES "\x08" /** id-aes128-wrap-pad OBJECT IDENTIFIER ::= { aes 8 } */ -#define MBEDTLS_OID_AES192_KW MBEDTLS_OID_AES "\x19" /** id-aes192-wrap OBJECT IDENTIFIER ::= { aes 25 } */ -#define MBEDTLS_OID_AES192_KWP MBEDTLS_OID_AES "\x1c" /** id-aes192-wrap-pad OBJECT IDENTIFIER ::= { aes 28 } */ -#define MBEDTLS_OID_AES256_KW MBEDTLS_OID_AES "\x2d" /** id-aes256-wrap OBJECT IDENTIFIER ::= { aes 45 } */ -#define MBEDTLS_OID_AES256_KWP MBEDTLS_OID_AES "\x30" /** id-aes256-wrap-pad OBJECT IDENTIFIER ::= { aes 48 } */ -/* - * PKCS#5 OIDs - */ -#define MBEDTLS_OID_PKCS5_PBKDF2 MBEDTLS_OID_PKCS5 "\x0c" /**< id-PBKDF2 OBJECT IDENTIFIER ::= {pkcs-5 12} */ -#define MBEDTLS_OID_PKCS5_PBES2 MBEDTLS_OID_PKCS5 "\x0d" /**< id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13} */ -#define MBEDTLS_OID_PKCS5_PBMAC1 MBEDTLS_OID_PKCS5 "\x0e" /**< id-PBMAC1 OBJECT IDENTIFIER ::= {pkcs-5 14} */ - -/* - * PKCS#5 PBES1 algorithms - */ -#define MBEDTLS_OID_PKCS5_PBE_MD2_DES_CBC MBEDTLS_OID_PKCS5 "\x01" /**< pbeWithMD2AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 1} */ -#define MBEDTLS_OID_PKCS5_PBE_MD2_RC2_CBC MBEDTLS_OID_PKCS5 "\x04" /**< pbeWithMD2AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 4} */ -#define MBEDTLS_OID_PKCS5_PBE_MD5_DES_CBC MBEDTLS_OID_PKCS5 "\x03" /**< pbeWithMD5AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 3} */ -#define MBEDTLS_OID_PKCS5_PBE_MD5_RC2_CBC MBEDTLS_OID_PKCS5 "\x06" /**< pbeWithMD5AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 6} */ -#define MBEDTLS_OID_PKCS5_PBE_SHA1_DES_CBC MBEDTLS_OID_PKCS5 "\x0a" /**< pbeWithSHA1AndDES-CBC OBJECT IDENTIFIER ::= {pkcs-5 10} */ -#define MBEDTLS_OID_PKCS5_PBE_SHA1_RC2_CBC MBEDTLS_OID_PKCS5 "\x0b" /**< pbeWithSHA1AndRC2-CBC OBJECT IDENTIFIER ::= {pkcs-5 11} */ - -/* - * PKCS#8 OIDs - */ -#define MBEDTLS_OID_PKCS9_CSR_EXT_REQ MBEDTLS_OID_PKCS9 "\x0e" /**< extensionRequest OBJECT IDENTIFIER ::= {pkcs-9 14} */ - -/* - * PKCS#12 PBE OIDs - */ -#define MBEDTLS_OID_PKCS12_PBE MBEDTLS_OID_PKCS12 "\x01" /**< pkcs-12PbeIds OBJECT IDENTIFIER ::= {pkcs-12 1} */ - -#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_128 MBEDTLS_OID_PKCS12_PBE "\x01" /**< pbeWithSHAAnd128BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 1} */ -#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC4_40 MBEDTLS_OID_PKCS12_PBE "\x02" /**< pbeWithSHAAnd40BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 2} */ -#define MBEDTLS_OID_PKCS12_PBE_SHA1_DES3_EDE_CBC MBEDTLS_OID_PKCS12_PBE "\x03" /**< pbeWithSHAAnd3-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 3} */ -#define MBEDTLS_OID_PKCS12_PBE_SHA1_DES2_EDE_CBC MBEDTLS_OID_PKCS12_PBE "\x04" /**< pbeWithSHAAnd2-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 4} */ -#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_128_CBC MBEDTLS_OID_PKCS12_PBE "\x05" /**< pbeWithSHAAnd128BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 5} */ -#define MBEDTLS_OID_PKCS12_PBE_SHA1_RC2_40_CBC MBEDTLS_OID_PKCS12_PBE "\x06" /**< pbeWithSHAAnd40BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 6} */ - -/* - * EC key algorithms from RFC 5480 - */ - -/* id-ecPublicKey OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) keyType(2) 1 } */ -#define MBEDTLS_OID_EC_ALG_UNRESTRICTED MBEDTLS_OID_ANSI_X9_62 "\x02\01" - -/* id-ecDH OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) - * schemes(1) ecdh(12) } */ -#define MBEDTLS_OID_EC_ALG_ECDH MBEDTLS_OID_CERTICOM "\x01\x0c" - -/* - * ECParameters namedCurve identifiers, from RFC 5480, RFC 5639, and SEC2 - */ - -/* secp192r1 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) prime(1) 1 } */ -#define MBEDTLS_OID_EC_GRP_SECP192R1 MBEDTLS_OID_ANSI_X9_62 "\x03\x01\x01" - -/* secp224r1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 33 } */ -#define MBEDTLS_OID_EC_GRP_SECP224R1 MBEDTLS_OID_CERTICOM "\x00\x21" - -/* secp256r1 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) curves(3) prime(1) 7 } */ -#define MBEDTLS_OID_EC_GRP_SECP256R1 MBEDTLS_OID_ANSI_X9_62 "\x03\x01\x07" - -/* secp384r1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 34 } */ -#define MBEDTLS_OID_EC_GRP_SECP384R1 MBEDTLS_OID_CERTICOM "\x00\x22" - -/* secp521r1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 35 } */ -#define MBEDTLS_OID_EC_GRP_SECP521R1 MBEDTLS_OID_CERTICOM "\x00\x23" - -/* secp192k1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 31 } */ -#define MBEDTLS_OID_EC_GRP_SECP192K1 MBEDTLS_OID_CERTICOM "\x00\x1f" - -/* secp224k1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 32 } */ -#define MBEDTLS_OID_EC_GRP_SECP224K1 MBEDTLS_OID_CERTICOM "\x00\x20" - -/* secp256k1 OBJECT IDENTIFIER ::= { - * iso(1) identified-organization(3) certicom(132) curve(0) 10 } */ -#define MBEDTLS_OID_EC_GRP_SECP256K1 MBEDTLS_OID_CERTICOM "\x00\x0a" - -/* RFC 5639 4.1 - * ecStdCurvesAndGeneration OBJECT IDENTIFIER::= {iso(1) - * identified-organization(3) teletrust(36) algorithm(3) signature- - * algorithm(3) ecSign(2) 8} - * ellipticCurve OBJECT IDENTIFIER ::= {ecStdCurvesAndGeneration 1} - * versionOne OBJECT IDENTIFIER ::= {ellipticCurve 1} */ -#define MBEDTLS_OID_EC_BRAINPOOL_V1 MBEDTLS_OID_TELETRUST "\x03\x03\x02\x08\x01\x01" - -/* brainpoolP256r1 OBJECT IDENTIFIER ::= {versionOne 7} */ -#define MBEDTLS_OID_EC_GRP_BP256R1 MBEDTLS_OID_EC_BRAINPOOL_V1 "\x07" - -/* brainpoolP384r1 OBJECT IDENTIFIER ::= {versionOne 11} */ -#define MBEDTLS_OID_EC_GRP_BP384R1 MBEDTLS_OID_EC_BRAINPOOL_V1 "\x0B" - -/* brainpoolP512r1 OBJECT IDENTIFIER ::= {versionOne 13} */ -#define MBEDTLS_OID_EC_GRP_BP512R1 MBEDTLS_OID_EC_BRAINPOOL_V1 "\x0D" - -/* - * SEC1 C.1 - * - * prime-field OBJECT IDENTIFIER ::= { id-fieldType 1 } - * id-fieldType OBJECT IDENTIFIER ::= { ansi-X9-62 fieldType(1)} - */ -#define MBEDTLS_OID_ANSI_X9_62_FIELD_TYPE MBEDTLS_OID_ANSI_X9_62 "\x01" -#define MBEDTLS_OID_ANSI_X9_62_PRIME_FIELD MBEDTLS_OID_ANSI_X9_62_FIELD_TYPE "\x01" - -/* - * ECDSA signature identifiers, from RFC 5480 - */ -#define MBEDTLS_OID_ANSI_X9_62_SIG MBEDTLS_OID_ANSI_X9_62 "\x04" /* signatures(4) */ -#define MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 MBEDTLS_OID_ANSI_X9_62_SIG "\x03" /* ecdsa-with-SHA2(3) */ - -/* ecdsa-with-SHA1 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) 1 } */ -#define MBEDTLS_OID_ECDSA_SHA1 MBEDTLS_OID_ANSI_X9_62_SIG "\x01" - -/* ecdsa-with-SHA224 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) - * ecdsa-with-SHA2(3) 1 } */ -#define MBEDTLS_OID_ECDSA_SHA224 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x01" - -/* ecdsa-with-SHA256 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) - * ecdsa-with-SHA2(3) 2 } */ -#define MBEDTLS_OID_ECDSA_SHA256 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x02" - -/* ecdsa-with-SHA384 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) - * ecdsa-with-SHA2(3) 3 } */ -#define MBEDTLS_OID_ECDSA_SHA384 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x03" - -/* ecdsa-with-SHA512 OBJECT IDENTIFIER ::= { - * iso(1) member-body(2) us(840) ansi-X9-62(10045) signatures(4) - * ecdsa-with-SHA2(3) 4 } */ -#define MBEDTLS_OID_ECDSA_SHA512 MBEDTLS_OID_ANSI_X9_62_SIG_SHA2 "\x04" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Base OID descriptor structure - */ -typedef struct mbedtls_oid_descriptor_t -{ - const char *asn1; /*!< OID ASN.1 representation */ - size_t asn1_len; /*!< length of asn1 */ - const char *name; /*!< official name (e.g. from RFC) */ - const char *description; /*!< human friendly description */ -} mbedtls_oid_descriptor_t; - -/** - * \brief Translate an ASN.1 OID into its numeric representation - * (e.g. "\x2A\x86\x48\x86\xF7\x0D" into "1.2.840.113549") - * - * \param buf buffer to put representation in - * \param size size of the buffer - * \param oid OID to translate - * - * \return Length of the string written (excluding final NULL) or - * MBEDTLS_ERR_OID_BUF_TOO_SMALL in case of error - */ -int mbedtls_oid_get_numeric_string( char *buf, size_t size, const mbedtls_asn1_buf *oid ); - -/** - * \brief Translate an X.509 extension OID into local values - * - * \param oid OID to use - * \param ext_type place to store the extension type - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_x509_ext_type( const mbedtls_asn1_buf *oid, int *ext_type ); - -/** - * \brief Translate an X.509 attribute type OID into the short name - * (e.g. the OID for an X520 Common Name into "CN") - * - * \param oid OID to use - * \param short_name place to store the string pointer - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_attr_short_name( const mbedtls_asn1_buf *oid, const char **short_name ); - -/** - * \brief Translate PublicKeyAlgorithm OID into pk_type - * - * \param oid OID to use - * \param pk_alg place to store public key algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_pk_alg( const mbedtls_asn1_buf *oid, mbedtls_pk_type_t *pk_alg ); - -/** - * \brief Translate pk_type into PublicKeyAlgorithm OID - * - * \param pk_alg Public key type to look for - * \param oid place to store ASN.1 OID string pointer - * \param olen length of the OID - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_oid_by_pk_alg( mbedtls_pk_type_t pk_alg, - const char **oid, size_t *olen ); - -#if defined(MBEDTLS_ECP_C) -/** - * \brief Translate NamedCurve OID into an EC group identifier - * - * \param oid OID to use - * \param grp_id place to store group id - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_ec_grp( const mbedtls_asn1_buf *oid, mbedtls_ecp_group_id *grp_id ); - -/** - * \brief Translate EC group identifier into NamedCurve OID - * - * \param grp_id EC group identifier - * \param oid place to store ASN.1 OID string pointer - * \param olen length of the OID - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_oid_by_ec_grp( mbedtls_ecp_group_id grp_id, - const char **oid, size_t *olen ); -#endif /* MBEDTLS_ECP_C */ - -#if defined(MBEDTLS_MD_C) -/** - * \brief Translate SignatureAlgorithm OID into md_type and pk_type - * - * \param oid OID to use - * \param md_alg place to store message digest algorithm - * \param pk_alg place to store public key algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_sig_alg( const mbedtls_asn1_buf *oid, - mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg ); - -/** - * \brief Translate SignatureAlgorithm OID into description - * - * \param oid OID to use - * \param desc place to store string pointer - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_sig_alg_desc( const mbedtls_asn1_buf *oid, const char **desc ); - -/** - * \brief Translate md_type and pk_type into SignatureAlgorithm OID - * - * \param md_alg message digest algorithm - * \param pk_alg public key algorithm - * \param oid place to store ASN.1 OID string pointer - * \param olen length of the OID - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_oid_by_sig_alg( mbedtls_pk_type_t pk_alg, mbedtls_md_type_t md_alg, - const char **oid, size_t *olen ); - -/** - * \brief Translate hash algorithm OID into md_type - * - * \param oid OID to use - * \param md_alg place to store message digest algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_md_alg( const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_alg ); - -/** - * \brief Translate hmac algorithm OID into md_type - * - * \param oid OID to use - * \param md_hmac place to store message hmac algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_md_hmac( const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_hmac ); -#endif /* MBEDTLS_MD_C */ - -/** - * \brief Translate Extended Key Usage OID into description - * - * \param oid OID to use - * \param desc place to store string pointer - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_extended_key_usage( const mbedtls_asn1_buf *oid, const char **desc ); - -/** - * \brief Translate certificate policies OID into description - * - * \param oid OID to use - * \param desc place to store string pointer - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_certificate_policies( const mbedtls_asn1_buf *oid, const char **desc ); - -/** - * \brief Translate md_type into hash algorithm OID - * - * \param md_alg message digest algorithm - * \param oid place to store ASN.1 OID string pointer - * \param olen length of the OID - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_oid_by_md( mbedtls_md_type_t md_alg, const char **oid, size_t *olen ); - -#if defined(MBEDTLS_CIPHER_C) -/** - * \brief Translate encryption algorithm OID into cipher_type - * - * \param oid OID to use - * \param cipher_alg place to store cipher algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_cipher_alg( const mbedtls_asn1_buf *oid, mbedtls_cipher_type_t *cipher_alg ); -#endif /* MBEDTLS_CIPHER_C */ - -#if defined(MBEDTLS_PKCS12_C) -/** - * \brief Translate PKCS#12 PBE algorithm OID into md_type and - * cipher_type - * - * \param oid OID to use - * \param md_alg place to store message digest algorithm - * \param cipher_alg place to store cipher algorithm - * - * \return 0 if successful, or MBEDTLS_ERR_OID_NOT_FOUND - */ -int mbedtls_oid_get_pkcs12_pbe_alg( const mbedtls_asn1_buf *oid, mbedtls_md_type_t *md_alg, - mbedtls_cipher_type_t *cipher_alg ); -#endif /* MBEDTLS_PKCS12_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* oid.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/padlock.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/padlock.h deleted file mode 100644 index 513d72f3d..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/padlock.h +++ /dev/null @@ -1,126 +0,0 @@ -/** - * \file padlock.h - * - * \brief VIA PadLock ACE for HW encryption/decryption supported by some - * processors - * - * \warning These functions are only for internal use by other library - * functions; you must not call them directly. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PADLOCK_H -#define MBEDTLS_PADLOCK_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/aes.h" - -#define MBEDTLS_ERR_PADLOCK_DATA_MISALIGNED -0x0030 /**< Input data should be aligned. */ - -#if defined(__has_feature) -#if __has_feature(address_sanitizer) -#define MBEDTLS_HAVE_ASAN -#endif -#endif - -/* Some versions of ASan result in errors about not enough registers */ -#if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \ - !defined(MBEDTLS_HAVE_ASAN) - -#ifndef MBEDTLS_HAVE_X86 -#define MBEDTLS_HAVE_X86 -#endif - -#include - -#define MBEDTLS_PADLOCK_RNG 0x000C -#define MBEDTLS_PADLOCK_ACE 0x00C0 -#define MBEDTLS_PADLOCK_PHE 0x0C00 -#define MBEDTLS_PADLOCK_PMM 0x3000 - -#define MBEDTLS_PADLOCK_ALIGN16(x) (uint32_t *) (16 + ((int32_t) (x) & ~15)) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Internal PadLock detection routine - * - * \note This function is only for internal use by other library - * functions; you must not call it directly. - * - * \param feature The feature to detect - * - * \return 1 if CPU has support for the feature, 0 otherwise - */ -int mbedtls_padlock_has_support( int feature ); - -/** - * \brief Internal PadLock AES-ECB block en(de)cryption - * - * \note This function is only for internal use by other library - * functions; you must not call it directly. - * - * \param ctx AES context - * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT - * \param input 16-byte input block - * \param output 16-byte output block - * - * \return 0 if success, 1 if operation failed - */ -int mbedtls_padlock_xcryptecb( mbedtls_aes_context *ctx, - int mode, - const unsigned char input[16], - unsigned char output[16] ); - -/** - * \brief Internal PadLock AES-CBC buffer en(de)cryption - * - * \note This function is only for internal use by other library - * functions; you must not call it directly. - * - * \param ctx AES context - * \param mode MBEDTLS_AES_ENCRYPT or MBEDTLS_AES_DECRYPT - * \param length length of the input data - * \param iv initialization vector (updated after use) - * \param input buffer holding the input data - * \param output buffer holding the output data - * - * \return 0 if success, 1 if operation failed - */ -int mbedtls_padlock_xcryptcbc( mbedtls_aes_context *ctx, - int mode, - size_t length, - unsigned char iv[16], - const unsigned char *input, - unsigned char *output ); - -#ifdef __cplusplus -} -#endif - -#endif /* HAVE_X86 */ - -#endif /* padlock.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pem.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pem.h deleted file mode 100644 index f7bf1a667..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pem.h +++ /dev/null @@ -1,146 +0,0 @@ -/** - * \file pem.h - * - * \brief Privacy Enhanced Mail (PEM) decoding - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PEM_H -#define MBEDTLS_PEM_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -/** - * \name PEM Error codes - * These error codes are returned in case of errors reading the - * PEM data. - * \{ - */ -#define MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT -0x1080 /**< No PEM header or footer found. */ -#define MBEDTLS_ERR_PEM_INVALID_DATA -0x1100 /**< PEM string is not as expected. */ -#define MBEDTLS_ERR_PEM_ALLOC_FAILED -0x1180 /**< Failed to allocate memory. */ -#define MBEDTLS_ERR_PEM_INVALID_ENC_IV -0x1200 /**< RSA IV is not in hex-format. */ -#define MBEDTLS_ERR_PEM_UNKNOWN_ENC_ALG -0x1280 /**< Unsupported key encryption algorithm. */ -#define MBEDTLS_ERR_PEM_PASSWORD_REQUIRED -0x1300 /**< Private key password can't be empty. */ -#define MBEDTLS_ERR_PEM_PASSWORD_MISMATCH -0x1380 /**< Given private key password does not allow for correct decryption. */ -#define MBEDTLS_ERR_PEM_FEATURE_UNAVAILABLE -0x1400 /**< Unavailable feature, e.g. hashing/encryption combination. */ -#define MBEDTLS_ERR_PEM_BAD_INPUT_DATA -0x1480 /**< Bad input parameters to function. */ -/* \} name */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_PEM_PARSE_C) -/** - * \brief PEM context structure - */ -typedef struct mbedtls_pem_context -{ - unsigned char *buf; /*!< buffer for decoded data */ - size_t buflen; /*!< length of the buffer */ - unsigned char *info; /*!< buffer for extra header information */ -} -mbedtls_pem_context; - -/** - * \brief PEM context setup - * - * \param ctx context to be initialized - */ -void mbedtls_pem_init( mbedtls_pem_context *ctx ); - -/** - * \brief Read a buffer for PEM information and store the resulting - * data into the specified context buffers. - * - * \param ctx context to use - * \param header header string to seek and expect - * \param footer footer string to seek and expect - * \param data source data to look in (must be nul-terminated) - * \param pwd password for decryption (can be NULL) - * \param pwdlen length of password - * \param use_len destination for total length used (set after header is - * correctly read, so unless you get - * MBEDTLS_ERR_PEM_BAD_INPUT_DATA or - * MBEDTLS_ERR_PEM_NO_HEADER_FOOTER_PRESENT, use_len is - * the length to skip) - * - * \note Attempts to check password correctness by verifying if - * the decrypted text starts with an ASN.1 sequence of - * appropriate length - * - * \return 0 on success, or a specific PEM error code - */ -int mbedtls_pem_read_buffer( mbedtls_pem_context *ctx, const char *header, const char *footer, - const unsigned char *data, - const unsigned char *pwd, - size_t pwdlen, size_t *use_len ); - -/** - * \brief PEM context memory freeing - * - * \param ctx context to be freed - */ -void mbedtls_pem_free( mbedtls_pem_context *ctx ); -#endif /* MBEDTLS_PEM_PARSE_C */ - -#if defined(MBEDTLS_PEM_WRITE_C) -/** - * \brief Write a buffer of PEM information from a DER encoded - * buffer. - * - * \param header The header string to write. - * \param footer The footer string to write. - * \param der_data The DER data to encode. - * \param der_len The length of the DER data \p der_data in Bytes. - * \param buf The buffer to write to. - * \param buf_len The length of the output buffer \p buf in Bytes. - * \param olen The address at which to store the total length written - * or required (if \p buf_len is not enough). - * - * \note You may pass \c NULL for \p buf and \c 0 for \p buf_len - * to request the length of the resulting PEM buffer in - * `*olen`. - * - * \note This function may be called with overlapping \p der_data - * and \p buf buffers. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_BASE64_BUFFER_TOO_SMALL if \p buf isn't large - * enough to hold the PEM buffer. In this case, `*olen` holds - * the required minimum size of \p buf. - * \return Another PEM or BASE64 error code on other kinds of failure. - */ -int mbedtls_pem_write_buffer( const char *header, const char *footer, - const unsigned char *der_data, size_t der_len, - unsigned char *buf, size_t buf_len, size_t *olen ); -#endif /* MBEDTLS_PEM_WRITE_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* pem.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pk.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pk.h deleted file mode 100644 index 99e7a55a1..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pk.h +++ /dev/null @@ -1,881 +0,0 @@ -/** - * \file pk.h - * - * \brief Public Key abstraction layer - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_PK_H -#define MBEDTLS_PK_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/md.h" - -#if defined(MBEDTLS_RSA_C) -#include "mbedtls/rsa.h" -#endif - -#if defined(MBEDTLS_ECP_C) -#include "mbedtls/ecp.h" -#endif - -#if defined(MBEDTLS_ECDSA_C) -#include "mbedtls/ecdsa.h" -#endif - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "psa/crypto.h" -#endif - -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - -#define MBEDTLS_ERR_PK_ALLOC_FAILED -0x3F80 /**< Memory allocation failed. */ -#define MBEDTLS_ERR_PK_TYPE_MISMATCH -0x3F00 /**< Type mismatch, eg attempt to encrypt with an ECDSA key */ -#define MBEDTLS_ERR_PK_BAD_INPUT_DATA -0x3E80 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_PK_FILE_IO_ERROR -0x3E00 /**< Read/write of file failed. */ -#define MBEDTLS_ERR_PK_KEY_INVALID_VERSION -0x3D80 /**< Unsupported key version */ -#define MBEDTLS_ERR_PK_KEY_INVALID_FORMAT -0x3D00 /**< Invalid key tag or value. */ -#define MBEDTLS_ERR_PK_UNKNOWN_PK_ALG -0x3C80 /**< Key algorithm is unsupported (only RSA and EC are supported). */ -#define MBEDTLS_ERR_PK_PASSWORD_REQUIRED -0x3C00 /**< Private key password can't be empty. */ -#define MBEDTLS_ERR_PK_PASSWORD_MISMATCH -0x3B80 /**< Given private key password does not allow for correct decryption. */ -#define MBEDTLS_ERR_PK_INVALID_PUBKEY -0x3B00 /**< The pubkey tag or value is invalid (only RSA and EC are supported). */ -#define MBEDTLS_ERR_PK_INVALID_ALG -0x3A80 /**< The algorithm tag or value is invalid. */ -#define MBEDTLS_ERR_PK_UNKNOWN_NAMED_CURVE -0x3A00 /**< Elliptic curve is unsupported (only NIST curves are supported). */ -#define MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE -0x3980 /**< Unavailable feature, e.g. RSA disabled for RSA key. */ -#define MBEDTLS_ERR_PK_SIG_LEN_MISMATCH -0x3900 /**< The buffer contains a valid signature followed by more data. */ - -/* MBEDTLS_ERR_PK_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_PK_HW_ACCEL_FAILED -0x3880 /**< PK hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Public key types - */ -typedef enum { - MBEDTLS_PK_NONE=0, - MBEDTLS_PK_RSA, - MBEDTLS_PK_ECKEY, - MBEDTLS_PK_ECKEY_DH, - MBEDTLS_PK_ECDSA, - MBEDTLS_PK_RSA_ALT, - MBEDTLS_PK_RSASSA_PSS, - MBEDTLS_PK_OPAQUE, -} mbedtls_pk_type_t; - -/** - * \brief Options for RSASSA-PSS signature verification. - * See \c mbedtls_rsa_rsassa_pss_verify_ext() - */ -typedef struct mbedtls_pk_rsassa_pss_options -{ - mbedtls_md_type_t mgf1_hash_id; - int expected_salt_len; - -} mbedtls_pk_rsassa_pss_options; - -/** - * \brief Maximum size of a signature made by mbedtls_pk_sign(). - */ -/* We need to set MBEDTLS_PK_SIGNATURE_MAX_SIZE to the maximum signature - * size among the supported signature types. Do it by starting at 0, - * then incrementally increasing to be large enough for each supported - * signature mechanism. - * - * The resulting value can be 0, for example if MBEDTLS_ECDH_C is enabled - * (which allows the pk module to be included) but neither MBEDTLS_ECDSA_C - * nor MBEDTLS_RSA_C nor any opaque signature mechanism (PSA or RSA_ALT). - */ -#define MBEDTLS_PK_SIGNATURE_MAX_SIZE 0 - -#if ( defined(MBEDTLS_RSA_C) || defined(MBEDTLS_PK_RSA_ALT_SUPPORT) ) && \ - MBEDTLS_MPI_MAX_SIZE > MBEDTLS_PK_SIGNATURE_MAX_SIZE -/* For RSA, the signature can be as large as the bignum module allows. - * For RSA_ALT, the signature size is not necessarily tied to what the - * bignum module can do, but in the absence of any specific setting, - * we use that (rsa_alt_sign_wrap in pk_wrap will check). */ -#undef MBEDTLS_PK_SIGNATURE_MAX_SIZE -#define MBEDTLS_PK_SIGNATURE_MAX_SIZE MBEDTLS_MPI_MAX_SIZE -#endif - -#if defined(MBEDTLS_ECDSA_C) && \ - MBEDTLS_ECDSA_MAX_LEN > MBEDTLS_PK_SIGNATURE_MAX_SIZE -/* For ECDSA, the ecdsa module exports a constant for the maximum - * signature size. */ -#undef MBEDTLS_PK_SIGNATURE_MAX_SIZE -#define MBEDTLS_PK_SIGNATURE_MAX_SIZE MBEDTLS_ECDSA_MAX_LEN -#endif - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -#if PSA_SIGNATURE_MAX_SIZE > MBEDTLS_PK_SIGNATURE_MAX_SIZE -/* PSA_SIGNATURE_MAX_SIZE is the maximum size of a signature made - * through the PSA API in the PSA representation. */ -#undef MBEDTLS_PK_SIGNATURE_MAX_SIZE -#define MBEDTLS_PK_SIGNATURE_MAX_SIZE PSA_SIGNATURE_MAX_SIZE -#endif - -#if PSA_VENDOR_ECDSA_SIGNATURE_MAX_SIZE + 11 > MBEDTLS_PK_SIGNATURE_MAX_SIZE -/* The Mbed TLS representation is different for ECDSA signatures: - * PSA uses the raw concatenation of r and s, - * whereas Mbed TLS uses the ASN.1 representation (SEQUENCE of two INTEGERs). - * Add the overhead of ASN.1: up to (1+2) + 2 * (1+2+1) for the - * types, lengths (represented by up to 2 bytes), and potential leading - * zeros of the INTEGERs and the SEQUENCE. */ -#undef MBEDTLS_PK_SIGNATURE_MAX_SIZE -#define MBEDTLS_PK_SIGNATURE_MAX_SIZE ( PSA_VENDOR_ECDSA_SIGNATURE_MAX_SIZE + 11 ) -#endif -#endif /* defined(MBEDTLS_USE_PSA_CRYPTO) */ - -/** - * \brief Types for interfacing with the debug module - */ -typedef enum -{ - MBEDTLS_PK_DEBUG_NONE = 0, - MBEDTLS_PK_DEBUG_MPI, - MBEDTLS_PK_DEBUG_ECP, -} mbedtls_pk_debug_type; - -/** - * \brief Item to send to the debug module - */ -typedef struct mbedtls_pk_debug_item -{ - mbedtls_pk_debug_type type; - const char *name; - void *value; -} mbedtls_pk_debug_item; - -/** Maximum number of item send for debugging, plus 1 */ -#define MBEDTLS_PK_DEBUG_MAX_ITEMS 3 - -/** - * \brief Public key information and operations - */ -typedef struct mbedtls_pk_info_t mbedtls_pk_info_t; - -/** - * \brief Public key container - */ -typedef struct mbedtls_pk_context -{ - const mbedtls_pk_info_t * pk_info; /**< Public key information */ - void * pk_ctx; /**< Underlying public key context */ -} mbedtls_pk_context; - -#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE) -/** - * \brief Context for resuming operations - */ -typedef struct -{ - const mbedtls_pk_info_t * pk_info; /**< Public key information */ - void * rs_ctx; /**< Underlying restart context */ -} mbedtls_pk_restart_ctx; -#else /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */ -/* Now we can declare functions that take a pointer to that */ -typedef void mbedtls_pk_restart_ctx; -#endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */ - -#if defined(MBEDTLS_RSA_C) -/** - * Quick access to an RSA context inside a PK context. - * - * \warning You must make sure the PK context actually holds an RSA context - * before using this function! - */ -static inline mbedtls_rsa_context *mbedtls_pk_rsa( const mbedtls_pk_context pk ) -{ - return( (mbedtls_rsa_context *) (pk).pk_ctx ); -} -#endif /* MBEDTLS_RSA_C */ - -#if defined(MBEDTLS_ECP_C) -/** - * Quick access to an EC context inside a PK context. - * - * \warning You must make sure the PK context actually holds an EC context - * before using this function! - */ -static inline mbedtls_ecp_keypair *mbedtls_pk_ec( const mbedtls_pk_context pk ) -{ - return( (mbedtls_ecp_keypair *) (pk).pk_ctx ); -} -#endif /* MBEDTLS_ECP_C */ - -#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) -/** - * \brief Types for RSA-alt abstraction - */ -typedef int (*mbedtls_pk_rsa_alt_decrypt_func)( void *ctx, int mode, size_t *olen, - const unsigned char *input, unsigned char *output, - size_t output_max_len ); -typedef int (*mbedtls_pk_rsa_alt_sign_func)( void *ctx, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, - int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, - const unsigned char *hash, unsigned char *sig ); -typedef size_t (*mbedtls_pk_rsa_alt_key_len_func)( void *ctx ); -#endif /* MBEDTLS_PK_RSA_ALT_SUPPORT */ - -/** - * \brief Return information associated with the given PK type - * - * \param pk_type PK type to search for. - * - * \return The PK info associated with the type or NULL if not found. - */ -const mbedtls_pk_info_t *mbedtls_pk_info_from_type( mbedtls_pk_type_t pk_type ); - -/** - * \brief Initialize a #mbedtls_pk_context (as NONE). - * - * \param ctx The context to initialize. - * This must not be \c NULL. - */ -void mbedtls_pk_init( mbedtls_pk_context *ctx ); - -/** - * \brief Free the components of a #mbedtls_pk_context. - * - * \param ctx The context to clear. It must have been initialized. - * If this is \c NULL, this function does nothing. - * - * \note For contexts that have been set up with - * mbedtls_pk_setup_opaque(), this does not free the underlying - * PSA key and you still need to call psa_destroy_key() - * independently if you want to destroy that key. - */ -void mbedtls_pk_free( mbedtls_pk_context *ctx ); - -#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE) -/** - * \brief Initialize a restart context - * - * \param ctx The context to initialize. - * This must not be \c NULL. - */ -void mbedtls_pk_restart_init( mbedtls_pk_restart_ctx *ctx ); - -/** - * \brief Free the components of a restart context - * - * \param ctx The context to clear. It must have been initialized. - * If this is \c NULL, this function does nothing. - */ -void mbedtls_pk_restart_free( mbedtls_pk_restart_ctx *ctx ); -#endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */ - -/** - * \brief Initialize a PK context with the information given - * and allocates the type-specific PK subcontext. - * - * \param ctx Context to initialize. It must not have been set - * up yet (type #MBEDTLS_PK_NONE). - * \param info Information to use - * - * \return 0 on success, - * MBEDTLS_ERR_PK_BAD_INPUT_DATA on invalid input, - * MBEDTLS_ERR_PK_ALLOC_FAILED on allocation failure. - * - * \note For contexts holding an RSA-alt key, use - * \c mbedtls_pk_setup_rsa_alt() instead. - */ -int mbedtls_pk_setup( mbedtls_pk_context *ctx, const mbedtls_pk_info_t *info ); - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -/** - * \brief Initialize a PK context to wrap a PSA key. - * - * \note This function replaces mbedtls_pk_setup() for contexts - * that wrap a (possibly opaque) PSA key instead of - * storing and manipulating the key material directly. - * - * \param ctx The context to initialize. It must be empty (type NONE). - * \param key The PSA key to wrap, which must hold an ECC key pair - * (see notes below). - * - * \note The wrapped key must remain valid as long as the - * wrapping PK context is in use, that is at least between - * the point this function is called and the point - * mbedtls_pk_free() is called on this context. The wrapped - * key might then be independently used or destroyed. - * - * \note This function is currently only available for ECC key - * pairs (that is, ECC keys containing private key material). - * Support for other key types may be added later. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_PK_BAD_INPUT_DATA on invalid input - * (context already used, invalid key handle). - * \return #MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE if the key is not an - * ECC key pair. - * \return #MBEDTLS_ERR_PK_ALLOC_FAILED on allocation failure. - */ -int mbedtls_pk_setup_opaque( mbedtls_pk_context *ctx, const psa_key_handle_t key ); -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) -/** - * \brief Initialize an RSA-alt context - * - * \param ctx Context to initialize. It must not have been set - * up yet (type #MBEDTLS_PK_NONE). - * \param key RSA key pointer - * \param decrypt_func Decryption function - * \param sign_func Signing function - * \param key_len_func Function returning key length in bytes - * - * \return 0 on success, or MBEDTLS_ERR_PK_BAD_INPUT_DATA if the - * context wasn't already initialized as RSA_ALT. - * - * \note This function replaces \c mbedtls_pk_setup() for RSA-alt. - */ -int mbedtls_pk_setup_rsa_alt( mbedtls_pk_context *ctx, void * key, - mbedtls_pk_rsa_alt_decrypt_func decrypt_func, - mbedtls_pk_rsa_alt_sign_func sign_func, - mbedtls_pk_rsa_alt_key_len_func key_len_func ); -#endif /* MBEDTLS_PK_RSA_ALT_SUPPORT */ - -/** - * \brief Get the size in bits of the underlying key - * - * \param ctx The context to query. It must have been initialized. - * - * \return Key size in bits, or 0 on error - */ -size_t mbedtls_pk_get_bitlen( const mbedtls_pk_context *ctx ); - -/** - * \brief Get the length in bytes of the underlying key - * - * \param ctx The context to query. It must have been initialized. - * - * \return Key length in bytes, or 0 on error - */ -static inline size_t mbedtls_pk_get_len( const mbedtls_pk_context *ctx ) -{ - return( ( mbedtls_pk_get_bitlen( ctx ) + 7 ) / 8 ); -} - -/** - * \brief Tell if a context can do the operation given by type - * - * \param ctx The context to query. It must have been initialized. - * \param type The desired type. - * - * \return 1 if the context can do operations on the given type. - * \return 0 if the context cannot do the operations on the given - * type. This is always the case for a context that has - * been initialized but not set up, or that has been - * cleared with mbedtls_pk_free(). - */ -int mbedtls_pk_can_do( const mbedtls_pk_context *ctx, mbedtls_pk_type_t type ); - -/** - * \brief Verify signature (including padding if relevant). - * - * \param ctx The PK context to use. It must have been set up. - * \param md_alg Hash algorithm used (see notes) - * \param hash Hash of the message to sign - * \param hash_len Hash length or 0 (see notes) - * \param sig Signature to verify - * \param sig_len Signature length - * - * \return 0 on success (signature is valid), - * #MBEDTLS_ERR_PK_SIG_LEN_MISMATCH if there is a valid - * signature in sig but its length is less than \p siglen, - * or a specific error code. - * - * \note For RSA keys, the default padding type is PKCS#1 v1.5. - * Use \c mbedtls_pk_verify_ext( MBEDTLS_PK_RSASSA_PSS, ... ) - * to verify RSASSA_PSS signatures. - * - * \note If hash_len is 0, then the length associated with md_alg - * is used instead, or an error returned if it is invalid. - * - * \note md_alg may be MBEDTLS_MD_NONE, only if hash_len != 0 - */ -int mbedtls_pk_verify( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - const unsigned char *sig, size_t sig_len ); - -/** - * \brief Restartable version of \c mbedtls_pk_verify() - * - * \note Performs the same job as \c mbedtls_pk_verify(), but can - * return early and restart according to the limit set with - * \c mbedtls_ecp_set_max_ops() to reduce blocking for ECC - * operations. For RSA, same as \c mbedtls_pk_verify(). - * - * \param ctx The PK context to use. It must have been set up. - * \param md_alg Hash algorithm used (see notes) - * \param hash Hash of the message to sign - * \param hash_len Hash length or 0 (see notes) - * \param sig Signature to verify - * \param sig_len Signature length - * \param rs_ctx Restart context (NULL to disable restart) - * - * \return See \c mbedtls_pk_verify(), or - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of - * operations was reached: see \c mbedtls_ecp_set_max_ops(). - */ -int mbedtls_pk_verify_restartable( mbedtls_pk_context *ctx, - mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - const unsigned char *sig, size_t sig_len, - mbedtls_pk_restart_ctx *rs_ctx ); - -/** - * \brief Verify signature, with options. - * (Includes verification of the padding depending on type.) - * - * \param type Signature type (inc. possible padding type) to verify - * \param options Pointer to type-specific options, or NULL - * \param ctx The PK context to use. It must have been set up. - * \param md_alg Hash algorithm used (see notes) - * \param hash Hash of the message to sign - * \param hash_len Hash length or 0 (see notes) - * \param sig Signature to verify - * \param sig_len Signature length - * - * \return 0 on success (signature is valid), - * #MBEDTLS_ERR_PK_TYPE_MISMATCH if the PK context can't be - * used for this type of signatures, - * #MBEDTLS_ERR_PK_SIG_LEN_MISMATCH if there is a valid - * signature in sig but its length is less than \p siglen, - * or a specific error code. - * - * \note If hash_len is 0, then the length associated with md_alg - * is used instead, or an error returned if it is invalid. - * - * \note md_alg may be MBEDTLS_MD_NONE, only if hash_len != 0 - * - * \note If type is MBEDTLS_PK_RSASSA_PSS, then options must point - * to a mbedtls_pk_rsassa_pss_options structure, - * otherwise it must be NULL. - */ -int mbedtls_pk_verify_ext( mbedtls_pk_type_t type, const void *options, - mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - const unsigned char *sig, size_t sig_len ); - -/** - * \brief Make signature, including padding if relevant. - * - * \param ctx The PK context to use. It must have been set up - * with a private key. - * \param md_alg Hash algorithm used (see notes) - * \param hash Hash of the message to sign - * \param hash_len Hash length or 0 (see notes) - * \param sig Place to write the signature. - * It must have enough room for the signature. - * #MBEDTLS_PK_SIGNATURE_MAX_SIZE is always enough. - * You may use a smaller buffer if it is large enough - * given the key type. - * \param sig_len On successful return, - * the number of bytes written to \p sig. - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \return 0 on success, or a specific error code. - * - * \note For RSA keys, the default padding type is PKCS#1 v1.5. - * There is no interface in the PK module to make RSASSA-PSS - * signatures yet. - * - * \note If hash_len is 0, then the length associated with md_alg - * is used instead, or an error returned if it is invalid. - * - * \note For RSA, md_alg may be MBEDTLS_MD_NONE if hash_len != 0. - * For ECDSA, md_alg may never be MBEDTLS_MD_NONE. - */ -int mbedtls_pk_sign( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - unsigned char *sig, size_t *sig_len, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief Restartable version of \c mbedtls_pk_sign() - * - * \note Performs the same job as \c mbedtls_pk_sign(), but can - * return early and restart according to the limit set with - * \c mbedtls_ecp_set_max_ops() to reduce blocking for ECC - * operations. For RSA, same as \c mbedtls_pk_sign(). - * - * \param ctx The PK context to use. It must have been set up - * with a private key. - * \param md_alg Hash algorithm used (see notes for mbedtls_pk_sign()) - * \param hash Hash of the message to sign - * \param hash_len Hash length or 0 (see notes for mbedtls_pk_sign()) - * \param sig Place to write the signature. - * It must have enough room for the signature. - * #MBEDTLS_PK_SIGNATURE_MAX_SIZE is always enough. - * You may use a smaller buffer if it is large enough - * given the key type. - * \param sig_len On successful return, - * the number of bytes written to \p sig. - * \param f_rng RNG function - * \param p_rng RNG parameter - * \param rs_ctx Restart context (NULL to disable restart) - * - * \return See \c mbedtls_pk_sign(). - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of - * operations was reached: see \c mbedtls_ecp_set_max_ops(). - */ -int mbedtls_pk_sign_restartable( mbedtls_pk_context *ctx, - mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - unsigned char *sig, size_t *sig_len, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, - mbedtls_pk_restart_ctx *rs_ctx ); - -/** - * \brief Decrypt message (including padding if relevant). - * - * \param ctx The PK context to use. It must have been set up - * with a private key. - * \param input Input to decrypt - * \param ilen Input size - * \param output Decrypted output - * \param olen Decrypted message length - * \param osize Size of the output buffer - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \note For RSA keys, the default padding type is PKCS#1 v1.5. - * - * \return 0 on success, or a specific error code. - */ -int mbedtls_pk_decrypt( mbedtls_pk_context *ctx, - const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, size_t osize, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief Encrypt message (including padding if relevant). - * - * \param ctx The PK context to use. It must have been set up. - * \param input Message to encrypt - * \param ilen Message size - * \param output Encrypted output - * \param olen Encrypted output length - * \param osize Size of the output buffer - * \param f_rng RNG function - * \param p_rng RNG parameter - * - * \note For RSA keys, the default padding type is PKCS#1 v1.5. - * - * \return 0 on success, or a specific error code. - */ -int mbedtls_pk_encrypt( mbedtls_pk_context *ctx, - const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, size_t osize, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng ); - -/** - * \brief Check if a public-private pair of keys matches. - * - * \param pub Context holding a public key. - * \param prv Context holding a private (and public) key. - * - * \return \c 0 on success (keys were checked and match each other). - * \return #MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE if the keys could not - * be checked - in that case they may or may not match. - * \return #MBEDTLS_ERR_PK_BAD_INPUT_DATA if a context is invalid. - * \return Another non-zero value if the keys do not match. - */ -int mbedtls_pk_check_pair( const mbedtls_pk_context *pub, const mbedtls_pk_context *prv ); - -/** - * \brief Export debug information - * - * \param ctx The PK context to use. It must have been initialized. - * \param items Place to write debug items - * - * \return 0 on success or MBEDTLS_ERR_PK_BAD_INPUT_DATA - */ -int mbedtls_pk_debug( const mbedtls_pk_context *ctx, mbedtls_pk_debug_item *items ); - -/** - * \brief Access the type name - * - * \param ctx The PK context to use. It must have been initialized. - * - * \return Type name on success, or "invalid PK" - */ -const char * mbedtls_pk_get_name( const mbedtls_pk_context *ctx ); - -/** - * \brief Get the key type - * - * \param ctx The PK context to use. It must have been initialized. - * - * \return Type on success. - * \return #MBEDTLS_PK_NONE for a context that has not been set up. - */ -mbedtls_pk_type_t mbedtls_pk_get_type( const mbedtls_pk_context *ctx ); - -#if defined(MBEDTLS_PK_PARSE_C) -/** \ingroup pk_module */ -/** - * \brief Parse a private key in PEM or DER format - * - * \param ctx The PK context to fill. It must have been initialized - * but not set up. - * \param key Input buffer to parse. - * The buffer must contain the input exactly, with no - * extra trailing material. For PEM, the buffer must - * contain a null-terminated string. - * \param keylen Size of \b key in bytes. - * For PEM data, this includes the terminating null byte, - * so \p keylen must be equal to `strlen(key) + 1`. - * \param pwd Optional password for decryption. - * Pass \c NULL if expecting a non-encrypted key. - * Pass a string of \p pwdlen bytes if expecting an encrypted - * key; a non-encrypted key will also be accepted. - * The empty password is not supported. - * \param pwdlen Size of the password in bytes. - * Ignored if \p pwd is \c NULL. - * - * \note On entry, ctx must be empty, either freshly initialised - * with mbedtls_pk_init() or reset with mbedtls_pk_free(). If you need a - * specific key type, check the result with mbedtls_pk_can_do(). - * - * \note The key is also checked for correctness. - * - * \return 0 if successful, or a specific PK or PEM error code - */ -int mbedtls_pk_parse_key( mbedtls_pk_context *ctx, - const unsigned char *key, size_t keylen, - const unsigned char *pwd, size_t pwdlen ); - -/** \ingroup pk_module */ -/** - * \brief Parse a public key in PEM or DER format - * - * \param ctx The PK context to fill. It must have been initialized - * but not set up. - * \param key Input buffer to parse. - * The buffer must contain the input exactly, with no - * extra trailing material. For PEM, the buffer must - * contain a null-terminated string. - * \param keylen Size of \b key in bytes. - * For PEM data, this includes the terminating null byte, - * so \p keylen must be equal to `strlen(key) + 1`. - * - * \note On entry, ctx must be empty, either freshly initialised - * with mbedtls_pk_init() or reset with mbedtls_pk_free(). If you need a - * specific key type, check the result with mbedtls_pk_can_do(). - * - * \note The key is also checked for correctness. - * - * \return 0 if successful, or a specific PK or PEM error code - */ -int mbedtls_pk_parse_public_key( mbedtls_pk_context *ctx, - const unsigned char *key, size_t keylen ); - -#if defined(MBEDTLS_FS_IO) -/** \ingroup pk_module */ -/** - * \brief Load and parse a private key - * - * \param ctx The PK context to fill. It must have been initialized - * but not set up. - * \param path filename to read the private key from - * \param password Optional password to decrypt the file. - * Pass \c NULL if expecting a non-encrypted key. - * Pass a null-terminated string if expecting an encrypted - * key; a non-encrypted key will also be accepted. - * The empty password is not supported. - * - * \note On entry, ctx must be empty, either freshly initialised - * with mbedtls_pk_init() or reset with mbedtls_pk_free(). If you need a - * specific key type, check the result with mbedtls_pk_can_do(). - * - * \note The key is also checked for correctness. - * - * \return 0 if successful, or a specific PK or PEM error code - */ -int mbedtls_pk_parse_keyfile( mbedtls_pk_context *ctx, - const char *path, const char *password ); - -/** \ingroup pk_module */ -/** - * \brief Load and parse a public key - * - * \param ctx The PK context to fill. It must have been initialized - * but not set up. - * \param path filename to read the public key from - * - * \note On entry, ctx must be empty, either freshly initialised - * with mbedtls_pk_init() or reset with mbedtls_pk_free(). If - * you need a specific key type, check the result with - * mbedtls_pk_can_do(). - * - * \note The key is also checked for correctness. - * - * \return 0 if successful, or a specific PK or PEM error code - */ -int mbedtls_pk_parse_public_keyfile( mbedtls_pk_context *ctx, const char *path ); -#endif /* MBEDTLS_FS_IO */ -#endif /* MBEDTLS_PK_PARSE_C */ - -#if defined(MBEDTLS_PK_WRITE_C) -/** - * \brief Write a private key to a PKCS#1 or SEC1 DER structure - * Note: data is written at the end of the buffer! Use the - * return value to determine where you should start - * using the buffer - * - * \param ctx PK context which must contain a valid private key. - * \param buf buffer to write to - * \param size size of the buffer - * - * \return length of data written if successful, or a specific - * error code - */ -int mbedtls_pk_write_key_der( mbedtls_pk_context *ctx, unsigned char *buf, size_t size ); - -/** - * \brief Write a public key to a SubjectPublicKeyInfo DER structure - * Note: data is written at the end of the buffer! Use the - * return value to determine where you should start - * using the buffer - * - * \param ctx PK context which must contain a valid public or private key. - * \param buf buffer to write to - * \param size size of the buffer - * - * \return length of data written if successful, or a specific - * error code - */ -int mbedtls_pk_write_pubkey_der( mbedtls_pk_context *ctx, unsigned char *buf, size_t size ); - -#if defined(MBEDTLS_PEM_WRITE_C) -/** - * \brief Write a public key to a PEM string - * - * \param ctx PK context which must contain a valid public or private key. - * \param buf Buffer to write to. The output includes a - * terminating null byte. - * \param size Size of the buffer in bytes. - * - * \return 0 if successful, or a specific error code - */ -int mbedtls_pk_write_pubkey_pem( mbedtls_pk_context *ctx, unsigned char *buf, size_t size ); - -/** - * \brief Write a private key to a PKCS#1 or SEC1 PEM string - * - * \param ctx PK context which must contain a valid private key. - * \param buf Buffer to write to. The output includes a - * terminating null byte. - * \param size Size of the buffer in bytes. - * - * \return 0 if successful, or a specific error code - */ -int mbedtls_pk_write_key_pem( mbedtls_pk_context *ctx, unsigned char *buf, size_t size ); -#endif /* MBEDTLS_PEM_WRITE_C */ -#endif /* MBEDTLS_PK_WRITE_C */ - -/* - * WARNING: Low-level functions. You probably do not want to use these unless - * you are certain you do ;) - */ - -#if defined(MBEDTLS_PK_PARSE_C) -/** - * \brief Parse a SubjectPublicKeyInfo DER structure - * - * \param p the position in the ASN.1 data - * \param end end of the buffer - * \param pk The PK context to fill. It must have been initialized - * but not set up. - * - * \return 0 if successful, or a specific PK error code - */ -int mbedtls_pk_parse_subpubkey( unsigned char **p, const unsigned char *end, - mbedtls_pk_context *pk ); -#endif /* MBEDTLS_PK_PARSE_C */ - -#if defined(MBEDTLS_PK_WRITE_C) -/** - * \brief Write a subjectPublicKey to ASN.1 data - * Note: function works backwards in data buffer - * - * \param p reference to current position pointer - * \param start start of the buffer (for bounds-checking) - * \param key PK context which must contain a valid public or private key. - * - * \return the length written or a negative error code - */ -int mbedtls_pk_write_pubkey( unsigned char **p, unsigned char *start, - const mbedtls_pk_context *key ); -#endif /* MBEDTLS_PK_WRITE_C */ - -/* - * Internal module functions. You probably do not want to use these unless you - * know you do. - */ -#if defined(MBEDTLS_FS_IO) -int mbedtls_pk_load_file( const char *path, unsigned char **buf, size_t *n ); -#endif - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -/** - * \brief Turn an EC key into an opaque one. - * - * \warning This is a temporary utility function for tests. It might - * change or be removed at any time without notice. - * - * \note Only ECDSA keys are supported so far. Signing with the - * specified hash is the only allowed use of that key. - * - * \param pk Input: the EC key to import to a PSA key. - * Output: a PK context wrapping that PSA key. - * \param handle Output: a PSA key handle. - * It's the caller's responsibility to call - * psa_destroy_key() on that handle after calling - * mbedtls_pk_free() on the PK context. - * \param hash_alg The hash algorithm to allow for use with that key. - * - * \return \c 0 if successful. - * \return An Mbed TLS error code otherwise. - */ -int mbedtls_pk_wrap_as_opaque( mbedtls_pk_context *pk, - psa_key_handle_t *handle, - psa_algorithm_t hash_alg ); -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_PK_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pk_internal.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pk_internal.h deleted file mode 100644 index 7ef6322e4..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pk_internal.h +++ /dev/null @@ -1,142 +0,0 @@ -/** - * \file pk_internal.h - * - * \brief Public Key abstraction layer: wrapper functions - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_PK_WRAP_H -#define MBEDTLS_PK_WRAP_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/pk.h" - -struct mbedtls_pk_info_t -{ - /** Public key type */ - mbedtls_pk_type_t type; - - /** Type name */ - const char *name; - - /** Get key size in bits */ - size_t (*get_bitlen)( const void * ); - - /** Tell if the context implements this type (e.g. ECKEY can do ECDSA) */ - int (*can_do)( mbedtls_pk_type_t type ); - - /** Verify signature */ - int (*verify_func)( void *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - const unsigned char *sig, size_t sig_len ); - - /** Make signature */ - int (*sign_func)( void *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - unsigned char *sig, size_t *sig_len, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE) - /** Verify signature (restartable) */ - int (*verify_rs_func)( void *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - const unsigned char *sig, size_t sig_len, - void *rs_ctx ); - - /** Make signature (restartable) */ - int (*sign_rs_func)( void *ctx, mbedtls_md_type_t md_alg, - const unsigned char *hash, size_t hash_len, - unsigned char *sig, size_t *sig_len, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, void *rs_ctx ); -#endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */ - - /** Decrypt message */ - int (*decrypt_func)( void *ctx, const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, size_t osize, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - - /** Encrypt message */ - int (*encrypt_func)( void *ctx, const unsigned char *input, size_t ilen, - unsigned char *output, size_t *olen, size_t osize, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - - /** Check public-private key pair */ - int (*check_pair_func)( const void *pub, const void *prv ); - - /** Allocate a new context */ - void * (*ctx_alloc_func)( void ); - - /** Free the given context */ - void (*ctx_free_func)( void *ctx ); - -#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE) - /** Allocate the restart context */ - void * (*rs_alloc_func)( void ); - - /** Free the restart context */ - void (*rs_free_func)( void *rs_ctx ); -#endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */ - - /** Interface with the debug module */ - void (*debug_func)( const void *ctx, mbedtls_pk_debug_item *items ); - -}; -#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) -/* Container for RSA-alt */ -typedef struct -{ - void *key; - mbedtls_pk_rsa_alt_decrypt_func decrypt_func; - mbedtls_pk_rsa_alt_sign_func sign_func; - mbedtls_pk_rsa_alt_key_len_func key_len_func; -} mbedtls_rsa_alt_context; -#endif - -#if defined(MBEDTLS_RSA_C) -extern const mbedtls_pk_info_t mbedtls_rsa_info; -#endif - -#if defined(MBEDTLS_ECP_C) -extern const mbedtls_pk_info_t mbedtls_eckey_info; -extern const mbedtls_pk_info_t mbedtls_eckeydh_info; -#endif - -#if defined(MBEDTLS_ECDSA_C) -extern const mbedtls_pk_info_t mbedtls_ecdsa_info; -#endif - -#if defined(MBEDTLS_PK_RSA_ALT_SUPPORT) -extern const mbedtls_pk_info_t mbedtls_rsa_alt_info; -#endif - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -extern const mbedtls_pk_info_t mbedtls_pk_opaque_info; -#endif - -#endif /* MBEDTLS_PK_WRAP_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs11.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs11.h deleted file mode 100644 index cf8d8c429..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs11.h +++ /dev/null @@ -1,248 +0,0 @@ -/** - * \file pkcs11.h - * - * \brief Wrapper for PKCS#11 library libpkcs11-helper - * - * \author Adriaan de Jong - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PKCS11_H -#define MBEDTLS_PKCS11_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#if defined(MBEDTLS_PKCS11_C) - -#include "mbedtls/x509_crt.h" - -#include - -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_DEPRECATED_REMOVED) - -/** - * Context for PKCS #11 private keys. - */ -typedef struct mbedtls_pkcs11_context -{ - pkcs11h_certificate_t pkcs11h_cert; - int len; -} mbedtls_pkcs11_context; - -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif - -/** - * Initialize a mbedtls_pkcs11_context. - * (Just making memory references valid.) - * - * \deprecated This function is deprecated and will be removed in a - * future version of the library. - */ -MBEDTLS_DEPRECATED void mbedtls_pkcs11_init( mbedtls_pkcs11_context *ctx ); - -/** - * Fill in a mbed TLS certificate, based on the given PKCS11 helper certificate. - * - * \deprecated This function is deprecated and will be removed in a - * future version of the library. - * - * \param cert X.509 certificate to fill - * \param pkcs11h_cert PKCS #11 helper certificate - * - * \return 0 on success. - */ -MBEDTLS_DEPRECATED int mbedtls_pkcs11_x509_cert_bind( mbedtls_x509_crt *cert, - pkcs11h_certificate_t pkcs11h_cert ); - -/** - * Set up a mbedtls_pkcs11_context storing the given certificate. Note that the - * mbedtls_pkcs11_context will take over control of the certificate, freeing it when - * done. - * - * \deprecated This function is deprecated and will be removed in a - * future version of the library. - * - * \param priv_key Private key structure to fill. - * \param pkcs11_cert PKCS #11 helper certificate - * - * \return 0 on success - */ -MBEDTLS_DEPRECATED int mbedtls_pkcs11_priv_key_bind( - mbedtls_pkcs11_context *priv_key, - pkcs11h_certificate_t pkcs11_cert ); - -/** - * Free the contents of the given private key context. Note that the structure - * itself is not freed. - * - * \deprecated This function is deprecated and will be removed in a - * future version of the library. - * - * \param priv_key Private key structure to cleanup - */ -MBEDTLS_DEPRECATED void mbedtls_pkcs11_priv_key_free( - mbedtls_pkcs11_context *priv_key ); - -/** - * \brief Do an RSA private key decrypt, then remove the message - * padding - * - * \deprecated This function is deprecated and will be removed in a future - * version of the library. - * - * \param ctx PKCS #11 context - * \param mode must be MBEDTLS_RSA_PRIVATE, for compatibility with rsa.c's signature - * \param input buffer holding the encrypted data - * \param output buffer that will hold the plaintext - * \param olen will contain the plaintext length - * \param output_max_len maximum length of the output buffer - * - * \return 0 if successful, or an MBEDTLS_ERR_RSA_XXX error code - * - * \note The output buffer must be as large as the size - * of ctx->N (eg. 128 bytes if RSA-1024 is used) otherwise - * an error is thrown. - */ -MBEDTLS_DEPRECATED int mbedtls_pkcs11_decrypt( mbedtls_pkcs11_context *ctx, - int mode, size_t *olen, - const unsigned char *input, - unsigned char *output, - size_t output_max_len ); - -/** - * \brief Do a private RSA to sign a message digest - * - * \deprecated This function is deprecated and will be removed in a future - * version of the library. - * - * \param ctx PKCS #11 context - * \param mode must be MBEDTLS_RSA_PRIVATE, for compatibility with rsa.c's signature - * \param md_alg a MBEDTLS_MD_XXX (use MBEDTLS_MD_NONE for signing raw data) - * \param hashlen message digest length (for MBEDTLS_MD_NONE only) - * \param hash buffer holding the message digest - * \param sig buffer that will hold the ciphertext - * - * \return 0 if the signing operation was successful, - * or an MBEDTLS_ERR_RSA_XXX error code - * - * \note The "sig" buffer must be as large as the size - * of ctx->N (eg. 128 bytes if RSA-1024 is used). - */ -MBEDTLS_DEPRECATED int mbedtls_pkcs11_sign( mbedtls_pkcs11_context *ctx, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - unsigned char *sig ); - -/** - * SSL/TLS wrappers for PKCS#11 functions - * - * \deprecated This function is deprecated and will be removed in a future - * version of the library. - */ -MBEDTLS_DEPRECATED static inline int mbedtls_ssl_pkcs11_decrypt( void *ctx, - int mode, size_t *olen, - const unsigned char *input, unsigned char *output, - size_t output_max_len ) -{ - return mbedtls_pkcs11_decrypt( (mbedtls_pkcs11_context *) ctx, mode, olen, input, output, - output_max_len ); -} - -/** - * \brief This function signs a message digest using RSA. - * - * \deprecated This function is deprecated and will be removed in a future - * version of the library. - * - * \param ctx The PKCS #11 context. - * \param f_rng The RNG function. This parameter is unused. - * \param p_rng The RNG context. This parameter is unused. - * \param mode The operation to run. This must be set to - * MBEDTLS_RSA_PRIVATE, for compatibility with rsa.c's - * signature. - * \param md_alg The message digest algorithm. One of the MBEDTLS_MD_XXX - * must be passed to this function and MBEDTLS_MD_NONE can be - * used for signing raw data. - * \param hashlen The message digest length (for MBEDTLS_MD_NONE only). - * \param hash The buffer holding the message digest. - * \param sig The buffer that will hold the ciphertext. - * - * \return \c 0 if the signing operation was successful. - * \return A non-zero error code on failure. - * - * \note The \p sig buffer must be as large as the size of - * ctx->N. For example, 128 bytes if RSA-1024 is - * used. - */ -MBEDTLS_DEPRECATED static inline int mbedtls_ssl_pkcs11_sign( void *ctx, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, - int mode, mbedtls_md_type_t md_alg, unsigned int hashlen, - const unsigned char *hash, unsigned char *sig ) -{ - ((void) f_rng); - ((void) p_rng); - return mbedtls_pkcs11_sign( (mbedtls_pkcs11_context *) ctx, mode, md_alg, - hashlen, hash, sig ); -} - -/** - * This function gets the length of the private key. - * - * \deprecated This function is deprecated and will be removed in a future - * version of the library. - * - * \param ctx The PKCS #11 context. - * - * \return The length of the private key. - */ -MBEDTLS_DEPRECATED static inline size_t mbedtls_ssl_pkcs11_key_len( void *ctx ) -{ - return ( (mbedtls_pkcs11_context *) ctx )->len; -} - -#undef MBEDTLS_DEPRECATED - -#endif /* MBEDTLS_DEPRECATED_REMOVED */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_PKCS11_C */ - -#endif /* MBEDTLS_PKCS11_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs12.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs12.h deleted file mode 100644 index 9d42d7ffe..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs12.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - * \file pkcs12.h - * - * \brief PKCS#12 Personal Information Exchange Syntax - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PKCS12_H -#define MBEDTLS_PKCS12_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/md.h" -#include "mbedtls/cipher.h" -#include "mbedtls/asn1.h" - -#include - -#define MBEDTLS_ERR_PKCS12_BAD_INPUT_DATA -0x1F80 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_PKCS12_FEATURE_UNAVAILABLE -0x1F00 /**< Feature not available, e.g. unsupported encryption scheme. */ -#define MBEDTLS_ERR_PKCS12_PBE_INVALID_FORMAT -0x1E80 /**< PBE ASN.1 data not as expected. */ -#define MBEDTLS_ERR_PKCS12_PASSWORD_MISMATCH -0x1E00 /**< Given private key password does not allow for correct decryption. */ - -#define MBEDTLS_PKCS12_DERIVE_KEY 1 /**< encryption/decryption key */ -#define MBEDTLS_PKCS12_DERIVE_IV 2 /**< initialization vector */ -#define MBEDTLS_PKCS12_DERIVE_MAC_KEY 3 /**< integrity / MAC key */ - -#define MBEDTLS_PKCS12_PBE_DECRYPT 0 -#define MBEDTLS_PKCS12_PBE_ENCRYPT 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_ASN1_PARSE_C) - -/** - * \brief PKCS12 Password Based function (encryption / decryption) - * for pbeWithSHAAnd128BitRC4 - * - * \param pbe_params an ASN1 buffer containing the pkcs-12PbeParams structure - * \param mode either MBEDTLS_PKCS12_PBE_ENCRYPT or MBEDTLS_PKCS12_PBE_DECRYPT - * \param pwd the password used (may be NULL if no password is used) - * \param pwdlen length of the password (may be 0) - * \param input the input data - * \param len data length - * \param output the output buffer - * - * \return 0 if successful, or a MBEDTLS_ERR_XXX code - */ -int mbedtls_pkcs12_pbe_sha1_rc4_128( mbedtls_asn1_buf *pbe_params, int mode, - const unsigned char *pwd, size_t pwdlen, - const unsigned char *input, size_t len, - unsigned char *output ); - -/** - * \brief PKCS12 Password Based function (encryption / decryption) - * for cipher-based and mbedtls_md-based PBE's - * - * \param pbe_params an ASN1 buffer containing the pkcs-12PbeParams structure - * \param mode either MBEDTLS_PKCS12_PBE_ENCRYPT or MBEDTLS_PKCS12_PBE_DECRYPT - * \param cipher_type the cipher used - * \param md_type the mbedtls_md used - * \param pwd the password used (may be NULL if no password is used) - * \param pwdlen length of the password (may be 0) - * \param input the input data - * \param len data length - * \param output the output buffer - * - * \return 0 if successful, or a MBEDTLS_ERR_XXX code - */ -int mbedtls_pkcs12_pbe( mbedtls_asn1_buf *pbe_params, int mode, - mbedtls_cipher_type_t cipher_type, mbedtls_md_type_t md_type, - const unsigned char *pwd, size_t pwdlen, - const unsigned char *input, size_t len, - unsigned char *output ); - -#endif /* MBEDTLS_ASN1_PARSE_C */ - -/** - * \brief The PKCS#12 derivation function uses a password and a salt - * to produce pseudo-random bits for a particular "purpose". - * - * Depending on the given id, this function can produce an - * encryption/decryption key, an nitialization vector or an - * integrity key. - * - * \param data buffer to store the derived data in - * \param datalen length to fill - * \param pwd password to use (may be NULL if no password is used) - * \param pwdlen length of the password (may be 0) - * \param salt salt buffer to use - * \param saltlen length of the salt - * \param mbedtls_md mbedtls_md type to use during the derivation - * \param id id that describes the purpose (can be MBEDTLS_PKCS12_DERIVE_KEY, - * MBEDTLS_PKCS12_DERIVE_IV or MBEDTLS_PKCS12_DERIVE_MAC_KEY) - * \param iterations number of iterations - * - * \return 0 if successful, or a MD, BIGNUM type error. - */ -int mbedtls_pkcs12_derivation( unsigned char *data, size_t datalen, - const unsigned char *pwd, size_t pwdlen, - const unsigned char *salt, size_t saltlen, - mbedtls_md_type_t mbedtls_md, int id, int iterations ); - -#ifdef __cplusplus -} -#endif - -#endif /* pkcs12.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs5.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs5.h deleted file mode 100644 index bbec7e7ed..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/pkcs5.h +++ /dev/null @@ -1,109 +0,0 @@ -/** - * \file pkcs5.h - * - * \brief PKCS#5 functions - * - * \author Mathias Olsson - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PKCS5_H -#define MBEDTLS_PKCS5_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/asn1.h" -#include "mbedtls/md.h" - -#include -#include - -#define MBEDTLS_ERR_PKCS5_BAD_INPUT_DATA -0x2f80 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_PKCS5_INVALID_FORMAT -0x2f00 /**< Unexpected ASN.1 data. */ -#define MBEDTLS_ERR_PKCS5_FEATURE_UNAVAILABLE -0x2e80 /**< Requested encryption or digest alg not available. */ -#define MBEDTLS_ERR_PKCS5_PASSWORD_MISMATCH -0x2e00 /**< Given private key password does not allow for correct decryption. */ - -#define MBEDTLS_PKCS5_DECRYPT 0 -#define MBEDTLS_PKCS5_ENCRYPT 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_ASN1_PARSE_C) - -/** - * \brief PKCS#5 PBES2 function - * - * \param pbe_params the ASN.1 algorithm parameters - * \param mode either MBEDTLS_PKCS5_DECRYPT or MBEDTLS_PKCS5_ENCRYPT - * \param pwd password to use when generating key - * \param pwdlen length of password - * \param data data to process - * \param datalen length of data - * \param output output buffer - * - * \returns 0 on success, or a MBEDTLS_ERR_XXX code if verification fails. - */ -int mbedtls_pkcs5_pbes2( const mbedtls_asn1_buf *pbe_params, int mode, - const unsigned char *pwd, size_t pwdlen, - const unsigned char *data, size_t datalen, - unsigned char *output ); - -#endif /* MBEDTLS_ASN1_PARSE_C */ - -/** - * \brief PKCS#5 PBKDF2 using HMAC - * - * \param ctx Generic HMAC context - * \param password Password to use when generating key - * \param plen Length of password - * \param salt Salt to use when generating key - * \param slen Length of salt - * \param iteration_count Iteration count - * \param key_length Length of generated key in bytes - * \param output Generated key. Must be at least as big as key_length - * - * \returns 0 on success, or a MBEDTLS_ERR_XXX code if verification fails. - */ -int mbedtls_pkcs5_pbkdf2_hmac( mbedtls_md_context_t *ctx, const unsigned char *password, - size_t plen, const unsigned char *salt, size_t slen, - unsigned int iteration_count, - uint32_t key_length, unsigned char *output ); - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_pkcs5_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* pkcs5.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform.h deleted file mode 100644 index b402f8f97..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform.h +++ /dev/null @@ -1,419 +0,0 @@ -/** - * \file platform.h - * - * \brief This file contains the definitions and functions of the - * Mbed TLS platform abstraction layer. - * - * The platform abstraction layer removes the need for the library - * to directly link to standard C library functions or operating - * system services, making the library easier to port and embed. - * Application developers and users of the library can provide their own - * implementations of these functions, or implementations specific to - * their platform, which can be statically linked to the library or - * dynamically configured at runtime. - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PLATFORM_H -#define MBEDTLS_PLATFORM_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#if defined(MBEDTLS_HAVE_TIME) -#include "mbedtls/platform_time.h" -#endif - -#define MBEDTLS_ERR_PLATFORM_HW_ACCEL_FAILED -0x0070 /**< Hardware accelerator failed */ -#define MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED -0x0072 /**< The requested feature is not supported by the platform */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -/* The older Microsoft Windows common runtime provides non-conforming - * implementations of some standard library functions, including snprintf - * and vsnprintf. This affects MSVC and MinGW builds. - */ -#if defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER <= 1900) -#define MBEDTLS_PLATFORM_HAS_NON_CONFORMING_SNPRINTF -#define MBEDTLS_PLATFORM_HAS_NON_CONFORMING_VSNPRINTF -#endif - -#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) -#include -#include -#include -#if !defined(MBEDTLS_PLATFORM_STD_SNPRINTF) -#if defined(MBEDTLS_PLATFORM_HAS_NON_CONFORMING_SNPRINTF) -#define MBEDTLS_PLATFORM_STD_SNPRINTF mbedtls_platform_win32_snprintf /**< The default \c snprintf function to use. */ -#else -#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf /**< The default \c snprintf function to use. */ -#endif -#endif -#if !defined(MBEDTLS_PLATFORM_STD_VSNPRINTF) -#if defined(MBEDTLS_PLATFORM_HAS_NON_CONFORMING_VSNPRINTF) -#define MBEDTLS_PLATFORM_STD_VSNPRINTF mbedtls_platform_win32_vsnprintf /**< The default \c vsnprintf function to use. */ -#else -#define MBEDTLS_PLATFORM_STD_VSNPRINTF vsnprintf /**< The default \c vsnprintf function to use. */ -#endif -#endif -#if !defined(MBEDTLS_PLATFORM_STD_PRINTF) -#define MBEDTLS_PLATFORM_STD_PRINTF printf /**< The default \c printf function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_FPRINTF) -#define MBEDTLS_PLATFORM_STD_FPRINTF fprintf /**< The default \c fprintf function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_CALLOC) -#define MBEDTLS_PLATFORM_STD_CALLOC calloc /**< The default \c calloc function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_FREE) -#define MBEDTLS_PLATFORM_STD_FREE free /**< The default \c free function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_EXIT) -#define MBEDTLS_PLATFORM_STD_EXIT exit /**< The default \c exit function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_TIME) -#define MBEDTLS_PLATFORM_STD_TIME time /**< The default \c time function to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS) -#define MBEDTLS_PLATFORM_STD_EXIT_SUCCESS EXIT_SUCCESS /**< The default exit value to use. */ -#endif -#if !defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE) -#define MBEDTLS_PLATFORM_STD_EXIT_FAILURE EXIT_FAILURE /**< The default exit value to use. */ -#endif -#if defined(MBEDTLS_FS_IO) -#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_READ) -#define MBEDTLS_PLATFORM_STD_NV_SEED_READ mbedtls_platform_std_nv_seed_read -#endif -#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_WRITE) -#define MBEDTLS_PLATFORM_STD_NV_SEED_WRITE mbedtls_platform_std_nv_seed_write -#endif -#if !defined(MBEDTLS_PLATFORM_STD_NV_SEED_FILE) -#define MBEDTLS_PLATFORM_STD_NV_SEED_FILE "seedfile" -#endif -#endif /* MBEDTLS_FS_IO */ -#else /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ -#if defined(MBEDTLS_PLATFORM_STD_MEM_HDR) -#include MBEDTLS_PLATFORM_STD_MEM_HDR -#endif -#endif /* MBEDTLS_PLATFORM_NO_STD_FUNCTIONS */ - - -/* \} name SECTION: Module settings */ - -/* - * The function pointers for calloc and free. - */ -#if defined(MBEDTLS_PLATFORM_MEMORY) -#if defined(MBEDTLS_PLATFORM_FREE_MACRO) && \ - defined(MBEDTLS_PLATFORM_CALLOC_MACRO) -#define mbedtls_free MBEDTLS_PLATFORM_FREE_MACRO -#define mbedtls_calloc MBEDTLS_PLATFORM_CALLOC_MACRO -#else -/* For size_t */ -#include -extern void *mbedtls_calloc( size_t n, size_t size ); -extern void mbedtls_free( void *ptr ); - -/** - * \brief This function dynamically sets the memory-management - * functions used by the library, during runtime. - * - * \param calloc_func The \c calloc function implementation. - * \param free_func The \c free function implementation. - * - * \return \c 0. - */ -int mbedtls_platform_set_calloc_free( void * (*calloc_func)( size_t, size_t ), - void (*free_func)( void * ) ); -#endif /* MBEDTLS_PLATFORM_FREE_MACRO && MBEDTLS_PLATFORM_CALLOC_MACRO */ -#else /* !MBEDTLS_PLATFORM_MEMORY */ -#define mbedtls_free free -#define mbedtls_calloc calloc -#endif /* MBEDTLS_PLATFORM_MEMORY && !MBEDTLS_PLATFORM_{FREE,CALLOC}_MACRO */ - -/* - * The function pointers for fprintf - */ -#if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) -/* We need FILE * */ -#include -extern int (*mbedtls_fprintf)( FILE *stream, const char *format, ... ); - -/** - * \brief This function dynamically configures the fprintf - * function that is called when the - * mbedtls_fprintf() function is invoked by the library. - * - * \param fprintf_func The \c fprintf function implementation. - * - * \return \c 0. - */ -int mbedtls_platform_set_fprintf( int (*fprintf_func)( FILE *stream, const char *, - ... ) ); -#else -#if defined(MBEDTLS_PLATFORM_FPRINTF_MACRO) -#define mbedtls_fprintf MBEDTLS_PLATFORM_FPRINTF_MACRO -#else -#define mbedtls_fprintf fprintf -#endif /* MBEDTLS_PLATFORM_FPRINTF_MACRO */ -#endif /* MBEDTLS_PLATFORM_FPRINTF_ALT */ - -/* - * The function pointers for printf - */ -#if defined(MBEDTLS_PLATFORM_PRINTF_ALT) -extern int (*mbedtls_printf)( const char *format, ... ); - -/** - * \brief This function dynamically configures the snprintf - * function that is called when the mbedtls_snprintf() - * function is invoked by the library. - * - * \param printf_func The \c printf function implementation. - * - * \return \c 0 on success. - */ -int mbedtls_platform_set_printf( int (*printf_func)( const char *, ... ) ); -#else /* !MBEDTLS_PLATFORM_PRINTF_ALT */ -#if defined(MBEDTLS_PLATFORM_PRINTF_MACRO) -#define mbedtls_printf MBEDTLS_PLATFORM_PRINTF_MACRO -#else -#define mbedtls_printf printf -#endif /* MBEDTLS_PLATFORM_PRINTF_MACRO */ -#endif /* MBEDTLS_PLATFORM_PRINTF_ALT */ - -/* - * The function pointers for snprintf - * - * The snprintf implementation should conform to C99: - * - it *must* always correctly zero-terminate the buffer - * (except when n == 0, then it must leave the buffer untouched) - * - however it is acceptable to return -1 instead of the required length when - * the destination buffer is too short. - */ -#if defined(MBEDTLS_PLATFORM_HAS_NON_CONFORMING_SNPRINTF) -/* For Windows (inc. MSYS2), we provide our own fixed implementation */ -int mbedtls_platform_win32_snprintf( char *s, size_t n, const char *fmt, ... ); -#endif - -#if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) -extern int (*mbedtls_snprintf)( char * s, size_t n, const char * format, ... ); - -/** - * \brief This function allows configuring a custom - * \c snprintf function pointer. - * - * \param snprintf_func The \c snprintf function implementation. - * - * \return \c 0 on success. - */ -int mbedtls_platform_set_snprintf( int (*snprintf_func)( char * s, size_t n, - const char * format, ... ) ); -#else /* MBEDTLS_PLATFORM_SNPRINTF_ALT */ -#if defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO) -#define mbedtls_snprintf MBEDTLS_PLATFORM_SNPRINTF_MACRO -#else -#define mbedtls_snprintf MBEDTLS_PLATFORM_STD_SNPRINTF -#endif /* MBEDTLS_PLATFORM_SNPRINTF_MACRO */ -#endif /* MBEDTLS_PLATFORM_SNPRINTF_ALT */ - -/* - * The function pointers for vsnprintf - * - * The vsnprintf implementation should conform to C99: - * - it *must* always correctly zero-terminate the buffer - * (except when n == 0, then it must leave the buffer untouched) - * - however it is acceptable to return -1 instead of the required length when - * the destination buffer is too short. - */ -#if defined(MBEDTLS_PLATFORM_HAS_NON_CONFORMING_VSNPRINTF) -#include -/* For Older Windows (inc. MSYS2), we provide our own fixed implementation */ -int mbedtls_platform_win32_vsnprintf( char *s, size_t n, const char *fmt, va_list arg ); -#endif - -#if defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) -#include -extern int (*mbedtls_vsnprintf)( char * s, size_t n, const char * format, va_list arg ); - -/** - * \brief Set your own snprintf function pointer - * - * \param vsnprintf_func The \c vsnprintf function implementation - * - * \return \c 0 - */ -int mbedtls_platform_set_vsnprintf( int (*vsnprintf_func)( char * s, size_t n, - const char * format, va_list arg ) ); -#else /* MBEDTLS_PLATFORM_VSNPRINTF_ALT */ -#if defined(MBEDTLS_PLATFORM_VSNPRINTF_MACRO) -#define mbedtls_vsnprintf MBEDTLS_PLATFORM_VSNPRINTF_MACRO -#else -#define mbedtls_vsnprintf vsnprintf -#endif /* MBEDTLS_PLATFORM_VSNPRINTF_MACRO */ -#endif /* MBEDTLS_PLATFORM_VSNPRINTF_ALT */ - -/* - * The function pointers for exit - */ -#if defined(MBEDTLS_PLATFORM_EXIT_ALT) -extern void (*mbedtls_exit)( int status ); - -/** - * \brief This function dynamically configures the exit - * function that is called when the mbedtls_exit() - * function is invoked by the library. - * - * \param exit_func The \c exit function implementation. - * - * \return \c 0 on success. - */ -int mbedtls_platform_set_exit( void (*exit_func)( int status ) ); -#else -#if defined(MBEDTLS_PLATFORM_EXIT_MACRO) -#define mbedtls_exit MBEDTLS_PLATFORM_EXIT_MACRO -#else -#define mbedtls_exit exit -#endif /* MBEDTLS_PLATFORM_EXIT_MACRO */ -#endif /* MBEDTLS_PLATFORM_EXIT_ALT */ - -/* - * The default exit values - */ -#if defined(MBEDTLS_PLATFORM_STD_EXIT_SUCCESS) -#define MBEDTLS_EXIT_SUCCESS MBEDTLS_PLATFORM_STD_EXIT_SUCCESS -#else -#define MBEDTLS_EXIT_SUCCESS 0 -#endif -#if defined(MBEDTLS_PLATFORM_STD_EXIT_FAILURE) -#define MBEDTLS_EXIT_FAILURE MBEDTLS_PLATFORM_STD_EXIT_FAILURE -#else -#define MBEDTLS_EXIT_FAILURE 1 -#endif - -/* - * The function pointers for reading from and writing a seed file to - * Non-Volatile storage (NV) in a platform-independent way - * - * Only enabled when the NV seed entropy source is enabled - */ -#if defined(MBEDTLS_ENTROPY_NV_SEED) -#if !defined(MBEDTLS_PLATFORM_NO_STD_FUNCTIONS) && defined(MBEDTLS_FS_IO) -/* Internal standard platform definitions */ -int mbedtls_platform_std_nv_seed_read( unsigned char *buf, size_t buf_len ); -int mbedtls_platform_std_nv_seed_write( unsigned char *buf, size_t buf_len ); -#endif - -#if defined(MBEDTLS_PLATFORM_NV_SEED_ALT) -extern int (*mbedtls_nv_seed_read)( unsigned char *buf, size_t buf_len ); -extern int (*mbedtls_nv_seed_write)( unsigned char *buf, size_t buf_len ); - -/** - * \brief This function allows configuring custom seed file writing and - * reading functions. - * - * \param nv_seed_read_func The seed reading function implementation. - * \param nv_seed_write_func The seed writing function implementation. - * - * \return \c 0 on success. - */ -int mbedtls_platform_set_nv_seed( - int (*nv_seed_read_func)( unsigned char *buf, size_t buf_len ), - int (*nv_seed_write_func)( unsigned char *buf, size_t buf_len ) - ); -#else -#if defined(MBEDTLS_PLATFORM_NV_SEED_READ_MACRO) && \ - defined(MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO) -#define mbedtls_nv_seed_read MBEDTLS_PLATFORM_NV_SEED_READ_MACRO -#define mbedtls_nv_seed_write MBEDTLS_PLATFORM_NV_SEED_WRITE_MACRO -#else -#define mbedtls_nv_seed_read mbedtls_platform_std_nv_seed_read -#define mbedtls_nv_seed_write mbedtls_platform_std_nv_seed_write -#endif -#endif /* MBEDTLS_PLATFORM_NV_SEED_ALT */ -#endif /* MBEDTLS_ENTROPY_NV_SEED */ - -#if !defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT) - -/** - * \brief The platform context structure. - * - * \note This structure may be used to assist platform-specific - * setup or teardown operations. - */ -typedef struct mbedtls_platform_context -{ - char dummy; /**< A placeholder member, as empty structs are not portable. */ -} -mbedtls_platform_context; - -#else -#include "platform_alt.h" -#endif /* !MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */ - -/** - * \brief This function performs any platform-specific initialization - * operations. - * - * \note This function should be called before any other library functions. - * - * Its implementation is platform-specific, and unless - * platform-specific code is provided, it does nothing. - * - * \note The usage and necessity of this function is dependent on the platform. - * - * \param ctx The platform context. - * - * \return \c 0 on success. - */ -int mbedtls_platform_setup( mbedtls_platform_context *ctx ); -/** - * \brief This function performs any platform teardown operations. - * - * \note This function should be called after every other Mbed TLS module - * has been correctly freed using the appropriate free function. - * - * Its implementation is platform-specific, and unless - * platform-specific code is provided, it does nothing. - * - * \note The usage and necessity of this function is dependent on the platform. - * - * \param ctx The platform context. - * - */ -void mbedtls_platform_teardown( mbedtls_platform_context *ctx ); - -#ifdef __cplusplus -} -#endif - -#endif /* platform.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_alt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_alt.h deleted file mode 100644 index 4187e8b24..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_alt.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef MBEDTLS_PLATFORM_ALT_H -#define MBEDTLS_PLATFORM_ALT_H - -#include -#include - -#if defined(MBEDTLS_CONFIG_FILE) -#include MBEDTLS_CONFIG_FILE -#endif - -#if defined(MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT) - -#define MBEDTLS_ERR_PLATFORM_SUCCESS (0) -#define MBEDTLS_ERR_PLATFORM_ERROR_PARAM_NULL (-0x7001) -#define MBEDTLS_ERR_PLATFORM_ERROR_INTERNAL (-0x7002) -#define MBEDTLS_ERR_PLATFORM_ERROR_RNG_TEST_FAILED (-0x7003) -#define MBEDTLS_ERR_PLATFORM_ERROR_HW_VERSION_FAILED (-0x7004) -#define MBEDTLS_ERR_PLATFORM_ERROR_PARAM_WRITE_FAILED (-0x7005) -#define MBEDTLS_ERR_PLATFORM_ERROR_MUTEX_NOT_INITIALIZED (-0x7016) -#define MBEDTLS_ERR_PLATFORM_ERROR_MUTEX_FAILED (-0x7017) -#define MBEDTLS_ERR_PLATFORM_ERROR_ENTROPY_NOT_INITIALIZED (-0x7018) -#define MBEDTLS_ERR_PLATFORM_ERROR_ENTROPY_TRNG_TOO_LONG (-0x7019) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief The platform context structure. - * - */ -typedef struct { - char dummy; /**< A placeholder member, as empty structs are not portable. */ -} -mbedtls_platform_context; - - -/** @brief Function to initialize platform without rng support - * - * Call this function instead of mbedtls_platform_setup if RNG is not required. - * e.g. to conserve code size of improve startup time. - * - * @note It is possible to run mbedtls_platform_setup after calling - * this API if RNG is suddenly required. Calling mbedtls_platform_teardown - * is not required to be used, in this case. - * - * @warning Only deterministic cryptographic is supported if this API is used - * to initalize the HW. - */ -int mbedtls_platform_setup_no_rng(void); - - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT */ - -#endif /* MBEDTLS_PLATFORM_ALT_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_time.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_time.h deleted file mode 100644 index fe484fd75..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_time.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * \file platform_time.h - * - * \brief mbed TLS Platform time abstraction - */ -/* - * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PLATFORM_TIME_H -#define MBEDTLS_PLATFORM_TIME_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -/* - * The time_t datatype - */ -#if defined(MBEDTLS_PLATFORM_TIME_TYPE_MACRO) -typedef MBEDTLS_PLATFORM_TIME_TYPE_MACRO mbedtls_time_t; -#else -/* For time_t */ -#include -typedef time_t mbedtls_time_t; -#endif /* MBEDTLS_PLATFORM_TIME_TYPE_MACRO */ - -/* - * The function pointers for time - */ -#if defined(MBEDTLS_PLATFORM_TIME_ALT) -extern mbedtls_time_t (*mbedtls_time)( mbedtls_time_t* time ); - -/** - * \brief Set your own time function pointer - * - * \param time_func the time function implementation - * - * \return 0 - */ -int mbedtls_platform_set_time( mbedtls_time_t (*time_func)( mbedtls_time_t* time ) ); -#else -#if defined(MBEDTLS_PLATFORM_TIME_MACRO) -#define mbedtls_time MBEDTLS_PLATFORM_TIME_MACRO -#else -#define mbedtls_time time -#endif /* MBEDTLS_PLATFORM_TIME_MACRO */ -#endif /* MBEDTLS_PLATFORM_TIME_ALT */ - -#ifdef __cplusplus -} -#endif - -#endif /* platform_time.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_util.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_util.h deleted file mode 100644 index cf0130a84..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/platform_util.h +++ /dev/null @@ -1,196 +0,0 @@ -/** - * \file platform_util.h - * - * \brief Common and shared functions used by multiple modules in the Mbed TLS - * library. - */ -/* - * Copyright (C) 2018, Arm Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_PLATFORM_UTIL_H -#define MBEDTLS_PLATFORM_UTIL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#if defined(MBEDTLS_HAVE_TIME_DATE) -#include "mbedtls/platform_time.h" -#include -#endif /* MBEDTLS_HAVE_TIME_DATE */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_CHECK_PARAMS) - -#if defined(MBEDTLS_CHECK_PARAMS_ASSERT) -/* Allow the user to define MBEDTLS_PARAM_FAILED to something like assert - * (which is what our config.h suggests). */ -#include -#endif /* MBEDTLS_CHECK_PARAMS_ASSERT */ - -#if defined(MBEDTLS_PARAM_FAILED) -/** An alternative definition of MBEDTLS_PARAM_FAILED has been set in config.h. - * - * This flag can be used to check whether it is safe to assume that - * MBEDTLS_PARAM_FAILED() will expand to a call to mbedtls_param_failed(). - */ -#define MBEDTLS_PARAM_FAILED_ALT - -#elif defined(MBEDTLS_CHECK_PARAMS_ASSERT) -#define MBEDTLS_PARAM_FAILED( cond ) assert( cond ) -#define MBEDTLS_PARAM_FAILED_ALT - -#else /* MBEDTLS_PARAM_FAILED */ -#define MBEDTLS_PARAM_FAILED( cond ) \ - mbedtls_param_failed( #cond, __FILE__, __LINE__ ) - -/** - * \brief User supplied callback function for parameter validation failure. - * See #MBEDTLS_CHECK_PARAMS for context. - * - * This function will be called unless an alternative treatement - * is defined through the #MBEDTLS_PARAM_FAILED macro. - * - * This function can return, and the operation will be aborted, or - * alternatively, through use of setjmp()/longjmp() can resume - * execution in the application code. - * - * \param failure_condition The assertion that didn't hold. - * \param file The file where the assertion failed. - * \param line The line in the file where the assertion failed. - */ -void mbedtls_param_failed( const char *failure_condition, - const char *file, - int line ); -#endif /* MBEDTLS_PARAM_FAILED */ - -/* Internal macro meant to be called only from within the library. */ -#define MBEDTLS_INTERNAL_VALIDATE_RET( cond, ret ) \ - do { \ - if( !(cond) ) \ - { \ - MBEDTLS_PARAM_FAILED( cond ); \ - return( ret ); \ - } \ - } while( 0 ) - -/* Internal macro meant to be called only from within the library. */ -#define MBEDTLS_INTERNAL_VALIDATE( cond ) \ - do { \ - if( !(cond) ) \ - { \ - MBEDTLS_PARAM_FAILED( cond ); \ - return; \ - } \ - } while( 0 ) - -#else /* MBEDTLS_CHECK_PARAMS */ - -/* Internal macros meant to be called only from within the library. */ -#define MBEDTLS_INTERNAL_VALIDATE_RET( cond, ret ) do { } while( 0 ) -#define MBEDTLS_INTERNAL_VALIDATE( cond ) do { } while( 0 ) - -#endif /* MBEDTLS_CHECK_PARAMS */ - -/* Internal helper macros for deprecating API constants. */ -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -/* Deliberately don't (yet) export MBEDTLS_DEPRECATED here - * to avoid conflict with other headers which define and use - * it, too. We might want to move all these definitions here at - * some point for uniformity. */ -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -MBEDTLS_DEPRECATED typedef char const * mbedtls_deprecated_string_constant_t; -#define MBEDTLS_DEPRECATED_STRING_CONSTANT( VAL ) \ - ( (mbedtls_deprecated_string_constant_t) ( VAL ) ) -MBEDTLS_DEPRECATED typedef int mbedtls_deprecated_numeric_constant_t; -#define MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( VAL ) \ - ( (mbedtls_deprecated_numeric_constant_t) ( VAL ) ) -#undef MBEDTLS_DEPRECATED -#else /* MBEDTLS_DEPRECATED_WARNING */ -#define MBEDTLS_DEPRECATED_STRING_CONSTANT( VAL ) VAL -#define MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( VAL ) VAL -#endif /* MBEDTLS_DEPRECATED_WARNING */ -#endif /* MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Securely zeroize a buffer - * - * The function is meant to wipe the data contained in a buffer so - * that it can no longer be recovered even if the program memory - * is later compromised. Call this function on sensitive data - * stored on the stack before returning from a function, and on - * sensitive data stored on the heap before freeing the heap - * object. - * - * It is extremely difficult to guarantee that calls to - * mbedtls_platform_zeroize() are not removed by aggressive - * compiler optimizations in a portable way. For this reason, Mbed - * TLS provides the configuration option - * MBEDTLS_PLATFORM_ZEROIZE_ALT, which allows users to configure - * mbedtls_platform_zeroize() to use a suitable implementation for - * their platform and needs - * - * \param buf Buffer to be zeroized - * \param len Length of the buffer in bytes - * - */ -void mbedtls_platform_zeroize( void *buf, size_t len ); - -#if defined(MBEDTLS_HAVE_TIME_DATE) -/** - * \brief Platform-specific implementation of gmtime_r() - * - * The function is a thread-safe abstraction that behaves - * similarly to the gmtime_r() function from Unix/POSIX. - * - * Mbed TLS will try to identify the underlying platform and - * make use of an appropriate underlying implementation (e.g. - * gmtime_r() for POSIX and gmtime_s() for Windows). If this is - * not possible, then gmtime() will be used. In this case, calls - * from the library to gmtime() will be guarded by the mutex - * mbedtls_threading_gmtime_mutex if MBEDTLS_THREADING_C is - * enabled. It is recommended that calls from outside the library - * are also guarded by this mutex. - * - * If MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, then Mbed TLS will - * unconditionally use the alternative implementation for - * mbedtls_platform_gmtime_r() supplied by the user at compile time. - * - * \param tt Pointer to an object containing time (in seconds) since the - * epoch to be converted - * \param tm_buf Pointer to an object where the results will be stored - * - * \return Pointer to an object of type struct tm on success, otherwise - * NULL - */ -struct tm *mbedtls_platform_gmtime_r( const mbedtls_time_t *tt, - struct tm *tm_buf ); -#endif /* MBEDTLS_HAVE_TIME_DATE */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_PLATFORM_UTIL_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/poly1305.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/poly1305.h deleted file mode 100644 index 4a3e35448..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/poly1305.h +++ /dev/null @@ -1,193 +0,0 @@ -/** - * \file poly1305.h - * - * \brief This file contains Poly1305 definitions and functions. - * - * Poly1305 is a one-time message authenticator that can be used to - * authenticate messages. Poly1305-AES was created by Daniel - * Bernstein https://cr.yp.to/mac/poly1305-20050329.pdf The generic - * Poly1305 algorithm (not tied to AES) was also standardized in RFC - * 7539. - * - * \author Daniel King - */ - -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_POLY1305_H -#define MBEDTLS_POLY1305_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA -0x0057 /**< Invalid input parameter(s). */ - -/* MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE is deprecated and should not be - * used. */ -#define MBEDTLS_ERR_POLY1305_FEATURE_UNAVAILABLE -0x0059 /**< Feature not available. For example, s part of the API is not implemented. */ - -/* MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED is deprecated and should not be used. - */ -#define MBEDTLS_ERR_POLY1305_HW_ACCEL_FAILED -0x005B /**< Poly1305 hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_POLY1305_ALT) - -typedef struct mbedtls_poly1305_context -{ - uint32_t r[4]; /** The value for 'r' (low 128 bits of the key). */ - uint32_t s[4]; /** The value for 's' (high 128 bits of the key). */ - uint32_t acc[5]; /** The accumulator number. */ - uint8_t queue[16]; /** The current partial block of data. */ - size_t queue_len; /** The number of bytes stored in 'queue'. */ -} -mbedtls_poly1305_context; - -#else /* MBEDTLS_POLY1305_ALT */ -#include "poly1305_alt.h" -#endif /* MBEDTLS_POLY1305_ALT */ - -/** - * \brief This function initializes the specified Poly1305 context. - * - * It must be the first API called before using - * the context. - * - * It is usually followed by a call to - * \c mbedtls_poly1305_starts(), then one or more calls to - * \c mbedtls_poly1305_update(), then one call to - * \c mbedtls_poly1305_finish(), then finally - * \c mbedtls_poly1305_free(). - * - * \param ctx The Poly1305 context to initialize. This must - * not be \c NULL. - */ -void mbedtls_poly1305_init( mbedtls_poly1305_context *ctx ); - -/** - * \brief This function releases and clears the specified - * Poly1305 context. - * - * \param ctx The Poly1305 context to clear. This may be \c NULL, in which - * case this function is a no-op. If it is not \c NULL, it must - * point to an initialized Poly1305 context. - */ -void mbedtls_poly1305_free( mbedtls_poly1305_context *ctx ); - -/** - * \brief This function sets the one-time authentication key. - * - * \warning The key must be unique and unpredictable for each - * invocation of Poly1305. - * - * \param ctx The Poly1305 context to which the key should be bound. - * This must be initialized. - * \param key The buffer containing the \c 32 Byte (\c 256 Bit) key. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_poly1305_starts( mbedtls_poly1305_context *ctx, - const unsigned char key[32] ); - -/** - * \brief This functions feeds an input buffer into an ongoing - * Poly1305 computation. - * - * It is called between \c mbedtls_cipher_poly1305_starts() and - * \c mbedtls_cipher_poly1305_finish(). - * It can be called repeatedly to process a stream of data. - * - * \param ctx The Poly1305 context to use for the Poly1305 operation. - * This must be initialized and bound to a key. - * \param ilen The length of the input data in Bytes. - * Any value is accepted. - * \param input The buffer holding the input data. - * This pointer can be \c NULL if `ilen == 0`. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_poly1305_update( mbedtls_poly1305_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function generates the Poly1305 Message - * Authentication Code (MAC). - * - * \param ctx The Poly1305 context to use for the Poly1305 operation. - * This must be initialized and bound to a key. - * \param mac The buffer to where the MAC is written. This must - * be a writable buffer of length \c 16 Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_poly1305_finish( mbedtls_poly1305_context *ctx, - unsigned char mac[16] ); - -/** - * \brief This function calculates the Poly1305 MAC of the input - * buffer with the provided key. - * - * \warning The key must be unique and unpredictable for each - * invocation of Poly1305. - * - * \param key The buffer containing the \c 32 Byte (\c 256 Bit) key. - * \param ilen The length of the input data in Bytes. - * Any value is accepted. - * \param input The buffer holding the input data. - * This pointer can be \c NULL if `ilen == 0`. - * \param mac The buffer to where the MAC is written. This must be - * a writable buffer of length \c 16 Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_poly1305_mac( const unsigned char key[32], - const unsigned char *input, - size_t ilen, - unsigned char mac[16] ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief The Poly1305 checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_poly1305_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_POLY1305_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/poly1305_alt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/poly1305_alt.h deleted file mode 100644 index 93d400d81..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/poly1305_alt.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef MBEDTLS_POLY1305_ALT_H -#define MBEDTLS_POLY1305_ALT_H - -#if defined(MBEDTLS_CONFIG_FILE) -#include MBEDTLS_CONFIG_FILE -#endif - - -#ifdef __cplusplus -extern "C" -{ -#endif - -#if defined(MBEDTLS_POLY1305_ALT) - -/************************ defines ****************************/ -/*! The size of the POLY key in words. */ -#define MBEDTLS_POLY_KEY_SIZE_WORDS 8 - -/*! The size of the POLY key in bytes. */ -#define MBEDTLS_POLY_KEY_SIZE_BYTES 32 - -/*! The size of the POLY MAC in words. */ -#define MBEDTLS_POLY_MAC_SIZE_WORDS 4 - -/*! The size of the POLY MAC in bytes. */ -#define MBEDTLS_POLY_MAC_SIZE_BYTES 16 - -/************************ Typedefs ****************************/ -/*! The definition of the ChaCha-MAC buffer. */ -typedef uint32_t mbedtls_poly_mac[MBEDTLS_POLY_MAC_SIZE_WORDS]; - -/*! The definition of the ChaCha-key buffer. */ -typedef uint32_t mbedtls_poly_key[MBEDTLS_POLY_KEY_SIZE_WORDS]; - -typedef struct mbedtls_poly1305_context -{ - uint32_t r[4]; /** The value for 'r' (low 128 bits of the key). */ - uint32_t s[4]; /** The value for 's' (high 128 bits of the key). */ - uint32_t acc[5]; /** The accumulator number. */ - uint8_t queue[16]; /** The current partial block of data. */ - size_t queue_len; /** The number of bytes stored in 'queue'. */ -} -mbedtls_poly1305_context; - -#endif - -#ifdef __cplusplus -} -#endif - - -#endif /* MBEDTLS_POLY1305_ALT_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/psa_util.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/psa_util.h deleted file mode 100644 index 513bc5feb..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/psa_util.h +++ /dev/null @@ -1,422 +0,0 @@ -/** - * \file psa_util.h - * - * \brief Utility functions for the use of the PSA Crypto library. - * - * \warning This function is not part of the public API and may - * change at any time. - */ -/* - * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ - -#ifndef MBEDTLS_PSA_UTIL_H -#define MBEDTLS_PSA_UTIL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#if defined(MBEDTLS_USE_PSA_CRYPTO) - -#include "psa/crypto.h" - -#include "mbedtls/ecp.h" -#include "mbedtls/md.h" -#include "mbedtls/pk.h" -#include "mbedtls/oid.h" - -#include - -/* Translations for symmetric crypto. */ - -static inline psa_key_type_t mbedtls_psa_translate_cipher_type( - mbedtls_cipher_type_t cipher ) -{ - switch( cipher ) - { - case MBEDTLS_CIPHER_AES_128_CCM: - case MBEDTLS_CIPHER_AES_192_CCM: - case MBEDTLS_CIPHER_AES_256_CCM: - case MBEDTLS_CIPHER_AES_128_GCM: - case MBEDTLS_CIPHER_AES_192_GCM: - case MBEDTLS_CIPHER_AES_256_GCM: - case MBEDTLS_CIPHER_AES_128_CBC: - case MBEDTLS_CIPHER_AES_192_CBC: - case MBEDTLS_CIPHER_AES_256_CBC: - return( PSA_KEY_TYPE_AES ); - - /* ARIA not yet supported in PSA. */ - /* case MBEDTLS_CIPHER_ARIA_128_CCM: - case MBEDTLS_CIPHER_ARIA_192_CCM: - case MBEDTLS_CIPHER_ARIA_256_CCM: - case MBEDTLS_CIPHER_ARIA_128_GCM: - case MBEDTLS_CIPHER_ARIA_192_GCM: - case MBEDTLS_CIPHER_ARIA_256_GCM: - case MBEDTLS_CIPHER_ARIA_128_CBC: - case MBEDTLS_CIPHER_ARIA_192_CBC: - case MBEDTLS_CIPHER_ARIA_256_CBC: - return( PSA_KEY_TYPE_ARIA ); */ - - default: - return( 0 ); - } -} - -static inline psa_algorithm_t mbedtls_psa_translate_cipher_mode( - mbedtls_cipher_mode_t mode, size_t taglen ) -{ - switch( mode ) - { - case MBEDTLS_MODE_GCM: - return( PSA_ALG_AEAD_WITH_TAG_LENGTH( PSA_ALG_GCM, taglen ) ); - case MBEDTLS_MODE_CCM: - return( PSA_ALG_AEAD_WITH_TAG_LENGTH( PSA_ALG_CCM, taglen ) ); - case MBEDTLS_MODE_CBC: - if( taglen == 0 ) - return( PSA_ALG_CBC_NO_PADDING ); - /* Intentional fallthrough for taglen != 0 */ - /* fallthrough */ - default: - return( 0 ); - } -} - -static inline psa_key_usage_t mbedtls_psa_translate_cipher_operation( - mbedtls_operation_t op ) -{ - switch( op ) - { - case MBEDTLS_ENCRYPT: - return( PSA_KEY_USAGE_ENCRYPT ); - case MBEDTLS_DECRYPT: - return( PSA_KEY_USAGE_DECRYPT ); - default: - return( 0 ); - } -} - -/* Translations for hashing. */ - -static inline psa_algorithm_t mbedtls_psa_translate_md( mbedtls_md_type_t md_alg ) -{ - switch( md_alg ) - { -#if defined(MBEDTLS_MD2_C) - case MBEDTLS_MD_MD2: - return( PSA_ALG_MD2 ); -#endif -#if defined(MBEDTLS_MD4_C) - case MBEDTLS_MD_MD4: - return( PSA_ALG_MD4 ); -#endif -#if defined(MBEDTLS_MD5_C) - case MBEDTLS_MD_MD5: - return( PSA_ALG_MD5 ); -#endif -#if defined(MBEDTLS_SHA1_C) - case MBEDTLS_MD_SHA1: - return( PSA_ALG_SHA_1 ); -#endif -#if defined(MBEDTLS_SHA256_C) - case MBEDTLS_MD_SHA224: - return( PSA_ALG_SHA_224 ); - case MBEDTLS_MD_SHA256: - return( PSA_ALG_SHA_256 ); -#endif -#if defined(MBEDTLS_SHA512_C) - case MBEDTLS_MD_SHA384: - return( PSA_ALG_SHA_384 ); - case MBEDTLS_MD_SHA512: - return( PSA_ALG_SHA_512 ); -#endif -#if defined(MBEDTLS_RIPEMD160_C) - case MBEDTLS_MD_RIPEMD160: - return( PSA_ALG_RIPEMD160 ); -#endif - case MBEDTLS_MD_NONE: /* Intentional fallthrough */ - default: - return( 0 ); - } -} - -/* Translations for ECC. */ - -static inline int mbedtls_psa_get_ecc_oid_from_id( - psa_ecc_curve_t curve, size_t bits, - char const **oid, size_t *oid_len ) -{ - switch( curve ) - { - case PSA_ECC_CURVE_SECP_R1: - switch( bits ) - { -#if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) - case 192: - *oid = MBEDTLS_OID_EC_GRP_SECP192R1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP192R1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */ -#if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) - case 224: - *oid = MBEDTLS_OID_EC_GRP_SECP224R1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP224R1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */ -#if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) - case 256: - *oid = MBEDTLS_OID_EC_GRP_SECP256R1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP256R1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_SECP256R1_ENABLED */ -#if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) - case 384: - *oid = MBEDTLS_OID_EC_GRP_SECP384R1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP384R1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_SECP384R1_ENABLED */ -#if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) - case 521: - *oid = MBEDTLS_OID_EC_GRP_SECP521R1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP521R1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */ - } - break; - case PSA_ECC_CURVE_SECP_K1: - switch( bits ) - { -#if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) - case 192: - *oid = MBEDTLS_OID_EC_GRP_SECP192K1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP192K1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_SECP192K1_ENABLED */ -#if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) - case 224: - *oid = MBEDTLS_OID_EC_GRP_SECP224K1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP224K1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_SECP224K1_ENABLED */ -#if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) - case 256: - *oid = MBEDTLS_OID_EC_GRP_SECP256K1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_SECP256K1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_SECP256K1_ENABLED */ - } - break; - case PSA_ECC_CURVE_BRAINPOOL_P_R1: - switch( bits ) - { -#if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) - case 256: - *oid = MBEDTLS_OID_EC_GRP_BP256R1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_BP256R1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_BP256R1_ENABLED */ -#if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) - case 384: - *oid = MBEDTLS_OID_EC_GRP_BP384R1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_BP384R1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_BP384R1_ENABLED */ -#if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) - case 512: - *oid = MBEDTLS_OID_EC_GRP_BP512R1; - *oid_len = MBEDTLS_OID_SIZE( MBEDTLS_OID_EC_GRP_BP512R1 ); - return( 0 ); -#endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */ - } - break; - } - (void) oid; - (void) oid_len; - return( -1 ); -} - -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH 1 - -#if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 192 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 192 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_SECP192R1_ENABLED */ - -#if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 224 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 224 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_SECP224R1_ENABLED */ - -#if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_SECP256R1_ENABLED */ - -#if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 384 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 384 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_SECP384R1_ENABLED */ - -#if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 521 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 521 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_SECP521R1_ENABLED */ - -#if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 192 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 192 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_SECP192K1_ENABLED */ - -#if defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 224 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 224 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_SECP224K1_ENABLED */ - -#if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_SECP256K1_ENABLED */ - -#if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 256 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_BP256R1_ENABLED */ - -#if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 384 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 384 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_BP384R1_ENABLED */ - -#if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED) -#if MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH < ( 2 * ( ( 512 + 7 ) / 8 ) + 1 ) -#undef MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH -#define MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH ( 2 * ( ( 512 + 7 ) / 8 ) + 1 ) -#endif -#endif /* MBEDTLS_ECP_DP_BP512R1_ENABLED */ - - -/* Translations for PK layer */ - -static inline int mbedtls_psa_err_translate_pk( psa_status_t status ) -{ - switch( status ) - { - case PSA_SUCCESS: - return( 0 ); - case PSA_ERROR_NOT_SUPPORTED: - return( MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE ); - case PSA_ERROR_INSUFFICIENT_MEMORY: - return( MBEDTLS_ERR_PK_ALLOC_FAILED ); - case PSA_ERROR_INSUFFICIENT_ENTROPY: - return( MBEDTLS_ERR_ECP_RANDOM_FAILED ); - case PSA_ERROR_BAD_STATE: - return( MBEDTLS_ERR_PK_BAD_INPUT_DATA ); - /* All other failures */ - case PSA_ERROR_COMMUNICATION_FAILURE: - case PSA_ERROR_HARDWARE_FAILURE: - case PSA_ERROR_CORRUPTION_DETECTED: - return( MBEDTLS_ERR_PK_HW_ACCEL_FAILED ); - default: /* We return the same as for the 'other failures', - * but list them separately nonetheless to indicate - * which failure conditions we have considered. */ - return( MBEDTLS_ERR_PK_HW_ACCEL_FAILED ); - } -} - -/* Translations for ECC */ - -/* This function transforms an ECC group identifier from - * https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-8 - * into a PSA ECC group identifier. */ -#if defined(MBEDTLS_ECP_C) -static inline psa_key_type_t mbedtls_psa_parse_tls_ecc_group( - uint16_t tls_ecc_grp_reg_id, size_t *bits ) -{ - const mbedtls_ecp_curve_info *curve_info = - mbedtls_ecp_curve_info_from_tls_id( tls_ecc_grp_reg_id ); - if( curve_info == NULL ) - return( 0 ); - return( PSA_KEY_TYPE_ECC_KEY_PAIR( - mbedtls_ecc_group_to_psa( curve_info->grp_id, bits ) ) ); -} -#endif /* MBEDTLS_ECP_C */ - -/* This function takes a buffer holding an EC public key - * exported through psa_export_public_key(), and converts - * it into an ECPoint structure to be put into a ClientKeyExchange - * message in an ECDHE exchange. - * - * Both the present and the foreseeable future format of EC public keys - * used by PSA have the ECPoint structure contained in the exported key - * as a subbuffer, and the function merely selects this subbuffer instead - * of making a copy. - */ -static inline int mbedtls_psa_tls_psa_ec_to_ecpoint( unsigned char *src, - size_t srclen, - unsigned char **dst, - size_t *dstlen ) -{ - *dst = src; - *dstlen = srclen; - return( 0 ); -} - -/* This function takes a buffer holding an ECPoint structure - * (as contained in a TLS ServerKeyExchange message for ECDHE - * exchanges) and converts it into a format that the PSA key - * agreement API understands. - */ -static inline int mbedtls_psa_tls_ecpoint_to_psa_ec( unsigned char const *src, - size_t srclen, - unsigned char *dst, - size_t dstlen, - size_t *olen ) -{ - if( srclen > dstlen ) - return( MBEDTLS_ERR_ECP_BUFFER_TOO_SMALL ); - - memcpy( dst, src, srclen ); - *olen = srclen; - return( 0 ); -} - -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -#endif /* MBEDTLS_PSA_UTIL_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ripemd160.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ripemd160.h deleted file mode 100644 index 3c1f5bf50..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ripemd160.h +++ /dev/null @@ -1,237 +0,0 @@ -/** - * \file ripemd160.h - * - * \brief RIPE MD-160 message digest - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_RIPEMD160_H -#define MBEDTLS_RIPEMD160_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -/* MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED is deprecated and should not be used. - */ -#define MBEDTLS_ERR_RIPEMD160_HW_ACCEL_FAILED -0x0031 /**< RIPEMD160 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_RIPEMD160_ALT) -// Regular implementation -// - -/** - * \brief RIPEMD-160 context structure - */ -typedef struct mbedtls_ripemd160_context -{ - uint32_t total[2]; /*!< number of bytes processed */ - uint32_t state[5]; /*!< intermediate digest state */ - unsigned char buffer[64]; /*!< data block being processed */ -} -mbedtls_ripemd160_context; - -#else /* MBEDTLS_RIPEMD160_ALT */ -#include "ripemd160_alt.h" -#endif /* MBEDTLS_RIPEMD160_ALT */ - -/** - * \brief Initialize RIPEMD-160 context - * - * \param ctx RIPEMD-160 context to be initialized - */ -void mbedtls_ripemd160_init( mbedtls_ripemd160_context *ctx ); - -/** - * \brief Clear RIPEMD-160 context - * - * \param ctx RIPEMD-160 context to be cleared - */ -void mbedtls_ripemd160_free( mbedtls_ripemd160_context *ctx ); - -/** - * \brief Clone (the state of) an RIPEMD-160 context - * - * \param dst The destination context - * \param src The context to be cloned - */ -void mbedtls_ripemd160_clone( mbedtls_ripemd160_context *dst, - const mbedtls_ripemd160_context *src ); - -/** - * \brief RIPEMD-160 context setup - * - * \param ctx context to be initialized - * - * \return 0 if successful - */ -int mbedtls_ripemd160_starts_ret( mbedtls_ripemd160_context *ctx ); - -/** - * \brief RIPEMD-160 process buffer - * - * \param ctx RIPEMD-160 context - * \param input buffer holding the data - * \param ilen length of the input data - * - * \return 0 if successful - */ -int mbedtls_ripemd160_update_ret( mbedtls_ripemd160_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief RIPEMD-160 final digest - * - * \param ctx RIPEMD-160 context - * \param output RIPEMD-160 checksum result - * - * \return 0 if successful - */ -int mbedtls_ripemd160_finish_ret( mbedtls_ripemd160_context *ctx, - unsigned char output[20] ); - -/** - * \brief RIPEMD-160 process data block (internal use only) - * - * \param ctx RIPEMD-160 context - * \param data buffer holding one block of data - * - * \return 0 if successful - */ -int mbedtls_internal_ripemd160_process( mbedtls_ripemd160_context *ctx, - const unsigned char data[64] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief RIPEMD-160 context setup - * - * \deprecated Superseded by mbedtls_ripemd160_starts_ret() in 2.7.0 - * - * \param ctx context to be initialized - */ -MBEDTLS_DEPRECATED void mbedtls_ripemd160_starts( - mbedtls_ripemd160_context *ctx ); - -/** - * \brief RIPEMD-160 process buffer - * - * \deprecated Superseded by mbedtls_ripemd160_update_ret() in 2.7.0 - * - * \param ctx RIPEMD-160 context - * \param input buffer holding the data - * \param ilen length of the input data - */ -MBEDTLS_DEPRECATED void mbedtls_ripemd160_update( - mbedtls_ripemd160_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief RIPEMD-160 final digest - * - * \deprecated Superseded by mbedtls_ripemd160_finish_ret() in 2.7.0 - * - * \param ctx RIPEMD-160 context - * \param output RIPEMD-160 checksum result - */ -MBEDTLS_DEPRECATED void mbedtls_ripemd160_finish( - mbedtls_ripemd160_context *ctx, - unsigned char output[20] ); - -/** - * \brief RIPEMD-160 process data block (internal use only) - * - * \deprecated Superseded by mbedtls_internal_ripemd160_process() in 2.7.0 - * - * \param ctx RIPEMD-160 context - * \param data buffer holding one block of data - */ -MBEDTLS_DEPRECATED void mbedtls_ripemd160_process( - mbedtls_ripemd160_context *ctx, - const unsigned char data[64] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Output = RIPEMD-160( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output RIPEMD-160 checksum result - * - * \return 0 if successful - */ -int mbedtls_ripemd160_ret( const unsigned char *input, - size_t ilen, - unsigned char output[20] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief Output = RIPEMD-160( input buffer ) - * - * \deprecated Superseded by mbedtls_ripemd160_ret() in 2.7.0 - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output RIPEMD-160 checksum result - */ -MBEDTLS_DEPRECATED void mbedtls_ripemd160( const unsigned char *input, - size_t ilen, - unsigned char output[20] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_ripemd160_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_ripemd160.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/rsa.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/rsa.h deleted file mode 100644 index ec8d0d8de..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/rsa.h +++ /dev/null @@ -1,1277 +0,0 @@ -/** - * \file rsa.h - * - * \brief This file provides an API for the RSA public-key cryptosystem. - * - * The RSA public-key cryptosystem is defined in Public-Key - * Cryptography Standards (PKCS) #1 v1.5: RSA Encryption - * and Public-Key Cryptography Standards (PKCS) #1 v2.1: - * RSA Cryptography Specifications. - * - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_RSA_H -#define MBEDTLS_RSA_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/bignum.h" -#include "mbedtls/md.h" - -#if defined(MBEDTLS_THREADING_C) -#include "mbedtls/threading.h" -#endif - -/* - * RSA Error codes - */ -#define MBEDTLS_ERR_RSA_BAD_INPUT_DATA -0x4080 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_RSA_INVALID_PADDING -0x4100 /**< Input data contains invalid padding and is rejected. */ -#define MBEDTLS_ERR_RSA_KEY_GEN_FAILED -0x4180 /**< Something failed during generation of a key. */ -#define MBEDTLS_ERR_RSA_KEY_CHECK_FAILED -0x4200 /**< Key failed to pass the validity check of the library. */ -#define MBEDTLS_ERR_RSA_PUBLIC_FAILED -0x4280 /**< The public key operation failed. */ -#define MBEDTLS_ERR_RSA_PRIVATE_FAILED -0x4300 /**< The private key operation failed. */ -#define MBEDTLS_ERR_RSA_VERIFY_FAILED -0x4380 /**< The PKCS#1 verification failed. */ -#define MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE -0x4400 /**< The output buffer for decryption is not large enough. */ -#define MBEDTLS_ERR_RSA_RNG_FAILED -0x4480 /**< The random generator failed to generate non-zeros. */ - -/* MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION is deprecated and should not be used. - */ -#define MBEDTLS_ERR_RSA_UNSUPPORTED_OPERATION -0x4500 /**< The implementation does not offer the requested operation, for example, because of security violations or lack of functionality. */ - -/* MBEDTLS_ERR_RSA_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_RSA_HW_ACCEL_FAILED -0x4580 /**< RSA hardware accelerator failed. */ - -/* - * RSA constants - */ -#define MBEDTLS_RSA_PUBLIC 0 /**< Request private key operation. */ -#define MBEDTLS_RSA_PRIVATE 1 /**< Request public key operation. */ - -#define MBEDTLS_RSA_PKCS_V15 0 /**< Use PKCS#1 v1.5 encoding. */ -#define MBEDTLS_RSA_PKCS_V21 1 /**< Use PKCS#1 v2.1 encoding. */ - -#define MBEDTLS_RSA_SIGN 1 /**< Identifier for RSA signature operations. */ -#define MBEDTLS_RSA_CRYPT 2 /**< Identifier for RSA encryption and decryption operations. */ - -#define MBEDTLS_RSA_SALT_LEN_ANY -1 - -/* - * The above constants may be used even if the RSA module is compile out, - * eg for alternative (PKCS#11) RSA implemenations in the PK layers. - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_RSA_ALT) -// Regular implementation -// - -/** - * \brief The RSA context structure. - * - * \note Direct manipulation of the members of this structure - * is deprecated. All manipulation should instead be done through - * the public interface functions. - */ -typedef struct mbedtls_rsa_context -{ - int ver; /*!< Always 0.*/ - size_t len; /*!< The size of \p N in Bytes. */ - - mbedtls_mpi N; /*!< The public modulus. */ - mbedtls_mpi E; /*!< The public exponent. */ - - mbedtls_mpi D; /*!< The private exponent. */ - mbedtls_mpi P; /*!< The first prime factor. */ - mbedtls_mpi Q; /*!< The second prime factor. */ - - mbedtls_mpi DP; /*!< D % (P - 1). */ - mbedtls_mpi DQ; /*!< D % (Q - 1). */ - mbedtls_mpi QP; /*!< 1 / (Q % P). */ - - mbedtls_mpi RN; /*!< cached R^2 mod N. */ - - mbedtls_mpi RP; /*!< cached R^2 mod P. */ - mbedtls_mpi RQ; /*!< cached R^2 mod Q. */ - - mbedtls_mpi Vi; /*!< The cached blinding value. */ - mbedtls_mpi Vf; /*!< The cached un-blinding value. */ - - int padding; /*!< Selects padding mode: - #MBEDTLS_RSA_PKCS_V15 for 1.5 padding and - #MBEDTLS_RSA_PKCS_V21 for OAEP or PSS. */ - int hash_id; /*!< Hash identifier of mbedtls_md_type_t type, - as specified in md.h for use in the MGF - mask generating function used in the - EME-OAEP and EMSA-PSS encodings. */ -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; /*!< Thread-safety mutex. */ -#endif -} -mbedtls_rsa_context; - -#else /* MBEDTLS_RSA_ALT */ -#include "rsa_alt.h" -#endif /* MBEDTLS_RSA_ALT */ - -/** - * \brief This function initializes an RSA context. - * - * \note Set padding to #MBEDTLS_RSA_PKCS_V21 for the RSAES-OAEP - * encryption scheme and the RSASSA-PSS signature scheme. - * - * \note The \p hash_id parameter is ignored when using - * #MBEDTLS_RSA_PKCS_V15 padding. - * - * \note The choice of padding mode is strictly enforced for private key - * operations, since there might be security concerns in - * mixing padding modes. For public key operations it is - * a default value, which can be overridden by calling specific - * \c rsa_rsaes_xxx or \c rsa_rsassa_xxx functions. - * - * \note The hash selected in \p hash_id is always used for OEAP - * encryption. For PSS signatures, it is always used for - * making signatures, but can be overridden for verifying them. - * If set to #MBEDTLS_MD_NONE, it is always overridden. - * - * \param ctx The RSA context to initialize. This must not be \c NULL. - * \param padding The padding mode to use. This must be either - * #MBEDTLS_RSA_PKCS_V15 or #MBEDTLS_RSA_PKCS_V21. - * \param hash_id The hash identifier of ::mbedtls_md_type_t type, if - * \p padding is #MBEDTLS_RSA_PKCS_V21. It is unused - * otherwise. - */ -void mbedtls_rsa_init( mbedtls_rsa_context *ctx, - int padding, - int hash_id ); - -/** - * \brief This function imports a set of core parameters into an - * RSA context. - * - * \note This function can be called multiple times for successive - * imports, if the parameters are not simultaneously present. - * - * Any sequence of calls to this function should be followed - * by a call to mbedtls_rsa_complete(), which checks and - * completes the provided information to a ready-for-use - * public or private RSA key. - * - * \note See mbedtls_rsa_complete() for more information on which - * parameters are necessary to set up a private or public - * RSA key. - * - * \note The imported parameters are copied and need not be preserved - * for the lifetime of the RSA context being set up. - * - * \param ctx The initialized RSA context to store the parameters in. - * \param N The RSA modulus. This may be \c NULL. - * \param P The first prime factor of \p N. This may be \c NULL. - * \param Q The second prime factor of \p N. This may be \c NULL. - * \param D The private exponent. This may be \c NULL. - * \param E The public exponent. This may be \c NULL. - * - * \return \c 0 on success. - * \return A non-zero error code on failure. - */ -int mbedtls_rsa_import( mbedtls_rsa_context *ctx, - const mbedtls_mpi *N, - const mbedtls_mpi *P, const mbedtls_mpi *Q, - const mbedtls_mpi *D, const mbedtls_mpi *E ); - -/** - * \brief This function imports core RSA parameters, in raw big-endian - * binary format, into an RSA context. - * - * \note This function can be called multiple times for successive - * imports, if the parameters are not simultaneously present. - * - * Any sequence of calls to this function should be followed - * by a call to mbedtls_rsa_complete(), which checks and - * completes the provided information to a ready-for-use - * public or private RSA key. - * - * \note See mbedtls_rsa_complete() for more information on which - * parameters are necessary to set up a private or public - * RSA key. - * - * \note The imported parameters are copied and need not be preserved - * for the lifetime of the RSA context being set up. - * - * \param ctx The initialized RSA context to store the parameters in. - * \param N The RSA modulus. This may be \c NULL. - * \param N_len The Byte length of \p N; it is ignored if \p N == NULL. - * \param P The first prime factor of \p N. This may be \c NULL. - * \param P_len The Byte length of \p P; it ns ignored if \p P == NULL. - * \param Q The second prime factor of \p N. This may be \c NULL. - * \param Q_len The Byte length of \p Q; it is ignored if \p Q == NULL. - * \param D The private exponent. This may be \c NULL. - * \param D_len The Byte length of \p D; it is ignored if \p D == NULL. - * \param E The public exponent. This may be \c NULL. - * \param E_len The Byte length of \p E; it is ignored if \p E == NULL. - * - * \return \c 0 on success. - * \return A non-zero error code on failure. - */ -int mbedtls_rsa_import_raw( mbedtls_rsa_context *ctx, - unsigned char const *N, size_t N_len, - unsigned char const *P, size_t P_len, - unsigned char const *Q, size_t Q_len, - unsigned char const *D, size_t D_len, - unsigned char const *E, size_t E_len ); - -/** - * \brief This function completes an RSA context from - * a set of imported core parameters. - * - * To setup an RSA public key, precisely \p N and \p E - * must have been imported. - * - * To setup an RSA private key, sufficient information must - * be present for the other parameters to be derivable. - * - * The default implementation supports the following: - *
  • Derive \p P, \p Q from \p N, \p D, \p E.
  • - *
  • Derive \p N, \p D from \p P, \p Q, \p E.
- * Alternative implementations need not support these. - * - * If this function runs successfully, it guarantees that - * the RSA context can be used for RSA operations without - * the risk of failure or crash. - * - * \warning This function need not perform consistency checks - * for the imported parameters. In particular, parameters that - * are not needed by the implementation might be silently - * discarded and left unchecked. To check the consistency - * of the key material, see mbedtls_rsa_check_privkey(). - * - * \param ctx The initialized RSA context holding imported parameters. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_RSA_BAD_INPUT_DATA if the attempted derivations - * failed. - * - */ -int mbedtls_rsa_complete( mbedtls_rsa_context *ctx ); - -/** - * \brief This function exports the core parameters of an RSA key. - * - * If this function runs successfully, the non-NULL buffers - * pointed to by \p N, \p P, \p Q, \p D, and \p E are fully - * written, with additional unused space filled leading by - * zero Bytes. - * - * Possible reasons for returning - * #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED:
    - *
  • An alternative RSA implementation is in use, which - * stores the key externally, and either cannot or should - * not export it into RAM.
  • - *
  • A SW or HW implementation might not support a certain - * deduction. For example, \p P, \p Q from \p N, \p D, - * and \p E if the former are not part of the - * implementation.
- * - * If the function fails due to an unsupported operation, - * the RSA context stays intact and remains usable. - * - * \param ctx The initialized RSA context. - * \param N The MPI to hold the RSA modulus. - * This may be \c NULL if this field need not be exported. - * \param P The MPI to hold the first prime factor of \p N. - * This may be \c NULL if this field need not be exported. - * \param Q The MPI to hold the second prime factor of \p N. - * This may be \c NULL if this field need not be exported. - * \param D The MPI to hold the private exponent. - * This may be \c NULL if this field need not be exported. - * \param E The MPI to hold the public exponent. - * This may be \c NULL if this field need not be exported. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED if exporting the - * requested parameters cannot be done due to missing - * functionality or because of security policies. - * \return A non-zero return code on any other failure. - * - */ -int mbedtls_rsa_export( const mbedtls_rsa_context *ctx, - mbedtls_mpi *N, mbedtls_mpi *P, mbedtls_mpi *Q, - mbedtls_mpi *D, mbedtls_mpi *E ); - -/** - * \brief This function exports core parameters of an RSA key - * in raw big-endian binary format. - * - * If this function runs successfully, the non-NULL buffers - * pointed to by \p N, \p P, \p Q, \p D, and \p E are fully - * written, with additional unused space filled leading by - * zero Bytes. - * - * Possible reasons for returning - * #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED:
    - *
  • An alternative RSA implementation is in use, which - * stores the key externally, and either cannot or should - * not export it into RAM.
  • - *
  • A SW or HW implementation might not support a certain - * deduction. For example, \p P, \p Q from \p N, \p D, - * and \p E if the former are not part of the - * implementation.
- * If the function fails due to an unsupported operation, - * the RSA context stays intact and remains usable. - * - * \note The length parameters are ignored if the corresponding - * buffer pointers are NULL. - * - * \param ctx The initialized RSA context. - * \param N The Byte array to store the RSA modulus, - * or \c NULL if this field need not be exported. - * \param N_len The size of the buffer for the modulus. - * \param P The Byte array to hold the first prime factor of \p N, - * or \c NULL if this field need not be exported. - * \param P_len The size of the buffer for the first prime factor. - * \param Q The Byte array to hold the second prime factor of \p N, - * or \c NULL if this field need not be exported. - * \param Q_len The size of the buffer for the second prime factor. - * \param D The Byte array to hold the private exponent, - * or \c NULL if this field need not be exported. - * \param D_len The size of the buffer for the private exponent. - * \param E The Byte array to hold the public exponent, - * or \c NULL if this field need not be exported. - * \param E_len The size of the buffer for the public exponent. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED if exporting the - * requested parameters cannot be done due to missing - * functionality or because of security policies. - * \return A non-zero return code on any other failure. - */ -int mbedtls_rsa_export_raw( const mbedtls_rsa_context *ctx, - unsigned char *N, size_t N_len, - unsigned char *P, size_t P_len, - unsigned char *Q, size_t Q_len, - unsigned char *D, size_t D_len, - unsigned char *E, size_t E_len ); - -/** - * \brief This function exports CRT parameters of a private RSA key. - * - * \note Alternative RSA implementations not using CRT-parameters - * internally can implement this function based on - * mbedtls_rsa_deduce_opt(). - * - * \param ctx The initialized RSA context. - * \param DP The MPI to hold \c D modulo `P-1`, - * or \c NULL if it need not be exported. - * \param DQ The MPI to hold \c D modulo `Q-1`, - * or \c NULL if it need not be exported. - * \param QP The MPI to hold modular inverse of \c Q modulo \c P, - * or \c NULL if it need not be exported. - * - * \return \c 0 on success. - * \return A non-zero error code on failure. - * - */ -int mbedtls_rsa_export_crt( const mbedtls_rsa_context *ctx, - mbedtls_mpi *DP, mbedtls_mpi *DQ, mbedtls_mpi *QP ); - -/** - * \brief This function sets padding for an already initialized RSA - * context. See mbedtls_rsa_init() for details. - * - * \param ctx The initialized RSA context to be configured. - * \param padding The padding mode to use. This must be either - * #MBEDTLS_RSA_PKCS_V15 or #MBEDTLS_RSA_PKCS_V21. - * \param hash_id The #MBEDTLS_RSA_PKCS_V21 hash identifier. - */ -void mbedtls_rsa_set_padding( mbedtls_rsa_context *ctx, int padding, - int hash_id ); - -/** - * \brief This function retrieves the length of RSA modulus in Bytes. - * - * \param ctx The initialized RSA context. - * - * \return The length of the RSA modulus in Bytes. - * - */ -size_t mbedtls_rsa_get_len( const mbedtls_rsa_context *ctx ); - -/** - * \brief This function generates an RSA keypair. - * - * \note mbedtls_rsa_init() must be called before this function, - * to set up the RSA context. - * - * \param ctx The initialized RSA context used to hold the key. - * \param f_rng The RNG function to be used for key generation. - * This must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. - * This may be \c NULL if \p f_rng doesn't need a context. - * \param nbits The size of the public key in bits. - * \param exponent The public exponent to use. For example, \c 65537. - * This must be odd and greater than \c 1. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_gen_key( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - unsigned int nbits, int exponent ); - -/** - * \brief This function checks if a context contains at least an RSA - * public key. - * - * If the function runs successfully, it is guaranteed that - * enough information is present to perform an RSA public key - * operation using mbedtls_rsa_public(). - * - * \param ctx The initialized RSA context to check. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - * - */ -int mbedtls_rsa_check_pubkey( const mbedtls_rsa_context *ctx ); - -/** - * \brief This function checks if a context contains an RSA private key - * and perform basic consistency checks. - * - * \note The consistency checks performed by this function not only - * ensure that mbedtls_rsa_private() can be called successfully - * on the given context, but that the various parameters are - * mutually consistent with high probability, in the sense that - * mbedtls_rsa_public() and mbedtls_rsa_private() are inverses. - * - * \warning This function should catch accidental misconfigurations - * like swapping of parameters, but it cannot establish full - * trust in neither the quality nor the consistency of the key - * material that was used to setup the given RSA context: - *
  • Consistency: Imported parameters that are irrelevant - * for the implementation might be silently dropped. If dropped, - * the current function does not have access to them, - * and therefore cannot check them. See mbedtls_rsa_complete(). - * If you want to check the consistency of the entire - * content of an PKCS1-encoded RSA private key, for example, you - * should use mbedtls_rsa_validate_params() before setting - * up the RSA context. - * Additionally, if the implementation performs empirical checks, - * these checks substantiate but do not guarantee consistency.
  • - *
  • Quality: This function is not expected to perform - * extended quality assessments like checking that the prime - * factors are safe. Additionally, it is the responsibility of the - * user to ensure the trustworthiness of the source of his RSA - * parameters, which goes beyond what is effectively checkable - * by the library.
- * - * \param ctx The initialized RSA context to check. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_check_privkey( const mbedtls_rsa_context *ctx ); - -/** - * \brief This function checks a public-private RSA key pair. - * - * It checks each of the contexts, and makes sure they match. - * - * \param pub The initialized RSA context holding the public key. - * \param prv The initialized RSA context holding the private key. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_check_pub_priv( const mbedtls_rsa_context *pub, - const mbedtls_rsa_context *prv ); - -/** - * \brief This function performs an RSA public key operation. - * - * \param ctx The initialized RSA context to use. - * \param input The input buffer. This must be a readable buffer - * of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * \param output The output buffer. This must be a writable buffer - * of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * - * \note This function does not handle message padding. - * - * \note Make sure to set \p input[0] = 0 or ensure that - * input is smaller than \p N. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_public( mbedtls_rsa_context *ctx, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function performs an RSA private key operation. - * - * \note Blinding is used if and only if a PRNG is provided. - * - * \note If blinding is used, both the base of exponentation - * and the exponent are blinded, providing protection - * against some side-channel attacks. - * - * \warning It is deprecated and a security risk to not provide - * a PRNG here and thereby prevent the use of blinding. - * Future versions of the library may enforce the presence - * of a PRNG. - * - * \param ctx The initialized RSA context to use. - * \param f_rng The RNG function, used for blinding. It is discouraged - * and deprecated to pass \c NULL here, in which case - * blinding will be omitted. - * \param p_rng The RNG context to pass to \p f_rng. This may be \c NULL - * if \p f_rng is \c NULL or if \p f_rng doesn't need a context. - * \param input The input buffer. This must be a readable buffer - * of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * \param output The output buffer. This must be a writable buffer - * of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - * - */ -int mbedtls_rsa_private( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function adds the message padding, then performs an RSA - * operation. - * - * It is the generic wrapper for performing a PKCS#1 encryption - * operation using the \p mode from the context. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA context to use. - * \param f_rng The RNG to use. It is mandatory for PKCS#1 v2.1 padding - * encoding, and for PKCS#1 v1.5 padding encoding when used - * with \p mode set to #MBEDTLS_RSA_PUBLIC. For PKCS#1 v1.5 - * padding encoding and \p mode set to #MBEDTLS_RSA_PRIVATE, - * it is used for blinding and should be provided in this - * case; see mbedtls_rsa_private() for more. - * \param p_rng The RNG context to be passed to \p f_rng. May be - * \c NULL if \p f_rng is \c NULL or if \p f_rng doesn't - * need a context argument. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated). - * \param ilen The length of the plaintext in Bytes. - * \param input The input data to encrypt. This must be a readable - * buffer of size \p ilen Bytes. It may be \c NULL if - * `ilen == 0`. - * \param output The output buffer. This must be a writable buffer - * of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_pkcs1_encrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, size_t ilen, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function performs a PKCS#1 v1.5 encryption operation - * (RSAES-PKCS1-v1_5-ENCRYPT). - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA context to use. - * \param f_rng The RNG function to use. It is needed for padding generation - * if \p mode is #MBEDTLS_RSA_PUBLIC. If \p mode is - * #MBEDTLS_RSA_PRIVATE (discouraged), it is used for - * blinding and should be provided; see mbedtls_rsa_private(). - * \param p_rng The RNG context to be passed to \p f_rng. This may - * be \c NULL if \p f_rng is \c NULL or if \p f_rng - * doesn't need a context argument. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated). - * \param ilen The length of the plaintext in Bytes. - * \param input The input data to encrypt. This must be a readable - * buffer of size \p ilen Bytes. It may be \c NULL if - * `ilen == 0`. - * \param output The output buffer. This must be a writable buffer - * of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsaes_pkcs1_v15_encrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, size_t ilen, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function performs a PKCS#1 v2.1 OAEP encryption - * operation (RSAES-OAEP-ENCRYPT). - * - * \note The output buffer must be as large as the size - * of ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initnialized RSA context to use. - * \param f_rng The RNG function to use. This is needed for padding - * generation and must be provided. - * \param p_rng The RNG context to be passed to \p f_rng. This may - * be \c NULL if \p f_rng doesn't need a context argument. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated). - * \param label The buffer holding the custom label to use. - * This must be a readable buffer of length \p label_len - * Bytes. It may be \c NULL if \p label_len is \c 0. - * \param label_len The length of the label in Bytes. - * \param ilen The length of the plaintext buffer \p input in Bytes. - * \param input The input data to encrypt. This must be a readable - * buffer of size \p ilen Bytes. It may be \c NULL if - * `ilen == 0`. - * \param output The output buffer. This must be a writable buffer - * of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsaes_oaep_encrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - const unsigned char *label, size_t label_len, - size_t ilen, - const unsigned char *input, - unsigned char *output ); - -/** - * \brief This function performs an RSA operation, then removes the - * message padding. - * - * It is the generic wrapper for performing a PKCS#1 decryption - * operation using the \p mode from the context. - * - * \note The output buffer length \c output_max_len should be - * as large as the size \p ctx->len of \p ctx->N (for example, - * 128 Bytes if RSA-1024 is used) to be able to hold an - * arbitrary decrypted message. If it is not large enough to - * hold the decryption of the particular ciphertext provided, - * the function returns \c MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA context to use. - * \param f_rng The RNG function. If \p mode is #MBEDTLS_RSA_PRIVATE, - * this is used for blinding and should be provided; see - * mbedtls_rsa_private() for more. If \p mode is - * #MBEDTLS_RSA_PUBLIC, it is ignored. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng is \c NULL or doesn't need a context. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated). - * \param olen The address at which to store the length of - * the plaintext. This must not be \c NULL. - * \param input The ciphertext buffer. This must be a readable buffer - * of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * \param output The buffer used to hold the plaintext. This must - * be a writable buffer of length \p output_max_len Bytes. - * \param output_max_len The length in Bytes of the output buffer \p output. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_pkcs1_decrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, size_t *olen, - const unsigned char *input, - unsigned char *output, - size_t output_max_len ); - -/** - * \brief This function performs a PKCS#1 v1.5 decryption - * operation (RSAES-PKCS1-v1_5-DECRYPT). - * - * \note The output buffer length \c output_max_len should be - * as large as the size \p ctx->len of \p ctx->N, for example, - * 128 Bytes if RSA-1024 is used, to be able to hold an - * arbitrary decrypted message. If it is not large enough to - * hold the decryption of the particular ciphertext provided, - * the function returns #MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA context to use. - * \param f_rng The RNG function. If \p mode is #MBEDTLS_RSA_PRIVATE, - * this is used for blinding and should be provided; see - * mbedtls_rsa_private() for more. If \p mode is - * #MBEDTLS_RSA_PUBLIC, it is ignored. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng is \c NULL or doesn't need a context. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated). - * \param olen The address at which to store the length of - * the plaintext. This must not be \c NULL. - * \param input The ciphertext buffer. This must be a readable buffer - * of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * \param output The buffer used to hold the plaintext. This must - * be a writable buffer of length \p output_max_len Bytes. - * \param output_max_len The length in Bytes of the output buffer \p output. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - * - */ -int mbedtls_rsa_rsaes_pkcs1_v15_decrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, size_t *olen, - const unsigned char *input, - unsigned char *output, - size_t output_max_len ); - -/** - * \brief This function performs a PKCS#1 v2.1 OAEP decryption - * operation (RSAES-OAEP-DECRYPT). - * - * \note The output buffer length \c output_max_len should be - * as large as the size \p ctx->len of \p ctx->N, for - * example, 128 Bytes if RSA-1024 is used, to be able to - * hold an arbitrary decrypted message. If it is not - * large enough to hold the decryption of the particular - * ciphertext provided, the function returns - * #MBEDTLS_ERR_RSA_OUTPUT_TOO_LARGE. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA context to use. - * \param f_rng The RNG function. If \p mode is #MBEDTLS_RSA_PRIVATE, - * this is used for blinding and should be provided; see - * mbedtls_rsa_private() for more. If \p mode is - * #MBEDTLS_RSA_PUBLIC, it is ignored. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng is \c NULL or doesn't need a context. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated). - * \param label The buffer holding the custom label to use. - * This must be a readable buffer of length \p label_len - * Bytes. It may be \c NULL if \p label_len is \c 0. - * \param label_len The length of the label in Bytes. - * \param olen The address at which to store the length of - * the plaintext. This must not be \c NULL. - * \param input The ciphertext buffer. This must be a readable buffer - * of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * \param output The buffer used to hold the plaintext. This must - * be a writable buffer of length \p output_max_len Bytes. - * \param output_max_len The length in Bytes of the output buffer \p output. - * - * \return \c 0 on success. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsaes_oaep_decrypt( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - const unsigned char *label, size_t label_len, - size_t *olen, - const unsigned char *input, - unsigned char *output, - size_t output_max_len ); - -/** - * \brief This function performs a private RSA operation to sign - * a message digest using PKCS#1. - * - * It is the generic wrapper for performing a PKCS#1 - * signature using the \p mode from the context. - * - * \note The \p sig buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \note For PKCS#1 v2.1 encoding, see comments on - * mbedtls_rsa_rsassa_pss_sign() for details on - * \p md_alg and \p hash_id. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA context to use. - * \param f_rng The RNG function to use. If the padding mode is PKCS#1 v2.1, - * this must be provided. If the padding mode is PKCS#1 v1.5 and - * \p mode is #MBEDTLS_RSA_PRIVATE, it is used for blinding - * and should be provided; see mbedtls_rsa_private() for more - * more. It is ignored otherwise. - * \param p_rng The RNG context to be passed to \p f_rng. This may be \c NULL - * if \p f_rng is \c NULL or doesn't need a context argument. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated). - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. - * Ths is only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest or raw data. - * If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable - * buffer of length \p hashlen Bytes. If \p md_alg is not - * #MBEDTLS_MD_NONE, it must be a readable buffer of length - * the size of the hash corresponding to \p md_alg. - * \param sig The buffer to hold the signature. This must be a writable - * buffer of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. A buffer length of - * #MBEDTLS_MPI_MAX_SIZE is always safe. - * - * \return \c 0 if the signing operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_pkcs1_sign( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - unsigned char *sig ); - -/** - * \brief This function performs a PKCS#1 v1.5 signature - * operation (RSASSA-PKCS1-v1_5-SIGN). - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA context to use. - * \param f_rng The RNG function. If \p mode is #MBEDTLS_RSA_PRIVATE, - * this is used for blinding and should be provided; see - * mbedtls_rsa_private() for more. If \p mode is - * #MBEDTLS_RSA_PUBLIC, it is ignored. - * \param p_rng The RNG context to be passed to \p f_rng. This may be \c NULL - * if \p f_rng is \c NULL or doesn't need a context argument. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated). - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. - * Ths is only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest or raw data. - * If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable - * buffer of length \p hashlen Bytes. If \p md_alg is not - * #MBEDTLS_MD_NONE, it must be a readable buffer of length - * the size of the hash corresponding to \p md_alg. - * \param sig The buffer to hold the signature. This must be a writable - * buffer of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. A buffer length of - * #MBEDTLS_MPI_MAX_SIZE is always safe. - * - * \return \c 0 if the signing operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsassa_pkcs1_v15_sign( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - unsigned char *sig ); - -/** - * \brief This function performs a PKCS#1 v2.1 PSS signature - * operation (RSASSA-PSS-SIGN). - * - * \note The \p hash_id in the RSA context is the one used for the - * encoding. \p md_alg in the function call is the type of hash - * that is encoded. According to RFC-3447: Public-Key - * Cryptography Standards (PKCS) #1 v2.1: RSA Cryptography - * Specifications it is advised to keep both hashes the - * same. - * - * \note This function always uses the maximum possible salt size, - * up to the length of the payload hash. This choice of salt - * size complies with FIPS 186-4 §5.5 (e) and RFC 8017 (PKCS#1 - * v2.2) §9.1.1 step 3. Furthermore this function enforces a - * minimum salt size which is the hash size minus 2 bytes. If - * this minimum size is too large given the key size (the salt - * size, plus the hash size, plus 2 bytes must be no more than - * the key size in bytes), this function returns - * #MBEDTLS_ERR_RSA_BAD_INPUT_DATA. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PUBLIC mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PRIVATE. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PUBLIC and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA context to use. - * \param f_rng The RNG function. It must not be \c NULL. - * \param p_rng The RNG context to be passed to \p f_rng. This may be \c NULL - * if \p f_rng doesn't need a context argument. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PRIVATE or #MBEDTLS_RSA_PUBLIC (deprecated). - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. - * Ths is only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest or raw data. - * If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable - * buffer of length \p hashlen Bytes. If \p md_alg is not - * #MBEDTLS_MD_NONE, it must be a readable buffer of length - * the size of the hash corresponding to \p md_alg. - * \param sig The buffer to hold the signature. This must be a writable - * buffer of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. A buffer length of - * #MBEDTLS_MPI_MAX_SIZE is always safe. - * - * \return \c 0 if the signing operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsassa_pss_sign( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - unsigned char *sig ); - -/** - * \brief This function performs a public RSA operation and checks - * the message digest. - * - * This is the generic wrapper for performing a PKCS#1 - * verification using the mode from the context. - * - * \note For PKCS#1 v2.1 encoding, see comments on - * mbedtls_rsa_rsassa_pss_verify() about \p md_alg and - * \p hash_id. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA public key context to use. - * \param f_rng The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE, - * this is used for blinding and should be provided; see - * mbedtls_rsa_private() for more. Otherwise, it is ignored. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng is \c NULL or doesn't need a context. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated). - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. - * This is only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest or raw data. - * If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable - * buffer of length \p hashlen Bytes. If \p md_alg is not - * #MBEDTLS_MD_NONE, it must be a readable buffer of length - * the size of the hash corresponding to \p md_alg. - * \param sig The buffer holding the signature. This must be a readable - * buffer of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * - * \return \c 0 if the verify operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_pkcs1_verify( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - const unsigned char *sig ); - -/** - * \brief This function performs a PKCS#1 v1.5 verification - * operation (RSASSA-PKCS1-v1_5-VERIFY). - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA public key context to use. - * \param f_rng The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE, - * this is used for blinding and should be provided; see - * mbedtls_rsa_private() for more. Otherwise, it is ignored. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng is \c NULL or doesn't need a context. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated). - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. - * This is only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest or raw data. - * If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable - * buffer of length \p hashlen Bytes. If \p md_alg is not - * #MBEDTLS_MD_NONE, it must be a readable buffer of length - * the size of the hash corresponding to \p md_alg. - * \param sig The buffer holding the signature. This must be a readable - * buffer of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * - * \return \c 0 if the verify operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsassa_pkcs1_v15_verify( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - const unsigned char *sig ); - -/** - * \brief This function performs a PKCS#1 v2.1 PSS verification - * operation (RSASSA-PSS-VERIFY). - * - * The hash function for the MGF mask generating function - * is that specified in the RSA context. - * - * \note The \p hash_id in the RSA context is the one used for the - * verification. \p md_alg in the function call is the type of - * hash that is verified. According to RFC-3447: Public-Key - * Cryptography Standards (PKCS) #1 v2.1: RSA Cryptography - * Specifications it is advised to keep both hashes the - * same. If \p hash_id in the RSA context is unset, - * the \p md_alg from the function call is used. - * - * \deprecated It is deprecated and discouraged to call this function - * in #MBEDTLS_RSA_PRIVATE mode. Future versions of the library - * are likely to remove the \p mode argument and have it - * implicitly set to #MBEDTLS_RSA_PUBLIC. - * - * \note Alternative implementations of RSA need not support - * mode being set to #MBEDTLS_RSA_PRIVATE and might instead - * return #MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED. - * - * \param ctx The initialized RSA public key context to use. - * \param f_rng The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE, - * this is used for blinding and should be provided; see - * mbedtls_rsa_private() for more. Otherwise, it is ignored. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng is \c NULL or doesn't need a context. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE (deprecated). - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. - * This is only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest or raw data. - * If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable - * buffer of length \p hashlen Bytes. If \p md_alg is not - * #MBEDTLS_MD_NONE, it must be a readable buffer of length - * the size of the hash corresponding to \p md_alg. - * \param sig The buffer holding the signature. This must be a readable - * buffer of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * - * \return \c 0 if the verify operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsassa_pss_verify( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - const unsigned char *sig ); - -/** - * \brief This function performs a PKCS#1 v2.1 PSS verification - * operation (RSASSA-PSS-VERIFY). - * - * The hash function for the MGF mask generating function - * is that specified in \p mgf1_hash_id. - * - * \note The \p sig buffer must be as large as the size - * of \p ctx->N. For example, 128 Bytes if RSA-1024 is used. - * - * \note The \p hash_id in the RSA context is ignored. - * - * \param ctx The initialized RSA public key context to use. - * \param f_rng The RNG function to use. If \p mode is #MBEDTLS_RSA_PRIVATE, - * this is used for blinding and should be provided; see - * mbedtls_rsa_private() for more. Otherwise, it is ignored. - * \param p_rng The RNG context to be passed to \p f_rng. This may be - * \c NULL if \p f_rng is \c NULL or doesn't need a context. - * \param mode The mode of operation. This must be either - * #MBEDTLS_RSA_PUBLIC or #MBEDTLS_RSA_PRIVATE. - * \param md_alg The message-digest algorithm used to hash the original data. - * Use #MBEDTLS_MD_NONE for signing raw data. - * \param hashlen The length of the message digest. - * This is only used if \p md_alg is #MBEDTLS_MD_NONE. - * \param hash The buffer holding the message digest or raw data. - * If \p md_alg is #MBEDTLS_MD_NONE, this must be a readable - * buffer of length \p hashlen Bytes. If \p md_alg is not - * #MBEDTLS_MD_NONE, it must be a readable buffer of length - * the size of the hash corresponding to \p md_alg. - * \param mgf1_hash_id The message digest used for mask generation. - * \param expected_salt_len The length of the salt used in padding. Use - * #MBEDTLS_RSA_SALT_LEN_ANY to accept any salt length. - * \param sig The buffer holding the signature. This must be a readable - * buffer of length \c ctx->len Bytes. For example, \c 256 Bytes - * for an 2048-bit RSA modulus. - * - * \return \c 0 if the verify operation was successful. - * \return An \c MBEDTLS_ERR_RSA_XXX error code on failure. - */ -int mbedtls_rsa_rsassa_pss_verify_ext( mbedtls_rsa_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng, - int mode, - mbedtls_md_type_t md_alg, - unsigned int hashlen, - const unsigned char *hash, - mbedtls_md_type_t mgf1_hash_id, - int expected_salt_len, - const unsigned char *sig ); - -/** - * \brief This function copies the components of an RSA context. - * - * \param dst The destination context. This must be initialized. - * \param src The source context. This must be initialized. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory allocation failure. - */ -int mbedtls_rsa_copy( mbedtls_rsa_context *dst, const mbedtls_rsa_context *src ); - -/** - * \brief This function frees the components of an RSA key. - * - * \param ctx The RSA context to free. May be \c NULL, in which case - * this function is a no-op. If it is not \c NULL, it must - * point to an initialized RSA context. - */ -void mbedtls_rsa_free( mbedtls_rsa_context *ctx ); - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief The RSA checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_rsa_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* rsa.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/rsa_internal.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/rsa_internal.h deleted file mode 100644 index c1c844ef7..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/rsa_internal.h +++ /dev/null @@ -1,226 +0,0 @@ -/** - * \file rsa_internal.h - * - * \brief Context-independent RSA helper functions - * - * This module declares some RSA-related helper functions useful when - * implementing the RSA interface. These functions are provided in a separate - * compilation unit in order to make it easy for designers of alternative RSA - * implementations to use them in their own code, as it is conceived that the - * functionality they provide will be necessary for most complete - * implementations. - * - * End-users of Mbed TLS who are not providing their own alternative RSA - * implementations should not use these functions directly, and should instead - * use only the functions declared in rsa.h. - * - * The interface provided by this module will be maintained through LTS (Long - * Term Support) branches of Mbed TLS, but may otherwise be subject to change, - * and must be considered an internal interface of the library. - * - * There are two classes of helper functions: - * - * (1) Parameter-generating helpers. These are: - * - mbedtls_rsa_deduce_primes - * - mbedtls_rsa_deduce_private_exponent - * - mbedtls_rsa_deduce_crt - * Each of these functions takes a set of core RSA parameters and - * generates some other, or CRT related parameters. - * - * (2) Parameter-checking helpers. These are: - * - mbedtls_rsa_validate_params - * - mbedtls_rsa_validate_crt - * They take a set of core or CRT related RSA parameters and check their - * validity. - * - */ -/* - * Copyright (C) 2006-2017, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - * - */ - -#ifndef MBEDTLS_RSA_INTERNAL_H -#define MBEDTLS_RSA_INTERNAL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/bignum.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * \brief Compute RSA prime moduli P, Q from public modulus N=PQ - * and a pair of private and public key. - * - * \note This is a 'static' helper function not operating on - * an RSA context. Alternative implementations need not - * overwrite it. - * - * \param N RSA modulus N = PQ, with P, Q to be found - * \param E RSA public exponent - * \param D RSA private exponent - * \param P Pointer to MPI holding first prime factor of N on success - * \param Q Pointer to MPI holding second prime factor of N on success - * - * \return - * - 0 if successful. In this case, P and Q constitute a - * factorization of N. - * - A non-zero error code otherwise. - * - * \note It is neither checked that P, Q are prime nor that - * D, E are modular inverses wrt. P-1 and Q-1. For that, - * use the helper function \c mbedtls_rsa_validate_params. - * - */ -int mbedtls_rsa_deduce_primes( mbedtls_mpi const *N, mbedtls_mpi const *E, - mbedtls_mpi const *D, - mbedtls_mpi *P, mbedtls_mpi *Q ); - -/** - * \brief Compute RSA private exponent from - * prime moduli and public key. - * - * \note This is a 'static' helper function not operating on - * an RSA context. Alternative implementations need not - * overwrite it. - * - * \param P First prime factor of RSA modulus - * \param Q Second prime factor of RSA modulus - * \param E RSA public exponent - * \param D Pointer to MPI holding the private exponent on success. - * - * \return - * - 0 if successful. In this case, D is set to a simultaneous - * modular inverse of E modulo both P-1 and Q-1. - * - A non-zero error code otherwise. - * - * \note This function does not check whether P and Q are primes. - * - */ -int mbedtls_rsa_deduce_private_exponent( mbedtls_mpi const *P, - mbedtls_mpi const *Q, - mbedtls_mpi const *E, - mbedtls_mpi *D ); - - -/** - * \brief Generate RSA-CRT parameters - * - * \note This is a 'static' helper function not operating on - * an RSA context. Alternative implementations need not - * overwrite it. - * - * \param P First prime factor of N - * \param Q Second prime factor of N - * \param D RSA private exponent - * \param DP Output variable for D modulo P-1 - * \param DQ Output variable for D modulo Q-1 - * \param QP Output variable for the modular inverse of Q modulo P. - * - * \return 0 on success, non-zero error code otherwise. - * - * \note This function does not check whether P, Q are - * prime and whether D is a valid private exponent. - * - */ -int mbedtls_rsa_deduce_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q, - const mbedtls_mpi *D, mbedtls_mpi *DP, - mbedtls_mpi *DQ, mbedtls_mpi *QP ); - - -/** - * \brief Check validity of core RSA parameters - * - * \note This is a 'static' helper function not operating on - * an RSA context. Alternative implementations need not - * overwrite it. - * - * \param N RSA modulus N = PQ - * \param P First prime factor of N - * \param Q Second prime factor of N - * \param D RSA private exponent - * \param E RSA public exponent - * \param f_rng PRNG to be used for primality check, or NULL - * \param p_rng PRNG context for f_rng, or NULL - * - * \return - * - 0 if the following conditions are satisfied - * if all relevant parameters are provided: - * - P prime if f_rng != NULL (%) - * - Q prime if f_rng != NULL (%) - * - 1 < N = P * Q - * - 1 < D, E < N - * - D and E are modular inverses modulo P-1 and Q-1 - * (%) This is only done if MBEDTLS_GENPRIME is defined. - * - A non-zero error code otherwise. - * - * \note The function can be used with a restricted set of arguments - * to perform specific checks only. E.g., calling it with - * (-,P,-,-,-) and a PRNG amounts to a primality check for P. - */ -int mbedtls_rsa_validate_params( const mbedtls_mpi *N, const mbedtls_mpi *P, - const mbedtls_mpi *Q, const mbedtls_mpi *D, - const mbedtls_mpi *E, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Check validity of RSA CRT parameters - * - * \note This is a 'static' helper function not operating on - * an RSA context. Alternative implementations need not - * overwrite it. - * - * \param P First prime factor of RSA modulus - * \param Q Second prime factor of RSA modulus - * \param D RSA private exponent - * \param DP MPI to check for D modulo P-1 - * \param DQ MPI to check for D modulo P-1 - * \param QP MPI to check for the modular inverse of Q modulo P. - * - * \return - * - 0 if the following conditions are satisfied: - * - D = DP mod P-1 if P, D, DP != NULL - * - Q = DQ mod P-1 if P, D, DQ != NULL - * - QP = Q^-1 mod P if P, Q, QP != NULL - * - \c MBEDTLS_ERR_RSA_KEY_CHECK_FAILED if check failed, - * potentially including \c MBEDTLS_ERR_MPI_XXX if some - * MPI calculations failed. - * - \c MBEDTLS_ERR_RSA_BAD_INPUT_DATA if insufficient - * data was provided to check DP, DQ or QP. - * - * \note The function can be used with a restricted set of arguments - * to perform specific checks only. E.g., calling it with the - * parameters (P, -, D, DP, -, -) will check DP = D mod P-1. - */ -int mbedtls_rsa_validate_crt( const mbedtls_mpi *P, const mbedtls_mpi *Q, - const mbedtls_mpi *D, const mbedtls_mpi *DP, - const mbedtls_mpi *DQ, const mbedtls_mpi *QP ); - -#ifdef __cplusplus -} -#endif - -#endif /* rsa_internal.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha1.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha1.h deleted file mode 100644 index 988d2f93d..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha1.h +++ /dev/null @@ -1,352 +0,0 @@ -/** - * \file sha1.h - * - * \brief This file contains SHA-1 definitions and functions. - * - * The Secure Hash Algorithm 1 (SHA-1) cryptographic hash function is defined in - * FIPS 180-4: Secure Hash Standard (SHS). - * - * \warning SHA-1 is considered a weak message digest and its use constitutes - * a security risk. We recommend considering stronger message - * digests instead. - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SHA1_H -#define MBEDTLS_SHA1_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -/* MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035 /**< SHA-1 hardware accelerator failed */ -#define MBEDTLS_ERR_SHA1_BAD_INPUT_DATA -0x0073 /**< SHA-1 input data was malformed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_SHA1_ALT) -// Regular implementation -// - -/** - * \brief The SHA-1 context structure. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - */ -typedef struct mbedtls_sha1_context -{ - uint32_t total[2]; /*!< The number of Bytes processed. */ - uint32_t state[5]; /*!< The intermediate digest state. */ - unsigned char buffer[64]; /*!< The data block being processed. */ -} -mbedtls_sha1_context; - -#else /* MBEDTLS_SHA1_ALT */ -#include "sha1_alt.h" -#endif /* MBEDTLS_SHA1_ALT */ - -/** - * \brief This function initializes a SHA-1 context. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context to initialize. - * This must not be \c NULL. - * - */ -void mbedtls_sha1_init( mbedtls_sha1_context *ctx ); - -/** - * \brief This function clears a SHA-1 context. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context to clear. This may be \c NULL, - * in which case this function does nothing. If it is - * not \c NULL, it must point to an initialized - * SHA-1 context. - * - */ -void mbedtls_sha1_free( mbedtls_sha1_context *ctx ); - -/** - * \brief This function clones the state of a SHA-1 context. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param dst The SHA-1 context to clone to. This must be initialized. - * \param src The SHA-1 context to clone from. This must be initialized. - * - */ -void mbedtls_sha1_clone( mbedtls_sha1_context *dst, - const mbedtls_sha1_context *src ); - -/** - * \brief This function starts a SHA-1 checksum calculation. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context to initialize. This must be initialized. - * - * \return \c 0 on success. - * \return A negative error code on failure. - * - */ -int mbedtls_sha1_starts_ret( mbedtls_sha1_context *ctx ); - -/** - * \brief This function feeds an input buffer into an ongoing SHA-1 - * checksum calculation. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context. This must be initialized - * and have a hash operation started. - * \param input The buffer holding the input data. - * This must be a readable buffer of length \p ilen Bytes. - * \param ilen The length of the input data \p input in Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_sha1_update_ret( mbedtls_sha1_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-1 operation, and writes - * the result to the output buffer. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context to use. This must be initialized and - * have a hash operation started. - * \param output The SHA-1 checksum result. This must be a writable - * buffer of length \c 20 Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_sha1_finish_ret( mbedtls_sha1_context *ctx, - unsigned char output[20] ); - -/** - * \brief SHA-1 process data block (internal use only). - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param ctx The SHA-1 context to use. This must be initialized. - * \param data The data block being processed. This must be a - * readable buffer of length \c 64 Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - * - */ -int mbedtls_internal_sha1_process( mbedtls_sha1_context *ctx, - const unsigned char data[64] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function starts a SHA-1 checksum calculation. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \deprecated Superseded by mbedtls_sha1_starts_ret() in 2.7.0. - * - * \param ctx The SHA-1 context to initialize. This must be initialized. - * - */ -MBEDTLS_DEPRECATED void mbedtls_sha1_starts( mbedtls_sha1_context *ctx ); - -/** - * \brief This function feeds an input buffer into an ongoing SHA-1 - * checksum calculation. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \deprecated Superseded by mbedtls_sha1_update_ret() in 2.7.0. - * - * \param ctx The SHA-1 context. This must be initialized and - * have a hash operation started. - * \param input The buffer holding the input data. - * This must be a readable buffer of length \p ilen Bytes. - * \param ilen The length of the input data \p input in Bytes. - * - */ -MBEDTLS_DEPRECATED void mbedtls_sha1_update( mbedtls_sha1_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-1 operation, and writes - * the result to the output buffer. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \deprecated Superseded by mbedtls_sha1_finish_ret() in 2.7.0. - * - * \param ctx The SHA-1 context. This must be initialized and - * have a hash operation started. - * \param output The SHA-1 checksum result. - * This must be a writable buffer of length \c 20 Bytes. - */ -MBEDTLS_DEPRECATED void mbedtls_sha1_finish( mbedtls_sha1_context *ctx, - unsigned char output[20] ); - -/** - * \brief SHA-1 process data block (internal use only). - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \deprecated Superseded by mbedtls_internal_sha1_process() in 2.7.0. - * - * \param ctx The SHA-1 context. This must be initialized. - * \param data The data block being processed. - * This must be a readable buffer of length \c 64 bytes. - * - */ -MBEDTLS_DEPRECATED void mbedtls_sha1_process( mbedtls_sha1_context *ctx, - const unsigned char data[64] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief This function calculates the SHA-1 checksum of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-1 result is calculated as - * output = SHA-1(input buffer). - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \param input The buffer holding the input data. - * This must be a readable buffer of length \p ilen Bytes. - * \param ilen The length of the input data \p input in Bytes. - * \param output The SHA-1 checksum result. - * This must be a writable buffer of length \c 20 Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - * - */ -int mbedtls_sha1_ret( const unsigned char *input, - size_t ilen, - unsigned char output[20] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function calculates the SHA-1 checksum of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-1 result is calculated as - * output = SHA-1(input buffer). - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \deprecated Superseded by mbedtls_sha1_ret() in 2.7.0 - * - * \param input The buffer holding the input data. - * This must be a readable buffer of length \p ilen Bytes. - * \param ilen The length of the input data \p input in Bytes. - * \param output The SHA-1 checksum result. This must be a writable - * buffer of size \c 20 Bytes. - * - */ -MBEDTLS_DEPRECATED void mbedtls_sha1( const unsigned char *input, - size_t ilen, - unsigned char output[20] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief The SHA-1 checkup routine. - * - * \warning SHA-1 is considered a weak message digest and its use - * constitutes a security risk. We recommend considering - * stronger message digests instead. - * - * \return \c 0 on success. - * \return \c 1 on failure. - * - */ -int mbedtls_sha1_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_sha1.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha1_alt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha1_alt.h deleted file mode 100644 index 9da1a39c5..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha1_alt.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef MBEDTLS_SHA1_ALT_H -#define MBEDTLS_SHA1_ALT_H - -#include -#include - -#if defined (MBEDTLS_CONFIG_FILE) -#include MBEDTLS_CONFIG_FILE -#endif - -#if defined (MBEDTLS_SHA1_ALT) - -#define CC_HASH_USER_CTX_SIZE_IN_WORDS 60 - -#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED -0x0035 /**< SHA-1 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief SHA-1 context structure - */ -typedef struct mbedtls_sha1_context { - /*! Internal buffer */ - uint32_t buff[CC_HASH_USER_CTX_SIZE_IN_WORDS]; // defined in cc_hash_defs_proj.h -} mbedtls_sha1_context; - -#ifdef __cplusplus -} -#endif -#endif /* MBEDTLS_SHA1_ALT */ - -#endif /* MBEDTLS_SHA1_ALT_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha256.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha256.h deleted file mode 100644 index 1c5974021..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha256.h +++ /dev/null @@ -1,297 +0,0 @@ -/** - * \file sha256.h - * - * \brief This file contains SHA-224 and SHA-256 definitions and functions. - * - * The Secure Hash Algorithms 224 and 256 (SHA-224 and SHA-256) cryptographic - * hash functions are defined in FIPS 180-4: Secure Hash Standard (SHS). - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SHA256_H -#define MBEDTLS_SHA256_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -/* MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED -0x0037 /**< SHA-256 hardware accelerator failed */ -#define MBEDTLS_ERR_SHA256_BAD_INPUT_DATA -0x0074 /**< SHA-256 input data was malformed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_SHA256_ALT) -// Regular implementation -// - -/** - * \brief The SHA-256 context structure. - * - * The structure is used both for SHA-256 and for SHA-224 - * checksum calculations. The choice between these two is - * made in the call to mbedtls_sha256_starts_ret(). - */ -typedef struct mbedtls_sha256_context -{ - uint32_t total[2]; /*!< The number of Bytes processed. */ - uint32_t state[8]; /*!< The intermediate digest state. */ - unsigned char buffer[64]; /*!< The data block being processed. */ - int is224; /*!< Determines which function to use: - 0: Use SHA-256, or 1: Use SHA-224. */ -} -mbedtls_sha256_context; - -#else /* MBEDTLS_SHA256_ALT */ -#include "sha256_alt.h" -#endif /* MBEDTLS_SHA256_ALT */ - -/** - * \brief This function initializes a SHA-256 context. - * - * \param ctx The SHA-256 context to initialize. This must not be \c NULL. - */ -void mbedtls_sha256_init( mbedtls_sha256_context *ctx ); - -/** - * \brief This function clears a SHA-256 context. - * - * \param ctx The SHA-256 context to clear. This may be \c NULL, in which - * case this function returns immediately. If it is not \c NULL, - * it must point to an initialized SHA-256 context. - */ -void mbedtls_sha256_free( mbedtls_sha256_context *ctx ); - -/** - * \brief This function clones the state of a SHA-256 context. - * - * \param dst The destination context. This must be initialized. - * \param src The context to clone. This must be initialized. - */ -void mbedtls_sha256_clone( mbedtls_sha256_context *dst, - const mbedtls_sha256_context *src ); - -/** - * \brief This function starts a SHA-224 or SHA-256 checksum - * calculation. - * - * \param ctx The context to use. This must be initialized. - * \param is224 This determines which function to use. This must be - * either \c 0 for SHA-256, or \c 1 for SHA-224. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_sha256_starts_ret( mbedtls_sha256_context *ctx, int is224 ); - -/** - * \brief This function feeds an input buffer into an ongoing - * SHA-256 checksum calculation. - * - * \param ctx The SHA-256 context. This must be initialized - * and have a hash operation started. - * \param input The buffer holding the data. This must be a readable - * buffer of length \p ilen Bytes. - * \param ilen The length of the input data in Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_sha256_update_ret( mbedtls_sha256_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-256 operation, and writes - * the result to the output buffer. - * - * \param ctx The SHA-256 context. This must be initialized - * and have a hash operation started. - * \param output The SHA-224 or SHA-256 checksum result. - * This must be a writable buffer of length \c 32 Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_sha256_finish_ret( mbedtls_sha256_context *ctx, - unsigned char output[32] ); - -/** - * \brief This function processes a single data block within - * the ongoing SHA-256 computation. This function is for - * internal use only. - * - * \param ctx The SHA-256 context. This must be initialized. - * \param data The buffer holding one block of data. This must - * be a readable buffer of length \c 64 Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_internal_sha256_process( mbedtls_sha256_context *ctx, - const unsigned char data[64] ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function starts a SHA-224 or SHA-256 checksum - * calculation. - * - * \deprecated Superseded by mbedtls_sha256_starts_ret() in 2.7.0. - * - * \param ctx The context to use. This must be initialized. - * \param is224 Determines which function to use. This must be - * either \c 0 for SHA-256, or \c 1 for SHA-224. - */ -MBEDTLS_DEPRECATED void mbedtls_sha256_starts( mbedtls_sha256_context *ctx, - int is224 ); - -/** - * \brief This function feeds an input buffer into an ongoing - * SHA-256 checksum calculation. - * - * \deprecated Superseded by mbedtls_sha256_update_ret() in 2.7.0. - * - * \param ctx The SHA-256 context to use. This must be - * initialized and have a hash operation started. - * \param input The buffer holding the data. This must be a readable - * buffer of length \p ilen Bytes. - * \param ilen The length of the input data in Bytes. - */ -MBEDTLS_DEPRECATED void mbedtls_sha256_update( mbedtls_sha256_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-256 operation, and writes - * the result to the output buffer. - * - * \deprecated Superseded by mbedtls_sha256_finish_ret() in 2.7.0. - * - * \param ctx The SHA-256 context. This must be initialized and - * have a hash operation started. - * \param output The SHA-224 or SHA-256 checksum result. This must be - * a writable buffer of length \c 32 Bytes. - */ -MBEDTLS_DEPRECATED void mbedtls_sha256_finish( mbedtls_sha256_context *ctx, - unsigned char output[32] ); - -/** - * \brief This function processes a single data block within - * the ongoing SHA-256 computation. This function is for - * internal use only. - * - * \deprecated Superseded by mbedtls_internal_sha256_process() in 2.7.0. - * - * \param ctx The SHA-256 context. This must be initialized. - * \param data The buffer holding one block of data. This must be - * a readable buffer of size \c 64 Bytes. - */ -MBEDTLS_DEPRECATED void mbedtls_sha256_process( mbedtls_sha256_context *ctx, - const unsigned char data[64] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief This function calculates the SHA-224 or SHA-256 - * checksum of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-256 result is calculated as - * output = SHA-256(input buffer). - * - * \param input The buffer holding the data. This must be a readable - * buffer of length \p ilen Bytes. - * \param ilen The length of the input data in Bytes. - * \param output The SHA-224 or SHA-256 checksum result. This must - * be a writable buffer of length \c 32 Bytes. - * \param is224 Determines which function to use. This must be - * either \c 0 for SHA-256, or \c 1 for SHA-224. - */ -int mbedtls_sha256_ret( const unsigned char *input, - size_t ilen, - unsigned char output[32], - int is224 ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif - -/** - * \brief This function calculates the SHA-224 or SHA-256 checksum - * of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-256 result is calculated as - * output = SHA-256(input buffer). - * - * \deprecated Superseded by mbedtls_sha256_ret() in 2.7.0. - * - * \param input The buffer holding the data. This must be a readable - * buffer of length \p ilen Bytes. - * \param ilen The length of the input data in Bytes. - * \param output The SHA-224 or SHA-256 checksum result. This must be - * a writable buffer of length \c 32 Bytes. - * \param is224 Determines which function to use. This must be either - * \c 0 for SHA-256, or \c 1 for SHA-224. - */ -MBEDTLS_DEPRECATED void mbedtls_sha256( const unsigned char *input, - size_t ilen, - unsigned char output[32], - int is224 ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief The SHA-224 and SHA-256 checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_sha256_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_sha256.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha256_alt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha256_alt.h deleted file mode 100644 index c368a540b..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha256_alt.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef MBEDTLS_SHA256_ALT_H -#define MBEDTLS_SHA256_ALT_H - -#include -#include - -#if defined (MBEDTLS_CONFIG_FILE) -#include MBEDTLS_CONFIG_FILE -#endif - -#if defined (MBEDTLS_SHA256_ALT) - -#define CC_HASH_USER_CTX_SIZE_IN_WORDS 60 - -#define MBEDTLS_ERR_SHA256_HW_ACCEL_FAILED -0x0037 /**< SHA-256 hardware accelerator failed */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief SHA-256 context structure - */ -typedef struct mbedtls_sha256_context { - /*! Internal buffer */ - uint32_t buff[CC_HASH_USER_CTX_SIZE_IN_WORDS]; // defined in cc_hash_defs.h -} mbedtls_sha256_context; - -#ifdef __cplusplus -} -#endif -#endif /* MBEDTLS_SHA256_ALT */ - -#endif /* MBEDTLS_SHA256_ALT_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha512.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha512.h deleted file mode 100644 index 8e54ce01a..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/sha512.h +++ /dev/null @@ -1,316 +0,0 @@ -/** - * \file sha512.h - * \brief This file contains SHA-384 and SHA-512 definitions and functions. - * - * The Secure Hash Algorithms 384 and 512 (SHA-384 and SHA-512) cryptographic - * hash functions are defined in FIPS 180-4: Secure Hash Standard (SHS). - */ -/* - * Copyright (C) 2006-2018, Arm Limited (or its affiliates), All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of Mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SHA512_H -#define MBEDTLS_SHA512_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -/* MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_SHA512_HW_ACCEL_FAILED -0x0039 /**< SHA-512 hardware accelerator failed */ -#define MBEDTLS_ERR_SHA512_BAD_INPUT_DATA -0x0075 /**< SHA-512 input data was malformed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_SHA512_ALT) -// Regular implementation -// - -/** - * \brief The SHA-512 context structure. - * - * The structure is used both for SHA-384 and for SHA-512 - * checksum calculations. The choice between these two is - * made in the call to mbedtls_sha512_starts_ret(). - */ -typedef struct mbedtls_sha512_context -{ - uint64_t total[2]; /*!< The number of Bytes processed. */ - uint64_t state[8]; /*!< The intermediate digest state. */ - unsigned char buffer[128]; /*!< The data block being processed. */ -#if !defined(MBEDTLS_SHA512_NO_SHA384) - int is384; /*!< Determines which function to use: - 0: Use SHA-512, or 1: Use SHA-384. */ -#endif -} -mbedtls_sha512_context; - -#else /* MBEDTLS_SHA512_ALT */ -#include "sha512_alt.h" -#endif /* MBEDTLS_SHA512_ALT */ - -/** - * \brief This function initializes a SHA-512 context. - * - * \param ctx The SHA-512 context to initialize. This must - * not be \c NULL. - */ -void mbedtls_sha512_init( mbedtls_sha512_context *ctx ); - -/** - * \brief This function clears a SHA-512 context. - * - * \param ctx The SHA-512 context to clear. This may be \c NULL, - * in which case this function does nothing. If it - * is not \c NULL, it must point to an initialized - * SHA-512 context. - */ -void mbedtls_sha512_free( mbedtls_sha512_context *ctx ); - -/** - * \brief This function clones the state of a SHA-512 context. - * - * \param dst The destination context. This must be initialized. - * \param src The context to clone. This must be initialized. - */ -void mbedtls_sha512_clone( mbedtls_sha512_context *dst, - const mbedtls_sha512_context *src ); - -/** - * \brief This function starts a SHA-384 or SHA-512 checksum - * calculation. - * - * \param ctx The SHA-512 context to use. This must be initialized. - * \param is384 Determines which function to use. This must be - * either \c 0 for SHA-512, or \c 1 for SHA-384. - * - * \note When \c MBEDTLS_SHA512_NO_SHA384 is defined, \p is384 must - * be \c 0, or the function will return - * #MBEDTLS_ERR_SHA512_BAD_INPUT_DATA. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_sha512_starts_ret( mbedtls_sha512_context *ctx, int is384 ); - -/** - * \brief This function feeds an input buffer into an ongoing - * SHA-512 checksum calculation. - * - * \param ctx The SHA-512 context. This must be initialized - * and have a hash operation started. - * \param input The buffer holding the input data. This must - * be a readable buffer of length \p ilen Bytes. - * \param ilen The length of the input data in Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_sha512_update_ret( mbedtls_sha512_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-512 operation, and writes - * the result to the output buffer. This function is for - * internal use only. - * - * \param ctx The SHA-512 context. This must be initialized - * and have a hash operation started. - * \param output The SHA-384 or SHA-512 checksum result. - * This must be a writable buffer of length \c 64 Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_sha512_finish_ret( mbedtls_sha512_context *ctx, - unsigned char output[64] ); - -/** - * \brief This function processes a single data block within - * the ongoing SHA-512 computation. - * - * \param ctx The SHA-512 context. This must be initialized. - * \param data The buffer holding one block of data. This - * must be a readable buffer of length \c 128 Bytes. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_internal_sha512_process( mbedtls_sha512_context *ctx, - const unsigned char data[128] ); -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif -/** - * \brief This function starts a SHA-384 or SHA-512 checksum - * calculation. - * - * \deprecated Superseded by mbedtls_sha512_starts_ret() in 2.7.0 - * - * \param ctx The SHA-512 context to use. This must be initialized. - * \param is384 Determines which function to use. This must be either - * \c 0 for SHA-512 or \c 1 for SHA-384. - * - * \note When \c MBEDTLS_SHA512_NO_SHA384 is defined, \p is384 must - * be \c 0, or the function will fail to work. - */ -MBEDTLS_DEPRECATED void mbedtls_sha512_starts( mbedtls_sha512_context *ctx, - int is384 ); - -/** - * \brief This function feeds an input buffer into an ongoing - * SHA-512 checksum calculation. - * - * \deprecated Superseded by mbedtls_sha512_update_ret() in 2.7.0. - * - * \param ctx The SHA-512 context. This must be initialized - * and have a hash operation started. - * \param input The buffer holding the data. This must be a readable - * buffer of length \p ilen Bytes. - * \param ilen The length of the input data in Bytes. - */ -MBEDTLS_DEPRECATED void mbedtls_sha512_update( mbedtls_sha512_context *ctx, - const unsigned char *input, - size_t ilen ); - -/** - * \brief This function finishes the SHA-512 operation, and writes - * the result to the output buffer. - * - * \deprecated Superseded by mbedtls_sha512_finish_ret() in 2.7.0. - * - * \param ctx The SHA-512 context. This must be initialized - * and have a hash operation started. - * \param output The SHA-384 or SHA-512 checksum result. This must - * be a writable buffer of size \c 64 Bytes. - */ -MBEDTLS_DEPRECATED void mbedtls_sha512_finish( mbedtls_sha512_context *ctx, - unsigned char output[64] ); - -/** - * \brief This function processes a single data block within - * the ongoing SHA-512 computation. This function is for - * internal use only. - * - * \deprecated Superseded by mbedtls_internal_sha512_process() in 2.7.0. - * - * \param ctx The SHA-512 context. This must be initialized. - * \param data The buffer holding one block of data. This must be - * a readable buffer of length \c 128 Bytes. - */ -MBEDTLS_DEPRECATED void mbedtls_sha512_process( - mbedtls_sha512_context *ctx, - const unsigned char data[128] ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief This function calculates the SHA-512 or SHA-384 - * checksum of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-512 result is calculated as - * output = SHA-512(input buffer). - * - * \param input The buffer holding the input data. This must be - * a readable buffer of length \p ilen Bytes. - * \param ilen The length of the input data in Bytes. - * \param output The SHA-384 or SHA-512 checksum result. - * This must be a writable buffer of length \c 64 Bytes. - * \param is384 Determines which function to use. This must be either - * \c 0 for SHA-512, or \c 1 for SHA-384. - * - * \note When \c MBEDTLS_SHA512_NO_SHA384 is defined, \p is384 must - * be \c 0, or the function will return - * #MBEDTLS_ERR_SHA512_BAD_INPUT_DATA. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_sha512_ret( const unsigned char *input, - size_t ilen, - unsigned char output[64], - int is384 ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif - -/** - * \brief This function calculates the SHA-512 or SHA-384 - * checksum of a buffer. - * - * The function allocates the context, performs the - * calculation, and frees the context. - * - * The SHA-512 result is calculated as - * output = SHA-512(input buffer). - * - * \deprecated Superseded by mbedtls_sha512_ret() in 2.7.0 - * - * \param input The buffer holding the data. This must be a - * readable buffer of length \p ilen Bytes. - * \param ilen The length of the input data in Bytes. - * \param output The SHA-384 or SHA-512 checksum result. This must - * be a writable buffer of length \c 64 Bytes. - * \param is384 Determines which function to use. This must be either - * \c 0 for SHA-512, or \c 1 for SHA-384. - * - * \note When \c MBEDTLS_SHA512_NO_SHA384 is defined, \p is384 must - * be \c 0, or the function will fail to work. - */ -MBEDTLS_DEPRECATED void mbedtls_sha512( const unsigned char *input, - size_t ilen, - unsigned char output[64], - int is384 ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -#if defined(MBEDTLS_SELF_TEST) - - /** - * \brief The SHA-384 or SHA-512 checkup routine. - * - * \return \c 0 on success. - * \return \c 1 on failure. - */ -int mbedtls_sha512_self_test( int verbose ); -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_sha512.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl.h deleted file mode 100644 index 98264f9c2..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl.h +++ /dev/null @@ -1,4190 +0,0 @@ -/** - * \file ssl.h - * - * \brief SSL/TLS functions. - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_H -#define MBEDTLS_SSL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/bignum.h" -#include "mbedtls/ecp.h" - -#include "mbedtls/ssl_ciphersuites.h" - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -#include "mbedtls/x509_crt.h" -#include "mbedtls/x509_crl.h" -#endif - -#if defined(MBEDTLS_DHM_C) -#include "mbedtls/dhm.h" -#endif - -#if defined(MBEDTLS_ECDH_C) -#include "mbedtls/ecdh.h" -#endif - -#if defined(MBEDTLS_ZLIB_SUPPORT) - -#if defined(MBEDTLS_DEPRECATED_WARNING) -#warning "Record compression support via MBEDTLS_ZLIB_SUPPORT is deprecated and will be removed in the next major revision of the library" -#endif - -#if defined(MBEDTLS_DEPRECATED_REMOVED) -#error "Record compression support via MBEDTLS_ZLIB_SUPPORT is deprecated and cannot be used if MBEDTLS_DEPRECATED_REMOVED is set" -#endif - -#include "zlib.h" -#endif - -#if defined(MBEDTLS_HAVE_TIME) -#include "mbedtls/platform_time.h" -#endif - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "psa/crypto.h" -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -/* - * SSL Error codes - */ -#define MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE -0x7080 /**< The requested feature is not available. */ -#define MBEDTLS_ERR_SSL_BAD_INPUT_DATA -0x7100 /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_SSL_INVALID_MAC -0x7180 /**< Verification of the message MAC failed. */ -#define MBEDTLS_ERR_SSL_INVALID_RECORD -0x7200 /**< An invalid SSL record was received. */ -#define MBEDTLS_ERR_SSL_CONN_EOF -0x7280 /**< The connection indicated an EOF. */ -#define MBEDTLS_ERR_SSL_UNKNOWN_CIPHER -0x7300 /**< An unknown cipher was received. */ -#define MBEDTLS_ERR_SSL_NO_CIPHER_CHOSEN -0x7380 /**< The server has no ciphersuites in common with the client. */ -#define MBEDTLS_ERR_SSL_NO_RNG -0x7400 /**< No RNG was provided to the SSL module. */ -#define MBEDTLS_ERR_SSL_NO_CLIENT_CERTIFICATE -0x7480 /**< No client certification received from the client, but required by the authentication mode. */ -#define MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE -0x7500 /**< Our own certificate(s) is/are too large to send in an SSL message. */ -#define MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED -0x7580 /**< The own certificate is not set, but needed by the server. */ -#define MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED -0x7600 /**< The own private key or pre-shared key is not set, but needed. */ -#define MBEDTLS_ERR_SSL_CA_CHAIN_REQUIRED -0x7680 /**< No CA Chain is set, but required to operate. */ -#define MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE -0x7700 /**< An unexpected message was received from our peer. */ -#define MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE -0x7780 /**< A fatal alert message was received from our peer. */ -#define MBEDTLS_ERR_SSL_PEER_VERIFY_FAILED -0x7800 /**< Verification of our peer failed. */ -#define MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY -0x7880 /**< The peer notified us that the connection is going to be closed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_HELLO -0x7900 /**< Processing of the ClientHello handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO -0x7980 /**< Processing of the ServerHello handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE -0x7A00 /**< Processing of the Certificate handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_REQUEST -0x7A80 /**< Processing of the CertificateRequest handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_KEY_EXCHANGE -0x7B00 /**< Processing of the ServerKeyExchange handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_SERVER_HELLO_DONE -0x7B80 /**< Processing of the ServerHelloDone handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE -0x7C00 /**< Processing of the ClientKeyExchange handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_RP -0x7C80 /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Read Public. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CLIENT_KEY_EXCHANGE_CS -0x7D00 /**< Processing of the ClientKeyExchange handshake message failed in DHM / ECDH Calculate Secret. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CERTIFICATE_VERIFY -0x7D80 /**< Processing of the CertificateVerify handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_CHANGE_CIPHER_SPEC -0x7E00 /**< Processing of the ChangeCipherSpec handshake message failed. */ -#define MBEDTLS_ERR_SSL_BAD_HS_FINISHED -0x7E80 /**< Processing of the Finished handshake message failed. */ -#define MBEDTLS_ERR_SSL_ALLOC_FAILED -0x7F00 /**< Memory allocation failed */ -#define MBEDTLS_ERR_SSL_HW_ACCEL_FAILED -0x7F80 /**< Hardware acceleration function returned with error */ -#define MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH -0x6F80 /**< Hardware acceleration function skipped / left alone data */ -#define MBEDTLS_ERR_SSL_COMPRESSION_FAILED -0x6F00 /**< Processing of the compression / decompression failed */ -#define MBEDTLS_ERR_SSL_BAD_HS_PROTOCOL_VERSION -0x6E80 /**< Handshake protocol not within min/max boundaries */ -#define MBEDTLS_ERR_SSL_BAD_HS_NEW_SESSION_TICKET -0x6E00 /**< Processing of the NewSessionTicket handshake message failed. */ -#define MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED -0x6D80 /**< Session ticket has expired. */ -#define MBEDTLS_ERR_SSL_PK_TYPE_MISMATCH -0x6D00 /**< Public key type mismatch (eg, asked for RSA key exchange and presented EC key) */ -#define MBEDTLS_ERR_SSL_UNKNOWN_IDENTITY -0x6C80 /**< Unknown identity received (eg, PSK identity) */ -#define MBEDTLS_ERR_SSL_INTERNAL_ERROR -0x6C00 /**< Internal error (eg, unexpected failure in lower-level module) */ -#define MBEDTLS_ERR_SSL_COUNTER_WRAPPING -0x6B80 /**< A counter would wrap (eg, too many messages exchanged). */ -#define MBEDTLS_ERR_SSL_WAITING_SERVER_HELLO_RENEGO -0x6B00 /**< Unexpected message at ServerHello in renegotiation. */ -#define MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED -0x6A80 /**< DTLS client must retry for hello verification */ -#define MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL -0x6A00 /**< A buffer is too small to receive or write a message */ -#define MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE -0x6980 /**< None of the common ciphersuites is usable (eg, no suitable certificate, see debug messages). */ -#define MBEDTLS_ERR_SSL_WANT_READ -0x6900 /**< No data of requested type currently available on underlying transport. */ -#define MBEDTLS_ERR_SSL_WANT_WRITE -0x6880 /**< Connection requires a write call. */ -#define MBEDTLS_ERR_SSL_TIMEOUT -0x6800 /**< The operation timed out. */ -#define MBEDTLS_ERR_SSL_CLIENT_RECONNECT -0x6780 /**< The client initiated a reconnect from the same port. */ -#define MBEDTLS_ERR_SSL_UNEXPECTED_RECORD -0x6700 /**< Record header looks valid but is not expected. */ -#define MBEDTLS_ERR_SSL_NON_FATAL -0x6680 /**< The alert message received indicates a non-fatal error. */ -#define MBEDTLS_ERR_SSL_INVALID_VERIFY_HASH -0x6600 /**< Couldn't set the hash for verifying CertificateVerify */ -#define MBEDTLS_ERR_SSL_CONTINUE_PROCESSING -0x6580 /**< Internal-only message signaling that further message-processing should be done */ -#define MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS -0x6500 /**< The asynchronous operation is not completed yet. */ -#define MBEDTLS_ERR_SSL_EARLY_MESSAGE -0x6480 /**< Internal-only message signaling that a message arrived early. */ -#define MBEDTLS_ERR_SSL_UNEXPECTED_CID -0x6000 /**< An encrypted DTLS-frame with an unexpected CID was received. */ -#define MBEDTLS_ERR_SSL_VERSION_MISMATCH -0x5F00 /**< An operation failed due to an unexpected version or configuration. */ -#define MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS -0x7000 /**< A cryptographic operation is in progress. Try again later. */ -#define MBEDTLS_ERR_SSL_BAD_CONFIG -0x5E80 /**< Invalid value in SSL config */ - -/* - * Various constants - */ -#define MBEDTLS_SSL_MAJOR_VERSION_3 3 -#define MBEDTLS_SSL_MINOR_VERSION_0 0 /*!< SSL v3.0 */ -#define MBEDTLS_SSL_MINOR_VERSION_1 1 /*!< TLS v1.0 */ -#define MBEDTLS_SSL_MINOR_VERSION_2 2 /*!< TLS v1.1 */ -#define MBEDTLS_SSL_MINOR_VERSION_3 3 /*!< TLS v1.2 */ -#define MBEDTLS_SSL_MINOR_VERSION_4 4 /*!< TLS v1.3 (experimental) */ - -#define MBEDTLS_SSL_TRANSPORT_STREAM 0 /*!< TLS */ -#define MBEDTLS_SSL_TRANSPORT_DATAGRAM 1 /*!< DTLS */ - -#define MBEDTLS_SSL_MAX_HOST_NAME_LEN 255 /*!< Maximum host name defined in RFC 1035 */ -#define MBEDTLS_SSL_MAX_ALPN_NAME_LEN 255 /*!< Maximum size in bytes of a protocol name in alpn ext., RFC 7301 */ - -#define MBEDTLS_SSL_MAX_ALPN_LIST_LEN 65535 /*!< Maximum size in bytes of list in alpn ext., RFC 7301 */ - -/* RFC 6066 section 4, see also mfl_code_to_length in ssl_tls.c - * NONE must be zero so that memset()ing structure to zero works */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_NONE 0 /*!< don't use this extension */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_512 1 /*!< MaxFragmentLength 2^9 */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_1024 2 /*!< MaxFragmentLength 2^10 */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_2048 3 /*!< MaxFragmentLength 2^11 */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_4096 4 /*!< MaxFragmentLength 2^12 */ -#define MBEDTLS_SSL_MAX_FRAG_LEN_INVALID 5 /*!< first invalid value */ - -#define MBEDTLS_SSL_IS_CLIENT 0 -#define MBEDTLS_SSL_IS_SERVER 1 - -#define MBEDTLS_SSL_IS_NOT_FALLBACK 0 -#define MBEDTLS_SSL_IS_FALLBACK 1 - -#define MBEDTLS_SSL_EXTENDED_MS_DISABLED 0 -#define MBEDTLS_SSL_EXTENDED_MS_ENABLED 1 - -#define MBEDTLS_SSL_CID_DISABLED 0 -#define MBEDTLS_SSL_CID_ENABLED 1 - -#define MBEDTLS_SSL_ETM_DISABLED 0 -#define MBEDTLS_SSL_ETM_ENABLED 1 - -#define MBEDTLS_SSL_COMPRESS_NULL 0 -#define MBEDTLS_SSL_COMPRESS_DEFLATE 1 - -#define MBEDTLS_SSL_VERIFY_NONE 0 -#define MBEDTLS_SSL_VERIFY_OPTIONAL 1 -#define MBEDTLS_SSL_VERIFY_REQUIRED 2 -#define MBEDTLS_SSL_VERIFY_UNSET 3 /* Used only for sni_authmode */ - -#define MBEDTLS_SSL_LEGACY_RENEGOTIATION 0 -#define MBEDTLS_SSL_SECURE_RENEGOTIATION 1 - -#define MBEDTLS_SSL_RENEGOTIATION_DISABLED 0 -#define MBEDTLS_SSL_RENEGOTIATION_ENABLED 1 - -#define MBEDTLS_SSL_ANTI_REPLAY_DISABLED 0 -#define MBEDTLS_SSL_ANTI_REPLAY_ENABLED 1 - -#define MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED -1 -#define MBEDTLS_SSL_RENEGO_MAX_RECORDS_DEFAULT 16 - -#define MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION 0 -#define MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION 1 -#define MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE 2 - -#define MBEDTLS_SSL_TRUNC_HMAC_DISABLED 0 -#define MBEDTLS_SSL_TRUNC_HMAC_ENABLED 1 -#define MBEDTLS_SSL_TRUNCATED_HMAC_LEN 10 /* 80 bits, rfc 6066 section 7 */ - -#define MBEDTLS_SSL_SESSION_TICKETS_DISABLED 0 -#define MBEDTLS_SSL_SESSION_TICKETS_ENABLED 1 - -#define MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED 0 -#define MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED 1 - -#define MBEDTLS_SSL_ARC4_ENABLED 0 -#define MBEDTLS_SSL_ARC4_DISABLED 1 - -#define MBEDTLS_SSL_PRESET_DEFAULT 0 -#define MBEDTLS_SSL_PRESET_SUITEB 2 - -#define MBEDTLS_SSL_CERT_REQ_CA_LIST_ENABLED 1 -#define MBEDTLS_SSL_CERT_REQ_CA_LIST_DISABLED 0 - -/* - * Default range for DTLS retransmission timer value, in milliseconds. - * RFC 6347 4.2.4.1 says from 1 second to 60 seconds. - */ -#define MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MIN 1000 -#define MBEDTLS_SSL_DTLS_TIMEOUT_DFL_MAX 60000 - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME) -#define MBEDTLS_SSL_DEFAULT_TICKET_LIFETIME 86400 /**< Lifetime of session tickets (if enabled) */ -#endif - -/* - * Maximum fragment length in bytes, - * determines the size of each of the two internal I/O buffers. - * - * Note: the RFC defines the default size of SSL / TLS messages. If you - * change the value here, other clients / servers may not be able to - * communicate with you anymore. Only change this value if you control - * both sides of the connection and have it reduced at both sides, or - * if you're using the Max Fragment Length extension and you know all your - * peers are using it too! - */ -#if !defined(MBEDTLS_SSL_MAX_CONTENT_LEN) -#define MBEDTLS_SSL_MAX_CONTENT_LEN 16384 /**< Size of the input / output buffer */ -#endif - -#if !defined(MBEDTLS_SSL_IN_CONTENT_LEN) -#define MBEDTLS_SSL_IN_CONTENT_LEN MBEDTLS_SSL_MAX_CONTENT_LEN -#endif - -#if !defined(MBEDTLS_SSL_OUT_CONTENT_LEN) -#define MBEDTLS_SSL_OUT_CONTENT_LEN MBEDTLS_SSL_MAX_CONTENT_LEN -#endif - -/* - * Maximum number of heap-allocated bytes for the purpose of - * DTLS handshake message reassembly and future message buffering. - */ -#if !defined(MBEDTLS_SSL_DTLS_MAX_BUFFERING) -#define MBEDTLS_SSL_DTLS_MAX_BUFFERING 32768 -#endif - -/* - * Maximum length of CIDs for incoming and outgoing messages. - */ -#if !defined(MBEDTLS_SSL_CID_IN_LEN_MAX) -#define MBEDTLS_SSL_CID_IN_LEN_MAX 32 -#endif - -#if !defined(MBEDTLS_SSL_CID_OUT_LEN_MAX) -#define MBEDTLS_SSL_CID_OUT_LEN_MAX 32 -#endif - -#if !defined(MBEDTLS_SSL_CID_PADDING_GRANULARITY) -#define MBEDTLS_SSL_CID_PADDING_GRANULARITY 16 -#endif - -#if !defined(MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY) -#define MBEDTLS_SSL_TLS1_3_PADDING_GRANULARITY 1 -#endif - -/* \} name SECTION: Module settings */ - -/* - * Length of the verify data for secure renegotiation - */ -#if defined(MBEDTLS_SSL_PROTO_SSL3) -#define MBEDTLS_SSL_VERIFY_DATA_MAX_LEN 36 -#else -#define MBEDTLS_SSL_VERIFY_DATA_MAX_LEN 12 -#endif - -/* - * Signaling ciphersuite values (SCSV) - */ -#define MBEDTLS_SSL_EMPTY_RENEGOTIATION_INFO 0xFF /**< renegotiation info ext */ -#define MBEDTLS_SSL_FALLBACK_SCSV_VALUE 0x5600 /**< RFC 7507 section 2 */ - -/* - * Supported Signature and Hash algorithms (For TLS 1.2) - * RFC 5246 section 7.4.1.4.1 - */ -#define MBEDTLS_SSL_HASH_NONE 0 -#define MBEDTLS_SSL_HASH_MD5 1 -#define MBEDTLS_SSL_HASH_SHA1 2 -#define MBEDTLS_SSL_HASH_SHA224 3 -#define MBEDTLS_SSL_HASH_SHA256 4 -#define MBEDTLS_SSL_HASH_SHA384 5 -#define MBEDTLS_SSL_HASH_SHA512 6 - -#define MBEDTLS_SSL_SIG_ANON 0 -#define MBEDTLS_SSL_SIG_RSA 1 -#define MBEDTLS_SSL_SIG_ECDSA 3 - -/* - * Client Certificate Types - * RFC 5246 section 7.4.4 plus RFC 4492 section 5.5 - */ -#define MBEDTLS_SSL_CERT_TYPE_RSA_SIGN 1 -#define MBEDTLS_SSL_CERT_TYPE_ECDSA_SIGN 64 - -/* - * Message, alert and handshake types - */ -#define MBEDTLS_SSL_MSG_CHANGE_CIPHER_SPEC 20 -#define MBEDTLS_SSL_MSG_ALERT 21 -#define MBEDTLS_SSL_MSG_HANDSHAKE 22 -#define MBEDTLS_SSL_MSG_APPLICATION_DATA 23 -#define MBEDTLS_SSL_MSG_CID 25 - -#define MBEDTLS_SSL_ALERT_LEVEL_WARNING 1 -#define MBEDTLS_SSL_ALERT_LEVEL_FATAL 2 - -#define MBEDTLS_SSL_ALERT_MSG_CLOSE_NOTIFY 0 /* 0x00 */ -#define MBEDTLS_SSL_ALERT_MSG_UNEXPECTED_MESSAGE 10 /* 0x0A */ -#define MBEDTLS_SSL_ALERT_MSG_BAD_RECORD_MAC 20 /* 0x14 */ -#define MBEDTLS_SSL_ALERT_MSG_DECRYPTION_FAILED 21 /* 0x15 */ -#define MBEDTLS_SSL_ALERT_MSG_RECORD_OVERFLOW 22 /* 0x16 */ -#define MBEDTLS_SSL_ALERT_MSG_DECOMPRESSION_FAILURE 30 /* 0x1E */ -#define MBEDTLS_SSL_ALERT_MSG_HANDSHAKE_FAILURE 40 /* 0x28 */ -#define MBEDTLS_SSL_ALERT_MSG_NO_CERT 41 /* 0x29 */ -#define MBEDTLS_SSL_ALERT_MSG_BAD_CERT 42 /* 0x2A */ -#define MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_CERT 43 /* 0x2B */ -#define MBEDTLS_SSL_ALERT_MSG_CERT_REVOKED 44 /* 0x2C */ -#define MBEDTLS_SSL_ALERT_MSG_CERT_EXPIRED 45 /* 0x2D */ -#define MBEDTLS_SSL_ALERT_MSG_CERT_UNKNOWN 46 /* 0x2E */ -#define MBEDTLS_SSL_ALERT_MSG_ILLEGAL_PARAMETER 47 /* 0x2F */ -#define MBEDTLS_SSL_ALERT_MSG_UNKNOWN_CA 48 /* 0x30 */ -#define MBEDTLS_SSL_ALERT_MSG_ACCESS_DENIED 49 /* 0x31 */ -#define MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR 50 /* 0x32 */ -#define MBEDTLS_SSL_ALERT_MSG_DECRYPT_ERROR 51 /* 0x33 */ -#define MBEDTLS_SSL_ALERT_MSG_EXPORT_RESTRICTION 60 /* 0x3C */ -#define MBEDTLS_SSL_ALERT_MSG_PROTOCOL_VERSION 70 /* 0x46 */ -#define MBEDTLS_SSL_ALERT_MSG_INSUFFICIENT_SECURITY 71 /* 0x47 */ -#define MBEDTLS_SSL_ALERT_MSG_INTERNAL_ERROR 80 /* 0x50 */ -#define MBEDTLS_SSL_ALERT_MSG_INAPROPRIATE_FALLBACK 86 /* 0x56 */ -#define MBEDTLS_SSL_ALERT_MSG_USER_CANCELED 90 /* 0x5A */ -#define MBEDTLS_SSL_ALERT_MSG_NO_RENEGOTIATION 100 /* 0x64 */ -#define MBEDTLS_SSL_ALERT_MSG_UNSUPPORTED_EXT 110 /* 0x6E */ -#define MBEDTLS_SSL_ALERT_MSG_UNRECOGNIZED_NAME 112 /* 0x70 */ -#define MBEDTLS_SSL_ALERT_MSG_UNKNOWN_PSK_IDENTITY 115 /* 0x73 */ -#define MBEDTLS_SSL_ALERT_MSG_NO_APPLICATION_PROTOCOL 120 /* 0x78 */ - -#define MBEDTLS_SSL_HS_HELLO_REQUEST 0 -#define MBEDTLS_SSL_HS_CLIENT_HELLO 1 -#define MBEDTLS_SSL_HS_SERVER_HELLO 2 -#define MBEDTLS_SSL_HS_HELLO_VERIFY_REQUEST 3 -#define MBEDTLS_SSL_HS_NEW_SESSION_TICKET 4 -#define MBEDTLS_SSL_HS_CERTIFICATE 11 -#define MBEDTLS_SSL_HS_SERVER_KEY_EXCHANGE 12 -#define MBEDTLS_SSL_HS_CERTIFICATE_REQUEST 13 -#define MBEDTLS_SSL_HS_SERVER_HELLO_DONE 14 -#define MBEDTLS_SSL_HS_CERTIFICATE_VERIFY 15 -#define MBEDTLS_SSL_HS_CLIENT_KEY_EXCHANGE 16 -#define MBEDTLS_SSL_HS_FINISHED 20 - -/* - * TLS extensions - */ -#define MBEDTLS_TLS_EXT_SERVERNAME 0 -#define MBEDTLS_TLS_EXT_SERVERNAME_HOSTNAME 0 - -#define MBEDTLS_TLS_EXT_MAX_FRAGMENT_LENGTH 1 - -#define MBEDTLS_TLS_EXT_TRUNCATED_HMAC 4 - -#define MBEDTLS_TLS_EXT_SUPPORTED_ELLIPTIC_CURVES 10 -#define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS 11 - -#define MBEDTLS_TLS_EXT_SIG_ALG 13 - -#define MBEDTLS_TLS_EXT_ALPN 16 - -#define MBEDTLS_TLS_EXT_ENCRYPT_THEN_MAC 22 /* 0x16 */ -#define MBEDTLS_TLS_EXT_EXTENDED_MASTER_SECRET 0x0017 /* 23 */ - -#define MBEDTLS_TLS_EXT_SESSION_TICKET 35 - -/* The value of the CID extension is still TBD as of - * draft-ietf-tls-dtls-connection-id-05 - * (https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05) */ -#define MBEDTLS_TLS_EXT_CID 254 /* TBD */ - -#define MBEDTLS_TLS_EXT_ECJPAKE_KKPP 256 /* experimental */ - -#define MBEDTLS_TLS_EXT_RENEGOTIATION_INFO 0xFF01 - -/* - * Size defines - */ -#if !defined(MBEDTLS_PSK_MAX_LEN) -#define MBEDTLS_PSK_MAX_LEN 32 /* 256 bits */ -#endif - -/* Dummy type used only for its size */ -union mbedtls_ssl_premaster_secret -{ -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) - unsigned char _pms_rsa[48]; /* RFC 5246 8.1.1 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) - unsigned char _pms_dhm[MBEDTLS_MPI_MAX_SIZE]; /* RFC 5246 8.1.2 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) - unsigned char _pms_ecdh[MBEDTLS_ECP_MAX_BYTES]; /* RFC 4492 5.10 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) - unsigned char _pms_psk[4 + 2 * MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 2 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) - unsigned char _pms_dhe_psk[4 + MBEDTLS_MPI_MAX_SIZE - + MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 3 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) - unsigned char _pms_rsa_psk[52 + MBEDTLS_PSK_MAX_LEN]; /* RFC 4279 4 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) - unsigned char _pms_ecdhe_psk[4 + MBEDTLS_ECP_MAX_BYTES - + MBEDTLS_PSK_MAX_LEN]; /* RFC 5489 2 */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) - unsigned char _pms_ecjpake[32]; /* Thread spec: SHA-256 output */ -#endif -}; - -#define MBEDTLS_PREMASTER_SIZE sizeof( union mbedtls_ssl_premaster_secret ) - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * SSL state machine - */ -typedef enum -{ - MBEDTLS_SSL_HELLO_REQUEST, - MBEDTLS_SSL_CLIENT_HELLO, - MBEDTLS_SSL_SERVER_HELLO, - MBEDTLS_SSL_SERVER_CERTIFICATE, - MBEDTLS_SSL_SERVER_KEY_EXCHANGE, - MBEDTLS_SSL_CERTIFICATE_REQUEST, - MBEDTLS_SSL_SERVER_HELLO_DONE, - MBEDTLS_SSL_CLIENT_CERTIFICATE, - MBEDTLS_SSL_CLIENT_KEY_EXCHANGE, - MBEDTLS_SSL_CERTIFICATE_VERIFY, - MBEDTLS_SSL_CLIENT_CHANGE_CIPHER_SPEC, - MBEDTLS_SSL_CLIENT_FINISHED, - MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC, - MBEDTLS_SSL_SERVER_FINISHED, - MBEDTLS_SSL_FLUSH_BUFFERS, - MBEDTLS_SSL_HANDSHAKE_WRAPUP, - MBEDTLS_SSL_HANDSHAKE_OVER, - MBEDTLS_SSL_SERVER_NEW_SESSION_TICKET, - MBEDTLS_SSL_SERVER_HELLO_VERIFY_REQUEST_SENT, -} -mbedtls_ssl_states; - -/* - * The tls_prf function types. - */ -typedef enum -{ - MBEDTLS_SSL_TLS_PRF_NONE, - MBEDTLS_SSL_TLS_PRF_SSL3, - MBEDTLS_SSL_TLS_PRF_TLS1, - MBEDTLS_SSL_TLS_PRF_SHA384, - MBEDTLS_SSL_TLS_PRF_SHA256 -} -mbedtls_tls_prf_types; -/** - * \brief Callback type: send data on the network. - * - * \note That callback may be either blocking or non-blocking. - * - * \param ctx Context for the send callback (typically a file descriptor) - * \param buf Buffer holding the data to send - * \param len Length of the data to send - * - * \return The callback must return the number of bytes sent if any, - * or a non-zero error code. - * If performing non-blocking I/O, \c MBEDTLS_ERR_SSL_WANT_WRITE - * must be returned when the operation would block. - * - * \note The callback is allowed to send fewer bytes than requested. - * It must always return the number of bytes actually sent. - */ -typedef int mbedtls_ssl_send_t( void *ctx, - const unsigned char *buf, - size_t len ); - -/** - * \brief Callback type: receive data from the network. - * - * \note That callback may be either blocking or non-blocking. - * - * \param ctx Context for the receive callback (typically a file - * descriptor) - * \param buf Buffer to write the received data to - * \param len Length of the receive buffer - * - * \return The callback must return the number of bytes received, - * or a non-zero error code. - * If performing non-blocking I/O, \c MBEDTLS_ERR_SSL_WANT_READ - * must be returned when the operation would block. - * - * \note The callback may receive fewer bytes than the length of the - * buffer. It must always return the number of bytes actually - * received and written to the buffer. - */ -typedef int mbedtls_ssl_recv_t( void *ctx, - unsigned char *buf, - size_t len ); - -/** - * \brief Callback type: receive data from the network, with timeout - * - * \note That callback must block until data is received, or the - * timeout delay expires, or the operation is interrupted by a - * signal. - * - * \param ctx Context for the receive callback (typically a file descriptor) - * \param buf Buffer to write the received data to - * \param len Length of the receive buffer - * \param timeout Maximum nomber of millisecondes to wait for data - * 0 means no timeout (potentially waiting forever) - * - * \return The callback must return the number of bytes received, - * or a non-zero error code: - * \c MBEDTLS_ERR_SSL_TIMEOUT if the operation timed out, - * \c MBEDTLS_ERR_SSL_WANT_READ if interrupted by a signal. - * - * \note The callback may receive fewer bytes than the length of the - * buffer. It must always return the number of bytes actually - * received and written to the buffer. - */ -typedef int mbedtls_ssl_recv_timeout_t( void *ctx, - unsigned char *buf, - size_t len, - uint32_t timeout ); -/** - * \brief Callback type: set a pair of timers/delays to watch - * - * \param ctx Context pointer - * \param int_ms Intermediate delay in milliseconds - * \param fin_ms Final delay in milliseconds - * 0 cancels the current timer. - * - * \note This callback must at least store the necessary information - * for the associated \c mbedtls_ssl_get_timer_t callback to - * return correct information. - * - * \note If using a event-driven style of programming, an event must - * be generated when the final delay is passed. The event must - * cause a call to \c mbedtls_ssl_handshake() with the proper - * SSL context to be scheduled. Care must be taken to ensure - * that at most one such call happens at a time. - * - * \note Only one timer at a time must be running. Calling this - * function while a timer is running must cancel it. Cancelled - * timers must not generate any event. - */ -typedef void mbedtls_ssl_set_timer_t( void * ctx, - uint32_t int_ms, - uint32_t fin_ms ); - -/** - * \brief Callback type: get status of timers/delays - * - * \param ctx Context pointer - * - * \return This callback must return: - * -1 if cancelled (fin_ms == 0), - * 0 if none of the delays have passed, - * 1 if only the intermediate delay has passed, - * 2 if the final delay has passed. - */ -typedef int mbedtls_ssl_get_timer_t( void * ctx ); - -/* Defined below */ -typedef struct mbedtls_ssl_session mbedtls_ssl_session; -typedef struct mbedtls_ssl_context mbedtls_ssl_context; -typedef struct mbedtls_ssl_config mbedtls_ssl_config; - -/* Defined in ssl_internal.h */ -typedef struct mbedtls_ssl_transform mbedtls_ssl_transform; -typedef struct mbedtls_ssl_handshake_params mbedtls_ssl_handshake_params; -typedef struct mbedtls_ssl_sig_hash_set_t mbedtls_ssl_sig_hash_set_t; -#if defined(MBEDTLS_X509_CRT_PARSE_C) -typedef struct mbedtls_ssl_key_cert mbedtls_ssl_key_cert; -#endif -#if defined(MBEDTLS_SSL_PROTO_DTLS) -typedef struct mbedtls_ssl_flight_item mbedtls_ssl_flight_item; -#endif - -#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Callback type: start external signature operation. - * - * This callback is called during an SSL handshake to start - * a signature decryption operation using an - * external processor. The parameter \p cert contains - * the public key; it is up to the callback function to - * determine how to access the associated private key. - * - * This function typically sends or enqueues a request, and - * does not wait for the operation to complete. This allows - * the handshake step to be non-blocking. - * - * The parameters \p ssl and \p cert are guaranteed to remain - * valid throughout the handshake. On the other hand, this - * function must save the contents of \p hash if the value - * is needed for later processing, because the \p hash buffer - * is no longer valid after this function returns. - * - * This function may call mbedtls_ssl_set_async_operation_data() - * to store an operation context for later retrieval - * by the resume or cancel callback. - * - * \note For RSA signatures, this function must produce output - * that is consistent with PKCS#1 v1.5 in the same way as - * mbedtls_rsa_pkcs1_sign(). Before the private key operation, - * apply the padding steps described in RFC 8017, section 9.2 - * "EMSA-PKCS1-v1_5" as follows. - * - If \p md_alg is #MBEDTLS_MD_NONE, apply the PKCS#1 v1.5 - * encoding, treating \p hash as the DigestInfo to be - * padded. In other words, apply EMSA-PKCS1-v1_5 starting - * from step 3, with `T = hash` and `tLen = hash_len`. - * - If `md_alg != MBEDTLS_MD_NONE`, apply the PKCS#1 v1.5 - * encoding, treating \p hash as the hash to be encoded and - * padded. In other words, apply EMSA-PKCS1-v1_5 starting - * from step 2, with `digestAlgorithm` obtained by calling - * mbedtls_oid_get_oid_by_md() on \p md_alg. - * - * \note For ECDSA signatures, the output format is the DER encoding - * `Ecdsa-Sig-Value` defined in - * [RFC 4492 section 5.4](https://tools.ietf.org/html/rfc4492#section-5.4). - * - * \param ssl The SSL connection instance. It should not be - * modified other than via - * mbedtls_ssl_set_async_operation_data(). - * \param cert Certificate containing the public key. - * In simple cases, this is one of the pointers passed to - * mbedtls_ssl_conf_own_cert() when configuring the SSL - * connection. However, if other callbacks are used, this - * property may not hold. For example, if an SNI callback - * is registered with mbedtls_ssl_conf_sni(), then - * this callback determines what certificate is used. - * \param md_alg Hash algorithm. - * \param hash Buffer containing the hash. This buffer is - * no longer valid when the function returns. - * \param hash_len Size of the \c hash buffer in bytes. - * - * \return 0 if the operation was started successfully and the SSL - * stack should call the resume callback immediately. - * \return #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation - * was started successfully and the SSL stack should return - * immediately without calling the resume callback yet. - * \return #MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH if the external - * processor does not support this key. The SSL stack will - * use the private key object instead. - * \return Any other error indicates a fatal failure and is - * propagated up the call chain. The callback should - * use \c MBEDTLS_ERR_PK_xxx error codes, and must not - * use \c MBEDTLS_ERR_SSL_xxx error codes except as - * directed in the documentation of this callback. - */ -typedef int mbedtls_ssl_async_sign_t( mbedtls_ssl_context *ssl, - mbedtls_x509_crt *cert, - mbedtls_md_type_t md_alg, - const unsigned char *hash, - size_t hash_len ); - -/** - * \brief Callback type: start external decryption operation. - * - * This callback is called during an SSL handshake to start - * an RSA decryption operation using an - * external processor. The parameter \p cert contains - * the public key; it is up to the callback function to - * determine how to access the associated private key. - * - * This function typically sends or enqueues a request, and - * does not wait for the operation to complete. This allows - * the handshake step to be non-blocking. - * - * The parameters \p ssl and \p cert are guaranteed to remain - * valid throughout the handshake. On the other hand, this - * function must save the contents of \p input if the value - * is needed for later processing, because the \p input buffer - * is no longer valid after this function returns. - * - * This function may call mbedtls_ssl_set_async_operation_data() - * to store an operation context for later retrieval - * by the resume or cancel callback. - * - * \warning RSA decryption as used in TLS is subject to a potential - * timing side channel attack first discovered by Bleichenbacher - * in 1998. This attack can be remotely exploitable - * in practice. To avoid this attack, you must ensure that - * if the callback performs an RSA decryption, the time it - * takes to execute and return the result does not depend - * on whether the RSA decryption succeeded or reported - * invalid padding. - * - * \param ssl The SSL connection instance. It should not be - * modified other than via - * mbedtls_ssl_set_async_operation_data(). - * \param cert Certificate containing the public key. - * In simple cases, this is one of the pointers passed to - * mbedtls_ssl_conf_own_cert() when configuring the SSL - * connection. However, if other callbacks are used, this - * property may not hold. For example, if an SNI callback - * is registered with mbedtls_ssl_conf_sni(), then - * this callback determines what certificate is used. - * \param input Buffer containing the input ciphertext. This buffer - * is no longer valid when the function returns. - * \param input_len Size of the \p input buffer in bytes. - * - * \return 0 if the operation was started successfully and the SSL - * stack should call the resume callback immediately. - * \return #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation - * was started successfully and the SSL stack should return - * immediately without calling the resume callback yet. - * \return #MBEDTLS_ERR_SSL_HW_ACCEL_FALLTHROUGH if the external - * processor does not support this key. The SSL stack will - * use the private key object instead. - * \return Any other error indicates a fatal failure and is - * propagated up the call chain. The callback should - * use \c MBEDTLS_ERR_PK_xxx error codes, and must not - * use \c MBEDTLS_ERR_SSL_xxx error codes except as - * directed in the documentation of this callback. - */ -typedef int mbedtls_ssl_async_decrypt_t( mbedtls_ssl_context *ssl, - mbedtls_x509_crt *cert, - const unsigned char *input, - size_t input_len ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -/** - * \brief Callback type: resume external operation. - * - * This callback is called during an SSL handshake to resume - * an external operation started by the - * ::mbedtls_ssl_async_sign_t or - * ::mbedtls_ssl_async_decrypt_t callback. - * - * This function typically checks the status of a pending - * request or causes the request queue to make progress, and - * does not wait for the operation to complete. This allows - * the handshake step to be non-blocking. - * - * This function may call mbedtls_ssl_get_async_operation_data() - * to retrieve an operation context set by the start callback. - * It may call mbedtls_ssl_set_async_operation_data() to modify - * this context. - * - * Note that when this function returns a status other than - * #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS, it must free any - * resources associated with the operation. - * - * \param ssl The SSL connection instance. It should not be - * modified other than via - * mbedtls_ssl_set_async_operation_data(). - * \param output Buffer containing the output (signature or decrypted - * data) on success. - * \param output_len On success, number of bytes written to \p output. - * \param output_size Size of the \p output buffer in bytes. - * - * \return 0 if output of the operation is available in the - * \p output buffer. - * \return #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if the operation - * is still in progress. Subsequent requests for progress - * on the SSL connection will call the resume callback - * again. - * \return Any other error means that the operation is aborted. - * The SSL handshake is aborted. The callback should - * use \c MBEDTLS_ERR_PK_xxx error codes, and must not - * use \c MBEDTLS_ERR_SSL_xxx error codes except as - * directed in the documentation of this callback. - */ -typedef int mbedtls_ssl_async_resume_t( mbedtls_ssl_context *ssl, - unsigned char *output, - size_t *output_len, - size_t output_size ); - -/** - * \brief Callback type: cancel external operation. - * - * This callback is called if an SSL connection is closed - * while an asynchronous operation is in progress. Note that - * this callback is not called if the - * ::mbedtls_ssl_async_resume_t callback has run and has - * returned a value other than - * #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS, since in that case - * the asynchronous operation has already completed. - * - * This function may call mbedtls_ssl_get_async_operation_data() - * to retrieve an operation context set by the start callback. - * - * \param ssl The SSL connection instance. It should not be - * modified. - */ -typedef void mbedtls_ssl_async_cancel_t( mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ - -#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) && \ - !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) -#define MBEDTLS_SSL_PEER_CERT_DIGEST_MAX_LEN 48 -#if defined(MBEDTLS_SHA256_C) -#define MBEDTLS_SSL_PEER_CERT_DIGEST_DFL_TYPE MBEDTLS_MD_SHA256 -#define MBEDTLS_SSL_PEER_CERT_DIGEST_DFL_LEN 32 -#elif defined(MBEDTLS_SHA512_C) -#define MBEDTLS_SSL_PEER_CERT_DIGEST_DFL_TYPE MBEDTLS_MD_SHA384 -#define MBEDTLS_SSL_PEER_CERT_DIGEST_DFL_LEN 48 -#elif defined(MBEDTLS_SHA1_C) -#define MBEDTLS_SSL_PEER_CERT_DIGEST_DFL_TYPE MBEDTLS_MD_SHA1 -#define MBEDTLS_SSL_PEER_CERT_DIGEST_DFL_LEN 20 -#else -/* This is already checked in check_config.h, but be sure. */ -#error "Bad configuration - need SHA-1, SHA-256 or SHA-512 enabled to compute digest of peer CRT." -#endif -#endif /* MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED && - !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */ - -/* - * This structure is used for storing current session data. - * - * Note: when changing this definition, we need to check and update: - * - in tests/suites/test_suite_ssl.function: - * ssl_populate_session() and ssl_serialize_session_save_load() - * - in library/ssl_tls.c: - * mbedtls_ssl_session_init() and mbedtls_ssl_session_free() - * mbedtls_ssl_session_save() and ssl_session_load() - * ssl_session_copy() - */ -struct mbedtls_ssl_session -{ -#if defined(MBEDTLS_HAVE_TIME) - mbedtls_time_t start; /*!< starting time */ -#endif - int ciphersuite; /*!< chosen ciphersuite */ - int compression; /*!< chosen compression */ - size_t id_len; /*!< session id length */ - unsigned char id[32]; /*!< session identifier */ - unsigned char master[48]; /*!< the master secret */ - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -#if defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) - mbedtls_x509_crt *peer_cert; /*!< peer X.509 cert chain */ -#else /* MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */ - /*! The digest of the peer's end-CRT. This must be kept to detect CRT - * changes during renegotiation, mitigating the triple handshake attack. */ - unsigned char *peer_cert_digest; - size_t peer_cert_digest_len; - mbedtls_md_type_t peer_cert_digest_type; -#endif /* !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - uint32_t verify_result; /*!< verification result */ - -#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_CLI_C) - unsigned char *ticket; /*!< RFC 5077 session ticket */ - size_t ticket_len; /*!< session ticket length */ - uint32_t ticket_lifetime; /*!< ticket lifetime hint */ -#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */ - -#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) - unsigned char mfl_code; /*!< MaxFragmentLength negotiated by peer */ -#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */ - -#if defined(MBEDTLS_SSL_TRUNCATED_HMAC) - int trunc_hmac; /*!< flag for truncated hmac activation */ -#endif /* MBEDTLS_SSL_TRUNCATED_HMAC */ - -#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) - int encrypt_then_mac; /*!< flag for EtM activation */ -#endif -}; - -/** - * SSL/TLS configuration to be shared between mbedtls_ssl_context structures. - */ -struct mbedtls_ssl_config -{ - /* Group items by size (largest first) to minimize padding overhead */ - - /* - * Pointers - */ - - const int *ciphersuite_list[4]; /*!< allowed ciphersuites per version */ - - /** Callback for printing debug output */ - void (*f_dbg)(void *, int, const char *, int, const char *); - void *p_dbg; /*!< context for the debug function */ - - /** Callback for getting (pseudo-)random numbers */ - int (*f_rng)(void *, unsigned char *, size_t); - void *p_rng; /*!< context for the RNG function */ - - /** Callback to retrieve a session from the cache */ - int (*f_get_cache)(void *, mbedtls_ssl_session *); - /** Callback to store a session into the cache */ - int (*f_set_cache)(void *, const mbedtls_ssl_session *); - void *p_cache; /*!< context for cache callbacks */ - -#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) - /** Callback for setting cert according to SNI extension */ - int (*f_sni)(void *, mbedtls_ssl_context *, const unsigned char *, size_t); - void *p_sni; /*!< context for SNI callback */ -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) - /** Callback to customize X.509 certificate chain verification */ - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *); - void *p_vrfy; /*!< context for X.509 verify calllback */ -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) - /** Callback to retrieve PSK key from identity */ - int (*f_psk)(void *, mbedtls_ssl_context *, const unsigned char *, size_t); - void *p_psk; /*!< context for PSK callback */ -#endif - -#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C) - /** Callback to create & write a cookie for ClientHello veirifcation */ - int (*f_cookie_write)( void *, unsigned char **, unsigned char *, - const unsigned char *, size_t ); - /** Callback to verify validity of a ClientHello cookie */ - int (*f_cookie_check)( void *, const unsigned char *, size_t, - const unsigned char *, size_t ); - void *p_cookie; /*!< context for the cookie callbacks */ -#endif - -#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_SRV_C) - /** Callback to create & write a session ticket */ - int (*f_ticket_write)( void *, const mbedtls_ssl_session *, - unsigned char *, const unsigned char *, size_t *, uint32_t * ); - /** Callback to parse a session ticket into a session structure */ - int (*f_ticket_parse)( void *, mbedtls_ssl_session *, unsigned char *, size_t); - void *p_ticket; /*!< context for the ticket callbacks */ -#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_SRV_C */ - -#if defined(MBEDTLS_SSL_EXPORT_KEYS) - /** Callback to export key block and master secret */ - int (*f_export_keys)( void *, const unsigned char *, - const unsigned char *, size_t, size_t, size_t ); - /** Callback to export key block, master secret, - * tls_prf and random bytes. Should replace f_export_keys */ - int (*f_export_keys_ext)( void *, const unsigned char *, - const unsigned char *, size_t, size_t, size_t, - const unsigned char[32], const unsigned char[32], - mbedtls_tls_prf_types ); - void *p_export_keys; /*!< context for key export callback */ -#endif - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) - size_t cid_len; /*!< The length of CIDs for incoming DTLS records. */ -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ - -#if defined(MBEDTLS_X509_CRT_PARSE_C) - const mbedtls_x509_crt_profile *cert_profile; /*!< verification profile */ - mbedtls_ssl_key_cert *key_cert; /*!< own certificate/key pair(s) */ - mbedtls_x509_crt *ca_chain; /*!< trusted CAs */ - mbedtls_x509_crl *ca_crl; /*!< trusted CAs CRLs */ -#if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK) - mbedtls_x509_crt_ca_cb_t f_ca_cb; - void *p_ca_cb; -#endif /* MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) -#if defined(MBEDTLS_X509_CRT_PARSE_C) - mbedtls_ssl_async_sign_t *f_async_sign_start; /*!< start asynchronous signature operation */ - mbedtls_ssl_async_decrypt_t *f_async_decrypt_start; /*!< start asynchronous decryption operation */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - mbedtls_ssl_async_resume_t *f_async_resume; /*!< resume asynchronous operation */ - mbedtls_ssl_async_cancel_t *f_async_cancel; /*!< cancel asynchronous operation */ - void *p_async_config_data; /*!< Configuration data set by mbedtls_ssl_conf_async_private_cb(). */ -#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ - -#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) - const int *sig_hashes; /*!< allowed signature hashes */ -#endif - -#if defined(MBEDTLS_ECP_C) - const mbedtls_ecp_group_id *curve_list; /*!< allowed curves */ -#endif - -#if defined(MBEDTLS_DHM_C) - mbedtls_mpi dhm_P; /*!< prime modulus for DHM */ - mbedtls_mpi dhm_G; /*!< generator for DHM */ -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) - -#if defined(MBEDTLS_USE_PSA_CRYPTO) - psa_key_handle_t psk_opaque; /*!< PSA key slot holding opaque PSK. - * This field should only be set via - * mbedtls_ssl_conf_psk_opaque(). - * If either no PSK or a raw PSK have - * been configured, this has value \c 0. */ -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - - unsigned char *psk; /*!< The raw pre-shared key. This field should - * only be set via mbedtls_ssl_conf_psk(). - * If either no PSK or an opaque PSK - * have been configured, this has value NULL. */ - size_t psk_len; /*!< The length of the raw pre-shared key. - * This field should only be set via - * mbedtls_ssl_conf_psk(). - * Its value is non-zero if and only if - * \c psk is not \c NULL. */ - - unsigned char *psk_identity; /*!< The PSK identity for PSK negotiation. - * This field should only be set via - * mbedtls_ssl_conf_psk(). - * This is set if and only if either - * \c psk or \c psk_opaque are set. */ - size_t psk_identity_len;/*!< The length of PSK identity. - * This field should only be set via - * mbedtls_ssl_conf_psk(). - * Its value is non-zero if and only if - * \c psk is not \c NULL or \c psk_opaque - * is not \c 0. */ -#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED */ - -#if defined(MBEDTLS_SSL_ALPN) - const char **alpn_list; /*!< ordered list of protocols */ -#endif - - /* - * Numerical settings (int then char) - */ - - uint32_t read_timeout; /*!< timeout for mbedtls_ssl_read (ms) */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - uint32_t hs_timeout_min; /*!< initial value of the handshake - retransmission timeout (ms) */ - uint32_t hs_timeout_max; /*!< maximum value of the handshake - retransmission timeout (ms) */ -#endif - -#if defined(MBEDTLS_SSL_RENEGOTIATION) - int renego_max_records; /*!< grace period for renegotiation */ - unsigned char renego_period[8]; /*!< value of the record counters - that triggers renegotiation */ -#endif - -#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) - unsigned int badmac_limit; /*!< limit of records with a bad MAC */ -#endif - -#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_CLI_C) - unsigned int dhm_min_bitlen; /*!< min. bit length of the DHM prime */ -#endif - - unsigned char max_major_ver; /*!< max. major version used */ - unsigned char max_minor_ver; /*!< max. minor version used */ - unsigned char min_major_ver; /*!< min. major version used */ - unsigned char min_minor_ver; /*!< min. minor version used */ - - /* - * Flags (bitfields) - */ - - unsigned int endpoint : 1; /*!< 0: client, 1: server */ - unsigned int transport : 1; /*!< stream (TLS) or datagram (DTLS) */ - unsigned int authmode : 2; /*!< MBEDTLS_SSL_VERIFY_XXX */ - /* needed even with renego disabled for LEGACY_BREAK_HANDSHAKE */ - unsigned int allow_legacy_renegotiation : 2 ; /*!< MBEDTLS_LEGACY_XXX */ -#if defined(MBEDTLS_ARC4_C) - unsigned int arc4_disabled : 1; /*!< blacklist RC4 ciphersuites? */ -#endif -#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) - unsigned int mfl_code : 3; /*!< desired fragment length */ -#endif -#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) - unsigned int encrypt_then_mac : 1 ; /*!< negotiate encrypt-then-mac? */ -#endif -#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) - unsigned int extended_ms : 1; /*!< negotiate extended master secret? */ -#endif -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) - unsigned int anti_replay : 1; /*!< detect and prevent replay? */ -#endif -#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) - unsigned int cbc_record_splitting : 1; /*!< do cbc record splitting */ -#endif -#if defined(MBEDTLS_SSL_RENEGOTIATION) - unsigned int disable_renegotiation : 1; /*!< disable renegotiation? */ -#endif -#if defined(MBEDTLS_SSL_TRUNCATED_HMAC) - unsigned int trunc_hmac : 1; /*!< negotiate truncated hmac? */ -#endif -#if defined(MBEDTLS_SSL_SESSION_TICKETS) - unsigned int session_tickets : 1; /*!< use session tickets? */ -#endif -#if defined(MBEDTLS_SSL_FALLBACK_SCSV) && defined(MBEDTLS_SSL_CLI_C) - unsigned int fallback : 1; /*!< is this a fallback? */ -#endif -#if defined(MBEDTLS_SSL_SRV_C) - unsigned int cert_req_ca_list : 1; /*!< enable sending CA list in - Certificate Request messages? */ -#endif -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) - unsigned int ignore_unexpected_cid : 1; /*!< Determines whether DTLS - * record with unexpected CID - * should lead to failure. */ -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ -}; - - -struct mbedtls_ssl_context -{ - const mbedtls_ssl_config *conf; /*!< configuration information */ - - /* - * Miscellaneous - */ - int state; /*!< SSL handshake: current state */ -#if defined(MBEDTLS_SSL_RENEGOTIATION) - int renego_status; /*!< Initial, in progress, pending? */ - int renego_records_seen; /*!< Records since renego request, or with DTLS, - number of retransmissions of request if - renego_max_records is < 0 */ -#endif /* MBEDTLS_SSL_RENEGOTIATION */ - - int major_ver; /*!< equal to MBEDTLS_SSL_MAJOR_VERSION_3 */ - int minor_ver; /*!< either 0 (SSL3) or 1 (TLS1.0) */ - -#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) - unsigned badmac_seen; /*!< records with a bad MAC received */ -#endif /* MBEDTLS_SSL_DTLS_BADMAC_LIMIT */ - -#if defined(MBEDTLS_X509_CRT_PARSE_C) - /** Callback to customize X.509 certificate chain verification */ - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *); - void *p_vrfy; /*!< context for X.509 verify callback */ -#endif - - mbedtls_ssl_send_t *f_send; /*!< Callback for network send */ - mbedtls_ssl_recv_t *f_recv; /*!< Callback for network receive */ - mbedtls_ssl_recv_timeout_t *f_recv_timeout; - /*!< Callback for network receive with timeout */ - - void *p_bio; /*!< context for I/O operations */ - - /* - * Session layer - */ - mbedtls_ssl_session *session_in; /*!< current session data (in) */ - mbedtls_ssl_session *session_out; /*!< current session data (out) */ - mbedtls_ssl_session *session; /*!< negotiated session data */ - mbedtls_ssl_session *session_negotiate; /*!< session data in negotiation */ - - mbedtls_ssl_handshake_params *handshake; /*!< params required only during - the handshake process */ - - /* - * Record layer transformations - */ - mbedtls_ssl_transform *transform_in; /*!< current transform params (in) */ - mbedtls_ssl_transform *transform_out; /*!< current transform params (in) */ - mbedtls_ssl_transform *transform; /*!< negotiated transform params */ - mbedtls_ssl_transform *transform_negotiate; /*!< transform params in negotiation */ - - /* - * Timers - */ - void *p_timer; /*!< context for the timer callbacks */ - - mbedtls_ssl_set_timer_t *f_set_timer; /*!< set timer callback */ - mbedtls_ssl_get_timer_t *f_get_timer; /*!< get timer callback */ - - /* - * Record layer (incoming data) - */ - unsigned char *in_buf; /*!< input buffer */ - unsigned char *in_ctr; /*!< 64-bit incoming message counter - TLS: maintained by us - DTLS: read from peer */ - unsigned char *in_hdr; /*!< start of record header */ -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) - unsigned char *in_cid; /*!< The start of the CID; - * (the end is marked by in_len). */ -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ - unsigned char *in_len; /*!< two-bytes message length field */ - unsigned char *in_iv; /*!< ivlen-byte IV */ - unsigned char *in_msg; /*!< message contents (in_iv+ivlen) */ - unsigned char *in_offt; /*!< read offset in application data */ - - int in_msgtype; /*!< record header: message type */ - size_t in_msglen; /*!< record header: message length */ - size_t in_left; /*!< amount of data read so far */ -#if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH) - size_t in_buf_len; /*!< length of input buffer */ -#endif -#if defined(MBEDTLS_SSL_PROTO_DTLS) - uint16_t in_epoch; /*!< DTLS epoch for incoming records */ - size_t next_record_offset; /*!< offset of the next record in datagram - (equal to in_left if none) */ -#endif /* MBEDTLS_SSL_PROTO_DTLS */ -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) - uint64_t in_window_top; /*!< last validated record seq_num */ - uint64_t in_window; /*!< bitmask for replay detection */ -#endif /* MBEDTLS_SSL_DTLS_ANTI_REPLAY */ - - size_t in_hslen; /*!< current handshake message length, - including the handshake header */ - int nb_zero; /*!< # of 0-length encrypted messages */ - - int keep_current_message; /*!< drop or reuse current message - on next call to record layer? */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - uint8_t disable_datagram_packing; /*!< Disable packing multiple records - * within a single datagram. */ -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - - /* - * Record layer (outgoing data) - */ - unsigned char *out_buf; /*!< output buffer */ - unsigned char *out_ctr; /*!< 64-bit outgoing message counter */ - unsigned char *out_hdr; /*!< start of record header */ -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) - unsigned char *out_cid; /*!< The start of the CID; - * (the end is marked by in_len). */ -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ - unsigned char *out_len; /*!< two-bytes message length field */ - unsigned char *out_iv; /*!< ivlen-byte IV */ - unsigned char *out_msg; /*!< message contents (out_iv+ivlen) */ - - int out_msgtype; /*!< record header: message type */ - size_t out_msglen; /*!< record header: message length */ - size_t out_left; /*!< amount of data not yet written */ -#if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH) - size_t out_buf_len; /*!< length of output buffer */ -#endif - - unsigned char cur_out_ctr[8]; /*!< Outgoing record sequence number. */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - uint16_t mtu; /*!< path mtu, used to fragment outgoing messages */ -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - -#if defined(MBEDTLS_ZLIB_SUPPORT) - unsigned char *compress_buf; /*!< zlib data buffer */ -#endif /* MBEDTLS_ZLIB_SUPPORT */ -#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) - signed char split_done; /*!< current record already splitted? */ -#endif /* MBEDTLS_SSL_CBC_RECORD_SPLITTING */ - - /* - * PKI layer - */ - int client_auth; /*!< flag for client auth. */ - - /* - * User settings - */ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - char *hostname; /*!< expected peer CN for verification - (and SNI if available) */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_ALPN) - const char *alpn_chosen; /*!< negotiated protocol */ -#endif /* MBEDTLS_SSL_ALPN */ - - /* - * Information for DTLS hello verify - */ -#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C) - unsigned char *cli_id; /*!< transport-level ID of the client */ - size_t cli_id_len; /*!< length of cli_id */ -#endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY && MBEDTLS_SSL_SRV_C */ - - /* - * Secure renegotiation - */ - /* needed to know when to send extension on server */ - int secure_renegotiation; /*!< does peer support legacy or - secure renegotiation */ -#if defined(MBEDTLS_SSL_RENEGOTIATION) - size_t verify_data_len; /*!< length of verify data stored */ - char own_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]; /*!< previous handshake verify data */ - char peer_verify_data[MBEDTLS_SSL_VERIFY_DATA_MAX_LEN]; /*!< previous handshake verify data */ -#endif /* MBEDTLS_SSL_RENEGOTIATION */ - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) - /* CID configuration to use in subsequent handshakes. */ - - /*! The next incoming CID, chosen by the user and applying to - * all subsequent handshakes. This may be different from the - * CID currently used in case the user has re-configured the CID - * after an initial handshake. */ - unsigned char own_cid[ MBEDTLS_SSL_CID_IN_LEN_MAX ]; - uint8_t own_cid_len; /*!< The length of \c own_cid. */ - uint8_t negotiate_cid; /*!< This indicates whether the CID extension should - * be negotiated in the next handshake or not. - * Possible values are #MBEDTLS_SSL_CID_ENABLED - * and #MBEDTLS_SSL_CID_DISABLED. */ -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ -}; - -#if defined(MBEDTLS_SSL_HW_RECORD_ACCEL) - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) - -#define MBEDTLS_SSL_CHANNEL_OUTBOUND MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( 0 ) -#define MBEDTLS_SSL_CHANNEL_INBOUND MBEDTLS_DEPRECATED_NUMERIC_CONSTANT( 1 ) - -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif /* MBEDTLS_DEPRECATED_WARNING */ - -MBEDTLS_DEPRECATED extern int (*mbedtls_ssl_hw_record_init)( - mbedtls_ssl_context *ssl, - const unsigned char *key_enc, const unsigned char *key_dec, - size_t keylen, - const unsigned char *iv_enc, const unsigned char *iv_dec, - size_t ivlen, - const unsigned char *mac_enc, const unsigned char *mac_dec, - size_t maclen); -MBEDTLS_DEPRECATED extern int (*mbedtls_ssl_hw_record_activate)( - mbedtls_ssl_context *ssl, - int direction ); -MBEDTLS_DEPRECATED extern int (*mbedtls_ssl_hw_record_reset)( - mbedtls_ssl_context *ssl ); -MBEDTLS_DEPRECATED extern int (*mbedtls_ssl_hw_record_write)( - mbedtls_ssl_context *ssl ); -MBEDTLS_DEPRECATED extern int (*mbedtls_ssl_hw_record_read)( - mbedtls_ssl_context *ssl ); -MBEDTLS_DEPRECATED extern int (*mbedtls_ssl_hw_record_finish)( - mbedtls_ssl_context *ssl ); - -#undef MBEDTLS_DEPRECATED -#endif /* !MBEDTLS_DEPRECATED_REMOVED */ - -#endif /* MBEDTLS_SSL_HW_RECORD_ACCEL */ - -/** - * \brief Return the name of the ciphersuite associated with the - * given ID - * - * \param ciphersuite_id SSL ciphersuite ID - * - * \return a string containing the ciphersuite name - */ -const char *mbedtls_ssl_get_ciphersuite_name( const int ciphersuite_id ); - -/** - * \brief Return the ID of the ciphersuite associated with the - * given name - * - * \param ciphersuite_name SSL ciphersuite name - * - * \return the ID with the ciphersuite or 0 if not found - */ -int mbedtls_ssl_get_ciphersuite_id( const char *ciphersuite_name ); - -/** - * \brief Initialize an SSL context - * Just makes the context ready for mbedtls_ssl_setup() or - * mbedtls_ssl_free() - * - * \param ssl SSL context - */ -void mbedtls_ssl_init( mbedtls_ssl_context *ssl ); - -/** - * \brief Set up an SSL context for use - * - * \note No copy of the configuration context is made, it can be - * shared by many mbedtls_ssl_context structures. - * - * \warning The conf structure will be accessed during the session. - * It must not be modified or freed as long as the session - * is active. - * - * \warning This function must be called exactly once per context. - * Calling mbedtls_ssl_setup again is not supported, even - * if no session is active. - * - * \param ssl SSL context - * \param conf SSL configuration to use - * - * \return 0 if successful, or MBEDTLS_ERR_SSL_ALLOC_FAILED if - * memory allocation failed - */ -int mbedtls_ssl_setup( mbedtls_ssl_context *ssl, - const mbedtls_ssl_config *conf ); - -/** - * \brief Reset an already initialized SSL context for re-use - * while retaining application-set variables, function - * pointers and data. - * - * \param ssl SSL context - * \return 0 if successful, or MBEDTLS_ERR_SSL_ALLOC_FAILED, - MBEDTLS_ERR_SSL_HW_ACCEL_FAILED or - * MBEDTLS_ERR_SSL_COMPRESSION_FAILED - */ -int mbedtls_ssl_session_reset( mbedtls_ssl_context *ssl ); - -/** - * \brief Set the current endpoint type - * - * \param conf SSL configuration - * \param endpoint must be MBEDTLS_SSL_IS_CLIENT or MBEDTLS_SSL_IS_SERVER - */ -void mbedtls_ssl_conf_endpoint( mbedtls_ssl_config *conf, int endpoint ); - -/** - * \brief Set the transport type (TLS or DTLS). - * Default: TLS - * - * \note For DTLS, you must either provide a recv callback that - * doesn't block, or one that handles timeouts, see - * \c mbedtls_ssl_set_bio(). You also need to provide timer - * callbacks with \c mbedtls_ssl_set_timer_cb(). - * - * \param conf SSL configuration - * \param transport transport type: - * MBEDTLS_SSL_TRANSPORT_STREAM for TLS, - * MBEDTLS_SSL_TRANSPORT_DATAGRAM for DTLS. - */ -void mbedtls_ssl_conf_transport( mbedtls_ssl_config *conf, int transport ); - -/** - * \brief Set the certificate verification mode - * Default: NONE on server, REQUIRED on client - * - * \param conf SSL configuration - * \param authmode can be: - * - * MBEDTLS_SSL_VERIFY_NONE: peer certificate is not checked - * (default on server) - * (insecure on client) - * - * MBEDTLS_SSL_VERIFY_OPTIONAL: peer certificate is checked, however the - * handshake continues even if verification failed; - * mbedtls_ssl_get_verify_result() can be called after the - * handshake is complete. - * - * MBEDTLS_SSL_VERIFY_REQUIRED: peer *must* present a valid certificate, - * handshake is aborted if verification failed. - * (default on client) - * - * \note On client, MBEDTLS_SSL_VERIFY_REQUIRED is the recommended mode. - * With MBEDTLS_SSL_VERIFY_OPTIONAL, the user needs to call mbedtls_ssl_get_verify_result() at - * the right time(s), which may not be obvious, while REQUIRED always perform - * the verification as soon as possible. For example, REQUIRED was protecting - * against the "triple handshake" attack even before it was found. - */ -void mbedtls_ssl_conf_authmode( mbedtls_ssl_config *conf, int authmode ); - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Set the verification callback (Optional). - * - * If set, the provided verify callback is called for each - * certificate in the peer's CRT chain, including the trusted - * root. For more information, please see the documentation of - * \c mbedtls_x509_crt_verify(). - * - * \note For per context callbacks and contexts, please use - * mbedtls_ssl_set_verify() instead. - * - * \param conf The SSL configuration to use. - * \param f_vrfy The verification callback to use during CRT verification. - * \param p_vrfy The opaque context to be passed to the callback. - */ -void mbedtls_ssl_conf_verify( mbedtls_ssl_config *conf, - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), - void *p_vrfy ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -/** - * \brief Set the random number generator callback - * - * \param conf SSL configuration - * \param f_rng RNG function - * \param p_rng RNG parameter - */ -void mbedtls_ssl_conf_rng( mbedtls_ssl_config *conf, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Set the debug callback - * - * The callback has the following argument: - * void * opaque context for the callback - * int debug level - * const char * file name - * int line number - * const char * message - * - * \param conf SSL configuration - * \param f_dbg debug function - * \param p_dbg debug parameter - */ -void mbedtls_ssl_conf_dbg( mbedtls_ssl_config *conf, - void (*f_dbg)(void *, int, const char *, int, const char *), - void *p_dbg ); - -/** - * \brief Set the underlying BIO callbacks for write, read and - * read-with-timeout. - * - * \param ssl SSL context - * \param p_bio parameter (context) shared by BIO callbacks - * \param f_send write callback - * \param f_recv read callback - * \param f_recv_timeout blocking read callback with timeout. - * - * \note One of f_recv or f_recv_timeout can be NULL, in which case - * the other is used. If both are non-NULL, f_recv_timeout is - * used and f_recv is ignored (as if it were NULL). - * - * \note The two most common use cases are: - * - non-blocking I/O, f_recv != NULL, f_recv_timeout == NULL - * - blocking I/O, f_recv == NULL, f_recv_timout != NULL - * - * \note For DTLS, you need to provide either a non-NULL - * f_recv_timeout callback, or a f_recv that doesn't block. - * - * \note See the documentations of \c mbedtls_ssl_sent_t, - * \c mbedtls_ssl_recv_t and \c mbedtls_ssl_recv_timeout_t for - * the conventions those callbacks must follow. - * - * \note On some platforms, net_sockets.c provides - * \c mbedtls_net_send(), \c mbedtls_net_recv() and - * \c mbedtls_net_recv_timeout() that are suitable to be used - * here. - */ -void mbedtls_ssl_set_bio( mbedtls_ssl_context *ssl, - void *p_bio, - mbedtls_ssl_send_t *f_send, - mbedtls_ssl_recv_t *f_recv, - mbedtls_ssl_recv_timeout_t *f_recv_timeout ); - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) - - -/** - * \brief Configure the use of the Connection ID (CID) - * extension in the next handshake. - * - * Reference: draft-ietf-tls-dtls-connection-id-05 - * https://tools.ietf.org/html/draft-ietf-tls-dtls-connection-id-05 - * - * The DTLS CID extension allows the reliable association of - * DTLS records to DTLS connections across changes in the - * underlying transport (changed IP and Port metadata) by - * adding explicit connection identifiers (CIDs) to the - * headers of encrypted DTLS records. The desired CIDs are - * configured by the application layer and are exchanged in - * new `ClientHello` / `ServerHello` extensions during the - * handshake, where each side indicates the CID it wants the - * peer to use when writing encrypted messages. The CIDs are - * put to use once records get encrypted: the stack discards - * any incoming records that don't include the configured CID - * in their header, and adds the peer's requested CID to the - * headers of outgoing messages. - * - * This API enables or disables the use of the CID extension - * in the next handshake and sets the value of the CID to - * be used for incoming messages. - * - * \param ssl The SSL context to configure. This must be initialized. - * \param enable This value determines whether the CID extension should - * be used or not. Possible values are: - * - MBEDTLS_SSL_CID_ENABLED to enable the use of the CID. - * - MBEDTLS_SSL_CID_DISABLED (default) to disable the use - * of the CID. - * \param own_cid The address of the readable buffer holding the CID we want - * the peer to use when sending encrypted messages to us. - * This may be \c NULL if \p own_cid_len is \c 0. - * This parameter is unused if \p enabled is set to - * MBEDTLS_SSL_CID_DISABLED. - * \param own_cid_len The length of \p own_cid. - * This parameter is unused if \p enabled is set to - * MBEDTLS_SSL_CID_DISABLED. - * - * \note The value of \p own_cid_len must match the value of the - * \c len parameter passed to mbedtls_ssl_conf_cid() - * when configuring the ::mbedtls_ssl_config that \p ssl - * is bound to. - * - * \note This CID configuration applies to subsequent handshakes - * performed on the SSL context \p ssl, but does not trigger - * one. You still have to call `mbedtls_ssl_handshake()` - * (for the initial handshake) or `mbedtls_ssl_renegotiate()` - * (for a renegotiation handshake) explicitly after a - * successful call to this function to run the handshake. - * - * \note This call cannot guarantee that the use of the CID - * will be successfully negotiated in the next handshake, - * because the peer might not support it. Specifically: - * - On the Client, enabling the use of the CID through - * this call implies that the `ClientHello` in the next - * handshake will include the CID extension, thereby - * offering the use of the CID to the server. Only if - * the `ServerHello` contains the CID extension, too, - * the CID extension will actually be put to use. - * - On the Server, enabling the use of the CID through - * this call implies that that the server will look for - * the CID extension in a `ClientHello` from the client, - * and, if present, reply with a CID extension in its - * `ServerHello`. - * - * \note To check whether the use of the CID was negotiated - * after the subsequent handshake has completed, please - * use the API mbedtls_ssl_get_peer_cid(). - * - * \warning If the use of the CID extension is enabled in this call - * and the subsequent handshake negotiates its use, Mbed TLS - * will silently drop every packet whose CID does not match - * the CID configured in \p own_cid. It is the responsibility - * of the user to adapt the underlying transport to take care - * of CID-based demultiplexing before handing datagrams to - * Mbed TLS. - * - * \return \c 0 on success. In this case, the CID configuration - * applies to the next handshake. - * \return A negative error code on failure. - */ -int mbedtls_ssl_set_cid( mbedtls_ssl_context *ssl, - int enable, - unsigned char const *own_cid, - size_t own_cid_len ); - -/** - * \brief Get information about the use of the CID extension - * in the current connection. - * - * \param ssl The SSL context to query. - * \param enabled The address at which to store whether the CID extension - * is currently in use or not. If the CID is in use, - * `*enabled` is set to MBEDTLS_SSL_CID_ENABLED; - * otherwise, it is set to MBEDTLS_SSL_CID_DISABLED. - * \param peer_cid The address of the buffer in which to store the CID - * chosen by the peer (if the CID extension is used). - * This may be \c NULL in case the value of peer CID - * isn't needed. If it is not \c NULL, \p peer_cid_len - * must not be \c NULL. - * \param peer_cid_len The address at which to store the size of the CID - * chosen by the peer (if the CID extension is used). - * This is also the number of Bytes in \p peer_cid that - * have been written. - * This may be \c NULL in case the length of the peer CID - * isn't needed. If it is \c NULL, \p peer_cid must be - * \c NULL, too. - * - * \note This applies to the state of the CID negotiated in - * the last complete handshake. If a handshake is in - * progress, this function will attempt to complete - * the handshake first. - * - * \note If CID extensions have been exchanged but both client - * and server chose to use an empty CID, this function - * sets `*enabled` to #MBEDTLS_SSL_CID_DISABLED - * (the rationale for this is that the resulting - * communication is the same as if the CID extensions - * hadn't been used). - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -int mbedtls_ssl_get_peer_cid( mbedtls_ssl_context *ssl, - int *enabled, - unsigned char peer_cid[ MBEDTLS_SSL_CID_OUT_LEN_MAX ], - size_t *peer_cid_len ); - -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ - -/** - * \brief Set the Maximum Tranport Unit (MTU). - * Special value: 0 means unset (no limit). - * This represents the maximum size of a datagram payload - * handled by the transport layer (usually UDP) as determined - * by the network link and stack. In practice, this controls - * the maximum size datagram the DTLS layer will pass to the - * \c f_send() callback set using \c mbedtls_ssl_set_bio(). - * - * \note The limit on datagram size is converted to a limit on - * record payload by subtracting the current overhead of - * encapsulation and encryption/authentication if any. - * - * \note This can be called at any point during the connection, for - * example when a Path Maximum Transfer Unit (PMTU) - * estimate becomes available from other sources, - * such as lower (or higher) protocol layers. - * - * \note This setting only controls the size of the packets we send, - * and does not restrict the size of the datagrams we're - * willing to receive. Client-side, you can request the - * server to use smaller records with \c - * mbedtls_ssl_conf_max_frag_len(). - * - * \note If both a MTU and a maximum fragment length have been - * configured (or negotiated with the peer), the resulting - * lower limit on record payload (see first note) is used. - * - * \note This can only be used to decrease the maximum size - * of datagrams (hence records, see first note) sent. It - * cannot be used to increase the maximum size of records over - * the limit set by #MBEDTLS_SSL_OUT_CONTENT_LEN. - * - * \note Values lower than the current record layer expansion will - * result in an error when trying to send data. - * - * \note Using record compression together with a non-zero MTU value - * will result in an error when trying to send data. - * - * \param ssl SSL context - * \param mtu Value of the path MTU in bytes - */ -void mbedtls_ssl_set_mtu( mbedtls_ssl_context *ssl, uint16_t mtu ); -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Set a connection-specific verification callback (optional). - * - * If set, the provided verify callback is called for each - * certificate in the peer's CRT chain, including the trusted - * root. For more information, please see the documentation of - * \c mbedtls_x509_crt_verify(). - * - * \note This call is analogous to mbedtls_ssl_conf_verify() but - * binds the verification callback and context to an SSL context - * as opposed to an SSL configuration. - * If mbedtls_ssl_conf_verify() and mbedtls_ssl_set_verify() - * are both used, mbedtls_ssl_set_verify() takes precedence. - * - * \param ssl The SSL context to use. - * \param f_vrfy The verification callback to use during CRT verification. - * \param p_vrfy The opaque context to be passed to the callback. - */ -void mbedtls_ssl_set_verify( mbedtls_ssl_context *ssl, - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), - void *p_vrfy ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -/** - * \brief Set the timeout period for mbedtls_ssl_read() - * (Default: no timeout.) - * - * \param conf SSL configuration context - * \param timeout Timeout value in milliseconds. - * Use 0 for no timeout (default). - * - * \note With blocking I/O, this will only work if a non-NULL - * \c f_recv_timeout was set with \c mbedtls_ssl_set_bio(). - * With non-blocking I/O, this will only work if timer - * callbacks were set with \c mbedtls_ssl_set_timer_cb(). - * - * \note With non-blocking I/O, you may also skip this function - * altogether and handle timeouts at the application layer. - */ -void mbedtls_ssl_conf_read_timeout( mbedtls_ssl_config *conf, uint32_t timeout ); - -#if defined(MBEDTLS_SSL_RECORD_CHECKING) -/** - * \brief Check whether a buffer contains a valid and authentic record - * that has not been seen before. (DTLS only). - * - * This function does not change the user-visible state - * of the SSL context. Its sole purpose is to provide - * an indication of the legitimacy of an incoming record. - * - * This can be useful e.g. in distributed server environments - * using the DTLS Connection ID feature, in which connections - * might need to be passed between service instances on a change - * of peer address, but where such disruptive operations should - * only happen after the validity of incoming records has been - * confirmed. - * - * \param ssl The SSL context to use. - * \param buf The address of the buffer holding the record to be checked. - * This must be a read/write buffer of length \p buflen Bytes. - * \param buflen The length of \p buf in Bytes. - * - * \note This routine only checks whether the provided buffer begins - * with a valid and authentic record that has not been seen - * before, but does not check potential data following the - * initial record. In particular, it is possible to pass DTLS - * datagrams containing multiple records, in which case only - * the first record is checked. - * - * \note This function modifies the input buffer \p buf. If you need - * to preserve the original record, you have to maintain a copy. - * - * \return \c 0 if the record is valid and authentic and has not been - * seen before. - * \return MBEDTLS_ERR_SSL_INVALID_MAC if the check completed - * successfully but the record was found to be not authentic. - * \return MBEDTLS_ERR_SSL_INVALID_RECORD if the check completed - * successfully but the record was found to be invalid for - * a reason different from authenticity checking. - * \return MBEDTLS_ERR_SSL_UNEXPECTED_RECORD if the check completed - * successfully but the record was found to be unexpected - * in the state of the SSL context, including replayed records. - * \return Another negative error code on different kinds of failure. - * In this case, the SSL context becomes unusable and needs - * to be freed or reset before reuse. - */ -int mbedtls_ssl_check_record( mbedtls_ssl_context const *ssl, - unsigned char *buf, - size_t buflen ); -#endif /* MBEDTLS_SSL_RECORD_CHECKING */ - -/** - * \brief Set the timer callbacks (Mandatory for DTLS.) - * - * \param ssl SSL context - * \param p_timer parameter (context) shared by timer callbacks - * \param f_set_timer set timer callback - * \param f_get_timer get timer callback. Must return: - * - * \note See the documentation of \c mbedtls_ssl_set_timer_t and - * \c mbedtls_ssl_get_timer_t for the conventions this pair of - * callbacks must follow. - * - * \note On some platforms, timing.c provides - * \c mbedtls_timing_set_delay() and - * \c mbedtls_timing_get_delay() that are suitable for using - * here, except if using an event-driven style. - * - * \note See also the "DTLS tutorial" article in our knowledge base. - * https://tls.mbed.org/kb/how-to/dtls-tutorial - */ -void mbedtls_ssl_set_timer_cb( mbedtls_ssl_context *ssl, - void *p_timer, - mbedtls_ssl_set_timer_t *f_set_timer, - mbedtls_ssl_get_timer_t *f_get_timer ); - -/** - * \brief Callback type: generate and write session ticket - * - * \note This describes what a callback implementation should do. - * This callback should generate an encrypted and - * authenticated ticket for the session and write it to the - * output buffer. Here, ticket means the opaque ticket part - * of the NewSessionTicket structure of RFC 5077. - * - * \param p_ticket Context for the callback - * \param session SSL session to be written in the ticket - * \param start Start of the output buffer - * \param end End of the output buffer - * \param tlen On exit, holds the length written - * \param lifetime On exit, holds the lifetime of the ticket in seconds - * - * \return 0 if successful, or - * a specific MBEDTLS_ERR_XXX code. - */ -typedef int mbedtls_ssl_ticket_write_t( void *p_ticket, - const mbedtls_ssl_session *session, - unsigned char *start, - const unsigned char *end, - size_t *tlen, - uint32_t *lifetime ); - -#if defined(MBEDTLS_SSL_EXPORT_KEYS) -/** - * \brief Callback type: Export key block and master secret - * - * \note This is required for certain uses of TLS, e.g. EAP-TLS - * (RFC 5216) and Thread. The key pointers are ephemeral and - * therefore must not be stored. The master secret and keys - * should not be used directly except as an input to a key - * derivation function. - * - * \param p_expkey Context for the callback - * \param ms Pointer to master secret (fixed length: 48 bytes) - * \param kb Pointer to key block, see RFC 5246 section 6.3 - * (variable length: 2 * maclen + 2 * keylen + 2 * ivlen). - * \param maclen MAC length - * \param keylen Key length - * \param ivlen IV length - * - * \return 0 if successful, or - * a specific MBEDTLS_ERR_XXX code. - */ -typedef int mbedtls_ssl_export_keys_t( void *p_expkey, - const unsigned char *ms, - const unsigned char *kb, - size_t maclen, - size_t keylen, - size_t ivlen ); - -/** - * \brief Callback type: Export key block, master secret, - * handshake randbytes and the tls_prf function - * used to derive keys. - * - * \note This is required for certain uses of TLS, e.g. EAP-TLS - * (RFC 5216) and Thread. The key pointers are ephemeral and - * therefore must not be stored. The master secret and keys - * should not be used directly except as an input to a key - * derivation function. - * - * \param p_expkey Context for the callback. - * \param ms Pointer to master secret (fixed length: 48 bytes). - * \param kb Pointer to key block, see RFC 5246 section 6.3. - * (variable length: 2 * maclen + 2 * keylen + 2 * ivlen). - * \param maclen MAC length. - * \param keylen Key length. - * \param ivlen IV length. - * \param client_random The client random bytes. - * \param server_random The server random bytes. - * \param tls_prf_type The tls_prf enum type. - * - * \return 0 if successful, or - * a specific MBEDTLS_ERR_XXX code. - */ -typedef int mbedtls_ssl_export_keys_ext_t( void *p_expkey, - const unsigned char *ms, - const unsigned char *kb, - size_t maclen, - size_t keylen, - size_t ivlen, - const unsigned char client_random[32], - const unsigned char server_random[32], - mbedtls_tls_prf_types tls_prf_type ); -#endif /* MBEDTLS_SSL_EXPORT_KEYS */ - -/** - * \brief Callback type: parse and load session ticket - * - * \note This describes what a callback implementation should do. - * This callback should parse a session ticket as generated - * by the corresponding mbedtls_ssl_ticket_write_t function, - * and, if the ticket is authentic and valid, load the - * session. - * - * \note The implementation is allowed to modify the first len - * bytes of the input buffer, eg to use it as a temporary - * area for the decrypted ticket contents. - * - * \param p_ticket Context for the callback - * \param session SSL session to be loaded - * \param buf Start of the buffer containing the ticket - * \param len Length of the ticket. - * - * \return 0 if successful, or - * MBEDTLS_ERR_SSL_INVALID_MAC if not authentic, or - * MBEDTLS_ERR_SSL_SESSION_TICKET_EXPIRED if expired, or - * any other non-zero code for other failures. - */ -typedef int mbedtls_ssl_ticket_parse_t( void *p_ticket, - mbedtls_ssl_session *session, - unsigned char *buf, - size_t len ); - -#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_SRV_C) -/** - * \brief Configure SSL session ticket callbacks (server only). - * (Default: none.) - * - * \note On server, session tickets are enabled by providing - * non-NULL callbacks. - * - * \note On client, use \c mbedtls_ssl_conf_session_tickets(). - * - * \param conf SSL configuration context - * \param f_ticket_write Callback for writing a ticket - * \param f_ticket_parse Callback for parsing a ticket - * \param p_ticket Context shared by the two callbacks - */ -void mbedtls_ssl_conf_session_tickets_cb( mbedtls_ssl_config *conf, - mbedtls_ssl_ticket_write_t *f_ticket_write, - mbedtls_ssl_ticket_parse_t *f_ticket_parse, - void *p_ticket ); -#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_SRV_C */ - -#if defined(MBEDTLS_SSL_EXPORT_KEYS) -/** - * \brief Configure key export callback. - * (Default: none.) - * - * \note See \c mbedtls_ssl_export_keys_t. - * - * \param conf SSL configuration context - * \param f_export_keys Callback for exporting keys - * \param p_export_keys Context for the callback - */ -void mbedtls_ssl_conf_export_keys_cb( mbedtls_ssl_config *conf, - mbedtls_ssl_export_keys_t *f_export_keys, - void *p_export_keys ); - -/** - * \brief Configure extended key export callback. - * (Default: none.) - * - * \note See \c mbedtls_ssl_export_keys_ext_t. - * - * \param conf SSL configuration context - * \param f_export_keys_ext Callback for exporting keys - * \param p_export_keys Context for the callback - */ -void mbedtls_ssl_conf_export_keys_ext_cb( mbedtls_ssl_config *conf, - mbedtls_ssl_export_keys_ext_t *f_export_keys_ext, - void *p_export_keys ); -#endif /* MBEDTLS_SSL_EXPORT_KEYS */ - -#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) -/** - * \brief Configure asynchronous private key operation callbacks. - * - * \param conf SSL configuration context - * \param f_async_sign Callback to start a signature operation. See - * the description of ::mbedtls_ssl_async_sign_t - * for more information. This may be \c NULL if the - * external processor does not support any signature - * operation; in this case the private key object - * associated with the certificate will be used. - * \param f_async_decrypt Callback to start a decryption operation. See - * the description of ::mbedtls_ssl_async_decrypt_t - * for more information. This may be \c NULL if the - * external processor does not support any decryption - * operation; in this case the private key object - * associated with the certificate will be used. - * \param f_async_resume Callback to resume an asynchronous operation. See - * the description of ::mbedtls_ssl_async_resume_t - * for more information. This may not be \c NULL unless - * \p f_async_sign and \p f_async_decrypt are both - * \c NULL. - * \param f_async_cancel Callback to cancel an asynchronous operation. See - * the description of ::mbedtls_ssl_async_cancel_t - * for more information. This may be \c NULL if - * no cleanup is needed. - * \param config_data A pointer to configuration data which can be - * retrieved with - * mbedtls_ssl_conf_get_async_config_data(). The - * library stores this value without dereferencing it. - */ -void mbedtls_ssl_conf_async_private_cb( mbedtls_ssl_config *conf, - mbedtls_ssl_async_sign_t *f_async_sign, - mbedtls_ssl_async_decrypt_t *f_async_decrypt, - mbedtls_ssl_async_resume_t *f_async_resume, - mbedtls_ssl_async_cancel_t *f_async_cancel, - void *config_data ); - -/** - * \brief Retrieve the configuration data set by - * mbedtls_ssl_conf_async_private_cb(). - * - * \param conf SSL configuration context - * \return The configuration data set by - * mbedtls_ssl_conf_async_private_cb(). - */ -void *mbedtls_ssl_conf_get_async_config_data( const mbedtls_ssl_config *conf ); - -/** - * \brief Retrieve the asynchronous operation user context. - * - * \note This function may only be called while a handshake - * is in progress. - * - * \param ssl The SSL context to access. - * - * \return The asynchronous operation user context that was last - * set during the current handshake. If - * mbedtls_ssl_set_async_operation_data() has not yet been - * called during the current handshake, this function returns - * \c NULL. - */ -void *mbedtls_ssl_get_async_operation_data( const mbedtls_ssl_context *ssl ); - -/** - * \brief Retrieve the asynchronous operation user context. - * - * \note This function may only be called while a handshake - * is in progress. - * - * \param ssl The SSL context to access. - * \param ctx The new value of the asynchronous operation user context. - * Call mbedtls_ssl_get_async_operation_data() later during the - * same handshake to retrieve this value. - */ -void mbedtls_ssl_set_async_operation_data( mbedtls_ssl_context *ssl, - void *ctx ); -#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ - -/** - * \brief Callback type: generate a cookie - * - * \param ctx Context for the callback - * \param p Buffer to write to, - * must be updated to point right after the cookie - * \param end Pointer to one past the end of the output buffer - * \param info Client ID info that was passed to - * \c mbedtls_ssl_set_client_transport_id() - * \param ilen Length of info in bytes - * - * \return The callback must return 0 on success, - * or a negative error code. - */ -typedef int mbedtls_ssl_cookie_write_t( void *ctx, - unsigned char **p, unsigned char *end, - const unsigned char *info, size_t ilen ); - -/** - * \brief Callback type: verify a cookie - * - * \param ctx Context for the callback - * \param cookie Cookie to verify - * \param clen Length of cookie - * \param info Client ID info that was passed to - * \c mbedtls_ssl_set_client_transport_id() - * \param ilen Length of info in bytes - * - * \return The callback must return 0 if cookie is valid, - * or a negative error code. - */ -typedef int mbedtls_ssl_cookie_check_t( void *ctx, - const unsigned char *cookie, size_t clen, - const unsigned char *info, size_t ilen ); - -#if defined(MBEDTLS_SSL_DTLS_HELLO_VERIFY) && defined(MBEDTLS_SSL_SRV_C) -/** - * \brief Register callbacks for DTLS cookies - * (Server only. DTLS only.) - * - * Default: dummy callbacks that fail, in order to force you to - * register working callbacks (and initialize their context). - * - * To disable HelloVerifyRequest, register NULL callbacks. - * - * \warning Disabling hello verification allows your server to be used - * for amplification in DoS attacks against other hosts. - * Only disable if you known this can't happen in your - * particular environment. - * - * \note See comments on \c mbedtls_ssl_handshake() about handling - * the MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED that is expected - * on the first handshake attempt when this is enabled. - * - * \note This is also necessary to handle client reconnection from - * the same port as described in RFC 6347 section 4.2.8 (only - * the variant with cookies is supported currently). See - * comments on \c mbedtls_ssl_read() for details. - * - * \param conf SSL configuration - * \param f_cookie_write Cookie write callback - * \param f_cookie_check Cookie check callback - * \param p_cookie Context for both callbacks - */ -void mbedtls_ssl_conf_dtls_cookies( mbedtls_ssl_config *conf, - mbedtls_ssl_cookie_write_t *f_cookie_write, - mbedtls_ssl_cookie_check_t *f_cookie_check, - void *p_cookie ); - -/** - * \brief Set client's transport-level identification info. - * (Server only. DTLS only.) - * - * This is usually the IP address (and port), but could be - * anything identify the client depending on the underlying - * network stack. Used for HelloVerifyRequest with DTLS. - * This is *not* used to route the actual packets. - * - * \param ssl SSL context - * \param info Transport-level info identifying the client (eg IP + port) - * \param ilen Length of info in bytes - * - * \note An internal copy is made, so the info buffer can be reused. - * - * \return 0 on success, - * MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used on client, - * MBEDTLS_ERR_SSL_ALLOC_FAILED if out of memory. - */ -int mbedtls_ssl_set_client_transport_id( mbedtls_ssl_context *ssl, - const unsigned char *info, - size_t ilen ); - -#endif /* MBEDTLS_SSL_DTLS_HELLO_VERIFY && MBEDTLS_SSL_SRV_C */ - -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) -/** - * \brief Enable or disable anti-replay protection for DTLS. - * (DTLS only, no effect on TLS.) - * Default: enabled. - * - * \param conf SSL configuration - * \param mode MBEDTLS_SSL_ANTI_REPLAY_ENABLED or MBEDTLS_SSL_ANTI_REPLAY_DISABLED. - * - * \warning Disabling this is a security risk unless the application - * protocol handles duplicated packets in a safe way. You - * should not disable this without careful consideration. - * However, if your application already detects duplicated - * packets and needs information about them to adjust its - * transmission strategy, then you'll want to disable this. - */ -void mbedtls_ssl_conf_dtls_anti_replay( mbedtls_ssl_config *conf, char mode ); -#endif /* MBEDTLS_SSL_DTLS_ANTI_REPLAY */ - -#if defined(MBEDTLS_SSL_DTLS_BADMAC_LIMIT) -/** - * \brief Set a limit on the number of records with a bad MAC - * before terminating the connection. - * (DTLS only, no effect on TLS.) - * Default: 0 (disabled). - * - * \param conf SSL configuration - * \param limit Limit, or 0 to disable. - * - * \note If the limit is N, then the connection is terminated when - * the Nth non-authentic record is seen. - * - * \note Records with an invalid header are not counted, only the - * ones going through the authentication-decryption phase. - * - * \note This is a security trade-off related to the fact that it's - * often relatively easy for an active attacker ot inject UDP - * datagrams. On one hand, setting a low limit here makes it - * easier for such an attacker to forcibly terminated a - * connection. On the other hand, a high limit or no limit - * might make us waste resources checking authentication on - * many bogus packets. - */ -void mbedtls_ssl_conf_dtls_badmac_limit( mbedtls_ssl_config *conf, unsigned limit ); -#endif /* MBEDTLS_SSL_DTLS_BADMAC_LIMIT */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - -/** - * \brief Allow or disallow packing of multiple handshake records - * within a single datagram. - * - * \param ssl The SSL context to configure. - * \param allow_packing This determines whether datagram packing may - * be used or not. A value of \c 0 means that every - * record will be sent in a separate datagram; a - * value of \c 1 means that, if space permits, - * multiple handshake messages (including CCS) belonging to - * a single flight may be packed within a single datagram. - * - * \note This is enabled by default and should only be disabled - * for test purposes, or if datagram packing causes - * interoperability issues with peers that don't support it. - * - * \note Allowing datagram packing reduces the network load since - * there's less overhead if multiple messages share the same - * datagram. Also, it increases the handshake efficiency - * since messages belonging to a single datagram will not - * be reordered in transit, and so future message buffering - * or flight retransmission (if no buffering is used) as - * means to deal with reordering are needed less frequently. - * - * \note Application records are not affected by this option and - * are currently always sent in separate datagrams. - * - */ -void mbedtls_ssl_set_datagram_packing( mbedtls_ssl_context *ssl, - unsigned allow_packing ); - -/** - * \brief Set retransmit timeout values for the DTLS handshake. - * (DTLS only, no effect on TLS.) - * - * \param conf SSL configuration - * \param min Initial timeout value in milliseconds. - * Default: 1000 (1 second). - * \param max Maximum timeout value in milliseconds. - * Default: 60000 (60 seconds). - * - * \note Default values are from RFC 6347 section 4.2.4.1. - * - * \note The 'min' value should typically be slightly above the - * expected round-trip time to your peer, plus whatever time - * it takes for the peer to process the message. For example, - * if your RTT is about 600ms and you peer needs up to 1s to - * do the cryptographic operations in the handshake, then you - * should set 'min' slightly above 1600. Lower values of 'min' - * might cause spurious resends which waste network resources, - * while larger value of 'min' will increase overall latency - * on unreliable network links. - * - * \note The more unreliable your network connection is, the larger - * your max / min ratio needs to be in order to achieve - * reliable handshakes. - * - * \note Messages are retransmitted up to log2(ceil(max/min)) times. - * For example, if min = 1s and max = 5s, the retransmit plan - * goes: send ... 1s -> resend ... 2s -> resend ... 4s -> - * resend ... 5s -> give up and return a timeout error. - */ -void mbedtls_ssl_conf_handshake_timeout( mbedtls_ssl_config *conf, uint32_t min, uint32_t max ); -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - -#if defined(MBEDTLS_SSL_SRV_C) -/** - * \brief Set the session cache callbacks (server-side only) - * If not set, no session resuming is done (except if session - * tickets are enabled too). - * - * The session cache has the responsibility to check for stale - * entries based on timeout. See RFC 5246 for recommendations. - * - * Warning: session.peer_cert is cleared by the SSL/TLS layer on - * connection shutdown, so do not cache the pointer! Either set - * it to NULL or make a full copy of the certificate. - * - * The get callback is called once during the initial handshake - * to enable session resuming. The get function has the - * following parameters: (void *parameter, mbedtls_ssl_session *session) - * If a valid entry is found, it should fill the master of - * the session object with the cached values and return 0, - * return 1 otherwise. Optionally peer_cert can be set as well - * if it is properly present in cache entry. - * - * The set callback is called once during the initial handshake - * to enable session resuming after the entire handshake has - * been finished. The set function has the following parameters: - * (void *parameter, const mbedtls_ssl_session *session). The function - * should create a cache entry for future retrieval based on - * the data in the session structure and should keep in mind - * that the mbedtls_ssl_session object presented (and all its referenced - * data) is cleared by the SSL/TLS layer when the connection is - * terminated. It is recommended to add metadata to determine if - * an entry is still valid in the future. Return 0 if - * successfully cached, return 1 otherwise. - * - * \param conf SSL configuration - * \param p_cache parmater (context) for both callbacks - * \param f_get_cache session get callback - * \param f_set_cache session set callback - */ -void mbedtls_ssl_conf_session_cache( mbedtls_ssl_config *conf, - void *p_cache, - int (*f_get_cache)(void *, mbedtls_ssl_session *), - int (*f_set_cache)(void *, const mbedtls_ssl_session *) ); -#endif /* MBEDTLS_SSL_SRV_C */ - -#if defined(MBEDTLS_SSL_CLI_C) -/** - * \brief Request resumption of session (client-side only) - * Session data is copied from presented session structure. - * - * \param ssl SSL context - * \param session session context - * - * \return 0 if successful, - * MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used server-side or - * arguments are otherwise invalid - * - * \sa mbedtls_ssl_get_session() - */ -int mbedtls_ssl_set_session( mbedtls_ssl_context *ssl, const mbedtls_ssl_session *session ); -#endif /* MBEDTLS_SSL_CLI_C */ - -/** - * \brief Load serialized session data into a session structure. - * On client, this can be used for loading saved sessions - * before resuming them with mbedstls_ssl_set_session(). - * On server, this can be used for alternative implementations - * of session cache or session tickets. - * - * \warning If a peer certificate chain is associated with the session, - * the serialized state will only contain the peer's - * end-entity certificate and the result of the chain - * verification (unless verification was disabled), but not - * the rest of the chain. - * - * \see mbedtls_ssl_session_save() - * \see mbedtls_ssl_set_session() - * - * \param session The session structure to be populated. It must have been - * initialised with mbedtls_ssl_session_init() but not - * populated yet. - * \param buf The buffer holding the serialized session data. It must be a - * readable buffer of at least \p len bytes. - * \param len The size of the serialized data in bytes. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed. - * \return #MBEDTLS_ERR_SSL_BAD_INPUT_DATA if input data is invalid. - * \return #MBEDTLS_ERR_SSL_VERSION_MISMATCH if the serialized data - * was generated in a different version or configuration of - * Mbed TLS. - * \return Another negative value for other kinds of errors (for - * example, unsupported features in the embedded certificate). - */ -int mbedtls_ssl_session_load( mbedtls_ssl_session *session, - const unsigned char *buf, - size_t len ); - -/** - * \brief Save session structure as serialized data in a buffer. - * On client, this can be used for saving session data, - * potentially in non-volatile storage, for resuming later. - * On server, this can be used for alternative implementations - * of session cache or session tickets. - * - * \see mbedtls_ssl_session_load() - * \see mbedtls_ssl_get_session_pointer() - * - * \param session The session structure to be saved. - * \param buf The buffer to write the serialized data to. It must be a - * writeable buffer of at least \p len bytes, or may be \c - * NULL if \p len is \c 0. - * \param buf_len The number of bytes available for writing in \p buf. - * \param olen The size in bytes of the data that has been or would have - * been written. It must point to a valid \c size_t. - * - * \note \p olen is updated to the correct value regardless of - * whether \p buf_len was large enough. This makes it possible - * to determine the necessary size by calling this function - * with \p buf set to \c NULL and \p buf_len to \c 0. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL if \p buf is too small. - */ -int mbedtls_ssl_session_save( const mbedtls_ssl_session *session, - unsigned char *buf, - size_t buf_len, - size_t *olen ); - -/** - * \brief Get a pointer to the current session structure, for example - * to serialize it. - * - * \warning Ownership of the session remains with the SSL context, and - * the returned pointer is only guaranteed to be valid until - * the next API call operating on the same \p ssl context. - * - * \see mbedtls_ssl_session_save() - * - * \param ssl The SSL context. - * - * \return A pointer to the current session if successful. - * \return \c NULL if no session is active. - */ -const mbedtls_ssl_session *mbedtls_ssl_get_session_pointer( const mbedtls_ssl_context *ssl ); - -/** - * \brief Set the list of allowed ciphersuites and the preference - * order. First in the list has the highest preference. - * (Overrides all version-specific lists) - * - * The ciphersuites array is not copied, and must remain - * valid for the lifetime of the ssl_config. - * - * Note: The server uses its own preferences - * over the preference of the client unless - * MBEDTLS_SSL_SRV_RESPECT_CLIENT_PREFERENCE is defined! - * - * \param conf SSL configuration - * \param ciphersuites 0-terminated list of allowed ciphersuites - */ -void mbedtls_ssl_conf_ciphersuites( mbedtls_ssl_config *conf, - const int *ciphersuites ); - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) -#define MBEDTLS_SSL_UNEXPECTED_CID_IGNORE 0 -#define MBEDTLS_SSL_UNEXPECTED_CID_FAIL 1 -/** - * \brief Specify the length of Connection IDs for incoming - * encrypted DTLS records, as well as the behaviour - * on unexpected CIDs. - * - * By default, the CID length is set to \c 0, - * and unexpected CIDs are silently ignored. - * - * \param conf The SSL configuration to modify. - * \param len The length in Bytes of the CID fields in encrypted - * DTLS records using the CID mechanism. This must - * not be larger than #MBEDTLS_SSL_CID_OUT_LEN_MAX. - * \param ignore_other_cids This determines the stack's behaviour when - * receiving a record with an unexpected CID. - * Possible values are: - * - #MBEDTLS_SSL_UNEXPECTED_CID_IGNORE - * In this case, the record is silently ignored. - * - #MBEDTLS_SSL_UNEXPECTED_CID_FAIL - * In this case, the stack fails with the specific - * error code #MBEDTLS_ERR_SSL_UNEXPECTED_CID. - * - * \note The CID specification allows implementations to either - * use a common length for all incoming connection IDs or - * allow variable-length incoming IDs. Mbed TLS currently - * requires a common length for all connections sharing the - * same SSL configuration; this allows simpler parsing of - * record headers. - * - * \return \c 0 on success. - * \return #MBEDTLS_ERR_SSL_BAD_INPUT_DATA if \p own_cid_len - * is too large. - */ -int mbedtls_ssl_conf_cid( mbedtls_ssl_config *conf, size_t len, - int ignore_other_cids ); -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ - -/** - * \brief Set the list of allowed ciphersuites and the - * preference order for a specific version of the protocol. - * (Only useful on the server side) - * - * The ciphersuites array is not copied, and must remain - * valid for the lifetime of the ssl_config. - * - * \param conf SSL configuration - * \param ciphersuites 0-terminated list of allowed ciphersuites - * \param major Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3 - * supported) - * \param minor Minor version number (MBEDTLS_SSL_MINOR_VERSION_0, - * MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2, - * MBEDTLS_SSL_MINOR_VERSION_3 supported) - * - * \note With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0 - * and MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2 - */ -void mbedtls_ssl_conf_ciphersuites_for_version( mbedtls_ssl_config *conf, - const int *ciphersuites, - int major, int minor ); - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Set the X.509 security profile used for verification - * - * \note The restrictions are enforced for all certificates in the - * chain. However, signatures in the handshake are not covered - * by this setting but by \b mbedtls_ssl_conf_sig_hashes(). - * - * \param conf SSL configuration - * \param profile Profile to use - */ -void mbedtls_ssl_conf_cert_profile( mbedtls_ssl_config *conf, - const mbedtls_x509_crt_profile *profile ); - -/** - * \brief Set the data required to verify peer certificate - * - * \note See \c mbedtls_x509_crt_verify() for notes regarding the - * parameters ca_chain (maps to trust_ca for that function) - * and ca_crl. - * - * \param conf SSL configuration - * \param ca_chain trusted CA chain (meaning all fully trusted top-level CAs) - * \param ca_crl trusted CA CRLs - */ -void mbedtls_ssl_conf_ca_chain( mbedtls_ssl_config *conf, - mbedtls_x509_crt *ca_chain, - mbedtls_x509_crl *ca_crl ); - -#if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK) -/** - * \brief Set the trusted certificate callback. - * - * This API allows to register the set of trusted certificates - * through a callback, instead of a linked list as configured - * by mbedtls_ssl_conf_ca_chain(). - * - * This is useful for example in contexts where a large number - * of CAs are used, and the inefficiency of maintaining them - * in a linked list cannot be tolerated. It is also useful when - * the set of trusted CAs needs to be modified frequently. - * - * See the documentation of `mbedtls_x509_crt_ca_cb_t` for - * more information. - * - * \param conf The SSL configuration to register the callback with. - * \param f_ca_cb The trusted certificate callback to use when verifying - * certificate chains. - * \param p_ca_cb The context to be passed to \p f_ca_cb (for example, - * a reference to a trusted CA database). - * - * \note This API is incompatible with mbedtls_ssl_conf_ca_chain(): - * Any call to this function overwrites the values set through - * earlier calls to mbedtls_ssl_conf_ca_chain() or - * mbedtls_ssl_conf_ca_cb(). - * - * \note This API is incompatible with CA indication in - * CertificateRequest messages: A server-side SSL context which - * is bound to an SSL configuration that uses a CA callback - * configured via mbedtls_ssl_conf_ca_cb(), and which requires - * client authentication, will send an empty CA list in the - * corresponding CertificateRequest message. - * - * \note This API is incompatible with mbedtls_ssl_set_hs_ca_chain(): - * If an SSL context is bound to an SSL configuration which uses - * CA callbacks configured via mbedtls_ssl_conf_ca_cb(), then - * calls to mbedtls_ssl_set_hs_ca_chain() have no effect. - * - * \note The use of this API disables the use of restartable ECC - * during X.509 CRT signature verification (but doesn't affect - * other uses). - * - * \warning This API is incompatible with the use of CRLs. Any call to - * mbedtls_ssl_conf_ca_cb() unsets CRLs configured through - * earlier calls to mbedtls_ssl_conf_ca_chain(). - * - * \warning In multi-threaded environments, the callback \p f_ca_cb - * must be thread-safe, and it is the user's responsibility - * to guarantee this (for example through a mutex - * contained in the callback context pointed to by \p p_ca_cb). - */ -void mbedtls_ssl_conf_ca_cb( mbedtls_ssl_config *conf, - mbedtls_x509_crt_ca_cb_t f_ca_cb, - void *p_ca_cb ); -#endif /* MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK */ - -/** - * \brief Set own certificate chain and private key - * - * \note own_cert should contain in order from the bottom up your - * certificate chain. The top certificate (self-signed) - * can be omitted. - * - * \note On server, this function can be called multiple times to - * provision more than one cert/key pair (eg one ECDSA, one - * RSA with SHA-256, one RSA with SHA-1). An adequate - * certificate will be selected according to the client's - * advertised capabilities. In case multiple certificates are - * adequate, preference is given to the one set by the first - * call to this function, then second, etc. - * - * \note On client, only the first call has any effect. That is, - * only one client certificate can be provisioned. The - * server's preferences in its CertficateRequest message will - * be ignored and our only cert will be sent regardless of - * whether it matches those preferences - the server can then - * decide what it wants to do with it. - * - * \note The provided \p pk_key needs to match the public key in the - * first certificate in \p own_cert, or all handshakes using - * that certificate will fail. It is your responsibility - * to ensure that; this function will not perform any check. - * You may use mbedtls_pk_check_pair() in order to perform - * this check yourself, but be aware that this function can - * be computationally expensive on some key types. - * - * \param conf SSL configuration - * \param own_cert own public certificate chain - * \param pk_key own private key - * - * \return 0 on success or MBEDTLS_ERR_SSL_ALLOC_FAILED - */ -int mbedtls_ssl_conf_own_cert( mbedtls_ssl_config *conf, - mbedtls_x509_crt *own_cert, - mbedtls_pk_context *pk_key ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) -/** - * \brief Configure a pre-shared key (PSK) and identity - * to be used in PSK-based ciphersuites. - * - * \note This is mainly useful for clients. Servers will usually - * want to use \c mbedtls_ssl_conf_psk_cb() instead. - * - * \note A PSK set by \c mbedtls_ssl_set_hs_psk() in the PSK callback - * takes precedence over a PSK configured by this function. - * - * \warning Currently, clients can only register a single pre-shared key. - * Calling this function or mbedtls_ssl_conf_psk_opaque() more - * than once will overwrite values configured in previous calls. - * Support for setting multiple PSKs on clients and selecting - * one based on the identity hint is not a planned feature, - * but feedback is welcomed. - * - * \param conf The SSL configuration to register the PSK with. - * \param psk The pointer to the pre-shared key to use. - * \param psk_len The length of the pre-shared key in bytes. - * \param psk_identity The pointer to the pre-shared key identity. - * \param psk_identity_len The length of the pre-shared key identity - * in bytes. - * - * \note The PSK and its identity are copied internally and - * hence need not be preserved by the caller for the lifetime - * of the SSL configuration. - * - * \return \c 0 if successful. - * \return An \c MBEDTLS_ERR_SSL_XXX error code on failure. - */ -int mbedtls_ssl_conf_psk( mbedtls_ssl_config *conf, - const unsigned char *psk, size_t psk_len, - const unsigned char *psk_identity, size_t psk_identity_len ); - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -/** - * \brief Configure an opaque pre-shared key (PSK) and identity - * to be used in PSK-based ciphersuites. - * - * \note This is mainly useful for clients. Servers will usually - * want to use \c mbedtls_ssl_conf_psk_cb() instead. - * - * \note An opaque PSK set by \c mbedtls_ssl_set_hs_psk_opaque() in - * the PSK callback takes precedence over an opaque PSK - * configured by this function. - * - * \warning Currently, clients can only register a single pre-shared key. - * Calling this function or mbedtls_ssl_conf_psk() more than - * once will overwrite values configured in previous calls. - * Support for setting multiple PSKs on clients and selecting - * one based on the identity hint is not a planned feature, - * but feedback is welcomed. - * - * \param conf The SSL configuration to register the PSK with. - * \param psk The identifier of the key slot holding the PSK. - * Until \p conf is destroyed or this function is successfully - * called again, the key slot \p psk must be populated with a - * key of type PSA_ALG_CATEGORY_KEY_DERIVATION whose policy - * allows its use for the key derivation algorithm applied - * in the handshake. - * \param psk_identity The pointer to the pre-shared key identity. - * \param psk_identity_len The length of the pre-shared key identity - * in bytes. - * - * \note The PSK identity hint is copied internally and hence need - * not be preserved by the caller for the lifetime of the - * SSL configuration. - * - * \return \c 0 if successful. - * \return An \c MBEDTLS_ERR_SSL_XXX error code on failure. - */ -int mbedtls_ssl_conf_psk_opaque( mbedtls_ssl_config *conf, - psa_key_handle_t psk, - const unsigned char *psk_identity, - size_t psk_identity_len ); -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -/** - * \brief Set the pre-shared Key (PSK) for the current handshake. - * - * \note This should only be called inside the PSK callback, - * i.e. the function passed to \c mbedtls_ssl_conf_psk_cb(). - * - * \note A PSK set by this function takes precedence over a PSK - * configured by \c mbedtls_ssl_conf_psk(). - * - * \param ssl The SSL context to configure a PSK for. - * \param psk The pointer to the pre-shared key. - * \param psk_len The length of the pre-shared key in bytes. - * - * \return \c 0 if successful. - * \return An \c MBEDTLS_ERR_SSL_XXX error code on failure. - */ -int mbedtls_ssl_set_hs_psk( mbedtls_ssl_context *ssl, - const unsigned char *psk, size_t psk_len ); - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -/** - * \brief Set an opaque pre-shared Key (PSK) for the current handshake. - * - * \note This should only be called inside the PSK callback, - * i.e. the function passed to \c mbedtls_ssl_conf_psk_cb(). - * - * \note An opaque PSK set by this function takes precedence over an - * opaque PSK configured by \c mbedtls_ssl_conf_psk_opaque(). - * - * \param ssl The SSL context to configure a PSK for. - * \param psk The identifier of the key slot holding the PSK. - * For the duration of the current handshake, the key slot - * must be populated with a key of type - * PSA_ALG_CATEGORY_KEY_DERIVATION whose policy allows its - * use for the key derivation algorithm - * applied in the handshake. - * - * \return \c 0 if successful. - * \return An \c MBEDTLS_ERR_SSL_XXX error code on failure. - */ -int mbedtls_ssl_set_hs_psk_opaque( mbedtls_ssl_context *ssl, - psa_key_handle_t psk ); -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -/** - * \brief Set the PSK callback (server-side only). - * - * If set, the PSK callback is called for each - * handshake where a PSK-based ciphersuite was negotiated. - * The caller provides the identity received and wants to - * receive the actual PSK data and length. - * - * The callback has the following parameters: - * - \c void*: The opaque pointer \p p_psk. - * - \c mbedtls_ssl_context*: The SSL context to which - * the operation applies. - * - \c const unsigned char*: The PSK identity - * selected by the client. - * - \c size_t: The length of the PSK identity - * selected by the client. - * - * If a valid PSK identity is found, the callback should use - * \c mbedtls_ssl_set_hs_psk() or - * \c mbedtls_ssl_set_hs_psk_opaque() - * on the SSL context to set the correct PSK and return \c 0. - * Any other return value will result in a denied PSK identity. - * - * \note A dynamic PSK (i.e. set by the PSK callback) takes - * precedence over a static PSK (i.e. set by - * \c mbedtls_ssl_conf_psk() or - * \c mbedtls_ssl_conf_psk_opaque()). - * This means that if you set a PSK callback using this - * function, you don't need to set a PSK using - * \c mbedtls_ssl_conf_psk() or - * \c mbedtls_ssl_conf_psk_opaque()). - * - * \param conf The SSL configuration to register the callback with. - * \param f_psk The callback for selecting and setting the PSK based - * in the PSK identity chosen by the client. - * \param p_psk A pointer to an opaque structure to be passed to - * the callback, for example a PSK store. - */ -void mbedtls_ssl_conf_psk_cb( mbedtls_ssl_config *conf, - int (*f_psk)(void *, mbedtls_ssl_context *, const unsigned char *, - size_t), - void *p_psk ); -#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED */ - -#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_SRV_C) - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) - -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif - -/** - * \brief Set the Diffie-Hellman public P and G values, - * read as hexadecimal strings (server-side only) - * (Default values: MBEDTLS_DHM_RFC3526_MODP_2048_[PG]) - * - * \param conf SSL configuration - * \param dhm_P Diffie-Hellman-Merkle modulus - * \param dhm_G Diffie-Hellman-Merkle generator - * - * \deprecated Superseded by \c mbedtls_ssl_conf_dh_param_bin. - * - * \return 0 if successful - */ -MBEDTLS_DEPRECATED int mbedtls_ssl_conf_dh_param( mbedtls_ssl_config *conf, - const char *dhm_P, - const char *dhm_G ); - -#endif /* MBEDTLS_DEPRECATED_REMOVED */ - -/** - * \brief Set the Diffie-Hellman public P and G values - * from big-endian binary presentations. - * (Default values: MBEDTLS_DHM_RFC3526_MODP_2048_[PG]_BIN) - * - * \param conf SSL configuration - * \param dhm_P Diffie-Hellman-Merkle modulus in big-endian binary form - * \param P_len Length of DHM modulus - * \param dhm_G Diffie-Hellman-Merkle generator in big-endian binary form - * \param G_len Length of DHM generator - * - * \return 0 if successful - */ -int mbedtls_ssl_conf_dh_param_bin( mbedtls_ssl_config *conf, - const unsigned char *dhm_P, size_t P_len, - const unsigned char *dhm_G, size_t G_len ); - -/** - * \brief Set the Diffie-Hellman public P and G values, - * read from existing context (server-side only) - * - * \param conf SSL configuration - * \param dhm_ctx Diffie-Hellman-Merkle context - * - * \return 0 if successful - */ -int mbedtls_ssl_conf_dh_param_ctx( mbedtls_ssl_config *conf, mbedtls_dhm_context *dhm_ctx ); -#endif /* MBEDTLS_DHM_C && defined(MBEDTLS_SSL_SRV_C) */ - -#if defined(MBEDTLS_DHM_C) && defined(MBEDTLS_SSL_CLI_C) -/** - * \brief Set the minimum length for Diffie-Hellman parameters. - * (Client-side only.) - * (Default: 1024 bits.) - * - * \param conf SSL configuration - * \param bitlen Minimum bit length of the DHM prime - */ -void mbedtls_ssl_conf_dhm_min_bitlen( mbedtls_ssl_config *conf, - unsigned int bitlen ); -#endif /* MBEDTLS_DHM_C && MBEDTLS_SSL_CLI_C */ - -#if defined(MBEDTLS_ECP_C) -/** - * \brief Set the allowed curves in order of preference. - * (Default: all defined curves.) - * - * On server: this only affects selection of the ECDHE curve; - * the curves used for ECDH and ECDSA are determined by the - * list of available certificates instead. - * - * On client: this affects the list of curves offered for any - * use. The server can override our preference order. - * - * Both sides: limits the set of curves accepted for use in - * ECDHE and in the peer's end-entity certificate. - * - * \note This has no influence on which curves are allowed inside the - * certificate chains, see \c mbedtls_ssl_conf_cert_profile() - * for that. For the end-entity certificate however, the key - * will be accepted only if it is allowed both by this list - * and by the cert profile. - * - * \note This list should be ordered by decreasing preference - * (preferred curve first). - * - * \param conf SSL configuration - * \param curves Ordered list of allowed curves, - * terminated by MBEDTLS_ECP_DP_NONE. - */ -void mbedtls_ssl_conf_curves( mbedtls_ssl_config *conf, - const mbedtls_ecp_group_id *curves ); -#endif /* MBEDTLS_ECP_C */ - -#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) -/** - * \brief Set the allowed hashes for signatures during the handshake. - * (Default: all available hashes except MD5.) - * - * \note This only affects which hashes are offered and can be used - * for signatures during the handshake. Hashes for message - * authentication and the TLS PRF are controlled by the - * ciphersuite, see \c mbedtls_ssl_conf_ciphersuites(). Hashes - * used for certificate signature are controlled by the - * verification profile, see \c mbedtls_ssl_conf_cert_profile(). - * - * \note This list should be ordered by decreasing preference - * (preferred hash first). - * - * \param conf SSL configuration - * \param hashes Ordered list of allowed signature hashes, - * terminated by \c MBEDTLS_MD_NONE. - */ -void mbedtls_ssl_conf_sig_hashes( mbedtls_ssl_config *conf, - const int *hashes ); -#endif /* MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED */ - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Set or reset the hostname to check against the received - * server certificate. It sets the ServerName TLS extension, - * too, if that extension is enabled. (client-side only) - * - * \param ssl SSL context - * \param hostname the server hostname, may be NULL to clear hostname - - * \note Maximum hostname length MBEDTLS_SSL_MAX_HOST_NAME_LEN. - * - * \return 0 if successful, MBEDTLS_ERR_SSL_ALLOC_FAILED on - * allocation failure, MBEDTLS_ERR_SSL_BAD_INPUT_DATA on - * too long input hostname. - * - * Hostname set to the one provided on success (cleared - * when NULL). On allocation failure hostname is cleared. - * On too long input failure, old hostname is unchanged. - */ -int mbedtls_ssl_set_hostname( mbedtls_ssl_context *ssl, const char *hostname ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) -/** - * \brief Set own certificate and key for the current handshake - * - * \note Same as \c mbedtls_ssl_conf_own_cert() but for use within - * the SNI callback. - * - * \param ssl SSL context - * \param own_cert own public certificate chain - * \param pk_key own private key - * - * \return 0 on success or MBEDTLS_ERR_SSL_ALLOC_FAILED - */ -int mbedtls_ssl_set_hs_own_cert( mbedtls_ssl_context *ssl, - mbedtls_x509_crt *own_cert, - mbedtls_pk_context *pk_key ); - -/** - * \brief Set the data required to verify peer certificate for the - * current handshake - * - * \note Same as \c mbedtls_ssl_conf_ca_chain() but for use within - * the SNI callback. - * - * \param ssl SSL context - * \param ca_chain trusted CA chain (meaning all fully trusted top-level CAs) - * \param ca_crl trusted CA CRLs - */ -void mbedtls_ssl_set_hs_ca_chain( mbedtls_ssl_context *ssl, - mbedtls_x509_crt *ca_chain, - mbedtls_x509_crl *ca_crl ); - -/** - * \brief Set authmode for the current handshake. - * - * \note Same as \c mbedtls_ssl_conf_authmode() but for use within - * the SNI callback. - * - * \param ssl SSL context - * \param authmode MBEDTLS_SSL_VERIFY_NONE, MBEDTLS_SSL_VERIFY_OPTIONAL or - * MBEDTLS_SSL_VERIFY_REQUIRED - */ -void mbedtls_ssl_set_hs_authmode( mbedtls_ssl_context *ssl, - int authmode ); - -/** - * \brief Set server side ServerName TLS extension callback - * (optional, server-side only). - * - * If set, the ServerName callback is called whenever the - * server receives a ServerName TLS extension from the client - * during a handshake. The ServerName callback has the - * following parameters: (void *parameter, mbedtls_ssl_context *ssl, - * const unsigned char *hostname, size_t len). If a suitable - * certificate is found, the callback must set the - * certificate(s) and key(s) to use with \c - * mbedtls_ssl_set_hs_own_cert() (can be called repeatedly), - * and may optionally adjust the CA and associated CRL with \c - * mbedtls_ssl_set_hs_ca_chain() as well as the client - * authentication mode with \c mbedtls_ssl_set_hs_authmode(), - * then must return 0. If no matching name is found, the - * callback must either set a default cert, or - * return non-zero to abort the handshake at this point. - * - * \param conf SSL configuration - * \param f_sni verification function - * \param p_sni verification parameter - */ -void mbedtls_ssl_conf_sni( mbedtls_ssl_config *conf, - int (*f_sni)(void *, mbedtls_ssl_context *, const unsigned char *, - size_t), - void *p_sni ); -#endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */ - -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) -/** - * \brief Set the EC J-PAKE password for current handshake. - * - * \note An internal copy is made, and destroyed as soon as the - * handshake is completed, or when the SSL context is reset or - * freed. - * - * \note The SSL context needs to be already set up. The right place - * to call this function is between \c mbedtls_ssl_setup() or - * \c mbedtls_ssl_reset() and \c mbedtls_ssl_handshake(). - * - * \param ssl SSL context - * \param pw EC J-PAKE password (pre-shared secret) - * \param pw_len length of pw in bytes - * - * \return 0 on success, or a negative error code. - */ -int mbedtls_ssl_set_hs_ecjpake_password( mbedtls_ssl_context *ssl, - const unsigned char *pw, - size_t pw_len ); -#endif /*MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */ - -#if defined(MBEDTLS_SSL_ALPN) -/** - * \brief Set the supported Application Layer Protocols. - * - * \param conf SSL configuration - * \param protos Pointer to a NULL-terminated list of supported protocols, - * in decreasing preference order. The pointer to the list is - * recorded by the library for later reference as required, so - * the lifetime of the table must be atleast as long as the - * lifetime of the SSL configuration structure. - * - * \return 0 on success, or MBEDTLS_ERR_SSL_BAD_INPUT_DATA. - */ -int mbedtls_ssl_conf_alpn_protocols( mbedtls_ssl_config *conf, const char **protos ); - -/** - * \brief Get the name of the negotiated Application Layer Protocol. - * This function should be called after the handshake is - * completed. - * - * \param ssl SSL context - * - * \return Protcol name, or NULL if no protocol was negotiated. - */ -const char *mbedtls_ssl_get_alpn_protocol( const mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_SSL_ALPN */ - -/** - * \brief Set the maximum supported version sent from the client side - * and/or accepted at the server side - * (Default: MBEDTLS_SSL_MAX_MAJOR_VERSION, MBEDTLS_SSL_MAX_MINOR_VERSION) - * - * \note This ignores ciphersuites from higher versions. - * - * \note With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0 and - * MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2 - * - * \param conf SSL configuration - * \param major Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3 supported) - * \param minor Minor version number (MBEDTLS_SSL_MINOR_VERSION_0, - * MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2, - * MBEDTLS_SSL_MINOR_VERSION_3 supported) - */ -void mbedtls_ssl_conf_max_version( mbedtls_ssl_config *conf, int major, int minor ); - -/** - * \brief Set the minimum accepted SSL/TLS protocol version - * (Default: TLS 1.0) - * - * \note Input outside of the SSL_MAX_XXXXX_VERSION and - * SSL_MIN_XXXXX_VERSION range is ignored. - * - * \note MBEDTLS_SSL_MINOR_VERSION_0 (SSL v3) should be avoided. - * - * \note With DTLS, use MBEDTLS_SSL_MINOR_VERSION_2 for DTLS 1.0 and - * MBEDTLS_SSL_MINOR_VERSION_3 for DTLS 1.2 - * - * \param conf SSL configuration - * \param major Major version number (only MBEDTLS_SSL_MAJOR_VERSION_3 supported) - * \param minor Minor version number (MBEDTLS_SSL_MINOR_VERSION_0, - * MBEDTLS_SSL_MINOR_VERSION_1 and MBEDTLS_SSL_MINOR_VERSION_2, - * MBEDTLS_SSL_MINOR_VERSION_3 supported) - */ -void mbedtls_ssl_conf_min_version( mbedtls_ssl_config *conf, int major, int minor ); - -#if defined(MBEDTLS_SSL_FALLBACK_SCSV) && defined(MBEDTLS_SSL_CLI_C) -/** - * \brief Set the fallback flag (client-side only). - * (Default: MBEDTLS_SSL_IS_NOT_FALLBACK). - * - * \note Set to MBEDTLS_SSL_IS_FALLBACK when preparing a fallback - * connection, that is a connection with max_version set to a - * lower value than the value you're willing to use. Such - * fallback connections are not recommended but are sometimes - * necessary to interoperate with buggy (version-intolerant) - * servers. - * - * \warning You should NOT set this to MBEDTLS_SSL_IS_FALLBACK for - * non-fallback connections! This would appear to work for a - * while, then cause failures when the server is upgraded to - * support a newer TLS version. - * - * \param conf SSL configuration - * \param fallback MBEDTLS_SSL_IS_NOT_FALLBACK or MBEDTLS_SSL_IS_FALLBACK - */ -void mbedtls_ssl_conf_fallback( mbedtls_ssl_config *conf, char fallback ); -#endif /* MBEDTLS_SSL_FALLBACK_SCSV && MBEDTLS_SSL_CLI_C */ - -#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) -/** - * \brief Enable or disable Encrypt-then-MAC - * (Default: MBEDTLS_SSL_ETM_ENABLED) - * - * \note This should always be enabled, it is a security - * improvement, and should not cause any interoperability - * issue (used only if the peer supports it too). - * - * \param conf SSL configuration - * \param etm MBEDTLS_SSL_ETM_ENABLED or MBEDTLS_SSL_ETM_DISABLED - */ -void mbedtls_ssl_conf_encrypt_then_mac( mbedtls_ssl_config *conf, char etm ); -#endif /* MBEDTLS_SSL_ENCRYPT_THEN_MAC */ - -#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) -/** - * \brief Enable or disable Extended Master Secret negotiation. - * (Default: MBEDTLS_SSL_EXTENDED_MS_ENABLED) - * - * \note This should always be enabled, it is a security fix to the - * protocol, and should not cause any interoperability issue - * (used only if the peer supports it too). - * - * \param conf SSL configuration - * \param ems MBEDTLS_SSL_EXTENDED_MS_ENABLED or MBEDTLS_SSL_EXTENDED_MS_DISABLED - */ -void mbedtls_ssl_conf_extended_master_secret( mbedtls_ssl_config *conf, char ems ); -#endif /* MBEDTLS_SSL_EXTENDED_MASTER_SECRET */ - -#if defined(MBEDTLS_ARC4_C) -/** - * \brief Disable or enable support for RC4 - * (Default: MBEDTLS_SSL_ARC4_DISABLED) - * - * \warning Use of RC4 in DTLS/TLS has been prohibited by RFC 7465 - * for security reasons. Use at your own risk. - * - * \note This function is deprecated and will be removed in - * a future version of the library. - * RC4 is disabled by default at compile time and needs to be - * actively enabled for use with legacy systems. - * - * \param conf SSL configuration - * \param arc4 MBEDTLS_SSL_ARC4_ENABLED or MBEDTLS_SSL_ARC4_DISABLED - */ -void mbedtls_ssl_conf_arc4_support( mbedtls_ssl_config *conf, char arc4 ); -#endif /* MBEDTLS_ARC4_C */ - -#if defined(MBEDTLS_SSL_SRV_C) -/** - * \brief Whether to send a list of acceptable CAs in - * CertificateRequest messages. - * (Default: do send) - * - * \param conf SSL configuration - * \param cert_req_ca_list MBEDTLS_SSL_CERT_REQ_CA_LIST_ENABLED or - * MBEDTLS_SSL_CERT_REQ_CA_LIST_DISABLED - */ -void mbedtls_ssl_conf_cert_req_ca_list( mbedtls_ssl_config *conf, - char cert_req_ca_list ); -#endif /* MBEDTLS_SSL_SRV_C */ - -#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) -/** - * \brief Set the maximum fragment length to emit and/or negotiate. - * (Typical: the smaller of #MBEDTLS_SSL_IN_CONTENT_LEN and - * #MBEDTLS_SSL_OUT_CONTENT_LEN, usually `2^14` bytes) - * (Server: set maximum fragment length to emit, - * usually negotiated by the client during handshake) - * (Client: set maximum fragment length to emit *and* - * negotiate with the server during handshake) - * (Default: #MBEDTLS_SSL_MAX_FRAG_LEN_NONE) - * - * \note On the client side, the maximum fragment length extension - * *will not* be used, unless the maximum fragment length has - * been set via this function to a value different than - * #MBEDTLS_SSL_MAX_FRAG_LEN_NONE. - * - * \note With TLS, this currently only affects ApplicationData (sent - * with \c mbedtls_ssl_read()), not handshake messages. - * With DTLS, this affects both ApplicationData and handshake. - * - * \note This sets the maximum length for a record's payload, - * excluding record overhead that will be added to it, see - * \c mbedtls_ssl_get_record_expansion(). - * - * \note For DTLS, it is also possible to set a limit for the total - * size of daragrams passed to the transport layer, including - * record overhead, see \c mbedtls_ssl_set_mtu(). - * - * \param conf SSL configuration - * \param mfl_code Code for maximum fragment length (allowed values: - * MBEDTLS_SSL_MAX_FRAG_LEN_512, MBEDTLS_SSL_MAX_FRAG_LEN_1024, - * MBEDTLS_SSL_MAX_FRAG_LEN_2048, MBEDTLS_SSL_MAX_FRAG_LEN_4096) - * - * \return 0 if successful or MBEDTLS_ERR_SSL_BAD_INPUT_DATA - */ -int mbedtls_ssl_conf_max_frag_len( mbedtls_ssl_config *conf, unsigned char mfl_code ); -#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */ - -#if defined(MBEDTLS_SSL_TRUNCATED_HMAC) -/** - * \brief Activate negotiation of truncated HMAC - * (Default: MBEDTLS_SSL_TRUNC_HMAC_DISABLED) - * - * \param conf SSL configuration - * \param truncate Enable or disable (MBEDTLS_SSL_TRUNC_HMAC_ENABLED or - * MBEDTLS_SSL_TRUNC_HMAC_DISABLED) - */ -void mbedtls_ssl_conf_truncated_hmac( mbedtls_ssl_config *conf, int truncate ); -#endif /* MBEDTLS_SSL_TRUNCATED_HMAC */ - -#if defined(MBEDTLS_SSL_CBC_RECORD_SPLITTING) -/** - * \brief Enable / Disable 1/n-1 record splitting - * (Default: MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED) - * - * \note Only affects SSLv3 and TLS 1.0, not higher versions. - * Does not affect non-CBC ciphersuites in any version. - * - * \param conf SSL configuration - * \param split MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED or - * MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED - */ -void mbedtls_ssl_conf_cbc_record_splitting( mbedtls_ssl_config *conf, char split ); -#endif /* MBEDTLS_SSL_CBC_RECORD_SPLITTING */ - -#if defined(MBEDTLS_SSL_SESSION_TICKETS) && defined(MBEDTLS_SSL_CLI_C) -/** - * \brief Enable / Disable session tickets (client only). - * (Default: MBEDTLS_SSL_SESSION_TICKETS_ENABLED.) - * - * \note On server, use \c mbedtls_ssl_conf_session_tickets_cb(). - * - * \param conf SSL configuration - * \param use_tickets Enable or disable (MBEDTLS_SSL_SESSION_TICKETS_ENABLED or - * MBEDTLS_SSL_SESSION_TICKETS_DISABLED) - */ -void mbedtls_ssl_conf_session_tickets( mbedtls_ssl_config *conf, int use_tickets ); -#endif /* MBEDTLS_SSL_SESSION_TICKETS && MBEDTLS_SSL_CLI_C */ - -#if defined(MBEDTLS_SSL_RENEGOTIATION) -/** - * \brief Enable / Disable renegotiation support for connection when - * initiated by peer - * (Default: MBEDTLS_SSL_RENEGOTIATION_DISABLED) - * - * \warning It is recommended to always disable renegotation unless you - * know you need it and you know what you're doing. In the - * past, there have been several issues associated with - * renegotiation or a poor understanding of its properties. - * - * \note Server-side, enabling renegotiation also makes the server - * susceptible to a resource DoS by a malicious client. - * - * \param conf SSL configuration - * \param renegotiation Enable or disable (MBEDTLS_SSL_RENEGOTIATION_ENABLED or - * MBEDTLS_SSL_RENEGOTIATION_DISABLED) - */ -void mbedtls_ssl_conf_renegotiation( mbedtls_ssl_config *conf, int renegotiation ); -#endif /* MBEDTLS_SSL_RENEGOTIATION */ - -/** - * \brief Prevent or allow legacy renegotiation. - * (Default: MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION) - * - * MBEDTLS_SSL_LEGACY_NO_RENEGOTIATION allows connections to - * be established even if the peer does not support - * secure renegotiation, but does not allow renegotiation - * to take place if not secure. - * (Interoperable and secure option) - * - * MBEDTLS_SSL_LEGACY_ALLOW_RENEGOTIATION allows renegotiations - * with non-upgraded peers. Allowing legacy renegotiation - * makes the connection vulnerable to specific man in the - * middle attacks. (See RFC 5746) - * (Most interoperable and least secure option) - * - * MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE breaks off connections - * if peer does not support secure renegotiation. Results - * in interoperability issues with non-upgraded peers - * that do not support renegotiation altogether. - * (Most secure option, interoperability issues) - * - * \param conf SSL configuration - * \param allow_legacy Prevent or allow (SSL_NO_LEGACY_RENEGOTIATION, - * SSL_ALLOW_LEGACY_RENEGOTIATION or - * MBEDTLS_SSL_LEGACY_BREAK_HANDSHAKE) - */ -void mbedtls_ssl_conf_legacy_renegotiation( mbedtls_ssl_config *conf, int allow_legacy ); - -#if defined(MBEDTLS_SSL_RENEGOTIATION) -/** - * \brief Enforce renegotiation requests. - * (Default: enforced, max_records = 16) - * - * When we request a renegotiation, the peer can comply or - * ignore the request. This function allows us to decide - * whether to enforce our renegotiation requests by closing - * the connection if the peer doesn't comply. - * - * However, records could already be in transit from the peer - * when the request is emitted. In order to increase - * reliability, we can accept a number of records before the - * expected handshake records. - * - * The optimal value is highly dependent on the specific usage - * scenario. - * - * \note With DTLS and server-initiated renegotiation, the - * HelloRequest is retransmited every time mbedtls_ssl_read() times - * out or receives Application Data, until: - * - max_records records have beens seen, if it is >= 0, or - * - the number of retransmits that would happen during an - * actual handshake has been reached. - * Please remember the request might be lost a few times - * if you consider setting max_records to a really low value. - * - * \warning On client, the grace period can only happen during - * mbedtls_ssl_read(), as opposed to mbedtls_ssl_write() and mbedtls_ssl_renegotiate() - * which always behave as if max_record was 0. The reason is, - * if we receive application data from the server, we need a - * place to write it, which only happens during mbedtls_ssl_read(). - * - * \param conf SSL configuration - * \param max_records Use MBEDTLS_SSL_RENEGOTIATION_NOT_ENFORCED if you don't want to - * enforce renegotiation, or a non-negative value to enforce - * it but allow for a grace period of max_records records. - */ -void mbedtls_ssl_conf_renegotiation_enforced( mbedtls_ssl_config *conf, int max_records ); - -/** - * \brief Set record counter threshold for periodic renegotiation. - * (Default: 2^48 - 1) - * - * Renegotiation is automatically triggered when a record - * counter (outgoing or incoming) crosses the defined - * threshold. The default value is meant to prevent the - * connection from being closed when the counter is about to - * reached its maximal value (it is not allowed to wrap). - * - * Lower values can be used to enforce policies such as "keys - * must be refreshed every N packets with cipher X". - * - * The renegotiation period can be disabled by setting - * conf->disable_renegotiation to - * MBEDTLS_SSL_RENEGOTIATION_DISABLED. - * - * \note When the configured transport is - * MBEDTLS_SSL_TRANSPORT_DATAGRAM the maximum renegotiation - * period is 2^48 - 1, and for MBEDTLS_SSL_TRANSPORT_STREAM, - * the maximum renegotiation period is 2^64 - 1. - * - * \param conf SSL configuration - * \param period The threshold value: a big-endian 64-bit number. - */ -void mbedtls_ssl_conf_renegotiation_period( mbedtls_ssl_config *conf, - const unsigned char period[8] ); -#endif /* MBEDTLS_SSL_RENEGOTIATION */ - -/** - * \brief Check if there is data already read from the - * underlying transport but not yet processed. - * - * \param ssl SSL context - * - * \return 0 if nothing's pending, 1 otherwise. - * - * \note This is different in purpose and behaviour from - * \c mbedtls_ssl_get_bytes_avail in that it considers - * any kind of unprocessed data, not only unread - * application data. If \c mbedtls_ssl_get_bytes - * returns a non-zero value, this function will - * also signal pending data, but the converse does - * not hold. For example, in DTLS there might be - * further records waiting to be processed from - * the current underlying transport's datagram. - * - * \note If this function returns 1 (data pending), this - * does not imply that a subsequent call to - * \c mbedtls_ssl_read will provide any data; - * e.g., the unprocessed data might turn out - * to be an alert or a handshake message. - * - * \note This function is useful in the following situation: - * If the SSL/TLS module successfully returns from an - * operation - e.g. a handshake or an application record - * read - and you're awaiting incoming data next, you - * must not immediately idle on the underlying transport - * to have data ready, but you need to check the value - * of this function first. The reason is that the desired - * data might already be read but not yet processed. - * If, in contrast, a previous call to the SSL/TLS module - * returned MBEDTLS_ERR_SSL_WANT_READ, it is not necessary - * to call this function, as the latter error code entails - * that all internal data has been processed. - * - */ -int mbedtls_ssl_check_pending( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the number of application data bytes - * remaining to be read from the current record. - * - * \param ssl SSL context - * - * \return How many bytes are available in the application - * data record read buffer. - * - * \note When working over a datagram transport, this is - * useful to detect the current datagram's boundary - * in case \c mbedtls_ssl_read has written the maximal - * amount of data fitting into the input buffer. - * - */ -size_t mbedtls_ssl_get_bytes_avail( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the result of the certificate verification - * - * \param ssl The SSL context to use. - * - * \return \c 0 if the certificate verification was successful. - * \return \c -1u if the result is not available. This may happen - * e.g. if the handshake aborts early, or a verification - * callback returned a fatal error. - * \return A bitwise combination of \c MBEDTLS_X509_BADCERT_XXX - * and \c MBEDTLS_X509_BADCRL_XXX failure flags; see x509.h. - */ -uint32_t mbedtls_ssl_get_verify_result( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the name of the current ciphersuite - * - * \param ssl SSL context - * - * \return a string containing the ciphersuite name - */ -const char *mbedtls_ssl_get_ciphersuite( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the current SSL version (SSLv3/TLSv1/etc) - * - * \param ssl SSL context - * - * \return a string containing the SSL version - */ -const char *mbedtls_ssl_get_version( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the (maximum) number of bytes added by the record - * layer: header + encryption/MAC overhead (inc. padding) - * - * \note This function is not available (always returns an error) - * when record compression is enabled. - * - * \param ssl SSL context - * - * \return Current maximum record expansion in bytes, or - * MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE if compression is - * enabled, which makes expansion much less predictable - */ -int mbedtls_ssl_get_record_expansion( const mbedtls_ssl_context *ssl ); - -#if defined(MBEDTLS_SSL_MAX_FRAGMENT_LENGTH) -/** - * \brief Return the maximum fragment length (payload, in bytes) for - * the output buffer. For the client, this is the configured - * value. For the server, it is the minimum of two - the - * configured value and the negotiated one. - * - * \sa mbedtls_ssl_conf_max_frag_len() - * \sa mbedtls_ssl_get_max_record_payload() - * - * \param ssl SSL context - * - * \return Current maximum fragment length for the output buffer. - */ -size_t mbedtls_ssl_get_output_max_frag_len( const mbedtls_ssl_context *ssl ); - -/** - * \brief Return the maximum fragment length (payload, in bytes) for - * the input buffer. This is the negotiated maximum fragment - * length, or, if there is none, MBEDTLS_SSL_MAX_CONTENT_LEN. - * If it is not defined either, the value is 2^14. This function - * works as its predecessor, \c mbedtls_ssl_get_max_frag_len(). - * - * \sa mbedtls_ssl_conf_max_frag_len() - * \sa mbedtls_ssl_get_max_record_payload() - * - * \param ssl SSL context - * - * \return Current maximum fragment length for the output buffer. - */ -size_t mbedtls_ssl_get_input_max_frag_len( const mbedtls_ssl_context *ssl ); - -#if !defined(MBEDTLS_DEPRECATED_REMOVED) - -#if defined(MBEDTLS_DEPRECATED_WARNING) -#define MBEDTLS_DEPRECATED __attribute__((deprecated)) -#else -#define MBEDTLS_DEPRECATED -#endif - -/** - * \brief This function is a deprecated approach to getting the max - * fragment length. Its an alias for - * \c mbedtls_ssl_get_output_max_frag_len(), as the behaviour - * is the same. See \c mbedtls_ssl_get_output_max_frag_len() for - * more detail. - * - * \sa mbedtls_ssl_get_input_max_frag_len() - * \sa mbedtls_ssl_get_output_max_frag_len() - * - * \param ssl SSL context - * - * \return Current maximum fragment length for the output buffer. - */ -MBEDTLS_DEPRECATED size_t mbedtls_ssl_get_max_frag_len( - const mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_DEPRECATED_REMOVED */ -#endif /* MBEDTLS_SSL_MAX_FRAGMENT_LENGTH */ - -/** - * \brief Return the current maximum outgoing record payload in bytes. - * This takes into account the config.h setting \c - * MBEDTLS_SSL_OUT_CONTENT_LEN, the configured and negotiated - * max fragment length extension if used, and for DTLS the - * path MTU as configured and current record expansion. - * - * \note With DTLS, \c mbedtls_ssl_write() will return an error if - * called with a larger length value. - * With TLS, \c mbedtls_ssl_write() will fragment the input if - * necessary and return the number of bytes written; it is up - * to the caller to call \c mbedtls_ssl_write() again in - * order to send the remaining bytes if any. - * - * \note This function is not available (always returns an error) - * when record compression is enabled. - * - * \sa mbedtls_ssl_set_mtu() - * \sa mbedtls_ssl_get_output_max_frag_len() - * \sa mbedtls_ssl_get_input_max_frag_len() - * \sa mbedtls_ssl_get_record_expansion() - * - * \param ssl SSL context - * - * \return Current maximum payload for an outgoing record, - * or a negative error code. - */ -int mbedtls_ssl_get_max_out_record_payload( const mbedtls_ssl_context *ssl ); - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * \brief Return the peer certificate from the current connection. - * - * \param ssl The SSL context to use. This must be initialized and setup. - * - * \return The current peer certificate, if available. - * The returned certificate is owned by the SSL context and - * is valid only until the next call to the SSL API. - * \return \c NULL if no peer certificate is available. This might - * be because the chosen ciphersuite doesn't use CRTs - * (PSK-based ciphersuites, for example), or because - * #MBEDTLS_SSL_KEEP_PEER_CERTIFICATE has been disabled, - * allowing the stack to free the peer's CRT to save memory. - * - * \note For one-time inspection of the peer's certificate during - * the handshake, consider registering an X.509 CRT verification - * callback through mbedtls_ssl_conf_verify() instead of calling - * this function. Using mbedtls_ssl_conf_verify() also comes at - * the benefit of allowing you to influence the verification - * process, for example by masking expected and tolerated - * verification failures. - * - * \warning You must not use the pointer returned by this function - * after any further call to the SSL API, including - * mbedtls_ssl_read() and mbedtls_ssl_write(); this is - * because the pointer might change during renegotiation, - * which happens transparently to the user. - * If you want to use the certificate across API calls, - * you must make a copy. - */ -const mbedtls_x509_crt *mbedtls_ssl_get_peer_cert( const mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_CLI_C) -/** - * \brief Save session in order to resume it later (client-side only) - * Session data is copied to presented session structure. - * - * - * \param ssl SSL context - * \param session session context - * - * \return 0 if successful, - * MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed, - * MBEDTLS_ERR_SSL_BAD_INPUT_DATA if used server-side or - * arguments are otherwise invalid. - * - * \note Only the server certificate is copied, and not the full chain, - * so you should not attempt to validate the certificate again - * by calling \c mbedtls_x509_crt_verify() on it. - * Instead, you should use the results from the verification - * in the original handshake by calling \c mbedtls_ssl_get_verify_result() - * after loading the session again into a new SSL context - * using \c mbedtls_ssl_set_session(). - * - * \note Once the session object is not needed anymore, you should - * free it by calling \c mbedtls_ssl_session_free(). - * - * \sa mbedtls_ssl_set_session() - */ -int mbedtls_ssl_get_session( const mbedtls_ssl_context *ssl, mbedtls_ssl_session *session ); -#endif /* MBEDTLS_SSL_CLI_C */ - -/** - * \brief Perform the SSL handshake - * - * \param ssl SSL context - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_SSL_WANT_READ or #MBEDTLS_ERR_SSL_WANT_WRITE - * if the handshake is incomplete and waiting for data to - * be available for reading from or writing to the underlying - * transport - in this case you must call this function again - * when the underlying transport is ready for the operation. - * \return #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if an asynchronous - * operation is in progress (see - * mbedtls_ssl_conf_async_private_cb()) - in this case you - * must call this function again when the operation is ready. - * \return #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS if a cryptographic - * operation is in progress (see mbedtls_ecp_set_max_ops()) - - * in this case you must call this function again to complete - * the handshake when you're done attending other tasks. - * \return #MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED if DTLS is in use - * and the client did not demonstrate reachability yet - in - * this case you must stop using the context (see below). - * \return Another SSL error code - in this case you must stop using - * the context (see below). - * - * \warning If this function returns something other than - * \c 0, - * #MBEDTLS_ERR_SSL_WANT_READ, - * #MBEDTLS_ERR_SSL_WANT_WRITE, - * #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS or - * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS, - * you must stop using the SSL context for reading or writing, - * and either free it or call \c mbedtls_ssl_session_reset() - * on it before re-using it for a new connection; the current - * connection must be closed. - * - * \note If DTLS is in use, then you may choose to handle - * #MBEDTLS_ERR_SSL_HELLO_VERIFY_REQUIRED specially for logging - * purposes, as it is an expected return value rather than an - * actual error, but you still need to reset/free the context. - * - * \note Remarks regarding event-driven DTLS: - * If the function returns #MBEDTLS_ERR_SSL_WANT_READ, no datagram - * from the underlying transport layer is currently being processed, - * and it is safe to idle until the timer or the underlying transport - * signal a new event. This is not true for a successful handshake, - * in which case the datagram of the underlying transport that is - * currently being processed might or might not contain further - * DTLS records. - */ -int mbedtls_ssl_handshake( mbedtls_ssl_context *ssl ); - -/** - * \brief Perform a single step of the SSL handshake - * - * \note The state of the context (ssl->state) will be at - * the next state after this function returns \c 0. Do not - * call this function if state is MBEDTLS_SSL_HANDSHAKE_OVER. - * - * \param ssl SSL context - * - * \return See mbedtls_ssl_handshake(). - * - * \warning If this function returns something other than \c 0, - * #MBEDTLS_ERR_SSL_WANT_READ, #MBEDTLS_ERR_SSL_WANT_WRITE, - * #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS or - * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS, you must stop using - * the SSL context for reading or writing, and either free it - * or call \c mbedtls_ssl_session_reset() on it before - * re-using it for a new connection; the current connection - * must be closed. - */ -int mbedtls_ssl_handshake_step( mbedtls_ssl_context *ssl ); - -#if defined(MBEDTLS_SSL_RENEGOTIATION) -/** - * \brief Initiate an SSL renegotiation on the running connection. - * Client: perform the renegotiation right now. - * Server: request renegotiation, which will be performed - * during the next call to mbedtls_ssl_read() if honored by - * client. - * - * \param ssl SSL context - * - * \return 0 if successful, or any mbedtls_ssl_handshake() return - * value except #MBEDTLS_ERR_SSL_CLIENT_RECONNECT that can't - * happen during a renegotiation. - * - * \warning If this function returns something other than \c 0, - * #MBEDTLS_ERR_SSL_WANT_READ, #MBEDTLS_ERR_SSL_WANT_WRITE, - * #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS or - * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS, you must stop using - * the SSL context for reading or writing, and either free it - * or call \c mbedtls_ssl_session_reset() on it before - * re-using it for a new connection; the current connection - * must be closed. - * - */ -int mbedtls_ssl_renegotiate( mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_SSL_RENEGOTIATION */ - -/** - * \brief Read at most 'len' application data bytes - * - * \param ssl SSL context - * \param buf buffer that will hold the data - * \param len maximum number of bytes to read - * - * \return The (positive) number of bytes read if successful. - * \return \c 0 if the read end of the underlying transport was closed - * without sending a CloseNotify beforehand, which might happen - * because of various reasons (internal error of an underlying - * stack, non-conformant peer not sending a CloseNotify and - * such) - in this case you must stop using the context - * (see below). - * \return #MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY if the underlying - * transport is still functional, but the peer has - * acknowledged to not send anything anymore. - * \return #MBEDTLS_ERR_SSL_WANT_READ or #MBEDTLS_ERR_SSL_WANT_WRITE - * if the handshake is incomplete and waiting for data to - * be available for reading from or writing to the underlying - * transport - in this case you must call this function again - * when the underlying transport is ready for the operation. - * \return #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if an asynchronous - * operation is in progress (see - * mbedtls_ssl_conf_async_private_cb()) - in this case you - * must call this function again when the operation is ready. - * \return #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS if a cryptographic - * operation is in progress (see mbedtls_ecp_set_max_ops()) - - * in this case you must call this function again to complete - * the handshake when you're done attending other tasks. - * \return #MBEDTLS_ERR_SSL_CLIENT_RECONNECT if we're at the server - * side of a DTLS connection and the client is initiating a - * new connection using the same source port. See below. - * \return Another SSL error code - in this case you must stop using - * the context (see below). - * - * \warning If this function returns something other than - * a positive value, - * #MBEDTLS_ERR_SSL_WANT_READ, - * #MBEDTLS_ERR_SSL_WANT_WRITE, - * #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS, - * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS or - * #MBEDTLS_ERR_SSL_CLIENT_RECONNECT, - * you must stop using the SSL context for reading or writing, - * and either free it or call \c mbedtls_ssl_session_reset() - * on it before re-using it for a new connection; the current - * connection must be closed. - * - * \note When this function returns #MBEDTLS_ERR_SSL_CLIENT_RECONNECT - * (which can only happen server-side), it means that a client - * is initiating a new connection using the same source port. - * You can either treat that as a connection close and wait - * for the client to resend a ClientHello, or directly - * continue with \c mbedtls_ssl_handshake() with the same - * context (as it has been reset internally). Either way, you - * must make sure this is seen by the application as a new - * connection: application state, if any, should be reset, and - * most importantly the identity of the client must be checked - * again. WARNING: not validating the identity of the client - * again, or not transmitting the new identity to the - * application layer, would allow authentication bypass! - * - * \note Remarks regarding event-driven DTLS: - * - If the function returns #MBEDTLS_ERR_SSL_WANT_READ, no datagram - * from the underlying transport layer is currently being processed, - * and it is safe to idle until the timer or the underlying transport - * signal a new event. - * - This function may return MBEDTLS_ERR_SSL_WANT_READ even if data was - * initially available on the underlying transport, as this data may have - * been only e.g. duplicated messages or a renegotiation request. - * Therefore, you must be prepared to receive MBEDTLS_ERR_SSL_WANT_READ even - * when reacting to an incoming-data event from the underlying transport. - * - On success, the datagram of the underlying transport that is currently - * being processed may contain further DTLS records. You should call - * \c mbedtls_ssl_check_pending to check for remaining records. - * - */ -int mbedtls_ssl_read( mbedtls_ssl_context *ssl, unsigned char *buf, size_t len ); - -/** - * \brief Try to write exactly 'len' application data bytes - * - * \warning This function will do partial writes in some cases. If the - * return value is non-negative but less than length, the - * function must be called again with updated arguments: - * buf + ret, len - ret (if ret is the return value) until - * it returns a value equal to the last 'len' argument. - * - * \param ssl SSL context - * \param buf buffer holding the data - * \param len how many bytes must be written - * - * \return The (non-negative) number of bytes actually written if - * successful (may be less than \p len). - * \return #MBEDTLS_ERR_SSL_WANT_READ or #MBEDTLS_ERR_SSL_WANT_WRITE - * if the handshake is incomplete and waiting for data to - * be available for reading from or writing to the underlying - * transport - in this case you must call this function again - * when the underlying transport is ready for the operation. - * \return #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS if an asynchronous - * operation is in progress (see - * mbedtls_ssl_conf_async_private_cb()) - in this case you - * must call this function again when the operation is ready. - * \return #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS if a cryptographic - * operation is in progress (see mbedtls_ecp_set_max_ops()) - - * in this case you must call this function again to complete - * the handshake when you're done attending other tasks. - * \return Another SSL error code - in this case you must stop using - * the context (see below). - * - * \warning If this function returns something other than - * a non-negative value, - * #MBEDTLS_ERR_SSL_WANT_READ, - * #MBEDTLS_ERR_SSL_WANT_WRITE, - * #MBEDTLS_ERR_SSL_ASYNC_IN_PROGRESS or - * #MBEDTLS_ERR_SSL_CRYPTO_IN_PROGRESS, - * you must stop using the SSL context for reading or writing, - * and either free it or call \c mbedtls_ssl_session_reset() - * on it before re-using it for a new connection; the current - * connection must be closed. - * - * \note When this function returns #MBEDTLS_ERR_SSL_WANT_WRITE/READ, - * it must be called later with the *same* arguments, - * until it returns a value greater that or equal to 0. When - * the function returns #MBEDTLS_ERR_SSL_WANT_WRITE there may be - * some partial data in the output buffer, however this is not - * yet sent. - * - * \note If the requested length is greater than the maximum - * fragment length (either the built-in limit or the one set - * or negotiated with the peer), then: - * - with TLS, less bytes than requested are written. - * - with DTLS, MBEDTLS_ERR_SSL_BAD_INPUT_DATA is returned. - * \c mbedtls_ssl_get_output_max_frag_len() may be used to - * query the active maximum fragment length. - * - * \note Attempting to write 0 bytes will result in an empty TLS - * application record being sent. - */ -int mbedtls_ssl_write( mbedtls_ssl_context *ssl, const unsigned char *buf, size_t len ); - -/** - * \brief Send an alert message - * - * \param ssl SSL context - * \param level The alert level of the message - * (MBEDTLS_SSL_ALERT_LEVEL_WARNING or MBEDTLS_SSL_ALERT_LEVEL_FATAL) - * \param message The alert message (SSL_ALERT_MSG_*) - * - * \return 0 if successful, or a specific SSL error code. - * - * \note If this function returns something other than 0 or - * MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop using - * the SSL context for reading or writing, and either free it or - * call \c mbedtls_ssl_session_reset() on it before re-using it - * for a new connection; the current connection must be closed. - */ -int mbedtls_ssl_send_alert_message( mbedtls_ssl_context *ssl, - unsigned char level, - unsigned char message ); -/** - * \brief Notify the peer that the connection is being closed - * - * \param ssl SSL context - * - * \return 0 if successful, or a specific SSL error code. - * - * \note If this function returns something other than 0 or - * MBEDTLS_ERR_SSL_WANT_READ/WRITE, you must stop using - * the SSL context for reading or writing, and either free it or - * call \c mbedtls_ssl_session_reset() on it before re-using it - * for a new connection; the current connection must be closed. - */ -int mbedtls_ssl_close_notify( mbedtls_ssl_context *ssl ); - -/** - * \brief Free referenced items in an SSL context and clear memory - * - * \param ssl SSL context - */ -void mbedtls_ssl_free( mbedtls_ssl_context *ssl ); - -#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) -/** - * \brief Save an active connection as serialized data in a buffer. - * This allows the freeing or re-using of the SSL context - * while still picking up the connection later in a way that - * it entirely transparent to the peer. - * - * \see mbedtls_ssl_context_load() - * - * \note This feature is currently only available under certain - * conditions, see the documentation of the return value - * #MBEDTLS_ERR_SSL_BAD_INPUT_DATA for details. - * - * \note When this function succeeds, it calls - * mbedtls_ssl_session_reset() on \p ssl which as a result is - * no longer associated with the connection that has been - * serialized. This avoids creating copies of the connection - * state. You're then free to either re-use the context - * structure for a different connection, or call - * mbedtls_ssl_free() on it. See the documentation of - * mbedtls_ssl_session_reset() for more details. - * - * \param ssl The SSL context to save. On success, it is no longer - * associated with the connection that has been serialized. - * \param buf The buffer to write the serialized data to. It must be a - * writeable buffer of at least \p buf_len bytes, or may be \c - * NULL if \p buf_len is \c 0. - * \param buf_len The number of bytes available for writing in \p buf. - * \param olen The size in bytes of the data that has been or would have - * been written. It must point to a valid \c size_t. - * - * \note \p olen is updated to the correct value regardless of - * whether \p buf_len was large enough. This makes it possible - * to determine the necessary size by calling this function - * with \p buf set to \c NULL and \p buf_len to \c 0. However, - * the value of \p olen is only guaranteed to be correct when - * the function returns #MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL or - * \c 0. If the return value is different, then the value of - * \p olen is undefined. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL if \p buf is too small. - * \return #MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed - * while reseting the context. - * \return #MBEDTLS_ERR_SSL_BAD_INPUT_DATA if a handshake is in - * progress, or there is pending data for reading or sending, - * or the connection does not use DTLS 1.2 with an AEAD - * ciphersuite, or renegotiation is enabled. - */ -int mbedtls_ssl_context_save( mbedtls_ssl_context *ssl, - unsigned char *buf, - size_t buf_len, - size_t *olen ); - -/** - * \brief Load serialized connection data to an SSL context. - * - * \see mbedtls_ssl_context_save() - * - * \warning The same serialized data must never be loaded into more - * that one context. In order to ensure that, after - * successfully loading serialized data to an SSL context, you - * should immediately destroy or invalidate all copies of the - * serialized data that was loaded. Loading the same data in - * more than one context would cause severe security failures - * including but not limited to loss of confidentiality. - * - * \note Before calling this function, the SSL context must be - * prepared in one of the two following ways. The first way is - * to take a context freshly initialised with - * mbedtls_ssl_init() and call mbedtls_ssl_setup() on it with - * the same ::mbedtls_ssl_config structure that was used in - * the original connection. The second way is to - * call mbedtls_ssl_session_reset() on a context that was - * previously prepared as above but used in the meantime. - * Either way, you must not use the context to perform a - * handshake between calling mbedtls_ssl_setup() or - * mbedtls_ssl_session_reset() and calling this function. You - * may however call other setter functions in that time frame - * as indicated in the note below. - * - * \note Before or after calling this function successfully, you - * also need to configure some connection-specific callbacks - * and settings before you can use the connection again - * (unless they were already set before calling - * mbedtls_ssl_session_reset() and the values are suitable for - * the present connection). Specifically, you want to call - * at least mbedtls_ssl_set_bio() and - * mbedtls_ssl_set_timer_cb(). All other SSL setter functions - * are not necessary to call, either because they're only used - * in handshakes, or because the setting is already saved. You - * might choose to call them anyway, for example in order to - * share code between the cases of establishing a new - * connection and the case of loading an already-established - * connection. - * - * \note If you have new information about the path MTU, you want to - * call mbedtls_ssl_set_mtu() after calling this function, as - * otherwise this function would overwrite your - * newly-configured value with the value that was active when - * the context was saved. - * - * \note When this function returns an error code, it calls - * mbedtls_ssl_free() on \p ssl. In this case, you need to - * prepare the context with the usual sequence starting with a - * call to mbedtls_ssl_init() if you want to use it again. - * - * \param ssl The SSL context structure to be populated. It must have - * been prepared as described in the note above. - * \param buf The buffer holding the serialized connection data. It must - * be a readable buffer of at least \p len bytes. - * \param len The size of the serialized data in bytes. - * - * \return \c 0 if successful. - * \return #MBEDTLS_ERR_SSL_ALLOC_FAILED if memory allocation failed. - * \return #MBEDTLS_ERR_SSL_VERSION_MISMATCH if the serialized data - * comes from a different Mbed TLS version or build. - * \return #MBEDTLS_ERR_SSL_BAD_INPUT_DATA if input data is invalid. - */ -int mbedtls_ssl_context_load( mbedtls_ssl_context *ssl, - const unsigned char *buf, - size_t len ); -#endif /* MBEDTLS_SSL_CONTEXT_SERIALIZATION */ - -/** - * \brief Initialize an SSL configuration context - * Just makes the context ready for - * mbedtls_ssl_config_defaults() or mbedtls_ssl_config_free(). - * - * \note You need to call mbedtls_ssl_config_defaults() unless you - * manually set all of the relevant fields yourself. - * - * \param conf SSL configuration context - */ -void mbedtls_ssl_config_init( mbedtls_ssl_config *conf ); - -/** - * \brief Load reasonnable default SSL configuration values. - * (You need to call mbedtls_ssl_config_init() first.) - * - * \param conf SSL configuration context - * \param endpoint MBEDTLS_SSL_IS_CLIENT or MBEDTLS_SSL_IS_SERVER - * \param transport MBEDTLS_SSL_TRANSPORT_STREAM for TLS, or - * MBEDTLS_SSL_TRANSPORT_DATAGRAM for DTLS - * \param preset a MBEDTLS_SSL_PRESET_XXX value - * - * \note See \c mbedtls_ssl_conf_transport() for notes on DTLS. - * - * \return 0 if successful, or - * MBEDTLS_ERR_XXX_ALLOC_FAILED on memory allocation error. - */ -int mbedtls_ssl_config_defaults( mbedtls_ssl_config *conf, - int endpoint, int transport, int preset ); - -/** - * \brief Free an SSL configuration context - * - * \param conf SSL configuration context - */ -void mbedtls_ssl_config_free( mbedtls_ssl_config *conf ); - -/** - * \brief Initialize SSL session structure - * - * \param session SSL session - */ -void mbedtls_ssl_session_init( mbedtls_ssl_session *session ); - -/** - * \brief Free referenced items in an SSL session including the - * peer certificate and clear memory - * - * \note A session object can be freed even if the SSL context - * that was used to retrieve the session is still in use. - * - * \param session SSL session - */ -void mbedtls_ssl_session_free( mbedtls_ssl_session *session ); - -/** - * \brief TLS-PRF function for key derivation. - * - * \param prf The tls_prf type funtion type to be used. - * \param secret Secret for the key derivation function. - * \param slen Length of the secret. - * \param label String label for the key derivation function, - * terminated with null character. - * \param random Random bytes. - * \param rlen Length of the random bytes buffer. - * \param dstbuf The buffer holding the derived key. - * \param dlen Length of the output buffer. - * - * \return 0 on sucess. An SSL specific error on failure. - */ -int mbedtls_ssl_tls_prf( const mbedtls_tls_prf_types prf, - const unsigned char *secret, size_t slen, - const char *label, - const unsigned char *random, size_t rlen, - unsigned char *dstbuf, size_t dlen ); - -#ifdef __cplusplus -} -#endif - -#endif /* ssl.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_cache.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_cache.h deleted file mode 100644 index d049f6e29..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_cache.h +++ /dev/null @@ -1,151 +0,0 @@ -/** - * \file ssl_cache.h - * - * \brief SSL session cache implementation - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_CACHE_H -#define MBEDTLS_SSL_CACHE_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/ssl.h" - -#if defined(MBEDTLS_THREADING_C) -#include "mbedtls/threading.h" -#endif - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ - -#if !defined(MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT) -#define MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT 86400 /*!< 1 day */ -#endif - -#if !defined(MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES) -#define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /*!< Maximum entries in cache */ -#endif - -/* \} name SECTION: Module settings */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct mbedtls_ssl_cache_context mbedtls_ssl_cache_context; -typedef struct mbedtls_ssl_cache_entry mbedtls_ssl_cache_entry; - -/** - * \brief This structure is used for storing cache entries - */ -struct mbedtls_ssl_cache_entry -{ -#if defined(MBEDTLS_HAVE_TIME) - mbedtls_time_t timestamp; /*!< entry timestamp */ -#endif - mbedtls_ssl_session session; /*!< entry session */ -#if defined(MBEDTLS_X509_CRT_PARSE_C) && \ - defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) - mbedtls_x509_buf peer_cert; /*!< entry peer_cert */ -#endif - mbedtls_ssl_cache_entry *next; /*!< chain pointer */ -}; - -/** - * \brief Cache context - */ -struct mbedtls_ssl_cache_context -{ - mbedtls_ssl_cache_entry *chain; /*!< start of the chain */ - int timeout; /*!< cache entry timeout */ - int max_entries; /*!< maximum entries */ -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; /*!< mutex */ -#endif -}; - -/** - * \brief Initialize an SSL cache context - * - * \param cache SSL cache context - */ -void mbedtls_ssl_cache_init( mbedtls_ssl_cache_context *cache ); - -/** - * \brief Cache get callback implementation - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param data SSL cache context - * \param session session to retrieve entry for - */ -int mbedtls_ssl_cache_get( void *data, mbedtls_ssl_session *session ); - -/** - * \brief Cache set callback implementation - * (Thread-safe if MBEDTLS_THREADING_C is enabled) - * - * \param data SSL cache context - * \param session session to store entry for - */ -int mbedtls_ssl_cache_set( void *data, const mbedtls_ssl_session *session ); - -#if defined(MBEDTLS_HAVE_TIME) -/** - * \brief Set the cache timeout - * (Default: MBEDTLS_SSL_CACHE_DEFAULT_TIMEOUT (1 day)) - * - * A timeout of 0 indicates no timeout. - * - * \param cache SSL cache context - * \param timeout cache entry timeout in seconds - */ -void mbedtls_ssl_cache_set_timeout( mbedtls_ssl_cache_context *cache, int timeout ); -#endif /* MBEDTLS_HAVE_TIME */ - -/** - * \brief Set the maximum number of cache entries - * (Default: MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES (50)) - * - * \param cache SSL cache context - * \param max cache entry maximum - */ -void mbedtls_ssl_cache_set_max_entries( mbedtls_ssl_cache_context *cache, int max ); - -/** - * \brief Free referenced items in a cache context and clear memory - * - * \param cache SSL cache context - */ -void mbedtls_ssl_cache_free( mbedtls_ssl_cache_context *cache ); - -#ifdef __cplusplus -} -#endif - -#endif /* ssl_cache.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_ciphersuites.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_ciphersuites.h deleted file mode 100644 index 7fbafa48d..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_ciphersuites.h +++ /dev/null @@ -1,558 +0,0 @@ -/** - * \file ssl_ciphersuites.h - * - * \brief SSL Ciphersuites for mbed TLS - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_CIPHERSUITES_H -#define MBEDTLS_SSL_CIPHERSUITES_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/pk.h" -#include "mbedtls/cipher.h" -#include "mbedtls/md.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Supported ciphersuites (Official IANA names) - */ -#define MBEDTLS_TLS_RSA_WITH_NULL_MD5 0x01 /**< Weak! */ -#define MBEDTLS_TLS_RSA_WITH_NULL_SHA 0x02 /**< Weak! */ - -#define MBEDTLS_TLS_RSA_WITH_RC4_128_MD5 0x04 -#define MBEDTLS_TLS_RSA_WITH_RC4_128_SHA 0x05 -#define MBEDTLS_TLS_RSA_WITH_DES_CBC_SHA 0x09 /**< Weak! Not in TLS 1.2 */ - -#define MBEDTLS_TLS_RSA_WITH_3DES_EDE_CBC_SHA 0x0A - -#define MBEDTLS_TLS_DHE_RSA_WITH_DES_CBC_SHA 0x15 /**< Weak! Not in TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA 0x16 - -#define MBEDTLS_TLS_PSK_WITH_NULL_SHA 0x2C /**< Weak! */ -#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA 0x2D /**< Weak! */ -#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA 0x2E /**< Weak! */ -#define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA 0x2F - -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA 0x33 -#define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA 0x35 -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA 0x39 - -#define MBEDTLS_TLS_RSA_WITH_NULL_SHA256 0x3B /**< Weak! */ -#define MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256 0x3C /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA256 0x3D /**< TLS 1.2 */ - -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA 0x41 -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x45 - -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 0x67 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 0x6B /**< TLS 1.2 */ - -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA 0x84 -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x88 - -#define MBEDTLS_TLS_PSK_WITH_RC4_128_SHA 0x8A -#define MBEDTLS_TLS_PSK_WITH_3DES_EDE_CBC_SHA 0x8B -#define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA 0x8C -#define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA 0x8D - -#define MBEDTLS_TLS_DHE_PSK_WITH_RC4_128_SHA 0x8E -#define MBEDTLS_TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA 0x8F -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA 0x90 -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA 0x91 - -#define MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA 0x92 -#define MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA 0x93 -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA 0x94 -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA 0x95 - -#define MBEDTLS_TLS_RSA_WITH_AES_128_GCM_SHA256 0x9C /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_AES_256_GCM_SHA384 0x9D /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 0x9E /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 0x9F /**< TLS 1.2 */ - -#define MBEDTLS_TLS_PSK_WITH_AES_128_GCM_SHA256 0xA8 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_AES_256_GCM_SHA384 0xA9 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 0xAA /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 0xAB /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 0xAC /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 0xAD /**< TLS 1.2 */ - -#define MBEDTLS_TLS_PSK_WITH_AES_128_CBC_SHA256 0xAE -#define MBEDTLS_TLS_PSK_WITH_AES_256_CBC_SHA384 0xAF -#define MBEDTLS_TLS_PSK_WITH_NULL_SHA256 0xB0 /**< Weak! */ -#define MBEDTLS_TLS_PSK_WITH_NULL_SHA384 0xB1 /**< Weak! */ - -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 0xB2 -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 0xB3 -#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA256 0xB4 /**< Weak! */ -#define MBEDTLS_TLS_DHE_PSK_WITH_NULL_SHA384 0xB5 /**< Weak! */ - -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 0xB6 -#define MBEDTLS_TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 0xB7 -#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA256 0xB8 /**< Weak! */ -#define MBEDTLS_TLS_RSA_PSK_WITH_NULL_SHA384 0xB9 /**< Weak! */ - -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBA /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xBE /**< TLS 1.2 */ - -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC0 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 0xC4 /**< TLS 1.2 */ - -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_NULL_SHA 0xC001 /**< Weak! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_RC4_128_SHA 0xC002 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC003 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0xC004 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0xC005 /**< Not in SSL3! */ - -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_NULL_SHA 0xC006 /**< Weak! */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_RC4_128_SHA 0xC007 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA 0xC008 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0xC009 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0xC00A /**< Not in SSL3! */ - -#define MBEDTLS_TLS_ECDH_RSA_WITH_NULL_SHA 0xC00B /**< Weak! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_RC4_128_SHA 0xC00C /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA 0xC00D /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA 0xC00E /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA 0xC00F /**< Not in SSL3! */ - -#define MBEDTLS_TLS_ECDHE_RSA_WITH_NULL_SHA 0xC010 /**< Weak! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_RC4_128_SHA 0xC011 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA 0xC012 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA 0xC013 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA 0xC014 /**< Not in SSL3! */ - -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xC023 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xC024 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 0xC025 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 0xC026 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 0xC027 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 0xC028 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 0xC029 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 0xC02A /**< TLS 1.2 */ - -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xC02B /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xC02C /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0xC02D /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0xC02E /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0xC02F /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0xC030 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 0xC031 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 0xC032 /**< TLS 1.2 */ - -#define MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA 0xC033 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA 0xC034 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA 0xC035 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA 0xC036 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 0xC037 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 0xC038 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA 0xC039 /**< Weak! No SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA256 0xC03A /**< Weak! No SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_NULL_SHA384 0xC03B /**< Weak! No SSL3! */ - -#define MBEDTLS_TLS_RSA_WITH_ARIA_128_CBC_SHA256 0xC03C /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_ARIA_256_CBC_SHA384 0xC03D /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 0xC044 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 0xC045 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC048 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC049 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 0xC04A /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 0xC04B /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 0xC04C /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 0xC04D /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 0xC04E /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 0xC04F /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_ARIA_128_GCM_SHA256 0xC050 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_ARIA_256_GCM_SHA384 0xC051 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 0xC052 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 0xC053 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05C /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05D /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 0xC05E /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 0xC05F /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 0xC060 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 0xC061 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 0xC062 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 0xC063 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_ARIA_128_CBC_SHA256 0xC064 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_ARIA_256_CBC_SHA384 0xC065 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 0xC066 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 0xC067 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 0xC068 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 0xC069 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_ARIA_128_GCM_SHA256 0xC06A /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_ARIA_256_GCM_SHA384 0xC06B /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 0xC06C /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 0xC06D /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 0xC06E /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 0xC06F /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 0xC070 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 0xC071 /**< TLS 1.2 */ - -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC072 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC073 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 0xC074 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 0xC075 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC076 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC077 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 0xC078 /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 0xC079 /**< Not in SSL3! */ - -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07A /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07B /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC07C /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC07D /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC086 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC087 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 0xC088 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 0xC089 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08A /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08B /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 0xC08C /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 0xC08D /**< TLS 1.2 */ - -#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC08E /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC08F /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC090 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC091 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 0xC092 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 0xC093 /**< TLS 1.2 */ - -#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC094 -#define MBEDTLS_TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC095 -#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC096 -#define MBEDTLS_TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC097 -#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC098 -#define MBEDTLS_TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC099 -#define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 0xC09A /**< Not in SSL3! */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 0xC09B /**< Not in SSL3! */ - -#define MBEDTLS_TLS_RSA_WITH_AES_128_CCM 0xC09C /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_AES_256_CCM 0xC09D /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM 0xC09E /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM 0xC09F /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_AES_128_CCM_8 0xC0A0 /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_WITH_AES_256_CCM_8 0xC0A1 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_128_CCM_8 0xC0A2 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_AES_256_CCM_8 0xC0A3 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_AES_128_CCM 0xC0A4 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_AES_256_CCM 0xC0A5 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM 0xC0A6 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM 0xC0A7 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 0xC0A8 /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8 0xC0A9 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_128_CCM_8 0xC0AA /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_AES_256_CCM_8 0xC0AB /**< TLS 1.2 */ -/* The last two are named with PSK_DHE in the RFC, which looks like a typo */ - -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM 0xC0AC /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM 0xC0AD /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 0xC0AE /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 0xC0AF /**< TLS 1.2 */ - -#define MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 0xC0FF /**< experimental */ - -/* RFC 7905 */ -#define MBEDTLS_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 0xCCA8 /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0xCCA9 /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 0xCCAA /**< TLS 1.2 */ -#define MBEDTLS_TLS_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAB /**< TLS 1.2 */ -#define MBEDTLS_TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAC /**< TLS 1.2 */ -#define MBEDTLS_TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAD /**< TLS 1.2 */ -#define MBEDTLS_TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256 0xCCAE /**< TLS 1.2 */ - -/* Reminder: update mbedtls_ssl_premaster_secret when adding a new key exchange. - * Reminder: update MBEDTLS_KEY_EXCHANGE__xxx below - */ -typedef enum { - MBEDTLS_KEY_EXCHANGE_NONE = 0, - MBEDTLS_KEY_EXCHANGE_RSA, - MBEDTLS_KEY_EXCHANGE_DHE_RSA, - MBEDTLS_KEY_EXCHANGE_ECDHE_RSA, - MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA, - MBEDTLS_KEY_EXCHANGE_PSK, - MBEDTLS_KEY_EXCHANGE_DHE_PSK, - MBEDTLS_KEY_EXCHANGE_RSA_PSK, - MBEDTLS_KEY_EXCHANGE_ECDHE_PSK, - MBEDTLS_KEY_EXCHANGE_ECDH_RSA, - MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA, - MBEDTLS_KEY_EXCHANGE_ECJPAKE, -} mbedtls_key_exchange_type_t; - -/* Key exchanges using a certificate */ -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) -#define MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED -#endif - -/* Key exchanges allowing client certificate requests */ -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) -#define MBEDTLS_KEY_EXCHANGE_CERT_REQ_ALLOWED_ENABLED -#endif - -/* Key exchanges involving server signature in ServerKeyExchange */ -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) -#define MBEDTLS_KEY_EXCHANGE_WITH_SERVER_SIGNATURE_ENABLED -#endif - -/* Key exchanges using ECDH */ -#if defined(MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) -#define MBEDTLS_KEY_EXCHANGE_SOME_ECDH_ENABLED -#endif - -/* Key exchanges that don't involve ephemeral keys */ -#if defined(MBEDTLS_KEY_EXCHANGE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_SOME_ECDH_ENABLED) -#define MBEDTLS_KEY_EXCHANGE_SOME_NON_PFS_ENABLED -#endif - -/* Key exchanges that involve ephemeral keys */ -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) -#define MBEDTLS_KEY_EXCHANGE_SOME_PFS_ENABLED -#endif - -/* Key exchanges using a PSK */ -#if defined(MBEDTLS_KEY_EXCHANGE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) -#define MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED -#endif - -/* Key exchanges using DHE */ -#if defined(MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED) -#define MBEDTLS_KEY_EXCHANGE_SOME_DHE_ENABLED -#endif - -/* Key exchanges using ECDHE */ -#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED) -#define MBEDTLS_KEY_EXCHANGE_SOME_ECDHE_ENABLED -#endif - -typedef struct mbedtls_ssl_ciphersuite_t mbedtls_ssl_ciphersuite_t; - -#define MBEDTLS_CIPHERSUITE_WEAK 0x01 /**< Weak ciphersuite flag */ -#define MBEDTLS_CIPHERSUITE_SHORT_TAG 0x02 /**< Short authentication tag, - eg for CCM_8 */ -#define MBEDTLS_CIPHERSUITE_NODTLS 0x04 /**< Can't be used with DTLS */ - -/** - * \brief This structure is used for storing ciphersuite information - */ -struct mbedtls_ssl_ciphersuite_t -{ - int id; - const char * name; - - mbedtls_cipher_type_t cipher; - mbedtls_md_type_t mac; - mbedtls_key_exchange_type_t key_exchange; - - int min_major_ver; - int min_minor_ver; - int max_major_ver; - int max_minor_ver; - - unsigned char flags; -}; - -const int *mbedtls_ssl_list_ciphersuites( void ); - -const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_string( const char *ciphersuite_name ); -const mbedtls_ssl_ciphersuite_t *mbedtls_ssl_ciphersuite_from_id( int ciphersuite_id ); - -#if defined(MBEDTLS_PK_C) -mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_pk_alg( const mbedtls_ssl_ciphersuite_t *info ); -mbedtls_pk_type_t mbedtls_ssl_get_ciphersuite_sig_alg( const mbedtls_ssl_ciphersuite_t *info ); -#endif - -int mbedtls_ssl_ciphersuite_uses_ec( const mbedtls_ssl_ciphersuite_t *info ); -int mbedtls_ssl_ciphersuite_uses_psk( const mbedtls_ssl_ciphersuite_t *info ); - -#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PFS_ENABLED) -static inline int mbedtls_ssl_ciphersuite_has_pfs( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_DHE_RSA: - case MBEDTLS_KEY_EXCHANGE_DHE_PSK: - case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK: - case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: - case MBEDTLS_KEY_EXCHANGE_ECJPAKE: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PFS_ENABLED */ - -#if defined(MBEDTLS_KEY_EXCHANGE_SOME_NON_PFS_ENABLED) -static inline int mbedtls_ssl_ciphersuite_no_pfs( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: - case MBEDTLS_KEY_EXCHANGE_RSA: - case MBEDTLS_KEY_EXCHANGE_PSK: - case MBEDTLS_KEY_EXCHANGE_RSA_PSK: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE_SOME_NON_PFS_ENABLED */ - -#if defined(MBEDTLS_KEY_EXCHANGE_SOME_ECDH_ENABLED) -static inline int mbedtls_ssl_ciphersuite_uses_ecdh( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE_SOME_ECDH_ENABLED */ - -static inline int mbedtls_ssl_ciphersuite_cert_req_allowed( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_RSA: - case MBEDTLS_KEY_EXCHANGE_DHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: - return( 1 ); - - default: - return( 0 ); - } -} - -static inline int mbedtls_ssl_ciphersuite_uses_srv_cert( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_RSA: - case MBEDTLS_KEY_EXCHANGE_RSA_PSK: - case MBEDTLS_KEY_EXCHANGE_DHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDH_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: - return( 1 ); - - default: - return( 0 ); - } -} - -#if defined(MBEDTLS_KEY_EXCHANGE_SOME_DHE_ENABLED) -static inline int mbedtls_ssl_ciphersuite_uses_dhe( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_DHE_RSA: - case MBEDTLS_KEY_EXCHANGE_DHE_PSK: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE_SOME_DHE_ENABLED) */ - -#if defined(MBEDTLS_KEY_EXCHANGE_SOME_ECDHE_ENABLED) -static inline int mbedtls_ssl_ciphersuite_uses_ecdhe( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_PSK: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE_SOME_ECDHE_ENABLED) */ - -#if defined(MBEDTLS_KEY_EXCHANGE_WITH_SERVER_SIGNATURE_ENABLED) -static inline int mbedtls_ssl_ciphersuite_uses_server_signature( const mbedtls_ssl_ciphersuite_t *info ) -{ - switch( info->key_exchange ) - { - case MBEDTLS_KEY_EXCHANGE_DHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_RSA: - case MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA: - return( 1 ); - - default: - return( 0 ); - } -} -#endif /* MBEDTLS_KEY_EXCHANGE_WITH_SERVER_SIGNATURE_ENABLED */ - -#ifdef __cplusplus -} -#endif - -#endif /* ssl_ciphersuites.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_cookie.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_cookie.h deleted file mode 100644 index 3dbaf223a..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_cookie.h +++ /dev/null @@ -1,115 +0,0 @@ -/** - * \file ssl_cookie.h - * - * \brief DTLS cookie callbacks implementation - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_COOKIE_H -#define MBEDTLS_SSL_COOKIE_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/ssl.h" - -#if defined(MBEDTLS_THREADING_C) -#include "mbedtls/threading.h" -#endif - -/** - * \name SECTION: Module settings - * - * The configuration options you can set for this module are in this section. - * Either change them in config.h or define them on the compiler command line. - * \{ - */ -#ifndef MBEDTLS_SSL_COOKIE_TIMEOUT -#define MBEDTLS_SSL_COOKIE_TIMEOUT 60 /**< Default expiration delay of DTLS cookies, in seconds if HAVE_TIME, or in number of cookies issued */ -#endif - -/* \} name SECTION: Module settings */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Context for the default cookie functions. - */ -typedef struct mbedtls_ssl_cookie_ctx -{ - mbedtls_md_context_t hmac_ctx; /*!< context for the HMAC portion */ -#if !defined(MBEDTLS_HAVE_TIME) - unsigned long serial; /*!< serial number for expiration */ -#endif - unsigned long timeout; /*!< timeout delay, in seconds if HAVE_TIME, - or in number of tickets issued */ - -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; -#endif -} mbedtls_ssl_cookie_ctx; - -/** - * \brief Initialize cookie context - */ -void mbedtls_ssl_cookie_init( mbedtls_ssl_cookie_ctx *ctx ); - -/** - * \brief Setup cookie context (generate keys) - */ -int mbedtls_ssl_cookie_setup( mbedtls_ssl_cookie_ctx *ctx, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -/** - * \brief Set expiration delay for cookies - * (Default MBEDTLS_SSL_COOKIE_TIMEOUT) - * - * \param ctx Cookie contex - * \param delay Delay, in seconds if HAVE_TIME, or in number of cookies - * issued in the meantime. - * 0 to disable expiration (NOT recommended) - */ -void mbedtls_ssl_cookie_set_timeout( mbedtls_ssl_cookie_ctx *ctx, unsigned long delay ); - -/** - * \brief Free cookie context - */ -void mbedtls_ssl_cookie_free( mbedtls_ssl_cookie_ctx *ctx ); - -/** - * \brief Generate cookie, see \c mbedtls_ssl_cookie_write_t - */ -mbedtls_ssl_cookie_write_t mbedtls_ssl_cookie_write; - -/** - * \brief Verify cookie, see \c mbedtls_ssl_cookie_write_t - */ -mbedtls_ssl_cookie_check_t mbedtls_ssl_cookie_check; - -#ifdef __cplusplus -} -#endif - -#endif /* ssl_cookie.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_internal.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_internal.h deleted file mode 100644 index c68038c7b..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_internal.h +++ /dev/null @@ -1,1232 +0,0 @@ -/** - * \file ssl_internal.h - * - * \brief Internal functions shared by the SSL modules - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_INTERNAL_H -#define MBEDTLS_SSL_INTERNAL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/ssl.h" -#include "mbedtls/cipher.h" - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "psa/crypto.h" -#endif - -#if defined(MBEDTLS_MD5_C) -#include "mbedtls/md5.h" -#endif - -#if defined(MBEDTLS_SHA1_C) -#include "mbedtls/sha1.h" -#endif - -#if defined(MBEDTLS_SHA256_C) -#include "mbedtls/sha256.h" -#endif - -#if defined(MBEDTLS_SHA512_C) -#include "mbedtls/sha512.h" -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) -#include "mbedtls/ecjpake.h" -#endif - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -#include "psa/crypto.h" -#include "mbedtls/psa_util.h" -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \ - !defined(inline) && !defined(__cplusplus) -#define inline __inline -#endif - -/* Determine minimum supported version */ -#define MBEDTLS_SSL_MIN_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3 - -#if defined(MBEDTLS_SSL_PROTO_SSL3) -#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_0 -#else -#if defined(MBEDTLS_SSL_PROTO_TLS1) -#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1 -#else -#if defined(MBEDTLS_SSL_PROTO_TLS1_1) -#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_2 -#else -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) -#define MBEDTLS_SSL_MIN_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_3 -#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */ -#endif /* MBEDTLS_SSL_PROTO_TLS1_1 */ -#endif /* MBEDTLS_SSL_PROTO_TLS1 */ -#endif /* MBEDTLS_SSL_PROTO_SSL3 */ - -#define MBEDTLS_SSL_MIN_VALID_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1 -#define MBEDTLS_SSL_MIN_VALID_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3 - -/* Determine maximum supported version */ -#define MBEDTLS_SSL_MAX_MAJOR_VERSION MBEDTLS_SSL_MAJOR_VERSION_3 - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) -#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_3 -#else -#if defined(MBEDTLS_SSL_PROTO_TLS1_1) -#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_2 -#else -#if defined(MBEDTLS_SSL_PROTO_TLS1) -#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_1 -#else -#if defined(MBEDTLS_SSL_PROTO_SSL3) -#define MBEDTLS_SSL_MAX_MINOR_VERSION MBEDTLS_SSL_MINOR_VERSION_0 -#endif /* MBEDTLS_SSL_PROTO_SSL3 */ -#endif /* MBEDTLS_SSL_PROTO_TLS1 */ -#endif /* MBEDTLS_SSL_PROTO_TLS1_1 */ -#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */ - -/* Shorthand for restartable ECC */ -#if defined(MBEDTLS_ECP_RESTARTABLE) && \ - defined(MBEDTLS_SSL_CLI_C) && \ - defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ - defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) -#define MBEDTLS_SSL_ECP_RESTARTABLE_ENABLED -#endif - -#define MBEDTLS_SSL_INITIAL_HANDSHAKE 0 -#define MBEDTLS_SSL_RENEGOTIATION_IN_PROGRESS 1 /* In progress */ -#define MBEDTLS_SSL_RENEGOTIATION_DONE 2 /* Done or aborted */ -#define MBEDTLS_SSL_RENEGOTIATION_PENDING 3 /* Requested (server only) */ - -/* - * DTLS retransmission states, see RFC 6347 4.2.4 - * - * The SENDING state is merged in PREPARING for initial sends, - * but is distinct for resends. - * - * Note: initial state is wrong for server, but is not used anyway. - */ -#define MBEDTLS_SSL_RETRANS_PREPARING 0 -#define MBEDTLS_SSL_RETRANS_SENDING 1 -#define MBEDTLS_SSL_RETRANS_WAITING 2 -#define MBEDTLS_SSL_RETRANS_FINISHED 3 - -/* - * Allow extra bytes for record, authentication and encryption overhead: - * counter (8) + header (5) + IV(16) + MAC (16-48) + padding (0-256) - * and allow for a maximum of 1024 of compression expansion if - * enabled. - */ -#if defined(MBEDTLS_ZLIB_SUPPORT) -#define MBEDTLS_SSL_COMPRESSION_ADD 1024 -#else -#define MBEDTLS_SSL_COMPRESSION_ADD 0 -#endif - -#if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_NULL_CIPHER) || \ - ( defined(MBEDTLS_CIPHER_MODE_CBC) && \ - ( defined(MBEDTLS_AES_C) || \ - defined(MBEDTLS_CAMELLIA_C) || \ - defined(MBEDTLS_ARIA_C) || \ - defined(MBEDTLS_DES_C) ) ) -#define MBEDTLS_SSL_SOME_MODES_USE_MAC -#endif - -#if defined(MBEDTLS_SSL_SOME_MODES_USE_MAC) -/* Ciphersuites using HMAC */ -#if defined(MBEDTLS_SHA512_C) -#define MBEDTLS_SSL_MAC_ADD 48 /* SHA-384 used for HMAC */ -#elif defined(MBEDTLS_SHA256_C) -#define MBEDTLS_SSL_MAC_ADD 32 /* SHA-256 used for HMAC */ -#else -#define MBEDTLS_SSL_MAC_ADD 20 /* SHA-1 used for HMAC */ -#endif -#else /* MBEDTLS_SSL_SOME_MODES_USE_MAC */ -/* AEAD ciphersuites: GCM and CCM use a 128 bits tag */ -#define MBEDTLS_SSL_MAC_ADD 16 -#endif - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -#define MBEDTLS_SSL_PADDING_ADD 256 -#else -#define MBEDTLS_SSL_PADDING_ADD 0 -#endif - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) -#define MBEDTLS_SSL_MAX_CID_EXPANSION MBEDTLS_SSL_CID_PADDING_GRANULARITY -#else -#define MBEDTLS_SSL_MAX_CID_EXPANSION 0 -#endif - -#define MBEDTLS_SSL_PAYLOAD_OVERHEAD ( MBEDTLS_SSL_COMPRESSION_ADD + \ - MBEDTLS_MAX_IV_LENGTH + \ - MBEDTLS_SSL_MAC_ADD + \ - MBEDTLS_SSL_PADDING_ADD + \ - MBEDTLS_SSL_MAX_CID_EXPANSION \ - ) - -#define MBEDTLS_SSL_IN_PAYLOAD_LEN ( MBEDTLS_SSL_PAYLOAD_OVERHEAD + \ - ( MBEDTLS_SSL_IN_CONTENT_LEN ) ) - -#define MBEDTLS_SSL_OUT_PAYLOAD_LEN ( MBEDTLS_SSL_PAYLOAD_OVERHEAD + \ - ( MBEDTLS_SSL_OUT_CONTENT_LEN ) ) - -/* The maximum number of buffered handshake messages. */ -#define MBEDTLS_SSL_MAX_BUFFERED_HS 4 - -/* Maximum length we can advertise as our max content length for - RFC 6066 max_fragment_length extension negotiation purposes - (the lesser of both sizes, if they are unequal.) - */ -#define MBEDTLS_TLS_EXT_ADV_CONTENT_LEN ( \ - (MBEDTLS_SSL_IN_CONTENT_LEN > MBEDTLS_SSL_OUT_CONTENT_LEN) \ - ? ( MBEDTLS_SSL_OUT_CONTENT_LEN ) \ - : ( MBEDTLS_SSL_IN_CONTENT_LEN ) \ - ) - -/* Maximum size in bytes of list in sig-hash algorithm ext., RFC 5246 */ -#define MBEDTLS_SSL_MAX_SIG_HASH_ALG_LIST_LEN 65534 - -/* Maximum size in bytes of list in supported elliptic curve ext., RFC 4492 */ -#define MBEDTLS_SSL_MAX_CURVE_LIST_LEN 65535 - -/* - * Check that we obey the standard's message size bounds - */ - -#if MBEDTLS_SSL_MAX_CONTENT_LEN > 16384 -#error "Bad configuration - record content too large." -#endif - -#if MBEDTLS_SSL_IN_CONTENT_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN -#error "Bad configuration - incoming record content should not be larger than MBEDTLS_SSL_MAX_CONTENT_LEN." -#endif - -#if MBEDTLS_SSL_OUT_CONTENT_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN -#error "Bad configuration - outgoing record content should not be larger than MBEDTLS_SSL_MAX_CONTENT_LEN." -#endif - -#if MBEDTLS_SSL_IN_PAYLOAD_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN + 2048 -#error "Bad configuration - incoming protected record payload too large." -#endif - -#if MBEDTLS_SSL_OUT_PAYLOAD_LEN > MBEDTLS_SSL_MAX_CONTENT_LEN + 2048 -#error "Bad configuration - outgoing protected record payload too large." -#endif - -/* Calculate buffer sizes */ - -/* Note: Even though the TLS record header is only 5 bytes - long, we're internally using 8 bytes to store the - implicit sequence number. */ -#define MBEDTLS_SSL_HEADER_LEN 13 - -#if !defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) -#define MBEDTLS_SSL_IN_BUFFER_LEN \ - ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_IN_PAYLOAD_LEN ) ) -#else -#define MBEDTLS_SSL_IN_BUFFER_LEN \ - ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_IN_PAYLOAD_LEN ) \ - + ( MBEDTLS_SSL_CID_IN_LEN_MAX ) ) -#endif - -#if !defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) -#define MBEDTLS_SSL_OUT_BUFFER_LEN \ - ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_OUT_PAYLOAD_LEN ) ) -#else -#define MBEDTLS_SSL_OUT_BUFFER_LEN \ - ( ( MBEDTLS_SSL_HEADER_LEN ) + ( MBEDTLS_SSL_OUT_PAYLOAD_LEN ) \ - + ( MBEDTLS_SSL_CID_OUT_LEN_MAX ) ) -#endif - -#if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH) -static inline uint32_t mbedtls_ssl_get_output_buflen( const mbedtls_ssl_context *ctx ) -{ -#if defined (MBEDTLS_SSL_DTLS_CONNECTION_ID) - return (uint32_t) mbedtls_ssl_get_output_max_frag_len( ctx ) - + MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD - + MBEDTLS_SSL_CID_OUT_LEN_MAX; -#else - return (uint32_t) mbedtls_ssl_get_output_max_frag_len( ctx ) - + MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD; -#endif -} - -static inline uint32_t mbedtls_ssl_get_input_buflen( const mbedtls_ssl_context *ctx ) -{ -#if defined (MBEDTLS_SSL_DTLS_CONNECTION_ID) - return (uint32_t) mbedtls_ssl_get_input_max_frag_len( ctx ) - + MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD - + MBEDTLS_SSL_CID_IN_LEN_MAX; -#else - return (uint32_t) mbedtls_ssl_get_input_max_frag_len( ctx ) - + MBEDTLS_SSL_HEADER_LEN + MBEDTLS_SSL_PAYLOAD_OVERHEAD; -#endif -} -#endif - -#ifdef MBEDTLS_ZLIB_SUPPORT -/* Compression buffer holds both IN and OUT buffers, so should be size of the larger */ -#define MBEDTLS_SSL_COMPRESS_BUFFER_LEN ( \ - ( MBEDTLS_SSL_IN_BUFFER_LEN > MBEDTLS_SSL_OUT_BUFFER_LEN ) \ - ? MBEDTLS_SSL_IN_BUFFER_LEN \ - : MBEDTLS_SSL_OUT_BUFFER_LEN \ - ) -#endif - -/* - * TLS extension flags (for extensions with outgoing ServerHello content - * that need it (e.g. for RENEGOTIATION_INFO the server already knows because - * of state of the renegotiation flag, so no indicator is required) - */ -#define MBEDTLS_TLS_EXT_SUPPORTED_POINT_FORMATS_PRESENT (1 << 0) -#define MBEDTLS_TLS_EXT_ECJPAKE_KKPP_OK (1 << 1) - -/** - * \brief This function checks if the remaining size in a buffer is - * greater or equal than a needed space. - * - * \param cur Pointer to the current position in the buffer. - * \param end Pointer to one past the end of the buffer. - * \param need Needed space in bytes. - * - * \return Zero if the needed space is available in the buffer, non-zero - * otherwise. - */ -static inline int mbedtls_ssl_chk_buf_ptr( const uint8_t *cur, - const uint8_t *end, size_t need ) -{ - return( ( cur > end ) || ( need > (size_t)( end - cur ) ) ); -} - -/** - * \brief This macro checks if the remaining size in a buffer is - * greater or equal than a needed space. If it is not the case, - * it returns an SSL_BUFFER_TOO_SMALL error. - * - * \param cur Pointer to the current position in the buffer. - * \param end Pointer to one past the end of the buffer. - * \param need Needed space in bytes. - * - */ -#define MBEDTLS_SSL_CHK_BUF_PTR( cur, end, need ) \ - do { \ - if( mbedtls_ssl_chk_buf_ptr( ( cur ), ( end ), ( need ) ) != 0 ) \ - { \ - return( MBEDTLS_ERR_SSL_BUFFER_TOO_SMALL ); \ - } \ - } while( 0 ) - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ - defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) -/* - * Abstraction for a grid of allowed signature-hash-algorithm pairs. - */ -struct mbedtls_ssl_sig_hash_set_t -{ - /* At the moment, we only need to remember a single suitable - * hash algorithm per signature algorithm. As long as that's - * the case - and we don't need a general lookup function - - * we can implement the sig-hash-set as a map from signatures - * to hash algorithms. */ - mbedtls_md_type_t rsa; - mbedtls_md_type_t ecdsa; -}; -#endif /* MBEDTLS_SSL_PROTO_TLS1_2 && - MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED */ - -typedef int mbedtls_ssl_tls_prf_cb( const unsigned char *secret, size_t slen, - const char *label, - const unsigned char *random, size_t rlen, - unsigned char *dstbuf, size_t dlen ); -/* - * This structure contains the parameters only needed during handshake. - */ -struct mbedtls_ssl_handshake_params -{ - /* - * Handshake specific crypto variables - */ - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ - defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) - mbedtls_ssl_sig_hash_set_t hash_algs; /*!< Set of suitable sig-hash pairs */ -#endif -#if defined(MBEDTLS_DHM_C) - mbedtls_dhm_context dhm_ctx; /*!< DHM key exchange */ -#endif -#if defined(MBEDTLS_ECDH_C) - mbedtls_ecdh_context ecdh_ctx; /*!< ECDH key exchange */ - -#if defined(MBEDTLS_USE_PSA_CRYPTO) - psa_key_type_t ecdh_psa_type; - uint16_t ecdh_bits; - psa_key_handle_t ecdh_psa_privkey; - unsigned char ecdh_psa_peerkey[MBEDTLS_PSA_MAX_EC_PUBKEY_LENGTH]; - size_t ecdh_psa_peerkey_len; -#endif /* MBEDTLS_USE_PSA_CRYPTO */ -#endif /* MBEDTLS_ECDH_C */ - -#if defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) - mbedtls_ecjpake_context ecjpake_ctx; /*!< EC J-PAKE key exchange */ -#if defined(MBEDTLS_SSL_CLI_C) - unsigned char *ecjpake_cache; /*!< Cache for ClientHello ext */ - size_t ecjpake_cache_len; /*!< Length of cached data */ -#endif -#endif /* MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */ -#if defined(MBEDTLS_ECDH_C) || defined(MBEDTLS_ECDSA_C) || \ - defined(MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED) - const mbedtls_ecp_curve_info **curves; /*!< Supported elliptic curves */ -#endif -#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) -#if defined(MBEDTLS_USE_PSA_CRYPTO) - psa_key_handle_t psk_opaque; /*!< Opaque PSK from the callback */ -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - unsigned char *psk; /*!< PSK from the callback */ - size_t psk_len; /*!< Length of PSK from callback */ -#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED */ -#if defined(MBEDTLS_X509_CRT_PARSE_C) - mbedtls_ssl_key_cert *key_cert; /*!< chosen key/cert pair (server) */ -#if defined(MBEDTLS_SSL_SERVER_NAME_INDICATION) - int sni_authmode; /*!< authmode from SNI callback */ - mbedtls_ssl_key_cert *sni_key_cert; /*!< key/cert list from SNI */ - mbedtls_x509_crt *sni_ca_chain; /*!< trusted CAs from SNI callback */ - mbedtls_x509_crl *sni_ca_crl; /*!< trusted CAs CRLs from SNI */ -#endif /* MBEDTLS_SSL_SERVER_NAME_INDICATION */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ -#if defined(MBEDTLS_SSL_ECP_RESTARTABLE_ENABLED) - int ecrs_enabled; /*!< Handshake supports EC restart? */ - mbedtls_x509_crt_restart_ctx ecrs_ctx; /*!< restart context */ - enum { /* this complements ssl->state with info on intra-state operations */ - ssl_ecrs_none = 0, /*!< nothing going on (yet) */ - ssl_ecrs_crt_verify, /*!< Certificate: crt_verify() */ - ssl_ecrs_ske_start_processing, /*!< ServerKeyExchange: pk_verify() */ - ssl_ecrs_cke_ecdh_calc_secret, /*!< ClientKeyExchange: ECDH step 2 */ - ssl_ecrs_crt_vrfy_sign, /*!< CertificateVerify: pk_sign() */ - } ecrs_state; /*!< current (or last) operation */ - mbedtls_x509_crt *ecrs_peer_cert; /*!< The peer's CRT chain. */ - size_t ecrs_n; /*!< place for saving a length */ -#endif -#if defined(MBEDTLS_X509_CRT_PARSE_C) && \ - !defined(MBEDTLS_SSL_KEEP_PEER_CERTIFICATE) - mbedtls_pk_context peer_pubkey; /*!< The public key from the peer. */ -#endif /* MBEDTLS_X509_CRT_PARSE_C && !MBEDTLS_SSL_KEEP_PEER_CERTIFICATE */ -#if defined(MBEDTLS_SSL_PROTO_DTLS) - unsigned int out_msg_seq; /*!< Outgoing handshake sequence number */ - unsigned int in_msg_seq; /*!< Incoming handshake sequence number */ - - unsigned char *verify_cookie; /*!< Cli: HelloVerifyRequest cookie - Srv: unused */ - unsigned char verify_cookie_len; /*!< Cli: cookie length - Srv: flag for sending a cookie */ - - uint32_t retransmit_timeout; /*!< Current value of timeout */ - unsigned char retransmit_state; /*!< Retransmission state */ - mbedtls_ssl_flight_item *flight; /*!< Current outgoing flight */ - mbedtls_ssl_flight_item *cur_msg; /*!< Current message in flight */ - unsigned char *cur_msg_p; /*!< Position in current message */ - unsigned int in_flight_start_seq; /*!< Minimum message sequence in the - flight being received */ - mbedtls_ssl_transform *alt_transform_out; /*!< Alternative transform for - resending messages */ - unsigned char alt_out_ctr[8]; /*!< Alternative record epoch/counter - for resending messages */ - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) - /* The state of CID configuration in this handshake. */ - - uint8_t cid_in_use; /*!< This indicates whether the use of the CID extension - * has been negotiated. Possible values are - * #MBEDTLS_SSL_CID_ENABLED and - * #MBEDTLS_SSL_CID_DISABLED. */ - unsigned char peer_cid[ MBEDTLS_SSL_CID_OUT_LEN_MAX ]; /*! The peer's CID */ - uint8_t peer_cid_len; /*!< The length of - * \c peer_cid. */ -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ - - struct - { - size_t total_bytes_buffered; /*!< Cumulative size of heap allocated - * buffers used for message buffering. */ - - uint8_t seen_ccs; /*!< Indicates if a CCS message has - * been seen in the current flight. */ - - struct mbedtls_ssl_hs_buffer - { - unsigned is_valid : 1; - unsigned is_fragmented : 1; - unsigned is_complete : 1; - unsigned char *data; - size_t data_len; - } hs[MBEDTLS_SSL_MAX_BUFFERED_HS]; - - struct - { - unsigned char *data; - size_t len; - unsigned epoch; - } future_record; - - } buffering; - - uint16_t mtu; /*!< Handshake mtu, used to fragment outgoing messages */ -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - - /* - * Checksum contexts - */ -#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \ - defined(MBEDTLS_SSL_PROTO_TLS1_1) - mbedtls_md5_context fin_md5; - mbedtls_sha1_context fin_sha1; -#endif -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) -#if defined(MBEDTLS_SHA256_C) -#if defined(MBEDTLS_USE_PSA_CRYPTO) - psa_hash_operation_t fin_sha256_psa; -#else - mbedtls_sha256_context fin_sha256; -#endif -#endif -#if defined(MBEDTLS_SHA512_C) -#if defined(MBEDTLS_USE_PSA_CRYPTO) - psa_hash_operation_t fin_sha384_psa; -#else - mbedtls_sha512_context fin_sha512; -#endif -#endif -#endif /* MBEDTLS_SSL_PROTO_TLS1_2 */ - - void (*update_checksum)(mbedtls_ssl_context *, const unsigned char *, size_t); - void (*calc_verify)(const mbedtls_ssl_context *, unsigned char *, size_t *); - void (*calc_finished)(mbedtls_ssl_context *, unsigned char *, int); - mbedtls_ssl_tls_prf_cb *tls_prf; - - mbedtls_ssl_ciphersuite_t const *ciphersuite_info; - - size_t pmslen; /*!< premaster length */ - - unsigned char randbytes[64]; /*!< random bytes */ - unsigned char premaster[MBEDTLS_PREMASTER_SIZE]; - /*!< premaster secret */ - - int resume; /*!< session resume indicator*/ - int max_major_ver; /*!< max. major version client*/ - int max_minor_ver; /*!< max. minor version client*/ - int cli_exts; /*!< client extension presence*/ - -#if defined(MBEDTLS_SSL_SESSION_TICKETS) - int new_session_ticket; /*!< use NewSessionTicket? */ -#endif /* MBEDTLS_SSL_SESSION_TICKETS */ -#if defined(MBEDTLS_SSL_EXTENDED_MASTER_SECRET) - int extended_ms; /*!< use Extended Master Secret? */ -#endif - -#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) - unsigned int async_in_progress : 1; /*!< an asynchronous operation is in progress */ -#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ - -#if defined(MBEDTLS_SSL_ASYNC_PRIVATE) - /** Asynchronous operation context. This field is meant for use by the - * asynchronous operation callbacks (mbedtls_ssl_config::f_async_sign_start, - * mbedtls_ssl_config::f_async_decrypt_start, - * mbedtls_ssl_config::f_async_resume, mbedtls_ssl_config::f_async_cancel). - * The library does not use it internally. */ - void *user_async_ctx; -#endif /* MBEDTLS_SSL_ASYNC_PRIVATE */ -}; - -typedef struct mbedtls_ssl_hs_buffer mbedtls_ssl_hs_buffer; - -/* - * Representation of decryption/encryption transformations on records - * - * There are the following general types of record transformations: - * - Stream transformations (TLS versions <= 1.2 only) - * Transformation adding a MAC and applying a stream-cipher - * to the authenticated message. - * - CBC block cipher transformations ([D]TLS versions <= 1.2 only) - * In addition to the distinction of the order of encryption and - * authentication, there's a fundamental difference between the - * handling in SSL3 & TLS 1.0 and TLS 1.1 and TLS 1.2: For SSL3 - * and TLS 1.0, the final IV after processing a record is used - * as the IV for the next record. No explicit IV is contained - * in an encrypted record. The IV for the first record is extracted - * at key extraction time. In contrast, for TLS 1.1 and 1.2, no - * IV is generated at key extraction time, but every encrypted - * record is explicitly prefixed by the IV with which it was encrypted. - * - AEAD transformations ([D]TLS versions >= 1.2 only) - * These come in two fundamentally different versions, the first one - * used in TLS 1.2, excluding ChaChaPoly ciphersuites, and the second - * one used for ChaChaPoly ciphersuites in TLS 1.2 as well as for TLS 1.3. - * In the first transformation, the IV to be used for a record is obtained - * as the concatenation of an explicit, static 4-byte IV and the 8-byte - * record sequence number, and explicitly prepending this sequence number - * to the encrypted record. In contrast, in the second transformation - * the IV is obtained by XOR'ing a static IV obtained at key extraction - * time with the 8-byte record sequence number, without prepending the - * latter to the encrypted record. - * - * Additionally, DTLS 1.2 + CID as well as TLS 1.3 use an inner plaintext - * which allows to add flexible length padding and to hide a record's true - * content type. - * - * In addition to type and version, the following parameters are relevant: - * - The symmetric cipher algorithm to be used. - * - The (static) encryption/decryption keys for the cipher. - * - For stream/CBC, the type of message digest to be used. - * - For stream/CBC, (static) encryption/decryption keys for the digest. - * - For AEAD transformations, the size (potentially 0) of an explicit, - * random initialization vector placed in encrypted records. - * - For some transformations (currently AEAD and CBC in SSL3 and TLS 1.0) - * an implicit IV. It may be static (e.g. AEAD) or dynamic (e.g. CBC) - * and (if present) is combined with the explicit IV in a transformation- - * dependent way (e.g. appending in TLS 1.2 and XOR'ing in TLS 1.3). - * - For stream/CBC, a flag determining the order of encryption and MAC. - * - The details of the transformation depend on the SSL/TLS version. - * - The length of the authentication tag. - * - * Note: Except for CBC in SSL3 and TLS 1.0, these parameters are - * constant across multiple encryption/decryption operations. - * For CBC, the implicit IV needs to be updated after each - * operation. - * - * The struct below refines this abstract view as follows: - * - The cipher underlying the transformation is managed in - * cipher contexts cipher_ctx_{enc/dec}, which must have the - * same cipher type. The mode of these cipher contexts determines - * the type of the transformation in the sense above: e.g., if - * the type is MBEDTLS_CIPHER_AES_256_CBC resp. MBEDTLS_CIPHER_AES_192_GCM - * then the transformation has type CBC resp. AEAD. - * - The cipher keys are never stored explicitly but - * are maintained within cipher_ctx_{enc/dec}. - * - For stream/CBC transformations, the message digest contexts - * used for the MAC's are stored in md_ctx_{enc/dec}. These contexts - * are unused for AEAD transformations. - * - For stream/CBC transformations and versions > SSL3, the - * MAC keys are not stored explicitly but maintained within - * md_ctx_{enc/dec}. - * - For stream/CBC transformations and version SSL3, the MAC - * keys are stored explicitly in mac_enc, mac_dec and have - * a fixed size of 20 bytes. These fields are unused for - * AEAD transformations or transformations >= TLS 1.0. - * - For transformations using an implicit IV maintained within - * the transformation context, its contents are stored within - * iv_{enc/dec}. - * - The value of ivlen indicates the length of the IV. - * This is redundant in case of stream/CBC transformations - * which always use 0 resp. the cipher's block length as the - * IV length, but is needed for AEAD ciphers and may be - * different from the underlying cipher's block length - * in this case. - * - The field fixed_ivlen is nonzero for AEAD transformations only - * and indicates the length of the static part of the IV which is - * constant throughout the communication, and which is stored in - * the first fixed_ivlen bytes of the iv_{enc/dec} arrays. - * Note: For CBC in SSL3 and TLS 1.0, the fields iv_{enc/dec} - * still store IV's for continued use across multiple transformations, - * so it is not true that fixed_ivlen == 0 means that iv_{enc/dec} are - * not being used! - * - minor_ver denotes the SSL/TLS version - * - For stream/CBC transformations, maclen denotes the length of the - * authentication tag, while taglen is unused and 0. - * - For AEAD transformations, taglen denotes the length of the - * authentication tag, while maclen is unused and 0. - * - For CBC transformations, encrypt_then_mac determines the - * order of encryption and authentication. This field is unused - * in other transformations. - * - */ -struct mbedtls_ssl_transform -{ - /* - * Session specific crypto layer - */ - size_t minlen; /*!< min. ciphertext length */ - size_t ivlen; /*!< IV length */ - size_t fixed_ivlen; /*!< Fixed part of IV (AEAD) */ - size_t maclen; /*!< MAC(CBC) len */ - size_t taglen; /*!< TAG(AEAD) len */ - - unsigned char iv_enc[16]; /*!< IV (encryption) */ - unsigned char iv_dec[16]; /*!< IV (decryption) */ - -#if defined(MBEDTLS_SSL_SOME_MODES_USE_MAC) - -#if defined(MBEDTLS_SSL_PROTO_SSL3) - /* Needed only for SSL v3.0 secret */ - unsigned char mac_enc[20]; /*!< SSL v3.0 secret (enc) */ - unsigned char mac_dec[20]; /*!< SSL v3.0 secret (dec) */ -#endif /* MBEDTLS_SSL_PROTO_SSL3 */ - - mbedtls_md_context_t md_ctx_enc; /*!< MAC (encryption) */ - mbedtls_md_context_t md_ctx_dec; /*!< MAC (decryption) */ - -#if defined(MBEDTLS_SSL_ENCRYPT_THEN_MAC) - int encrypt_then_mac; /*!< flag for EtM activation */ -#endif - -#endif /* MBEDTLS_SSL_SOME_MODES_USE_MAC */ - - mbedtls_cipher_context_t cipher_ctx_enc; /*!< encryption context */ - mbedtls_cipher_context_t cipher_ctx_dec; /*!< decryption context */ - int minor_ver; - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) - uint8_t in_cid_len; - uint8_t out_cid_len; - unsigned char in_cid [ MBEDTLS_SSL_CID_OUT_LEN_MAX ]; - unsigned char out_cid[ MBEDTLS_SSL_CID_OUT_LEN_MAX ]; -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ - - /* - * Session specific compression layer - */ -#if defined(MBEDTLS_ZLIB_SUPPORT) - z_stream ctx_deflate; /*!< compression context */ - z_stream ctx_inflate; /*!< decompression context */ -#endif - -#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION) - /* We need the Hello random bytes in order to re-derive keys from the - * Master Secret and other session info, see ssl_populate_transform() */ - unsigned char randbytes[64]; /*!< ServerHello.random+ClientHello.random */ -#endif /* MBEDTLS_SSL_CONTEXT_SERIALIZATION */ -}; - -/* - * Return 1 if the transform uses an AEAD cipher, 0 otherwise. - * Equivalently, return 0 if a separate MAC is used, 1 otherwise. - */ -static inline int mbedtls_ssl_transform_uses_aead( - const mbedtls_ssl_transform *transform ) -{ -#if defined(MBEDTLS_SSL_SOME_MODES_USE_MAC) - return( transform->maclen == 0 && transform->taglen != 0 ); -#else - (void) transform; - return( 1 ); -#endif -} - -/* - * Internal representation of record frames - * - * Instances come in two flavors: - * (1) Encrypted - * These always have data_offset = 0 - * (2) Unencrypted - * These have data_offset set to the amount of - * pre-expansion during record protection. Concretely, - * this is the length of the fixed part of the explicit IV - * used for encryption, or 0 if no explicit IV is used - * (e.g. for CBC in TLS 1.0, or stream ciphers). - * - * The reason for the data_offset in the unencrypted case - * is to allow for in-place conversion of an unencrypted to - * an encrypted record. If the offset wasn't included, the - * encrypted content would need to be shifted afterwards to - * make space for the fixed IV. - * - */ -#if MBEDTLS_SSL_CID_OUT_LEN_MAX > MBEDTLS_SSL_CID_IN_LEN_MAX -#define MBEDTLS_SSL_CID_LEN_MAX MBEDTLS_SSL_CID_OUT_LEN_MAX -#else -#define MBEDTLS_SSL_CID_LEN_MAX MBEDTLS_SSL_CID_IN_LEN_MAX -#endif - -typedef struct -{ - uint8_t ctr[8]; /* In TLS: The implicit record sequence number. - * In DTLS: The 2-byte epoch followed by - * the 6-byte sequence number. - * This is stored as a raw big endian byte array - * as opposed to a uint64_t because we rarely - * need to perform arithmetic on this, but do - * need it as a Byte array for the purpose of - * MAC computations. */ - uint8_t type; /* The record content type. */ - uint8_t ver[2]; /* SSL/TLS version as present on the wire. - * Convert to internal presentation of versions - * using mbedtls_ssl_read_version() and - * mbedtls_ssl_write_version(). - * Keep wire-format for MAC computations. */ - - unsigned char *buf; /* Memory buffer enclosing the record content */ - size_t buf_len; /* Buffer length */ - size_t data_offset; /* Offset of record content */ - size_t data_len; /* Length of record content */ - -#if defined(MBEDTLS_SSL_DTLS_CONNECTION_ID) - uint8_t cid_len; /* Length of the CID (0 if not present) */ - unsigned char cid[ MBEDTLS_SSL_CID_LEN_MAX ]; /* The CID */ -#endif /* MBEDTLS_SSL_DTLS_CONNECTION_ID */ -} mbedtls_record; - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/* - * List of certificate + private key pairs - */ -struct mbedtls_ssl_key_cert -{ - mbedtls_x509_crt *cert; /*!< cert */ - mbedtls_pk_context *key; /*!< private key */ - mbedtls_ssl_key_cert *next; /*!< next key/cert pair */ -}; -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) -/* - * List of handshake messages kept around for resending - */ -struct mbedtls_ssl_flight_item -{ - unsigned char *p; /*!< message, including handshake headers */ - size_t len; /*!< length of p */ - unsigned char type; /*!< type of the message: handshake or CCS */ - mbedtls_ssl_flight_item *next; /*!< next handshake message(s) */ -}; -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - -#if defined(MBEDTLS_SSL_PROTO_TLS1_2) && \ - defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) - -/* Find an entry in a signature-hash set matching a given hash algorithm. */ -mbedtls_md_type_t mbedtls_ssl_sig_hash_set_find( mbedtls_ssl_sig_hash_set_t *set, - mbedtls_pk_type_t sig_alg ); -/* Add a signature-hash-pair to a signature-hash set */ -void mbedtls_ssl_sig_hash_set_add( mbedtls_ssl_sig_hash_set_t *set, - mbedtls_pk_type_t sig_alg, - mbedtls_md_type_t md_alg ); -/* Allow exactly one hash algorithm for each signature. */ -void mbedtls_ssl_sig_hash_set_const_hash( mbedtls_ssl_sig_hash_set_t *set, - mbedtls_md_type_t md_alg ); - -/* Setup an empty signature-hash set */ -static inline void mbedtls_ssl_sig_hash_set_init( mbedtls_ssl_sig_hash_set_t *set ) -{ - mbedtls_ssl_sig_hash_set_const_hash( set, MBEDTLS_MD_NONE ); -} - -#endif /* MBEDTLS_SSL_PROTO_TLS1_2) && - MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED */ - -/** - * \brief Free referenced items in an SSL transform context and clear - * memory - * - * \param transform SSL transform context - */ -void mbedtls_ssl_transform_free( mbedtls_ssl_transform *transform ); - -/** - * \brief Free referenced items in an SSL handshake context and clear - * memory - * - * \param ssl SSL context - */ -void mbedtls_ssl_handshake_free( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_handshake_client_step( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_handshake_server_step( mbedtls_ssl_context *ssl ); -void mbedtls_ssl_handshake_wrapup( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_send_fatal_handshake_failure( mbedtls_ssl_context *ssl ); - -void mbedtls_ssl_reset_checksum( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_derive_keys( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_handle_message_type( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_prepare_handshake_record( mbedtls_ssl_context *ssl ); -void mbedtls_ssl_update_handshake_status( mbedtls_ssl_context *ssl ); - -/** - * \brief Update record layer - * - * This function roughly separates the implementation - * of the logic of (D)TLS from the implementation - * of the secure transport. - * - * \param ssl The SSL context to use. - * \param update_hs_digest This indicates if the handshake digest - * should be automatically updated in case - * a handshake message is found. - * - * \return 0 or non-zero error code. - * - * \note A clarification on what is called 'record layer' here - * is in order, as many sensible definitions are possible: - * - * The record layer takes as input an untrusted underlying - * transport (stream or datagram) and transforms it into - * a serially multiplexed, secure transport, which - * conceptually provides the following: - * - * (1) Three datagram based, content-agnostic transports - * for handshake, alert and CCS messages. - * (2) One stream- or datagram-based transport - * for application data. - * (3) Functionality for changing the underlying transform - * securing the contents. - * - * The interface to this functionality is given as follows: - * - * a Updating - * [Currently implemented by mbedtls_ssl_read_record] - * - * Check if and on which of the four 'ports' data is pending: - * Nothing, a controlling datagram of type (1), or application - * data (2). In any case data is present, internal buffers - * provide access to the data for the user to process it. - * Consumption of type (1) datagrams is done automatically - * on the next update, invalidating that the internal buffers - * for previous datagrams, while consumption of application - * data (2) is user-controlled. - * - * b Reading of application data - * [Currently manual adaption of ssl->in_offt pointer] - * - * As mentioned in the last paragraph, consumption of data - * is different from the automatic consumption of control - * datagrams (1) because application data is treated as a stream. - * - * c Tracking availability of application data - * [Currently manually through decreasing ssl->in_msglen] - * - * For efficiency and to retain datagram semantics for - * application data in case of DTLS, the record layer - * provides functionality for checking how much application - * data is still available in the internal buffer. - * - * d Changing the transformation securing the communication. - * - * Given an opaque implementation of the record layer in the - * above sense, it should be possible to implement the logic - * of (D)TLS on top of it without the need to know anything - * about the record layer's internals. This is done e.g. - * in all the handshake handling functions, and in the - * application data reading function mbedtls_ssl_read. - * - * \note The above tries to give a conceptual picture of the - * record layer, but the current implementation deviates - * from it in some places. For example, our implementation of - * the update functionality through mbedtls_ssl_read_record - * discards datagrams depending on the current state, which - * wouldn't fall under the record layer's responsibility - * following the above definition. - * - */ -int mbedtls_ssl_read_record( mbedtls_ssl_context *ssl, - unsigned update_hs_digest ); -int mbedtls_ssl_fetch_input( mbedtls_ssl_context *ssl, size_t nb_want ); - -int mbedtls_ssl_write_handshake_msg( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_write_record( mbedtls_ssl_context *ssl, uint8_t force_flush ); -int mbedtls_ssl_flush_output( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_parse_certificate( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_write_certificate( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_parse_change_cipher_spec( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_write_change_cipher_spec( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_parse_finished( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_write_finished( mbedtls_ssl_context *ssl ); - -void mbedtls_ssl_optimize_checksum( mbedtls_ssl_context *ssl, - const mbedtls_ssl_ciphersuite_t *ciphersuite_info ); - -#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED) -int mbedtls_ssl_psk_derive_premaster( mbedtls_ssl_context *ssl, mbedtls_key_exchange_type_t key_ex ); - -/** - * Get the first defined PSK by order of precedence: - * 1. handshake PSK set by \c mbedtls_ssl_set_hs_psk() in the PSK callback - * 2. static PSK configured by \c mbedtls_ssl_conf_psk() - * Return a code and update the pair (PSK, PSK length) passed to this function - */ -static inline int mbedtls_ssl_get_psk( const mbedtls_ssl_context *ssl, - const unsigned char **psk, size_t *psk_len ) -{ - if( ssl->handshake->psk != NULL && ssl->handshake->psk_len > 0 ) - { - *psk = ssl->handshake->psk; - *psk_len = ssl->handshake->psk_len; - } - - else if( ssl->conf->psk != NULL && ssl->conf->psk_len > 0 ) - { - *psk = ssl->conf->psk; - *psk_len = ssl->conf->psk_len; - } - - else - { - *psk = NULL; - *psk_len = 0; - return( MBEDTLS_ERR_SSL_PRIVATE_KEY_REQUIRED ); - } - - return( 0 ); -} - -#if defined(MBEDTLS_USE_PSA_CRYPTO) -/** - * Get the first defined opaque PSK by order of precedence: - * 1. handshake PSK set by \c mbedtls_ssl_set_hs_psk_opaque() in the PSK - * callback - * 2. static PSK configured by \c mbedtls_ssl_conf_psk_opaque() - * Return an opaque PSK - */ -static inline psa_key_handle_t mbedtls_ssl_get_opaque_psk( - const mbedtls_ssl_context *ssl ) -{ - if( ssl->handshake->psk_opaque != 0 ) - return( ssl->handshake->psk_opaque ); - - if( ssl->conf->psk_opaque != 0 ) - return( ssl->conf->psk_opaque ); - - return( 0 ); -} -#endif /* MBEDTLS_USE_PSA_CRYPTO */ - -#endif /* MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED */ - -#if defined(MBEDTLS_PK_C) -unsigned char mbedtls_ssl_sig_from_pk( mbedtls_pk_context *pk ); -unsigned char mbedtls_ssl_sig_from_pk_alg( mbedtls_pk_type_t type ); -mbedtls_pk_type_t mbedtls_ssl_pk_alg_from_sig( unsigned char sig ); -#endif - -mbedtls_md_type_t mbedtls_ssl_md_alg_from_hash( unsigned char hash ); -unsigned char mbedtls_ssl_hash_from_md_alg( int md ); -int mbedtls_ssl_set_calc_verify_md( mbedtls_ssl_context *ssl, int md ); - -#if defined(MBEDTLS_ECP_C) -int mbedtls_ssl_check_curve( const mbedtls_ssl_context *ssl, mbedtls_ecp_group_id grp_id ); -#endif - -#if defined(MBEDTLS_KEY_EXCHANGE_WITH_CERT_ENABLED) -int mbedtls_ssl_check_sig_hash( const mbedtls_ssl_context *ssl, - mbedtls_md_type_t md ); -#endif - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -static inline mbedtls_pk_context *mbedtls_ssl_own_key( mbedtls_ssl_context *ssl ) -{ - mbedtls_ssl_key_cert *key_cert; - - if( ssl->handshake != NULL && ssl->handshake->key_cert != NULL ) - key_cert = ssl->handshake->key_cert; - else - key_cert = ssl->conf->key_cert; - - return( key_cert == NULL ? NULL : key_cert->key ); -} - -static inline mbedtls_x509_crt *mbedtls_ssl_own_cert( mbedtls_ssl_context *ssl ) -{ - mbedtls_ssl_key_cert *key_cert; - - if( ssl->handshake != NULL && ssl->handshake->key_cert != NULL ) - key_cert = ssl->handshake->key_cert; - else - key_cert = ssl->conf->key_cert; - - return( key_cert == NULL ? NULL : key_cert->cert ); -} - -/* - * Check usage of a certificate wrt extensions: - * keyUsage, extendedKeyUsage (later), and nSCertType (later). - * - * Warning: cert_endpoint is the endpoint of the cert (ie, of our peer when we - * check a cert we received from them)! - * - * Return 0 if everything is OK, -1 if not. - */ -int mbedtls_ssl_check_cert_usage( const mbedtls_x509_crt *cert, - const mbedtls_ssl_ciphersuite_t *ciphersuite, - int cert_endpoint, - uint32_t *flags ); -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -void mbedtls_ssl_write_version( int major, int minor, int transport, - unsigned char ver[2] ); -void mbedtls_ssl_read_version( int *major, int *minor, int transport, - const unsigned char ver[2] ); - -static inline size_t mbedtls_ssl_in_hdr_len( const mbedtls_ssl_context *ssl ) -{ -#if !defined(MBEDTLS_SSL_PROTO_DTLS) - ((void) ssl); -#endif - -#if defined(MBEDTLS_SSL_PROTO_DTLS) - if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) - { - return( 13 ); - } - else -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - { - return( 5 ); - } -} - -static inline size_t mbedtls_ssl_out_hdr_len( const mbedtls_ssl_context *ssl ) -{ - return( (size_t) ( ssl->out_iv - ssl->out_hdr ) ); -} - -static inline size_t mbedtls_ssl_hs_hdr_len( const mbedtls_ssl_context *ssl ) -{ -#if defined(MBEDTLS_SSL_PROTO_DTLS) - if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) - return( 12 ); -#else - ((void) ssl); -#endif - return( 4 ); -} - -#if defined(MBEDTLS_SSL_PROTO_DTLS) -void mbedtls_ssl_send_flight_completed( mbedtls_ssl_context *ssl ); -void mbedtls_ssl_recv_flight_completed( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_resend( mbedtls_ssl_context *ssl ); -int mbedtls_ssl_flight_transmit( mbedtls_ssl_context *ssl ); -#endif - -/* Visible for testing purposes only */ -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) -int mbedtls_ssl_dtls_replay_check( mbedtls_ssl_context const *ssl ); -void mbedtls_ssl_dtls_replay_update( mbedtls_ssl_context *ssl ); -#endif - -int mbedtls_ssl_session_copy( mbedtls_ssl_session *dst, - const mbedtls_ssl_session *src ); - -/* constant-time buffer comparison */ -static inline int mbedtls_ssl_safer_memcmp( const void *a, const void *b, size_t n ) -{ - size_t i; - volatile const unsigned char *A = (volatile const unsigned char *) a; - volatile const unsigned char *B = (volatile const unsigned char *) b; - volatile unsigned char diff = 0; - - for( i = 0; i < n; i++ ) - { - /* Read volatile data in order before computing diff. - * This avoids IAR compiler warning: - * 'the order of volatile accesses is undefined ..' */ - unsigned char x = A[i], y = B[i]; - diff |= x ^ y; - } - - return( diff ); -} - -#if defined(MBEDTLS_SSL_PROTO_SSL3) || defined(MBEDTLS_SSL_PROTO_TLS1) || \ - defined(MBEDTLS_SSL_PROTO_TLS1_1) -int mbedtls_ssl_get_key_exchange_md_ssl_tls( mbedtls_ssl_context *ssl, - unsigned char *output, - unsigned char *data, size_t data_len ); -#endif /* MBEDTLS_SSL_PROTO_SSL3 || MBEDTLS_SSL_PROTO_TLS1 || \ - MBEDTLS_SSL_PROTO_TLS1_1 */ - -#if defined(MBEDTLS_SSL_PROTO_TLS1) || defined(MBEDTLS_SSL_PROTO_TLS1_1) || \ - defined(MBEDTLS_SSL_PROTO_TLS1_2) -/* The hash buffer must have at least MBEDTLS_MD_MAX_SIZE bytes of length. */ -int mbedtls_ssl_get_key_exchange_md_tls1_2( mbedtls_ssl_context *ssl, - unsigned char *hash, size_t *hashlen, - unsigned char *data, size_t data_len, - mbedtls_md_type_t md_alg ); -#endif /* MBEDTLS_SSL_PROTO_TLS1 || MBEDTLS_SSL_PROTO_TLS1_1 || \ - MBEDTLS_SSL_PROTO_TLS1_2 */ - -#ifdef __cplusplus -} -#endif - -void mbedtls_ssl_transform_init( mbedtls_ssl_transform *transform ); -int mbedtls_ssl_encrypt_buf( mbedtls_ssl_context *ssl, - mbedtls_ssl_transform *transform, - mbedtls_record *rec, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -int mbedtls_ssl_decrypt_buf( mbedtls_ssl_context const *ssl, - mbedtls_ssl_transform *transform, - mbedtls_record *rec ); - -/* Length of the "epoch" field in the record header */ -static inline size_t mbedtls_ssl_ep_len( const mbedtls_ssl_context *ssl ) -{ -#if defined(MBEDTLS_SSL_PROTO_DTLS) - if( ssl->conf->transport == MBEDTLS_SSL_TRANSPORT_DATAGRAM ) - return( 2 ); -#else - ((void) ssl); -#endif - return( 0 ); -} - -#if defined(MBEDTLS_SSL_PROTO_DTLS) -int mbedtls_ssl_resend_hello_request( mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - -void mbedtls_ssl_set_timer( mbedtls_ssl_context *ssl, uint32_t millisecs ); -int mbedtls_ssl_check_timer( mbedtls_ssl_context *ssl ); - -void mbedtls_ssl_reset_in_out_pointers( mbedtls_ssl_context *ssl ); -void mbedtls_ssl_update_out_pointers( mbedtls_ssl_context *ssl, - mbedtls_ssl_transform *transform ); -void mbedtls_ssl_update_in_pointers( mbedtls_ssl_context *ssl ); - -int mbedtls_ssl_session_reset_int( mbedtls_ssl_context *ssl, int partial ); - -#if defined(MBEDTLS_SSL_DTLS_ANTI_REPLAY) -void mbedtls_ssl_dtls_replay_reset( mbedtls_ssl_context *ssl ); -#endif - -void mbedtls_ssl_handshake_wrapup_free_hs_transform( mbedtls_ssl_context *ssl ); - -#if defined(MBEDTLS_SSL_RENEGOTIATION) -int mbedtls_ssl_start_renegotiation( mbedtls_ssl_context *ssl ); -#endif /* MBEDTLS_SSL_RENEGOTIATION */ - -#if defined(MBEDTLS_SSL_PROTO_DTLS) -size_t mbedtls_ssl_get_current_mtu( const mbedtls_ssl_context *ssl ); -void mbedtls_ssl_buffering_free( mbedtls_ssl_context *ssl ); -void mbedtls_ssl_flight_free( mbedtls_ssl_flight_item *flight ); -#endif /* MBEDTLS_SSL_PROTO_DTLS */ - -#endif /* ssl_internal.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_ticket.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_ticket.h deleted file mode 100644 index 8561f6d88..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/ssl_ticket.h +++ /dev/null @@ -1,142 +0,0 @@ -/** - * \file ssl_ticket.h - * - * \brief TLS server ticket callbacks implementation - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_SSL_TICKET_H -#define MBEDTLS_SSL_TICKET_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -/* - * This implementation of the session ticket callbacks includes key - * management, rotating the keys periodically in order to preserve forward - * secrecy, when MBEDTLS_HAVE_TIME is defined. - */ - -#include "mbedtls/ssl.h" -#include "mbedtls/cipher.h" - -#if defined(MBEDTLS_THREADING_C) -#include "mbedtls/threading.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \brief Information for session ticket protection - */ -typedef struct mbedtls_ssl_ticket_key -{ - unsigned char name[4]; /*!< random key identifier */ - uint32_t generation_time; /*!< key generation timestamp (seconds) */ - mbedtls_cipher_context_t ctx; /*!< context for auth enc/decryption */ -} -mbedtls_ssl_ticket_key; - -/** - * \brief Context for session ticket handling functions - */ -typedef struct mbedtls_ssl_ticket_context -{ - mbedtls_ssl_ticket_key keys[2]; /*!< ticket protection keys */ - unsigned char active; /*!< index of the currently active key */ - - uint32_t ticket_lifetime; /*!< lifetime of tickets in seconds */ - - /** Callback for getting (pseudo-)random numbers */ - int (*f_rng)(void *, unsigned char *, size_t); - void *p_rng; /*!< context for the RNG function */ - -#if defined(MBEDTLS_THREADING_C) - mbedtls_threading_mutex_t mutex; -#endif -} -mbedtls_ssl_ticket_context; - -/** - * \brief Initialize a ticket context. - * (Just make it ready for mbedtls_ssl_ticket_setup() - * or mbedtls_ssl_ticket_free().) - * - * \param ctx Context to be initialized - */ -void mbedtls_ssl_ticket_init( mbedtls_ssl_ticket_context *ctx ); - -/** - * \brief Prepare context to be actually used - * - * \param ctx Context to be set up - * \param f_rng RNG callback function - * \param p_rng RNG callback context - * \param cipher AEAD cipher to use for ticket protection. - * Recommended value: MBEDTLS_CIPHER_AES_256_GCM. - * \param lifetime Tickets lifetime in seconds - * Recommended value: 86400 (one day). - * - * \note It is highly recommended to select a cipher that is at - * least as strong as the the strongest ciphersuite - * supported. Usually that means a 256-bit key. - * - * \note The lifetime of the keys is twice the lifetime of tickets. - * It is recommended to pick a reasonnable lifetime so as not - * to negate the benefits of forward secrecy. - * - * \return 0 if successful, - * or a specific MBEDTLS_ERR_XXX error code - */ -int mbedtls_ssl_ticket_setup( mbedtls_ssl_ticket_context *ctx, - int (*f_rng)(void *, unsigned char *, size_t), void *p_rng, - mbedtls_cipher_type_t cipher, - uint32_t lifetime ); - -/** - * \brief Implementation of the ticket write callback - * - * \note See \c mbedtls_ssl_ticket_write_t for description - */ -mbedtls_ssl_ticket_write_t mbedtls_ssl_ticket_write; - -/** - * \brief Implementation of the ticket parse callback - * - * \note See \c mbedtls_ssl_ticket_parse_t for description - */ -mbedtls_ssl_ticket_parse_t mbedtls_ssl_ticket_parse; - -/** - * \brief Free a context's content and zeroize it. - * - * \param ctx Context to be cleaned up - */ -void mbedtls_ssl_ticket_free( mbedtls_ssl_ticket_context *ctx ); - -#ifdef __cplusplus -} -#endif - -#endif /* ssl_ticket.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/threading.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/threading.h deleted file mode 100644 index cab40f71a..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/threading.h +++ /dev/null @@ -1,122 +0,0 @@ -/** - * \file threading.h - * - * \brief Threading abstraction layer - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_THREADING_H -#define MBEDTLS_THREADING_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE is deprecated and should not be - * used. */ -#define MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE -0x001A /**< The selected feature is not available. */ - -#define MBEDTLS_ERR_THREADING_BAD_INPUT_DATA -0x001C /**< Bad input parameters to function. */ -#define MBEDTLS_ERR_THREADING_MUTEX_ERROR -0x001E /**< Locking / unlocking / free failed with error code. */ - -#if defined(MBEDTLS_THREADING_PTHREAD) -#include -typedef struct mbedtls_threading_mutex_t -{ - pthread_mutex_t mutex; - char is_valid; -} mbedtls_threading_mutex_t; -#endif - -#if defined(MBEDTLS_THREADING_ALT) -/* You should define the mbedtls_threading_mutex_t type in your header */ -#include "threading_alt.h" - -/** - * \brief Set your alternate threading implementation function - * pointers and initialize global mutexes. If used, this - * function must be called once in the main thread before any - * other mbed TLS function is called, and - * mbedtls_threading_free_alt() must be called once in the main - * thread after all other mbed TLS functions. - * - * \note mutex_init() and mutex_free() don't return a status code. - * If mutex_init() fails, it should leave its argument (the - * mutex) in a state such that mutex_lock() will fail when - * called with this argument. - * - * \param mutex_init the init function implementation - * \param mutex_free the free function implementation - * \param mutex_lock the lock function implementation - * \param mutex_unlock the unlock function implementation - */ -void mbedtls_threading_set_alt( void (*mutex_init)( mbedtls_threading_mutex_t * ), - void (*mutex_free)( mbedtls_threading_mutex_t * ), - int (*mutex_lock)( mbedtls_threading_mutex_t * ), - int (*mutex_unlock)( mbedtls_threading_mutex_t * ) ); - -/** - * \brief Free global mutexes. - */ -void mbedtls_threading_free_alt( void ); -#endif /* MBEDTLS_THREADING_ALT */ - -#if defined(MBEDTLS_THREADING_C) -/* - * The function pointers for mutex_init, mutex_free, mutex_ and mutex_unlock - * - * All these functions are expected to work or the result will be undefined. - */ -extern void (*mbedtls_mutex_init)( mbedtls_threading_mutex_t *mutex ); -extern void (*mbedtls_mutex_free)( mbedtls_threading_mutex_t *mutex ); -extern int (*mbedtls_mutex_lock)( mbedtls_threading_mutex_t *mutex ); -extern int (*mbedtls_mutex_unlock)( mbedtls_threading_mutex_t *mutex ); - -/* - * Global mutexes - */ -#if defined(MBEDTLS_FS_IO) -extern mbedtls_threading_mutex_t mbedtls_threading_readdir_mutex; -#endif - -#if defined(MBEDTLS_HAVE_TIME_DATE) && !defined(MBEDTLS_PLATFORM_GMTIME_R_ALT) -/* This mutex may or may not be used in the default definition of - * mbedtls_platform_gmtime_r(), but in order to determine that, - * we need to check POSIX features, hence modify _POSIX_C_SOURCE. - * With the current approach, this declaration is orphaned, lacking - * an accompanying definition, in case mbedtls_platform_gmtime_r() - * doesn't need it, but that's not a problem. */ -extern mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex; -#endif /* MBEDTLS_HAVE_TIME_DATE && !MBEDTLS_PLATFORM_GMTIME_R_ALT */ - -#endif /* MBEDTLS_THREADING_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* threading.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/threading_alt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/threading_alt.h deleted file mode 100644 index 23c1d29df..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/threading_alt.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef MBEDTLS_THREADING_ALT_H -#define MBEDTLS_THREADING_ALT_H - -#include -#include "nrf_cc3xx_platform_mutex.h" - -/** @brief Alternate declaration of mbedtls mutex type - * - * The RTOS may require allocation and freeing of resources - * as the inner type of the mutex is represented by an - * RTOS-friendly void pointer. - */ -typedef nrf_cc3xx_platform_mutex_t mbedtls_threading_mutex_t; - -#endif /* MBEDTLS_THREADING_ALT_H */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/timing.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/timing.h deleted file mode 100644 index b264a5a95..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/timing.h +++ /dev/null @@ -1,153 +0,0 @@ -/** - * \file timing.h - * - * \brief Portable interface to timeouts and to the CPU cycle counter - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_TIMING_H -#define MBEDTLS_TIMING_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_TIMING_ALT) -// Regular implementation -// - -/** - * \brief timer structure - */ -struct mbedtls_timing_hr_time -{ - unsigned char opaque[32]; -}; - -/** - * \brief Context for mbedtls_timing_set/get_delay() - */ -typedef struct mbedtls_timing_delay_context -{ - struct mbedtls_timing_hr_time timer; - uint32_t int_ms; - uint32_t fin_ms; -} mbedtls_timing_delay_context; - -#else /* MBEDTLS_TIMING_ALT */ -#include "timing_alt.h" -#endif /* MBEDTLS_TIMING_ALT */ - -extern volatile int mbedtls_timing_alarmed; - -/** - * \brief Return the CPU cycle counter value - * - * \warning This is only a best effort! Do not rely on this! - * In particular, it is known to be unreliable on virtual - * machines. - * - * \note This value starts at an unspecified origin and - * may wrap around. - */ -unsigned long mbedtls_timing_hardclock( void ); - -/** - * \brief Return the elapsed time in milliseconds - * - * \param val points to a timer structure - * \param reset If 0, query the elapsed time. Otherwise (re)start the timer. - * - * \return Elapsed time since the previous reset in ms. When - * restarting, this is always 0. - * - * \note To initialize a timer, call this function with reset=1. - * - * Determining the elapsed time and resetting the timer is not - * atomic on all platforms, so after the sequence - * `{ get_timer(1); ...; time1 = get_timer(1); ...; time2 = - * get_timer(0) }` the value time1+time2 is only approximately - * the delay since the first reset. - */ -unsigned long mbedtls_timing_get_timer( struct mbedtls_timing_hr_time *val, int reset ); - -/** - * \brief Setup an alarm clock - * - * \param seconds delay before the "mbedtls_timing_alarmed" flag is set - * (must be >=0) - * - * \warning Only one alarm at a time is supported. In a threaded - * context, this means one for the whole process, not one per - * thread. - */ -void mbedtls_set_alarm( int seconds ); - -/** - * \brief Set a pair of delays to watch - * (See \c mbedtls_timing_get_delay().) - * - * \param data Pointer to timing data. - * Must point to a valid \c mbedtls_timing_delay_context struct. - * \param int_ms First (intermediate) delay in milliseconds. - * The effect if int_ms > fin_ms is unspecified. - * \param fin_ms Second (final) delay in milliseconds. - * Pass 0 to cancel the current delay. - * - * \note To set a single delay, either use \c mbedtls_timing_set_timer - * directly or use this function with int_ms == fin_ms. - */ -void mbedtls_timing_set_delay( void *data, uint32_t int_ms, uint32_t fin_ms ); - -/** - * \brief Get the status of delays - * (Memory helper: number of delays passed.) - * - * \param data Pointer to timing data - * Must point to a valid \c mbedtls_timing_delay_context struct. - * - * \return -1 if cancelled (fin_ms = 0), - * 0 if none of the delays are passed, - * 1 if only the intermediate delay is passed, - * 2 if the final delay is passed. - */ -int mbedtls_timing_get_delay( void *data ); - -#if defined(MBEDTLS_SELF_TEST) -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if a test failed - */ -int mbedtls_timing_self_test( int verbose ); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* timing.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/version.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/version.h deleted file mode 100644 index 0ae4d2271..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/version.h +++ /dev/null @@ -1,112 +0,0 @@ -/** - * \file version.h - * - * \brief Run-time version information - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -/* - * This set of compile-time defines and run-time variables can be used to - * determine the version number of the mbed TLS library used. - */ -#ifndef MBEDTLS_VERSION_H -#define MBEDTLS_VERSION_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -/** - * The version number x.y.z is split into three parts. - * Major, Minor, Patchlevel - */ -#define MBEDTLS_VERSION_MAJOR 2 -#define MBEDTLS_VERSION_MINOR 23 -#define MBEDTLS_VERSION_PATCH 0 - -/** - * The single version number has the following structure: - * MMNNPP00 - * Major version | Minor version | Patch version - */ -#define MBEDTLS_VERSION_NUMBER 0x02170000 -#define MBEDTLS_VERSION_STRING "2.23.0" -#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.23.0" - -#if defined(MBEDTLS_VERSION_C) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Get the version number. - * - * \return The constructed version number in the format - * MMNNPP00 (Major, Minor, Patch). - */ -unsigned int mbedtls_version_get_number( void ); - -/** - * Get the version string ("x.y.z"). - * - * \param string The string that will receive the value. - * (Should be at least 9 bytes in size) - */ -void mbedtls_version_get_string( char *string ); - -/** - * Get the full version string ("mbed TLS x.y.z"). - * - * \param string The string that will receive the value. The mbed TLS version - * string will use 18 bytes AT MOST including a terminating - * null byte. - * (So the buffer should be at least 18 bytes to receive this - * version string). - */ -void mbedtls_version_get_string_full( char *string ); - -/** - * \brief Check if support for a feature was compiled into this - * mbed TLS binary. This allows you to see at runtime if the - * library was for instance compiled with or without - * Multi-threading support. - * - * \note only checks against defines in the sections "System - * support", "mbed TLS modules" and "mbed TLS feature - * support" in config.h - * - * \param feature The string for the define to check (e.g. "MBEDTLS_AES_C") - * - * \return 0 if the feature is present, - * -1 if the feature is not present and - * -2 if support for feature checking as a whole was not - * compiled in. - */ -int mbedtls_version_check_feature( const char *feature ); - -#ifdef __cplusplus -} -#endif - -#endif /* MBEDTLS_VERSION_C */ - -#endif /* version.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509.h deleted file mode 100644 index 9b6b51f45..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509.h +++ /dev/null @@ -1,361 +0,0 @@ -/** - * \file x509.h - * - * \brief X.509 generic defines and structures - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_X509_H -#define MBEDTLS_X509_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/asn1.h" -#include "mbedtls/pk.h" - -#if defined(MBEDTLS_RSA_C) -#include "mbedtls/rsa.h" -#endif - -/** - * \addtogroup x509_module - * \{ - */ - -#if !defined(MBEDTLS_X509_MAX_INTERMEDIATE_CA) -/** - * Maximum number of intermediate CAs in a verification chain. - * That is, maximum length of the chain, excluding the end-entity certificate - * and the trusted root certificate. - * - * Set this to a low value to prevent an adversary from making you waste - * resources verifying an overlong certificate chain. - */ -#define MBEDTLS_X509_MAX_INTERMEDIATE_CA 8 -#endif - -/** - * \name X509 Error codes - * \{ - */ -#define MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE -0x2080 /**< Unavailable feature, e.g. RSA hashing/encryption combination. */ -#define MBEDTLS_ERR_X509_UNKNOWN_OID -0x2100 /**< Requested OID is unknown. */ -#define MBEDTLS_ERR_X509_INVALID_FORMAT -0x2180 /**< The CRT/CRL/CSR format is invalid, e.g. different type expected. */ -#define MBEDTLS_ERR_X509_INVALID_VERSION -0x2200 /**< The CRT/CRL/CSR version element is invalid. */ -#define MBEDTLS_ERR_X509_INVALID_SERIAL -0x2280 /**< The serial tag or value is invalid. */ -#define MBEDTLS_ERR_X509_INVALID_ALG -0x2300 /**< The algorithm tag or value is invalid. */ -#define MBEDTLS_ERR_X509_INVALID_NAME -0x2380 /**< The name tag or value is invalid. */ -#define MBEDTLS_ERR_X509_INVALID_DATE -0x2400 /**< The date tag or value is invalid. */ -#define MBEDTLS_ERR_X509_INVALID_SIGNATURE -0x2480 /**< The signature tag or value invalid. */ -#define MBEDTLS_ERR_X509_INVALID_EXTENSIONS -0x2500 /**< The extension tag or value is invalid. */ -#define MBEDTLS_ERR_X509_UNKNOWN_VERSION -0x2580 /**< CRT/CRL/CSR has an unsupported version number. */ -#define MBEDTLS_ERR_X509_UNKNOWN_SIG_ALG -0x2600 /**< Signature algorithm (oid) is unsupported. */ -#define MBEDTLS_ERR_X509_SIG_MISMATCH -0x2680 /**< Signature algorithms do not match. (see \c ::mbedtls_x509_crt sig_oid) */ -#define MBEDTLS_ERR_X509_CERT_VERIFY_FAILED -0x2700 /**< Certificate verification failed, e.g. CRL, CA or signature check failed. */ -#define MBEDTLS_ERR_X509_CERT_UNKNOWN_FORMAT -0x2780 /**< Format not recognized as DER or PEM. */ -#define MBEDTLS_ERR_X509_BAD_INPUT_DATA -0x2800 /**< Input invalid. */ -#define MBEDTLS_ERR_X509_ALLOC_FAILED -0x2880 /**< Allocation of memory failed. */ -#define MBEDTLS_ERR_X509_FILE_IO_ERROR -0x2900 /**< Read/write of file failed. */ -#define MBEDTLS_ERR_X509_BUFFER_TOO_SMALL -0x2980 /**< Destination buffer is too small. */ -#define MBEDTLS_ERR_X509_FATAL_ERROR -0x3000 /**< A fatal error occurred, eg the chain is too long or the vrfy callback failed. */ -/* \} name */ - -/** - * \name X509 Verify codes - * \{ - */ -/* Reminder: update x509_crt_verify_strings[] in library/x509_crt.c */ -#define MBEDTLS_X509_BADCERT_EXPIRED 0x01 /**< The certificate validity has expired. */ -#define MBEDTLS_X509_BADCERT_REVOKED 0x02 /**< The certificate has been revoked (is on a CRL). */ -#define MBEDTLS_X509_BADCERT_CN_MISMATCH 0x04 /**< The certificate Common Name (CN) does not match with the expected CN. */ -#define MBEDTLS_X509_BADCERT_NOT_TRUSTED 0x08 /**< The certificate is not correctly signed by the trusted CA. */ -#define MBEDTLS_X509_BADCRL_NOT_TRUSTED 0x10 /**< The CRL is not correctly signed by the trusted CA. */ -#define MBEDTLS_X509_BADCRL_EXPIRED 0x20 /**< The CRL is expired. */ -#define MBEDTLS_X509_BADCERT_MISSING 0x40 /**< Certificate was missing. */ -#define MBEDTLS_X509_BADCERT_SKIP_VERIFY 0x80 /**< Certificate verification was skipped. */ -#define MBEDTLS_X509_BADCERT_OTHER 0x0100 /**< Other reason (can be used by verify callback) */ -#define MBEDTLS_X509_BADCERT_FUTURE 0x0200 /**< The certificate validity starts in the future. */ -#define MBEDTLS_X509_BADCRL_FUTURE 0x0400 /**< The CRL is from the future */ -#define MBEDTLS_X509_BADCERT_KEY_USAGE 0x0800 /**< Usage does not match the keyUsage extension. */ -#define MBEDTLS_X509_BADCERT_EXT_KEY_USAGE 0x1000 /**< Usage does not match the extendedKeyUsage extension. */ -#define MBEDTLS_X509_BADCERT_NS_CERT_TYPE 0x2000 /**< Usage does not match the nsCertType extension. */ -#define MBEDTLS_X509_BADCERT_BAD_MD 0x4000 /**< The certificate is signed with an unacceptable hash. */ -#define MBEDTLS_X509_BADCERT_BAD_PK 0x8000 /**< The certificate is signed with an unacceptable PK alg (eg RSA vs ECDSA). */ -#define MBEDTLS_X509_BADCERT_BAD_KEY 0x010000 /**< The certificate is signed with an unacceptable key (eg bad curve, RSA too short). */ -#define MBEDTLS_X509_BADCRL_BAD_MD 0x020000 /**< The CRL is signed with an unacceptable hash. */ -#define MBEDTLS_X509_BADCRL_BAD_PK 0x040000 /**< The CRL is signed with an unacceptable PK alg (eg RSA vs ECDSA). */ -#define MBEDTLS_X509_BADCRL_BAD_KEY 0x080000 /**< The CRL is signed with an unacceptable key (eg bad curve, RSA too short). */ - -/* \} name */ -/* \} addtogroup x509_module */ - -/* - * X.509 v3 Subject Alternative Name types. - * otherName [0] OtherName, - * rfc822Name [1] IA5String, - * dNSName [2] IA5String, - * x400Address [3] ORAddress, - * directoryName [4] Name, - * ediPartyName [5] EDIPartyName, - * uniformResourceIdentifier [6] IA5String, - * iPAddress [7] OCTET STRING, - * registeredID [8] OBJECT IDENTIFIER - */ -#define MBEDTLS_X509_SAN_OTHER_NAME 0 -#define MBEDTLS_X509_SAN_RFC822_NAME 1 -#define MBEDTLS_X509_SAN_DNS_NAME 2 -#define MBEDTLS_X509_SAN_X400_ADDRESS_NAME 3 -#define MBEDTLS_X509_SAN_DIRECTORY_NAME 4 -#define MBEDTLS_X509_SAN_EDI_PARTY_NAME 5 -#define MBEDTLS_X509_SAN_UNIFORM_RESOURCE_IDENTIFIER 6 -#define MBEDTLS_X509_SAN_IP_ADDRESS 7 -#define MBEDTLS_X509_SAN_REGISTERED_ID 8 - -/* - * X.509 v3 Key Usage Extension flags - * Reminder: update x509_info_key_usage() when adding new flags. - */ -#define MBEDTLS_X509_KU_DIGITAL_SIGNATURE (0x80) /* bit 0 */ -#define MBEDTLS_X509_KU_NON_REPUDIATION (0x40) /* bit 1 */ -#define MBEDTLS_X509_KU_KEY_ENCIPHERMENT (0x20) /* bit 2 */ -#define MBEDTLS_X509_KU_DATA_ENCIPHERMENT (0x10) /* bit 3 */ -#define MBEDTLS_X509_KU_KEY_AGREEMENT (0x08) /* bit 4 */ -#define MBEDTLS_X509_KU_KEY_CERT_SIGN (0x04) /* bit 5 */ -#define MBEDTLS_X509_KU_CRL_SIGN (0x02) /* bit 6 */ -#define MBEDTLS_X509_KU_ENCIPHER_ONLY (0x01) /* bit 7 */ -#define MBEDTLS_X509_KU_DECIPHER_ONLY (0x8000) /* bit 8 */ - -/* - * Netscape certificate types - * (http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn3.html) - */ - -#define MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT (0x80) /* bit 0 */ -#define MBEDTLS_X509_NS_CERT_TYPE_SSL_SERVER (0x40) /* bit 1 */ -#define MBEDTLS_X509_NS_CERT_TYPE_EMAIL (0x20) /* bit 2 */ -#define MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING (0x10) /* bit 3 */ -#define MBEDTLS_X509_NS_CERT_TYPE_RESERVED (0x08) /* bit 4 */ -#define MBEDTLS_X509_NS_CERT_TYPE_SSL_CA (0x04) /* bit 5 */ -#define MBEDTLS_X509_NS_CERT_TYPE_EMAIL_CA (0x02) /* bit 6 */ -#define MBEDTLS_X509_NS_CERT_TYPE_OBJECT_SIGNING_CA (0x01) /* bit 7 */ - -/* - * X.509 extension types - * - * Comments refer to the status for using certificates. Status can be - * different for writing certificates or reading CRLs or CSRs. - * - * Those are defined in oid.h as oid.c needs them in a data structure. Since - * these were previously defined here, let's have aliases for compatibility. - */ -#define MBEDTLS_X509_EXT_AUTHORITY_KEY_IDENTIFIER MBEDTLS_OID_X509_EXT_AUTHORITY_KEY_IDENTIFIER -#define MBEDTLS_X509_EXT_SUBJECT_KEY_IDENTIFIER MBEDTLS_OID_X509_EXT_SUBJECT_KEY_IDENTIFIER -#define MBEDTLS_X509_EXT_KEY_USAGE MBEDTLS_OID_X509_EXT_KEY_USAGE -#define MBEDTLS_X509_EXT_CERTIFICATE_POLICIES MBEDTLS_OID_X509_EXT_CERTIFICATE_POLICIES -#define MBEDTLS_X509_EXT_POLICY_MAPPINGS MBEDTLS_OID_X509_EXT_POLICY_MAPPINGS -#define MBEDTLS_X509_EXT_SUBJECT_ALT_NAME MBEDTLS_OID_X509_EXT_SUBJECT_ALT_NAME /* Supported (DNS) */ -#define MBEDTLS_X509_EXT_ISSUER_ALT_NAME MBEDTLS_OID_X509_EXT_ISSUER_ALT_NAME -#define MBEDTLS_X509_EXT_SUBJECT_DIRECTORY_ATTRS MBEDTLS_OID_X509_EXT_SUBJECT_DIRECTORY_ATTRS -#define MBEDTLS_X509_EXT_BASIC_CONSTRAINTS MBEDTLS_OID_X509_EXT_BASIC_CONSTRAINTS /* Supported */ -#define MBEDTLS_X509_EXT_NAME_CONSTRAINTS MBEDTLS_OID_X509_EXT_NAME_CONSTRAINTS -#define MBEDTLS_X509_EXT_POLICY_CONSTRAINTS MBEDTLS_OID_X509_EXT_POLICY_CONSTRAINTS -#define MBEDTLS_X509_EXT_EXTENDED_KEY_USAGE MBEDTLS_OID_X509_EXT_EXTENDED_KEY_USAGE -#define MBEDTLS_X509_EXT_CRL_DISTRIBUTION_POINTS MBEDTLS_OID_X509_EXT_CRL_DISTRIBUTION_POINTS -#define MBEDTLS_X509_EXT_INIHIBIT_ANYPOLICY MBEDTLS_OID_X509_EXT_INIHIBIT_ANYPOLICY -#define MBEDTLS_X509_EXT_FRESHEST_CRL MBEDTLS_OID_X509_EXT_FRESHEST_CRL -#define MBEDTLS_X509_EXT_NS_CERT_TYPE MBEDTLS_OID_X509_EXT_NS_CERT_TYPE - -/* - * Storage format identifiers - * Recognized formats: PEM and DER - */ -#define MBEDTLS_X509_FORMAT_DER 1 -#define MBEDTLS_X509_FORMAT_PEM 2 - -#define MBEDTLS_X509_MAX_DN_NAME_SIZE 256 /**< Maximum value size of a DN entry */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup x509_module - * \{ */ - -/** - * \name Structures for parsing X.509 certificates, CRLs and CSRs - * \{ - */ - -/** - * Type-length-value structure that allows for ASN1 using DER. - */ -typedef mbedtls_asn1_buf mbedtls_x509_buf; - -/** - * Container for ASN1 bit strings. - */ -typedef mbedtls_asn1_bitstring mbedtls_x509_bitstring; - -/** - * Container for ASN1 named information objects. - * It allows for Relative Distinguished Names (e.g. cn=localhost,ou=code,etc.). - */ -typedef mbedtls_asn1_named_data mbedtls_x509_name; - -/** - * Container for a sequence of ASN.1 items - */ -typedef mbedtls_asn1_sequence mbedtls_x509_sequence; - -/** Container for date and time (precision in seconds). */ -typedef struct mbedtls_x509_time -{ - int year, mon, day; /**< Date. */ - int hour, min, sec; /**< Time. */ -} -mbedtls_x509_time; - -/** \} name Structures for parsing X.509 certificates, CRLs and CSRs */ -/** \} addtogroup x509_module */ - -/** - * \brief Store the certificate DN in printable form into buf; - * no more than size characters will be written. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param dn The X509 name to represent - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_dn_gets( char *buf, size_t size, const mbedtls_x509_name *dn ); - -/** - * \brief Store the certificate serial in printable form into buf; - * no more than size characters will be written. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param serial The X509 serial to represent - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_serial_gets( char *buf, size_t size, const mbedtls_x509_buf *serial ); - -/** - * \brief Check a given mbedtls_x509_time against the system time - * and tell if it's in the past. - * - * \note Intended usage is "if( is_past( valid_to ) ) ERROR". - * Hence the return value of 1 if on internal errors. - * - * \param to mbedtls_x509_time to check - * - * \return 1 if the given time is in the past or an error occurred, - * 0 otherwise. - */ -int mbedtls_x509_time_is_past( const mbedtls_x509_time *to ); - -/** - * \brief Check a given mbedtls_x509_time against the system time - * and tell if it's in the future. - * - * \note Intended usage is "if( is_future( valid_from ) ) ERROR". - * Hence the return value of 1 if on internal errors. - * - * \param from mbedtls_x509_time to check - * - * \return 1 if the given time is in the future or an error occurred, - * 0 otherwise. - */ -int mbedtls_x509_time_is_future( const mbedtls_x509_time *from ); - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_x509_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -/* - * Internal module functions. You probably do not want to use these unless you - * know you do. - */ -int mbedtls_x509_get_name( unsigned char **p, const unsigned char *end, - mbedtls_x509_name *cur ); -int mbedtls_x509_get_alg_null( unsigned char **p, const unsigned char *end, - mbedtls_x509_buf *alg ); -int mbedtls_x509_get_alg( unsigned char **p, const unsigned char *end, - mbedtls_x509_buf *alg, mbedtls_x509_buf *params ); -#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT) -int mbedtls_x509_get_rsassa_pss_params( const mbedtls_x509_buf *params, - mbedtls_md_type_t *md_alg, mbedtls_md_type_t *mgf_md, - int *salt_len ); -#endif -int mbedtls_x509_get_sig( unsigned char **p, const unsigned char *end, mbedtls_x509_buf *sig ); -int mbedtls_x509_get_sig_alg( const mbedtls_x509_buf *sig_oid, const mbedtls_x509_buf *sig_params, - mbedtls_md_type_t *md_alg, mbedtls_pk_type_t *pk_alg, - void **sig_opts ); -int mbedtls_x509_get_time( unsigned char **p, const unsigned char *end, - mbedtls_x509_time *t ); -int mbedtls_x509_get_serial( unsigned char **p, const unsigned char *end, - mbedtls_x509_buf *serial ); -int mbedtls_x509_get_ext( unsigned char **p, const unsigned char *end, - mbedtls_x509_buf *ext, int tag ); -int mbedtls_x509_sig_alg_gets( char *buf, size_t size, const mbedtls_x509_buf *sig_oid, - mbedtls_pk_type_t pk_alg, mbedtls_md_type_t md_alg, - const void *sig_opts ); -int mbedtls_x509_key_size_helper( char *buf, size_t buf_size, const char *name ); -int mbedtls_x509_string_to_names( mbedtls_asn1_named_data **head, const char *name ); -int mbedtls_x509_set_extension( mbedtls_asn1_named_data **head, const char *oid, size_t oid_len, - int critical, const unsigned char *val, - size_t val_len ); -int mbedtls_x509_write_extensions( unsigned char **p, unsigned char *start, - mbedtls_asn1_named_data *first ); -int mbedtls_x509_write_names( unsigned char **p, unsigned char *start, - mbedtls_asn1_named_data *first ); -int mbedtls_x509_write_sig( unsigned char **p, unsigned char *start, - const char *oid, size_t oid_len, - unsigned char *sig, size_t size ); - -#define MBEDTLS_X509_SAFE_SNPRINTF \ - do { \ - if( ret < 0 || (size_t) ret >= n ) \ - return( MBEDTLS_ERR_X509_BUFFER_TOO_SMALL ); \ - \ - n -= (size_t) ret; \ - p += (size_t) ret; \ - } while( 0 ) - -#ifdef __cplusplus -} -#endif - -#endif /* x509.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_crl.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_crl.h deleted file mode 100644 index 072a53671..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_crl.h +++ /dev/null @@ -1,174 +0,0 @@ -/** - * \file x509_crl.h - * - * \brief X.509 certificate revocation list parsing - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_X509_CRL_H -#define MBEDTLS_X509_CRL_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/x509.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup x509_module - * \{ */ - -/** - * \name Structures and functions for parsing CRLs - * \{ - */ - -/** - * Certificate revocation list entry. - * Contains the CA-specific serial numbers and revocation dates. - */ -typedef struct mbedtls_x509_crl_entry -{ - mbedtls_x509_buf raw; - - mbedtls_x509_buf serial; - - mbedtls_x509_time revocation_date; - - mbedtls_x509_buf entry_ext; - - struct mbedtls_x509_crl_entry *next; -} -mbedtls_x509_crl_entry; - -/** - * Certificate revocation list structure. - * Every CRL may have multiple entries. - */ -typedef struct mbedtls_x509_crl -{ - mbedtls_x509_buf raw; /**< The raw certificate data (DER). */ - mbedtls_x509_buf tbs; /**< The raw certificate body (DER). The part that is To Be Signed. */ - - int version; /**< CRL version (1=v1, 2=v2) */ - mbedtls_x509_buf sig_oid; /**< CRL signature type identifier */ - - mbedtls_x509_buf issuer_raw; /**< The raw issuer data (DER). */ - - mbedtls_x509_name issuer; /**< The parsed issuer data (named information object). */ - - mbedtls_x509_time this_update; - mbedtls_x509_time next_update; - - mbedtls_x509_crl_entry entry; /**< The CRL entries containing the certificate revocation times for this CA. */ - - mbedtls_x509_buf crl_ext; - - mbedtls_x509_buf sig_oid2; - mbedtls_x509_buf sig; - mbedtls_md_type_t sig_md; /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ - mbedtls_pk_type_t sig_pk; /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ - void *sig_opts; /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ - - struct mbedtls_x509_crl *next; -} -mbedtls_x509_crl; - -/** - * \brief Parse a DER-encoded CRL and append it to the chained list - * - * \param chain points to the start of the chain - * \param buf buffer holding the CRL data in DER format - * \param buflen size of the buffer - * (including the terminating null byte for PEM data) - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_crl_parse_der( mbedtls_x509_crl *chain, - const unsigned char *buf, size_t buflen ); -/** - * \brief Parse one or more CRLs and append them to the chained list - * - * \note Multiple CRLs are accepted only if using PEM format - * - * \param chain points to the start of the chain - * \param buf buffer holding the CRL data in PEM or DER format - * \param buflen size of the buffer - * (including the terminating null byte for PEM data) - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_crl_parse( mbedtls_x509_crl *chain, const unsigned char *buf, size_t buflen ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Load one or more CRLs and append them to the chained list - * - * \note Multiple CRLs are accepted only if using PEM format - * - * \param chain points to the start of the chain - * \param path filename to read the CRLs from (in PEM or DER encoding) - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_crl_parse_file( mbedtls_x509_crl *chain, const char *path ); -#endif /* MBEDTLS_FS_IO */ - -/** - * \brief Returns an informational string about the CRL. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param prefix A line prefix - * \param crl The X509 CRL to represent - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_crl_info( char *buf, size_t size, const char *prefix, - const mbedtls_x509_crl *crl ); - -/** - * \brief Initialize a CRL (chain) - * - * \param crl CRL chain to initialize - */ -void mbedtls_x509_crl_init( mbedtls_x509_crl *crl ); - -/** - * \brief Unallocate all CRL data - * - * \param crl CRL chain to free - */ -void mbedtls_x509_crl_free( mbedtls_x509_crl *crl ); - -/* \} name */ -/* \} addtogroup x509_module */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_x509_crl.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_crt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_crt.h deleted file mode 100644 index ab0d0cdbc..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_crt.h +++ /dev/null @@ -1,1084 +0,0 @@ -/** - * \file x509_crt.h - * - * \brief X.509 certificate parsing and writing - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_X509_CRT_H -#define MBEDTLS_X509_CRT_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/x509.h" -#include "mbedtls/x509_crl.h" -#include "mbedtls/bignum.h" - -/** - * \addtogroup x509_module - * \{ - */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \name Structures and functions for parsing and writing X.509 certificates - * \{ - */ - -/** - * Container for an X.509 certificate. The certificate may be chained. - */ -typedef struct mbedtls_x509_crt -{ - int own_buffer; /**< Indicates if \c raw is owned - * by the structure or not. */ - mbedtls_x509_buf raw; /**< The raw certificate data (DER). */ - mbedtls_x509_buf tbs; /**< The raw certificate body (DER). The part that is To Be Signed. */ - - int version; /**< The X.509 version. (1=v1, 2=v2, 3=v3) */ - mbedtls_x509_buf serial; /**< Unique id for certificate issued by a specific CA. */ - mbedtls_x509_buf sig_oid; /**< Signature algorithm, e.g. sha1RSA */ - - mbedtls_x509_buf issuer_raw; /**< The raw issuer data (DER). Used for quick comparison. */ - mbedtls_x509_buf subject_raw; /**< The raw subject data (DER). Used for quick comparison. */ - - mbedtls_x509_name issuer; /**< The parsed issuer data (named information object). */ - mbedtls_x509_name subject; /**< The parsed subject data (named information object). */ - - mbedtls_x509_time valid_from; /**< Start time of certificate validity. */ - mbedtls_x509_time valid_to; /**< End time of certificate validity. */ - - mbedtls_x509_buf pk_raw; - mbedtls_pk_context pk; /**< Container for the public key context. */ - - mbedtls_x509_buf issuer_id; /**< Optional X.509 v2/v3 issuer unique identifier. */ - mbedtls_x509_buf subject_id; /**< Optional X.509 v2/v3 subject unique identifier. */ - mbedtls_x509_buf v3_ext; /**< Optional X.509 v3 extensions. */ - mbedtls_x509_sequence subject_alt_names; /**< Optional list of raw entries of Subject Alternative Names extension (currently only dNSName and OtherName are listed). */ - - mbedtls_x509_sequence certificate_policies; /**< Optional list of certificate policies (Only anyPolicy is printed and enforced, however the rest of the policies are still listed). */ - - int ext_types; /**< Bit string containing detected and parsed extensions */ - int ca_istrue; /**< Optional Basic Constraint extension value: 1 if this certificate belongs to a CA, 0 otherwise. */ - int max_pathlen; /**< Optional Basic Constraint extension value: The maximum path length to the root certificate. Path length is 1 higher than RFC 5280 'meaning', so 1+ */ - - unsigned int key_usage; /**< Optional key usage extension value: See the values in x509.h */ - - mbedtls_x509_sequence ext_key_usage; /**< Optional list of extended key usage OIDs. */ - - unsigned char ns_cert_type; /**< Optional Netscape certificate type extension value: See the values in x509.h */ - - mbedtls_x509_buf sig; /**< Signature: hash of the tbs part signed with the private key. */ - mbedtls_md_type_t sig_md; /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ - mbedtls_pk_type_t sig_pk; /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ - void *sig_opts; /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ - - struct mbedtls_x509_crt *next; /**< Next certificate in the CA-chain. */ -} -mbedtls_x509_crt; - -/** - * From RFC 5280 section 4.2.1.6: - * OtherName ::= SEQUENCE { - * type-id OBJECT IDENTIFIER, - * value [0] EXPLICIT ANY DEFINED BY type-id } - */ -typedef struct mbedtls_x509_san_other_name -{ - /** - * The type_id is an OID as deifned in RFC 5280. - * To check the value of the type id, you should use - * \p MBEDTLS_OID_CMP with a known OID mbedtls_x509_buf. - */ - mbedtls_x509_buf type_id; /**< The type id. */ - union - { - /** - * From RFC 4108 section 5: - * HardwareModuleName ::= SEQUENCE { - * hwType OBJECT IDENTIFIER, - * hwSerialNum OCTET STRING } - */ - struct - { - mbedtls_x509_buf oid; /**< The object identifier. */ - mbedtls_x509_buf val; /**< The named value. */ - } - hardware_module_name; - } - value; -} -mbedtls_x509_san_other_name; - -/** - * A structure for holding the parsed Subject Alternative Name, according to type - */ -typedef struct mbedtls_x509_subject_alternative_name -{ - int type; /**< The SAN type, value of MBEDTLS_X509_SAN_XXX. */ - union { - mbedtls_x509_san_other_name other_name; /**< The otherName supported type. */ - mbedtls_x509_buf unstructured_name; /**< The buffer for the un constructed types. Only dnsName currently supported */ - } - san; /**< A union of the supported SAN types */ -} -mbedtls_x509_subject_alternative_name; - -/** - * Build flag from an algorithm/curve identifier (pk, md, ecp) - * Since 0 is always XXX_NONE, ignore it. - */ -#define MBEDTLS_X509_ID_FLAG( id ) ( 1 << ( (id) - 1 ) ) - -/** - * Security profile for certificate verification. - * - * All lists are bitfields, built by ORing flags from MBEDTLS_X509_ID_FLAG(). - */ -typedef struct mbedtls_x509_crt_profile -{ - uint32_t allowed_mds; /**< MDs for signatures */ - uint32_t allowed_pks; /**< PK algs for signatures */ - uint32_t allowed_curves; /**< Elliptic curves for ECDSA */ - uint32_t rsa_min_bitlen; /**< Minimum size for RSA keys */ -} -mbedtls_x509_crt_profile; - -#define MBEDTLS_X509_CRT_VERSION_1 0 -#define MBEDTLS_X509_CRT_VERSION_2 1 -#define MBEDTLS_X509_CRT_VERSION_3 2 - -#define MBEDTLS_X509_RFC5280_MAX_SERIAL_LEN 32 -#define MBEDTLS_X509_RFC5280_UTC_TIME_LEN 15 - -#if !defined( MBEDTLS_X509_MAX_FILE_PATH_LEN ) -#define MBEDTLS_X509_MAX_FILE_PATH_LEN 512 -#endif - -/** - * Container for writing a certificate (CRT) - */ -typedef struct mbedtls_x509write_cert -{ - int version; - mbedtls_mpi serial; - mbedtls_pk_context *subject_key; - mbedtls_pk_context *issuer_key; - mbedtls_asn1_named_data *subject; - mbedtls_asn1_named_data *issuer; - mbedtls_md_type_t md_alg; - char not_before[MBEDTLS_X509_RFC5280_UTC_TIME_LEN + 1]; - char not_after[MBEDTLS_X509_RFC5280_UTC_TIME_LEN + 1]; - mbedtls_asn1_named_data *extensions; -} -mbedtls_x509write_cert; - -/** - * Item in a verification chain: cert and flags for it - */ -typedef struct { - mbedtls_x509_crt *crt; - uint32_t flags; -} mbedtls_x509_crt_verify_chain_item; - -/** - * Max size of verification chain: end-entity + intermediates + trusted root - */ -#define MBEDTLS_X509_MAX_VERIFY_CHAIN_SIZE ( MBEDTLS_X509_MAX_INTERMEDIATE_CA + 2 ) - -/** - * Verification chain as built by \c mbedtls_crt_verify_chain() - */ -typedef struct -{ - mbedtls_x509_crt_verify_chain_item items[MBEDTLS_X509_MAX_VERIFY_CHAIN_SIZE]; - unsigned len; - -#if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK) - /* This stores the list of potential trusted signers obtained from - * the CA callback used for the CRT verification, if configured. - * We must track it somewhere because the callback passes its - * ownership to the caller. */ - mbedtls_x509_crt *trust_ca_cb_result; -#endif /* MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK */ -} mbedtls_x509_crt_verify_chain; - -#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE) - -/** - * \brief Context for resuming X.509 verify operations - */ -typedef struct -{ - /* for check_signature() */ - mbedtls_pk_restart_ctx pk; - - /* for find_parent_in() */ - mbedtls_x509_crt *parent; /* non-null iff parent_in in progress */ - mbedtls_x509_crt *fallback_parent; - int fallback_signature_is_good; - - /* for find_parent() */ - int parent_is_trusted; /* -1 if find_parent is not in progress */ - - /* for verify_chain() */ - enum { - x509_crt_rs_none, - x509_crt_rs_find_parent, - } in_progress; /* none if no operation is in progress */ - int self_cnt; - mbedtls_x509_crt_verify_chain ver_chain; - -} mbedtls_x509_crt_restart_ctx; - -#else /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */ - -/* Now we can declare functions that take a pointer to that */ -typedef void mbedtls_x509_crt_restart_ctx; - -#endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */ - -#if defined(MBEDTLS_X509_CRT_PARSE_C) -/** - * Default security profile. Should provide a good balance between security - * and compatibility with current deployments. - */ -extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_default; - -/** - * Expected next default profile. Recommended for new deployments. - * Currently targets a 128-bit security level, except for RSA-2048. - */ -extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_next; - -/** - * NSA Suite B profile. - */ -extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_suiteb; - -/** - * \brief Parse a single DER formatted certificate and add it - * to the end of the provided chained list. - * - * \param chain The pointer to the start of the CRT chain to attach to. - * When parsing the first CRT in a chain, this should point - * to an instance of ::mbedtls_x509_crt initialized through - * mbedtls_x509_crt_init(). - * \param buf The buffer holding the DER encoded certificate. - * \param buflen The size in Bytes of \p buf. - * - * \note This function makes an internal copy of the CRT buffer - * \p buf. In particular, \p buf may be destroyed or reused - * after this call returns. To avoid duplicating the CRT - * buffer (at the cost of stricter lifetime constraints), - * use mbedtls_x509_crt_parse_der_nocopy() instead. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_x509_crt_parse_der( mbedtls_x509_crt *chain, - const unsigned char *buf, - size_t buflen ); - -/** - * \brief The type of certificate extension callbacks. - * - * Callbacks of this type are passed to and used by the - * mbedtls_x509_crt_parse_der_with_ext_cb() routine when - * it encounters either an unsupported extension or a - * "certificate policies" extension containing any - * unsupported certificate policies. - * Future versions of the library may invoke the callback - * in other cases, if and when the need arises. - * - * \param p_ctx An opaque context passed to the callback. - * \param crt The certificate being parsed. - * \param oid The OID of the extension. - * \param critical Whether the extension is critical. - * \param p Pointer to the start of the extension value - * (the content of the OCTET STRING). - * \param end End of extension value. - * - * \note The callback must fail and return a negative error code - * if it can not parse or does not support the extension. - * When the callback fails to parse a critical extension - * mbedtls_x509_crt_parse_der_with_ext_cb() also fails. - * When the callback fails to parse a non critical extension - * mbedtls_x509_crt_parse_der_with_ext_cb() simply skips - * the extension and continues parsing. - * - * \return \c 0 on success. - * \return A negative error code on failure. - */ -typedef int (*mbedtls_x509_crt_ext_cb_t)( void *p_ctx, - mbedtls_x509_crt const *crt, - mbedtls_x509_buf const *oid, - int critical, - const unsigned char *p, - const unsigned char *end ); - -/** - * \brief Parse a single DER formatted certificate and add it - * to the end of the provided chained list. - * - * \param chain The pointer to the start of the CRT chain to attach to. - * When parsing the first CRT in a chain, this should point - * to an instance of ::mbedtls_x509_crt initialized through - * mbedtls_x509_crt_init(). - * \param buf The buffer holding the DER encoded certificate. - * \param buflen The size in Bytes of \p buf. - * \param make_copy When not zero this function makes an internal copy of the - * CRT buffer \p buf. In particular, \p buf may be destroyed - * or reused after this call returns. - * When zero this function avoids duplicating the CRT buffer - * by taking temporary ownership thereof until the CRT - * is destroyed (like mbedtls_x509_crt_parse_der_nocopy()) - * \param cb A callback invoked for every unsupported certificate - * extension. - * \param p_ctx An opaque context passed to the callback. - * - * \note This call is functionally equivalent to - * mbedtls_x509_crt_parse_der(), and/or - * mbedtls_x509_crt_parse_der_nocopy() - * but it calls the callback with every unsupported - * certificate extension and additionally the - * "certificate policies" extension if it contains any - * unsupported certificate policies. - * The callback must return a negative error code if it - * does not know how to handle such an extension. - * When the callback fails to parse a critical extension - * mbedtls_x509_crt_parse_der_with_ext_cb() also fails. - * When the callback fails to parse a non critical extension - * mbedtls_x509_crt_parse_der_with_ext_cb() simply skips - * the extension and continues parsing. - * Future versions of the library may invoke the callback - * in other cases, if and when the need arises. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_x509_crt_parse_der_with_ext_cb( mbedtls_x509_crt *chain, - const unsigned char *buf, - size_t buflen, - int make_copy, - mbedtls_x509_crt_ext_cb_t cb, - void *p_ctx ); - -/** - * \brief Parse a single DER formatted certificate and add it - * to the end of the provided chained list. This is a - * variant of mbedtls_x509_crt_parse_der() which takes - * temporary ownership of the CRT buffer until the CRT - * is destroyed. - * - * \param chain The pointer to the start of the CRT chain to attach to. - * When parsing the first CRT in a chain, this should point - * to an instance of ::mbedtls_x509_crt initialized through - * mbedtls_x509_crt_init(). - * \param buf The address of the readable buffer holding the DER encoded - * certificate to use. On success, this buffer must be - * retained and not be changed for the liftetime of the - * CRT chain \p chain, that is, until \p chain is destroyed - * through a call to mbedtls_x509_crt_free(). - * \param buflen The size in Bytes of \p buf. - * - * \note This call is functionally equivalent to - * mbedtls_x509_crt_parse_der(), but it avoids creating a - * copy of the input buffer at the cost of stronger lifetime - * constraints. This is useful in constrained environments - * where duplication of the CRT cannot be tolerated. - * - * \return \c 0 if successful. - * \return A negative error code on failure. - */ -int mbedtls_x509_crt_parse_der_nocopy( mbedtls_x509_crt *chain, - const unsigned char *buf, - size_t buflen ); - -/** - * \brief Parse one DER-encoded or one or more concatenated PEM-encoded - * certificates and add them to the chained list. - * - * For CRTs in PEM encoding, the function parses permissively: - * if at least one certificate can be parsed, the function - * returns the number of certificates for which parsing failed - * (hence \c 0 if all certificates were parsed successfully). - * If no certificate could be parsed, the function returns - * the first (negative) error encountered during parsing. - * - * PEM encoded certificates may be interleaved by other data - * such as human readable descriptions of their content, as - * long as the certificates are enclosed in the PEM specific - * '-----{BEGIN/END} CERTIFICATE-----' delimiters. - * - * \param chain The chain to which to add the parsed certificates. - * \param buf The buffer holding the certificate data in PEM or DER format. - * For certificates in PEM encoding, this may be a concatenation - * of multiple certificates; for DER encoding, the buffer must - * comprise exactly one certificate. - * \param buflen The size of \p buf, including the terminating \c NULL byte - * in case of PEM encoded data. - * - * \return \c 0 if all certificates were parsed successfully. - * \return The (positive) number of certificates that couldn't - * be parsed if parsing was partly successful (see above). - * \return A negative X509 or PEM error code otherwise. - * - */ -int mbedtls_x509_crt_parse( mbedtls_x509_crt *chain, const unsigned char *buf, size_t buflen ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Load one or more certificates and add them - * to the chained list. Parses permissively. If some - * certificates can be parsed, the result is the number - * of failed certificates it encountered. If none complete - * correctly, the first error is returned. - * - * \param chain points to the start of the chain - * \param path filename to read the certificates from - * - * \return 0 if all certificates parsed successfully, a positive number - * if partly successful or a specific X509 or PEM error code - */ -int mbedtls_x509_crt_parse_file( mbedtls_x509_crt *chain, const char *path ); - -/** - * \brief Load one or more certificate files from a path and add them - * to the chained list. Parses permissively. If some - * certificates can be parsed, the result is the number - * of failed certificates it encountered. If none complete - * correctly, the first error is returned. - * - * \param chain points to the start of the chain - * \param path directory / folder to read the certificate files from - * - * \return 0 if all certificates parsed successfully, a positive number - * if partly successful or a specific X509 or PEM error code - */ -int mbedtls_x509_crt_parse_path( mbedtls_x509_crt *chain, const char *path ); - -#endif /* MBEDTLS_FS_IO */ -/** - * \brief This function parses an item in the SubjectAlternativeNames - * extension. - * - * \param san_buf The buffer holding the raw data item of the subject - * alternative name. - * \param san The target structure to populate with the parsed presentation - * of the subject alternative name encoded in \p san_raw. - * - * \note Only "dnsName" and "otherName" of type hardware_module_name - * as defined in RFC 4180 is supported. - * - * \note This function should be called on a single raw data of - * subject alternative name. For example, after successful - * certificate parsing, one must iterate on every item in the - * \p crt->subject_alt_names sequence, and pass it to - * this function. - * - * \warning The target structure contains pointers to the raw data of the - * parsed certificate, and its lifetime is restricted by the - * lifetime of the certificate. - * - * \return \c 0 on success - * \return #MBEDTLS_ERR_X509_FEATURE_UNAVAILABLE for an unsupported - * SAN type. - * \return Another negative value for any other failure. - */ -int mbedtls_x509_parse_subject_alt_name( const mbedtls_x509_buf *san_buf, - mbedtls_x509_subject_alternative_name *san ); -/** - * \brief Returns an informational string about the - * certificate. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param prefix A line prefix - * \param crt The X509 certificate to represent - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_crt_info( char *buf, size_t size, const char *prefix, - const mbedtls_x509_crt *crt ); - -/** - * \brief Returns an informational string about the - * verification status of a certificate. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param prefix A line prefix - * \param flags Verification flags created by mbedtls_x509_crt_verify() - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_crt_verify_info( char *buf, size_t size, const char *prefix, - uint32_t flags ); - -/** - * \brief Verify a chain of certificates. - * - * The verify callback is a user-supplied callback that - * can clear / modify / add flags for a certificate. If set, - * the verification callback is called for each - * certificate in the chain (from the trust-ca down to the - * presented crt). The parameters for the callback are: - * (void *parameter, mbedtls_x509_crt *crt, int certificate_depth, - * int *flags). With the flags representing current flags for - * that specific certificate and the certificate depth from - * the bottom (Peer cert depth = 0). - * - * All flags left after returning from the callback - * are also returned to the application. The function should - * return 0 for anything (including invalid certificates) - * other than fatal error, as a non-zero return code - * immediately aborts the verification process. For fatal - * errors, a specific error code should be used (different - * from MBEDTLS_ERR_X509_CERT_VERIFY_FAILED which should not - * be returned at this point), or MBEDTLS_ERR_X509_FATAL_ERROR - * can be used if no better code is available. - * - * \note In case verification failed, the results can be displayed - * using \c mbedtls_x509_crt_verify_info() - * - * \note Same as \c mbedtls_x509_crt_verify_with_profile() with the - * default security profile. - * - * \note It is your responsibility to provide up-to-date CRLs for - * all trusted CAs. If no CRL is provided for the CA that was - * used to sign the certificate, CRL verification is skipped - * silently, that is *without* setting any flag. - * - * \note The \c trust_ca list can contain two types of certificates: - * (1) those of trusted root CAs, so that certificates - * chaining up to those CAs will be trusted, and (2) - * self-signed end-entity certificates to be trusted (for - * specific peers you know) - in that case, the self-signed - * certificate doesn't need to have the CA bit set. - * - * \param crt The certificate chain to be verified. - * \param trust_ca The list of trusted CAs. - * \param ca_crl The list of CRLs for trusted CAs. - * \param cn The expected Common Name. This may be \c NULL if the - * CN need not be verified. - * \param flags The address at which to store the result of the verification. - * If the verification couldn't be completed, the flag value is - * set to (uint32_t) -1. - * \param f_vrfy The verification callback to use. See the documentation - * of mbedtls_x509_crt_verify() for more information. - * \param p_vrfy The context to be passed to \p f_vrfy. - * - * \return \c 0 if the chain is valid with respect to the - * passed CN, CAs, CRLs and security profile. - * \return #MBEDTLS_ERR_X509_CERT_VERIFY_FAILED in case the - * certificate chain verification failed. In this case, - * \c *flags will have one or more - * \c MBEDTLS_X509_BADCERT_XXX or \c MBEDTLS_X509_BADCRL_XXX - * flags set. - * \return Another negative error code in case of a fatal error - * encountered during the verification process. - */ -int mbedtls_x509_crt_verify( mbedtls_x509_crt *crt, - mbedtls_x509_crt *trust_ca, - mbedtls_x509_crl *ca_crl, - const char *cn, uint32_t *flags, - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), - void *p_vrfy ); - -/** - * \brief Verify a chain of certificates with respect to - * a configurable security profile. - * - * \note Same as \c mbedtls_x509_crt_verify(), but with explicit - * security profile. - * - * \note The restrictions on keys (RSA minimum size, allowed curves - * for ECDSA) apply to all certificates: trusted root, - * intermediate CAs if any, and end entity certificate. - * - * \param crt The certificate chain to be verified. - * \param trust_ca The list of trusted CAs. - * \param ca_crl The list of CRLs for trusted CAs. - * \param profile The security profile to use for the verification. - * \param cn The expected Common Name. This may be \c NULL if the - * CN need not be verified. - * \param flags The address at which to store the result of the verification. - * If the verification couldn't be completed, the flag value is - * set to (uint32_t) -1. - * \param f_vrfy The verification callback to use. See the documentation - * of mbedtls_x509_crt_verify() for more information. - * \param p_vrfy The context to be passed to \p f_vrfy. - * - * \return \c 0 if the chain is valid with respect to the - * passed CN, CAs, CRLs and security profile. - * \return #MBEDTLS_ERR_X509_CERT_VERIFY_FAILED in case the - * certificate chain verification failed. In this case, - * \c *flags will have one or more - * \c MBEDTLS_X509_BADCERT_XXX or \c MBEDTLS_X509_BADCRL_XXX - * flags set. - * \return Another negative error code in case of a fatal error - * encountered during the verification process. - */ -int mbedtls_x509_crt_verify_with_profile( mbedtls_x509_crt *crt, - mbedtls_x509_crt *trust_ca, - mbedtls_x509_crl *ca_crl, - const mbedtls_x509_crt_profile *profile, - const char *cn, uint32_t *flags, - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), - void *p_vrfy ); - -/** - * \brief Restartable version of \c mbedtls_crt_verify_with_profile() - * - * \note Performs the same job as \c mbedtls_crt_verify_with_profile() - * but can return early and restart according to the limit - * set with \c mbedtls_ecp_set_max_ops() to reduce blocking. - * - * \param crt The certificate chain to be verified. - * \param trust_ca The list of trusted CAs. - * \param ca_crl The list of CRLs for trusted CAs. - * \param profile The security profile to use for the verification. - * \param cn The expected Common Name. This may be \c NULL if the - * CN need not be verified. - * \param flags The address at which to store the result of the verification. - * If the verification couldn't be completed, the flag value is - * set to (uint32_t) -1. - * \param f_vrfy The verification callback to use. See the documentation - * of mbedtls_x509_crt_verify() for more information. - * \param p_vrfy The context to be passed to \p f_vrfy. - * \param rs_ctx The restart context to use. This may be set to \c NULL - * to disable restartable ECC. - * - * \return See \c mbedtls_crt_verify_with_profile(), or - * \return #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of - * operations was reached: see \c mbedtls_ecp_set_max_ops(). - */ -int mbedtls_x509_crt_verify_restartable( mbedtls_x509_crt *crt, - mbedtls_x509_crt *trust_ca, - mbedtls_x509_crl *ca_crl, - const mbedtls_x509_crt_profile *profile, - const char *cn, uint32_t *flags, - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), - void *p_vrfy, - mbedtls_x509_crt_restart_ctx *rs_ctx ); - -/** - * \brief The type of trusted certificate callbacks. - * - * Callbacks of this type are passed to and used by the CRT - * verification routine mbedtls_x509_crt_verify_with_ca_cb() - * when looking for trusted signers of a given certificate. - * - * On success, the callback returns a list of trusted - * certificates to be considered as potential signers - * for the input certificate. - * - * \param p_ctx An opaque context passed to the callback. - * \param child The certificate for which to search a potential signer. - * This will point to a readable certificate. - * \param candidate_cas The address at which to store the address of the first - * entry in the generated linked list of candidate signers. - * This will not be \c NULL. - * - * \note The callback must only return a non-zero value on a - * fatal error. If, in contrast, the search for a potential - * signer completes without a single candidate, the - * callback must return \c 0 and set \c *candidate_cas - * to \c NULL. - * - * \return \c 0 on success. In this case, \c *candidate_cas points - * to a heap-allocated linked list of instances of - * ::mbedtls_x509_crt, and ownership of this list is passed - * to the caller. - * \return A negative error code on failure. - */ -typedef int (*mbedtls_x509_crt_ca_cb_t)( void *p_ctx, - mbedtls_x509_crt const *child, - mbedtls_x509_crt **candidate_cas ); - -#if defined(MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK) -/** - * \brief Version of \c mbedtls_x509_crt_verify_with_profile() which - * uses a callback to acquire the list of trusted CA - * certificates. - * - * \param crt The certificate chain to be verified. - * \param f_ca_cb The callback to be used to query for potential signers - * of a given child certificate. See the documentation of - * ::mbedtls_x509_crt_ca_cb_t for more information. - * \param p_ca_cb The opaque context to be passed to \p f_ca_cb. - * \param profile The security profile for the verification. - * \param cn The expected Common Name. This may be \c NULL if the - * CN need not be verified. - * \param flags The address at which to store the result of the verification. - * If the verification couldn't be completed, the flag value is - * set to (uint32_t) -1. - * \param f_vrfy The verification callback to use. See the documentation - * of mbedtls_x509_crt_verify() for more information. - * \param p_vrfy The context to be passed to \p f_vrfy. - * - * \return See \c mbedtls_crt_verify_with_profile(). - */ -int mbedtls_x509_crt_verify_with_ca_cb( mbedtls_x509_crt *crt, - mbedtls_x509_crt_ca_cb_t f_ca_cb, - void *p_ca_cb, - const mbedtls_x509_crt_profile *profile, - const char *cn, uint32_t *flags, - int (*f_vrfy)(void *, mbedtls_x509_crt *, int, uint32_t *), - void *p_vrfy ); - -#endif /* MBEDTLS_X509_TRUSTED_CERTIFICATE_CALLBACK */ - -#if defined(MBEDTLS_X509_CHECK_KEY_USAGE) -/** - * \brief Check usage of certificate against keyUsage extension. - * - * \param crt Leaf certificate used. - * \param usage Intended usage(s) (eg MBEDTLS_X509_KU_KEY_ENCIPHERMENT - * before using the certificate to perform an RSA key - * exchange). - * - * \note Except for decipherOnly and encipherOnly, a bit set in the - * usage argument means this bit MUST be set in the - * certificate. For decipherOnly and encipherOnly, it means - * that bit MAY be set. - * - * \return 0 is these uses of the certificate are allowed, - * MBEDTLS_ERR_X509_BAD_INPUT_DATA if the keyUsage extension - * is present but does not match the usage argument. - * - * \note You should only call this function on leaf certificates, on - * (intermediate) CAs the keyUsage extension is automatically - * checked by \c mbedtls_x509_crt_verify(). - */ -int mbedtls_x509_crt_check_key_usage( const mbedtls_x509_crt *crt, - unsigned int usage ); -#endif /* MBEDTLS_X509_CHECK_KEY_USAGE) */ - -#if defined(MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE) -/** - * \brief Check usage of certificate against extendedKeyUsage. - * - * \param crt Leaf certificate used. - * \param usage_oid Intended usage (eg MBEDTLS_OID_SERVER_AUTH or - * MBEDTLS_OID_CLIENT_AUTH). - * \param usage_len Length of usage_oid (eg given by MBEDTLS_OID_SIZE()). - * - * \return 0 if this use of the certificate is allowed, - * MBEDTLS_ERR_X509_BAD_INPUT_DATA if not. - * - * \note Usually only makes sense on leaf certificates. - */ -int mbedtls_x509_crt_check_extended_key_usage( const mbedtls_x509_crt *crt, - const char *usage_oid, - size_t usage_len ); -#endif /* MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE */ - -#if defined(MBEDTLS_X509_CRL_PARSE_C) -/** - * \brief Verify the certificate revocation status - * - * \param crt a certificate to be verified - * \param crl the CRL to verify against - * - * \return 1 if the certificate is revoked, 0 otherwise - * - */ -int mbedtls_x509_crt_is_revoked( const mbedtls_x509_crt *crt, const mbedtls_x509_crl *crl ); -#endif /* MBEDTLS_X509_CRL_PARSE_C */ - -/** - * \brief Initialize a certificate (chain) - * - * \param crt Certificate chain to initialize - */ -void mbedtls_x509_crt_init( mbedtls_x509_crt *crt ); - -/** - * \brief Unallocate all certificate data - * - * \param crt Certificate chain to free - */ -void mbedtls_x509_crt_free( mbedtls_x509_crt *crt ); - -#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE) -/** - * \brief Initialize a restart context - */ -void mbedtls_x509_crt_restart_init( mbedtls_x509_crt_restart_ctx *ctx ); - -/** - * \brief Free the components of a restart context - */ -void mbedtls_x509_crt_restart_free( mbedtls_x509_crt_restart_ctx *ctx ); -#endif /* MBEDTLS_ECDSA_C && MBEDTLS_ECP_RESTARTABLE */ -#endif /* MBEDTLS_X509_CRT_PARSE_C */ - -/* \} name */ -/* \} addtogroup x509_module */ - -#if defined(MBEDTLS_X509_CRT_WRITE_C) -/** - * \brief Initialize a CRT writing context - * - * \param ctx CRT context to initialize - */ -void mbedtls_x509write_crt_init( mbedtls_x509write_cert *ctx ); - -/** - * \brief Set the verion for a Certificate - * Default: MBEDTLS_X509_CRT_VERSION_3 - * - * \param ctx CRT context to use - * \param version version to set (MBEDTLS_X509_CRT_VERSION_1, MBEDTLS_X509_CRT_VERSION_2 or - * MBEDTLS_X509_CRT_VERSION_3) - */ -void mbedtls_x509write_crt_set_version( mbedtls_x509write_cert *ctx, int version ); - -/** - * \brief Set the serial number for a Certificate. - * - * \param ctx CRT context to use - * \param serial serial number to set - * - * \return 0 if successful - */ -int mbedtls_x509write_crt_set_serial( mbedtls_x509write_cert *ctx, const mbedtls_mpi *serial ); - -/** - * \brief Set the validity period for a Certificate - * Timestamps should be in string format for UTC timezone - * i.e. "YYYYMMDDhhmmss" - * e.g. "20131231235959" for December 31st 2013 - * at 23:59:59 - * - * \param ctx CRT context to use - * \param not_before not_before timestamp - * \param not_after not_after timestamp - * - * \return 0 if timestamp was parsed successfully, or - * a specific error code - */ -int mbedtls_x509write_crt_set_validity( mbedtls_x509write_cert *ctx, const char *not_before, - const char *not_after ); - -/** - * \brief Set the issuer name for a Certificate - * Issuer names should contain a comma-separated list - * of OID types and values: - * e.g. "C=UK,O=ARM,CN=mbed TLS CA" - * - * \param ctx CRT context to use - * \param issuer_name issuer name to set - * - * \return 0 if issuer name was parsed successfully, or - * a specific error code - */ -int mbedtls_x509write_crt_set_issuer_name( mbedtls_x509write_cert *ctx, - const char *issuer_name ); - -/** - * \brief Set the subject name for a Certificate - * Subject names should contain a comma-separated list - * of OID types and values: - * e.g. "C=UK,O=ARM,CN=mbed TLS Server 1" - * - * \param ctx CRT context to use - * \param subject_name subject name to set - * - * \return 0 if subject name was parsed successfully, or - * a specific error code - */ -int mbedtls_x509write_crt_set_subject_name( mbedtls_x509write_cert *ctx, - const char *subject_name ); - -/** - * \brief Set the subject public key for the certificate - * - * \param ctx CRT context to use - * \param key public key to include - */ -void mbedtls_x509write_crt_set_subject_key( mbedtls_x509write_cert *ctx, mbedtls_pk_context *key ); - -/** - * \brief Set the issuer key used for signing the certificate - * - * \param ctx CRT context to use - * \param key private key to sign with - */ -void mbedtls_x509write_crt_set_issuer_key( mbedtls_x509write_cert *ctx, mbedtls_pk_context *key ); - -/** - * \brief Set the MD algorithm to use for the signature - * (e.g. MBEDTLS_MD_SHA1) - * - * \param ctx CRT context to use - * \param md_alg MD algorithm to use - */ -void mbedtls_x509write_crt_set_md_alg( mbedtls_x509write_cert *ctx, mbedtls_md_type_t md_alg ); - -/** - * \brief Generic function to add to or replace an extension in the - * CRT - * - * \param ctx CRT context to use - * \param oid OID of the extension - * \param oid_len length of the OID - * \param critical if the extension is critical (per the RFC's definition) - * \param val value of the extension OCTET STRING - * \param val_len length of the value data - * - * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_extension( mbedtls_x509write_cert *ctx, - const char *oid, size_t oid_len, - int critical, - const unsigned char *val, size_t val_len ); - -/** - * \brief Set the basicConstraints extension for a CRT - * - * \param ctx CRT context to use - * \param is_ca is this a CA certificate - * \param max_pathlen maximum length of certificate chains below this - * certificate (only for CA certificates, -1 is - * inlimited) - * - * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_basic_constraints( mbedtls_x509write_cert *ctx, - int is_ca, int max_pathlen ); - -#if defined(MBEDTLS_SHA1_C) -/** - * \brief Set the subjectKeyIdentifier extension for a CRT - * Requires that mbedtls_x509write_crt_set_subject_key() has been - * called before - * - * \param ctx CRT context to use - * - * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_subject_key_identifier( mbedtls_x509write_cert *ctx ); - -/** - * \brief Set the authorityKeyIdentifier extension for a CRT - * Requires that mbedtls_x509write_crt_set_issuer_key() has been - * called before - * - * \param ctx CRT context to use - * - * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_authority_key_identifier( mbedtls_x509write_cert *ctx ); -#endif /* MBEDTLS_SHA1_C */ - -/** - * \brief Set the Key Usage Extension flags - * (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN) - * - * \param ctx CRT context to use - * \param key_usage key usage flags to set - * - * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_key_usage( mbedtls_x509write_cert *ctx, - unsigned int key_usage ); - -/** - * \brief Set the Netscape Cert Type flags - * (e.g. MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT | MBEDTLS_X509_NS_CERT_TYPE_EMAIL) - * - * \param ctx CRT context to use - * \param ns_cert_type Netscape Cert Type flags to set - * - * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_crt_set_ns_cert_type( mbedtls_x509write_cert *ctx, - unsigned char ns_cert_type ); - -/** - * \brief Free the contents of a CRT write context - * - * \param ctx CRT context to free - */ -void mbedtls_x509write_crt_free( mbedtls_x509write_cert *ctx ); - -/** - * \brief Write a built up certificate to a X509 DER structure - * Note: data is written at the end of the buffer! Use the - * return value to determine where you should start - * using the buffer - * - * \param ctx certificate to write away - * \param buf buffer to write to - * \param size size of the buffer - * \param f_rng RNG function (for signature, see note) - * \param p_rng RNG parameter - * - * \return length of data written if successful, or a specific - * error code - * - * \note f_rng may be NULL if RSA is used for signature and the - * signature is made offline (otherwise f_rng is desirable - * for countermeasures against timing attacks). - * ECDSA signatures always require a non-NULL f_rng. - */ -int mbedtls_x509write_crt_der( mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -#if defined(MBEDTLS_PEM_WRITE_C) -/** - * \brief Write a built up certificate to a X509 PEM string - * - * \param ctx certificate to write away - * \param buf buffer to write to - * \param size size of the buffer - * \param f_rng RNG function (for signature, see note) - * \param p_rng RNG parameter - * - * \return 0 if successful, or a specific error code - * - * \note f_rng may be NULL if RSA is used for signature and the - * signature is made offline (otherwise f_rng is desirable - * for countermeasures against timing attacks). - * ECDSA signatures always require a non-NULL f_rng. - */ -int mbedtls_x509write_crt_pem( mbedtls_x509write_cert *ctx, unsigned char *buf, size_t size, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -#endif /* MBEDTLS_PEM_WRITE_C */ -#endif /* MBEDTLS_X509_CRT_WRITE_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_x509_crt.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_csr.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_csr.h deleted file mode 100644 index 25b23bbc0..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/x509_csr.h +++ /dev/null @@ -1,307 +0,0 @@ -/** - * \file x509_csr.h - * - * \brief X.509 certificate signing request parsing and writing - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_X509_CSR_H -#define MBEDTLS_X509_CSR_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include "mbedtls/x509.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * \addtogroup x509_module - * \{ */ - -/** - * \name Structures and functions for X.509 Certificate Signing Requests (CSR) - * \{ - */ - -/** - * Certificate Signing Request (CSR) structure. - */ -typedef struct mbedtls_x509_csr -{ - mbedtls_x509_buf raw; /**< The raw CSR data (DER). */ - mbedtls_x509_buf cri; /**< The raw CertificateRequestInfo body (DER). */ - - int version; /**< CSR version (1=v1). */ - - mbedtls_x509_buf subject_raw; /**< The raw subject data (DER). */ - mbedtls_x509_name subject; /**< The parsed subject data (named information object). */ - - mbedtls_pk_context pk; /**< Container for the public key context. */ - - mbedtls_x509_buf sig_oid; - mbedtls_x509_buf sig; - mbedtls_md_type_t sig_md; /**< Internal representation of the MD algorithm of the signature algorithm, e.g. MBEDTLS_MD_SHA256 */ - mbedtls_pk_type_t sig_pk; /**< Internal representation of the Public Key algorithm of the signature algorithm, e.g. MBEDTLS_PK_RSA */ - void *sig_opts; /**< Signature options to be passed to mbedtls_pk_verify_ext(), e.g. for RSASSA-PSS */ -} -mbedtls_x509_csr; - -/** - * Container for writing a CSR - */ -typedef struct mbedtls_x509write_csr -{ - mbedtls_pk_context *key; - mbedtls_asn1_named_data *subject; - mbedtls_md_type_t md_alg; - mbedtls_asn1_named_data *extensions; -} -mbedtls_x509write_csr; - -#if defined(MBEDTLS_X509_CSR_PARSE_C) -/** - * \brief Load a Certificate Signing Request (CSR) in DER format - * - * \note CSR attributes (if any) are currently silently ignored. - * - * \param csr CSR context to fill - * \param buf buffer holding the CRL data - * \param buflen size of the buffer - * - * \return 0 if successful, or a specific X509 error code - */ -int mbedtls_x509_csr_parse_der( mbedtls_x509_csr *csr, - const unsigned char *buf, size_t buflen ); - -/** - * \brief Load a Certificate Signing Request (CSR), DER or PEM format - * - * \note See notes for \c mbedtls_x509_csr_parse_der() - * - * \param csr CSR context to fill - * \param buf buffer holding the CRL data - * \param buflen size of the buffer - * (including the terminating null byte for PEM data) - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_csr_parse( mbedtls_x509_csr *csr, const unsigned char *buf, size_t buflen ); - -#if defined(MBEDTLS_FS_IO) -/** - * \brief Load a Certificate Signing Request (CSR) - * - * \note See notes for \c mbedtls_x509_csr_parse() - * - * \param csr CSR context to fill - * \param path filename to read the CSR from - * - * \return 0 if successful, or a specific X509 or PEM error code - */ -int mbedtls_x509_csr_parse_file( mbedtls_x509_csr *csr, const char *path ); -#endif /* MBEDTLS_FS_IO */ - -/** - * \brief Returns an informational string about the - * CSR. - * - * \param buf Buffer to write to - * \param size Maximum size of buffer - * \param prefix A line prefix - * \param csr The X509 CSR to represent - * - * \return The length of the string written (not including the - * terminated nul byte), or a negative error code. - */ -int mbedtls_x509_csr_info( char *buf, size_t size, const char *prefix, - const mbedtls_x509_csr *csr ); - -/** - * \brief Initialize a CSR - * - * \param csr CSR to initialize - */ -void mbedtls_x509_csr_init( mbedtls_x509_csr *csr ); - -/** - * \brief Unallocate all CSR data - * - * \param csr CSR to free - */ -void mbedtls_x509_csr_free( mbedtls_x509_csr *csr ); -#endif /* MBEDTLS_X509_CSR_PARSE_C */ - -/* \} name */ -/* \} addtogroup x509_module */ - -#if defined(MBEDTLS_X509_CSR_WRITE_C) -/** - * \brief Initialize a CSR context - * - * \param ctx CSR context to initialize - */ -void mbedtls_x509write_csr_init( mbedtls_x509write_csr *ctx ); - -/** - * \brief Set the subject name for a CSR - * Subject names should contain a comma-separated list - * of OID types and values: - * e.g. "C=UK,O=ARM,CN=mbed TLS Server 1" - * - * \param ctx CSR context to use - * \param subject_name subject name to set - * - * \return 0 if subject name was parsed successfully, or - * a specific error code - */ -int mbedtls_x509write_csr_set_subject_name( mbedtls_x509write_csr *ctx, - const char *subject_name ); - -/** - * \brief Set the key for a CSR (public key will be included, - * private key used to sign the CSR when writing it) - * - * \param ctx CSR context to use - * \param key Asymetric key to include - */ -void mbedtls_x509write_csr_set_key( mbedtls_x509write_csr *ctx, mbedtls_pk_context *key ); - -/** - * \brief Set the MD algorithm to use for the signature - * (e.g. MBEDTLS_MD_SHA1) - * - * \param ctx CSR context to use - * \param md_alg MD algorithm to use - */ -void mbedtls_x509write_csr_set_md_alg( mbedtls_x509write_csr *ctx, mbedtls_md_type_t md_alg ); - -/** - * \brief Set the Key Usage Extension flags - * (e.g. MBEDTLS_X509_KU_DIGITAL_SIGNATURE | MBEDTLS_X509_KU_KEY_CERT_SIGN) - * - * \param ctx CSR context to use - * \param key_usage key usage flags to set - * - * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED - * - * \note The decipherOnly flag from the Key Usage - * extension is represented by bit 8 (i.e. - * 0x8000), which cannot typically be represented - * in an unsigned char. Therefore, the flag - * decipherOnly (i.e. - * #MBEDTLS_X509_KU_DECIPHER_ONLY) cannot be set using this - * function. - */ -int mbedtls_x509write_csr_set_key_usage( mbedtls_x509write_csr *ctx, unsigned char key_usage ); - -/** - * \brief Set the Netscape Cert Type flags - * (e.g. MBEDTLS_X509_NS_CERT_TYPE_SSL_CLIENT | MBEDTLS_X509_NS_CERT_TYPE_EMAIL) - * - * \param ctx CSR context to use - * \param ns_cert_type Netscape Cert Type flags to set - * - * \return 0 if successful, or MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_csr_set_ns_cert_type( mbedtls_x509write_csr *ctx, - unsigned char ns_cert_type ); - -/** - * \brief Generic function to add to or replace an extension in the - * CSR - * - * \param ctx CSR context to use - * \param oid OID of the extension - * \param oid_len length of the OID - * \param val value of the extension OCTET STRING - * \param val_len length of the value data - * - * \return 0 if successful, or a MBEDTLS_ERR_X509_ALLOC_FAILED - */ -int mbedtls_x509write_csr_set_extension( mbedtls_x509write_csr *ctx, - const char *oid, size_t oid_len, - const unsigned char *val, size_t val_len ); - -/** - * \brief Free the contents of a CSR context - * - * \param ctx CSR context to free - */ -void mbedtls_x509write_csr_free( mbedtls_x509write_csr *ctx ); - -/** - * \brief Write a CSR (Certificate Signing Request) to a - * DER structure - * Note: data is written at the end of the buffer! Use the - * return value to determine where you should start - * using the buffer - * - * \param ctx CSR to write away - * \param buf buffer to write to - * \param size size of the buffer - * \param f_rng RNG function (for signature, see note) - * \param p_rng RNG parameter - * - * \return length of data written if successful, or a specific - * error code - * - * \note f_rng may be NULL if RSA is used for signature and the - * signature is made offline (otherwise f_rng is desirable - * for countermeasures against timing attacks). - * ECDSA signatures always require a non-NULL f_rng. - */ -int mbedtls_x509write_csr_der( mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); - -#if defined(MBEDTLS_PEM_WRITE_C) -/** - * \brief Write a CSR (Certificate Signing Request) to a - * PEM string - * - * \param ctx CSR to write away - * \param buf buffer to write to - * \param size size of the buffer - * \param f_rng RNG function (for signature, see note) - * \param p_rng RNG parameter - * - * \return 0 if successful, or a specific error code - * - * \note f_rng may be NULL if RSA is used for signature and the - * signature is made offline (otherwise f_rng is desirable - * for countermeasures against timing attacks). - * ECDSA signatures always require a non-NULL f_rng. - */ -int mbedtls_x509write_csr_pem( mbedtls_x509write_csr *ctx, unsigned char *buf, size_t size, - int (*f_rng)(void *, unsigned char *, size_t), - void *p_rng ); -#endif /* MBEDTLS_PEM_WRITE_C */ -#endif /* MBEDTLS_X509_CSR_WRITE_C */ - -#ifdef __cplusplus -} -#endif - -#endif /* mbedtls_x509_csr.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/xtea.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/xtea.h deleted file mode 100644 index 2dc0afc73..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/mbedtls/xtea.h +++ /dev/null @@ -1,139 +0,0 @@ -/** - * \file xtea.h - * - * \brief XTEA block cipher (32-bit) - */ -/* - * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * This file is part of mbed TLS (https://tls.mbed.org) - */ -#ifndef MBEDTLS_XTEA_H -#define MBEDTLS_XTEA_H - -#if !defined(MBEDTLS_CONFIG_FILE) -#include "mbedtls/config.h" -#else -#include MBEDTLS_CONFIG_FILE -#endif - -#include -#include - -#define MBEDTLS_XTEA_ENCRYPT 1 -#define MBEDTLS_XTEA_DECRYPT 0 - -#define MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH -0x0028 /**< The data input has an invalid length. */ - -/* MBEDTLS_ERR_XTEA_HW_ACCEL_FAILED is deprecated and should not be used. */ -#define MBEDTLS_ERR_XTEA_HW_ACCEL_FAILED -0x0029 /**< XTEA hardware accelerator failed. */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined(MBEDTLS_XTEA_ALT) -// Regular implementation -// - -/** - * \brief XTEA context structure - */ -typedef struct mbedtls_xtea_context -{ - uint32_t k[4]; /*!< key */ -} -mbedtls_xtea_context; - -#else /* MBEDTLS_XTEA_ALT */ -#include "xtea_alt.h" -#endif /* MBEDTLS_XTEA_ALT */ - -/** - * \brief Initialize XTEA context - * - * \param ctx XTEA context to be initialized - */ -void mbedtls_xtea_init( mbedtls_xtea_context *ctx ); - -/** - * \brief Clear XTEA context - * - * \param ctx XTEA context to be cleared - */ -void mbedtls_xtea_free( mbedtls_xtea_context *ctx ); - -/** - * \brief XTEA key schedule - * - * \param ctx XTEA context to be initialized - * \param key the secret key - */ -void mbedtls_xtea_setup( mbedtls_xtea_context *ctx, const unsigned char key[16] ); - -/** - * \brief XTEA cipher function - * - * \param ctx XTEA context - * \param mode MBEDTLS_XTEA_ENCRYPT or MBEDTLS_XTEA_DECRYPT - * \param input 8-byte input block - * \param output 8-byte output block - * - * \return 0 if successful - */ -int mbedtls_xtea_crypt_ecb( mbedtls_xtea_context *ctx, - int mode, - const unsigned char input[8], - unsigned char output[8] ); - -#if defined(MBEDTLS_CIPHER_MODE_CBC) -/** - * \brief XTEA CBC cipher function - * - * \param ctx XTEA context - * \param mode MBEDTLS_XTEA_ENCRYPT or MBEDTLS_XTEA_DECRYPT - * \param length the length of input, multiple of 8 - * \param iv initialization vector for CBC mode - * \param input input block - * \param output output block - * - * \return 0 if successful, - * MBEDTLS_ERR_XTEA_INVALID_INPUT_LENGTH if the length % 8 != 0 - */ -int mbedtls_xtea_crypt_cbc( mbedtls_xtea_context *ctx, - int mode, - size_t length, - unsigned char iv[8], - const unsigned char *input, - unsigned char *output); -#endif /* MBEDTLS_CIPHER_MODE_CBC */ - -#if defined(MBEDTLS_SELF_TEST) - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_xtea_self_test( int verbose ); - -#endif /* MBEDTLS_SELF_TEST */ - -#ifdef __cplusplus -} -#endif - -#endif /* xtea.h */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/include/software-only-threading/threading_alt.h b/third_party/NordicSemiconductor/libraries/nrf_security/include/software-only-threading/threading_alt.h deleted file mode 100644 index def50ba4a..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/include/software-only-threading/threading_alt.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef THREADING_ALT_H_ -#define THREADING_ALT_H_ - -#ifdef MBEDTLS_THREADING_MUTEX_DEF -#include MBEDTLS_THREADING_MUTEX_DEF -#else -typedef void * mbedtls_threading_mutex_t; -#endif // MBEDTLS_THREADING_MUTEX_DEF - -#endif // THREADING_ALT_H_ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_cc3xx.a b/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_cc3xx.a deleted file mode 100644 index 433609813c5a7c860d0a40eeeb94843577300a10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 438916 zcmeFa3wTu3xi`M%k}CmYK#ho)0BQt_bjGXdKEzvrCi z`*%OtdG~u+?|RqmUGG|Z%}oAf;aGL;6`2$A+*i?*!YM_?7f+fzB`>c~vYh|(@`{Ql zUknzm%1j}AzZPQZj)Cve_l4j+XOa-}^VGelSqR=sm!9~(VYd*xtB1Mox*j3SI|e-i z-M8E>#Q(tCmsKfzUwC2QJ2Xr9s&^;98y^wAzvo`FPWX7=1>Glme}9?q4Rr5B^Y41d zzJJj#e7s*qn%5?&`yJ%>0q$e#PwMucS}z8?M?56_=3SI4{JbySY~Qn&3BP$)>=%CC z*HpOgy7j_u-m8$8^Zx2S;lCSv^L`L%|8LySKPmiw%l+mK;pcszEcyMHM?}Ck%)STj z69MziEfE3pK6kYU@V;<|2u%Ey2wYw!0yDFc-{CPLknH}-iz2YDHSvA``gs4~33a!B zCISQ9``;3Qo~V6)io8y62eX7oxbvbScy6Ejo;*who%hTKM38s+yCS&wGj(5IE`pVh zsJr$V5%k_Sf$zLquNT2}St9tako~uM5&Yf=5&Y51BG`Vb2>$p&5q$P7b-xOHp!>~x zMKIa@PK5}b=>8~I1W$0M42_DU_c>)E#k|LLi4^aBS-nW%Jum3Kmu88SWcPL3M9P2D zojNpK40w<16R88;F^$npM{ zZR)fhzY0L8Ek=Tsp=GdHwY0j*Mu){cDwtdRp ztHX88a~qo@u~)&}6^S>;nr?QI z%A2ZJI`JzTVT?(Ut+*t-Dzc!dCgP}G7kx={xVa^+b+|c^`bf2`vogEu;L+7Iz-QJ+ z!ZE9DN>vw2Mqj*e4)XzPK{&qBN}*{9O$j*{jjdkS*c^&fM?))O(NJAYsJSUr)6@{I zYXl-1svN9sZi%gmgzD?!%`UP|mOxkHb&boLLd#=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vYBLI<~LbH+W4AE&d_$Oo3(7szmrEwK(P8 z)YgzRF7Gt10d1_~(euDfpv)N`KnonmhfJ6q9wS){>b0)bFo+NuwM zZ^ak*{78{08XYhYX5S^C1(C%JNk=4_Y7W$q&czhV&IYYx zNF}qC^uc^JFY!@y+!!lwlbs2jQ&6VvR9&w2gaV3vynxk=2i&CKU4%HJ?I{RTR^W#S z@q+U(;SG+%{cD7@GYFqi@LLN09pNg+`L2SmD!3GSuAl<@vk4(YBVi@>%n@Sq+)U{A z0^GfNgb)W;jzFLCOg8mwL6zgYOn8&yTqH!gxzL{l>+o$tLX=~Ng1Glv-qdbJ`9p|qJQI3-eo*|_C3NFHy0Pc+b;jVOufT7^;_r{QLcn(-Q zbYtPTKM!WOQzbBrLj)9aOaNzk(xJ;Z*C`xP!j*9If#FC?w*(LAFGojtm?n&ej{J(G zSNzxVl>#&6dl84zSPaU?YS!|tg`fOLPgezg9nvfQGmg)CJdiCZ0`c!r&_Rv(jx=;E uo-PCNmys{JgYPsQp)La>Uq-?n2!`PyWTAYNmt`>ddGAGE)`diz=J!8PFu6AX diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_oberon.a b/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedcrypto_oberon.a deleted file mode 100644 index ea5c799ca19bb9436803f37960d188b01b222ba1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 249424 zcmeFa3wTu3xi`KqbI)WlBmokLFiE&(LYO2FK~ovRFj7%L!K#=xmmxUemXJgZ;E@TS zqKFMl)Lg&|c-jOkpglcRv<=;2d8$Bh#BG!Mr@b|J@8n0zWR%=(z)Da?5=F;w(&e6q0e zE{<2jSHc{x4LhFTcr~;;IR0wFp>~cRExa7y_|d}2a*qFjD>0l~!trW&{|_AhHwc2E zoco)E(*2z9w+J*B=G!WZ7=#H$J3Oiui3!fhzm9hYLmDnBP`Lv<@BYJ-0U zCngIGr#O*9i|+rM5O|OiDLjhuQg}g14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Revgw`6?u%wg-tZGBQ7*Z26PgrCH>ET}qg zHuY%JnNg;upU+!1JaW&e!U>Ciw`l&mO&8u-HuWjj%{@~#t-N;Q!?_1a-(53i#ge7l z$7U4&|JYyZzbldUDC!w)x>gSjZNO%3WrHGiND|)V*H*bSK1AZHeIe5RM`~ANqoju8 z^|T>UI^_8d`?YDk%k)P&WW3X_P1O$CpeY?Pe%Y^0c>O32b9)c_wH1U)o!F@=_v)}~ zGYVC5F9v56YLjG0`b&E`r{kP}(~6Vug(#JS@KreP!WoN`aQ}U%gg=JUiE|qkA-o3l zZq$|aeu;Jnw8|VQ-lbbS4n=^hQKxc?{2!6_Wha=KiWiYvM}}_l?eX-APy#Mpr&g>iw(qd4NytB zP9^0um8&q;garJ8N=h2Un%Yx&nMWo1H&b~BWB;HM+$gL?Wh|B8XY%$5aH)L}IbpJ4 z&oXksgta26ggsNK#5{|r1pa+0G3T>XV$8SgFvl+Yq@Z2qo>F{1TMB^|Ucoo+D;q!wd!iHx=JJ{qsbN!&YeQd@_Uj&pu$-yn?6g*dTh84Bq*4&J}Af4vfWzaLNrp`^L! mpwiDA=EHnB=%9N%-7-m+NSvgd;w!2wYbs-Flu6K5s{adDAD_Aa diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a b/third_party/NordicSemiconductor/libraries/nrf_security/lib/libmbedtls_base_vanilla.a deleted file mode 100644 index 0b093e30b59cdea2456b7680d810beda26b066cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 582422 zcmeFa34C2u)i!?4y*ESCG^FX=rs>VlHXSl{1UjZA6ex7AEmP+71~QqUO&M&NK~P2& zAy5QVWRNl`Qz@??Dky@YB7^qzMT-=r2uPgZ|2%82eeO9oX~0iEzt`X2ot*pZwb$Bf zuRWYSoME5b1vMRYu|;Vm(V#1vTROL_eBSJN<8N#=-fH8OhB|c&2gMJ9Vhpx z;IZUaj`NQk*C75s;c!F0apai%dB^=XJ3_mkcK#V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_vanilla.a deleted file mode 100644 index 14f5180fa8f0fb061d7ede8a661fb5b385076931..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 429956 zcmeFa33yf2)i=J+kb7^=4H@8q0b;l$3?Y%sKo}E3j7m_#9B@cNazkQ55;8D3Fo+fr zD}z-8HHcOb6#<8$4B}L+wKi0=NUF;**WPZ!d+$v zA=V2qs7xqV9=&k6t5GPvqCRs-{HOfi@qzy44)OoDVwDGEdJqwy@S}xe5qS{kY8zPFTeO9+LmDe{nHZ--A)>MY@R5a9AmCDhY<7f_{21eiP zX`1h8I)C)^Q)5$ANUusyQ_Xx&X{~2bsIOLl)#*n*SFM^HhCKB$`^%jaHy5#E#-5X z%IB6gmRHo))XxcFkRk%Jci{kp0p+bN)pHvvI|mdfnC+UXP_0sE(}gru&JI;i`)1cP zgqTF!+?Li5oGH;$UU|VK!XC7|skCDD`Q5BZs3=D~oKLQ(X{`1%HMe55ghrv%8B8t3 zBy+f&(hJBzG$O(qs%q*kprv6!y^Plj^eac4me+(z3d9$IfVr_riXwnS-o`m2e@qv|^Qq;-!j)=9c>MxfdA!-13D#?z*`( z^*>ImDzB@XjmQldk2yE=c#~&dX+?QyT}|@^mW`*rqG?ehf}`3~UplwE;(QsNg)LZh zo=Q-eWlEbp6-}NCNW$SGyR^Brk*V=~DI8r@Q~8|II#1|4N;~U3bIL0g!P0uqoQ9T~ z@|Fw6k7uDwyG(``oQ_~RtnSP+#~(3J)ZAJZY9*;bp&T*-U(fTRn)sUf##XGx9~&N7 zuwVUKo_{HzqO}RGIe*PlI6FcChE#z#N5C(tYbXzmcd|8lxb_ha=MBtS{4%e0+C?l{ zbNT$xhz;b!^EPomDMXVWizw){O$SH|n#vnn8zl!9v47hLk!0C)o*au%(a;#0Y`N}y z#1KjJ%Z2cr4GQUGX*ti!(9-FcVX>O~Y3E%lgc_paypeH@Ak|!OO9Z~sQ&o;|4ox<` zKIh45Mu)1V2JCgA`638kT3#2r2Q}6bWp)E!h_U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(ZzQD)iu}NH@uGir!Sjb|EcR{Juf-84?PxEliu#^X|-g8 z9vj>zTMf=l4XPr>w0UqMEXVcL>bmW?X^D6a_wce zxZe4AxRjGBr3JQoR)X)f%<#?Y#CQVdff-Kov(NPd{^@6 zbi1>c8zv_PXLr-{XT6BpR{5KsKc`!Vf*YPcwJt>mNlltloByrz=btCU|I7*TRzJ54 z^dx7>9|=5}q4EE;Ibb=rwK6dGgQmY5p;`5fh6E<$UTd=b~FVpXv`V zTk3PO^J%t}({r}n*{c*5DVLm%?$7h-pBI?cHR!+L0`ng{pXzT#{yd*rd+7h!bt&gl mtL^_hpW4Sq`7H96n9==lRq+zy2%Nr~jYNr~d;vVA19P diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/lib/libnrf_cc310_platform_0.9.4.a b/third_party/NordicSemiconductor/libraries/nrf_security/lib/libnrf_cc310_platform_0.9.4.a deleted file mode 100644 index 124492c7099c938b5c57b97e1f2a4ce3198446a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67176 zcmeIb3w%}8nK!)lIVZ`<1qc^y2pCRCz#zBWuLNOUapc8meLGGsUlVb@!M3)v)0qfqJ3&EHaLV`puf5ma zYwvRcq0INQ-+Vm3v(CCa&wAF{>+-B;UH00AOQMP9){kY)54oXiL1{&K#lrIP#i3BC zMCt#bP(?*Wr5U3sO9*kN5aV{GHdE_`7|9fWT8NR%ycdO_sQ~*0zctNORYK5Ih0bkO zJ}d;yHAmd$x|fAe=9A#F{_)Y7&b>k?)AP0vsmwh;65>xWTXzeg%+3}e&SjoM8FSD0AdDLX2d7w?l|`YK3@zsxmb-jrDEoS9G@ZT+_9tbE7c* zk+#k@%SjXvtGZe?wa2tD(b(90*T%+pqH9B2d#rK8rq1TZSZ7ZxkrJ`Ft%q@IqwVBp zIoHJ!9c`V_9?2G{n)X;Uv4T7jo8moTn=UDQ%{9v{7OSG&x7jhQu#ZREdd?cQ=9;A> zUF~EBPA4<*nwmA8Ej5X|;yqof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Leu{_^)Afe!qdAW3&RrkMdWi8qNbSW=Xy8i+< z(^s0)I`C6zA=q{gj*^a<8x6mSqolh6bojaQNB#;_UU{xlf8KUHFX=)s6JXTyUhUz> z_o3Jh6exaIdHD5!UkF4r7{zRUw}1{mJAdu)5U)V-yAk1f{vOfzQU0s^aot|$w*{V5 z&)ehS$NP}g^HM8N{J!Yn$F=xW{CL(@&)>@$KWY(*AMZlL&wgIMOPh+{6CQrAYWz5q zDSmq_ejM`%BkgDWJ?PLz<0cjA6skXEhXSA_(AH-K+|L+7#6pBqcV@b*Z$7JP^Kgnq X5CT5M1b*f8&ZU2Z=lG#QYIOe(Q0Jl( diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52811-mbedtls-config.h b/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52811-mbedtls-config.h deleted file mode 100644 index 46f15fecf..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52811-mbedtls-config.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef NRF52811_MBEDTLS_CONFIG_H_ -#define NRF52811_MBEDTLS_CONFIG_H_ - -#if defined(__ICCARM__) - _Pragma("diag_suppress=Pe550") -#endif - -#if defined(__CC_ARM) - _Pragma("diag_suppress=550") - _Pragma("diag_suppress=68") -#endif - -#endif // NRF52811_MBEDTLS_CONFIG_H_ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52833-mbedtls-config.h b/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52833-mbedtls-config.h deleted file mode 100644 index d519e7b15..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52833-mbedtls-config.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2019, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef NRF52833_MBEDTLS_CONFIG_H_ -#define NRF52833_MBEDTLS_CONFIG_H_ - -#define MBEDTLS_PK_WRITE_C - -#if defined(__ICCARM__) - _Pragma("diag_suppress=Pe550") -#endif - -#if defined(__CC_ARM) - _Pragma("diag_suppress=550") - _Pragma("diag_suppress=68") -#endif - -#endif // NRF52833_MBEDTLS_CONFIG_H_ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52840-mbedtls-config.h b/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52840-mbedtls-config.h deleted file mode 100644 index bbec89365..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/mbedtls_plat_config/nrf52840-mbedtls-config.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2018, The OpenThread Authors. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef NRF52840_MBEDTLS_CONFIG_H_ -#define NRF52840_MBEDTLS_CONFIG_H_ - -#define MBEDTLS_PK_WRITE_C - -#include - -#if defined(__ICCARM__) - _Pragma("diag_suppress=Pe550") -#endif - -#if defined(__CC_ARM) - _Pragma("diag_suppress=550") - _Pragma("diag_suppress=68") -#endif - -#endif // NRF52840_MBEDTLS_CONFIG_H_ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform.h deleted file mode 100644 index 1ea57c66e..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform.h +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -#ifndef NRF_CC310_PLATFORM_H__ -#define NRF_CC310_PLATFORM_H__ - -#include -#include -#include - -#include "nrf_cc3xx_platform_defines.h" -#include "nrf_cc3xx_platform_abort.h" -#include "nrf_cc3xx_platform_mutex.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define nrf_cc310_platform_init nrf_cc3xx_platform_init - -#define nrf_cc310_platform_init_no_rng nrf_cc3xx_platform_init_no_rng - -#define nrf_cc310_platform_deinit nrf_cc3xx_platform_deinit - -#define nrf_cc310_platform_is_initialized nrf_cc3xx_platform_is_initialized - -#define nrf_cc310_platform_rng_is_initialized nrf_cc3xx_platform_rng_is_initialized - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_CC310_PLATFORM_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_abort.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_abort.h deleted file mode 100644 index b2b83d2d5..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_abort.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -#ifndef NRF_CC310_PLATFORM_ABORT_H__ -#define NRF_CC310_PLATFORM_ABORT_H__ - -#include "nrf_cc3xx_platform_abort.h" - -#define nrf_cc310_platform_abort_handle_t nrf_cc3xx_platform_abort_handle_t - -#define nrf_cc310_platform_abort_fn_t nrf_cc3xx_platform_abort_fn_t - -#define nrf_cc310_platform_abort_apis_t nrf_cc3xx_platform_abort_apis_t - -#define nrf_cc310_platform_set_abort nrf_cc3xx_platform_set_abort - -#define nrf_cc310_platform_abort_init nrf_cc3xx_platform_abort_init - -#endif /* NRF_CC310_PLATFORM_DEFINES_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_defines.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_defines.h deleted file mode 100644 index f10107d55..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_defines.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -#ifndef NRF_CC310_PLATFORM_DEFINES_H__ -#define NRF_CC310_PLATFORM_DEFINES_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include "nrf_cc3xx_platform_defines.h" - -#define NRF_CC310_PLATFORM_ENTROPY_MAX_GATHER NRF_CC3XX_PLATFORM_ENTROPY_MAX_GATHER -#define NRF_CC310_PLATFORM_USE_COUNT_MAX NRF_CC3XX_PLATFORM_USE_COUNT_MAX - -#define NRF_CC310_PLATFORM_SUCCESS NRF_CC3XX_PLATFORM_SUCCESS -#define NRF_CC310_PLATFORM_ERROR_PARAM_NULL NRF_CC3XX_PLATFORM_ERROR_PARAM_NULL -#define NRF_CC310_PLATFORM_ERROR_INTERNAL NRF_CC3XX_PLATFORM_ERROR_INTERNAL -#define NRF_CC310_PLATFORM_ERROR_RNG_TEST_FAILED NRF_CC3XX_PLATFORM_ERROR_RNG_TEST_FAILED -#define NRF_CC310_PLATFORM_ERROR_HW_VERSION_FAILED NRF_CC3XX_PLATFORM_ERROR_HW_VERSION_FAILED -#define NRF_CC310_PLATFORM_ERROR_PARAM_WRITE_FAILED NRF_CC3XX_PLATFORM_ERROR_PARAM_WRITE_FAILED -#define NRF_CC310_PLATFORM_ERROR_MUTEX_NOT_INITIALIZED NRF_CC3XX_PLATFORM_ERROR_MUTEX_NOT_INITIALIZED -#define NRF_CC310_PLATFORM_ERROR_MUTEX_FAILED NRF_CC3XX_PLATFORM_ERROR_MUTEX_FAILED -#define NRF_CC310_PLATFORM_ERROR_ENTROPY_NOT_INITIALIZED NRF_CC3XX_PLATFORM_ERROR_ENTROPY_NOT_INITIALIZED -#define NRF_CC310_PLATFORM_ERROR_ENTROPY_TRNG_TOO_LONG NRF_CC3XX_PLATFORM_ERROR_ENTROPY_TRNG_TOO_LONG - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_CC310_PLATFORM_DEFINES_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_entropy.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_entropy.h deleted file mode 100644 index 7de8e9dbe..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_entropy.h +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ - -#ifndef NRF_CC310_PLATFORM_ENTROPY_H__ -#define NRF_CC310_PLATFORM_ENTROPY_H__ - -#include "nrf_cc3xx_platform_entropy.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define nrf_cc310_platform_entropy_get nrf_cc3xx_platform_entropy_get - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_CC310_PLATFORM_ENTROPY_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_mutex.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_mutex.h deleted file mode 100644 index dc45b42ae..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc310_platform_mutex.h +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ - -#ifndef NRF_CC310_PLATFORM_MUTEX_H__ -#define NRF_CC310_PLATFORM_MUTEX_H__ - -#include "nrf_cc3xx_platform_mutex.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define NRF_CC310_PLATFORM_MUTEX_MASK_INVALID NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID -#define NRF_CC310_PLATFORM_MUTEX_MASK_IS_VALID NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID -#define NRF_CC310_PLATFORM_MUTEX_MASK_IS_ALLOCATED NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ALLOCATED - -#define nrf_cc310_platform_mutex_t nrf_cc3xx_platform_mutex_t - -#define nrf_cc310_platform_mutex_init_fn_t nrf_cc3xx_platform_mutex_init_fn_t - -#define nrf_cc310_platform_mutex_free_fn_t nrf_cc3xx_platform_mutex_free_fn_t - -#define nrf_cc310_platform_mutex_free_fn_t nrf_cc3xx_platform_mutex_free_fn_t - -#define nrf_cc310_platform_mutex_unlock_fn_t nrf_cc3xx_platform_mutex_unlock_fn_t - -#define nrf_cc310_platform_mutex_apis_t nrf_cc3xx_platform_mutex_apis_t - -#define nrf_cc310_platform_mutexes_t nrf_cc3xx_platform_mutexes_t - -#define nrf_cc310_platform_set_mutexes nrf_cc3xx_platform_set_mutexes - -#define nrf_cc310_platform_mutex_init nrf_cc3xx_platform_mutex_init - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_CC3XX_PLATFORM_MUTEX_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform.h deleted file mode 100644 index e1d8ddde0..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -/**@file - * @defgroup nrf_cc3xx_platform nrf_cc3xx_platform APIs - * @{ - * @brief nrf_cc3xx_platform library containing cc3xx - * hardware initialization and entropy gathering APIs. The library also contains - * APIs and companion source-files to setus RTOS dependent mutex and abort - * functionality for the nrf_cc3xx_mbedcrypto library in Zephyr RTOS and FreeRTOS. - * @} - * - * @defgroup nrf_cc3xx_platform_init nrf_cc3xx_platform initialization APIs - * @ingroup nrf_cc3xx_platform - * @{ - * @brief The nrf_cc3xx_platform APIs provides functions related to - * initialization of the Arm CryptoCell cc3xx hardware accelerator for - * usage in nrf_cc3xx_platform and dependent libraries. - */ -#ifndef NRF_CC3XX_PLATFORM_H__ -#define NRF_CC3XX_PLATFORM_H__ - -#include -#include -#include - -#include "nrf_cc3xx_platform_defines.h" -#include "nrf_cc3xx_platform_abort.h" -#include "nrf_cc3xx_platform_mutex.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/**@brief Function to initialize the nrf_cc3xx_platform with rng support - * - * @return Zero on success, otherwise a non-zero error code. - */ -int nrf_cc3xx_platform_init(void); - - -/**@brief Function to initialize the nrf_cc3xx_platform without rng support - * - * @return Zero on success, otherwise a non-zero error code. - */ -int nrf_cc3xx_platform_init_no_rng(void); - - -/** @brief Function to deintialize the nrf_cc3xx_platform - * - * @return Zero on success, otherwise a non-zero error code. - */ -int nrf_cc3xx_platform_deinit(void); - - -/** @brief Function to check if the nrf_cc3xx_platform is initialized - * - * @retval True if initialized, otherwise false. - */ -bool nrf_cc3xx_platform_is_initialized(void); - - -/** @brief Function to check if the nrf_cc3xx_platform is initialized - * with RNG support - * - * @retval True if RNG is initialized, otherwise false. - */ -bool nrf_cc3xx_platform_rng_is_initialized(void); - - -/** @brief ISR Function for processing of cc3xx Interrupts. - * This cc3xx interrupt service routine function should be called for - * interrupt processing. - * Either by placing this functions directly in the vector table or by - * calling it from the ISR in the OS. - */ -void CRYPTOCELL_IRQHandler(void); - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_CC3XX_PLATFORM_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_abort.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_abort.h deleted file mode 100644 index 0d26bc379..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_abort.h +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -/**@file - * @defgroup nrf_cc3xx_platform_abort nrf_cc3xx_platform abort APIs - * @ingroup nrf_cc3xx_platform - * @{ - * @brief The nrf_cc3xx_platform_entropy APIs provides callbacks to abort - * from nrf_cc3xx_platform and/or dependent libraries. - */ -#ifndef NRF_CC3XX_PLATFORM_ABORT_H__ -#define NRF_CC3XX_PLATFORM_ABORT_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @brief Type definition of handle used for abort - * - * This handle could point to the thread or task to abort or any other - * static memory required for aborting the on-going cryptographic routine(s). - */ -typedef void* nrf_cc3xx_platform_abort_handle_t; - - -/** @brief Type definition of platform abort function - * - * @note This function pointer will be used when the nrf_cc3xx_platform - * and/or dependent libraries raises an error that can't be recovered. - */ -typedef void (*nrf_cc3xx_platform_abort_fn_t)(char const * const reason); - - -/** @brief Type definition of structure holding platform abort APIs - */ -typedef struct nrf_cc3xx_platform_abort_apis_t -{ - nrf_cc3xx_platform_abort_handle_t abort_handle; //!< Handle to use when crypto operations are aborted. - nrf_cc3xx_platform_abort_fn_t abort_fn; //!< Function to use when crypto operations are aborted. - -} nrf_cc3xx_platform_abort_apis_t; - - -/** @brief External reference to the platform abort APIs - */ -extern nrf_cc3xx_platform_abort_apis_t platform_abort_apis; - - -/** @brief Function to set platform abort APIs - * - * @param[in] apis Pointer to platform APIs. - */ -void nrf_cc3xx_platform_set_abort( - nrf_cc3xx_platform_abort_apis_t const * const apis); - - -/** @brief Function to initialize platform abort APIs - * - * @note This function must be called once before calling - * @ref nrf_cc3xx_platform_init or @ref nrf_cc3xx_platform_init_no_rng. - * - * @note This function is not expected to be thread-safe. - */ -void nrf_cc3xx_platform_abort_init(void); - - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_CC3XX_PLATFORM_ABORT_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_ctr_drbg.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_ctr_drbg.h deleted file mode 100644 index c7c3d4d09..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_ctr_drbg.h +++ /dev/null @@ -1,232 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -/**@file - * @defgroup nrf_cc3xx_platform_ctr_drbg nrf_cc3xx_platform ctr_drbg generation APIs - * @ingroup nrf_cc3xx_platform - * @{ - * @brief The nrf_cc3xx_platform_ctr_drbg APIs provide PRNG seeded by TRNG in - * accordance with NIST SP 800-90A: Recommendation for Random Number - * Generation Using Deterministic Random Bit Generators - * The generation of TRNG/PRNG data is using Arm CryptoCell cc3xx - * hardware acceleration. - * - * The pre-built APIs are based on mbedtls_entropy and mbedtls_ctr_drbg - * but doesn't require setting up memory allocation before use. - */ -#ifndef NRF_CC3XX_PLATFORM_CTR_DRBG_H__ -#define NRF_CC3XX_PLATFORM_CTR_DRBG_H__ - -#include -#include -#include - -#include "nrf_cc3xx_platform_defines.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/**@brief Macro holding size of the opaque ctr_drbg context type - * - * This corresponds to a structure with the combined size of - * mbedtls_entropy_context and mbedtls_ctr_drbg_context in Arm CryptoCell - * code base which is sized differently than in vanilla mbed TLS software. - */ -#define NRF_CC3XX_PLATFORM_ENTROPY_SIZE_WORDS (110) - -/**@brief Opaque type for the context required for ctr_drbg generation - * - * Note: This opaque type contains contexts for mbed TLS - * entropy generation (TRNG) and ctr_drbg (PRNG). - */ -typedef struct nrf_cc3xx_platform_ctr_drbg_context_t -{ - uint32_t is_initialized; //!< Mask indicating if the ctr_drbg context has been initialized. - uint32_t buffer[NRF_CC3XX_PLATFORM_ENTROPY_SIZE_WORDS]; //!< Internal buffer for the built-in entropy and ctrl_drbg contexts. -} nrf_cc3xx_platform_ctr_drbg_context_t; - - -/**@brief Function that initializes an ctr_drbg context - * - * @param[in,out] context Pointer to structure holding the ctr_drbg - * context which must be used for subsequent - * calls to generate random data. - * @param[in] pers_string Personalization string used for the - * CTR_DRBG_Instantiate_algorithm. - * @param[in] pers_string_len Length of the personalization string, - * which may be zero. - * - * @retval NRF_CC3XX_PLATFORM_ERROR_PARAM_NULL Context was NULL. - * @return 0 on success, otherwise a non-zero failure from mbedtls_ctrl_drbg_seed. - */ -int nrf_cc3xx_platform_ctr_drbg_init( - nrf_cc3xx_platform_ctr_drbg_context_t * const context, - const uint8_t * pers_string, - size_t pers_string_len); - - -/**@brief Function that deintializes an ctr_drbg context - * - * Param[in,out] context Pointer to structure holding ctr_drbg context which - * is to be deinitialized. - */ -int nrf_cc3xx_platform_ctr_drbg_free( - nrf_cc3xx_platform_ctr_drbg_context_t * const context); - - -/**@brief Function to enable prediction resistance - * - * If prediction resistance is enabled, TRNG is gathered at the beginning of - * every call to @ref nrf_cc3xx_platform_ctr_drbg_get and - * @ref nrf_cc3xx_platform_ctr_drbg_get_with_add. This leads to a higher power - * draw and longer execution time. - * - * @note Before calling this api the context to must be initialized by calling - * @ref nrf_cc3xx_platform_ctr_drbg_init - * - * @note The default configuration is to have prediction resistance turned off. - * - * @param[in,out] context Pointer to a structure holding the ctr_drbg - * context. - * @param[in] pr_enabled Enables prediction resistance if true, otherwise - * false (default). - * - * @retval NRF_CC3XX_PLATFORM_ERROR_PARAM_NULL Context was NULL. - * @return 0 on success, otherwise a non-zero failure. - */ -int nrf_cc3xx_platform_ctr_drbg_set_pr( - nrf_cc3xx_platform_ctr_drbg_context_t * const context, - bool pr_enabled); - - -/**@brief Function to change the reseed interval - * - * This API controls when the ctr_drbg is automatically reseeded - * - * @note Before calling this api the context to must be initialized by calling - * @ref nrf_cc3xx_platform_ctr_drbg_init. - * - * @note Changing the reseed interval is optional. - * - * @param[in,out] context Pointer to a structure holding the ctr_drbg - * context. - * @param[in] interval New reeseed interval value. - * - * @retval NRF_CC3XX_PLATFORM_ERROR_PARAM_NULL Context was NULL. - * @return 0 on success, otherwise a non-zero failure according to the API - * mbedtls_ctrl_drbg_reseed. - */ -int nrf_cc3xx_platform_ctr_drbg_set_reseed_interval( - nrf_cc3xx_platform_ctr_drbg_context_t * const context, int interval); - - -/**@brief Function to do a manual reseed of ctr_drbg (using TRNG) - * - * @note Calling this API is optional as the APIs - * @ref nrf_cc3xx_platform_ctr_drbg_get and - * @ref nrf_cc3xx_platform_ctr_drbg_get_with_add functions will reseed - * automatically according to the reseed interval in the built-in - * mbedtls_ctr_drbg context. - * - * @note Before calling this api the context to must be initialized by calling - * @ref nrf_cc3xx_platform_ctr_drbg_init. - * - * @note This API is only usable if @ref nrf_cc3xx_platform_init was run - * prior to calling it. - * - * @note This API is unneccesary if ctr_drbg is executed with prediction - * resistance turned on. - * - * @param[in,out] context Pointer to a structure holding the ctr_drbg - * context. - * @param[in] additional Optional additional input to use for - * CTR_DRBG_Reseed_function. - * @param[in] add_len Length of the additional input, may be zero. - * - * @retval NRF_CC3XX_PLATFORM_ERROR_PARAM_NULL Context was NULL. - * @return 0 on success, otherwise a non-zero failure according to the API - * mbedtls_ctrl_drbg_seed. - */ -int nrf_cc3xx_platform_ctr_drbg_reseed( - nrf_cc3xx_platform_ctr_drbg_context_t * const context, - const uint8_t *additional, - size_t add_len); - - -/** @brief Function to get PRNG using ctr_drbg and an additional string of data - * - * This function will calculate PRNG using HW accelarated AES CTR_DRBG with a - * 16-byte key and reseed with TRNG using ARM CryptoCEll cc3xx HW according - * to a reseed interval. - * - * @details This function calculates random numbers using PRNG seeded by TRNG - * as defined in NIST SP 800-90A: Recommendation for Random Number - * Generation Using Deterministic Random Bit Generators. The - * random numbers are generated using Arm CryptoCell cc3xx hardware - * acceleration. - * - * @note Before calling this api the context to must be initialized by calling - * @ref nrf_cc3xx_platform_ctr_drbg_init. - * - * @note This API is only usable if @ref nrf_cc3xx_platform_init was run - * prior to calling it. - * - * @param[in,out] context Pointer to structure holding the ctr_drbg context. - * @param[in] buffer Pointer to buffer to hold PRNG data. - * @param[in] len Length of PRNG to get. - * @param[out] olen Length reported out. - * @param[in] additional Additional input to use with CTR_DRBG_Generate_algorithm. - * @param[in] add_len Length of CTR_DRBG additional input. - * - * @retval NRF_CC3XX_PLATFORM_ERROR_PARAM_NULL Context was NULL. - * @return 0 on success, otherwise a non-zero failure according to the API - * mbedtls_ctrl_drbg_get_with_add. - */ -int nrf_cc3xx_platform_ctr_drbg_get_with_add( - nrf_cc3xx_platform_ctr_drbg_context_t * const context, - uint8_t *buffer, - size_t len, - size_t *olen, - const uint8_t *additional, - size_t add_len); - - -/** @brief Function to get PRNG data using ctr_drbg - * - * @details This function calculates random numbers using PRNG seeded by TRNG as - * defined in NIST SP 800-90A: Recommendation for Random Number - * Generation Using Deterministic Random Bit Generators. The - * random numbers are generated using Arm CryptoCell cc3xx hardware - * acceleration. - * - * @note Before calling this api the context to must be initialized by calling - * @ref nrf_cc3xx_platform_ctr_drbg_init. - * - * @note This API is only usable if @ref nrf_cc3xx_platform_init was run - * prior to calling it. - * - * @param[in,out] context Pointer to structure holding the ctr_drbg context. - * @param[in] buffer Pointer to buffer to hold PRNG data. - * @param[in] length Length of PRNG to get. - * @param[out] olen Length reported out. - * - * @return 0 on success, otherwise a non-zero failure according to the API - * mbedtls_ctr_drbg_random. - */ -int nrf_cc3xx_platform_ctr_drbg_get( - nrf_cc3xx_platform_ctr_drbg_context_t * const context, - uint8_t *buffer, - size_t length, - size_t* olen); - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_CC3XX_PLATFORM_CTR_DRBG_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_defines.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_defines.h deleted file mode 100644 index 15cd6e668..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_defines.h +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -/**@file - * @defgroup nrf_cc3xx_platform_defines nrf_cc3xx_platform shared defines - * @ingroup nrf_cc3xx_platform - * @{ - * @brief nrf_cc3xx_platform shared defines and return codes. - */ -#ifndef NRF_CC3XX_PLATFORM_DEFINES_H__ -#define NRF_CC3XX_PLATFORM_DEFINES_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** @brief Definition of max number of entropy bits to gather for CTR_DRBG - */ -#define NRF_CC3XX_PLATFORM_ENTROPY_MAX_GATHER (144) - - -/** @brief Definition of max count of concurrent usage - * - * @note The max value will never be reached. - */ -#define NRF_CC3XX_PLATFORM_USE_COUNT_MAX (10) - - -#define NRF_CC3XX_PLATFORM_SUCCESS (0) -#define NRF_CC3XX_PLATFORM_ERROR_PARAM_NULL (-0x7001) -#define NRF_CC3XX_PLATFORM_ERROR_INTERNAL (-0x7002) -#define NRF_CC3XX_PLATFORM_ERROR_RNG_TEST_FAILED (-0x7003) -#define NRF_CC3XX_PLATFORM_ERROR_HW_VERSION_FAILED (-0x7004) -#define NRF_CC3XX_PLATFORM_ERROR_PARAM_WRITE_FAILED (-0x7005) -#define NRF_CC3XX_PLATFORM_ERROR_MUTEX_NOT_INITIALIZED (-0x7016) -#define NRF_CC3XX_PLATFORM_ERROR_MUTEX_FAILED (-0x7017) -#define NRF_CC3XX_PLATFORM_ERROR_ENTROPY_NOT_INITIALIZED (-0x7018) -#define NRF_CC3XX_PLATFORM_ERROR_ENTROPY_TRNG_TOO_LONG (-0x7019) -#define NRF_CC3XX_PLATFORM_ERROR_KMU_INVALID_SLOT (-0x701a) -#define NRF_CC3XX_PLATFORM_ERROR_KMU_ALREADY_FILLED (-0x701b) -#define NRF_CC3XX_PLATFORM_ERROR_KMU_WRONG_ADDRESS (-0x701c) -#define NRF_CC3XX_PLATFORM_ERROR_KMU_WRITE_KEY_FAILED (-0x701d) -#define NRF_CC3XX_PLATFORM_ERROR_KMU_WRITE_INVALID_PERM (-0x701e) -#define NRF_CC3XX_PLATFORM_ERROR_KDR_INVALID_WRITE (-0x701f) -#define NRF_CC3XX_PLATFORM_ERROR_KDR_INVALID_PUSH (-0x7020) - - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_CC3XX_PLATFORM_DEFINES_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_entropy.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_entropy.h deleted file mode 100644 index 348a40ef7..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_entropy.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -/**@file - * @defgroup nrf_cc3xx_platform_entropy nrf_cc3xx_platform entropy generation APIs - * @ingroup nrf_cc3xx_platform - * @{ - * @brief The nrf_cc3xx_platform_entropy APIs provides TRNG using Arm CC3xx - * hardware acceleration. - */ -#ifndef NRF_CC3XX_PLATFORM_ENTROPY_H__ -#define NRF_CC3XX_PLATFORM_ENTROPY_H__ - -#include -#include -#include - -#include "nrf_cc3xx_platform_defines.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/**@brief Function to generate entropy using Arm CryptoCell cc3xx - * - * This API corresponds to mbedtls_hardware_poll. It provides TRNG using - * the Arm CryptoCell cc3xx hardware accelerator. - * - * @note This API is only usable if @ref nrf_cc3xx_platform_init was run - * prior to calling it. - * - * @param[out] buffer Pointer to buffer to hold the entropy data. - * @param[in] length Length of the buffer to fill with entropy data. - * @param[out] olen Pointer to variable that will hold the length of - * generated entropy. - * - * @retval 0 on success - * @return Any other error code returned from mbedtls_hardware_poll - */ -int nrf_cc3xx_platform_entropy_get(uint8_t *buffer, - size_t length, - size_t* olen); - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_CC3XX_PLATFORM_ENTROPY_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_kmu.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_kmu.h deleted file mode 100644 index 2cf774fbf..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_kmu.h +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Copyright (c) 2020 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -/**@file - * @defgroup nrf_cc3xx_platform_kmu nrf_cc3xx_platform kmu APIs - * @ingroup nrf_cc3xx_platform - * @{ - * @brief The nrf_cc3xx_platform_kmu APIs provides RTOS integration for storing - * keys in KMU hardware peripherals - */ -#ifndef NRF_CC3XX_PLATFORM_KMU__ -#define NRF_CC3XX_PLATFORM_KMU__ - -#include -#include "nrf.h" - -#if defined(NRF9160_XXAA) || defined(NRF5340_XXAA_APPLICATION) - -/** @brief Constant value representing the default permission to use - * when writing a key to KMU. - * - * @details This sets up the written key to be non-writable, non-readable - * and pushable. - * - * @warning Deviating from this mask when setting up permissions may allow - * reading the key from CPU, which has security implications. - */ -#define NRF_CC3XX_PLATFORM_KMU_DEFAULT_PERMISSIONS (0xFFFFFFFCUL) - -#if defined(NRF9160_XXAA) - - /** @brief Address of the AES key register in CryptoCell */ - #define NRF_CC3XX_PLATFORM_KMU_AES_ADDR (0x50841400UL) - -#elif defined(NRF5340_XXAA_APPLICATION) - - /** Address of the AES key register in CryptoCell for 128 bit keys */ - #define NRF_CC3XX_PLATFORM_KMU_AES_ADDR (0x50845400UL) - - /** Address of the first 128 bits of AES key in CryptoCell */ - #define NRF_CC3XX_PLATFORM_KMU_AES_ADDR_1 (0x50845400UL) - - /** Address of the subsequent bits of AES key register in CryptoCell HW - * - * @note Used only when AES key is larger than 128 bits, in which case - * the AES key is split between two slots in KMU - */ - #define NRF_CC3XX_PLATFORM_KMU_AES_ADDR_2 (0x50845410UL) -#endif - -/** @brief Write a 128 bit key into a KMU slot - * - * @details This writes a key to KMU with the destination of the subsequent - * push operation set to the address of the AES key registers in - * Arm CryptoCell. - * - * @note The default mask for permissions is recommended to use. - * Please see @ref NRF_CC3XX_PLATFORM_KMU_DEFAULT_PERMISSIONS. - * - * @note Slot 0 and 1 is reserved for KDR use. See - * @ref nrf_cc3xx_platform_kmu_write_kdr_slot. - * - * @note nRF5340: Keys of 128 bits can use @ref NRF_CC3XX_PLATFORM_KMU_AES_ADDR, - * Keys larger than 128 bits must be split up to use two KMU slots. - * Use @ref NRF_CC3XX_PLATFORM_KMU_AES_ADDR_1 for the first 128 bits of - * the key. - * Use @ref NRF_CC3XX_PLATFORM_KMU_AES_ADDR_2 for the subsequent bits of - * the key. - * - * @param[in] slot_id KMU slot ID for the new key (2 - 127). - * @param[in] key_addr Destination address in CryptoCell used for key push. - * @param[in] key_perm Permissions to set for the KMU slot. - * @param[in] key Array with the 128 bit key to put in the KMU slot. - * - * @return NRF_CC3XX_PLATFORM_SUCCESS on success, otherwise a negative value. - */ -int nrf_cc3xx_platform_kmu_write_key_slot( - uint32_t slot_id, - uint32_t key_addr, - uint32_t key_perm, - const uint8_t key[16]); - -#endif /* defined(NRF9160_XXAA) || defined(NRF5340_XXAA_APPLICATION) */ - -#if defined(NRF9160_XXAA) - -/** @brief Write a 128 bit AES key into the KMU slot 0 for KDR use - * - * @details This writes a key to KMU with the destination of the subsequent - * push operation set to the address of the KDR registers in - * Arm CryptoCell. - * - * @note The permission set by this function is "non-writable, non-readable - * and pushable". Please see - * @ref NRF_CC3XX_PLATFORM_KMU_DEFAULT_PERMISSIONS. - * - * @param[in] key Array with the 128 bit key to put in the KMU slot. - * - * @return NRF_CC3XX_PLATFORM_SUCCESS on success, otherwise a negative value. - */ -int nrf_cc3xx_platform_kmu_write_kdr_slot(const uint8_t key[16]); - - -/** @brief Push the 128 bit AES key in KMU slot 0 (reserved for KDR) into - * CryptoCell KDR registers and set LCS state to secure - * - * @note This function must be run once on every boot to load the KDR key - * and to set the LCS state to secure. - * - * @note The KDR key will be stored in the Always on Domain (AO) untill the next - * reset. It is not possible to set the KDR value once the LCS state is - * set to secure. - * - * @return NRF_CC3XX_PLATFORM_SUCCESS on success, otherwise a negative value. - */ -int nrf_cc3xx_platform_kmu_push_kdr_slot_and_lock(void); - -#endif // defined(NRF9160_XXAA) - - -#if defined(NRF52840_XXAA) - -/** @brief Load a unique 128 bit root key into CryptoCell KDR registers and set - * CryptoCell LCS state to secure - * - * @note This function must be run once on every boot do load an AES key into - * KDR. It is recommended that this is done in an immutable bootloader - * stage and the page holding the key is ACL read+write protected after - * it has been loaded into KDR with this API. - * - * @note The KDR key should be a randomly generated unique key. - * - * @note The KDR key will be stored in the Always on Domain (AO) until the next - * reset. It is not possible to set the KDR value once the LCS state is - * set to secure. - * - * @param[in] key Array with the AES 128 bit key. - * - * @return NRF_CC3XX_PLATFORM_SUCCESS on success, otherwise a negative value. - */ -int nrf_cc3xx_platform_kdr_load_key(uint8_t key[16]); - -#endif // defined(NRF52840_XXAA) - -#endif /* NRF_CC3XX_PLATFORM_KMU__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_mutex.h b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_mutex.h deleted file mode 100644 index 140167a99..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/include/nrf_cc3xx_platform_mutex.h +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -/**@file - * @defgroup nrf_cc3xx_platform_mutex nrf_cc3xx_platform mutex APIs - * @ingroup nrf_cc3xx_platform - * @{ - * @brief The nrf_cc3xx_platform_mutex APIs provides RTOS integration for mutex - * usage in nrf_cc3xx_platform and dependent libraries. - */ -#ifndef NRF_CC3XX_PLATFORM_MUTEX_H__ -#define NRF_CC3XX_PLATFORM_MUTEX_H__ - -#include -#include - -#include "nrf_cc3xx_platform_abort.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -#define NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID (0) /*!< Mask indicating that the mutex is invalid (not initialized or allocated). */ -#define NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID (1<<0) /*!< Mask value indicating that the mutex is valid for use. */ -#define NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ALLOCATED (1<<1) /*!< Mask value indicating that the mutex is allocated and requires deallocation once freed. */ - -/** @brief Type definition of architecture neutral mutex type */ -typedef struct nrf_cc3xx_platform_mutex -{ - void * mutex; - uint32_t flags; - -} nrf_cc3xx_platform_mutex_t; - -/** @brief Type definition of function pointer to initialize a mutex - * - * Calling this function pointer should initialize a previously uninitialized - * mutex or do nothing if the mutex is already initialized. - * - * @note Initialization may not imply memory allocation, as this can be done - * using static allocation through other APIs in the RTOS. - * - * @param[in] mutex Pointer to a mutex to initialize. - */ -typedef void (*nrf_cc3xx_platform_mutex_init_fn_t)(nrf_cc3xx_platform_mutex_t *mutex); - - -/** @brief Type definition of function pointer to free a mutex - * - * Calling this function pointer should free a mutex. - * - * @note If the RTOS does not provide an API to free the mutex it is advised - * to reset the mutex to an initialized state with no owner. - * - * @param[in] mutex Pointer to a mutex to free. - */ -typedef void (*nrf_cc3xx_platform_mutex_free_fn_t)(nrf_cc3xx_platform_mutex_t *mutex); - - -/** @brief Type definition of function pointer to lock a mutex - * - * Calling this function pointer should lock a mutex. - * - * @param[in] mutex Pointer to a mutex to lock. - */ -typedef int (*nrf_cc3xx_platform_mutex_lock_fn_t)(nrf_cc3xx_platform_mutex_t *mutex); - - -/** @brief Type definition of function pointer to unlock a mutex - * - * Calling this function pointer should unlock a mutex. - * - * @param[in] mutex Pointer to a mutex to unlock. - */ -typedef int (*nrf_cc3xx_platform_mutex_unlock_fn_t)(nrf_cc3xx_platform_mutex_t *mutex); - - -/**@brief Type definition of structure holding platform mutex APIs - */ -typedef struct nrf_cc3xx_platform_mutex_apis_t -{ - /* The platform mutex init function */ - nrf_cc3xx_platform_mutex_init_fn_t mutex_init_fn; - - /* The platform mutex free function */ - nrf_cc3xx_platform_mutex_free_fn_t mutex_free_fn; - - /* The platform lock function */ - nrf_cc3xx_platform_mutex_lock_fn_t mutex_lock_fn; - - /* The platform unlock function */ - nrf_cc3xx_platform_mutex_unlock_fn_t mutex_unlock_fn; -} nrf_cc3xx_platform_mutex_apis_t; - - -/** @brief Type definition of structure to platform hw mutexes - */ -typedef struct nrf_cc3xx_platform_mutexes_t -{ - /* Mutex for symmetric operations. */ - void * sym_mutex; - - /* Mutex for asymetric operations. */ - void * asym_mutex; - - /* Mutex for rng operations. */ - void * rng_mutex; - - /* Mutex reserved for future use. */ - void * reserved; - - /* Mutex for power mode changes */ - void * power_mutex; -} nrf_cc3xx_platform_mutexes_t; - - -/**@brief External reference to structure holding the currently set platform - * mutexe APIs. - */ -extern nrf_cc3xx_platform_mutex_apis_t platform_mutex_apis; - - -/**@brief External reference to currently set platform hw mutexes */ -extern nrf_cc3xx_platform_mutexes_t platform_mutexes; - - -/** @brief Function to set platform mutex APIs and mutexes - * - * @param[in] apis Structure holding the mutex APIs. - * @param[in] mutexes Structure holding the mutexes. - */ -void nrf_cc3xx_platform_set_mutexes( - nrf_cc3xx_platform_mutex_apis_t const * const apis, - nrf_cc3xx_platform_mutexes_t const * const mutexes); - - -/** @brief Function to initialize RTOS thread-safe mutexes - * - * This function must be implemented to set the platform mutex APIS, - * and platform mutexes. - * - * @note This function must be called once before calling - * @ref nrf_cc3xx_platform_init or @ref nrf_cc3xx_platform_init_no_rng. - * - * @note This function is not expected to be thread-safe. - */ -void nrf_cc3xx_platform_mutex_init(void); - -#ifdef __cplusplus -} -#endif - -#endif /* NRF_CC3XX_PLATFORM_MUTEX_H__ */ - -/** @} */ diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_abort_freertos.c b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_abort_freertos.c deleted file mode 100644 index 2b65ec724..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_abort_freertos.c +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -#include -#include - -#include "nrf_cc3xx_platform_abort.h" -#include "FreeRTOS.h" - -/** @brief Definition of platform handle used during abort in FreeRTOS - * - * @note Currently not used - */ -static nrf_cc3xx_platform_abort_handle_t platform_abort_handle; - - -/** @brief Definition of abort function used for FreeRTOS - */ -static void abort_function(char const * const reason) -{ - configASSERT(!reason); -} - - -/** @brief Definition of abort API to set in nrf_cc3xx_platform - */ -static const nrf_cc3xx_platform_abort_apis_t apis = -{ - .abort_handle = &platform_abort_handle, - .abort_fn = abort_function -}; - -/** @brief Function to initialize the nrf_cc3xx_platform abort APIs. - */ -void nrf_cc3xx_platform_abort_init(void) -{ - nrf_cc3xx_platform_set_abort(&apis); -} diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_abort_zephyr.c b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_abort_zephyr.c deleted file mode 100644 index 4071db154..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_abort_zephyr.c +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -#include -#include -//#include -//LOG_MODULE_DECLARE(cc3xx_platform); - -#include "nrf_cc3xx_platform_abort.h" - - -/** @brief Definition of abort function used for Zephyr - */ -static void abort_function(char const * const reason) -{ - //LOG_ERR("Reason: %s", reason); -#ifdef CONFIG_REBOOT - //LOG_ERR("Rebooting"); - sys_reboot(SYS_REBOOT_WARM); -#else - //LOG_ERR("Halted"); - while(1); -#endif -} - - -/** @brief Definition of abort API to set in nrf_cc3xx_platform - */ -static const nrf_cc3xx_platform_abort_apis_t apis = -{ - .abort_handle = NULL, - .abort_fn = abort_function, -}; - -/** @brief Function to initialize the nrf_cc3xx_platform abort APIs. - */ -void nrf_cc3xx_platform_abort_init(void) -{ - nrf_cc3xx_platform_set_abort(&apis); -} diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_mutex_freertos.c b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_mutex_freertos.c deleted file mode 100644 index 9c0a3ee85..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_mutex_freertos.c +++ /dev/null @@ -1,228 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -#include -#include - -#include "FreeRTOS.h" -#include "semphr.h" - -#include "nrf_cc3xx_platform_defines.h" -#include "nrf_cc3xx_platform_mutex.h" - - -/** @brief external reference to the cc3xx platform mutex APIs*/ -extern nrf_cc3xx_platform_mutex_apis_t platform_mutex_apis; - -/** @brief Definition of mutex for symmetric cryptography - */ -static SemaphoreHandle_t sym_mutex_int; - -/** @brief Definition of mutex for asymmetric cryptography - */ -static SemaphoreHandle_t asym_mutex_int; - -/** @brief Definition of mutex for random number generation - */ -static SemaphoreHandle_t rng_mutex_int; - -/** @brief Definition of mutex for power management changes - */ -static SemaphoreHandle_t power_mutex_int; - -/** @brief Definition of mutex for heap allocations using buffer_mem_alloc.c - */ -static SemaphoreHandle_t heap_mutex_int; - - -/**@brief Definition of RTOS-independent symmetric cryptography mutex - * with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that - * allocation is unneccesary -*/ -static nrf_cc3xx_platform_mutex_t sym_mutex = -{ - .mutex = &sym_mutex_int, - .flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID -}; - - -/**@brief Definition of RTOS-independent asymmetric cryptography mutex - * with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that - * allocation is unneccesary -*/ -static nrf_cc3xx_platform_mutex_t asym_mutex = -{ - .mutex = &asym_mutex_int, - .flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID -}; - - -/**@brief Definition of RTOS-independent random number generation mutex - * with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that - * allocation is unneccesary -*/ -static nrf_cc3xx_platform_mutex_t rng_mutex = -{ - .mutex = &rng_mutex_int, - .flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID -}; - - -/**@brief Definition of RTOS-independent power management mutex - * with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that - * allocation is unneccesary -*/ -static nrf_cc3xx_platform_mutex_t power_mutex = -{ - .mutex = &power_mutex_int, - .flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID -}; - -/** @brief Definition of RTOS-independent heap allocation mutex - * with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that - * allocation is unneccesary - * - * @note This symbol can't be static as it is referenced in the replacement - * file mbemory_buffer_alloc.c inside the heap structure. - */ -nrf_cc3xx_platform_mutex_t heap_mutex = -{ - .mutex = &heap_mutex_int, - .flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID -}; - - -/** @brief Static function to unlock a mutex - */ -static void mutex_init_platform(nrf_cc3xx_platform_mutex_t *mutex) -{ - /* Ensure that the mutex is valid (not NULL) */ - if (mutex == NULL) { - platform_abort_apis.abort_fn("mutex_init called with NULL parameter"); - } - - if (mutex->flag == NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID) - { - mutex->mutex = (void*)xSemaphoreCreateMutex(); - if (mutex->mutex == NULL) { - platform_abort_apis.abort_fn("Could not create mutex!"); - } - } - - /* Set the mask to indicate that the mutex is valid */ - mutex->flags |= NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID; -} - - -/** @brief Static function to free a mutex - */ -static void mutex_free_platform(nrf_cc3xx_platform_mutex_t *mutex) -{ - SemaphoreHandle_t p_mutex; - - /* Ensure that the mutex is valid (not NULL) */ - if (mutex == NULL) { - platform_abort_apis.abort_fn("mutex_free called with NULL parameter"); - } - - if (mutex->flags == NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID) { - /*Nothing to free*/ - return; - } - - p_mutex = (SemaphoreHandle_t) mutex->mutex; - - vSemaphoreDelete(p_mutex); - - /* Reset the mutex to invalid state */ - mutex->flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID; -} - - -/** @brief Static function to lock a mutex - */ -static int mutex_lock_platform(nrf_cc3xx_platform_mutex_t *mutex) -{ - int ret; - SemaphoreHandle_t p_mutex; - - /* Ensure that the mutex is valid (not NULL) */ - if (mutex == NULL) { - platform_abort_apis.abort_fn("mutex_lock called with NULL parameter"); - } - - /* Ensure that the mutex has been initialized */ - if (mutex->flags == NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID) { - return NRF_CC3XX_PLATFORM_ERROR_MUTEX_NOT_INITIALIZED; - } - - p_mutex = (SemaphoreHandle_t) mutex->mutex; - - ret = xSemaphoreTake(p_mutex, portMAX_DELAY); - if (ret == pdTRUE) { - return NRF_CC3XX_PLATFORM_SUCCESS; - } - else { - return NRF_CC3XX_PLATFORM_ERROR_MUTEX_FAILED; - } -} - - -/** @brief Static function to unlock a mutex - */ -static int mutex_unlock_platform(nrf_cc3xx_platform_mutex_t * mutex) -{ - int ret; - SemaphoreHandle_t p_mutex; - - /* Ensure that the mutex is valid (not NULL) */ - if (mutex == NULL) { - platform_abort_apis.abort_fn("mutex_unlock called with NULL parameter"); - } - - /* Ensure that the mutex has been initialized */ - if (mutex->flags == NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID) { - return NRF_CC3XX_PLATFORM_ERROR_MUTEX_NOT_INITIALIZED; - } - - p_mutex = (SemaphoreHandle_t) mutex->mutex; - - ret = xSemaphoreGive(p_mutex); - if (ret != pdTRUE) { - platform_abort_apis.abort_fn("Could not unlock mutex!"); - } - - return NRF_CC3XX_PLATFORM_SUCCESS; -} - - -/**@brief Constant definition of mutex APIs to set in nrf_cc3xx_platform - */ -const nrf_cc3xx_platform_mutex_apis_t mutex_apis = -{ - .mutex_init_fn = mutex_init_platform, - .mutex_free_fn = mutex_free_platform, - .mutex_lock_fn = mutex_lock_platform, - .mutex_unlock_fn = mutex_unlock_platform -}; - - -/** @brief Constant definition of mutexes to set in nrf_cc3xx_platform - */ -const nrf_cc3xx_platform_mutexes_t mutexes = -{ - .sym_mutex = &sym_mutex, - .asym_mutex = &asym_mutex, - .rng_mutex = &rng_mutex, - .reserved = NULL, - .power_mutex = &power_mutex -}; - -/** @brief Function to initiialize the nrf_cc3xx_platform mutex APIs. - */ -void nrf_cc3xx_platform_mutex_init(void) -{ - nrf_cc3xx_platform_set_mutexes(&mutex_apis, &mutexes); -} diff --git a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_mutex_zephyr.c b/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_mutex_zephyr.c deleted file mode 100644 index 89821868c..000000000 --- a/third_party/NordicSemiconductor/libraries/nrf_security/nrf_cc310_plat/src/nrf_cc3xx_platform_mutex_zephyr.c +++ /dev/null @@ -1,263 +0,0 @@ -/** - * Copyright (c) 2019 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic - */ -#include -#include -#include - -#include -#include - -#include "nrf_cc3xx_platform_defines.h" -#include "nrf_cc3xx_platform_mutex.h" -#include "nrf_cc3xx_platform_abort.h" - -/** @brief External reference to the platforms abort APIs - * This is used in case the mutex functions don't - * provide return values in their APIs. - */ -extern nrf_cc3xx_platform_abort_apis_t platform_abort_apis; - -/** @brief Definition of mutex for symmetric cryptography - */ -K_MUTEX_DEFINE(sym_mutex_int); - -/** @brief Definition of mutex for asymmetric cryptography - */ -K_MUTEX_DEFINE(asym_mutex_int); - -/** @brief Definition of mutex for random number generation -*/ -K_MUTEX_DEFINE(rng_mutex_int); - -/** @brief Definition of mutex for power mode changes -*/ -K_MUTEX_DEFINE(power_mutex_int); - -/** @brief Definition of mutex for heap allocations - */ -K_MUTEX_DEFINE(heap_mutex_int); - -/** @brief Arbritary number of mutexes the system suppors - */ -#define NUM_MUTEXES 64 - -/** @brief Structure definition of the mutex slab - */ -struct k_mem_slab mutex_slab; - -/** @brief Definition of buffer used for the mutex slabs - */ -char __aligned(4) mutex_slab_buffer[NUM_MUTEXES * sizeof(struct k_mutex)]; - -/**@brief Definition of RTOS-independent symmetric cryptography mutex - * with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that - * allocation is unneccesary -*/ -static nrf_cc3xx_platform_mutex_t sym_mutex = -{ - .mutex = &sym_mutex_int, - .flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID -}; - - -/**@brief Definition of RTOS-independent asymmetric cryptography mutex - * with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that - * allocation is unneccesary -*/ -static nrf_cc3xx_platform_mutex_t asym_mutex = -{ - .mutex = &asym_mutex_int, - .flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID -}; - - -/**@brief Definition of RTOS-independent random number generation mutex - * with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that - * allocation is unneccesary -*/ -static nrf_cc3xx_platform_mutex_t rng_mutex = -{ - .mutex = &rng_mutex_int, - .flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID -}; - - -/**@brief Definition of RTOS-independent power management mutex - * with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that - * allocation is unneccesary -*/ -static nrf_cc3xx_platform_mutex_t power_mutex = -{ - .mutex = &power_mutex_int, - .flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID -}; - -/** @brief Definition of RTOS-independent heap allocation mutex - * with NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID set to indicate that - * allocation is unneccesary - * - * @note This symbol can't be static as it is referenced in the replacement - * file mbemory_buffer_alloc.c inside the heap structure. - */ -nrf_cc3xx_platform_mutex_t heap_mutex = -{ - .mutex = &heap_mutex_int, - .flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID -}; - - -/**@brief static function to initialize a mutex - */ -static void mutex_init_platform(nrf_cc3xx_platform_mutex_t *mutex) { - int ret; - struct k_mutex * p_mutex; - - /* Ensure that the mutex is valid (not NULL) */ - if (mutex == NULL) { - platform_abort_apis.abort_fn( - "mutex_init called with NULL parameter"); - } - - /* Allocate if this has not been initialized statically */ - if (mutex->flags == NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID && - mutex->mutex == NULL) { - /* Allocate some memory for the mutex */ - ret = k_mem_slab_alloc(&mutex_slab, &mutex->mutex, K_FOREVER); - if(ret != 0 || mutex->mutex == NULL) - { - /* Allocation failed. Abort all operations */ - platform_abort_apis.abort_fn( - "Could not allocate mutex before initializing"); - } - - memset(mutex->mutex, 0, sizeof(struct k_mutex)); - - /** Set a flag to ensure that mutex is deallocated by the freeing - * operation - */ - mutex->flags |= NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ALLOCATED; - } - - p_mutex = (struct k_mutex *)mutex->mutex; - k_mutex_init(p_mutex); - - /* Set the mask to indicate that the mutex is valid */ - mutex->flags |= NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_VALID; -} - - -/** @brief Static function to free a mutex - */ -static void mutex_free_platform(nrf_cc3xx_platform_mutex_t *mutex) { - /* Ensure that the mutex is valid (not NULL) */ - if (mutex == NULL) { - platform_abort_apis.abort_fn( - "mutex_init called with NULL parameter"); - } - - /* Check if we are freeing a mutex that isn't initialized */ - if (mutex->flags == NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID) { - /*Nothing to free*/ - return; - } - - /* Check if the mutex was allocated or being statically defined */ - if ((mutex->flags & NRF_CC3XX_PLATFORM_MUTEX_MASK_IS_ALLOCATED) != 0) { - k_mem_slab_free(&mutex_slab, mutex->mutex); - mutex->mutex = NULL; - } - else { - memset(mutex->mutex, 0, sizeof(struct k_mutex)); - } - - /* Reset the mutex to invalid state */ - mutex->flags = NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID; -} - - -/** @brief Static function to lock a mutex - */ -static int32_t mutex_lock_platform(nrf_cc3xx_platform_mutex_t *mutex) { - int ret; - struct k_mutex * p_mutex; - - /* Ensure that the mutex param is valid (not NULL) */ - if(mutex == NULL) { - return NRF_CC3XX_PLATFORM_ERROR_PARAM_NULL; - } - - /* Ensure that the mutex has been initialized */ - if (mutex->flags == NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID) { - return NRF_CC3XX_PLATFORM_ERROR_MUTEX_NOT_INITIALIZED; - } - - p_mutex = (struct k_mutex *)mutex->mutex; - - ret = k_mutex_lock(p_mutex, K_FOREVER); - if (ret == 0) { - return NRF_CC3XX_PLATFORM_SUCCESS; - } - else { - return NRF_CC3XX_PLATFORM_ERROR_MUTEX_FAILED; - } -} - - -/** @brief Static function to unlock a mutex - */ -static int32_t mutex_unlock_platform(nrf_cc3xx_platform_mutex_t *mutex) { - struct k_mutex * p_mutex; - - /* Ensure that the mutex param is valid (not NULL) */ - if(mutex == NULL) { - return NRF_CC3XX_PLATFORM_ERROR_PARAM_NULL; - } - - /* Ensure that the mutex has been initialized */ - if (mutex->flags == NRF_CC3XX_PLATFORM_MUTEX_MASK_INVALID) { - return NRF_CC3XX_PLATFORM_ERROR_MUTEX_NOT_INITIALIZED; - } - - p_mutex = (struct k_mutex *)mutex->mutex; - - k_mutex_unlock(p_mutex); - return NRF_CC3XX_PLATFORM_SUCCESS; -} - - -/**@brief Constant definition of mutex APIs to set in nrf_cc3xx_platform - */ -static const nrf_cc3xx_platform_mutex_apis_t mutex_apis = -{ - .mutex_init_fn = mutex_init_platform, - .mutex_free_fn = mutex_free_platform, - .mutex_lock_fn = mutex_lock_platform, - .mutex_unlock_fn = mutex_unlock_platform -}; - - -/** @brief Constant definition of mutexes to set in nrf_cc3xx_platform - */ -static const nrf_cc3xx_platform_mutexes_t mutexes = -{ - .sym_mutex = &sym_mutex, - .asym_mutex = &asym_mutex, - .rng_mutex = &rng_mutex, - .reserved = NULL, - .power_mutex = &power_mutex, -}; - -/** @brief Function to initialize the nrf_cc3xx_platform mutex APIs - */ -void nrf_cc3xx_platform_mutex_init(void) -{ - k_mem_slab_init(&mutex_slab, - mutex_slab_buffer, - sizeof(struct k_mutex), - NUM_MUTEXES); - - nrf_cc3xx_platform_set_mutexes(&mutex_apis, &mutexes); -} diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd.c b/third_party/NordicSemiconductor/libraries/usb/app_usbd.c deleted file mode 100644 index 23a8c4bc5..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd.c +++ /dev/null @@ -1,1919 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include "sdk_common.h" -#if NRF_MODULE_ENABLED(APP_USBD) - -#include "app_usbd.h" -#include "app_usbd_core.h" -#include "app_usbd_request.h" -#include "nrf_power.h" -#include "nrf_drv_clock.h" -#include "nrf_drv_power.h" -#if APP_USBD_CONFIG_EVENT_QUEUE_ENABLE -#include "nrf_atfifo.h" -#include "nrf_atomic.h" -#endif - -#define NRF_LOG_MODULE_NAME app_usbd - -#if APP_USBD_CONFIG_LOG_ENABLED -#define NRF_LOG_LEVEL APP_USBD_CONFIG_LOG_LEVEL -#define NRF_LOG_INFO_COLOR APP_USBD_CONFIG_INFO_COLOR -#define NRF_LOG_DEBUG_COLOR APP_USBD_CONFIG_DEBUG_COLOR -#else //APP_USBD_CONFIG_LOG_ENABLED -#define NRF_LOG_LEVEL 0 -#endif //APP_USBD_CONFIG_LOG_ENABLED -#include "nrf_log.h" -NRF_LOG_MODULE_REGISTER(); - - -/* Base variables tests */ - -/* Check event of app_usbd_event_type_t enumerator */ -STATIC_ASSERT((int32_t)APP_USBD_EVT_FIRST_POWER == (int32_t)NRF_DRV_USBD_EVT_CNT); -STATIC_ASSERT(sizeof(app_usbd_event_type_t) == sizeof(nrf_drv_usbd_event_type_t)); - -STATIC_ASSERT(sizeof(app_usbd_descriptor_header_t) == 2); -STATIC_ASSERT(sizeof(app_usbd_descriptor_device_t) == 18); -STATIC_ASSERT(sizeof(app_usbd_descriptor_configuration_t) == 9); -STATIC_ASSERT(sizeof(app_usbd_descriptor_iface_t) == 9); -STATIC_ASSERT(sizeof(app_usbd_descriptor_ep_t) == 7); -STATIC_ASSERT(sizeof(app_usbd_descriptor_iad_t) == 8); - -STATIC_ASSERT(sizeof(app_usbd_setup_t) == sizeof(nrf_drv_usbd_setup_t)); - -/** - * @internal - * @defgroup app_usbd_internals USBD library internals - * @ingroup app_usbd - * - * Internal variables, auxiliary macros and functions of USBD library. - * @{ - */ - -#if (APP_USBD_PROVIDE_SOF_TIMESTAMP) || defined(__SDK_DOXYGEN__) -/** - * @brief The last received frame number. - */ -static uint16_t m_last_frame; -#endif - -/** - * @brief Variable type for endpoint configuration. - * - * Each endpoint would have assigned this type of configuration structure. - */ -typedef struct -{ - /** - * @brief The class instance. - * - * The pointer to the class instance that is connected to the endpoint. - */ - app_usbd_class_inst_t const * p_cinst; - - /** - * @brief Endpoint event handler. - * - * Event handler for the endpoint. - * It is set to event handler for the class instance during connection by default, - * but it can be then updated for as a reaction for @ref APP_USBD_EVT_ATTACHED event. - * This way we can speed up the interpretation of endpoint related events. - */ - app_usbd_ep_event_handler_t event_handler; -}app_usbd_ep_conf_t; - - -/** - * @brief Internal event with SOF counter. - */ -typedef struct -{ - app_usbd_internal_evt_t evt; //!< Internal event type - -#if (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) \ - || defined(__SDK_DOXYGEN__) - uint16_t sof_cnt; //!< Number of the SOF events that appears before current event - uint16_t start_frame; //!< Number of the SOF frame that starts this event -#endif // (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - -} app_usbd_internal_queue_evt_t; - -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) || defined(__SDK_DOXYGEN__) -/** - * @brief Event queue. - * - * The queue with events to be processed. - */ -NRF_ATFIFO_DEF(m_event_queue, app_usbd_internal_queue_evt_t, APP_USBD_CONFIG_EVENT_QUEUE_SIZE); - -#if (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) \ - || defined(__SDK_DOXYGEN__) - -/** @brief SOF events counter */ -static nrf_atomic_u32_t m_sof_events_cnt; - -/** @brief SOF Frame counter */ -static uint16_t m_event_frame; - -/* Limit of SOF events stacked until warning message. */ -#define APP_USBD_SOF_WARNING_LIMIT 500 -#endif // (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - // || defined(__SDK_DOXYGEN__) - -#endif - -/** - * @brief Instances connected with IN endpoints. - * - * Array of instance pointers connected with every IN endpoint. - * @sa m_epout_instances - */ -static app_usbd_ep_conf_t m_epin_conf[NRF_USBD_EPIN_CNT]; - -/** - * @brief Instances connected with OUT endpoints. - * - * Array of instance pointers connected with every OUT endpoint. - * @sa m_epin_instances - */ -static app_usbd_ep_conf_t m_epout_conf[NRF_USBD_EPIN_CNT]; - -/** - * @brief Beginning of classes list. - * - * All enabled in current configuration instances are connected into - * a single linked list chain. - * This variable points to first element. - * Core class instance (connected to endpoint 0) is not listed here. - */ -static app_usbd_class_inst_t const * m_p_first_cinst; - -/** - * @brief Classes list that requires SOF events. - * - * Pointer to first class that requires SOF events. - */ -static app_usbd_class_inst_t const * m_p_first_sof_cinst; - -/** - * @brief Classes list that require SOF events in interrupt. - * - * Pointer to first class that requires SOF events in interrupt. - */ -static app_usbd_class_inst_t const * m_p_first_sof_interrupt_cinst; - -/** - * @brief Default configuration (when NULL is passed to @ref app_usbd_init). - */ -static const app_usbd_config_t m_default_conf = { -#if (!(APP_USBD_CONFIG_EVENT_QUEUE_ENABLE)) || defined(__SDK_DOXYGEN__) - .ev_handler = app_usbd_event_execute, -#endif -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) || defined(__SDK_DOXYGEN__) - .ev_isr_handler = NULL, -#endif - .ev_state_proc = NULL, - .enable_sof = false -}; - -/** - * @brief SUSPEND state machine states. - * - * The enumeration of internal SUSPEND state machine states. - */ -typedef enum -{ - SUSTATE_STOPPED, /**< The USB driver was not started */ - SUSTATE_STARTED, /**< The USB driver was started - waiting for USB RESET */ - SUSTATE_ACTIVE, /**< Active state */ - SUSTATE_SUSPENDING, /**< Suspending - waiting for the user to acknowledge */ - SUSTATE_SUSPEND, /**< Suspended */ - SUSTATE_RESUMING, /**< Resuming - waiting for clock */ - SUSTATE_WAKINGUP_WAITING_HFCLK_WREQ, /**< Waking up - waiting for clock and WUREQ from driver */ - SUSTATE_WAKINGUP_WAITING_HFCLK, /**< Waking up - waiting for HFCLK (WUREQ detected) */ - SUSTATE_WAKINGUP_WAITING_WREQ, /**< Waking up - waiting for WREQ (HFCLK active) */ -}app_usbd_sustate_t; - -/** - * @brief Current suspend state. - * - * The state of the suspend state machine. - */ -static app_usbd_sustate_t m_sustate; - -/** - * @brief Remote wake-up register/unregister. - * - * Counter incremented when appended instance required remote wake-up functionality. - * It should be decremented when the class is removed. - * When this counter is not zero, remote wake-up functionality is activated inside core. - */ -static uint8_t m_rwu_registered_counter; - -/** - * @brief Current configuration. - */ -static app_usbd_config_t m_current_conf; - -/** - * @brief Class interface call: event handler - * - * @ref app_usbd_class_interface_t::event_handler - * - * @param[in] p_cinst Class instance. - * @param[in] p_event Event passed to class instance. - * - * @return Standard error code @ref ret_code_t - * @retval NRF_SUCCESS event handled successfully. - * @retval NRF_ERROR_NOT_SUPPORTED unsupported event. - * */ -static inline ret_code_t class_event_handler(app_usbd_class_inst_t const * const p_cinst, - app_usbd_complex_evt_t const * const p_event) -{ - ASSERT(p_cinst != NULL); - ASSERT(p_cinst->p_class_methods != NULL); - ASSERT(p_cinst->p_class_methods->event_handler != NULL); - return p_cinst->p_class_methods->event_handler(p_cinst, p_event); -} - -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) || defined(__SDK_DOXYGEN__) -static inline void class_sof_interrupt_handler(app_usbd_class_inst_t const * const p_cinst, - app_usbd_complex_evt_t const * const p_event) -{ - ASSERT(p_cinst != NULL); - ASSERT(p_cinst->p_data != NULL); - ASSERT(p_cinst->p_data->sof_handler != NULL); - p_cinst->p_data->sof_handler(p_event->drv_evt.data.sof.framecnt); -} - -/** - * @brief User event handler call (passed via configuration). - * - * @param p_event Handler of an event that is going to be added into queue. - * @param queued The event is visible in the queue. - */ -static inline void user_event_handler(app_usbd_internal_evt_t const * const p_event, bool queued) -{ - if ((m_current_conf.ev_isr_handler) != NULL) - { - m_current_conf.ev_isr_handler(p_event, queued); - } -} -#endif - -/** - * @brief User event processor call (passed via configuration). - * - * @param event Event type. - */ -static inline void user_event_state_proc(app_usbd_event_type_t event) -{ - if ((m_current_conf.ev_state_proc) != NULL) - { - m_current_conf.ev_state_proc(event); - } -} - -/** - * @brief Find a specified descriptor. - * - * @param[in] p_cinst Class instance. - * @param[in] desc_type Descriptor type @ref app_usbd_descriptor_t - * @param[in] desc_index Descriptor index. - * @param[out] p_desc Pointer to escriptor. - * @param[out] p_desc_len Length of descriptor. - * - * @return Standard error code @ref ret_code_t - * @retval NRF_SUCCESS Descriptor successfully found. - * @retval NRF_ERROR_NOT_FOUND Descriptor not found. - * */ -ret_code_t app_usbd_class_descriptor_find(app_usbd_class_inst_t const * const p_cinst, - uint8_t desc_type, - uint8_t desc_index, - uint8_t * p_desc, - size_t * p_desc_len) -{ - app_usbd_class_descriptor_ctx_t siz; - APP_USBD_CLASS_DESCRIPTOR_INIT(&siz); - uint32_t total_size = 0; - while(p_cinst->p_class_methods->feed_descriptors(&siz, p_cinst, NULL, sizeof(uint8_t))) - { - total_size++; - } - - uint8_t cur_len = 0; - uint32_t cur_size = 0; - - uint8_t index = 0; - app_usbd_class_descriptor_ctx_t descr; - APP_USBD_CLASS_DESCRIPTOR_INIT(&descr); - - while(cur_size < total_size) - { - /* First byte of a descriptor is its size */ - UNUSED_RETURN_VALUE(p_cinst->p_class_methods->feed_descriptors(&descr, - p_cinst, - &cur_len, - sizeof(uint8_t))); - - /* Second byte is type of the descriptor */ - uint8_t type; - UNUSED_RETURN_VALUE(p_cinst->p_class_methods->feed_descriptors(&descr, - p_cinst, - &type, - sizeof(uint8_t))); - - if(type == desc_type) - { - if(index == desc_index) - { - /* Copy the length of descriptor to *p_desc_len */ - *p_desc_len = cur_len; - /* Two first bytes of descriptor have already been fed - copy them to *p_desc */ - *p_desc++ = cur_len; - *p_desc++ = desc_type; - /* Copy the rest of descriptor to *p_desc */ - UNUSED_RETURN_VALUE(p_cinst->p_class_methods->feed_descriptors(&descr, - p_cinst, - p_desc, - cur_len-2)); - return NRF_SUCCESS; - } - else - { - index++; - } - } - /* Fast-forward through unmatched descriptor */ - UNUSED_RETURN_VALUE(p_cinst->p_class_methods->feed_descriptors(&descr, - p_cinst, - NULL, - cur_len-2)); - cur_size += cur_len; - } - return NRF_ERROR_NOT_FOUND; -} - -/** - * @brief Access into selected endpoint configuration structure. - * - * @param ep Endpoint address. - * @return A pointer to the endpoint configuration structure. - * - * @note This function would assert when endpoint number is not correct and debugging is enabled. - */ -static app_usbd_ep_conf_t * app_usbd_ep_conf_access(nrf_drv_usbd_ep_t ep) -{ - if (NRF_USBD_EPIN_CHECK(ep)) - { - uint8_t nr = NRF_USBD_EP_NR_GET(ep); - ASSERT(nr < NRF_USBD_EPIN_CNT); - return &m_epin_conf[nr]; - } - else - { - uint8_t nr = NRF_USBD_EP_NR_GET(ep); - ASSERT(nr < NRF_USBD_EPOUT_CNT); - return &m_epout_conf[nr]; - } -} - -/** - * @brief Accessing instance connected with selected endpoint. - * - * @param ep Endpoint number. - * - * @return The pointer to the instance connected with endpoint. - */ -static inline app_usbd_class_inst_t const * app_usbd_ep_instance_get(nrf_drv_usbd_ep_t ep) -{ - return app_usbd_ep_conf_access(ep)->p_cinst; -} - -/** - * @brief Connect instance with selected endpoint. - * - * This function configures instance connected to endpoint but also sets - * default event handler function pointer. - * - * @param ep Endpoint number. - * @param p_cinst The instance to connect into the selected endpoint. - * NULL if endpoint is going to be disconnected. - * - * @note Disconnecting EP0 is not allowed and protected by assertion. - */ -static void app_usbd_ep_instance_set(nrf_drv_usbd_ep_t ep, app_usbd_class_inst_t const * p_cinst) -{ - app_usbd_ep_conf_t * p_ep_conf = app_usbd_ep_conf_access(ep); - /* Set instance and default event handler */ - p_ep_conf->p_cinst = p_cinst; - if (p_cinst == NULL) - { - ASSERT((ep != NRF_DRV_USBD_EPOUT0) && (ep != NRF_DRV_USBD_EPIN0)); /* EP0 should never be disconnected */ - p_ep_conf->event_handler = NULL; - } - else - { - p_ep_conf->event_handler = p_cinst->p_class_methods->event_handler; - } -} - -/** - * @brief Call the core handler. - * - * Core instance is special kind of instance that is connected only to endpoint 0. - * It is not present in instance list. - * This auxiliary function makes future changes easier. - * Just call the event instance for core module here. - */ -static inline ret_code_t app_usbd_core_handler_call(app_usbd_internal_evt_t const * const p_event) -{ - return m_epout_conf[0].event_handler( - m_epout_conf[0].p_cinst, - (app_usbd_complex_evt_t const *)p_event); -} - - - -/** - * @brief Add event for execution. - * - * Dependent on configuration event would be executed in place or would be added into queue - * to be executed later. - * - * @param p_event_input Event to be executed. - */ -static inline void app_usbd_event_add(app_usbd_internal_evt_t const * const p_event_input) -{ - app_usbd_internal_evt_t const * p_event = p_event_input; - - - if (p_event->type == APP_USBD_EVT_DRV_SETUP) - { - uint8_t bRequest = nrf_usbd_setup_brequest_get(); - uint8_t bmRequestType = nrf_usbd_setup_bmrequesttype_get(); - - if ((bmRequestType == app_usbd_setup_req_val( - APP_USBD_SETUP_REQREC_DEVICE, - APP_USBD_SETUP_REQTYPE_STD, - APP_USBD_SETUP_REQDIR_OUT)) - && (bRequest == APP_USBD_SETUP_STDREQ_SET_ADDRESS)) - { - static const app_usbd_internal_evt_t event_setaddress = - { - .type = APP_USBD_EVT_SETUP_SETADDRESS, - }; - p_event = &event_setaddress; - } - } - -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) - - if (p_event->app_evt.type == APP_USBD_EVT_DRV_SOF) - { - /* Propagate SOF event to classes that need it in interrupt */ - app_usbd_class_inst_t const * p_inst = app_usbd_class_sof_interrupt_first_get(); - while (NULL != p_inst) - { - class_sof_interrupt_handler(p_inst, (app_usbd_complex_evt_t const *)p_event); - p_inst = app_usbd_class_sof_interrupt_next_get(p_inst); - } - -#if (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - CRITICAL_REGION_ENTER(); - if (m_sof_events_cnt == 0) - { - m_event_frame = p_event->drv_evt.data.sof.framecnt; - } - UNUSED_RETURN_VALUE(nrf_atomic_u32_add(&m_sof_events_cnt, 1)); - CRITICAL_REGION_EXIT(); - - user_event_handler(p_event, true); - if (m_sof_events_cnt == APP_USBD_SOF_WARNING_LIMIT) - { - NRF_LOG_WARNING("Stacked over %d SOF events.", APP_USBD_SOF_WARNING_LIMIT); - } - return; - -#endif // (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - -#if (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_INTERRUPT) - - user_event_handler(p_event, false); - app_usbd_event_execute(p_event); - return; - -#endif // (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_INTERRUPT) - } - - nrf_atfifo_item_put_t cx; - app_usbd_internal_queue_evt_t * p_event_item = nrf_atfifo_item_alloc(m_event_queue, &cx); - - if (NULL != p_event_item) - { - bool visible; - p_event_item->evt = *p_event; - -#if (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - CRITICAL_REGION_ENTER(); - p_event_item->start_frame = m_event_frame - m_sof_events_cnt + 1; - p_event_item->sof_cnt = nrf_atomic_u32_fetch_store(&m_sof_events_cnt, 0); - CRITICAL_REGION_EXIT(); -#endif // (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - - visible = nrf_atfifo_item_put(m_event_queue, &cx); - user_event_handler(p_event, visible); - } - else - { - NRF_LOG_ERROR("Event queue full."); - } -#else - m_current_conf.ev_handler(p_event); -#endif -} - -/** - * @brief Power event handler. - * - * The function that pushes power events into the queue. - * @param p_event Event from power driver to map into APP_USBD_EVT_POWER_ event. - */ -#if APP_USBD_CONFIG_POWER_EVENTS_PROCESS -static void app_usbd_power_event_handler(nrf_drv_power_usb_evt_t event) -{ - switch(event) - { - case NRF_DRV_POWER_USB_EVT_DETECTED: - { - static const app_usbd_internal_evt_t ev = { - .type = APP_USBD_EVT_POWER_DETECTED - }; - app_usbd_event_add(&ev); - break; - } - case NRF_DRV_POWER_USB_EVT_REMOVED: - { - static const app_usbd_internal_evt_t ev = { - .type = APP_USBD_EVT_POWER_REMOVED - }; - app_usbd_event_add(&ev); - break; - } - case NRF_DRV_POWER_USB_EVT_READY: - { - static const app_usbd_internal_evt_t ev = { - .type = APP_USBD_EVT_POWER_READY - }; - app_usbd_event_add(&ev); - break; - } - default: - ASSERT(false); - } -} -#endif - -/** - * @brief Event handler. - * - * The function that pushes the event into the queue. - * @param p_event Event to push. - */ -static void app_usbd_event_handler(nrf_drv_usbd_evt_t const * const p_event) -{ - app_usbd_event_add((app_usbd_internal_evt_t const *)p_event); -} - -/** - * @brief HF clock ready event handler. - * - * Function that is called when high frequency clock is started. - * - * @param event Event type that comes from clock driver. - */ -static void app_usbd_hfclk_ready(nrf_drv_clock_evt_type_t event) -{ - ASSERT(NRF_DRV_CLOCK_EVT_HFCLK_STARTED == event); - static const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_HFCLK_READY - }; - app_usbd_event_add((app_usbd_internal_evt_t const * )&evt_data); -} - -/** - * @brief Check if the HFCLK was requested in selected suspend state machine state. - * - * - * @param sustate State to be checked. - * - * @retval true High frequency clock was requested in selected state. - * @retval false High frequency clock was released in selected state. - */ -static inline bool app_usbd_sustate_with_requested_hfclk(app_usbd_sustate_t sustate) -{ - switch(sustate) - { - case SUSTATE_STOPPED: return false; - case SUSTATE_STARTED: return false; - case SUSTATE_ACTIVE: return true; - case SUSTATE_SUSPENDING: return false; - case SUSTATE_SUSPEND: return false; - case SUSTATE_RESUMING: return true; - case SUSTATE_WAKINGUP_WAITING_HFCLK_WREQ: return true; - case SUSTATE_WAKINGUP_WAITING_HFCLK: return true; - case SUSTATE_WAKINGUP_WAITING_WREQ: return true; - default: - return false; - } -} - -/** - * @brief Check it the HFCLK is running in selected suspend state machine state. - * - * @param sustate State to be checked. - * - * @retval true High frequency clock is running in selected state. - * @retval false High frequency clock is released in selected state. - */ -static inline bool app_usbd_sustate_with_running_hfclk(app_usbd_sustate_t sustate) -{ - switch(sustate) - { - case SUSTATE_STOPPED: return false; - case SUSTATE_STARTED: return false; - case SUSTATE_ACTIVE: return true; - case SUSTATE_SUSPENDING: return false; - case SUSTATE_SUSPEND: return false; - case SUSTATE_RESUMING: return false; - case SUSTATE_WAKINGUP_WAITING_HFCLK_WREQ: return false; - case SUSTATE_WAKINGUP_WAITING_HFCLK: return false; - case SUSTATE_WAKINGUP_WAITING_WREQ: return true; - default: - return false; - } -} - -/** - * @brief Get current suspend state machine state. - * - * @return The state of the suspend state machine. - */ -static inline app_usbd_sustate_t sustate_get(void) -{ - return m_sustate; -} - -/** - * @brief Set current suspend state machine state. - * - * @param sustate The requested state of the state machine. - */ -static inline void sustate_set(app_usbd_sustate_t sustate) -{ - if (app_usbd_sustate_with_requested_hfclk(sustate) != app_usbd_sustate_with_requested_hfclk(m_sustate)) - { - if (app_usbd_sustate_with_requested_hfclk(sustate)) - { - static nrf_drv_clock_handler_item_t clock_handler_item = - { - .event_handler = app_usbd_hfclk_ready - }; - nrf_drv_clock_hfclk_request(&clock_handler_item); - } - else - { - nrf_drv_clock_hfclk_release(); - } - } - if (app_usbd_sustate_with_running_hfclk(sustate) != app_usbd_sustate_with_running_hfclk(m_sustate)) - { - if (app_usbd_sustate_with_running_hfclk(sustate)) - { - nrf_drv_usbd_active_irq_config(); - } - else - { - nrf_drv_usbd_suspend_irq_config(); - } - } - m_sustate = sustate; -} - -/** - * @brief Default selection function for interface. - * - * This function just enables and clears interface endpoints. - * - * @param[in] p_inst Class instance. - * @param[in] iface_idx Interface index. - * @param[in] alternate Interface alternate setting. - * - * @note Currently only alternate setting 0 is supported. - * - * @return Standard error code @ref ret_code_t - * @retval NRF_SUCCESS Endpoints enabled and cleared. - * @retval NRF_ERROR_INVALID_PARAM Unsupported alternate selected. - */ -static inline ret_code_t default_iface_select( - app_usbd_class_inst_t const * const p_inst, - uint8_t iface_idx, - uint8_t alternate) -{ - ASSERT(iface_idx <= app_usbd_class_iface_count_get(p_inst)); - - if (alternate != 0) - { - return NRF_ERROR_INVALID_PARAM; - } - - app_usbd_class_iface_conf_t const * p_iface = app_usbd_class_iface_get(p_inst, iface_idx); - uint8_t ep_count = app_usbd_class_iface_ep_count_get(p_iface); - - for (uint8_t i = 0; i < ep_count; ++i) - { - /* Enable every endpoint */ - app_usbd_class_ep_conf_t const * p_ep = app_usbd_class_iface_ep_get(p_iface, i); - app_usbd_ep_enable(p_ep->address); - } - return NRF_SUCCESS; -} - -/** - * @brief Default deselection function for interface. - * - * This function just disables all interface endpoints. - * - * @param[in] p_inst Class instance. - * @param[in] iface_idx Interface index. - */ -static inline void default_iface_deselect( - app_usbd_class_inst_t const * const p_inst, - uint8_t iface_idx) -{ - ASSERT(iface_idx <= app_usbd_class_iface_count_get(p_inst)); - - app_usbd_class_iface_conf_t const * p_iface = app_usbd_class_iface_get(p_inst, iface_idx); - uint8_t ep_count = app_usbd_class_iface_ep_count_get(p_iface); - - for (uint8_t i = 0; i < ep_count; ++i) - { - /* Disable every endpoint */ - app_usbd_class_ep_conf_t const * p_ep = app_usbd_class_iface_ep_get(p_iface, i); - app_usbd_ep_disable(p_ep->address); - } -} - - -/** @} */ - -#if (APP_USBD_PROVIDE_SOF_TIMESTAMP) || defined(__SDK_DOXYGEN__) -uint32_t app_usbd_sof_timestamp_get(void) -{ - return m_last_frame; -} -#endif - -ret_code_t app_usbd_init(app_usbd_config_t const * p_config) -{ - ASSERT(nrf_drv_clock_init_check()); - ret_code_t ret; - -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) || defined(__SDK_DOXYGEN__) - ret = NRF_ATFIFO_INIT(m_event_queue); - if (NRF_SUCCESS != ret) - { - return NRF_ERROR_INTERNAL; - } -#endif - - /* This is called at the beginning to secure multiple calls to init function */ - ret = nrf_drv_usbd_init(app_usbd_event_handler); - if (NRF_SUCCESS != ret) - { - return ret; - } - - /* Clear the variables */ - m_sustate = SUSTATE_STOPPED; - m_p_first_cinst = NULL; - m_p_first_sof_cinst = NULL; - memset(m_epin_conf , 0, sizeof(m_epin_conf )); - memset(m_epout_conf, 0, sizeof(m_epout_conf)); - /* Save the new configuration */ - if (p_config == NULL) - { - m_current_conf = m_default_conf; - } - else - { - m_current_conf = *p_config; - } - -#if (!(APP_USBD_CONFIG_EVENT_QUEUE_ENABLE)) - if(m_current_conf.ev_handler == NULL) - { - m_current_conf.ev_handler = m_default_conf.ev_handler; - } -#endif - -#if APP_USBD_CONFIG_POWER_EVENTS_PROCESS - ret = nrf_drv_power_init(NULL); - if ((ret != NRF_SUCCESS) && (ret != NRF_ERROR_MODULE_ALREADY_INITIALIZED)) - { - /* This should never happen */ - APP_ERROR_HANDLER(ret); - } -#endif - - /*Pin core class to required endpoints*/ - uint8_t iface_idx; - app_usbd_class_iface_conf_t const * p_iface; - app_usbd_class_inst_t const * const p_inst = app_usbd_core_instance_access(); - iface_idx = 0; - while ((p_iface = app_usbd_class_iface_get(p_inst, iface_idx++)) != NULL) - { - uint8_t ep_idx = 0; - app_usbd_class_ep_conf_t const * p_ep; - while ((p_ep = app_usbd_class_iface_ep_get(p_iface, ep_idx++)) != NULL) - { - app_usbd_ep_instance_set(app_usbd_class_ep_address_get(p_ep), p_inst); - } - } - - /* Successfully attached */ - const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_INST_APPEND - }; - - ret = class_event_handler(p_inst, (app_usbd_complex_evt_t const *)(&evt_data)); - if (NRF_SUCCESS != ret) - { - UNUSED_RETURN_VALUE(nrf_drv_usbd_uninit()); - return ret; - } - - return NRF_SUCCESS; -} - - -ret_code_t app_usbd_uninit(void) -{ -#if APP_USBD_CONFIG_POWER_EVENTS_PROCESS - nrf_drv_power_usbevt_uninit(); -#endif - - /* We get this error at very beginning but it would be used at the end of the function */ - const ret_code_t ret = nrf_drv_usbd_uninit(); - - /* Unchain instance list */ - app_usbd_class_inst_t const * * pp_inst; - pp_inst = &m_p_first_cinst; - while (NULL != (*pp_inst)) - { - app_usbd_class_inst_t const * * pp_next = &app_usbd_class_data_access(*pp_inst)->p_next; - (*pp_inst) = NULL; - pp_inst = pp_next; - } - - /* Unchain SOF list */ - pp_inst = &m_p_first_sof_cinst; - while (NULL != (*pp_inst)) - { - app_usbd_class_inst_t const * * pp_next = &app_usbd_class_data_access(*pp_inst)->p_sof_next; - (*pp_inst) = NULL; - pp_inst = pp_next; - } - - /* Unchain SOF interrupt list */ - pp_inst = &m_p_first_sof_interrupt_cinst; - while (NULL != (*pp_inst)) - { - app_usbd_class_inst_t const * * pp_next = &app_usbd_class_data_access(*pp_inst)->p_sof_next; - (*pp_inst) = NULL; - pp_inst = pp_next; - } - - /* Clear all endpoints configurations */ - memset(m_epin_conf , 0, sizeof(m_epin_conf )); - memset(m_epout_conf, 0, sizeof(m_epout_conf)); - /* Clear current configuration */ - memset(&m_current_conf, 0, sizeof(m_current_conf)); - - return ret; -} - - -#if APP_USBD_CONFIG_POWER_EVENTS_PROCESS -ret_code_t app_usbd_power_events_enable(void) -{ - if (!nrf_drv_usbd_is_initialized() || nrf_drv_usbd_is_enabled()) - { - return NRF_ERROR_INVALID_STATE; - } - - ASSERT((!APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) || (USBD_CONFIG_IRQ_PRIORITY == POWER_CONFIG_IRQ_PRIORITY)); - - ret_code_t ret; - static const nrf_drv_power_usbevt_config_t config = - { - .handler = app_usbd_power_event_handler - }; - - ret = nrf_drv_power_usbevt_init(&config); - APP_ERROR_CHECK(ret); - - return NRF_SUCCESS; -} -#endif /* APP_USBD_CONFIG_POWER_EVENTS_PROCESS */ - - -void app_usbd_enable(void) -{ - nrf_drv_usbd_enable(); -} - - -void app_usbd_disable(void) -{ - ASSERT(!nrf_drv_usbd_is_started()); - nrf_drv_usbd_disable(); -} - - -void app_usbd_start(void) -{ - ASSERT(nrf_drv_usbd_is_enabled()); - - /* Check if interface numbers are in correct order */ - if (APP_USBD_CONFIG_LOG_ENABLED) - { - uint8_t next_iface = 0; - for (app_usbd_class_inst_t const * * pp_inst = &m_p_first_cinst; - (*pp_inst) != NULL; - pp_inst = &(app_usbd_class_data_access(*pp_inst)->p_next)) - { - uint8_t iface_idx = 0; - app_usbd_class_iface_conf_t const * p_iface; - while (NULL != (p_iface = app_usbd_class_iface_get(*pp_inst, iface_idx++))) - { - if (p_iface->number != next_iface) - { - NRF_LOG_WARNING("Unexpected interface number, expected %d, got %d", - next_iface, - p_iface->number); - } - ++next_iface; - } - } - } - - /* Power should be already enabled - wait just in case if user calls - * app_usbd_start just after app_usbd_enable without waiting for the event. */ - while (!nrf_power_usbregstatus_outrdy_get()) - { - /* Wait for the power but terminate the function if USBD power disappears */ - if (!nrf_power_usbregstatus_vbusdet_get()) - return; - } - - static const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_START_REQ - }; - app_usbd_event_add((app_usbd_internal_evt_t const * )&evt_data); -} - - -void app_usbd_stop(void) -{ - const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_STOP_REQ - }; - app_usbd_event_add((app_usbd_internal_evt_t const * )&evt_data); -} - -void app_usbd_suspend_req(void) -{ - const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_SUSPEND_REQ - }; - app_usbd_event_add((app_usbd_internal_evt_t const * )&evt_data); -} - -bool app_usbd_wakeup_req(void) -{ - ASSERT(app_usbd_class_rwu_enabled_check()); - if (!app_usbd_core_feature_state_get(APP_USBD_SETUP_STDFEATURE_DEVICE_REMOTE_WAKEUP)) - return false; - - const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_WAKEUP_REQ - }; - app_usbd_event_add((app_usbd_internal_evt_t const * )&evt_data); - return true; -} - -bool app_usbd_active_check(void) -{ - return (sustate_get() == SUSTATE_ACTIVE); -} - -void app_usbd_event_execute(app_usbd_internal_evt_t const * const p_event) -{ - ASSERT(NULL != m_p_first_cinst); - /* If no event queue is implemented, it has to be ensured that this function is never called - * from the context higher than USB interrupt level - * If queue is implemented it would be called always from Thread level - * if the library is used correctly. - * NOTE: Higher interrupt level -> lower priority value. - */ - ASSERT(USBD_CONFIG_IRQ_PRIORITY <= current_int_priority_get()); - - /* Note - there should never be situation that event is generated on disconnected endpoint */ - switch (p_event->type) - { - case APP_USBD_EVT_START_REQ: - { - static const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_STARTED - }; - - /* Send event to all classes */ - UNUSED_RETURN_VALUE(app_usbd_core_handler_call((app_usbd_internal_evt_t const * )&evt_data)); - app_usbd_all_call((app_usbd_complex_evt_t const *)&evt_data); - user_event_state_proc(APP_USBD_EVT_STARTED); - - app_usbd_all_iface_deselect(); - app_usbd_core_ep0_disable(); - nrf_drv_usbd_start((NULL != m_p_first_sof_cinst) || (m_current_conf.enable_sof) || (APP_USBD_PROVIDE_SOF_TIMESTAMP)); - sustate_set(SUSTATE_STARTED); - break; - } - case APP_USBD_EVT_STOP_REQ: - { - static const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_STOPPED - }; - - app_usbd_all_iface_deselect(); - nrf_drv_usbd_stop(); - sustate_set(SUSTATE_STOPPED); - - /* Send event to all classes */ - app_usbd_all_call((app_usbd_complex_evt_t const * )&evt_data); - UNUSED_RETURN_VALUE(app_usbd_core_handler_call((app_usbd_internal_evt_t const *)&evt_data)); - user_event_state_proc(APP_USBD_EVT_STOPPED); - if (app_usbd_sustate_with_requested_hfclk(sustate_get())) - { - nrf_drv_clock_hfclk_release(); - } - - break; - } - case APP_USBD_EVT_HFCLK_READY: - { - switch(sustate_get()) - { - case SUSTATE_RESUMING: - { - sustate_set(SUSTATE_ACTIVE); - break; - } - case SUSTATE_WAKINGUP_WAITING_HFCLK_WREQ: - { - sustate_set(SUSTATE_WAKINGUP_WAITING_WREQ); - break; - } - case SUSTATE_WAKINGUP_WAITING_HFCLK: - { - sustate_set(SUSTATE_ACTIVE); - break; - } - default: - break; // Just ignore - it can happen in specific situation - } - break; - } - case APP_USBD_EVT_SUSPEND_REQ: - { - /* Suspend request can be only processed when we are in suspending state */ - if (SUSTATE_SUSPENDING == sustate_get()) - { - if (nrf_drv_usbd_suspend()) - { - sustate_set(SUSTATE_SUSPEND); - } - } - break; - } - case APP_USBD_EVT_WAKEUP_REQ: - { - /* Suspend temporary if no suspend function was called from the application. - * This makes it possible to generate APP_USBD_EVT_DRV_WUREQ event from the driver */ - if (sustate_get() == SUSTATE_SUSPENDING) - { - if (nrf_drv_usbd_suspend()) - { - sustate_set(SUSTATE_SUSPEND); - } - } - if (nrf_drv_usbd_wakeup_req()) - { - sustate_set(SUSTATE_WAKINGUP_WAITING_HFCLK_WREQ); - } - break; - } - - case APP_USBD_EVT_DRV_SOF: - { -#if (APP_USBD_PROVIDE_SOF_TIMESTAMP) || defined(__SDK_DOXYGEN__) - m_last_frame = p_event->drv_evt.data.sof.framecnt; -#endif - /* Wake up if suspended */ - if ((sustate_get() == SUSTATE_SUSPENDING) || (sustate_get() == SUSTATE_WAKINGUP_WAITING_WREQ)) - { - static const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_DRV_RESUME - }; - app_usbd_event_execute((app_usbd_internal_evt_t *)&evt_data); - } - - user_event_state_proc(APP_USBD_EVT_DRV_SOF); - - app_usbd_class_inst_t const * p_inst = app_usbd_class_sof_first_get(); - while (NULL != p_inst) - { - ret_code_t r = class_event_handler(p_inst, (app_usbd_complex_evt_t const *)p_event); - UNUSED_VARIABLE(r); - p_inst = app_usbd_class_sof_next_get(p_inst); - } - break; - } - - case APP_USBD_EVT_DRV_RESET: - { - app_usbd_all_iface_deselect(); - app_usbd_core_ep0_enable(); - sustate_set(SUSTATE_ACTIVE); - user_event_state_proc(APP_USBD_EVT_DRV_RESET); - /* Processing core interface (connected only to EP0) and then all instances from the list */ - UNUSED_RETURN_VALUE(app_usbd_core_handler_call(p_event)); - app_usbd_all_call((app_usbd_complex_evt_t const *)p_event); - break; - } - case APP_USBD_EVT_DRV_RESUME: - { - if (sustate_get() == SUSTATE_WAKINGUP_WAITING_WREQ) - { - sustate_set(SUSTATE_ACTIVE); - nrf_drv_usbd_force_bus_wakeup(); - } - else - { - sustate_set(SUSTATE_RESUMING); - } - user_event_state_proc(APP_USBD_EVT_DRV_RESUME); - /* Processing core interface (connected only to EP0) and then all instances from the list */ - UNUSED_RETURN_VALUE(app_usbd_core_handler_call(p_event)); - app_usbd_all_call((app_usbd_complex_evt_t const *)p_event); - break; - } - case APP_USBD_EVT_DRV_WUREQ: - { - static const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_DRV_RESUME - }; - user_event_state_proc(APP_USBD_EVT_DRV_RESUME); - /* Processing core interface (connected only to EP0) and then all instances from the list */ - UNUSED_RETURN_VALUE(app_usbd_core_handler_call((app_usbd_internal_evt_t const *)&evt_data)); - app_usbd_all_call((app_usbd_complex_evt_t const *)&evt_data); - - switch(sustate_get()) - { - case SUSTATE_WAKINGUP_WAITING_HFCLK_WREQ: - sustate_set(SUSTATE_WAKINGUP_WAITING_HFCLK); - break; - case SUSTATE_WAKINGUP_WAITING_WREQ: - sustate_set(SUSTATE_ACTIVE); - break; - default: - { - /* This should not happen - but try to recover by setting directly active state */ - NRF_LOG_WARNING("Unexpected state on WUREQ event (%u)", sustate_get()); - sustate_set(SUSTATE_ACTIVE); - } - } - break; - } - case APP_USBD_EVT_DRV_SUSPEND: - { - sustate_set(SUSTATE_SUSPENDING); - - user_event_state_proc(APP_USBD_EVT_DRV_SUSPEND); - - /* Processing all instances from the list and then core interface (connected only to EP0) */ - app_usbd_all_call((app_usbd_complex_evt_t const *)p_event); - UNUSED_RETURN_VALUE(app_usbd_core_handler_call(p_event)); - break; - } - - case APP_USBD_EVT_STATE_CHANGED: - { - user_event_state_proc(APP_USBD_EVT_STATE_CHANGED); - /* Processing all instances from the list and then core interface (connected only to EP0) */ - app_usbd_all_call((app_usbd_complex_evt_t const *)p_event); - break; - } - - case APP_USBD_EVT_DRV_SETUP: - { - UNUSED_RETURN_VALUE(app_usbd_core_handler_call(p_event)); - break; - } - - case APP_USBD_EVT_SETUP_SETADDRESS: - { - UNUSED_RETURN_VALUE(app_usbd_core_handler_call(p_event)); - break; - } - - case APP_USBD_EVT_DRV_EPTRANSFER: - { - app_usbd_ep_conf_t const * p_ep_conf = - app_usbd_ep_conf_access(p_event->drv_evt.data.eptransfer.ep); - ASSERT(NULL != p_ep_conf->p_cinst); - ASSERT(NULL != p_ep_conf->event_handler); - - if (NRF_SUCCESS != p_ep_conf->event_handler(p_ep_conf->p_cinst, - (app_usbd_complex_evt_t const *)p_event)) - { - /* If error returned, every bulk/interrupt endpoint would be stalled */ - if (!(0 == NRF_USBD_EP_NR_GET(p_event->drv_evt.data.eptransfer.ep) || - NRF_USBD_EPISO_CHECK(p_event->drv_evt.data.eptransfer.ep))) - { - nrf_drv_usbd_ep_stall(p_event->drv_evt.data.eptransfer.ep); - } - } - break; - } -#if APP_USBD_CONFIG_POWER_EVENTS_PROCESS - case APP_USBD_EVT_POWER_DETECTED: - { - user_event_state_proc(APP_USBD_EVT_POWER_DETECTED); - app_usbd_all_call((app_usbd_complex_evt_t const *)p_event); - break; - } - case APP_USBD_EVT_POWER_REMOVED: - { - user_event_state_proc(APP_USBD_EVT_POWER_REMOVED); - app_usbd_all_call((app_usbd_complex_evt_t const *)p_event); - break; - } - case APP_USBD_EVT_POWER_READY: - { - user_event_state_proc(APP_USBD_EVT_POWER_READY); - app_usbd_all_call((app_usbd_complex_evt_t const *)p_event); - break; - } -#endif - default: - ASSERT(0); - break; - } -} - - -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) || defined(__SDK_DOXYGEN__) -bool app_usbd_event_queue_process(void) -{ -#if (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - app_usbd_internal_evt_t sof_event = { - .app_evt.type = APP_USBD_EVT_DRV_SOF - }; -#endif // (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - static nrf_atfifo_item_get_t cx; - static app_usbd_internal_queue_evt_t * p_event_item = NULL; - if (NULL == p_event_item) - { - p_event_item = nrf_atfifo_item_get(m_event_queue, &cx); - } - - if (NULL != p_event_item) - { - -#if (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - if (p_event_item->sof_cnt > 0) - { - if (p_event_item->start_frame > USBD_FRAMECNTR_FRAMECNTR_Msk) - { - p_event_item->start_frame = 0; - } - sof_event.drv_evt.data.sof.framecnt = (p_event_item->start_frame)++; - --(p_event_item->sof_cnt); - app_usbd_event_execute(&sof_event); - return true; - } -#endif // (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - - app_usbd_event_execute(&(p_event_item->evt)); - UNUSED_RETURN_VALUE(nrf_atfifo_item_free(m_event_queue, &cx)); - p_event_item = NULL; - return true; - } -#if (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - else if (m_sof_events_cnt > 0) - { - CRITICAL_REGION_ENTER(); - if (m_event_frame > USBD_FRAMECNTR_FRAMECNTR_Msk) - { - m_event_frame = 0; - } - sof_event.drv_evt.data.sof.framecnt = m_event_frame++; - UNUSED_RETURN_VALUE(nrf_atomic_u32_sub_hs(&m_sof_events_cnt, 1)); - CRITICAL_REGION_EXIT(); - app_usbd_event_execute(&sof_event); - return true; - } -#endif // (APP_USBD_CONFIG_SOF_HANDLING_MODE == APP_USBD_SOF_HANDLING_COMPRESS_QUEUE) - else - { - return false; - } -} -#endif - - -ret_code_t app_usbd_class_append(app_usbd_class_inst_t const * p_cinst) -{ - ASSERT(NULL != p_cinst); - ASSERT(NULL != p_cinst->p_class_methods); - ASSERT(NULL != p_cinst->p_class_methods->event_handler); - ASSERT(NULL == app_usbd_class_data_access(p_cinst)->p_next); - - /* This should be only called if USBD is disabled - * We simply assume that USBD is enabled if its interrupts are */ - ASSERT(!nrf_drv_usbd_is_enabled() && nrf_drv_usbd_is_initialized()); - - /* Check if all required endpoints are available - * Checking is splitted from setting to avoid situation that anything - * is modified and then operation finishes with error */ - uint8_t iface_idx; - app_usbd_class_iface_conf_t const * p_iface; - - iface_idx = 0; - while (NULL != (p_iface = app_usbd_class_iface_get(p_cinst, iface_idx++))) - { - uint8_t ep_idx = 0; - app_usbd_class_ep_conf_t const * p_ep; - while (NULL != (p_ep = app_usbd_class_iface_ep_get(p_iface, ep_idx++))) - { - if (NULL != app_usbd_ep_instance_get(app_usbd_class_ep_address_get(p_ep))) - { - return NRF_ERROR_BUSY; - } - } - } - - /* Connecting all required endpoints */ - iface_idx = 0; - while (NULL != (p_iface = app_usbd_class_iface_get(p_cinst, iface_idx++))) - { - uint8_t ep_idx = 0; - app_usbd_class_ep_conf_t const * p_ep; - while (NULL != (p_ep = app_usbd_class_iface_ep_get(p_iface, ep_idx++))) - { - app_usbd_ep_instance_set(app_usbd_class_ep_address_get(p_ep), p_cinst); - } - } - - /* Adding pointer to this instance to the end of the chain */ - app_usbd_class_inst_t const * * pp_last = &m_p_first_cinst; - while (NULL != (*pp_last)) - { - ASSERT((*pp_last) != p_cinst); - pp_last = &(app_usbd_class_data_access(*pp_last)->p_next); - } - (*pp_last) = p_cinst; - - /* Successfully attached */ - const app_usbd_evt_t evt_data = {.type = APP_USBD_EVT_INST_APPEND }; - return class_event_handler(p_cinst, (app_usbd_complex_evt_t const *)(&evt_data)); -} - - -ret_code_t app_usbd_class_remove(app_usbd_class_inst_t const * p_cinst) -{ - ASSERT(NULL != p_cinst); - ASSERT(NULL != p_cinst->p_class_methods); - ASSERT(NULL != p_cinst->p_class_methods->event_handler); - /* This function should be only called if USBD is disabled */ - ASSERT(!nrf_drv_usbd_is_enabled() && nrf_drv_usbd_is_initialized()); - ret_code_t ret; - /* Remove this class from the chain */ - app_usbd_class_inst_t const * * pp_last = &m_p_first_cinst; - while (NULL != (*pp_last)) - { - if ((*pp_last) == p_cinst) - { - /* Inform class instance that removing process is going to be started */ - const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_INST_REMOVE - }; - ret = class_event_handler(p_cinst, (app_usbd_complex_evt_t const *)(&evt_data)); - if (ret != NRF_SUCCESS) - { - return ret; - } - - /* Breaking chain */ - (*pp_last) = (app_usbd_class_data_access(p_cinst)->p_next); - app_usbd_class_data_access(p_cinst)->p_next = NULL; - - /* Disconnecting endpoints */ - uint8_t ep_idx; - for (ep_idx = 0; ep_idx < NRF_USBD_EPIN_CNT; ++ep_idx) - { - nrf_drv_usbd_ep_t ep = NRF_DRV_USBD_EPIN(ep_idx); - if (app_usbd_ep_instance_get(ep) == p_cinst) - { - app_usbd_ep_instance_set(ep, NULL); - } - } - for (ep_idx = 0; ep_idx < NRF_USBD_EPOUT_CNT; ++ep_idx) - { - nrf_drv_usbd_ep_t ep = NRF_DRV_USBD_EPOUT(ep_idx); - if (app_usbd_ep_instance_get(ep) == p_cinst) - { - app_usbd_ep_instance_set(ep, NULL); - } - } - - return NRF_SUCCESS; - } - pp_last = &(app_usbd_class_data_access(*pp_last)->p_next); - } - - return NRF_ERROR_NOT_FOUND; -} - - -ret_code_t app_usbd_class_remove_all(void) -{ - ret_code_t ret = NRF_SUCCESS; - while (NULL != m_p_first_cinst) - { - ret = app_usbd_class_remove(m_p_first_cinst); - if (ret != NRF_SUCCESS) - { - break; - } - } - - return ret; -} - - -ret_code_t app_usbd_ep_handler_set(app_usbd_class_inst_t const * const p_cinst, - nrf_drv_usbd_ep_t ep, - app_usbd_ep_event_handler_t handler) -{ - ASSERT(NULL != p_cinst); - ASSERT(NULL != handler); - /* This function should be only called if USBD is disabled */ - ASSERT(!nrf_drv_usbd_is_enabled() && nrf_drv_usbd_is_initialized()); - - if (p_cinst != app_usbd_ep_instance_get(ep)) - { - return NRF_ERROR_INVALID_PARAM; - } - - (app_usbd_ep_conf_access(ep))->event_handler = handler; - return NRF_SUCCESS; -} - - -ret_code_t app_usbd_class_sof_register(app_usbd_class_inst_t const * p_cinst) -{ - ASSERT(NULL != p_cinst); - ASSERT(NULL != p_cinst->p_class_methods); - ASSERT(NULL != p_cinst->p_class_methods->event_handler); - /* This function should be only called if USBD is disabled */ - ASSERT(!nrf_drv_usbd_is_enabled() && nrf_drv_usbd_is_initialized()); - - /* Make sure it's not in interrupt SOF list */ - app_usbd_class_inst_t const * * pp_last = &m_p_first_sof_interrupt_cinst; - while (NULL != (*pp_last)) - { - ASSERT((*pp_last) != p_cinst); - pp_last = &(app_usbd_class_data_access(*pp_last)->p_sof_next); - } - - /* Next SOF event requiring instance has to be NULL now */ - ASSERT(NULL == (app_usbd_class_data_access(p_cinst)->p_sof_next)); - - /* Adding pointer to this instance to the end of the chain */ - pp_last = &m_p_first_sof_cinst; - while (NULL != (*pp_last)) - { - ASSERT((*pp_last) != p_cinst); - pp_last = &(app_usbd_class_data_access(*pp_last)->p_sof_next); - } - (*pp_last) = p_cinst; - - return NRF_SUCCESS; -} - - -ret_code_t app_usbd_class_sof_unregister(app_usbd_class_inst_t const * p_cinst) -{ - ASSERT(NULL != p_cinst); - /** This function should be only called if USBD is disabled */ - ASSERT(!nrf_drv_usbd_is_enabled() && nrf_drv_usbd_is_initialized()); - - app_usbd_class_inst_t const * * pp_last = &m_p_first_sof_cinst; - while (NULL != (*pp_last)) - { - if ((*pp_last) == p_cinst) - { - /* Breaking chain */ - (*pp_last) = (app_usbd_class_data_access(p_cinst)->p_sof_next); - app_usbd_class_data_access(p_cinst)->p_sof_next = NULL; - - return NRF_SUCCESS; - } - pp_last = &(app_usbd_class_data_access(*pp_last)->p_sof_next); - } - return NRF_ERROR_NOT_FOUND; -} - -ret_code_t app_usbd_class_sof_interrupt_register(app_usbd_class_inst_t const * p_cinst, app_usbd_sof_interrupt_handler_t handler) -{ - ASSERT(NULL != p_cinst); - ASSERT(NULL != p_cinst->p_class_methods); - ASSERT(NULL != handler); - /* This function should be only called if USBD is disabled */ - ASSERT(!nrf_drv_usbd_is_enabled() && nrf_drv_usbd_is_initialized()); - - /* Next SOF event requiring instance has to be NULL now */ - ASSERT(NULL == (app_usbd_class_data_access(p_cinst)->p_sof_next)); - - app_usbd_class_data_access(p_cinst)->sof_handler = handler; - - /* Make sure it's not in normal SOF list */ - app_usbd_class_inst_t const * * pp_last = &m_p_first_sof_cinst; - while (NULL != (*pp_last)) - { - ASSERT((*pp_last) != p_cinst); - pp_last = &(app_usbd_class_data_access(*pp_last)->p_sof_next); - } - - /* Adding pointer to this instance to the end of the interrupt chain */ - pp_last = &m_p_first_sof_interrupt_cinst; - while (NULL != (*pp_last)) - { - - ASSERT((*pp_last) != p_cinst); - pp_last = &(app_usbd_class_data_access(*pp_last)->p_sof_next); - } - (*pp_last) = p_cinst; - - return NRF_SUCCESS; -} - - -ret_code_t app_usbd_class_sof_interrupt_unregister(app_usbd_class_inst_t const * p_cinst) -{ - ASSERT(NULL != p_cinst); - /** This function should be only called if USBD is disabled */ - ASSERT(!nrf_drv_usbd_is_enabled() && nrf_drv_usbd_is_initialized()); - - app_usbd_class_inst_t const * * pp_last = &m_p_first_sof_interrupt_cinst; - while (NULL != (*pp_last)) - { - if ((*pp_last) == p_cinst) - { - /* Breaking chain */ - (*pp_last) = (app_usbd_class_data_access(p_cinst)->p_sof_next); - app_usbd_class_data_access(p_cinst)->p_sof_next = NULL; - - return NRF_SUCCESS; - } - pp_last = &(app_usbd_class_data_access(*pp_last)->p_sof_next); - } - return NRF_ERROR_NOT_FOUND; -} - -ret_code_t app_usbd_class_rwu_register(app_usbd_class_inst_t const * const p_inst) -{ - ASSERT(p_inst != NULL); - ++m_rwu_registered_counter; - /*Overflow check*/ - ASSERT(m_rwu_registered_counter != 0); - - return NRF_SUCCESS; -} - - -ret_code_t app_usbd_class_rwu_unregister(app_usbd_class_inst_t const * const p_inst) -{ - ASSERT(p_inst != NULL); - /* Usage validation. If counter is 0 unregister is not possible.*/ - ASSERT(m_rwu_registered_counter != 0); - --m_rwu_registered_counter; - - return NRF_SUCCESS; -} - -bool app_usbd_class_rwu_enabled_check(void) -{ - return (m_rwu_registered_counter != 0); -} - -ret_code_t app_usbd_interface_ep_reset(app_usbd_class_inst_t const * const p_cinst, - uint8_t iface) -{ - uint8_t iface_count = app_usbd_class_iface_count_get(p_cinst); - - app_usbd_class_iface_conf_t const * p_iface = NULL; - for (uint8_t j = 0; j < iface_count; ++j) - { - p_iface = app_usbd_class_iface_get(p_cinst, j); - if (app_usbd_class_iface_number_get(p_iface) == iface) - { - break; - } - } - - if (p_iface == NULL) - { - return NRF_ERROR_NOT_SUPPORTED; - } - - uint8_t ep_count = app_usbd_class_iface_ep_count_get(p_iface); - - for (uint8_t j = 0; j < ep_count; ++j) - { - /*Clear stall for every endpoint*/ - app_usbd_class_ep_conf_t const * p_ep = app_usbd_class_iface_ep_get(p_iface, j); - - if (!NRF_USBD_EPISO_CHECK(p_ep->address)) - { - nrf_drv_usbd_ep_dtoggle_clear(p_ep->address); - nrf_drv_usbd_ep_stall_clear(p_ep->address); - } - - } - - return NRF_SUCCESS; -} - -void app_usbd_ep_enable(nrf_drv_usbd_ep_t ep) -{ - if (!NRF_USBD_EPISO_CHECK(ep)) - { - nrf_drv_usbd_ep_dtoggle_clear(ep); - nrf_drv_usbd_ep_stall_clear(ep); - } - nrf_drv_usbd_ep_enable(ep); -} - -void app_usbd_ep_disable(nrf_drv_usbd_ep_t ep) -{ - nrf_drv_usbd_ep_disable(ep); -} - - -app_usbd_class_inst_t const * app_usbd_class_first_get(void) -{ - return m_p_first_cinst; -} - -app_usbd_class_inst_t const * app_usbd_class_sof_first_get(void) -{ - return m_p_first_sof_cinst; -} - -app_usbd_class_inst_t const * app_usbd_class_sof_interrupt_first_get(void) -{ - return m_p_first_sof_interrupt_cinst; -} - -app_usbd_class_inst_t const * app_usbd_iface_find(uint8_t iface, uint8_t * p_iface_idx) -{ - app_usbd_class_inst_t const * p_inst = app_usbd_class_first_get(); - while (p_inst != NULL) - { - uint8_t iface_count = app_usbd_class_iface_count_get(p_inst); - /* Iterate over interfaces */ - for (uint8_t i = 0; i < iface_count; ++i) - { - app_usbd_class_iface_conf_t const * p_iface; - p_iface = app_usbd_class_iface_get(p_inst, i); - if (app_usbd_class_iface_number_get(p_iface) == iface) - { - if (p_iface_idx != NULL) - { - (*p_iface_idx) = i; - } - return p_inst; - } - } - p_inst = app_usbd_class_next_get(p_inst); - } - return NULL; -} - -ret_code_t app_usbd_iface_call( - app_usbd_class_inst_t const * const p_class_inst, - uint8_t iface_idx, - app_usbd_complex_evt_t const * const p_event) -{ - UNUSED_PARAMETER(iface_idx); - return class_event_handler(p_class_inst, p_event); -} - -ret_code_t app_usbd_ep_call(nrf_drv_usbd_ep_t ep, app_usbd_complex_evt_t const * const p_event) -{ - if (NRF_USBD_EP_VALIDATE(ep)) - { - app_usbd_class_inst_t const * p_inst = app_usbd_ep_conf_access(ep)->p_cinst; - if (p_inst != NULL) - { - return class_event_handler(p_inst, p_event); - } - } - return NRF_ERROR_INVALID_ADDR; -} - -void app_usbd_all_call(app_usbd_complex_evt_t const * const p_event) -{ - app_usbd_class_inst_t const * p_inst; - for (p_inst = app_usbd_class_first_get(); NULL != p_inst; - p_inst = app_usbd_class_next_get(p_inst)) - { - UNUSED_RETURN_VALUE(class_event_handler(p_inst, p_event)); - } -} - -ret_code_t app_usbd_all_until_served_call(app_usbd_complex_evt_t const * const p_event) -{ - app_usbd_class_inst_t const * p_inst; - ret_code_t ret = NRF_ERROR_NOT_SUPPORTED; - /* Try to process via every instance */ - for (p_inst = app_usbd_class_first_get(); NULL != p_inst; - p_inst = app_usbd_class_next_get(p_inst)) - { - - ret = class_event_handler(p_inst, p_event); - if (NRF_ERROR_NOT_SUPPORTED != ret) - { - /* Processing finished */ - break; - } - } - - return ret; -} - -ret_code_t app_usbd_ep_transfer( - nrf_drv_usbd_ep_t ep, - nrf_drv_usbd_transfer_t const * const p_transfer) -{ - if (!nrf_drv_usbd_ep_enable_check(ep)) - { - return NRF_ERROR_INVALID_STATE; - } - if (m_sustate != SUSTATE_ACTIVE) - { - return NRF_ERROR_INVALID_STATE; - } - return nrf_drv_usbd_ep_transfer(ep, p_transfer); -} - -ret_code_t app_usbd_ep_handled_transfer( - nrf_drv_usbd_ep_t ep, - nrf_drv_usbd_handler_desc_t const * const p_handler) -{ - if (!nrf_drv_usbd_ep_enable_check(ep)) - { - return NRF_ERROR_INVALID_STATE; - } - if (m_sustate != SUSTATE_ACTIVE) - { - return NRF_ERROR_INVALID_STATE; - } - return nrf_drv_usbd_ep_handled_transfer(ep, p_handler); -} - -ret_code_t app_usbd_iface_select( - app_usbd_class_inst_t const * const p_inst, - uint8_t iface_idx, - uint8_t alternate) -{ - ret_code_t ret = NRF_ERROR_NOT_SUPPORTED; - - if (p_inst->p_class_methods->iface_select != NULL) - { - ret = p_inst->p_class_methods->iface_select(p_inst, iface_idx, alternate); - } - - if(ret == NRF_ERROR_NOT_SUPPORTED) - { - ret = default_iface_select(p_inst, iface_idx, alternate); - } - return ret; -} - -void app_usbd_iface_deselect( - app_usbd_class_inst_t const * const p_inst, - uint8_t iface_idx) -{ - if (p_inst->p_class_methods->iface_deselect != NULL) - { - p_inst->p_class_methods->iface_deselect(p_inst, iface_idx); - } - default_iface_deselect(p_inst, iface_idx); -} - -uint8_t app_usbd_iface_selection_get( - app_usbd_class_inst_t const * const p_inst, - uint8_t iface_idx) -{ - uint8_t alt = 0; - if (p_inst->p_class_methods->iface_selection_get != NULL) - { - alt = p_inst->p_class_methods->iface_selection_get(p_inst, iface_idx); - } - return alt; -} - -void app_usbd_all_iface_select_0(void) -{ - app_usbd_class_inst_t const * p_inst = app_usbd_class_first_get(); - while (p_inst != NULL) - { - uint8_t iface_count = app_usbd_class_iface_count_get(p_inst); - for (uint8_t i = 0; i < iface_count; ++i) - { - ret_code_t ret; - ret = app_usbd_iface_select(p_inst, i, 0); - ASSERT(ret == NRF_SUCCESS); - UNUSED_VARIABLE(ret); - } - p_inst = app_usbd_class_next_get(p_inst); - } -} - -void app_usbd_all_iface_deselect(void) -{ - app_usbd_class_inst_t const * p_inst = app_usbd_class_first_get(); - while (p_inst != NULL) - { - uint8_t iface_count = app_usbd_class_iface_count_get(p_inst); - for (uint8_t i = 0; i < iface_count; ++i) - { - app_usbd_iface_deselect(p_inst, i); - } - p_inst = app_usbd_class_next_get(p_inst); - } -} - -#endif //NRF_MODULE_ENABLED(APP_USBD) diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd.h deleted file mode 100644 index c5369fc9d..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd.h +++ /dev/null @@ -1,816 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef APP_USBD_H__ -#define APP_USBD_H__ - -#include "nrf_drv_usbd.h" -#include "app_usbd_types.h" -#include "app_usbd_class_base.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup app_usbd USB Device high level library - * @ingroup app_common - * - * @brief @tagAPI52840 Module for easy support for any USB device configuration. - * - * This module manages class instances that would create the USB device, - * manages endpoints and interfaces transactions. - * @{ - */ - -/** - * @brief Highest value of Frame Number in SOF packets. - */ -#define APP_USBD_SOF_MAX 2047 - -/** - * @brief True if SOF timestamping is really provided. - * - * SOF timestamping is really provided if it was requested and if the logger is enabled. - */ -#if ((APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE) && (NRF_LOG_ENABLED)) -#define APP_USBD_PROVIDE_SOF_TIMESTAMP 1 -#else -#define APP_USBD_PROVIDE_SOF_TIMESTAMP 0 -#endif - -/** - * @brief SOF event handling modes. - */ -#define APP_USBD_SOF_HANDLING_NORMAL_QUEUE 0 //!< Push SOF events into event queue. -#define APP_USBD_SOF_HANDLING_COMPRESS_QUEUE 1 //!< Compress SOF events. -#define APP_USBD_SOF_HANDLING_INTERRUPT 2 //!< Handle SOF events in interrupt. - -/** - * @brief Configuration passed to @ref app_usbd_init. - */ -typedef struct { -#if (!(APP_USBD_CONFIG_EVENT_QUEUE_ENABLE)) || defined(__SDK_DOXYGEN__) - /** - * @brief User defined event handler. - * - * This function is called on every event from the interrupt. - * It is prepared for external user function that would queue events to be processed - * from the main context. - * It should be used with operating systems with its own implementation of the queue. - * - * @param p_event The event structure pointer. - * - * @note This field is available only when USB internal queue is disabled - * (see @ref APP_USBD_CONFIG_EVENT_QUEUE_ENABLE). - */ - void (*ev_handler)(app_usbd_internal_evt_t const * const p_event); -#endif - -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) || defined(__SDK_DOXYGEN__) - /** - * @brief User defined event handler. - * - * This function is called on every event from the interrupt. - * - * @param p_event The event structure pointer. - * @param queued The event is visible in the queue. - * If queue conflict is detected the event might not be accessible inside queue - * until all write operations finish. - * See @ref nrf_atfifo for more details. - * - * @note This field is available only when USBD internal queue is configured - * (see @ref APP_USBD_CONFIG_EVENT_QUEUE_ENABLE). - * - * @note If is set to NULL no event would be called from interrupt. - * @note This function is called before event is processed. - * It means that if the event type is @ref APP_USBD_EVT_DRV_SETUP, - * there would not be setup field present in the event structure. - */ - void (*ev_isr_handler)(app_usbd_internal_evt_t const * const p_event, bool queued); -#endif - - /** - * @brief User defined event processor - * - * This function is called while state event is processed. - * - * * @note This field is available only when USBD internal queue is configured - * (see @ref APP_USBD_CONFIG_EVENT_QUEUE_ENABLE). - * - * @param event Event type. - * Only following events are sent into this function: - * - APP_USBD_EVT_DRV_SOF - * - APP_USBD_EVT_DRV_RESET - Note that it also exits suspend - * - APP_USBD_EVT_DRV_SUSPEND - * - APP_USBD_EVT_DRV_RESUME - It is also generated when remote wakeup is generated - * - APP_USBD_EVT_START - * - APP_USBD_EVT_STOP - * - APP_USBD_EVT_STATE_CHANGED - * - APP_USBD_EVT_POWER_DETECTED - * - APP_USBD_EVT_POWER_REMOVED - * - APP_USBD_EVT_POWER_READY - */ - void (*ev_state_proc)(app_usbd_event_type_t event); - - /** - * @brief SOF processing required by the user event processing. - * - * This flag would enable SOF processing for the user events regardless of the fact if any - * of the implemented class requires SOF event. - * - * @note SOF event would be enabled anyway if any of the appended class requires SOF processing. - */ - bool enable_sof; -} app_usbd_config_t; - - -#if (APP_USBD_PROVIDE_SOF_TIMESTAMP) || defined(__SDK_DOXYGEN__) -/** - * @brief Timestamp function for the logger. - * - * @return Current frame number taken directly from the last processed SOF. - */ -uint32_t app_usbd_sof_timestamp_get(void); -#endif - -/** - * @brief USB library initialization. - * - * Call this function before any configuration or class attachment. - * USBD peripheral would be ready to accept commands, and library would be ready, - * but it would not be connected to the bus. - * Call @ref app_usbd_enable to enable USBD communication with the host. - * - * @param p_config Configuration. NULL pointer might be passed here and default - * configuration will be applied then. - */ -ret_code_t app_usbd_init(app_usbd_config_t const * p_config); - -/** - * @brief USB library un-initialization. - * - * @note Currently not supported. - */ -ret_code_t app_usbd_uninit(void); - -#if (APP_USBD_CONFIG_POWER_EVENTS_PROCESS) || defined(__SDK_DOXYGEN__) -/** - * @brief Function to start USB related power events processing. - * - * This function should be called after @ref app_usbd_init and after all the - * required classes were appended (@ref app_usbd_class_append). - * - * @retval NRF_SUCCESS Power events successfully initialized. - * @retval NRF_ERROR_INVALID_STATE The state of the driver does not allow to enable - * the power events processing. - */ -ret_code_t app_usbd_power_events_enable(void); -#endif - -/** - * @brief Enable USBD. - * - * USBD is enabled. - * Since now the high frequency clock may be requested when USB RESET would be detected. - */ -void app_usbd_enable(void); - -/** - * @brief Disable USBD. - * - * Disabled USDB peripheral cannot be accessed but also stops requesting - * High Frequency clock and releases power regulator. - * - * @note This function cannot be called when USB is started. Stop it first. - */ -void app_usbd_disable(void); - -/** - * @brief Request USBD to start. - * - * The function sends start request to the event queue. - * If the queue is enabled (@ref APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) it would be processed - * when the queue is processed. - * If queue is disabled it would be processed immediately inside this function. - * It means that if queue is disabled this function cannot be called from interrupt with priority - * higher than USB interrupt. - * - * When start is processed it would: - * 1. Start library. - * 2. Enable interrupts. - * 3. Enable USB pull-ups. - * - * @note - * In some specific circumstances the library can be left not started and this function would - * silently exit. - * This may happen if some glitches appears on USB power line or if the plug was disconnected before - * whole starting process finishes. - * User would get the event from POWER peripheral then. - * Also no @ref APP_USBD_EVT_STARTED event would be generated to the classes and user event handler. - * For the safe code it is recommended to wait for @ref APP_USBD_EVT_STARTED event if anything - * has to be initialized after USB driver is started (just before enabling the interrupts). - * If library is properly started the @ref APP_USBD_EVT_STARTED event passed to the user handler - * from this function body. - */ -void app_usbd_start(void); - -/** - * @brief Stop USB. - * - * The function sends stop request to the event queue. - * If the queue is enabled (@ref APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) it would be processed - * when the queue is processed. - * If queue is disabled it would be processed immediately inside this function. - * It means that if queue is disabled this function cannot be called from interrupt with priority - * higher than USB interrupt. - * - * When the event is processed interrupts and USB pull-ups are disabled. - * The peripheral itself is left enabled so it can be programmed, - * but a HOST sees it as a peripheral disconnection. - * - * @note - * If the library is not started when this function is called it exits silently - also - * no @ref APP_USBD_EVT_STOPPED is generated. - */ -void app_usbd_stop(void); - -/** - * @brief Request library to suspend. - * - * This function send suspend request to the event queue. - * - * @note This function should only be called after @ref APP_USBD_EVT_DRV_SUSPEND os received. - * Internal suspend request processing would give no effect if the bus is not in suspend state. - */ -void app_usbd_suspend_req(void); - -/** - * @brief Request library to wake-up. - * - * This function send wakeup request to the event queue. - * - * @note Calling this function does not mean that peripheral is active - the wakeup request is sent - * into message queue and needs to be processed. - * - * @retval true Wakeup generation has been started. - * @retval false No wakeup would be generated becouse it is disabled by the host. - */ -bool app_usbd_wakeup_req(void); - -/** - * @brief Get information whether there is an active connection. - * - * Function to check if the communication with the bus is possible. - * - * @retval true The bus is active. - * @retval false There is no connection or bus is suspended. - */ -bool app_usbd_active_check(void); - -/** - * @brief USBD event processor. - * - * Function to be called on each event to be processed by the library. - */ -void app_usbd_event_execute(app_usbd_internal_evt_t const * const p_event); - - -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) || defined(__SDK_DOXYGEN__) -/** - * @brief Function that process events from the queue. - * - * @note This function calls @ref app_usbd_event_execute internally. - * - * @retval true Event was processed. - * @retval false The event queue is empty. - */ -bool app_usbd_event_queue_process(void); -#endif - -/** - * @brief Add class instance. - * - * This function connects given instance into internal class instance chain and - * into all required endpoints. - * The instance event handler would be connected into endpoint by default, - * but this can be overwritten by @ref app_usbd_ep_handler_set. - * - * After successful attachment @ref APP_USBD_EVT_INST_APPEND would be passed to class instance. - * - * @note This function can only be called after USBD library is initialized but still disabled. - * Assertion would be generated otherwise. - * - * @param[in,out] p_cinst Instance to connect. Chain data would be written into writable instance data. - * - * @retval NRF_SUCCESS Instance successfully added. - * @retval NRF_ERROR_BUSY Endpoint(s) not available. - */ -ret_code_t app_usbd_class_append(app_usbd_class_inst_t const * p_cinst); - -/** - * @brief Remove class instance. - * - * Instance is removed from instance chain. - * Instance and event handlers are removed also from endpoints. - * Endpoints used by by the class instance are left disabled. - * - * @note This function can only be called after USBD library is initialized but still disabled. - * Assertion would be generated otherwise. - * - * @param p_cinst Instance pointer to remove. - * - * @retval NRF_SUCCESS Instance successfully removed. - * @retval NRF_ERROR_NOT_FOUND Instance not found in the instance chain. - */ -ret_code_t app_usbd_class_remove(app_usbd_class_inst_t const * p_cinst); - -/** - * @brief Remove all class instances. - * - * This function basically calls @ref app_usbd_class_remove - * on instances chain as long as there is any element left. - * - * @note This function can only be called after USBD library is initialized but still disabled. - * Assertion would be generated otherwise. - * - * @sa app_usbd_class_remove - * - * @return Is should always return @ref NRF_SUCCESS. - * Any error value returned would mean there is an error inside the library. - */ -ret_code_t app_usbd_class_remove_all(void); - -/** - * @brief Change endpoint handler. - * - * This function may be called for the endpoint only if the class instance is - * already properly attached by the @ref app_usbd_class_append function. - * - * The endpoint event handler function can be only overwritten by the class instance - * that was connected into the endpoint. - * - * @note This function can only be called after USBD library is initialized but still disabled. - * Assertion would be generated otherwise. - * - * @param[in] p_cinst Instance of a class that wish to set new event handler. - * It has to match currently configured instance for the selected endpoint. - * In other situation error would be returned. - * @param[in] ep Endpoint address to configure. - * @param[in] handler Event handler function to set. - * - * @retval NRF_SUCCESS New handler successfully set - * @retval NRF_ERROR_INVALID_PARAM p_cinst is not the same as currently set for the endpoint - */ -ret_code_t app_usbd_ep_handler_set(app_usbd_class_inst_t const * p_cinst, - nrf_drv_usbd_ep_t ep, - app_usbd_ep_event_handler_t handler); - -/** - * @brief Register class instance as the one that requires SOF events. - * - * This function should be called in reaction on APP_USBD_EVT_INST_APPEND event. - * Connect the class instance to the list of instances that requires SOF processing. - * If none of the appended instances requires SOF event - it is disabled. - * - * @param p_cinst Instance that requires SOF event. - * - * @retval NRF_SUCCESS Instance linked into SOF processing list. - * - * @sa app_usbd_class_sof_unregister - */ -ret_code_t app_usbd_class_sof_register(app_usbd_class_inst_t const * p_cinst); - -/** - * @brief Unregister class instance from SOF processing instances list. - * - * Every class that calls @ref app_usbd_class_sof_register have to call also unregistering function - * in reaction to @ref APP_USBD_EVT_INST_REMOVE event. - * - * @param p_cinst Instance to be unregistered from SOF event processing list. - * - * @retval NRF_SUCCESS Instance linked into SOF processing list. - * @retval NRF_ERROR_NOT_FOUND Instance not found in the SOF processing list. - * - * @sa app_usbd_class_sof_register - */ -ret_code_t app_usbd_class_sof_unregister(app_usbd_class_inst_t const * p_cinst); - -/** - * @brief Register class instance as the one that requires SOF events in interrupt. - * - * This function should be called in reaction on APP_USBD_EVT_INST_APPEND event. - * Connect the class instance to the list of instances that requires SOF processing. - * If none of the appended instances requires SOF event - it is disabled. - * - * @param p_cinst Instance that requires SOF event. - * @param handler Handler to SOF event - * - * @retval NRF_SUCCESS Instance linked into SOF processing list. - * - * @sa app_usbd_class_sof_interrupt_unregister - */ -ret_code_t app_usbd_class_sof_interrupt_register(app_usbd_class_inst_t const * p_cinst, - app_usbd_sof_interrupt_handler_t handler); - -/** - * @brief Unregister class instance from SOF processing in interrupt instances list. - * - * Every class that calls @ref app_usbd_class_sof_interrupt_register have to call - * also unregistering function in reaction to @ref APP_USBD_EVT_INST_REMOVE event. - * - * @param p_cinst Instance to be unregistered from SOF processing in interrupt list. - * - * @retval NRF_SUCCESS Instance linked into SOF processing in interrupt list. - * @retval NRF_ERROR_NOT_FOUND Instance not found in the SOF processing in interrupt list. - * - * @sa app_usbd_class_sof_interrupt_register - */ -ret_code_t app_usbd_class_sof_interrupt_unregister(app_usbd_class_inst_t const * p_cinst); - - -/** - * @brief Register class on remote wake-up feature. - * - * @param[in] p_inst Instance of the class. - * - * @retval NRF_SUCCESS Instance that requires remote wake-up registered. - */ -ret_code_t app_usbd_class_rwu_register(app_usbd_class_inst_t const * const p_inst); - -/** - * @brief Unregister class from remote wake-up feature. - * - * @param[in] p_inst Instance of the class. - * - * @retval NRF_SUCCESS Instance that requires remote wake-up removed. - */ -ret_code_t app_usbd_class_rwu_unregister(app_usbd_class_inst_t const * const p_inst); - -/** - * @brief Check if there is any class with remote wakeup. - * - * The function checks internal registered class with remote wakeup counter. - * - * @sa app_usbd_class_rwu_register, app_usbd_class_rwu_unregister - * - * @retval true The remote wakeup functionality is required by some class instance. - * @retval false There is no class instance that requires wakeup functionality. - */ -bool app_usbd_class_rwu_enabled_check(void); - -/** - * @brief Find a specified descriptor. - * - * @param[in] p_cinst Class instance. - * @param[in] desc_type Descriptor type @ref app_usbd_descriptor_t - * @param[in] desc_index Descriptor index. - * @param[out] p_desc Pointer to escriptor. - * @param[out] p_desc_len Length of descriptor. - * - * @return Standard error code @ref ret_code_t - * @retval NRF_SUCCESS Descriptor successfully found. - * @retval NRF_ERROR_NOT_FOUND Descriptor not found. - * */ -ret_code_t app_usbd_class_descriptor_find(app_usbd_class_inst_t const * const p_cinst, - uint8_t desc_type, - uint8_t desc_index, - uint8_t * p_desc, - size_t * p_desc_len); - -/** - * @brief Standard set interface request handle. - * - * This function should be called when processing SET_INTERFACE request. - * - * @param[in] p_cinst Instance of a class. - * @param[in] iface Interface number. - * - * @return Standard error code. - * - * @note Selected interface to reset has to be part of given class. - * */ -ret_code_t app_usbd_interface_ep_reset(app_usbd_class_inst_t const * const p_cinst, - uint8_t iface); - - -/** - * @brief Enable selected endpoint. - * - * Selected endpoint is enabled and cleared. - * - * @param ep Endpoint number. - */ -void app_usbd_ep_enable(nrf_drv_usbd_ep_t ep); - -/** - * @brief Disable selected endpoint. - * - * @param ep Endpoint number. - */ -void app_usbd_ep_disable(nrf_drv_usbd_ep_t ep); - -/** - * @name Iterate through classes lists - * - * Functions that helps to iterate through internally chained classes. - * @{ - */ - /** - * @brief Get first class instance in the list. - * - * Get first instance from the list of active class instances. - * That instance may be used then in @ref app_usbd_class_next_get function. - * - * @return First instance in the list or NULL if there are no instances available. - */ - app_usbd_class_inst_t const * app_usbd_class_first_get(void); - - /** - * @brief Get next instance in the list. - * - * Get the next instance from the list of active instances. - * Used to iterate through all instances. - * - * @param[in] p_cinst The current instance from with next one is required. - * - * @return Next instance to the given one or NULL if there is no more instances in the list. - */ - static inline app_usbd_class_inst_t const * app_usbd_class_next_get( - app_usbd_class_inst_t const * const p_cinst) - { - ASSERT(NULL != p_cinst); - return app_usbd_class_data_access(p_cinst)->p_next; - } - - /** - * @brief Get first instance in SOF list. - * - * Start iteration through the list of instances that require SOF event processing. - * - * @return First instance in the list or NULL if the list is empty. - * - * @sa app_usbd_class_first_get - */ - app_usbd_class_inst_t const * app_usbd_class_sof_first_get(void); - - /** - * @brief Get next instance in the SOF list. - * - * Get the next instance from the list of instances requiring SOF event processing. - * Used to iterate through all SOF instances. - * - * @param p_cinst The current instance from with next one is required. - * - * @return Next instance to the given one or NULL if there is no more instances in the list. - */ - static inline app_usbd_class_inst_t const * app_usbd_class_sof_next_get( - app_usbd_class_inst_t const * const p_cinst) - { - ASSERT(NULL != p_cinst); - return app_usbd_class_data_access(p_cinst)->p_sof_next; - } - - /** - * @brief Get first instance in SOF interrupt list. - * - * Start iteration through the list of instances that require SOF processing in interrupt. - * - * @return First instance in the list or NULL if the list is empty. - * - * @sa app_usbd_class_first_get - */ - app_usbd_class_inst_t const * app_usbd_class_sof_interrupt_first_get(void); - - /** - * @brief Get next instance in the SOF interrupt list. - * - * Get the next instance from the list of instances requiring SOF processing in interrupt. - * Used to iterate through all SOF instances that have SOF handlers. - * - * @param p_cinst The current instance from with next one is required. - * - * @return Next instance to the given one or NULL if there is no more instances in the list. - */ - static inline app_usbd_class_inst_t const * app_usbd_class_sof_interrupt_next_get( - app_usbd_class_inst_t const * const p_cinst) - { - ASSERT(NULL != p_cinst); - return app_usbd_class_data_access(p_cinst)->p_sof_next; - } -/** @} */ - -/** - * @brief Search for selected interface. - * - * Function searches for the given interface number and returns the class that contains it. - * Optionally it can return interface index inside class instance. - * - * @param[in] iface Interface number. - * @param[out] p_iface_idx Pointer to a variable that would hold interface index inside returned - * class instance. - * - * @return Pointer to the class structure that cointain given interface or NULL if not found. - */ -app_usbd_class_inst_t const * app_usbd_iface_find(uint8_t iface, uint8_t * p_iface_idx); - - -/** - * @name Communicate with interfaces, endpoints and instances inside usbd library - * - * @{ - */ - - /** - * @brief Call interface event handler. - * - * Call event handler for selected interface. - * @param[in,out] p_class_inst Class instance that holds selected interface. - * @param[in] iface_idx Index of the interface in class structure. - * @param[in] p_event Event structure to be processed. - * - * @return Operation status. - */ - ret_code_t app_usbd_iface_call( - app_usbd_class_inst_t const * const p_class_inst, - uint8_t iface_idx, - app_usbd_complex_evt_t const * const p_event); - - /** - * @brief Call endpoint event handler. - * - * Call event handler for the selected endpoint. - * @param[in] ep Endpoint number. - * @param[in] p_event Event structure to send. - * - * @return Operation status. - */ - ret_code_t app_usbd_ep_call(nrf_drv_usbd_ep_t ep, app_usbd_complex_evt_t const * const p_event); - - /** - * @brief Auxiliary function that process event by every instance in the list. - * - * This function ignores the result of called handler. - * - * @param p_event Event to pass to every instance. - */ - void app_usbd_all_call(app_usbd_complex_evt_t const * const p_event); - - /** - * @brief Call interface event handlers and stop when served. - * - * Call event handlers from instances as long as we get result different than @ref NRF_ERROR_NOT_SUPPORTED - * @param[in] p_event Event structure to send. - * - * @return Operation status or @ref NRF_ERROR_NOT_SUPPORTED if none of instances in the list can support given event. - */ - ret_code_t app_usbd_all_until_served_call(app_usbd_complex_evt_t const * const p_event); -/** @} */ - -/** - * @brief Endpoint transfer. - * - * @param ep Endpoint number. - * @param p_transfer Description of the transfer to be performed. - * The direction of the transfer is determined by the - * endpoint number. - * - * @retval NRF_ERROR_INVALID_STATE The state of the USB device does not allow - * data transfer on the endpoint. - * @return Values returned by @ref nrf_drv_usbd_ep_transfer. - * - * @sa app_usbd_ep_handled_transfer - */ -ret_code_t app_usbd_ep_transfer( - nrf_drv_usbd_ep_t ep, - nrf_drv_usbd_transfer_t const * const p_transfer); - -/** - * @brief Set up an endpoint handled transfer. - * - * Configures a transfer handled by the feedback function. - * - * @param ep Endpoint number. - * @param p_handler Function called when the next chunk of data is requested. - * - * @retval NRF_ERROR_INVALID_STATE The state of the USB device does not allow - * data transfer on the endpoint. - * @return Values returned by @ref nrf_drv_usbd_ep_handled_transfer. - */ -ret_code_t app_usbd_ep_handled_transfer( - nrf_drv_usbd_ep_t ep, - nrf_drv_usbd_handler_desc_t const * const p_handler); - - -/** - * @brief Select interface - * - * Select the given interface. - * This function calls class interface selection function or default - * interface selection function. - * - * After calling this function interface should be functional. - * - * @param[in,out] p_inst Instance of the class. - * @param[in] iface_idx Index of the interface inside class structure. - * @param[in] alternate Alternate setting that should be selected. - * - * @return Standard error code. - */ -ret_code_t app_usbd_iface_select( - app_usbd_class_inst_t const * const p_inst, - uint8_t iface_idx, - uint8_t alternate); - - -/** - * @brief Deselect interface. - * - * Disable the given interface. - * This function calls class interface deselection function or - * default interface selection function. - * - * After calling this function all the endpoints from the interface - * have to be disabled. - * - * @param[in,out] p_inst Instance of the class. - * @param[in] iface_idx Index of the interface inside class structure. - */ -void app_usbd_iface_deselect( - app_usbd_class_inst_t const * const p_inst, - uint8_t iface_idx); - -/** - * @brief Get selected interface. - * - * Function retieves currently selected interface. - * If the class contains @ref app_usbd_class_methods_t::iface_selection_get it is called. - * It it does not contain this function this function would return default, 0 value. - * - * @param[in] p_inst Instance of the class. - * @param[in] iface_idx Index of the interface inside class structure. - * - * @return Selected alternate interface setting. - */ -uint8_t app_usbd_iface_selection_get( - app_usbd_class_inst_t const * const p_inst, - uint8_t iface_idx); - -/** - * @brief Select alternate configuration 0 for all interfaces. - * - * Auxiliary function that clears settings for all interfaces leaving them enabled. - */ -void app_usbd_all_iface_select_0(void); - -/** - * @brief Deselect all interfaces. - * - * Auxiliary function to disable all interfaces. - */ -void app_usbd_all_iface_deselect(void); - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_class_base.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_class_base.h deleted file mode 100644 index a770b57ff..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_class_base.h +++ /dev/null @@ -1,1103 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef APP_USBD_CLASS_BASE_H__ -#define APP_USBD_CLASS_BASE_H__ - -#include -#include - -#include "app_usbd_types.h" -#include "nrf_drv_usbd.h" -#include "nrf_assert.h" -#include "app_util.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup app_usbd_class_base USBD Class Base module - * @ingroup app_usbd - * - * @brief @tagAPI52840 The base for any class instance is defined in this module. - * - * @details Any class instance must start from base class instance structure. - * This makes them compatible with USBD library independently of the - * implementation details. - * @{ - */ - -/** - * @brief Endpoint configuration. - */ -typedef struct -{ - nrf_drv_usbd_ep_t address; //!< Endpoint address -} app_usbd_class_ep_conf_t; - -/** - * @brief Interface configuration. - */ -typedef struct -{ - uint8_t number; //!< Interface number - uint8_t ep_cnt; //!< Endpoint number - uint8_t ep_offset; //!< Offset of the first endpoint - /**< Offset in bytes of the first endpoint. - * The offset is calculated from the address of this interface structure - */ -} app_usbd_class_iface_conf_t; - -/** - * @brief Instance variable data. - */ -typedef struct -{ - app_usbd_class_inst_t const * p_next; //!< Pointer to the next instance - app_usbd_class_inst_t const * p_sof_next; //!< Pointer to the next SOF event requiring instance - app_usbd_sof_interrupt_handler_t sof_handler; //!< Instance specific SOF interrupt handler -} app_usbd_class_data_t; - -/** - * @brief Class descriptor context. - */ -typedef struct -{ - uint32_t line; //!< Number of line to resume writing descriptors from - uint8_t data_buffer; //!< Data from last call of feeder -} app_usbd_class_descriptor_ctx_t; - -/** - * @brief Class descriptor state. - */ -typedef struct -{ - uint8_t * p_buffer; //!< Pointer to buffer - uint32_t current_size; //!< Current size of descriptor - uint32_t maximum_size; //!< Maximum size of descriptor - app_usbd_class_descriptor_ctx_t * p_context; //!< Pointer to context -} app_usbd_class_descriptor_state_t; - -/** - * @brief Class interface function set. - * */ -typedef struct { - /** - * @brief Instance callback function. - * - * The function used by every class instance. - * @param[in,out] p_inst Instance of the class. - * @param[in] p_event Event to process. - * - * @return Standard error code. - * - * @note If given event is not supported by class, return @ref NRF_ERROR_NOT_SUPPORTED - */ - ret_code_t (* event_handler)(app_usbd_class_inst_t const * const p_inst, - app_usbd_complex_evt_t const * const p_event); - - /** - * @brief Instance feed descriptors. - * - * Feeds whole descriptor of the instance. - * @param[in] p_ctx Class descriptor context. - * @param[in,out] p_inst Instance of the class. - * @param[out] p_buff Buffer for descriptor. - * @param[in] max_size Requested size of the descriptor. - * - * @return True if not finished feeding the descriptor, false if done. - */ - bool (* feed_descriptors)(app_usbd_class_descriptor_ctx_t * p_ctx, - app_usbd_class_inst_t const * p_inst, - uint8_t * p_buff, - size_t max_size); - - - /** - * @brief Select interface - * - * Function called when class interface has to be selected. - * - * This function would be called for every interface when: - * - SET_INTERFACE command is processed by the default handler - * - SET_CONFIG(1) command is processed by the default handler - * - * @note Remember to disable all the endpoints that are not used - * in the selected configuration. - * @note If this function pointer is NULL default procedure would - * just enable all the interface endpoints and selecting - * alternate configurations other than 0 would generate error. - * @note Calling the function with alternate setting 0 has to always succeed. - * - * @param[in,out] p_inst Instance of the class - * @param[in] iface_idx Index of the interface inside class structure - * @param[in] alternate Alternate setting that should be selected - * - * @return Function has to return @ref NRF_SUCCESS when it has successfully proceed - * interface selection. - * If it returns @ref NRF_ERROR_NOT_SUPPORTED, default function would be used - * to proceed the request - just like there would be NULL pointer in this field. - * Any other kind of error would make library to STALL the request. - */ - ret_code_t (* iface_select)(app_usbd_class_inst_t const * const p_inst, - uint8_t iface_idx, - uint8_t alternate); - - /** - * @brief Deselect interface. - * - * Function called when the class interface has to be deselected. - * - * This function would be called for every interface when: - * - Library start internal event is processed by the default handler - * - RESET event is processed by the default handler - * - SET_ADDRESS is processed by the default handler - * - SET_CONFIG(0) is processed by the default handler - * - * @note Just after this function is called all the interface - * endpoints would be disabled. - * This function does not has to take care about it. - * @note If this function pointer is NULL default procedure would - * just disable all the interface endpoints. - * - * @param[in,out] p_inst Instance of the class. - * @param[in] iface_idx Index of the interface inside class structure. - */ - void (* iface_deselect)(app_usbd_class_inst_t const * const p_inst, uint8_t iface_idx); - - /** - * @brief Get current interface. - * - * Function called when class interface has to return its alternate settings - * in reaction on GET_INTERFACE command. - * It should be defined in a pair with @ref app_usbd_class_methods_t::iface_select. - * - * @param[in] p_inst Instance of the class. - * @param[in] iface_idx Index of the interface inside class structure. - * - * @return Current alternate setting of the selected interface. - * - * @note For the classes that support this function, when an interface that has not alternate - * configurations has been selected this function has to return 0 - default alternate setting. - * - * @note If this function pointer it NULL default procedure would return alternate interface - * value 0. - */ - uint8_t (* iface_selection_get)(app_usbd_class_inst_t const * const p_inst, uint8_t iface_idx); - -} app_usbd_class_methods_t; - -/** - * @brief The instance structure itself. - * - * The structure of base class instance. - */ -struct app_usbd_class_inst_s -{ - app_usbd_class_data_t * p_data; //!< Pointer to non-constant data - app_usbd_class_methods_t const * p_class_methods; //!< Class interface methods - struct - { - uint8_t cnt; //!< Number of defined interfaces - uint8_t config[]; //!< Interface configuration data followed by endpoint data - } iface; //!< Interface structure -}; - - -/** - * @brief Get total number of interfaces. - * - * - */ -static inline uint8_t app_usbd_class_iface_count_get(app_usbd_class_inst_t const * const p_inst) -{ - return p_inst->iface.cnt; -} - -/** - * @brief Interface accessing function. - * - * Get interface pointer. - * Interfaces create continuous array in the memory so it is possible to get - * interface with index 0 and then just iterate to the next one. - * - * @param p_inst Pointer to the class instance - * @param iface_idx Index of the instance to get. - * This is not the interface identifier. - * Technically it is the index of the interface in the class description array. - * @return Pointer to the interface configuration parameters or NULL if given index is out of interface scope for given class. - */ -static inline app_usbd_class_iface_conf_t const * app_usbd_class_iface_get( - app_usbd_class_inst_t const * const p_inst, - uint8_t iface_idx) -{ - ASSERT(NULL != p_inst); - if (iface_idx >= (app_usbd_class_iface_count_get(p_inst))) - { - return NULL; - } - - app_usbd_class_iface_conf_t const * p_interface = - (app_usbd_class_iface_conf_t const * )(p_inst->iface.config); - return &(p_interface[iface_idx]); -} - -/** - * @brief Get interface number. - * - * @param p_iface Pointer to interface structure. - * - * @return Interface number from interface configuration structure. - */ -static inline uint8_t app_usbd_class_iface_number_get( - app_usbd_class_iface_conf_t const * const p_iface) -{ - return p_iface->number; -} - -/** - * @brief Get number of endpoints in interface. - * - * @param p_iface Pointer to interface structure. - * - * @return Number of endpoints used by given interface. - */ -static inline uint8_t app_usbd_class_iface_ep_count_get( - app_usbd_class_iface_conf_t const * const p_iface) -{ - return p_iface->ep_cnt; -} - -/** - * @brief Interface Endpoint accessing function. - * - * @param p_iface Interface configuration pointer. - * @param ep_idx Endpoint index. - * - * @return Endpoint information structure pointer or NULL if given index is outside of endpoints for selected interface. - * - * @sa app_usbd_class_iface_get - */ -static inline app_usbd_class_ep_conf_t const * app_usbd_class_iface_ep_get( - app_usbd_class_iface_conf_t const * const p_iface, - uint8_t ep_idx) -{ - ASSERT(NULL != p_iface); - if (ep_idx >= p_iface->ep_cnt) - { - return NULL; - } - - app_usbd_class_ep_conf_t const * p_ep = - (app_usbd_class_ep_conf_t const * )(((uint8_t const *)p_iface) + p_iface->ep_offset); - return &(p_ep[ep_idx]); -} - -/** - * @brief Translate endpoint address to class index. - * - * @param p_iface Interface configuration pointer. - * @param ep_address Endpoint address. - * - * @return Endpoint index or number of endpoints if not found. - * - */ -static inline uint8_t app_usbd_class_iface_ep_idx_get( - app_usbd_class_iface_conf_t const * const p_iface, - nrf_drv_usbd_ep_t ep_address) -{ - ASSERT(NULL != p_iface); - app_usbd_class_ep_conf_t const * p_ep = - (app_usbd_class_ep_conf_t const * )(((uint8_t const *)p_iface) + p_iface->ep_offset); - - uint8_t i; - for (i = 0; i < p_iface->ep_cnt; ++i) - { - if (ep_address == p_ep[i].address) - { - break; - } - } - - return i; -} - -/** - * @brief Get the selected endpoint address. - * - * @param p_ep Endpoint configuration structure. - * - * @return Endpoint address - */ -static inline nrf_drv_usbd_ep_t app_usbd_class_ep_address_get(app_usbd_class_ep_conf_t const * p_ep) -{ - return (nrf_drv_usbd_ep_t)p_ep->address; -} - -/** - * @brief Get the pointer to the writable instance data. - * - * @param p_inst Instance pointer. - * @return Pointer to writable instance data. - */ -static inline app_usbd_class_data_t * app_usbd_class_data_access( - app_usbd_class_inst_t const * const p_inst) -{ - return p_inst->p_data; -} - -/** - * @name Internal macros for argument mapping - * - * Functions to be used as a mapping macro for @ref MACRO_MAP, @ref MACRO_MAP_FOR or @ref MACRO_MAP_FOR_PARAM - * @{ - */ - /** - * @brief Count the number of endpoints in given configuration. - * - * Config should be given as a interface configuration in a brackets: - * @code - * (interface_nr, ep1, ep2, ep3) - * @endcode - * Number of endpoints may vary from 0 to a few (technically up to 16, but it seems not to make sense to use more than 4). - * Interface number is always present. - * - * @param iface_config Single interface configuration (in brackets). - * - * @return Number of endpoints in interface. This is computed value - can be used by compiler but not by preprocessor. - */ - #define APP_USBD_CLASS_CONF_IFACE_EP_COUNT_(iface_config) \ - (NUM_VA_ARGS(BRACKET_EXTRACT(iface_config)) - 1) - - /** - * @brief Adds the number of endpoints in given config to the current value. - * - * This is basically @ref APP_USBD_CLASS_CONF_IFACE_EP_COUNT_ with plus sign added. - * - * @param iface_config See parameters documentation in @ref APP_USBD_CLASS_CONF_IFACE_EP_COUNT_ - * - * @return Plus sign followed by number of endpoints in interface. - * - * @sa APP_USBD_CLASS_CONF_IFACE_EP_COUNT_ - */ - #define APP_USBD_CLASS_CONF_IFACE_EP_PLUS_COUNT_(iface_config) \ - + APP_USBD_CLASS_CONF_IFACE_EP_COUNT_(iface_config) - - /** - * @brief Create variable for endpoint. - */ - - /** - * @brief Extract endpoints given interface configuration. - * - * This macro gets single endpoint configuration and extracts all the endpoints. - * It also adds comma on the end of extracted endpoints. - * This way when this macro is called few times it generates nice list of all endpoints - * that may be used to array initialization. - * - * @param iface_config Single interface configuration in brackets. - * The format should be similar like described in @ref APP_USBD_CLASS_CONF_IFACE_EP_COUNT_. - */ - #define APP_USBD_CLASS_IFACE_EP_EXTRACT_(iface_config) \ - CONCAT_2(APP_USBD_CLASS_IFACE_EP_EXTRACT_, \ - NUM_VA_ARGS_IS_MORE_THAN_1(BRACKET_EXTRACT(iface_config))) \ - (BRACKET_EXTRACT(iface_config)) - - /** - * @brief Auxiliary macro for @ref APP_USBD_CLASS_IFACE_EP_EXTRACT_ - * - * This macro is called when interface has no endpoints. - */ - #define APP_USBD_CLASS_IFACE_EP_EXTRACT_0(iface_nr) - - /** - * @brief Auxiliary macro for @ref APP_USBD_CLASS_IFACE_EP_EXTRACT_ - * - * This macro is called when interface has at least one endpoint. - */ - #define APP_USBD_CLASS_IFACE_EP_EXTRACT_1(...) \ - APP_USBD_CLASS_IFACE_EP_EXTRACT_1_(__VA_ARGS__) - - #define APP_USBD_CLASS_IFACE_EP_EXTRACT_1_(iface_nr, ...) \ - MACRO_MAP_REC(APP_USBD_CLASS_IFACE_EP_EXTRACT_1__, __VA_ARGS__) - - #define APP_USBD_CLASS_IFACE_EP_EXTRACT_1__(ep) \ - {(nrf_drv_usbd_ep_t) (ep)}, - - /** - * @brief Generate configuration for single interface. - * - * This macro extract configuration for single interface. - * The configuration is inside curly brackets and comma is added on the end. - * This mean it can be directly used to init array of interface configurations. - * - * @param iface_config Single interface configuration. - * @param N Currently processed configuration. - * @param iface_configs All interfaces configuration in brackets. - */ - #define APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_(iface_config, N, iface_configs) \ - CONCAT_2(APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_, \ - NUM_VA_ARGS_IS_MORE_THAN_1(BRACKET_EXTRACT(iface_config))) \ - (N, iface_configs, BRACKET_EXTRACT(iface_config)) - - /** - * @brief Macro used when there was an error extracting number of configs. - * - * Throws a syntax error. - */ - #define APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_x(iface_config, N, iface_configs) \ - [N] = !!!iface_config!!! - /** - * @brief Auxiliary macro for @ref APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_ - * - * This macro is called when interface has no endpoints. - */ - #define APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_0(N, iface_configs, iface_nr) \ - APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_0_(N, iface_configs, iface_nr) - #define APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_0_(N, iface_configs, iface_nr) \ - { .number = iface_nr, .ep_cnt = 0, .ep_offset = 0 }, - - /** - * @brief Auxiliary macro for @ref APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_ - * - * This macro is called when interface has at last one endpoint. - */ - #define APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_1(N, iface_configs, ...) \ - APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_1_(N, iface_configs, __VA_ARGS__) - #define APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_1_(N, iface_configs, iface_nr, ...) \ - { .number = iface_nr, .ep_cnt = NUM_VA_ARGS(__VA_ARGS__), \ - .ep_offset = APP_USBD_CLASS_CONF_TOTAL_EP_COUNT_N(N, iface_configs) * \ - sizeof(app_usbd_class_ep_conf_t) \ - + ((NUM_VA_ARGS(BRACKET_EXTRACT(iface_configs)) - N) * \ - sizeof(app_usbd_class_iface_conf_t)) \ - }, - -/** @} */ - - -/** - * @name Macros that uses mapping macros internally - * - * Auxiliary macros that uses mapping macros to make some calculations or realize other functionality. - * Mapped here for easier unit testing and to hide complex mapping functions calling. - * @{ - */ - -/** - * @brief Count total number of endpoints. - * - * @param iface_configs List of interface configurations like explained - * in documentation for @ref APP_USBD_CLASS_INSTANCE_TYPEDEF - * - * @return The equation to calculate the number of endpoints by compiler. - */ -#define APP_USBD_CLASS_CONF_TOTAL_EP_COUNT(iface_configs) \ - (0 MACRO_MAP(APP_USBD_CLASS_CONF_IFACE_EP_PLUS_COUNT_, BRACKET_EXTRACT(iface_configs))) - -/** - * @brief Count total number of endpoint up-to interface index. - * - * The version of @ref APP_USBD_CLASS_CONF_TOTAL_EP_COUNT macro which takes the - * number of interfaces to analyze. - * - * @param N Number of interfaces to analyze. - * @param iface_configs List of interface configurations like explained - * in documentation for @ref APP_USBD_CLASS_INSTANCE_TYPEDEF - * - * @return The equation to calculate the number of endpoints by compiler. - */ -#define APP_USBD_CLASS_CONF_TOTAL_EP_COUNT_N(N, iface_configs) \ - (0 MACRO_MAP_N(N, APP_USBD_CLASS_CONF_IFACE_EP_PLUS_COUNT_, BRACKET_EXTRACT(iface_configs))) - -/** - * @brief Extract configurations for interfaces. - * - * This macro extracts the configurations for every interface. - * Basically uses the @ref APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_ macro on every - * configuration found. - * - * This should generate interface configuration initialization data - * in comma separated initializers in curly braces. - * - * @param iface_configs List of interface configurations like explained - * in documentation for @ref APP_USBD_CLASS_INSTANCE_TYPEDEF - * - * @return Comma separated initialization data for all interfaces. - */ -/*lint -emacro( (40), APP_USBD_CLASS_IFACES_CONFIG_EXTRACT) */ -#define APP_USBD_CLASS_IFACES_CONFIG_EXTRACT(iface_configs) \ - MACRO_MAP_FOR_PARAM(iface_configs, \ - APP_USBD_CLASS_IFACE_CONFIG_EXTRACT_, \ - BRACKET_EXTRACT(iface_configs)) - -/** - * @brief Extract all endpoints. - * - * Macro that extracts all endpoints from every interface. - * - * @param iface_configs List of interface configurations like explained - * in documentation for @ref APP_USBD_CLASS_INSTANCE_TYPEDEF - * - * @return Comma separated list of endpoints. - */ -/*lint -emacro( (40), APP_USBD_CLASS_IFACES_EP_EXTRACT) */ -#define APP_USBD_CLASS_IFACES_EP_EXTRACT(iface_configs) \ - MACRO_MAP(APP_USBD_CLASS_IFACE_EP_EXTRACT_, BRACKET_EXTRACT(iface_configs)) - - -/** @} */ - - -/** - * @brief USBD instance of class mnemonic. - * - * Macro that generates mnemonic for the name of the structure that describes instance for selected class. - * - * @param type_name The name of the instance without _t postfix. - * - * @return The name with the right postfix to create the name for the type for the class. - */ -#define APP_USBD_CLASS_INSTANCE_TYPE(type_name) CONCAT_2(type_name, _t) - -/** - * @brief USBD data for instance class mnemonic. - * - * The mnemonic of the variable type that holds writable part of the class instance. - * - * @param type_name The name of the instance without _t postfix. - * - * @return The name with the right postfix to create the name for the data type for the class. - */ -#define APP_USBD_CLASS_DATA_TYPE(type_name) CONCAT_2(type_name, _data_t) - -/** - * @brief Declare class specific member of class instance. - * - * @param type Type of the attached class configuration. - * - * @sa APP_USBD_CLASS_INSTANCE_TYPEDEF - */ -#define APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC(type) type class_part; - -/** - * @brief Used if there is no class specific configuration. - * - * This constant can be used if there is no specific configuration inside created instance. - * - * @sa APP_USBD_CLASS_INSTANCE_TYPEDEF - */ -#define APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC_NONE - -/** - * @brief Declare class specific member of class data. - * - * @param type Type of the attached class data. - * - * @sa APP_USBD_CLASS_DATA_TYPEDEF - */ -#define APP_USBD_CLASS_DATA_SPECIFIC_DEC(type) APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC(type) - -/** - * @brief Used if there is no class specific data. - * - * This constant can be used if there is no specific writable data inside created instance. - * - * @sa APP_USBD_CLASS_DATA_TYPEDEF - */ -#define APP_USBD_CLASS_DATA_SPECIFIC_DEC_NONE APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC_NONE - - - - -/** - * @brief Instance structure declaration. - * - * The macro that declares a variable type that would be used to store given class instance. - * Class instance stores all the data from @ref app_usbd_class_inst_t and overlaid data for specified class. - * - * The structure of interface configuration data: - * @code - * ( - * (iface1_nr, (ep1, ep2, ep3)), - (iface2_nr), - (iface3_nr, (ep4)) - * ) - * @endcode - * - * @param type_name The name of the instance without _t postfix. - * @param interfaces_configs List of interface configurations like explained above. - * @param class_config_dec Result of the macro - * @ref APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC or - * @ref APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC_NONE - * - * @return The definition of the structure type that holds all the required data. - * - * @note It should not be used directly in the final application. See @ref APP_USBD_CLASS_DATA_TYPEDEF instead. - * - * @note APP_USBD_CLASS_DATA_TYPEDEF has to be called first for the compilation to success. - * - * @sa APP_USBD_CLASS_TYPEDEF - */ -#define APP_USBD_CLASS_INSTANCE_TYPEDEF(type_name, interfaces_configs, class_config_dec) \ - typedef union CONCAT_2(type_name, _u) \ - { \ - app_usbd_class_inst_t base; \ - struct \ - { \ - APP_USBD_CLASS_DATA_TYPE(type_name) * p_data; \ - app_usbd_class_methods_t const * p_class_methods; \ - struct \ - { \ - uint8_t cnt; \ - app_usbd_class_iface_conf_t \ - config[NUM_VA_ARGS(BRACKET_EXTRACT(interfaces_configs))]; \ - app_usbd_class_ep_conf_t \ - ep[APP_USBD_CLASS_CONF_TOTAL_EP_COUNT(interfaces_configs)]; \ - } iface; \ - class_config_dec \ - } specific; \ - } APP_USBD_CLASS_INSTANCE_TYPE(type_name) - -/** - * @brief Same as @ref APP_USBD_CLASS_INSTANCE_TYPEDEF but for class with EP0 only. - */ -#define APP_USBD_CLASS_INSTANCE_NO_EP_TYPEDEF(type_name, interfaces_configs, class_config_dec) \ - typedef union CONCAT_2(type_name, _u) \ - { \ - app_usbd_class_inst_t base; \ - struct \ - { \ - APP_USBD_CLASS_DATA_TYPE(type_name) * p_data; \ - app_usbd_class_methods_t const * p_class_methods; \ - struct \ - { \ - uint8_t cnt; \ - app_usbd_class_iface_conf_t \ - config[NUM_VA_ARGS(BRACKET_EXTRACT(interfaces_configs))]; \ - } iface; \ - class_config_dec \ - } specific; \ - } APP_USBD_CLASS_INSTANCE_TYPE(type_name) - -/** - * @brief Writable data structure declaration. - * - * The macro that declares a variable type that would be used to store given class writable data. - * Writable data contains base part of the type @ref app_usbd_class_data_t followed by - * class specific data. - * - * @param type_name The name of the type without _t postfix. - * @param class_data_dec Result of the macro - * @ref APP_USBD_CLASS_DATA_SPECIFIC_DEC or - * @ref APP_USBD_CLASS_DATA_SPECIFIC_DEC_NONE - * - * @return The definition of the structure type that holds all the required writable data. - * - * @note It should not be used directly in the final application. See @ref APP_USBD_CLASS_DATA_TYPEDEF instead. - * - * @sa APP_USBD_CLASS_TYPEDEF - */ -#define APP_USBD_CLASS_DATA_TYPEDEF(type_name, class_data_dec) \ - typedef struct \ - { \ - app_usbd_class_data_t base; \ - class_data_dec \ - }APP_USBD_CLASS_DATA_TYPE(type_name) - - -/** - * @brief Declare all data types required by the class instance. - * - * Macro that declares data type first and then instance type. - * - * @param type_name The name of the type without _t postfix. - * @param interface_configs List of interface configurations like in @ref APP_USBD_CLASS_INSTANCE_TYPEDEF. - * @param class_config_dec Result of the macro - * @ref APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC or - * @ref APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC_NONE - * @param class_data_dec Result of the macro - * @ref APP_USBD_CLASS_DATA_SPECIFIC_DEC or - * @ref APP_USBD_CLASS_DATA_SPECIFIC_DEC_NONE - * - * @return Declaration of the data type for the instance and instance itself. - * - * @sa APP_USBD_CLASS_DATA_TYPEDEF - * @sa APP_USBD_CLASS_INSTANCE_TYPEDEF - */ -#define APP_USBD_CLASS_TYPEDEF(type_name, interface_configs, class_config_dec, class_data_dec) \ - APP_USBD_CLASS_DATA_TYPEDEF(type_name, class_data_dec); \ - APP_USBD_CLASS_INSTANCE_TYPEDEF(type_name, interface_configs, class_config_dec) - -/** - * @brief Same as @ref APP_USBD_CLASS_TYPEDEF but for class with EP0 only. - */ -#define APP_USBD_CLASS_NO_EP_TYPEDEF(type_name, \ - interface_configs, \ - class_config_dec, \ - class_data_dec) \ - APP_USBD_CLASS_DATA_TYPEDEF(type_name, class_data_dec); \ - APP_USBD_CLASS_INSTANCE_NO_EP_TYPEDEF(type_name, interface_configs, class_config_dec) - -/** - * @brief Forward declaration of type defined by @ref APP_USBD_CLASS_TYPEDEF - * - * @param type_name The name of the type without _t postfix. - * */ -#define APP_USBD_CLASS_FORWARD(type_name) union CONCAT_2(type_name, _u) - -/** - * @brief Generate the initialization data for. - * - * Macro that generates the initialization data for instance. - * - * @param p_ram_data Pointer to writable instance data structure. - * @param class_methods Class methods. - * @param interfaces_configs Exactly the same interface config data that in @ref APP_USBD_CLASS_INSTANCE_TYPEDEF - * @param class_config_part Configuration part. The data should be inside brackets. - * Any data here would be removed from brackets and then put as an initialization - * data for class_part member of instance structure. - * - * @note It should not be used directly in the final application. See @ref APP_USBD_CLASS_INST_DEF instead. - */ -#define APP_USBD_CLASS_INSTANCE_INITVAL(p_ram_data, \ - class_methods, \ - interfaces_configs, \ - class_config_part) \ - { \ - .specific = { \ - .p_data = p_ram_data, \ - .p_class_methods = class_methods, \ - .iface = { \ - .cnt = NUM_VA_ARGS(BRACKET_EXTRACT(interfaces_configs)), \ - .config = { APP_USBD_CLASS_IFACES_CONFIG_EXTRACT(interfaces_configs) }, \ - .ep = { APP_USBD_CLASS_IFACES_EP_EXTRACT(interfaces_configs) } \ - }, \ - BRACKET_EXTRACT(class_config_part) \ - } \ - } - -/** - * @brief Same as @ref APP_USBD_CLASS_INSTANCE_INITVAL but for class with EP0 only. - */ -#define APP_USBD_CLASS_INSTANCE_NO_EP_INITVAL(p_ram_data, \ - class_methods, \ - interfaces_configs, \ - class_config_part) \ - { \ - .specific = { \ - .p_data = p_ram_data, \ - .p_class_methods = class_methods, \ - .iface = { \ - .cnt = NUM_VA_ARGS(BRACKET_EXTRACT(interfaces_configs)), \ - .config = { APP_USBD_CLASS_IFACES_CONFIG_EXTRACT(interfaces_configs) } \ - }, \ - BRACKET_EXTRACT(class_config_part) \ - } \ - } - -/** - * @brief Define the base class instance. - * - * Macro that defines whole instance variable and fill it with initialization data. - * - * The tricky part is @c class_config_part. - * The configuration data here has to be placed inside brackets. - * Then any type of values can be used depending on the type used in @ref APP_USBD_CLASS_TYPEDEF. - * If instance does not has any specyfic data, use just empty bracket here. - * @code - * APP_USBD_CLASS_TYPEDEF( - * some_base_class, - * CLASS_BASE_CONFIGURATION, - * APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC_NONE, - * APP_USBD_CLASS_DATA_SPECIFIC_DEC_NONE - * ); - * APP_USBD_CLASS_INST_DEF( - * some_base_class_inst, - * some_base_class, - * base_class_event_handler, - * CLASS_BASE_CONFIGURATION, - * () // Empty configuration - * ); - * @endcode - * - * If the type of instance configuration is simple type, just provide initialization value: - * @code - * APP_USBD_CLASS_TYPEDEF( - * some_base_class, - * CLASS_BASE_CONFIGURATION, - * APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC_NONE, - * APP_USBD_CLASS_DATA_SPECIFIC_DEC(uint8_t) - * ); - * APP_USBD_CLASS_INST_DEF( - * some_base_class_inst, - * some_base_class, - * base_class_event_handler, - * CLASS_BASE_CONFIGURATION, - * (12) // Example values - * ); - * @endcode - * - * If the type of instance configuration is structure, provide initialization value for the whole structure: - * @code - * typedef structure - * { - * uint32_t p1; - * uint8_t p2; - * }my_config_t; - * - * APP_USBD_CLASS_TYPEDEF( - * some_base_class, - * CLASS_BASE_CONFIGURATION, - * APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC_NONE, - * APP_USBD_CLASS_DATA_SPECIFIC_DEC(my_config_t) - * ); - * APP_USBD_CLASS_INST_DEF( - * some_base_class_inst, - * some_base_class, - * base_class_event_handler, - * CLASS_BASE_CONFIGURATION, - * ({12, 3}) // Example values - * ); - * @endcode - * - * @param instance_name The name of created instance variable. - * It would be constant variable and its type would be app_usbd_class_inst_t. - * @param type_name The name of the variable type. It has to be the same type that was passed to - * @ref APP_USBD_CLASS_TYPEDEF - * @param class_methods Class unified interface. - * @param interfaces_configs The same configuration data that the one passed to @ref APP_USBD_CLASS_TYPEDEF - * @param class_config_part Configuration data to the type that was declared by class_data_dec when calling - * @ref APP_USBD_CLASS_TYPEDEF. - * Configuration data has to be provided in brackets. - * It would be extracted from brackets and placed in initialization part of configuration structure. - * See detailed description of this macro for more informations. - */ -#define APP_USBD_CLASS_INST_DEF(instance_name, \ - type_name, \ - class_methods, \ - interfaces_configs, \ - class_config_part) \ - static APP_USBD_CLASS_DATA_TYPE(type_name) CONCAT_2(instance_name, _data); \ - static const APP_USBD_CLASS_INSTANCE_TYPE(type_name) instance_name = \ - APP_USBD_CLASS_INSTANCE_INITVAL( \ - &CONCAT_2(instance_name, _data), \ - class_methods, \ - interfaces_configs, \ - class_config_part) - - -/** - * @brief Define the base class instance in global scope. - * - * This is the same macro like @ref APP_USBD_CLASS_INST_DEF but it creates the instance - * without static keyword. - * - * @param instance_name See documentation for @ref APP_USBD_CLASS_INST_DEF - * @param type_name See documentation for @ref APP_USBD_CLASS_INST_DEF - * @param class_methods See documentation for @ref APP_USBD_CLASS_INST_DEF - * @param interfaces_configs See documentation for @ref APP_USBD_CLASS_INST_DEF - * @param class_config_part See documentation for @ref APP_USBD_CLASS_INST_DEF - */ -#define APP_USBD_CLASS_INST_GLOBAL_DEF(instance_name, \ - type_name, \ - class_methods, \ - interfaces_configs, \ - class_config_part) \ - static APP_USBD_CLASS_DATA_TYPE(type_name) CONCAT_2(instance_name, _data); \ - const APP_USBD_CLASS_INSTANCE_TYPE(type_name) instance_name = \ - APP_USBD_CLASS_INSTANCE_INITVAL( \ - &CONCAT_2(instance_name, _data), \ - class_methods, \ - interfaces_configs, \ - class_config_part) - -/** - * @brief Same as @ref APP_USBD_CLASS_INST_GLOBAL_DEF but for class with EP0 only. - */ -#define APP_USBD_CLASS_INST_NO_EP_GLOBAL_DEF(instance_name, \ - type_name, \ - class_methods, \ - interfaces_configs, \ - class_config_part) \ - static APP_USBD_CLASS_DATA_TYPE(type_name) CONCAT_2(instance_name, _data); \ - const APP_USBD_CLASS_INSTANCE_TYPE(type_name) instance_name = \ - APP_USBD_CLASS_INSTANCE_NO_EP_INITVAL( \ - &CONCAT_2(instance_name, _data), \ - class_methods, \ - interfaces_configs, \ - class_config_part) -/** - * @brief Access class specific configuration. - * - * Macro that returns class specific configuration. - * - * @param[in] p_inst Instance pointer. - * - * @return A pointer for class specific part of the instance. - * - * @note If macro is used on the instance that has no class specific configuration - * an error would be generated during compilation. - */ -#define APP_USBD_CLASS_GET_SPECIFIC_CONFIG(p_inst) (&((p_inst)->specific.class_part)) - -/** - * @brief Access class specific data. - * - * @param[in] p_inst Instance pointer. - * - * @return A pointer for class specific part of writable data. - * - * @note If macro is used on the instance that has no class specific data - * an error would be generated during compilation. - */ -#define APP_USBD_CLASS_GET_SPECIFIC_DATA(p_inst) (&(((p_inst)->specific.p_data)->class_part)) - -/** - * @brief Macro to get base instance from class specific instance. - * - * This macro may be used on class specific instance to get base instance that - * can be processed by base instance access functions. - * Class specific instance can be just casted to class base instance, - * but then we would totally lost type safety. - * - * A little more safe is to use pointer to base member of class instance. - * This would generate an error when used on any variable that has no base member - * and would generate also error if this base member is wrong type. - */ -#define APP_USBD_CLASS_BASE_INSTANCE(p_inst) (&((p_inst)->base)) - -/*lint -emacro(142 438 616 646, APP_USBD_CLASS_DESCRIPTOR_INIT, APP_USBD_CLASS_DESCRIPTOR_BEGIN, APP_USBD_CLASS_DESCRIPTOR_YIELD, APP_USBD_CLASS_DESCRIPTOR_END, APP_USBD_CLASS_DESCRIPTOR_WRITE)*/ - -/** - * @brief Initialize class descriptor. - * - * @param[in] p_ctx Class descriptor context. - */ - -#define APP_USBD_CLASS_DESCRIPTOR_INIT(p_ctx) \ - (p_ctx)->line = 0; - -/** - * @brief Begin class descriptor. - * - * @param[in] p_ctx Class descriptor context. - * @param[in] p_buff Buffer to write into. - * @param[in] max_size Size of the buffer. - */ - -#define APP_USBD_CLASS_DESCRIPTOR_BEGIN(p_ctx, p_buff, max_size) \ - ASSERT((p_ctx) != NULL); \ - app_usbd_class_descriptor_state_t this_descriptor_feed; \ - this_descriptor_feed.p_buffer = (p_buff); \ - this_descriptor_feed.current_size = 0; \ - this_descriptor_feed.maximum_size = (max_size); \ - this_descriptor_feed.p_context = (p_ctx); \ - switch ((this_descriptor_feed.p_context)->line) \ - { \ - case 0: \ - ; - -/** - * @brief Yield class descriptor - * - */ - -#define APP_USBD_CLASS_DESCRIPTOR_YIELD() \ -do \ -{ \ - (this_descriptor_feed.p_context)->line = __LINE__; \ - return true; \ - case __LINE__: \ - ; \ -} while (0) - -/*lint -emacro(438 527, APP_USBD_CLASS_DESCRIPTOR_END)*/ - -/** - * @brief End class descriptor. - * - * This function has to be called at the end of class descriptor feeder function. - * No other operations in feeder function can be done after calling it. - */ - -#define APP_USBD_CLASS_DESCRIPTOR_END() \ - APP_USBD_CLASS_DESCRIPTOR_YIELD(); \ - } \ - (this_descriptor_feed.p_context)->line = 0; \ - return false; - - -/** - * @brief Write descriptor using protothreads. - * - * This function writes one byte to the buffer with offset. If buffer is full - * it yields. - * - * It is used by the class descriptor feeders internally. - * - * @ref APP_USBD_CLASS_DESCRIPTOR_BEGIN has to be called before using this function. - * @ref APP_USBD_CLASS_DESCRIPTOR_END has to be called after last use of this function. - * - * @param data Byte to be written to buffer. - */ -#define APP_USBD_CLASS_DESCRIPTOR_WRITE(data) \ -do \ -{ \ - (this_descriptor_feed.p_context)->data_buffer = (data); \ - if (this_descriptor_feed.current_size >= this_descriptor_feed.maximum_size) \ - { \ - APP_USBD_CLASS_DESCRIPTOR_YIELD(); \ - } \ - if(this_descriptor_feed.p_buffer != NULL) \ - { \ - *(this_descriptor_feed.p_buffer + this_descriptor_feed.current_size) = \ - (this_descriptor_feed.p_context)->data_buffer; \ - } \ - this_descriptor_feed.current_size++; \ -} while(0); - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_CLASS_BASE_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_core.c b/third_party/NordicSemiconductor/libraries/usb/app_usbd_core.c deleted file mode 100644 index 6200bfe8a..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_core.c +++ /dev/null @@ -1,1251 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include "sdk_common.h" -#if NRF_MODULE_ENABLED(APP_USBD) - -#include "app_usbd_core.h" -#include "app_usbd.h" -#include "app_usbd_request.h" -#include "app_usbd_string_desc.h" -#include "nrf.h" -#include "nrf_atomic.h" -#include "app_util_platform.h" -#include "app_usbd.h" -#include "app_usbd_class_base.h" - -#define NRF_LOG_MODULE_NAME app_usbd_core - -#if APP_USBD_CONFIG_LOG_ENABLED -#define NRF_LOG_LEVEL APP_USBD_CONFIG_LOG_LEVEL -#define NRF_LOG_INFO_COLOR APP_USBD_CONFIG_INFO_COLOR -#define NRF_LOG_DEBUG_COLOR APP_USBD_CONFIG_DEBUG_COLOR -#else //APP_USBD_CONFIG_LOG_ENABLED -#define NRF_LOG_LEVEL 0 -#endif //APP_USBD_CONFIG_LOG_ENABLED -#include "nrf_log.h" -NRF_LOG_MODULE_REGISTER(); - -/* Test if VID was configured */ -#ifndef APP_USBD_VID -#error APP_USBD_VID not properly defined. -#endif - - -/* Device version checking */ -#if defined(APP_USBD_DEVICE_VER_MAJOR) && defined(APP_USBD_DEVICE_VER_MINOR) - #if ((APP_USBD_DEVICE_VER_MAJOR)) > 99 || ((APP_USBD_DEVICE_VER_MINOR) > 99) - #error Major and minor device version value have to be limited to 99. - #endif -#else - #error The definition of a pair APP_USBD_DEVICE_VER_MAJOR and APP_USBD_DEVICE_VER_MINOR required. -#endif - -/** - * @internal - * @defgroup app_usbd_core_internals USB Device high level library core module internals - * @ingroup app_usbd_core - * - * Internal variables, auxiliary macros and functions of USBD high level core module. - * @{ - */ - -/** @brief Make USB power value */ -#define APP_USBD_POWER_MAKE(ma) (((ma) + 1) / 2) - -/** - @brief Default device descriptor initializer @ref app_usbd_descriptor_device_t -* */ -#define APP_USBD_CORE_DEVICE_DESCRIPTOR { \ - .bLength = sizeof(app_usbd_descriptor_device_t), /* descriptor size */ \ - .bDescriptorType = APP_USBD_DESCRIPTOR_DEVICE, /* descriptor type */ \ - .bcdUSB = APP_USBD_BCD_VER_MAKE(2,0,0), /* USB BCD version: 2.0 */ \ - .bDeviceClass = 0, /* device class: 0 - specified by interface */ \ - .bDeviceSubClass = 0, /* device subclass: 0 - specified by interface */ \ - .bDeviceProtocol = 0, /* device protocol: 0 - specified by interface */ \ - .bMaxPacketSize0 = NRF_DRV_USBD_EPSIZE, /* endpoint size: fixed to: NRF_DRV_USBD_EPSIZE*/ \ - .idVendor = APP_USBD_VID, /* Vendor ID*/ \ - .idProduct = APP_USBD_PID, /* Product ID*/ \ - .bcdDevice = APP_USBD_BCD_VER_MAKE( /* Device version BCD */ \ - APP_USBD_DEVICE_VER_MAJOR, \ - APP_USBD_DEVICE_VER_MINOR, \ - APP_USBD_DEVICE_VER_SUB), \ - .iManufacturer = APP_USBD_STRING_ID_MANUFACTURER, /* String ID: manufacturer */ \ - .iProduct = APP_USBD_STRING_ID_PRODUCT, /* String ID: product */ \ - .iSerialNumber = APP_USBD_STRING_ID_SERIAL, /* String ID: serial */ \ - .bNumConfigurations = 1 /* Fixed value: only one configuration supported*/\ -} - - -#define APP_USBD_CORE_CONFIGURATION_DESCRIPTOR { \ - .bLength = sizeof(app_usbd_descriptor_configuration_t), \ - .bDescriptorType = APP_USBD_DESCRIPTOR_CONFIGURATION, \ - .wTotalLength = 0, /*Calculated dynamically*/ \ - .bNumInterfaces = 0, /*Calculated dynamically*/ \ - .bConfigurationValue = 1, /*Value passed to set configuration*/ \ - .iConfiguration = APP_USBD_STRING_ID_CONFIGURATION, /*Configuration ID*/ \ - .bmAttributes = APP_USBD_DESCRIPTOR_CONFIGURATION_ATTRIBUTE_ALWAYS_SET_MASK | \ - ((APP_USBD_CONFIG_SELF_POWERED) ? \ - APP_USBD_DESCRIPTOR_CONFIGURATION_ATTRIBUTE_SELF_POWERED_MASK \ - : \ - 0), \ - .bMaxPower = APP_USBD_POWER_MAKE(APP_USBD_CONFIG_MAX_POWER), \ -} - -/** - * @brief Device descriptor instance. - * - * @note - * Constant part of the device descriptor. - * Values that must be calculated are updated directly in the buffer - * just before the transmission. - */ -static const app_usbd_descriptor_device_t m_device_dsc = - APP_USBD_CORE_DEVICE_DESCRIPTOR; - -/** - * @brief Configuration descriptor instance. - * - * @note - * Constant part of the device descriptor. - * Values that must be calculated are updated directly in the buffer - * just before the transmission. - */ -static const app_usbd_descriptor_configuration_t m_configuration_dsc = - APP_USBD_CORE_CONFIGURATION_DESCRIPTOR; - -/* Required early declaration of event handler function */ -static ret_code_t app_usbd_core_event_handler(app_usbd_class_inst_t const * const p_inst, - app_usbd_complex_evt_t const * const p_event); - -/** - * @brief Current USB device state. - * - * This variable is updated automatically by core library. - */ -static app_usbd_state_t m_app_usbd_state = APP_USBD_STATE_Disabled; - -/** - * @brief Active device features. - * - * @note Only @ref APP_USBD_SETUP_STDFEATURE_DEVICE_REMOTE_WAKEUP is supported for device. - */ -static uint8_t m_device_features_state; - -/** - * @brief Remote wake-up pending flag. - */ -static nrf_atomic_flag_t m_rwu_pending; - - -/** - * @brief Core class methods. - * - * Base methods interface for core class. - * This is quite specific class - it would be only connected into endpoint 0. - * Not connected into instances list. - */ -static const app_usbd_class_methods_t m_core_methods = { - .event_handler = app_usbd_core_event_handler, - .feed_descriptors = NULL, -}; - -/** - * @brief Setup transfer buffer. - */ -static uint8_t m_setup_transfer_buff[NRF_DRV_USBD_EPSIZE]; - - -/** - * @brief Handler for outgoing setup data. - * - */ -static app_usbd_core_setup_data_handler_desc_t m_ep0_handler_desc; - -#define APP_USBD_CORE_CLASS_INSTANCE_CONFIG () - - -/*lint -u -save -e26 -e40 -e64 -e123 -e505 -e651*/ - -/** - * @brief Core instance. - * - * Create instance that would be connected into endpoints in USBD library. - */ -APP_USBD_CLASS_INST_GLOBAL_DEF( - app_usbd_core_inst, - app_usbd_core, - &m_core_methods, - APP_USBD_CORE_CLASS_CONFIGURATION, - () ); -/*lint -restore*/ - -/** - * @brief Set the new USB state. - * - * Function changes the internal status of the bus. - * If the bus status is different than the one configured, an event is passed to all - * the instances. - * - * @param state New state to be set. - * - * @sa usbd_core_state_get - */ -static void usbd_core_state_set(app_usbd_state_t state) -{ - if (m_app_usbd_state != state) - { - m_app_usbd_state = state; - if(state != APP_USBD_STATE_Configured) - { - CLR_BIT(m_device_features_state, APP_USBD_SETUP_STDFEATURE_DEVICE_REMOTE_WAKEUP); - } - static const app_usbd_evt_t evt_data = { - .type = APP_USBD_EVT_STATE_CHANGED - }; - app_usbd_event_execute((app_usbd_internal_evt_t const *)&evt_data); - } -} - -/** - * @brief Get the current USB state - internal function. - * - * This is just a wrapper for @ref app_usbd_core_state_get - * to make symmetrical function to the internal @ref usbd_core_state_set. - * - * @return Current USB state. - * - * @sa usbd_core_state_set - * @sa app_usbd_core_state_get - */ -static inline app_usbd_state_t usbd_core_state_get(void) -{ - return m_app_usbd_state; -} - -/** - * @brief Check current USBD power connection status. - * - */ -static inline bool usbd_core_power_is_detected(void) -{ - return 0 != ( (NRF_POWER->USBREGSTATUS) & POWER_USBREGSTATUS_VBUSDETECT_Msk); -} - -/** - * @brief Clear current EP0 handler. - * - * Function just clears the EP0 handler without calling it. - */ -static inline void usbd_core_ep0_handler_clear(void) -{ - m_ep0_handler_desc.handler = NULL; -} - -/** - * @brief Safely call EP0 handler. - * - * Function calls EP0 handler only if its pointer is non-zero. - * - * @param status Status to send as a handler parameter. - */ -static inline ret_code_t usbd_core_ep0_handler_call_and_clear(nrf_drv_usbd_ep_status_t status) -{ - app_usbd_core_setup_data_handler_t handler = m_ep0_handler_desc.handler; - if (NULL != handler) - { - usbd_core_ep0_handler_clear(); - return handler(status, m_ep0_handler_desc.p_context); - } - - return NRF_ERROR_NULL; -} - -/** - * @brief Check if EP0 handler is configured. - * - * EP0 handler is configured is any instance that has processed SETUP command - * expects some incoming / outgoing data. - * - * EP0 handler should be cleared automatically just before it is called - * (see @ref usbd_core_ep0_handler_call_and_clear). - * If instance requires more data - it has to setup EP0 handler once more time - * (see @ref app_usbd_core_setup_data_handler_set). - * - * This function adds small layer of abstraction for checking if EP0 handler - * is already configured. - * - * @retval true EP0 handler is set. - * @retval false EP0 handler is cleared. - */ -static inline bool usb_core_ep0_handler_check(void) -{ - return (NULL != m_ep0_handler_desc.handler); -} - -/** - * @brief Empty data handler. - * - * Data handler used only to mark that there is requested data during SETUP. - * - * @return Always NRF_SUCCESS - * @sa setup_empty_data_handler_desc - */ -static ret_code_t setup_data_handler_empty(nrf_drv_usbd_ep_status_t status, void * p_contex) -{ - UNUSED_PARAMETER(status); - UNUSED_PARAMETER(p_contex); - return NRF_SUCCESS; -} - -/** - * @brief - * - * Empty EP0 transfer transfer handler. - */ -static app_usbd_core_setup_data_handler_desc_t const m_setup_data_handler_empty_desc = -{ - .handler = setup_data_handler_empty, - .p_context = NULL -}; - -/** - * @brief Structure used as a context for descriptor feeder. - * - * Structure with all the data required to process instances to generate descriptor - * data chunk. - */ -typedef struct -{ - app_usbd_class_inst_t const * p_cinst; //!< The class instance that is to be processed next. - const uint8_t * p_desc; //!< Pointer at current descriptor or NULL if finished. - /**< - * If the value passed by @ref p_desc is NULL on transfer function enter it means that ZLP is required. - * Or it is time to finish the transfer (depending on @c total_left). - */ - size_t desc_left; //!< Number of bytes left in the current class descriptor to send - size_t total_left; //!< Number of bytes left that was requested by the host - app_usbd_class_descriptor_ctx_t feed_thread; //!< Class descriptor context -} app_usbd_core_descriptor_conf_feed_data_t; - -/** - * @brief Default data used by the feeder. - * - * - */ -static app_usbd_core_descriptor_conf_feed_data_t m_descriptor_conf_feed_data; - -/** - * @brief Descriptor feeder. - * - * Descriptor feeder is used as an callback function when descriptors are - * transfered and buffer is ready for next data. - * It prepares next chunk of data to be sent. - * - * @param p_next See @ref nrf_drv_usbd_next_transfer_handler_t documentation. - * @param p_context Pointer to @ref app_usbd_core_descriptor_feed_data_t data type. - * @param ep_size The size of the endpoint. - * - * @return See @ref nrf_drv_usbd_next_transfer_handler_t documentation. - */ -static bool usbd_descriptor_conf_feeder( - nrf_drv_usbd_ep_transfer_t * p_next, - void * p_context, - size_t ep_size) -{ - bool continue_req = true; - - app_usbd_core_descriptor_conf_feed_data_t * p_data = p_context; - - - if ((p_data->p_desc == NULL) && (app_usbd_class_next_get(p_data->p_cinst) == NULL) - && (p_data->desc_left == 0)) - { - /* ZLP */ - continue_req = false; - p_next->p_data.tx = NULL; - p_next->size = 0; - } - else - { - ASSERT(ep_size <= NRF_DRV_USBD_FEEDER_BUFFER_SIZE); - uint8_t * p_tx_buff; - size_t size = 0; /* Currently added number of bytes */ - size_t tx_size; /* Number of bytes to send right now */ - bool feeding = false; - - /* Feeder function can use the USBD driver internal buffer */ - p_tx_buff = nrf_drv_usbd_feeder_buffer_get(); - - tx_size = MIN(ep_size, p_data->total_left); - - while (0 != tx_size) - { - size_t to_copy = MIN(tx_size, p_data->desc_left); - - /* First transfer */ - if (p_data->p_desc != NULL) - { - memcpy(p_tx_buff + size, p_data->p_desc, to_copy); - p_data->p_desc = NULL; - } - /* Starting with second transfer */ - else if (0 < p_data->desc_left) - { - UNUSED_RETURN_VALUE(p_data->p_cinst->p_class_methods->feed_descriptors( - &p_data->feed_thread, p_data->p_cinst, - (uint8_t *)p_tx_buff + size, to_copy)); - feeding = true; - } - else - { - ; - } - - p_data->desc_left -= to_copy; - p_data->total_left -= to_copy; - tx_size -= to_copy; - size += to_copy; - - /* Switch to next class if no descriptor left and first feeding was done */ - if(p_data->desc_left == 0 && feeding) - { - p_data->p_cinst = app_usbd_class_next_get(p_data->p_cinst); - } - - if (0 == p_data->total_left) - { - continue_req = false; - } - else if (0 == p_data->desc_left) - { - if (NULL == p_data->p_cinst) - { - p_data->p_desc = NULL; - /* No more data - check if ZLP is required */ - if (size > 0) - { - if (size < ep_size) - { - continue_req = false; - } - } - break; - } - else - { - /* New class - count descriptor size and initialize feeding thread */ - app_usbd_class_descriptor_ctx_t desiz; - APP_USBD_CLASS_DESCRIPTOR_INIT(&desiz); - while(p_data->p_cinst->p_class_methods->feed_descriptors( - &desiz, p_data->p_cinst, NULL, sizeof(uint8_t))) - { - p_data->desc_left++; - } - APP_USBD_CLASS_DESCRIPTOR_INIT(&p_data->feed_thread); - } - } - else - { - /* Nothing to do */ - } - } - p_next->p_data.tx = p_tx_buff; - p_next->size = size; - } - return continue_req; -} - -/** - * @brief Standard endpoint request handle. - * - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - */ -static ret_code_t setup_endpoint_req_std(app_usbd_setup_evt_t const * p_setup_ev) -{ - if (APP_USBD_SETUP_REQTYPE_STD != app_usbd_setup_req_typ(p_setup_ev->setup.bmRequestType)) - { - return NRF_ERROR_NOT_SUPPORTED; - } - - nrf_drv_usbd_ep_t ep_addr = (nrf_drv_usbd_ep_t)(p_setup_ev->setup.wIndex.lb); - app_usbd_state_t usb_state = usbd_core_state_get(); - - switch (p_setup_ev->setup.bRequest) - { - case APP_USBD_SETUP_STDREQ_GET_STATUS: - { - if ((usb_state == APP_USBD_STATE_Configured) || (NRF_USBD_EP_NR_GET(ep_addr) == 0)) - { - size_t tx_size; - uint16_t * p_tx_buff = app_usbd_core_setup_transfer_buff_get(&tx_size); - - p_tx_buff[0] = nrf_drv_usbd_ep_stall_check(ep_addr) ? 1 : 0; - return app_usbd_core_setup_rsp(&(p_setup_ev->setup), p_tx_buff, sizeof(uint16_t)); - } - else - { - return NRF_ERROR_INVALID_STATE; - } - } - case APP_USBD_SETUP_STDREQ_SET_FEATURE: - { - if ((!NRF_USBD_EPISO_CHECK(ep_addr)) && - (p_setup_ev->setup.wValue.w == APP_USBD_SETUP_STDFEATURE_ENDPOINT_HALT)) - { - if ((usb_state == APP_USBD_STATE_Configured) || (NRF_USBD_EP_NR_GET(ep_addr) == 0)) - { - nrf_drv_usbd_ep_stall(ep_addr); - return NRF_SUCCESS; - } - else - { - return NRF_ERROR_INVALID_STATE; - } - } - break; - } - case APP_USBD_SETUP_STDREQ_CLEAR_FEATURE: - { - if ((!NRF_USBD_EPISO_CHECK(ep_addr)) && - (p_setup_ev->setup.wValue.w == APP_USBD_SETUP_STDFEATURE_ENDPOINT_HALT)) - { - if ((usb_state == APP_USBD_STATE_Configured) || (NRF_USBD_EP_NR_GET(ep_addr) == 0)) - { - nrf_drv_usbd_ep_dtoggle_clear(ep_addr); - nrf_drv_usbd_ep_stall_clear(ep_addr); - return NRF_SUCCESS; - } - else - { - return NRF_ERROR_INVALID_STATE; - } - } - break; - } - default: - break; - } - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief Standard interface request handle. - * - * @param[in,out] p_class_inst Class instance that holds selected interface. - * @param[in] iface_idx Index of the interface in class structure. - * @param[in] p_event Event structure to be processed. - * - * @return Operation status. - */ -static ret_code_t setup_interface_req_std_handle( - app_usbd_class_inst_t const * const p_class_inst, - uint8_t iface_idx, - app_usbd_setup_evt_t const * p_setup_ev) -{ - if (APP_USBD_SETUP_REQTYPE_STD != app_usbd_setup_req_typ(p_setup_ev->setup.bmRequestType)) - { - return NRF_ERROR_NOT_SUPPORTED; - } - - app_usbd_state_t usb_state = usbd_core_state_get(); - - if (app_usbd_setup_req_dir(p_setup_ev->setup.bmRequestType) == APP_USBD_SETUP_REQDIR_IN) - { - switch (p_setup_ev->setup.bRequest) - { - case APP_USBD_SETUP_STDREQ_GET_STATUS: - { - if (!(usb_state == APP_USBD_STATE_Configured)) - { - return NRF_ERROR_INVALID_STATE; - } - size_t tx_size; - uint16_t * p_tx_buff = app_usbd_core_setup_transfer_buff_get(&tx_size); - p_tx_buff[0] = 0; - return app_usbd_core_setup_rsp(&(p_setup_ev->setup), p_tx_buff, sizeof(uint16_t)); - } - case APP_USBD_SETUP_STDREQ_GET_INTERFACE: - { - if (!(usb_state == APP_USBD_STATE_Configured)) - { - return NRF_ERROR_INVALID_STATE; - } - size_t tx_size; - uint8_t * p_tx_buff = app_usbd_core_setup_transfer_buff_get(&tx_size); - p_tx_buff[0] = app_usbd_iface_selection_get(p_class_inst, iface_idx); - return app_usbd_core_setup_rsp(&(p_setup_ev->setup), p_tx_buff, sizeof(uint8_t)); - } - } - } - else /* APP_USBD_SETUP_REQDIR_OUT */ - { - switch (p_setup_ev->setup.bRequest) - { - case APP_USBD_SETUP_STDREQ_SET_INTERFACE: - { - if (!(usb_state == APP_USBD_STATE_Configured)) - { - return NRF_ERROR_INVALID_STATE; - } - - if(p_setup_ev->setup.wValue.w > UINT8_MAX) - { - return NRF_ERROR_INVALID_PARAM; - } - uint8_t alt = p_setup_ev->setup.wValue.lb; - return app_usbd_iface_select(p_class_inst, iface_idx, alt); - } - default: - break; - } - } - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief - * - * Descriptors feeder handle structure. - */ -static const nrf_drv_usbd_handler_desc_t usbd_descriptor_feeder_desc = -{ - .handler = { .feeder = usbd_descriptor_conf_feeder }, - .p_context = &m_descriptor_conf_feed_data -}; - -static ret_code_t setup_device_req_get_status( - app_usbd_class_inst_t const * const p_inst, - app_usbd_setup_evt_t const * const p_setup_ev) -{ - size_t max_size; - uint8_t * p_trans_buff = app_usbd_core_setup_transfer_buff_get(&max_size); - ASSERT(sizeof(uint16_t) <= max_size); - - memset(p_trans_buff, 0, sizeof(uint16_t)); - if (m_configuration_dsc.bmAttributes & - APP_USBD_DESCRIPTOR_CONFIGURATION_ATTRIBUTE_SELF_POWERED_MASK) - { - SET_BIT(p_trans_buff[0], 0); - } - if (IS_SET(m_device_features_state, APP_USBD_SETUP_STDFEATURE_DEVICE_REMOTE_WAKEUP)) - { - SET_BIT(p_trans_buff[0], 1); - } - return app_usbd_core_setup_rsp(&(p_setup_ev->setup), p_trans_buff, sizeof(uint16_t)); -} - -static ret_code_t setup_device_req_get_descriptor(app_usbd_class_inst_t const * const p_inst, - app_usbd_setup_evt_t const * const p_setup_ev) -{ - switch (p_setup_ev->setup.wValue.hb) - { - case APP_USBD_DESCRIPTOR_DEVICE: - { - if(p_setup_ev->setup.wLength.w == 0) - { - return NRF_SUCCESS; - } - - return app_usbd_core_setup_rsp(&(p_setup_ev->setup), - &m_device_dsc, - sizeof(m_device_dsc)); - } - case APP_USBD_DESCRIPTOR_CONFIGURATION: - { - if(p_setup_ev->setup.wLength.w == 0) - { - return NRF_SUCCESS; - } - - /* The size equals the size of configuration descriptor and all classes descriptors */ - const size_t size = MIN( - sizeof(app_usbd_descriptor_configuration_t), - p_setup_ev->setup.wLength.w); - size_t total_length = sizeof(app_usbd_descriptor_configuration_t); - uint8_t iface_count = 0; - - /* Iterate over all registered classes count descriptors and total size */ - app_usbd_class_inst_t const * p_class; - for (p_class = app_usbd_class_first_get(); p_class != NULL; - p_class = app_usbd_class_next_get(p_class)) - { - ASSERT(NULL != (p_class->p_class_methods)); - ASSERT(NULL != (p_class->p_class_methods->feed_descriptors)); - size_t dsc_size = 0; - app_usbd_class_descriptor_ctx_t siz_desc; - APP_USBD_CLASS_DESCRIPTOR_INIT(&siz_desc); - while(p_class->p_class_methods->feed_descriptors(&siz_desc, - p_class, - NULL, - sizeof(uint8_t)) - ) - { - dsc_size++; - } - total_length += dsc_size; - iface_count += app_usbd_class_iface_count_get(p_class); - } - - /* Access transmission buffer */ - size_t max_size; - app_usbd_descriptor_configuration_t * p_trans_buff = - app_usbd_core_setup_transfer_buff_get(&max_size); - /* Copy the configuration descriptor and update the fields that require it */ - ASSERT(size <= max_size); - memcpy(p_trans_buff, &m_configuration_dsc, size); - - p_trans_buff->bNumInterfaces = iface_count; - p_trans_buff->wTotalLength = total_length; - if (app_usbd_class_rwu_enabled_check()) - { - p_trans_buff->bmAttributes |= - APP_USBD_DESCRIPTOR_CONFIGURATION_ATTRIBUTE_REMOTE_WAKEUP_MASK; - } - - - m_descriptor_conf_feed_data.p_cinst = app_usbd_class_first_get(); - m_descriptor_conf_feed_data.p_desc = (void *)p_trans_buff; - m_descriptor_conf_feed_data.desc_left = size; - m_descriptor_conf_feed_data.total_left = p_setup_ev->setup.wLength.w; - - /* Start first transfer */ - ret_code_t ret; - CRITICAL_REGION_ENTER(); - - ret = app_usbd_ep_handled_transfer( - NRF_DRV_USBD_EPIN0, - &usbd_descriptor_feeder_desc); - - if (NRF_SUCCESS == ret) - { - ret = app_usbd_core_setup_data_handler_set( - NRF_DRV_USBD_EPIN0, - &m_setup_data_handler_empty_desc); - } - CRITICAL_REGION_EXIT(); - - return ret; - } - case APP_USBD_DESCRIPTOR_STRING: - { - if(p_setup_ev->setup.wLength.w == 0) - { - return NRF_SUCCESS; - } - - app_usbd_string_desc_idx_t id = - (app_usbd_string_desc_idx_t)(p_setup_ev->setup.wValue.lb); - uint16_t langid = p_setup_ev->setup.wIndex.w; - uint16_t const * p_string_dsc = app_usbd_string_desc_get(id, langid); - if (p_string_dsc == NULL) - { - return NRF_ERROR_NOT_SUPPORTED; - } - - return app_usbd_core_setup_rsp( - &p_setup_ev->setup, - p_string_dsc, - app_usbd_string_desc_length(p_string_dsc)); - } - default: - break; - } - - - return NRF_ERROR_NOT_SUPPORTED; -} - -static ret_code_t setup_device_req_get_configuration( - app_usbd_class_inst_t const * const p_inst, - app_usbd_setup_evt_t const * const p_setup_ev) -{ - size_t max_size; - uint8_t * p_trans_buff = app_usbd_core_setup_transfer_buff_get(&max_size); - app_usbd_state_t usb_state = usbd_core_state_get(); - if (usb_state == APP_USBD_STATE_Configured) - { - p_trans_buff[0] = 1; - } - else if (usb_state == APP_USBD_STATE_Addressed) - { - p_trans_buff[0] = 0; - } - else - { - return NRF_ERROR_NOT_SUPPORTED; - } - - return app_usbd_core_setup_rsp(&p_setup_ev->setup, p_trans_buff, sizeof(p_trans_buff[0])); -} - -static ret_code_t setup_device_req_set_configuration( - app_usbd_class_inst_t const * const p_inst, - app_usbd_setup_evt_t const * const p_setup_ev) -{ - app_usbd_state_t usb_state = usbd_core_state_get(); - if (!((usb_state == APP_USBD_STATE_Configured) || - (usb_state == APP_USBD_STATE_Addressed))) - { - return NRF_ERROR_INVALID_STATE; - } - - if (p_setup_ev->setup.wValue.lb == 0) - { - app_usbd_all_iface_deselect(); - usbd_core_state_set(APP_USBD_STATE_Addressed); - } - else if (p_setup_ev->setup.wValue.lb == 1) - { - /*Clear all bulk/interrupt endpoint status and set toggle to DATA0*/ - app_usbd_all_iface_select_0(); - usbd_core_state_set(APP_USBD_STATE_Configured); - } - else - { - /*In this driver only one configuration is supported.*/ - return NRF_ERROR_INVALID_PARAM; - } - - return NRF_SUCCESS; -} - -/** - * @brief Internal SETUP event handler. - * @param[in] p_inst Instance of the class. - * @param[in] p_setup_ev Setup request. - * @return Standard error code. - * @retval NRF_SUCCESS Request handled correctly. - * @retval NRF_ERROR_NOT_SUPPORTED Request is not supported. - */ -static ret_code_t setup_device_req_std_handler(app_usbd_class_inst_t const * const p_inst, - app_usbd_setup_evt_t const * const p_setup_ev) -{ - ASSERT(p_inst != NULL); - ASSERT(p_setup_ev != NULL); - - if (APP_USBD_SETUP_REQTYPE_STD != app_usbd_setup_req_typ(p_setup_ev->setup.bmRequestType)) - { - return NRF_ERROR_NOT_SUPPORTED; - } - - if (app_usbd_setup_req_dir(p_setup_ev->setup.bmRequestType) == APP_USBD_SETUP_REQDIR_IN) - { - switch (p_setup_ev->setup.bRequest) - { - case APP_USBD_SETUP_STDREQ_GET_STATUS: - { - return setup_device_req_get_status(p_inst, p_setup_ev); - } - case APP_USBD_SETUP_STDREQ_GET_DESCRIPTOR: - { - return setup_device_req_get_descriptor(p_inst, p_setup_ev); - } - case APP_USBD_SETUP_STDREQ_GET_CONFIGURATION: - { - return setup_device_req_get_configuration(p_inst, p_setup_ev); - } - default: - /*Not supported*/ - break; - } - return NRF_ERROR_NOT_SUPPORTED; - } - else /* APP_USBD_SETUP_REQDIR_OUT */ - { - switch (p_setup_ev->setup.bRequest) - { - case APP_USBD_SETUP_STDREQ_SET_ADDRESS: - { - ASSERT(0); /* should never reach this point */ - break; - } - case APP_USBD_SETUP_STDREQ_SET_FEATURE: - { - if (p_setup_ev->setup.wValue.w == APP_USBD_SETUP_STDFEATURE_DEVICE_REMOTE_WAKEUP) - { - if (!app_usbd_class_rwu_enabled_check()) - { - return NRF_ERROR_FORBIDDEN; - } - SET_BIT(m_device_features_state, APP_USBD_SETUP_STDFEATURE_DEVICE_REMOTE_WAKEUP); - return NRF_SUCCESS; - } - break; - } - case APP_USBD_SETUP_STDREQ_CLEAR_FEATURE: - { - if (p_setup_ev->setup.wValue.w == APP_USBD_SETUP_STDFEATURE_DEVICE_REMOTE_WAKEUP) - { - if (!app_usbd_class_rwu_enabled_check()) - { - return NRF_ERROR_FORBIDDEN; - } - CLR_BIT(m_device_features_state, APP_USBD_SETUP_STDFEATURE_DEVICE_REMOTE_WAKEUP); - return NRF_SUCCESS; - } - break; - } - case APP_USBD_SETUP_STDREQ_SET_CONFIGURATION: - { - return setup_device_req_set_configuration(p_inst, p_setup_ev); - } - case APP_USBD_SETUP_STDREQ_SET_DESCRIPTOR: - { - /*Not supported yet.*/ - break; - } - default: - /*Not supported*/ - break; - } - return NRF_ERROR_NOT_SUPPORTED; - } -} - -/** - * @brief Process SETUP command. - * - * Auxiliary function for SETUP command processing. - */ -static inline ret_code_t app_usbd_core_setup_req_handler(app_usbd_class_inst_t const * const p_inst) -{ - app_usbd_setup_evt_t setup_ev; - ret_code_t ret = NRF_ERROR_NOT_SUPPORTED; /* Final result of request processing function */ - - setup_ev.type = APP_USBD_EVT_DRV_SETUP; - nrf_drv_usbd_setup_get((nrf_drv_usbd_setup_t *)&(setup_ev.setup)); - - NRF_LOG_DEBUG("SETUP: t: 0x%.2x r: 0x%.2x", - setup_ev.setup.bmRequestType, - setup_ev.setup.bRequest); - if (usb_core_ep0_handler_check()) - { - NRF_LOG_WARNING("Previous setup not finished!"); - } - /* Clear EP0 handler if there is anything in progress */ - usbd_core_ep0_handler_clear(); - - switch (app_usbd_setup_req_rec(setup_ev.setup.bmRequestType)) - { - case APP_USBD_SETUP_REQREC_DEVICE: - { - /* Endpoint 0 has core instance (that process device requests) connected */ - ret = setup_device_req_std_handler(p_inst, &setup_ev); - if (ret == NRF_ERROR_NOT_SUPPORTED) - { - ret = app_usbd_all_until_served_call((app_usbd_complex_evt_t const *)&setup_ev); - } - break; - } - case APP_USBD_SETUP_REQREC_INTERFACE: - { - uint8_t const iface_number = setup_ev.setup.wIndex.lb; - uint8_t iface_idx; - app_usbd_class_inst_t const * p_inst_found = app_usbd_iface_find( - iface_number, - &iface_idx); - if (p_inst_found == NULL) - { - ret = NRF_ERROR_INVALID_ADDR; - } - else - { - ret = app_usbd_iface_call( - p_inst_found, iface_idx, - (app_usbd_complex_evt_t const *)&setup_ev); - if (ret == NRF_ERROR_NOT_SUPPORTED) - { - ret = setup_interface_req_std_handle(p_inst_found, iface_idx, &setup_ev); - } - } - break; - } - case APP_USBD_SETUP_REQREC_ENDPOINT: - { - ret = NRF_ERROR_NOT_SUPPORTED; - nrf_drv_usbd_ep_t ep = (nrf_drv_usbd_ep_t)setup_ev.setup.wIndex.lb; - if ((NRF_USBD_EP_NR_GET(ep) != 0)) /* For EP0 we would call this function again! */ - { - ret = app_usbd_ep_call(ep, (app_usbd_complex_evt_t const *)&setup_ev); - } - if (ret == NRF_ERROR_NOT_SUPPORTED) - { - ret = setup_endpoint_req_std(&setup_ev); - } - break; - } - case APP_USBD_SETUP_REQREC_OTHER: - { - /* Try to process via every instance */ - ret = app_usbd_all_until_served_call((app_usbd_complex_evt_t const *)&setup_ev); - break; - } - default: - break; - } - - /* Processing result */ - if (ret == NRF_SUCCESS) - { - if (usb_core_ep0_handler_check()) - { - if (NRF_DRV_USBD_EPOUT0 == nrf_drv_usbd_last_setup_dir_get()) - { - /* Request processed successfully and requires SETUP data */ - nrf_drv_usbd_setup_data_clear(); - } - } - else - { - /* Request processed successfully */ - nrf_drv_usbd_setup_clear(); - } - } - else - { - /* Request finished with error */ - nrf_drv_usbd_setup_stall(); - } - return ret; -} - -/** - * @brief Event handler for core module. - * - * The event handler that would process all events directed to device. - * - */ -static ret_code_t app_usbd_core_event_handler(app_usbd_class_inst_t const * const p_inst, - app_usbd_complex_evt_t const * const p_event) -{ - ret_code_t ret = NRF_ERROR_NOT_SUPPORTED; - switch (p_event->type) - { - case APP_USBD_EVT_DRV_RESET: - { - usbd_core_state_set(APP_USBD_STATE_Default); - break; - } - case APP_USBD_EVT_DRV_SUSPEND: - { - ret = NRF_SUCCESS; - break; - } - case APP_USBD_EVT_DRV_RESUME: - { - if (nrf_atomic_flag_clear_fetch(&m_rwu_pending) != 0) - { - nrf_usbd_task_trigger(NRF_USBD_TASK_NODRIVEDPDM); - } - - ASSERT(usbd_core_state_get() >= APP_USBD_STATE_Unattached); - ret = NRF_SUCCESS; - break; - } - case APP_USBD_EVT_SETUP_SETADDRESS: - { - app_usbd_state_t usb_state = usbd_core_state_get(); - if (usb_state == APP_USBD_STATE_Default) - { - usbd_core_state_set(APP_USBD_STATE_Addressed); - } - break; - } - case APP_USBD_EVT_DRV_SETUP: - { - ret = app_usbd_core_setup_req_handler(p_inst); - break; - } - case APP_USBD_EVT_INST_APPEND: - { - ASSERT(usbd_core_state_get() == APP_USBD_STATE_Disabled); - ret = NRF_SUCCESS; - break; - } - case APP_USBD_EVT_INST_REMOVE: - { - ASSERT(usbd_core_state_get() == APP_USBD_STATE_Unattached); - usbd_core_state_set(APP_USBD_STATE_Disabled); - ret = NRF_SUCCESS; - break; - } - case APP_USBD_EVT_STARTED: - { - if (usbd_core_power_is_detected()) - { - usbd_core_state_set(APP_USBD_STATE_Powered); - } - else - { - usbd_core_state_set(APP_USBD_STATE_Unattached); - } - ret = NRF_SUCCESS; - break; - } - case APP_USBD_EVT_STOPPED: - { - ASSERT(usbd_core_state_get() >= APP_USBD_STATE_Powered); - usbd_core_state_set(APP_USBD_STATE_Unattached); - ret = NRF_SUCCESS; - break; - } - /* Data transfer on endpoint 0 */ - case APP_USBD_EVT_DRV_EPTRANSFER: - { - if (p_event->drv_evt.data.eptransfer.status == NRF_USBD_EP_ABORTED) - { - /* Just ignore aborting */ - break; - } - /* This EPTRANSFER event has to be called only for EP0 */ - ASSERT((p_event->drv_evt.data.eptransfer.ep == NRF_DRV_USBD_EPOUT0) || - (p_event->drv_evt.data.eptransfer.ep == NRF_DRV_USBD_EPIN0)); - ret = usbd_core_ep0_handler_call_and_clear(p_event->drv_evt.data.eptransfer.status); - /* Processing result */ - if (ret == NRF_SUCCESS) - { - if (usb_core_ep0_handler_check()) - { - if (p_event->drv_evt.data.eptransfer.ep == NRF_DRV_USBD_EPOUT0) - { - /* Request processed successfully and requires SETUP data */ - nrf_drv_usbd_setup_data_clear(); - } - } - else - { - if (!nrf_drv_usbd_errata_154()) - { - nrf_drv_usbd_setup_clear(); - } - } - } - else - { - /* Request finished with error */ - nrf_drv_usbd_setup_stall(); - } - break; - } - default: - break; - } - - return ret; -} - -/** @} */ - -void app_usbd_core_ep0_enable(void) -{ - app_usbd_ep_enable(NRF_DRV_USBD_EPOUT0); - app_usbd_ep_enable(NRF_DRV_USBD_EPIN0); -} - -void app_usbd_core_ep0_disable(void) -{ - app_usbd_ep_disable(NRF_DRV_USBD_EPOUT0); - app_usbd_ep_disable(NRF_DRV_USBD_EPIN0); -} - - -ret_code_t app_usbd_core_setup_rsp(app_usbd_setup_t const * p_setup, - void const * p_data, - size_t size) -{ - size_t req_size = p_setup->wLength.w; - size_t tx_size = MIN(req_size, size); - bool zlp_required = (size < req_size) && - (0 == (size % nrf_drv_usbd_ep_max_packet_size_get(NRF_DRV_USBD_EPIN0))); - - NRF_DRV_USBD_TRANSFER_IN_FLAGS( - transfer, - p_data, - tx_size, - zlp_required ? NRF_DRV_USBD_TRANSFER_ZLP_FLAG : 0); - - ret_code_t ret; - CRITICAL_REGION_ENTER(); - ret = app_usbd_ep_transfer(NRF_DRV_USBD_EPIN0, &transfer); - if (NRF_SUCCESS == ret) - { - ret = app_usbd_core_setup_data_handler_set(NRF_DRV_USBD_EPIN0, - &m_setup_data_handler_empty_desc); - } - CRITICAL_REGION_EXIT(); - - return ret; -} - -ret_code_t app_usbd_core_setup_data_handler_set( - nrf_drv_usbd_ep_t ep, - app_usbd_core_setup_data_handler_desc_t const * const p_handler_desc) -{ - if (nrf_drv_usbd_last_setup_dir_get() != ep) - { - return NRF_ERROR_INVALID_ADDR; - } - - m_ep0_handler_desc = *p_handler_desc; - return NRF_SUCCESS; -} - -void * app_usbd_core_setup_transfer_buff_get(size_t * p_size) -{ - if (p_size != NULL) - *p_size = sizeof(m_setup_transfer_buff); - - return m_setup_transfer_buff; -} - -app_usbd_state_t app_usbd_core_state_get(void) -{ - return usbd_core_state_get(); -} - - -bool app_usbd_core_feature_state_get(app_usbd_setup_stdfeature_t feature) -{ - return IS_SET(m_device_features_state, feature) ? true : false; -} - -#endif //NRF_MODULE_ENABLED(APP_USBD) diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_core.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_core.h deleted file mode 100644 index efa9d3e56..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_core.h +++ /dev/null @@ -1,222 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef APP_USBD_CORE_H__ -#define APP_USBD_CORE_H__ - -#include - -#include "sdk_common.h" -#include "nrf_drv_usbd.h" -#include "app_usbd_types.h" -#include "app_usbd_class_base.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * @defgroup app_usbd_core USB Device high level library core module - * @ingroup app_usbd - * - * @brief @tagAPI52840 Core module that manages current USB state and process device requests. - * @{ - */ - -/** - * @brief Core interface configuration. - * - * Core instance would have 2 endpoints (IN0 and OUT0). - * The interface number does not matter because it is not used. - */ -#define APP_USBD_CORE_CLASS_CONFIGURATION ((0, NRF_DRV_USBD_EPOUT0, NRF_DRV_USBD_EPIN0)) - -/** - * @brief USB Device state. - * - * Possible USB Device states according to specification. - */ -typedef enum -{ - APP_USBD_STATE_Disabled , /**< The whole USBD library is disabled */ - APP_USBD_STATE_Unattached, /**< Device is currently not connected to the host */ - APP_USBD_STATE_Powered , /**< Device is connected to the host but has not been enumerated */ - APP_USBD_STATE_Default , /**< USB Reset condition detected, waiting for the address */ - APP_USBD_STATE_Addressed , /**< Device has been addressed but has not been configured */ - APP_USBD_STATE_Configured, /**< Device is addressed and configured */ -}app_usbd_state_t; - -/** - * @brief EP0 handler function pointer. - * - * Type of the variable that would hold the pointer to the handler for - * endpoint 0 messages processing. - * - * @param p_contex Context variable configured with the transmission request. - */ -typedef ret_code_t (*app_usbd_core_setup_data_handler_t)(nrf_drv_usbd_ep_status_t status, - void * p_context); - -/** - * @brief Variable type used to register EP0 transfer handler. - * - * EP0 messages are processed by core instance. - * Another class can register itself to receive messages from EP0 when requesting - * for Setup data transfer. - */ -typedef struct -{ - app_usbd_core_setup_data_handler_t handler; //!< Event handler to be called when transmission is ready - void * p_context; //!< Context pointer to be send to every called event. -} app_usbd_core_setup_data_handler_desc_t; - -/*lint -save -e10 -e26 -e93 -e123 -e505 */ -/** - * @brief Declare Core instance type. - * - * USBD core instance type definition. - */ -APP_USBD_CLASS_TYPEDEF(app_usbd_core, - APP_USBD_CORE_CLASS_CONFIGURATION, - APP_USBD_CLASS_INSTANCE_SPECIFIC_DEC_NONE, - APP_USBD_CLASS_DATA_SPECIFIC_DEC_NONE); -/*lint -restore*/ - -/** - * @brief Access to core instance. - * - * Function that returns pointer to the USBD core instance. - * - * @return pointer to the core instance. - */ -static inline app_usbd_class_inst_t const * app_usbd_core_instance_access(void) -{ - extern const APP_USBD_CLASS_INSTANCE_TYPE(app_usbd_core) app_usbd_core_inst; - return (app_usbd_class_inst_t const *)&app_usbd_core_inst; -} - -/** - * @brief Enable endpoint 0 - * - * Function enables endpoint OUT0 and IN0. - * This makes the USB respond to SETUP transfers. - */ -void app_usbd_core_ep0_enable(void); - -/** - * @brief Disable endpoint 0 - * - * Function disables endpoint OUT0 and IN0. - * This makes the USB ignore SETUP transfers. - */ -void app_usbd_core_ep0_disable(void); - -/** - * @brief Default simple response to setup command. - * - * This function generates default simple response. - * It sends ZLP when required and on takes care on allowing status stage when - * transfer is finished. - * - * @param p_setup Pointer to original setup message. - * @param p_data Pointer to the response. This has to be globaly aviable data. - * @param size Total size of the answer - The function takes care about - * limiting the size of transfered data to the size required - * by setup command. - */ -ret_code_t app_usbd_core_setup_rsp(app_usbd_setup_t const * p_setup, - void const * p_data, - size_t size); - -/** - * @brief Configure the handler for the nearest setup data endpoint transfer. - * - * This function would be called on incomming setup data. - * The correct place to set the handler for a data is when SETUP command - * was received. - * - * @param ep Endpoint number (only IN0 and OUT0 are supported). - * @param p_handler_desc Descriptor of the handler to be called. - * - * @retval NRF_SUCCESS Successfully configured. - * @retval NRF_ERROR_INVALID_ADDR Last received setup direction does not match - * configured endpoint. - */ -ret_code_t app_usbd_core_setup_data_handler_set( - nrf_drv_usbd_ep_t ep, - app_usbd_core_setup_data_handler_desc_t const * const p_handler_desc); - -/** - * @brief Set up a data transfer buffer. - * - * Returns special internal buffer that can be used in setup transfer. - * @return Internal buffer pointer. - */ -void * app_usbd_core_setup_transfer_buff_get(size_t * p_size); - - -/**@brief Return internal USBD core state. - * - * @return Check @ref app_usbd_state_t to find possible USBD core states. - */ -app_usbd_state_t app_usbd_core_state_get(void); - - -/** - * @brief Check current feature state. - * - * Function checks the state of the selected feature that was configured by the host. - * - * @param feature Feature to check. @ref app_usbd_setup_stdfeature_t - * Only features related to the device should be checked by this function. - * - * @retval true Selected feature is set. - * @retval false Selected feature is cleared. - */ -bool app_usbd_core_feature_state_get(app_usbd_setup_stdfeature_t feature); - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_CORE_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_descriptor.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_descriptor.h deleted file mode 100644 index 5c2e100cf..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_descriptor.h +++ /dev/null @@ -1,337 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef APP_USBD_DESCRIPTOR_H__ -#define APP_USBD_DESCRIPTOR_H__ - -#include "nrf.h" -#include "nrf_drv_usbd.h" -#include "app_usbd_langid.h" -#include "app_util_platform.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Compiler support for anonymous unions */ -ANON_UNIONS_ENABLE; - -/** - * @defgroup app_usbd_descriptor USB standard descriptors - * @ingroup app_usbd - * - * @brief @tagAPI52840 Module with types definitions used for standard descriptors. - * @{ - */ - -/** - * @brief Helper macro for translating unsigned 24 bit value to 2 byte raw descriptor. - * */ -#define APP_USBD_U16_TO_RAW_DSC(val) (uint8_t)(val), \ - (uint8_t)(((val) / (256))) - -/** - * @brief Helper macro for translating unsigned 24 bit value to 3 byte raw descriptor. - * */ -#define APP_USBD_U24_TO_RAW_DSC(val) (uint8_t)(val), \ - (uint8_t)(((val) / (256))), \ - (uint8_t)(((val) / (256 * 256))) - -/** - * @brief Helper macro for translating unsigned 32 bit value to 4 byte raw descriptor. - * */ -#define APP_USBD_U32_TO_RAW_DSC(val) (uint8_t)(val), \ - (uint8_t)(((val) / (256))), \ - (uint8_t)(((val) / (256 * 256))) \ - (uint8_t)(((val) / (256 * 256 * 256))) -/** - * @brief Descriptor types. - * - * Descriptor types used in two situations: - * - When processing @ref APP_USBD_SETUP_STDREQ_GET_DESCRIPTOR SETUP request, - * the required descriptor type may be placed in wValue in HighByte. - * - As a descriptor identifier itself inside descriptor stream. - * - * According to chapter 9.6 of USB 2.0 specification, following descriptors may - * be requested directly by GetDescriptor method: - * - @ref APP_USBD_DESCRIPTOR_DEVICE - * - @ref APP_USBD_DESCRIPTOR_DEVICE_QUALIFIER (not used for FullSpeed only device) - * - @ref APP_USBD_DESCRIPTOR_CONFIGURATION - * - @ref APP_USBD_DESCRIPTOR_STRING - */ -typedef enum -{ - APP_USBD_DESCRIPTOR_DEVICE = 1, /**< Device descriptor. */ - APP_USBD_DESCRIPTOR_CONFIGURATION = 2, /**< - * Specific configuration descriptor. - * Configuration descriptor is always followed by all the related interface - * and endpoints descriptors. - */ - APP_USBD_DESCRIPTOR_STRING = 3, /**< String descriptor. */ - APP_USBD_DESCRIPTOR_INTERFACE = 4, /**< - * Interface descriptor followed by all the related endpoints descriptors. - * - * @note It is returned together with @ref APP_USBD_DESCRIPTOR_CONFIGURATION. - * Cannot be accessed by GetDescriptor or SetDescriptor - */ - APP_USBD_DESCRIPTOR_ENDPOINT = 5, /**< - * Endpoint descriptor. - * - * @note It is returned together with @ref APP_USBD_DESCRIPTOR_CONFIGURATION. - * Cannot be accessed by GetDescriptor or SetDescriptor - */ - APP_USBD_DESCRIPTOR_DEVICE_QUALIFIER = 6, /**< @note Not supported - used only in HighSpeed capable devices. */ - APP_USBD_DESCRIPTOR_OTHER_SPEED_CONFIGURATION = 7, /**< @note Not supported - USB library supports only one speed. */ - APP_USBD_DESCRIPTOR_INTERFACE_POWER = 8, /**< @note Not supported */ - APP_USBD_DESCRIPTOR_OTG = 9, /**< @note Not supported - USB library does not have OTG functionality */ - APP_USBD_DESCRIPTOR_DEBUG = 10, /**< Debug channel descriptor if available, can be only reached by GetDescriptor */ - APP_USBD_DESCRIPTOR_INTERFACE_ASSOCIATION = 11, /**< - * Descriptor used to describe that two or more interfaces are associated to the same function. - * - * @note It is returned together with @ref APP_USBD_DESCRIPTOR_CONFIGURATION. - * Cannot be accessed by GetDescriptor or SetDescriptor - */ - APP_USBD_DESCRIPTOR_REPORT = 34, /**< HID Report descriptor. */ - APP_USBD_DESCRIPTOR_PHYSICAL = 35 /**< HID Physical descriptor. */ - -} app_usbd_descriptor_t; - -/* Make all descriptors packed */ -#pragma pack(push, 1) - -/** - * @brief Common descriptor header. - * - * The header that we can find on the beginning of all descriptors that contains - * the descriptor length and type. - */ -typedef struct -{ - uint8_t bLength; //!< Size of the descriptor in bytes. - uint8_t bDescriptorType; //!< Should equal one of @ref app_usbd_descriptor_t. - /** Class specific descriptors values are defined inside classes. */ -} app_usbd_descriptor_header_t; - -/** - * @brief Device descriptor. - * - * Descriptor used for the whole device. - */ -typedef struct -{ - uint8_t bLength; //!< Size of the descriptor in bytes. - uint8_t bDescriptorType; //!< Should equal to @ref APP_USBD_DESCRIPTOR_DEVICE. - uint16_t bcdUSB; //!< USB Specification Release Number in Binary-Coded Decimal - uint8_t bDeviceClass; //!< Device class code. - /**< If 0, each interface specifies its own class information. - * 0xFF for vendor-specific. - */ - uint8_t bDeviceSubClass; //!< Subclass code. - /**< If bDevice Class is set to value other than 0xFF, - * all values here are reserved for assignment by USB-IF. - */ - uint8_t bDeviceProtocol; //!< Subclass code. - /**< If 0, no specific protocol is defined on device basis. - * Each interface may define its own protocol then. - * If set to 0xFF, vendor-specific protocol is used. - */ - uint8_t bMaxPacketSize0; //!< Maximum packet size for endpoint zero. - uint16_t idVendor; //!< Vendor ID (Assigned by the USB-IF). - uint16_t idProduct; //!< Product ID (assigned by manufacturer). - uint16_t bcdDevice; //!< Device release number in binary-coded decimal. - uint8_t iManufacturer; //!< Index of string descriptor in describing manufacturer. - uint8_t iProduct; //!< Index of string descriptor in describing product. - uint8_t iSerialNumber; //!< Index of string descriptor in describing the device's serial number. - uint8_t bNumConfigurations; //!< Number of possible configurations. -} app_usbd_descriptor_device_t; - -/** - * @brief Attributes masks. - * - * Masks used for attributes in configuration. - */ -typedef enum -{ - /** This is reserved descriptor that has always to be set */ - APP_USBD_DESCRIPTOR_CONFIGURATION_ATTRIBUTE_ALWAYS_SET_MASK = 1U << 7, - /** Attribute that informs that device is self powered */ - APP_USBD_DESCRIPTOR_CONFIGURATION_ATTRIBUTE_SELF_POWERED_MASK = 1U << 6, - /** Attribute that informs that device has Remove Wakeup functionality */ - APP_USBD_DESCRIPTOR_CONFIGURATION_ATTRIBUTE_REMOTE_WAKEUP_MASK = 1U << 5 -} app_usbd_descriptor_configuration_attributes_t; - -/** - * @brief Configuration descriptor. - * - * Descriptor used at the beginning of configuration response. - */ -typedef struct -{ - uint8_t bLength; //!< Size of the descriptor in bytes. - uint8_t bDescriptorType; //!< Should equal to @ref APP_USBD_DESCRIPTOR_DEVICE. - uint16_t wTotalLength; //!< Total length of configuration data, including all descriptors returned after configuration itself. - uint8_t bNumInterfaces; //!< Number of interfaces supportedf by this configuration - uint8_t bConfigurationValue; //!< Value to use as an argument to the SetConfiguration request. - uint8_t iConfiguration; //!< Index of string descriptor describing this configuration. - uint8_t bmAttributes; //!< Configuration characteristics. - uint8_t bMaxPower; //!< Maximum power consumption. Expressed in 2 mA units. -} app_usbd_descriptor_configuration_t; - -/** - * @brief Raw descriptor - String descriptor zero. - * - * String descriptor sent only as a response for GetDescriptor. - */ -typedef struct -{ - uint8_t bLength; //!< Size of the descriptor in bytes. - uint8_t bDescriptorType; //!< Should equal to @ref APP_USBD_DESCRIPTOR_STRING. - uint16_t wLANGID[]; //!< The array of LANGID codes supported by the device. -} app_usbd_descriptor_string0_t; - -/** - * @brief Raw descriptor - Any normal string. - * - * String descriptor sent only as a response for GetDescriptor. - */ -typedef struct -{ - uint8_t bLength; //!< Size of the descriptor in bytes. - uint8_t bDescriptorType; //!< Should equal to @ref APP_USBD_DESCRIPTOR_STRING. - uint16_t bString[]; //!< UNICODE encoded string. -} app_usbd_descriptor_string_t; - - -/** - * @brief Interface descriptor. - * - * Interface descriptor, returned as a part of configuration descriptor. - */ -typedef struct -{ - uint8_t bLength; //!< Size of the descriptor in bytes. - uint8_t bDescriptorType; //!< Should equal to @ref APP_USBD_DESCRIPTOR_INTERFACE. - uint8_t bInterfaceNumber; //!< Number of this interface. - uint8_t bAlternateSetting; //!< Value used to select this alternate setting. - uint8_t bNumEndpoints; //!< Number of endpoints used by this interface. - uint8_t bInterfaceClass; //!< Class code (assigned by the USB-IF). 0xff for vendor specific. - uint8_t bInterfaceSubClass; //!< Subclass code (assigned by the USB-IF). - uint8_t bInterfaceProtocol; //!< Protocol code (assigned by the USB-IF). 0xff for vendor specific. - uint8_t iInterface; //!< Index of string descriptor describing this interface. -} app_usbd_descriptor_iface_t; - -/** Offset of endpoint type attribute bits */ -#define APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_OFFSET 0 -/** Mask of endpoint type attribute bits */ -#define APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_MASK BF_MASK(2, APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_OFFSET) - -/** Offset of endpoint synchronization type attribute bits */ -#define APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_OFFSET 2 -/** Mask of endpoint synchronization type attribute bits */ -#define APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_MASK BF_MASK(2, APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_OFFSET) - -/** Offset of endpoint usage type attribute bits */ -#define APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_OFFSET 4 -/** Mask of endpoint usage type attribute bits */ -#define APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_MASK BF_MASK(2, APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_OFFSET) - -/** - * @brief Endpoint attributes mnemonics. - * - * @sa APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_OFFSET APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_MASK - * @sa APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_OFFSET APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_MASK - * @sa APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_OFFSET APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_MASK - */ -typedef enum -{ - APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_CONTROL = 0 << APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_OFFSET, - APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_ISOCHRONOUS = 1 << APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_OFFSET, - APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_BULK = 2 << APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_OFFSET, - APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_INTERRUPT = 3 << APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_OFFSET, - - APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_NONE = 0 << APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_OFFSET, - APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_ASYNCHRONOUS = 1 << APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_OFFSET, - APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_ADAPTIVE = 2 << APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_OFFSET, - APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_SYNCHRONOUS = 3 << APP_USBD_DESCRIPTOR_EP_ATTR_SYNC_OFFSET, - - APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_DATA = 0 << APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_OFFSET, - APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_FEEDBACK = 1 << APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_OFFSET, - APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_IMPLICIT = 2 << APP_USBD_DESCRIPTOR_EP_ATTR_USAGE_OFFSET -} app_usbd_descriptor_ep_attr_bitmap_t; - -/** - * @brief Endpoint descriptor. - * - * Endpoint descriptor, returned as a part of configuration descriptor. - */ -typedef struct -{ - uint8_t bLength; //!< Size of the descriptor in bytes. - uint8_t bDescriptorType; //!< Should equal to @ref APP_USBD_DESCRIPTOR_ENDPOINT. - uint8_t bEndpointAddress; //!< Endpoint address - uint8_t bmAttributes; //!< Endpoint attributes - uint16_t wMaxPacketSize; //!< Maximum packet size this endpoint is capable of handling. - uint8_t bInterval; //!< Interval for pooling endpoint for data transfers. -} app_usbd_descriptor_ep_t; - -/** - * @brief Interface association descriptor. - */ -typedef struct -{ - uint8_t bLength; //!< size of this descriptor in bytes - uint8_t bDescriptorType; //!< INTERFACE descriptor type - uint8_t bFirstInterface; //!< Number of interface - uint8_t bInterfaceCount; //!< value to select alternate setting - uint8_t bFunctionClass; //!< Class code assigned by the USB - uint8_t bFunctionSubClass;//!< Sub-class code assigned by the USB - uint8_t bFunctionProtocol;//!< Protocol code assigned by the USB - uint8_t iFunction; //!< Index of string descriptor -} app_usbd_descriptor_iad_t; - -#pragma pack(pop) -ANON_UNIONS_DISABLE; - -#ifdef __cplusplus -} -#endif - -/** @} */ -#endif /* APP_USBD_DESCRIPTOR_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_langid.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_langid.h deleted file mode 100644 index 14a464d10..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_langid.h +++ /dev/null @@ -1,300 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef APP_USBD_LANGID_H__ -#define APP_USBD_LANGID_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @file - * @brief This file contains LANGID variable type with all defined values. - * - * This file was created using Language Identifiers (LANGIDs) 3/29/00 Version 1.0, - * available on USB web page: - * http://www.usb.org/developers/docs/USB_LANGIDs.pdf - * - * @note - * Do not include this file directly to the project. - * It is included by @file app_usbd_request.h. - */ - -/** - * Offset of the lowest bit of primary language identifier. - * @sa app_usbd_langid_t - */ -#define APP_USB_LANG_OFFSET 0 - -/** - * Bitmask for a primary language identifier. - * @sa app_usbd_langid_t - */ -#define APP_USB_LANG_MASK BF_MASK(10, APP_USB_LANG_OFFSET) - -/** - * Macro for defining language identifier. - * - * @param x Language identifier value. - */ -#define APP_USB_LANG_DEF(x) ((x) << (APP_USB_LANG_OFFSET)) - -/** - * Offset of the lowest bit of sublanguage identifier. - * @sa app_usbd_langid_t - */ -#define APP_USB_SUBLANG_OFFSET 10 - -/** - * Bitmask for a sublanguage identifier. - * @sa app_usbd_langid_t - */ -#define APP_USB_SUBLANG_MASK BF_MASK(6, APP_USB_SUBLANG_OFFSET) - -/** - * Macro for defining language identifier. - * - * @param x Language identifier value. - */ -#define APP_USB_SUBLANG_DEF(x) ((x) << (APP_USB_SUBLANG_OFFSET)) - -/** - * @brief Primary language identifiers. - * - * Mnemonics for primary language identifiers. - * This mnemonics can be combined using the logical OR operator with @ref app_usbd_langid_sub_t. - */ -typedef enum -{ - APP_USBD_LANG_ARABIC = APP_USB_LANG_DEF(0x01U), /**< Arabic */ - APP_USBD_LANG_BULGARIAN = APP_USB_LANG_DEF(0x02U), /**< Bulgarian */ - APP_USBD_LANG_CATALAN = APP_USB_LANG_DEF(0x03U), /**< Catalan */ - APP_USBD_LANG_CHINESE = APP_USB_LANG_DEF(0x04U), /**< Chinese */ - APP_USBD_LANG_CZECH = APP_USB_LANG_DEF(0x05U), /**< Czech */ - APP_USBD_LANG_DANISH = APP_USB_LANG_DEF(0x06U), /**< Danish */ - APP_USBD_LANG_GERMAN = APP_USB_LANG_DEF(0x07U), /**< German */ - APP_USBD_LANG_GREEK = APP_USB_LANG_DEF(0x08U), /**< Greek */ - APP_USBD_LANG_ENGLISH = APP_USB_LANG_DEF(0x09U), /**< English */ - APP_USBD_LANG_SPANISH = APP_USB_LANG_DEF(0x0aU), /**< Spanish */ - APP_USBD_LANG_FINNISH = APP_USB_LANG_DEF(0x0bU), /**< Finnish */ - APP_USBD_LANG_FRENCH = APP_USB_LANG_DEF(0x0cU), /**< French */ - APP_USBD_LANG_HEBREW = APP_USB_LANG_DEF(0x0dU), /**< Hebrew */ - APP_USBD_LANG_HUNGARIAN = APP_USB_LANG_DEF(0x0eU), /**< Hungarian */ - APP_USBD_LANG_ICELANDIC = APP_USB_LANG_DEF(0x0fU), /**< Icelandic */ - APP_USBD_LANG_ITALIAN = APP_USB_LANG_DEF(0x10U), /**< Italian */ - APP_USBD_LANG_JAPANESE = APP_USB_LANG_DEF(0x11U), /**< Japanese */ - APP_USBD_LANG_KOREAN = APP_USB_LANG_DEF(0x12U), /**< Korean */ - APP_USBD_LANG_DUTCH = APP_USB_LANG_DEF(0x13U), /**< Dutch */ - APP_USBD_LANG_NORWEGIAN = APP_USB_LANG_DEF(0x14U), /**< Norwegian */ - APP_USBD_LANG_POLISH = APP_USB_LANG_DEF(0x15U), /**< Polish */ - APP_USBD_LANG_PORTUGUESE = APP_USB_LANG_DEF(0x16U), /**< Portuguese */ - APP_USBD_LANG_ROMANIAN = APP_USB_LANG_DEF(0x18U), /**< Romanian */ - APP_USBD_LANG_RUSSIAN = APP_USB_LANG_DEF(0x19U), /**< Russian */ - APP_USBD_LANG_CROATIAN = APP_USB_LANG_DEF(0x1aU), /**< Croatian */ - APP_USBD_LANG_SERBIAN = APP_USB_LANG_DEF(0x1aU), /**< Serbian */ - APP_USBD_LANG_SLOVAK = APP_USB_LANG_DEF(0x1bU), /**< Slovak */ - APP_USBD_LANG_ALBANIAN = APP_USB_LANG_DEF(0x1cU), /**< Albanian */ - APP_USBD_LANG_SWEDISH = APP_USB_LANG_DEF(0x1dU), /**< Swedish */ - APP_USBD_LANG_THAI = APP_USB_LANG_DEF(0x1eU), /**< Thai */ - APP_USBD_LANG_TURKISH = APP_USB_LANG_DEF(0x1fU), /**< Turkish */ - APP_USBD_LANG_URDU = APP_USB_LANG_DEF(0x20U), /**< Urdu */ - APP_USBD_LANG_INDONESIAN = APP_USB_LANG_DEF(0x21U), /**< Indonesian */ - APP_USBD_LANG_UKRANIAN = APP_USB_LANG_DEF(0x22U), /**< Ukrainian */ - APP_USBD_LANG_BELARUSIAN = APP_USB_LANG_DEF(0x23U), /**< Belarusian */ - APP_USBD_LANG_SLOVENIAN = APP_USB_LANG_DEF(0x24U), /**< Slovenian */ - APP_USBD_LANG_ESTONIAN = APP_USB_LANG_DEF(0x25U), /**< Estonian */ - APP_USBD_LANG_LATVIAN = APP_USB_LANG_DEF(0x26U), /**< Latvian */ - APP_USBD_LANG_LITHUANIAN = APP_USB_LANG_DEF(0x27U), /**< Lithuanian */ - APP_USBD_LANG_FARSI = APP_USB_LANG_DEF(0x29U), /**< Farsi */ - APP_USBD_LANG_VIETNAMESE = APP_USB_LANG_DEF(0x2aU), /**< Vietnamese */ - APP_USBD_LANG_ARMENIAN = APP_USB_LANG_DEF(0x2bU), /**< Armenian */ - APP_USBD_LANG_AZERI = APP_USB_LANG_DEF(0x2cU), /**< Azeri */ - APP_USBD_LANG_BASQUE = APP_USB_LANG_DEF(0x2dU), /**< Basque */ - APP_USBD_LANG_MACEDONIAN = APP_USB_LANG_DEF(0x2fU), /**< Macedonian */ - APP_USBD_LANG_AFRIKAANS = APP_USB_LANG_DEF(0x36U), /**< Afrikaans */ - APP_USBD_LANG_GEORGIAN = APP_USB_LANG_DEF(0x37U), /**< Georgian */ - APP_USBD_LANG_FAEROESE = APP_USB_LANG_DEF(0x38U), /**< Faeroese */ - APP_USBD_LANG_HINDI = APP_USB_LANG_DEF(0x39U), /**< Hindi */ - APP_USBD_LANG_MALAY = APP_USB_LANG_DEF(0x3eU), /**< Malay */ - APP_USBD_LANG_KAZAK = APP_USB_LANG_DEF(0x3fU), /**< Kazak */ - APP_USBD_LANG_SWAHILI = APP_USB_LANG_DEF(0x41U), /**< Swahili */ - APP_USBD_LANG_UZBEK = APP_USB_LANG_DEF(0x43U), /**< Uzbek */ - APP_USBD_LANG_TATAR = APP_USB_LANG_DEF(0x44U), /**< Tatar */ - APP_USBD_LANG_BENGALI = APP_USB_LANG_DEF(0x45U), /**< Bengali */ - APP_USBD_LANG_PUNJABI = APP_USB_LANG_DEF(0x46U), /**< Punjabi */ - APP_USBD_LANG_GUJARATI = APP_USB_LANG_DEF(0x47U), /**< Gujarati */ - APP_USBD_LANG_ORIYA = APP_USB_LANG_DEF(0x48U), /**< Oriya */ - APP_USBD_LANG_TAMIL = APP_USB_LANG_DEF(0x49U), /**< Tamil */ - APP_USBD_LANG_TELUGU = APP_USB_LANG_DEF(0x4aU), /**< Telugu */ - APP_USBD_LANG_KANNADA = APP_USB_LANG_DEF(0x4bU), /**< Kannada */ - APP_USBD_LANG_MALAYALAM = APP_USB_LANG_DEF(0x4cU), /**< Malayalam */ - APP_USBD_LANG_ASSAMESE = APP_USB_LANG_DEF(0x4dU), /**< Assamese */ - APP_USBD_LANG_MARATHI = APP_USB_LANG_DEF(0x4eU), /**< Marathi */ - APP_USBD_LANG_SANSKRIT = APP_USB_LANG_DEF(0x4fU), /**< Sanskrit */ - APP_USBD_LANG_KONKANI = APP_USB_LANG_DEF(0x57U), /**< Konkani */ - APP_USBD_LANG_MANIPURI = APP_USB_LANG_DEF(0x58U), /**< Manipuri */ - APP_USBD_LANG_SINDHI = APP_USB_LANG_DEF(0x59U), /**< Sindhi */ - APP_USBD_LANG_KASHMIRI = APP_USB_LANG_DEF(0x60U), /**< Kashmiri */ - APP_USBD_LANG_NEPALI = APP_USB_LANG_DEF(0x61U), /**< Nepali */ - APP_USBD_LANG_HID = APP_USB_LANG_DEF(0xffU), /**< Reserved for USB HID Class use. */ -} app_usbd_langid_primary_t; - -/** - * @brief Sublanguage identifiers. - * - * Mnemonics with sublanguage values. - * Use them in combination with @ref app_usbd_langid_primary_t. - */ -typedef enum -{ - APP_USBD_SUBLANG_ARABIC_SAUDI_ARABIA = APP_USB_SUBLANG_DEF(0x01U), /**< Arabic (Saudi Arabia) */ - APP_USBD_SUBLANG_ARABIC_IRAQ = APP_USB_SUBLANG_DEF(0x02U), /**< Arabic (Iraq) */ - APP_USBD_SUBLANG_ARABIC_EGYPT = APP_USB_SUBLANG_DEF(0x03U), /**< Arabic (Egypt) */ - APP_USBD_SUBLANG_ARABIC_LIBYA = APP_USB_SUBLANG_DEF(0x04U), /**< Arabic (Libya) */ - APP_USBD_SUBLANG_ARABIC_ALGERIA = APP_USB_SUBLANG_DEF(0x05U), /**< Arabic (Algeria) */ - APP_USBD_SUBLANG_ARABIC_MOROCCO = APP_USB_SUBLANG_DEF(0x06U), /**< Arabic (Morocco) */ - APP_USBD_SUBLANG_ARABIC_TUNISIA = APP_USB_SUBLANG_DEF(0x07U), /**< Arabic (Tunisia) */ - APP_USBD_SUBLANG_ARABIC_OMAN = APP_USB_SUBLANG_DEF(0x08U), /**< Arabic (Oman) */ - APP_USBD_SUBLANG_ARABIC_YEMEN = APP_USB_SUBLANG_DEF(0x09U), /**< Arabic (Yemen) */ - APP_USBD_SUBLANG_ARABIC_SYRIA = APP_USB_SUBLANG_DEF(0x10U), /**< Arabic (Syria) */ - APP_USBD_SUBLANG_ARABIC_JORDAN = APP_USB_SUBLANG_DEF(0x11U), /**< Arabic (Jordan) */ - APP_USBD_SUBLANG_ARABIC_LEBANON = APP_USB_SUBLANG_DEF(0x12U), /**< Arabic (Lebanon) */ - APP_USBD_SUBLANG_ARABIC_KUWAIT = APP_USB_SUBLANG_DEF(0x13U), /**< Arabic (Kuwait) */ - APP_USBD_SUBLANG_ARABIC_UAE = APP_USB_SUBLANG_DEF(0x14U), /**< Arabic (U.A.E.) */ - APP_USBD_SUBLANG_ARABIC_BAHRAIN = APP_USB_SUBLANG_DEF(0x15U), /**< Arabic (Bahrain) */ - APP_USBD_SUBLANG_ARABIC_QATAR = APP_USB_SUBLANG_DEF(0x16U), /**< Arabic (Qatar) */ - APP_USBD_SUBLANG_AZERI_CYRILLIC = APP_USB_SUBLANG_DEF(0x01U), /**< Azeri (Cyrillic) */ - APP_USBD_SUBLANG_AZERI_LATIN = APP_USB_SUBLANG_DEF(0x02U), /**< Azeri (Latin) */ - APP_USBD_SUBLANG_CHINESE_TRADITIONAL = APP_USB_SUBLANG_DEF(0x01U), /**< Chinese (Traditional) */ - APP_USBD_SUBLANG_CHINESE_SIMPLIFIED = APP_USB_SUBLANG_DEF(0x02U), /**< Chinese (Simplified) */ - APP_USBD_SUBLANG_CHINESE_HONGKONG = APP_USB_SUBLANG_DEF(0x03U), /**< Chinese (Hong Kong SAR, PRC) */ - APP_USBD_SUBLANG_CHINESE_SINGAPORE = APP_USB_SUBLANG_DEF(0x04U), /**< Chinese (Singapore) */ - APP_USBD_SUBLANG_CHINESE_MACAU = APP_USB_SUBLANG_DEF(0x05U), /**< Chinese (Macau SAR) */ - APP_USBD_SUBLANG_DUTCH = APP_USB_SUBLANG_DEF(0x01U), /**< Dutch */ - APP_USBD_SUBLANG_DUTCH_BELGIAN = APP_USB_SUBLANG_DEF(0x02U), /**< Dutch (Belgian) */ - APP_USBD_SUBLANG_ENGLISH_US = APP_USB_SUBLANG_DEF(0x01U), /**< English (US) */ - APP_USBD_SUBLANG_ENGLISH_UK = APP_USB_SUBLANG_DEF(0x02U), /**< English (UK) */ - APP_USBD_SUBLANG_ENGLISH_AUS = APP_USB_SUBLANG_DEF(0x03U), /**< English (Australian) */ - APP_USBD_SUBLANG_ENGLISH_CAN = APP_USB_SUBLANG_DEF(0x04U), /**< English (Canadian) */ - APP_USBD_SUBLANG_ENGLISH_NZ = APP_USB_SUBLANG_DEF(0x05U), /**< English (New Zealand) */ - APP_USBD_SUBLANG_ENGLISH_EIRE = APP_USB_SUBLANG_DEF(0x06U), /**< English (Ireland) */ - APP_USBD_SUBLANG_ENGLISH_SOUTH_AFRICA = APP_USB_SUBLANG_DEF(0x07U), /**< English (South Africa) */ - APP_USBD_SUBLANG_ENGLISH_JAMAICA = APP_USB_SUBLANG_DEF(0x08U), /**< English (Jamaica) */ - APP_USBD_SUBLANG_ENGLISH_CARIBBEAN = APP_USB_SUBLANG_DEF(0x09U), /**< English (Caribbean) */ - APP_USBD_SUBLANG_ENGLISH_BELIZE = APP_USB_SUBLANG_DEF(0x0aU), /**< English (Belize) */ - APP_USBD_SUBLANG_ENGLISH_TRINIDAD = APP_USB_SUBLANG_DEF(0x0bU), /**< English (Trinidad) */ - APP_USBD_SUBLANG_ENGLISH_PHILIPPINES = APP_USB_SUBLANG_DEF(0x0cU), /**< English (Zimbabwe) */ - APP_USBD_SUBLANG_ENGLISH_ZIMBABWE = APP_USB_SUBLANG_DEF(0x0dU), /**< English (Philippines) */ - APP_USBD_SUBLANG_FRENCH = APP_USB_SUBLANG_DEF(0x01U), /**< French */ - APP_USBD_SUBLANG_FRENCH_BELGIAN = APP_USB_SUBLANG_DEF(0x02U), /**< French (Belgian) */ - APP_USBD_SUBLANG_FRENCH_CANADIAN = APP_USB_SUBLANG_DEF(0x03U), /**< French (Canadian) */ - APP_USBD_SUBLANG_FRENCH_SWISS = APP_USB_SUBLANG_DEF(0x04U), /**< French (Switzerland) */ - APP_USBD_SUBLANG_FRENCH_LUXEMBOURG = APP_USB_SUBLANG_DEF(0x05U), /**< French (Luxembourg) */ - APP_USBD_SUBLANG_FRENCH_MONACO = APP_USB_SUBLANG_DEF(0x06U), /**< French (Monaco) */ - APP_USBD_SUBLANG_GERMAN = APP_USB_SUBLANG_DEF(0x01U), /**< German */ - APP_USBD_SUBLANG_GERMAN_SWISS = APP_USB_SUBLANG_DEF(0x02U), /**< German (Switzerland) */ - APP_USBD_SUBLANG_GERMAN_AUSTRIAN = APP_USB_SUBLANG_DEF(0x03U), /**< German (Austria) */ - APP_USBD_SUBLANG_GERMAN_LUXEMBOURG = APP_USB_SUBLANG_DEF(0x04U), /**< German (Luxembourg) */ - APP_USBD_SUBLANG_GERMAN_LIECHTENSTEIN = APP_USB_SUBLANG_DEF(0x05U), /**< German (Liechtenstein) */ - APP_USBD_SUBLANG_ITALIAN = APP_USB_SUBLANG_DEF(0x01U), /**< Italian */ - APP_USBD_SUBLANG_ITALIAN_SWISS = APP_USB_SUBLANG_DEF(0x02U), /**< Italian (Switzerland) */ - APP_USBD_SUBLANG_KASHMIRI_INDIA = APP_USB_SUBLANG_DEF(0x02U), /**< Kashmiri (India) */ - APP_USBD_SUBLANG_KOREAN = APP_USB_SUBLANG_DEF(0x01U), /**< Korean */ - APP_USBD_SUBLANG_LITHUANIAN = APP_USB_SUBLANG_DEF(0x01U), /**< Lithuanian */ - APP_USBD_SUBLANG_MALAY_MALAYSIA = APP_USB_SUBLANG_DEF(0x01U), /**< Malay (Malaysia) */ - APP_USBD_SUBLANG_MALAY_BRUNEI_DARUSSALAM = APP_USB_SUBLANG_DEF(0x02U), /**< Malay (Brunei Darassalam) */ - APP_USBD_SUBLANG_NEPALI_INDIA = APP_USB_SUBLANG_DEF(0x02U), /**< Nepali (India) */ - APP_USBD_SUBLANG_NORWEGIAN_BOKMAL = APP_USB_SUBLANG_DEF(0x01U), /**< Norwegian (Bokmal) */ - APP_USBD_SUBLANG_NORWEGIAN_NYNORSK = APP_USB_SUBLANG_DEF(0x02U), /**< Norwegian (Nynorsk) */ - APP_USBD_SUBLANG_PORTUGUESE = APP_USB_SUBLANG_DEF(0x01U), /**< Portuguese */ - APP_USBD_SUBLANG_PORTUGUESE_BRAZILIAN = APP_USB_SUBLANG_DEF(0x02U), /**< Portuguese (Brazil) */ - APP_USBD_SUBLANG_SERBIAN_LATIN = APP_USB_SUBLANG_DEF(0x02U), /**< Serbian (Latin) */ - APP_USBD_SUBLANG_SERBIAN_CYRILLIC = APP_USB_SUBLANG_DEF(0x03U), /**< Serbian (Cyrillic) */ - APP_USBD_SUBLANG_SPANISH = APP_USB_SUBLANG_DEF(0x01U), /**< Spanish (Traditional) */ - APP_USBD_SUBLANG_SPANISH_MEXICAN = APP_USB_SUBLANG_DEF(0x02U), /**< Spanish (Mexican) */ - APP_USBD_SUBLANG_SPANISH_MODERN = APP_USB_SUBLANG_DEF(0x03U), /**< Spanish (Modern) */ - APP_USBD_SUBLANG_SPANISH_GUATEMALA = APP_USB_SUBLANG_DEF(0x04U), /**< Spanish (Guatemala) */ - APP_USBD_SUBLANG_SPANISH_COSTA_RICA = APP_USB_SUBLANG_DEF(0x05U), /**< Spanish (Costa Rica) */ - APP_USBD_SUBLANG_SPANISH_PANAMA = APP_USB_SUBLANG_DEF(0x06U), /**< Spanish (Panama) */ - APP_USBD_SUBLANG_SPANISH_DOMINICAN_REPUBLIC = APP_USB_SUBLANG_DEF(0x07U), /**< Spanish (Dominican Republic) */ - APP_USBD_SUBLANG_SPANISH_VENEZUELA = APP_USB_SUBLANG_DEF(0x08U), /**< Spanish (Venezuela) */ - APP_USBD_SUBLANG_SPANISH_COLOMBIA = APP_USB_SUBLANG_DEF(0x09U), /**< Spanish (Colombia) */ - APP_USBD_SUBLANG_SPANISH_PERU = APP_USB_SUBLANG_DEF(0x0aU), /**< Spanish (Peru) */ - APP_USBD_SUBLANG_SPANISH_ARGENTINA = APP_USB_SUBLANG_DEF(0x0bU), /**< Spanish (Argentina) */ - APP_USBD_SUBLANG_SPANISH_ECUADOR = APP_USB_SUBLANG_DEF(0x0cU), /**< Spanish (Ecuador) */ - APP_USBD_SUBLANG_SPANISH_CHILE = APP_USB_SUBLANG_DEF(0x0dU), /**< Spanish (Chile) */ - APP_USBD_SUBLANG_SPANISH_URUGUAY = APP_USB_SUBLANG_DEF(0x0eU), /**< Spanish (Uruguay) */ - APP_USBD_SUBLANG_SPANISH_PARAGUAY = APP_USB_SUBLANG_DEF(0x0fU), /**< Spanish (Paraguay) */ - APP_USBD_SUBLANG_SPANISH_BOLIVIA = APP_USB_SUBLANG_DEF(0x10U), /**< Spanish (Bolivia) */ - APP_USBD_SUBLANG_SPANISH_EL_SALVADOR = APP_USB_SUBLANG_DEF(0x11U), /**< Spanish (El Salvador) */ - APP_USBD_SUBLANG_SPANISH_HONDURAS = APP_USB_SUBLANG_DEF(0x12U), /**< Spanish (Honduras) */ - APP_USBD_SUBLANG_SPANISH_NICARAGUA = APP_USB_SUBLANG_DEF(0x13U), /**< Spanish (Nicaragua) */ - APP_USBD_SUBLANG_SPANISH_PUERTO_RICO = APP_USB_SUBLANG_DEF(0x14U), /**< Spanish (Puerto Rico) */ - APP_USBD_SUBLANG_SWEDISH = APP_USB_SUBLANG_DEF(0x01U), /**< Swedish */ - APP_USBD_SUBLANG_SWEDISH_FINLAND = APP_USB_SUBLANG_DEF(0x02U), /**< Swedish (Finland) */ - APP_USBD_SUBLANG_URDU_PAKISTAN = APP_USB_SUBLANG_DEF(0x01U), /**< Urdu (Pakistan) */ - APP_USBD_SUBLANG_URDU_INDIA = APP_USB_SUBLANG_DEF(0x02U), /**< Urdu (India) */ - APP_USBD_SUBLANG_UZBEK_LATIN = APP_USB_SUBLANG_DEF(0x01U), /**< Uzbek (Latin) */ - APP_USBD_SUBLANG_UZBEK_CYRILLIC = APP_USB_SUBLANG_DEF(0x02U), /**< Uzbek (Cyrillic) */ - APP_USBD_SUBLANG_HID_USAGE_DATA_DESCRIPTOR = APP_USB_SUBLANG_DEF(0x01U), /**< HID (Usage Data Descriptor) */ - APP_USBD_SUBLANG_HID_VENDOR_DEFINED_1 = APP_USB_SUBLANG_DEF(0x3cU), /**< HID (Vendor Defined 1) */ - APP_USBD_SUBLANG_HID_VENDOR_DEFINED_2 = APP_USB_SUBLANG_DEF(0x3dU), /**< HID (Vendor Defined 2) */ - APP_USBD_SUBLANG_HID_VENDOR_DEFINED_3 = APP_USB_SUBLANG_DEF(0x3eU), /**< HID (Vendor Defined 3) */ - APP_USBD_SUBLANG_HID_VENDOR_DEFINED_4 = APP_USB_SUBLANG_DEF(0x3fU), /**< HID (Vendor Defined 4) */ -} app_usbd_langid_sub_t; - -/** - * @brief LANGID variable. - * - * The LANGID value is composed of: - * - 10 bits (9-0) of Primary Language Identifier, - * - 6 bits (15-10) of Sublanguage Identifier. - * - * @sa app_usbd_langid_primary_t - * @sa app_usbd_langid_sub_t - */ -typedef uint16_t app_usbd_langid_t; - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_LANGID_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger.c b/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger.c deleted file mode 100755 index 1f5c36f15..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger.c +++ /dev/null @@ -1,374 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include "sdk_common.h" -#if NRF_MODULE_ENABLED(APP_USBD_NRF_DFU_TRIGGER) - -#include -#include -#include "app_usbd.h" -#include "app_usbd_nrf_dfu_trigger.h" -#include "app_usbd_string_desc.h" -#include "nrf_gpio.h" - -/** - * @defgroup app_usbd_nrf_dfu_trigger_internal USBD Nordic DFU Trigger internals - * @{ - * @ingroup app_usbd_nrf_dfu_trigger - * @internal - */ - -#define NRF_LOG_MODULE_NAME usbd_nrf_dfu_trigger - -#if APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED -#define NRF_LOG_LEVEL APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL -#define NRF_LOG_INFO_COLOR APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR -#define NRF_LOG_DEBUG_COLOR APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR -#else //APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED -#define NRF_LOG_LEVEL 0 -#endif //APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED -#include "nrf_log.h" -NRF_LOG_MODULE_REGISTER(); - -/** - * @brief Auxiliary function to access DFU Trigger instance data. - * - * @param[in] p_inst Class instance data. - * - * @return DFU Trigger instance data @ref app_usbd_nrf_dfu_trigger_t - */ -static inline app_usbd_nrf_dfu_trigger_t const * nrf_dfu_trigger_get(app_usbd_class_inst_t const * p_inst) -{ - ASSERT(p_inst != NULL); - return (app_usbd_nrf_dfu_trigger_t const *)p_inst; -} - -/** - * @brief Auxiliary function to access DFU Trigger context data. - * - * @param[in] p_dfu DFU Trigger instance data. - * - * @return DFU Trigger context data @ref app_usbd_nrf_dfu_trigger_ctx_t - */ -static inline app_usbd_nrf_dfu_trigger_ctx_t * nrf_dfu_trigger_ctx_get( - app_usbd_nrf_dfu_trigger_t const * p_dfu) -{ - ASSERT(p_dfu != NULL); - ASSERT(p_dfu->specific.p_data != NULL); - return &p_dfu->specific.p_data->ctx; -} - -/** - * @brief Internal SETUP standard IN request handler. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - * @retval NRF_SUCCESS if request handled correctly. - * @retval NRF_ERROR_NOT_SUPPORTED if request is not supported. - */ -static ret_code_t setup_req_std_in(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - /* Only Get Descriptor standard IN request is supported by DFU class */ - if ((app_usbd_setup_req_rec(p_setup_ev->setup.bmRequestType) == APP_USBD_SETUP_REQREC_INTERFACE) - && - (p_setup_ev->setup.bRequest == APP_USBD_SETUP_STDREQ_GET_DESCRIPTOR)) - { - size_t dsc_len = 0; - size_t max_size; - - uint8_t * p_trans_buff = app_usbd_core_setup_transfer_buff_get(&max_size); - /* Try to find descriptor in class internals*/ - ret_code_t ret = app_usbd_class_descriptor_find(p_inst, - p_setup_ev->setup.wValue.hb, - p_setup_ev->setup.wValue.lb, - p_trans_buff, - &dsc_len); - if (ret != NRF_ERROR_NOT_FOUND) - { - ASSERT(dsc_len < NRF_DRV_USBD_EPSIZE); - return app_usbd_core_setup_rsp(&(p_setup_ev->setup), p_trans_buff, dsc_len); - } - } - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief Internal SETUP standard OUT request handler. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - * @retval NRF_SUCCESS if request handled correctly. - * @retval NRF_ERROR_NOT_SUPPORTED if request is not supported. - * @retval NRF_ERROR_FORBIDDEN if endpoint stall cannot be cleared because of internal state. - */ -static ret_code_t setup_req_std_out(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - - switch (p_setup_ev->setup.bRequest) - { - default: - break; - } - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief User event handler. - * - * @param[in] p_inst Class instance. - * @param[in] event user Event type. - */ -static inline void user_event_handler(app_usbd_class_inst_t const * p_inst, - app_usbd_nrf_dfu_trigger_user_event_t event) -{ - app_usbd_nrf_dfu_trigger_t const * p_dfu = nrf_dfu_trigger_get(p_inst); - if (p_dfu->specific.inst.user_ev_handler != NULL) - { - p_dfu->specific.inst.user_ev_handler(p_inst, event); - } -} - -/** - * @brief Internal SETUP class IN request handler. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - * @retval NRF_SUCCESS if request handled correctly. - * @retval NRF_ERROR_NOT_SUPPORTED if request is not supported. - */ -static ret_code_t setup_req_class_in(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - app_usbd_nrf_dfu_trigger_t const * p_dfu = nrf_dfu_trigger_get(p_inst); - - switch (p_setup_ev->setup.bRequest) - { - case APP_USBD_NRF_DFU_TRIGGER_REQ_NORDIC_INFO: - if (p_setup_ev->setup.wLength.w != sizeof(app_usbd_nrf_dfu_trigger_nordic_info_t)) - { - return NRF_ERROR_NOT_SUPPORTED; - } - return app_usbd_core_setup_rsp(&p_setup_ev->setup, - p_dfu->specific.inst.p_dfu_info, - sizeof(app_usbd_nrf_dfu_trigger_nordic_info_t)); - - case APP_USBD_NRF_DFU_TRIGGER_REQ_SEM_VER: - return app_usbd_core_setup_rsp(&p_setup_ev->setup, - p_dfu->specific.inst.p_sem_ver, - p_dfu->specific.inst.sem_ver_size); - - default: - break; - } - - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief Internal SETUP class OUT request handler. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - * @retval NRF_SUCCESS if request handled correctly. - * @retval NRF_ERROR_NOT_SUPPORTED if request is not supported. - */ -static ret_code_t setup_req_class_out(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - app_usbd_nrf_dfu_trigger_t const * p_dfu = nrf_dfu_trigger_get(p_inst); - app_usbd_nrf_dfu_trigger_ctx_t * p_dfu_ctx = nrf_dfu_trigger_ctx_get(p_dfu); - - switch (p_setup_ev->setup.bRequest) - { - case APP_USBD_NRF_DFU_TRIGGER_REQ_DETACH: - { - NRF_LOG_DEBUG("Entering DFU Mode"); - p_dfu_ctx->state = APP_USBD_NRF_DFU_TRIGGER_STATE_DETACH; - user_event_handler(p_inst, APP_USBD_NRF_DFU_TRIGGER_USER_EVT_DETACH); - return NRF_SUCCESS; - } - default: - break; - } - - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief Control endpoint handle. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - * @retval NRF_SUCCESS if request handled correctly. - * @retval NRF_ERROR_NOT_SUPPORTED if request is not supported. - */ -static ret_code_t setup_event_handler(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - ASSERT(p_inst != NULL); - ASSERT(p_setup_ev != NULL); - - if (app_usbd_setup_req_dir(p_setup_ev->setup.bmRequestType) == APP_USBD_SETUP_REQDIR_IN) - { - switch (app_usbd_setup_req_typ(p_setup_ev->setup.bmRequestType)) - { - case APP_USBD_SETUP_REQTYPE_STD: - return setup_req_std_in(p_inst, p_setup_ev); - case APP_USBD_SETUP_REQTYPE_CLASS: - return setup_req_class_in(p_inst, p_setup_ev); - default: - break; - } - } - else /* APP_USBD_SETUP_REQDIR_OUT */ - { - switch (app_usbd_setup_req_typ(p_setup_ev->setup.bmRequestType)) - { - case APP_USBD_SETUP_REQTYPE_STD: - return setup_req_std_out(p_inst, p_setup_ev); - case APP_USBD_SETUP_REQTYPE_CLASS: - return setup_req_class_out(p_inst, p_setup_ev); - default: - break; - } - } - - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief @ref app_usbd_class_methods_t::event_handler - */ -static ret_code_t nrf_dfu_trigger_event_handler(app_usbd_class_inst_t const * p_inst, - app_usbd_complex_evt_t const * p_event) -{ - ASSERT(p_inst != NULL); - ASSERT(p_event != NULL); - - ret_code_t ret = NRF_SUCCESS; - switch (p_event->app_evt.type) - { - case APP_USBD_EVT_DRV_SOF: - break; - case APP_USBD_EVT_DRV_RESET: - break; - case APP_USBD_EVT_DRV_SETUP: - ret = setup_event_handler(p_inst, (app_usbd_setup_evt_t const *) p_event); - break; - case APP_USBD_EVT_DRV_EPTRANSFER: - break; - case APP_USBD_EVT_DRV_SUSPEND: - break; - case APP_USBD_EVT_DRV_RESUME: - break; - case APP_USBD_EVT_INST_APPEND: - break; - case APP_USBD_EVT_INST_REMOVE: - break; - case APP_USBD_EVT_STARTED: - break; - case APP_USBD_EVT_STOPPED: - break; - default: - ret = NRF_ERROR_NOT_SUPPORTED; - break; - } - - return ret; -} - -/** - * @brief @ref app_usbd_class_methods_t::feed_descriptors - */ -static bool nrf_dfu_trigger_feed_descriptors(app_usbd_class_descriptor_ctx_t * p_ctx, - app_usbd_class_inst_t const * p_inst, - uint8_t * p_buff, - size_t max_size) -{ - static app_usbd_class_iface_conf_t const * p_cur_iface = NULL; - p_cur_iface = app_usbd_class_iface_get(p_inst, 0); - app_usbd_nrf_dfu_trigger_t const * p_dfu = nrf_dfu_trigger_get(p_inst); - - APP_USBD_CLASS_DESCRIPTOR_BEGIN(p_ctx, p_buff, max_size) - - /* INTERFACE DESCRIPTOR */ - APP_USBD_CLASS_DESCRIPTOR_WRITE(sizeof(app_usbd_descriptor_iface_t)); // bLength - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_DESCRIPTOR_INTERFACE); // bDescriptorType - APP_USBD_CLASS_DESCRIPTOR_WRITE(app_usbd_class_iface_number_get(p_cur_iface)); // bInterfaceNumber - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x00); // bAlternateSetting - APP_USBD_CLASS_DESCRIPTOR_WRITE(0); // bNumEndpoints - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_NRF_DFU_TRIGGER_CLASS); // bInterfaceClass - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_NRF_DFU_TRIGGER_SUBCLASS); // bInterfaceSubClass - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_NRF_DFU_TRIGGER_PROTOCOL_RUNTIME); // bInterfaceProtocol - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x00); // iInterface - - /* FUNCTIONAL DESCRIPTOR */ - APP_USBD_CLASS_DESCRIPTOR_WRITE(sizeof(app_usbd_nrf_dfu_trigger_desc_func_t)); // bFunctionLength - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_NRF_DFU_TRIGGER_CS_FUNCTIONAL); // bDescriptorType - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_NRF_DFU_TRIGGER_BIT_CAN_DNLOAD | - APP_USBD_NRF_DFU_TRIGGER_BIT_WILL_DETACH); // bmAttribute - APP_USBD_CLASS_DESCRIPTOR_WRITE(LSB_16(p_dfu->specific.inst.detach_timeout)); // wDetachTimeOut LSB - APP_USBD_CLASS_DESCRIPTOR_WRITE(MSB_16(p_dfu->specific.inst.detach_timeout)); // wDetachTimeOut MSB - APP_USBD_CLASS_DESCRIPTOR_WRITE(LSB_16(p_dfu->specific.inst.transfer_size)); // wTransferSize LSB - APP_USBD_CLASS_DESCRIPTOR_WRITE(MSB_16(p_dfu->specific.inst.transfer_size)); // wTransferSize MSB - APP_USBD_CLASS_DESCRIPTOR_WRITE(LSB_16(p_dfu->specific.inst.bcd_dfu)); // bcdDFUVersion LSB - APP_USBD_CLASS_DESCRIPTOR_WRITE(MSB_16(p_dfu->specific.inst.bcd_dfu)); // bcdDFUVersion MSB - - APP_USBD_CLASS_DESCRIPTOR_END(); -} - -const app_usbd_class_methods_t app_usbd_nrf_dfu_trigger_class_methods = { - .event_handler = nrf_dfu_trigger_event_handler, - .feed_descriptors = nrf_dfu_trigger_feed_descriptors, -}; - - -#endif //NRF_MODULE_ENABLED(APP_USBD_NRF_DFU_TRIGGER) diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger.h deleted file mode 100644 index 63452516e..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger.h +++ /dev/null @@ -1,166 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef APP_USBD_NRF_DFU_TRIGGER_H__ -#define APP_USBD_NRF_DFU_TRIGGER_H__ - -#include -#include - -#include "nrf_drv_usbd.h" -#include "nrf_block_dev.h" -#include "app_usbd_class_base.h" -#include "app_usbd.h" -#include "app_usbd_core.h" -#include "app_usbd_descriptor.h" - -#include "app_usbd_nrf_dfu_trigger_types.h" -#include "app_usbd_nrf_dfu_trigger_internal.h" - - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup app_usbd_nrf_dfu_trigger USB Nordic DFU Trigger class - * @ingroup app_usbd - * - * @brief @tagAPI52840 Module with types, definitions, - * and API used by the USB Nordic DFU Trigger class. - * - * @{ - */ - -#ifdef DOXYGEN -/** - * @brief Nordic DFU Trigger class instance type. - * - * @ref APP_USBD_CLASS_TYPEDEF - */ -typedef struct { } app_usbd_nrf_dfu_trigger_t; -#else -/*lint -save -e10 -e26 -e123 -e505 */ -APP_USBD_CLASS_NO_EP_TYPEDEF(app_usbd_nrf_dfu_trigger, \ - APP_USBD_NRF_DFU_TRIGGER_CONFIG(0), \ - APP_USBD_NRF_DFU_TRIGGER_INSTANCE_SPECIFIC_DEC, \ - APP_USBD_NRF_DFU_TRIGGER_DATA_SPECIFIC_DEC \ -); -#endif - -/*lint -restore*/ - - -/*lint -save -e407 */ - -/** - * @brief Events passed to user event handler. - * - * @note Example prototype of user event handler: - * - * void dfu_user_ev_handler(app_usbd_class_inst_t const * p_inst, - * app_usbd_nrf_dfu_trigger_user_event_t event); - */ -typedef enum app_usbd_nrf_dfu_trigger_user_event_e { - APP_USBD_NRF_DFU_TRIGGER_USER_EVT_DETACH, -} app_usbd_nrf_dfu_trigger_user_event_t; - -/*lint -restore*/ - -/** - * @brief Global definition of app_usbd_nrf_dfu_trigger_t class. - * - * @param instance_name Name of global instance. - * @param interface_number Unique interface number. - * @param p_nordic_dfu Pointer to @ref app_usbd_nrf_dfu_trigger_nordic_info_t structure. - * @param sem_ver_str Semantic version string. - * @param user_ev_handler User event handler (optional). - * - * @note This macro is just simplified version of @ref APP_USBD_NRF_DFU_TRIGGER_GLOBAL_DEF_INTERNAL - * - */ -/*lint -save -emacro(26 64 123 505 651, APP_USBD_NRF_DFU_TRIGGER_GLOBAL_DEF)*/ -#define APP_USBD_NRF_DFU_TRIGGER_GLOBAL_DEF(instance_name, \ - interface_number, \ - p_nordic_dfu, \ - sem_ver_str, \ - user_ev_handler) \ - APP_USBD_NRF_DFU_TRIGGER_GLOBAL_DEF_INTERNAL(instance_name, \ - interface_number, \ - 0, \ - 0, \ - p_nordic_dfu, \ - sem_ver_str, \ - user_ev_handler) -/*lint -restore*/ - -/** - * @brief Helper function to get class instance from Nordic DFU Trigger. - * - * @param[in] p_dfu Nordic DFU Trigger instance - * (declared by @ref APP_USBD_NRF_DFU_TRIGGER_GLOBAL_DEF) - * - * @return Base class instance - */ -static inline app_usbd_class_inst_t const * -app_usbd_nrf_dfu_trigger_class_inst_get(app_usbd_nrf_dfu_trigger_t const * p_dfu) -{ - return &p_dfu->base; -} - -/** - * @brief Helper function to get DFU from base class instance. - * - * @param[in] p_inst Base class instance. - * - * @return DFU class handle. - */ -static inline app_usbd_nrf_dfu_trigger_t const * -app_usbd_nrf_dfu_trigger_class_get( app_usbd_class_inst_t const * p_inst) -{ - return (app_usbd_nrf_dfu_trigger_t const *)p_inst; -} - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_NRF_DFU_TRIGGER_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger_internal.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger_internal.h deleted file mode 100644 index 551d88054..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger_internal.h +++ /dev/null @@ -1,203 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef APP_USBD_NRF_DFU_TRIGGER_INTERNAL_H__ -#define APP_USBD_NRF_DFU_TRIGGER_INTERNAL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup app_usbd_nrf_dfu_trigger_internals USB Nordic DFU Trigger internals - * @ingroup app_usbd_nrf_dfu_trigger - * - * @brief @tagAPI52840 Internals of the USB Nordic DFU Trigger class. - * @{ - */ - -/** - * @brief Forward declaration of Nordic DFU Trigger Class type. - * - */ -APP_USBD_CLASS_FORWARD(app_usbd_nrf_dfu_trigger); - -/*lint -save -e165*/ -/** - * @brief Forward declaration of @ref app_usbd_nrf_dfu_trigger_user_event_e - * - */ -enum app_usbd_nrf_dfu_trigger_user_event_e; - -/*lint -restore*/ - -/** - * @brief User event handler. - * - * @param[in] p_inst Class instance. - * @param[in] event User event. - * - * */ -typedef void (*app_usbd_nrf_dfu_trigger_user_ev_handler_t)( - app_usbd_class_inst_t const * p_inst, - enum app_usbd_nrf_dfu_trigger_user_event_e event); - -/** - * @brief Nordic DFU Trigger part of class instance data. - */ -typedef struct { - size_t const sem_ver_size; //!< Semantic string size - uint16_t const detach_timeout; //!< Detach timeout in ms - for compatibility with DFU spec. - uint16_t const transfer_size; //!< Transfer size - for compatibility with DFU spec. - uint16_t const bcd_dfu; //!< DFU spec version. - uint8_t const * p_sem_ver; //!< Pointer to semantic version string - - app_usbd_nrf_dfu_trigger_nordic_info_t const * p_dfu_info; //!< Pointer to Nordic DFU Info - - app_usbd_nrf_dfu_trigger_user_ev_handler_t user_ev_handler; //!< User event handler -} app_usbd_nrf_dfu_trigger_inst_t; - -/** - * @brief Internal module state. - * - * @note For future compatibility with DFU class. - */ -typedef enum { - APP_USBD_NRF_DFU_TRIGGER_STATE_IDLE, /**< Internal module state IDLE */ - APP_USBD_NRF_DFU_TRIGGER_STATE_DETACH, /**< Internal module state DETACH */ -} app_usbd_nrf_dfu_trigger_state_t; - -/** - * @brief Nordic DFU Trigger context. - * - * */ -typedef struct { - app_usbd_nrf_dfu_trigger_state_t state; //!< Internal module state -} app_usbd_nrf_dfu_trigger_ctx_t; - - -/** - * @brief Nordic DFU Trigger configuration macro. - * - * Used by @ref APP_USBD_NRF_DFU_TRIGGER_GLOBAL_DEF - * - * @param iface Interface number. - * */ -#define APP_USBD_NRF_DFU_TRIGGER_CONFIG(iface) (iface) - - -/** - * @brief Specific class constant data for Nordic DFU Trigger. - * - * @ref app_usbd_nrf_dfu_trigger_inst_t - */ -#define APP_USBD_NRF_DFU_TRIGGER_INSTANCE_SPECIFIC_DEC app_usbd_nrf_dfu_trigger_inst_t inst; - - -/** - * @brief Configures Nordic DFU Trigger instance. - * - * @param user_event_handler User event handler. - * @param p_nordic_dfu Pointer to @ref app_usbd_nrf_dfu_trigger_nordic_info_t structure. - * @param sem_ver_str Semantic version string. - * @param timeout Detach timeout in ms - left for compatibility with USB DFU spec. - * @param size Transfer size in bytes - left for compatibility with USB DFU spec. - * @param bcd USB DFU specification version. - */ -#define APP_USBD_NRF_DFU_TRIGGER_INST_CONFIG(user_event_handler, \ - p_nordic_dfu, \ - sem_ver_str, \ - timeout, \ - size, \ - bcd) \ - .inst = { \ - .user_ev_handler = user_event_handler, \ - .p_dfu_info = p_nordic_dfu, \ - .p_sem_ver = sem_ver_str, \ - .sem_ver_size = sizeof(sem_ver_str), \ - .transfer_size = size, \ - .detach_timeout = timeout, \ - .bcd_dfu = bcd, \ - } - -/** - * @brief Specific class data for Nordic DFU Trigger. - * - * @ref app_usbd_nrf_dfu_trigger_ctx_t - * */ -#define APP_USBD_NRF_DFU_TRIGGER_DATA_SPECIFIC_DEC app_usbd_nrf_dfu_trigger_ctx_t ctx; - - -/** - * @brief Public Nordic DFU Trigger class interface. - */ -extern const app_usbd_class_methods_t app_usbd_nrf_dfu_trigger_class_methods; - -/** - * @brief Global definition of Nordic DFU Trigger instance. - */ -#define APP_USBD_NRF_DFU_TRIGGER_GLOBAL_DEF_INTERNAL(instance_name, \ - interface_number, \ - detach_timeout, \ - transfer_size, \ - p_nordic_dfu, \ - sem_ver_str, \ - user_ev_handler) \ - APP_USBD_CLASS_INST_NO_EP_GLOBAL_DEF( \ - instance_name, \ - app_usbd_nrf_dfu_trigger, \ - &app_usbd_nrf_dfu_trigger_class_methods, \ - APP_USBD_NRF_DFU_TRIGGER_CONFIG((interface_number)), \ - (APP_USBD_NRF_DFU_TRIGGER_INST_CONFIG(user_ev_handler, \ - p_nordic_dfu, \ - sem_ver_str, \ - detach_timeout, \ - transfer_size, \ - 0x0110)) \ - ) - - -/** @} */ - - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_NRF_DFU_TRIGGER_INTERNAL_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger_types.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger_types.h deleted file mode 100644 index 77b4b2be7..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_nrf_dfu_trigger_types.h +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef APP_USBD_NRF_DFU_TRIGGER_TYPES_H__ -#define APP_USBD_NRF_DFU_TRIGGER_TYPES_H__ - -#include "app_util.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup app_usbd_nrf_dfu_trigger_types USB Nordic DFU Trigger types - * @ingroup app_usbd_nrf_dfu_trigger - * - * @brief @tagAPI52840 Types used in the USB Nordic DFU Trigger class. - * @{ - */ - -/** @brief Nordic DFU Trigger class definition in interface descriptor. - * - * @ref app_usbd_descriptor_iface_t::bInterfaceClass - * */ -#define APP_USBD_NRF_DFU_TRIGGER_CLASS 0xFF - -/** - * @brief Nordic DFU Trigger subclass possible value. - */ -typedef enum { - APP_USBD_NRF_DFU_TRIGGER_SUBCLASS = 0x01, /**< Device Firmware Upgrade Code */ -} app_usbd_nrf_dfu_trigger_subclass_t; - -/** - * @brief Nordic DFU Trigger protocol possible value. - * - * @note Only Run-time protocol is implemented, as DFU mode is covered by Nordic DFU. - */ -typedef enum { - APP_USBD_NRF_DFU_TRIGGER_PROTOCOL_RUNTIME = 0x01, /**< Run-time Protocol */ -} app_usbd_nrf_dfu_trigger_protocol_t; - -/** - * @brief Nordic DFU Trigger USB requests @ref nrf_drv_usbd_setup_t::bmRequestType - * - * @note Requests are limited only to @ref APP_USBD_NRF_DFU_TRIGGER_PROTOCOL_RUNTIME protocol type. - */ -typedef enum { - APP_USBD_NRF_DFU_TRIGGER_REQ_DETACH = 0x00, /**< Switch to DFU mode */ - APP_USBD_NRF_DFU_TRIGGER_REQ_NORDIC_INFO = 0x07, /**< Request Nordic DFU information */ - APP_USBD_NRF_DFU_TRIGGER_REQ_SEM_VER = 0x08, /**< Request semantic version information */ -} app_usbd_nrf_dfu_trigger_req_t; - -/** - * @brief Nordic DFU Trigger Functional Descriptor types. - */ -typedef enum { - APP_USBD_NRF_DFU_TRIGGER_CS_FUNCTIONAL = 0x21, /**< Functional descriptor type.*/ -} app_usbd_nrf_dfu_trigger_func_type_t; - -/** - * @brief Nordic DFU Trigger functional descriptor bmAttributes bit masks. - * - * @note For future compatibility with DFU class. - */ -typedef enum { - APP_USBD_NRF_DFU_TRIGGER_BIT_CAN_DNLOAD = 0x01, /**< bitCanDnload */ - APP_USBD_NRF_DFU_TRIGGER_BIT_CAB_UPLOAD = 0x02, /**< bitCanUpload */ - APP_USBD_NRF_DFU_TRIGGER_BIT_MANI_TOLERANT = 0x04, /**< bitManifestationTolerant */ - APP_USBD_NRF_DFU_TRIGGER_BIT_WILL_DETACH = 0x08, /**< bitWillDetach */ -} app_usbd_nrf_dfu_trigger_bm_attributes_t; - -#pragma pack(push, 1) - -/** - * @brief Nordic DFU Trigger Functional Descriptor. - */ -typedef struct { - uint8_t bFunctionLength; //!< Size of this descriptor in bytes. - uint8_t bDescriptorType; //!< Descriptor type. - uint8_t bmAttributes; //!< Attributes bits. - uint16_t wDetachTimeOut; //!< Device detach timeout - left for compatibility with USB DFU spec. - uint16_t wTransferSize; //!< Transfer size - left for compatibility with USB DFU spec. - uint16_t bcdDFUVersion; //!< DFU version. -} app_usbd_nrf_dfu_trigger_desc_func_t; - -/** - * @brief Nordic custom DFU information. - */ -typedef struct { - uint32_t wAddress; //!< Firmware start address. - uint32_t wFirmwareSize; //!< Firmware size. - uint16_t wVersionMajor; //!< Firmware version major. - uint16_t wVersionMinor; //!< Firmware version minor. - uint32_t wFirmwareID; //!< Firmware ID. - uint32_t wFlashSize; //!< Flash size. - uint32_t wFlashPageSize; //!< Flash page size. -} app_usbd_nrf_dfu_trigger_nordic_info_t; - -#pragma pack(pop) - - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_NRF_DFU_TRIGGER_TYPES_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_request.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_request.h deleted file mode 100644 index 8ef5494ef..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_request.h +++ /dev/null @@ -1,356 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef APP_USBD_REQUEST_H__ -#define APP_USBD_REQUEST_H__ - -#include "sdk_common.h" -#include "nrf.h" -#include "nrf_drv_usbd.h" -#include "app_usbd_descriptor.h" -#include "app_util_platform.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Compiler support for anonymous unions */ -ANON_UNIONS_ENABLE; - -#pragma pack(push, 1) - -/** - * @defgroup app_usbd_request USB standard requests - * @ingroup app_usbd - * - * @brief @tagAPI52840 Module with types definitions used for standard requests processing. - * @{ - */ - -/** - * @brief Recipient bit-field in request type. - * - * Bits 4...0 - */ -#define APP_USBD_SETUP_REQ_BF_REC BF_CX(5, 0) - -/** - * @brief Type bit-field in request type. - * - * Bits 6...5 - */ -#define APP_USBD_SETUP_REQ_BF_TYP BF_CX(2, 5) - -/** - * @brief Direction bit-field in request type. - * - * Bit 7 - */ -#define APP_USBD_SETUP_REQ_BF_DIR BF_CX(1, 7) - -/** - * @brief Recipient enumerator. - * - * @note It is part of @ref app_usbd_setup_reqtype_t variable type. - */ -typedef enum { - APP_USBD_SETUP_REQREC_DEVICE = 0x0, /**< The whole device is a request target */ - APP_USBD_SETUP_REQREC_INTERFACE = 0x1, /**< Selected interface is a request target */ - APP_USBD_SETUP_REQREC_ENDPOINT = 0x2, /**< Selected endpoint is a request target */ - APP_USBD_SETUP_REQREC_OTHER = 0x3 /**< Other element is a request target */ -} app_usbd_setup_reqrec_t; - -/** - * @brief Request type enumerator. - * - * @note It is part of @ref app_usbd_setup_reqtype_t variable type. - */ -typedef enum { - APP_USBD_SETUP_REQTYPE_STD = 0x0, /**< Standard request */ - APP_USBD_SETUP_REQTYPE_CLASS = 0x1, /**< Class specific request */ - APP_USBD_SETUP_REQTYPE_VENDOR = 0x2 /**< Vendor specific request */ -} app_usbd_setup_reqtype_t; - -/** - * @brief Direction of setup command. - * - * @note It is part of @ref app_usbd_setup_reqtype_t variable type. - */ -typedef enum { - APP_USBD_SETUP_REQDIR_OUT = 0x0, /**< Host to device */ - APP_USBD_SETUP_REQDIR_IN = 0x1, /**< Device to host */ -} app_usbd_setup_reqdir_t; - - -/** - * @brief Standard requests. - * - * Enumerator for standard requests values. - */ -typedef enum { - APP_USBD_SETUP_STDREQ_GET_STATUS = 0x00, /**< - * Targets: Device, Interface, Endpoint - * Expected SETUP frame format: - * - wValue: Zero - * - wIndex: Zero, (lb): Interface or Endpoint - * - wLength: 2 - * - Data:2 bytes of data, depending on targets - * - Device: - * - D15..D2: Reserved (Reset to zero) - * - D1: Remove Wakeup - * - D0: Self Powered - * - Interface: - * - D15..D0: Reserved (Reset to zero) - * - Endpoint: - * - D15..D1: Reserved (Reset to zero) - * - D0: Halt - */ - APP_USBD_SETUP_STDREQ_CLEAR_FEATURE = 0x01, /**< - * Targets: Device, Interface, Endpoint - * Expected SETUP frame format: - * - wValue: Feature selector (@ref app_usbd_setup_stdfeature_t) - * - wIndex: Zero, Interface or Endpoint - * - wLength: 0 - * - Data: None - */ - APP_USBD_SETUP_STDREQ_SET_FEATURE = 0x03, /**< - * Targets: Device, Interface, Endpoint - * Expected SETUP frame format: - * - wValue: Feature selector (@ref app_usbd_setup_stdfeature_t) - * - wIndex: Zero, Interface or Endpoint - * - wLength: 0 - * - Data: None - */ - APP_USBD_SETUP_STDREQ_SET_ADDRESS = 0x05, /**< - * @note This SETUP request is processed in hardware. - * Use it only to mark current USB state. - * - * Targets: Device - * Expected SETUP frame format: - * - wValue: New device address - * - wIndex: 0 - * - wLength: 0 - * - Data: None - */ - APP_USBD_SETUP_STDREQ_GET_DESCRIPTOR = 0x06, /**< - * Targets: Device - * - wValue: (hb): Descriptor Type and (lb): Descriptor Index - * - wIndex: Zero of Language ID - * - wLength: Descriptor Length - * - Data: Descriptor - */ - APP_USBD_SETUP_STDREQ_SET_DESCRIPTOR = 0x07, /**< - * Not supported - Stall when called. - */ - APP_USBD_SETUP_STDREQ_GET_CONFIGURATION = 0x08, /**< - * Target: Device - * Expected SETUP frame format: - * - wValue: 0 - * - wIndex: 0 - * - wLength: 1 - * - Data: Configuration value - */ - APP_USBD_SETUP_STDREQ_SET_CONFIGURATION = 0x09, /**< - * Target: Device - * Expected SETUP frame format: - * - wValue: (lb): Configuration value - * - wIndex: 0 - * - wLength: 0 - * - Data: None - */ - APP_USBD_SETUP_STDREQ_GET_INTERFACE = 0x0A, /**< - * Target: Interface - * Expected SETUP frame format: - * - wValue: 0 - * - wIndex: Interface - * - wLength: 1 - * - Data: Alternate setting - */ - APP_USBD_SETUP_STDREQ_SET_INTERFACE = 0x0B, /**< - * Target: Interface - * Expected SETUP frame format: - * - wValue: Alternate setting - * - wIndex: Interface - * - wLength: 0 - * - Data: None - */ - APP_USBD_SETUP_STDREQ_SYNCH_FRAME = 0x0C /**< - * Target: Endpoint - * Expected SETUP frame format: - * - wValue: 0 - * - wIndex: Endpoint - * - wLength: 2 - * - Data: Frame Number - * - * @note - * This request is used only in connection with isochronous endpoints. - * This is rarely used and probably we would not need to support it. - */ -} app_usbd_setup_stdrequest_t; - -/** - * @brief Standard feature selectors. - * - * Standard features that may be disabled or enabled by - * @ref APP_USBD_SETUP_STDREQ_CLEAR_FEATURE or @ref APP_USBD_SETUP_STDREQ_SET_FEATURE - */ -typedef enum { - APP_USBD_SETUP_STDFEATURE_DEVICE_REMOTE_WAKEUP = 1, /**< - * Remote wakeup feature. - * Target: Device only - */ - APP_USBD_SETUP_STDFEATURE_ENDPOINT_HALT = 0, /**< - * Stall or clear the endpoint. - * Target: Endpoint different than default (0) - */ - APP_USBD_SETUP_STDFEATURE_TEST_MODE = 2 /**< - * Upstream port test mode. - * Power has to be cycled to exit test mode. - * This feature cannot be cleared. - * - * Target: Device only - * - * @note - * It should only be supported by HighSpeed capable devices. - * Not supported in this library. - */ -} app_usbd_setup_stdfeature_t; - - -/** - * @brief Universal way to access 16 bit values and its parts. - */ -typedef union { - uint16_t w; //!< 16 bit access - struct - { - uint8_t lb; //!< Low byte access - uint8_t hb; //!< High byte access - }; -} app_usbd_setup_w_t; - -/** - * @brief Internal redefinition of setup structure. - * - * Redefinition of the structure to simplify changes in the future - * if required - app_usbd API would present setup data using app_usbd_setup_t. - * - * The structure layout is always the same like @ref nrf_drv_usbd_setup_t - */ -typedef struct { - uint8_t bmRequestType; //!< Setup type bitfield - uint8_t bRequest; //!< One of @ref app_usbd_setup_stdrequest_t values or class dependent one. - app_usbd_setup_w_t wValue; //!< byte 2, 3 - app_usbd_setup_w_t wIndex; //!< byte 4, 5 - app_usbd_setup_w_t wLength; //!< byte 6, 7 -} app_usbd_setup_t; - -#pragma pack(pop) - - -/** - * @brief Extract recipient from request type. - * - * @param[in] bmRequestType - * - * @return Extracted recipient field from request type value. - */ -static inline app_usbd_setup_reqrec_t app_usbd_setup_req_rec(uint8_t bmRequestType) -{ - return (app_usbd_setup_reqrec_t)BF_CX_GET(bmRequestType, APP_USBD_SETUP_REQ_BF_REC); -} - -/** - * @brief Extract type from request type. - * - * @param[in] bmRequestType - * - * @return Extracted type field from request type value. - */ -static inline app_usbd_setup_reqtype_t app_usbd_setup_req_typ(uint8_t bmRequestType) -{ - return (app_usbd_setup_reqtype_t)BF_CX_GET(bmRequestType, APP_USBD_SETUP_REQ_BF_TYP); -} - - -/** - * @brief Extract direction from request type. - * - * @param[in] bmRequestType - * - * @return Extracted direction field from request type value. - */ -static inline app_usbd_setup_reqdir_t app_usbd_setup_req_dir(uint8_t bmRequestType) -{ - return (app_usbd_setup_reqdir_t)BF_CX_GET(bmRequestType, APP_USBD_SETUP_REQ_BF_DIR); -} - -/** - * @brief Make request type value. - * - * @param[in] rec Recipient. - * @param[in] typ Request type. - * @param[in] dir Direction. - * - * @return Assembled request type value. - */ -static inline uint8_t app_usbd_setup_req_val(app_usbd_setup_reqrec_t rec, - app_usbd_setup_reqtype_t typ, - app_usbd_setup_reqdir_t dir) -{ - uint32_t bmRequestType = ( - BF_CX_VAL(rec, APP_USBD_SETUP_REQ_BF_REC) | - BF_CX_VAL(typ, APP_USBD_SETUP_REQ_BF_TYP) | - BF_CX_VAL(dir, APP_USBD_SETUP_REQ_BF_DIR) - ); - - ASSERT(bmRequestType < 256U); - return (uint8_t)bmRequestType; -} - - -ANON_UNIONS_DISABLE; -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_REQUEST_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.c b/third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.c deleted file mode 100644 index 1f0b46ad2..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.c +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Copyright (c) 2018 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include "app_usbd_serial_num.h" - -#include -#include -#include -#include -#include "app_usbd.h" - -#define SERIAL_NUMBER_STRING_SIZE (12) - -/**@brief Serial number generated. - * - * Serial number generated by the @ref serial_number_string_create function. - */ -uint8_t g_extern_serial_number[SERIAL_NUMBER_STRING_SIZE + 1]; - - -/**@brief Function for creating the serial number string from a regular C string. - * - * @param[in] p_serial_number_string The serial number string. Must be terminated with \0. - */ -static void string_create(char * p_serial_number_string) -{ - - for (uint32_t i = 0; i < strlen(p_serial_number_string); i++) - { - g_extern_serial_number[i] = (uint8_t)p_serial_number_string[i]; - } -} - - -void app_usbd_serial_num_generate(void) -{ - char serial_number_string[SERIAL_NUMBER_STRING_SIZE + 1]; - const uint16_t serial_num_high_bytes = (uint16_t)NRF_FICR->DEVICEADDR[1] | 0xC000; // The masking makes the address match the Random Static BLE address. - const uint32_t serial_num_low_bytes = NRF_FICR->DEVICEADDR[0]; - - (void)snprintf(serial_number_string, - SERIAL_NUMBER_STRING_SIZE + 1, - "%04"PRIX16"%08"PRIX32, - serial_num_high_bytes, - serial_num_low_bytes); - - string_create(serial_number_string); -} diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.h deleted file mode 100644 index 59124bbff..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_serial_num.h +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright (c) 2018 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef APP_USBD_SERIAL_NUM_H__ -#define APP_USBD_SERIAL_NUM_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup app_usbd_serial_num USBD serial number generator - * @ingroup app_usbd - * - * @brief @tagAPI52840 Generate a standard USB serial number that is unique for each device. - * @{ - */ - -/**@brief Function for generating a default serial number string based on FIRC->DEVICEADDR. - * - * After calling this function, the serial number is ready for the USB driver. - * - * The generated serial number shows up as a 12-hexidecimal-digit string with no delimiters - * (e.g 123456ABCDEF). The byte string is also printed on the PCA10059 dongle. It is also used as - * the default advertising address in the SoftDevice. - */ -void app_usbd_serial_num_generate(void); - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif // APP_USBD_SERIAL_NUM_H__ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.c b/third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.c deleted file mode 100644 index c808e81c4..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.c +++ /dev/null @@ -1,295 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include "sdk_config.h" -#if APP_USBD_ENABLED -#include "app_usbd_string_desc.h" -#include "app_usbd_langid.h" -#include "app_usbd_core.h" -#include "nordic_common.h" -#include "utf.h" - -/** - * @defgroup app_usbd_string_desc - * @ingroup app_usbd - * - * USBD string descriptor management - * @{ - */ - -/** - * @brief Array with language identifiers. - * - * This array is used to search the proper string for the selected language. - */ -static uint16_t const m_langids[] = { APP_USBD_STRINGS_LANGIDS }; - -/** - * @brief Language ID descriptor. - * - * Language. - */ - - -/** - * @brief Mnemonics for the string positions in the array. - * - * The mnemonics for the indexes of the strings inside the string array. - */ -enum { - APP_USBD_STRING_ID_LANGIDS_ARRAY_POS = 0, /**< Supported language identifiers. */ - -#if (APP_USBD_STRING_ID_MANUFACTURER != 0) - APP_USBD_STRING_ID_MANUFACTURER_ARRAY_POS, /**< Manufacturer name. */ -#endif // (APP_USBD_STRING_ID_MANUFACTURER != 0) - -#if (APP_USBD_STRING_ID_PRODUCT != 0) - APP_USBD_STRING_ID_PRODUCT_ARRAY_POS, /**< Product name. */ -#endif // (APP_USBD_STRING_ID_PRODUCT != 0) - -#if (APP_USBD_STRING_ID_SERIAL != 0) - APP_USBD_STRING_ID_SERIAL_ARRAY_POS, /**< Serial number. */ -#endif // (APP_USBD_STRING_ID_SERIAL != 0) - -#if (APP_USBD_STRING_ID_CONFIGURATION != 0) - APP_USBD_STRING_ID_CONFIGURATION_ARRAY_POS, /**< Configuration string. */ -#endif // (APP_USBD_STRING_ID_CONFIGURATION != 0) - -#define X(mnemonic, str_idx, ...) CONCAT_2(mnemonic, _ARRAY_POS), - APP_USBD_STRINGS_USER -#undef X -}; - -/** - * @brief String index into internal array index conversion table. - * - * The array that transforms the USB string indexes into internal array position. - * @note Value 0 is used to mark non-existing string. - */ -static uint8_t const m_string_translation[APP_USBD_STRING_ID_CNT] = -{ - [APP_USBD_STRING_ID_LANGIDS] = APP_USBD_STRING_ID_LANGIDS_ARRAY_POS, - -#if (APP_USBD_STRING_ID_MANUFACTURER != 0) - [APP_USBD_STRING_ID_MANUFACTURER] = APP_USBD_STRING_ID_MANUFACTURER_ARRAY_POS, -#endif // (APP_USBD_STRING_ID_MANUFACTURER != 0) - -#if (APP_USBD_STRING_ID_PRODUCT != 0) - [APP_USBD_STRING_ID_PRODUCT] = APP_USBD_STRING_ID_PRODUCT_ARRAY_POS, -#endif // (APP_USBD_STRING_ID_PRODUCT != 0) - -#if (APP_USBD_STRING_ID_SERIAL != 0) - [APP_USBD_STRING_ID_SERIAL] = APP_USBD_STRING_ID_SERIAL_ARRAY_POS, -#endif // (APP_USBD_STRING_ID_SERIAL != 0) - -#if (APP_USBD_STRING_ID_CONFIGURATION != 0) - [APP_USBD_STRING_ID_CONFIGURATION] = APP_USBD_STRING_ID_CONFIGURATION_ARRAY_POS, -#endif // (APP_USBD_STRING_ID_CONFIGURATION != 0) - -#define X(mnemonic, str_idx, ...) [mnemonic] = CONCAT_2(mnemonic, _ARRAY_POS), - APP_USBD_STRINGS_USER -#undef X -}; - -#ifndef APP_USBD_STRINGS_MANUFACTURER_EXTERN -#define APP_USBD_STRINGS_MANUFACTURER_EXTERN 0 -#endif - -#if APP_USBD_STRINGS_MANUFACTURER_EXTERN -extern uint8_t APP_USBD_STRINGS_MANUFACTURER[]; -#endif - -#ifndef APP_USBD_STRINGS_PRODUCT_EXTERN -#define APP_USBD_STRINGS_PRODUCT_EXTERN 0 -#endif - -#if APP_USBD_STRINGS_PRODUCT_EXTERN -extern uint8_t APP_USBD_STRINGS_PRODUCT[]; -#endif - -#ifndef APP_USBD_STRING_SERIAL_EXTERN -#define APP_USBD_STRING_SERIAL_EXTERN 0 -#endif - -#if APP_USBD_STRING_SERIAL_EXTERN -extern uint8_t APP_USBD_STRING_SERIAL[]; -#endif - -#ifndef APP_USBD_STRING_CONFIGURATION_EXTERN -#define APP_USBD_STRING_CONFIGURATION_EXTERN 0 -#endif - -#if APP_USBD_STRING_CONFIGURATION_EXTERN -extern uint8_t APP_USBD_STRING_CONFIGURATION[]; -#endif - -/** - * @brief String descriptor table. - * */ -static uint8_t const * m_string_dsc[APP_USBD_STRING_ID_CNT][ARRAY_SIZE(m_langids)] = -{ - [APP_USBD_STRING_ID_LANGIDS_ARRAY_POS] = {APP_USBD_STRING_RAW16_DESC(APP_USBD_STRINGS_LANGIDS)}, - -#if (APP_USBD_STRING_ID_MANUFACTURER != 0) - [APP_USBD_STRING_ID_MANUFACTURER_ARRAY_POS] = { APP_USBD_STRINGS_MANUFACTURER }, -#endif // (APP_USBD_STRING_ID_MANUFACTURER != 0) - -#if (APP_USBD_STRING_ID_PRODUCT != 0) - [APP_USBD_STRING_ID_PRODUCT_ARRAY_POS] = { APP_USBD_STRINGS_PRODUCT }, -#endif // (APP_USBD_STRING_ID_PRODUCT != 0) - -#if (APP_USBD_STRING_ID_SERIAL != 0) - [APP_USBD_STRING_ID_SERIAL_ARRAY_POS] = { APP_USBD_STRING_SERIAL }, -#endif // (APP_USBD_STRING_ID_SERIAL != 0) - -#if (APP_USBD_STRING_ID_CONFIGURATION != 0) - [APP_USBD_STRING_ID_CONFIGURATION_ARRAY_POS] = { APP_USBD_STRINGS_CONFIGURATION }, -#endif // (APP_USBD_STRING_ID_CONFIGURATION != 0) - -#define X(mnemonic, str_idx, ...) [CONCAT_2(mnemonic, _ARRAY_POS)] = {__VA_ARGS__}, - APP_USBD_STRINGS_USER -#undef X -}; - -/** - * @brief Function for preparing UTF16 string descriptor. - * - * @param idx String descriptor ID. - * @param langid Language ID. - * - * @return Pointer to the string descriptor. - */ -static uint16_t * app_usbd_prepare_string(uint8_t idx, uint16_t langid) -{ - if (m_string_dsc[idx][langid][0] == 0x00) - { - return (uint16_t *) &(m_string_dsc[idx][langid][2]); - } - -#if ((APP_USBD_CONFIG_DESC_STRING_SIZE * 2) + 2) <= NRF_DRV_USBD_EPSIZE - uint16_t * string_buffer = app_usbd_core_setup_transfer_buff_get(NULL); -#else - static uint16_t string_buffer[APP_USBD_CONFIG_DESC_STRING_SIZE + 1]; - // + 1 element for string descriptor type and size -#endif - - uint8_t size = 0; - const uint8_t * p_pos = m_string_dsc[idx][langid]; - -#if APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED - size = utf8UTF16Count((char *) p_pos, 0); - ASSERT(size <= APP_USBD_CONFIG_DESC_STRING_SIZE); - - uint16_t * p_out = &(string_buffer[1]); - uint32_t rune; - - while (*p_pos != 0) - { - p_pos = (uint8_t *) utf8DecodeRune((char *) p_pos, 0, &rune); - p_out += utf16EncodeRune(rune, p_out); - } -#else - while(*p_pos != 0) - { - ASSERT(size < APP_USBD_CONFIG_DESC_STRING_SIZE); - ++size; - string_buffer[size] = *p_pos; - ++p_pos; - } -#endif - - // Descriptor size is length of the string times 2 bytes per character + 2 bytes for - // descriptor type and size. - string_buffer[0] = (0xff & (size * 2 + 2)) | ((uint16_t)APP_USBD_DESCRIPTOR_STRING) << 8; - - return string_buffer; -} - -uint16_t const * app_usbd_string_desc_get(uint8_t idx, uint16_t langid) -{ - /* LANGID string. */ - if (APP_USBD_STRING_ID_LANGIDS == idx) - { - return app_usbd_prepare_string(APP_USBD_STRING_ID_LANGIDS_ARRAY_POS, 0); - } - - /* Searching for the language. */ - uint8_t lang_idx = 0; - if (ARRAY_SIZE(m_langids) > 1) - { - while (m_langids[lang_idx] != langid) - { - ++lang_idx; - if (lang_idx >= ARRAY_SIZE(m_langids)) - { - return NULL; - } - } - } - - /* Get the string index in array. */ - if (idx >= ARRAY_SIZE(m_string_translation)) - { - return NULL; - } - - uint8_t str_pos = m_string_translation[idx]; - if (str_pos == 0) - { - return NULL; - } - - if ((ARRAY_SIZE(m_langids) > 1) && (lang_idx != 0)) - { - if (m_string_dsc[str_pos][lang_idx] == NULL) - { - lang_idx = 0; - } - } - - if (m_string_dsc[str_pos][lang_idx] == NULL) - { - return NULL; - } - - return app_usbd_prepare_string(str_pos, lang_idx); -} - -/** @} */ -#endif // APP_USBD_ENABLED diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.h deleted file mode 100644 index 21d75e8be..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_string_desc.h +++ /dev/null @@ -1,179 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef APP_USBD_STRING_DESC_H__ -#define APP_USBD_STRING_DESC_H__ - -#include -#include "sdk_common.h" -#include "app_usbd.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup app_usbd_string_desc USBD string descriptors - * @ingroup app_usbd - * - * @brief @tagAPI52840 USBD string descriptor management. - * @{ - */ - -/** - * @brief USB Language identifier initialization. - * - * @param[in] lang Language identifier. - */ -#define APP_USBD_LANG(lang) \ - ((app_usbd_langid_t) lang) - -/** - * @brief USB Language identifier with sublanguage initialization. - * - * @param[in] lang Language identifier. - * @param[in] sublang Sublanguage identifier. - */ -#define APP_USBD_LANG_AND_SUBLANG(lang, sublang) \ - ((app_usbd_langid_t) lang | (app_usbd_langid_t) sublang) - -/** - * @brief USB string initialization. - * - * Macro that creates initialization values for the USB string. - * The string must be declared as a NULL-terminated string. - * - * @param[in] str NULL-terminated string. - * - * @return String descriptor initialization data. - */ -#define APP_USBD_STRING_DESC(str) (const uint8_t *)(const char[]){str} - -/** - * @brief USB raw 8-bit string initialization. - * - * Macro that creates header for raw values passed into descriptor. - * Values must be of the uint8_t type and separated by commas. - * - * @param[in] ... comma-separated values. - * - * @return String descriptor initialization data. - */ -#define APP_USBD_STRING_RAW8_DESC(...) (const uint8_t[]){ \ - 0x00, 0x00, /* NULL character at start to differentiate from normal string */ \ - (0xff & (sizeof((uint8_t[]){__VA_ARGS__}) + 2)), \ - (APP_USBD_DESCRIPTOR_STRING), \ - __VA_ARGS__ } - -/** - * @brief USB raw 16-bit string initialization. - * - * Macro that creates header for raw values passed into descriptor. - * Values must be of the uint16_t type and separated by commas. - * - * @param[in] ... comma-separated values. - * - * @return String descriptor initialization data. - */ -#define APP_USBD_STRING_RAW16_DESC(...) (const uint8_t *) ((const uint16_t[]){ \ - 0x00, /* NULL character at start to differentiate from normal string */ \ - (0xff & (sizeof((uint16_t[]){__VA_ARGS__}) + 2)) | \ - ((uint16_t)APP_USBD_DESCRIPTOR_STRING) << 8, \ - __VA_ARGS__ }) - -/** - * @brief USB string descriptors IDs - */ -typedef enum { - APP_USBD_STRING_ID_LANGIDS = 0, /**< Supported language identifiers */ - - /// Placeholders used only for alignement of user strings. Do not use or modify them. - -#if (APP_USBD_STRING_ID_MANUFACTURER != 0) - APP_USBD_STRING_ID_MANUFACTURER_PLACEHOLDER = APP_USBD_STRING_ID_MANUFACTURER, -#endif // (APP_USBD_STRING_ID_MANUFACTURER != 0) - -#if (APP_USBD_STRING_ID_PRODUCT != 0) - APP_USBD_STRING_ID_PRODUCT_PLACEHOLDER = APP_USBD_STRING_ID_PRODUCT, -#endif // (APP_USBD_STRING_ID_PRODUCT != 0) - -#if (APP_USBD_STRING_ID_SERIAL != 0) - APP_USBD_STRING_ID_SERIAL_PLACEHOLDER = APP_USBD_STRING_ID_SERIAL, -#endif // (APP_USBD_STRING_ID_SERIAL != 0) - -#if (APP_USBD_STRING_ID_CONFIGURATION != 0) - APP_USBD_STRING_ID_CONFIGURATION_PLACEHOLDER = APP_USBD_STRING_ID_CONFIGURATION, -#endif // (APP_USBD_STRING_ID_CONFIGURATION != 0) - -#define X(mnemonic, str_idx, ...) mnemonic str_idx, - APP_USBD_STRINGS_USER -#undef X - - APP_USBD_STRING_ID_CNT /**< Total number of identifiers. */ -} app_usbd_string_desc_idx_t; - -/** - * @brief Get string descriptor. - * - * @param[in] idx String descriptor index. - * @param[in] langid Selected language for the string. - * @return String descriptor, or NULL if it does not exist. - * */ -uint16_t const * app_usbd_string_desc_get(uint8_t idx, uint16_t langid); - -/** - * @brief Get string length. - * - * Function for getting string length from descriptor (descriptor returned by @ref app_usbd_string_desc_get). - * - * @param[in] p_str String descriptor pointer. - * @return Total descriptor length in bytes. - */ -static inline size_t app_usbd_string_desc_length(uint16_t const * p_str) -{ - return ((const app_usbd_descriptor_string_t *)p_str)->bLength; -} - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_STRING_DESC_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/app_usbd_types.h b/third_party/NordicSemiconductor/libraries/usb/app_usbd_types.h deleted file mode 100644 index 0d4a0c277..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/app_usbd_types.h +++ /dev/null @@ -1,279 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#ifndef APP_USBD_TYPES_H__ -#define APP_USBD_TYPES_H__ - -#include - -#include "sdk_errors.h" -#include "nrf_drv_usbd.h" -#include "app_usbd_request.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup app_usbd_types USB Device high level library variable types definition - * @ingroup app_usbd - * - * @brief @tagAPI52840 All types used by @ref app_usbd are defined here. - * This helps to avoid cross referencing into types in different files. - * @{ - */ - -/** - * @brief Change given value to 2 digits in BCD notation. - * - * @param[in] val The decimal value to be converted in the range from 0 to 99. - * @return Calculated BCD value. - */ -#define APP_USBD_BCD_2_MAKE(val) ( \ - ((((val) % 100) / 10) * 0x10) + \ - ((((val) % 10) / 1) * 0x1) \ - ) - -/** - * @brief Change given decimal version values to 4 digits in BCD notation. - * - * USB specification uses 4 digits BCD version notation in many descriptors. - * This macro changes 3 values to 4 BCD digits (one 16 bit value) - * that describes version in USB standard. - * - * @param[in] major Major version. - * @param[in] minor Minor version. - * @param[in] sub Sub-minor version. - * - * @return Calculated 16 bit value with BCD representation of the version. - */ -#define APP_USBD_BCD_VER_MAKE(major, minor, sub) \ - ((APP_USBD_BCD_2_MAKE(major) << 8) | (minor) << 4 | (sub)) - -/** - * @brief Combine endpoint address and its interval. - * - * @param[in] address Endpoint address - * @param[in] interval Endpoint interval - * @return Combined address and interval. - */ -#define APP_USBD_EP_WITH_INTERVAL(address, interval) \ - ((1UL << 16) | ((interval) << 8) | (address)) - -#define APP_USBD_EXTRACT_INTERVAL_VALUE(combined) \ - (((combined) & 0xFF00) >> 8) - -#define APP_USBD_EXTRACT_INTERVAL_FLAG(combined) \ - (((combined) >> 16) & 0x01) - -/** - * @brief Events codes. - * - * Redefined application event codes. - */ -typedef enum -{ - APP_USBD_EVT_DRV_SOF = NRF_DRV_USBD_EVT_SOF, /**< See documentation for @ref NRF_DRV_USBD_EVT_SOF */ - APP_USBD_EVT_DRV_RESET = NRF_DRV_USBD_EVT_RESET, /**< See documentation for @ref NRF_DRV_USBD_EVT_RESET */ - APP_USBD_EVT_DRV_SUSPEND = NRF_DRV_USBD_EVT_SUSPEND, /**< See documentation for @ref NRF_DRV_USBD_EVT_SUSPEND */ - APP_USBD_EVT_DRV_RESUME = NRF_DRV_USBD_EVT_RESUME, /**< See documentation for @ref NRF_DRV_USBD_EVT_RESUME */ - APP_USBD_EVT_DRV_WUREQ = NRF_DRV_USBD_EVT_WUREQ, /**< See documentation for @ref NRF_DRV_USBD_EVT_WUREQ */ - APP_USBD_EVT_DRV_SETUP = NRF_DRV_USBD_EVT_SETUP, /**< This event type has special structure. See @ref app_usbd_setup_evt_t */ - APP_USBD_EVT_DRV_EPTRANSFER = NRF_DRV_USBD_EVT_EPTRANSFER, /**< See documentation for @ref NRF_DRV_USBD_EVT_EPTRANSFER */ - - APP_USBD_EVT_FIRST_POWER, /**< First power event code - for internal static assert checking */ - - APP_USBD_EVT_POWER_DETECTED, /**< See documentation for @ref NRF_DRV_POWER_USB_EVT_DETECTED */ - APP_USBD_EVT_POWER_REMOVED, /**< See documentation for @ref NRF_DRV_POWER_USB_EVT_REMOVED */ - APP_USBD_EVT_POWER_READY, /**< See documentation for @ref NRF_DRV_POWER_USB_EVT_READY */ - - - APP_USBD_EVT_FIRST_APP, /**< First application event code - for internal static assert checking */ - - APP_USBD_EVT_INST_APPEND = APP_USBD_EVT_FIRST_APP, /**< The instance was attached to the library, any configuration action can be done now */ - APP_USBD_EVT_INST_REMOVE, /**< - * The instance is going to be removed, this event is called just before removing the instance. - * This removing cannot be stopped. - */ - APP_USBD_EVT_STARTED, /**< USBD library has just been started and functional - event passed to all instances, before USBD interrupts have been enabled */ - APP_USBD_EVT_STOPPED, /**< USBD library has just been stopped and is not functional - event passed to all instances, after USBD interrupts have been disabled*/ - - APP_USBD_EVT_STATE_CHANGED, /**< - * Informs all the classes that base state has been changed. - * This event is processed before setup stage that caused the state change finishes (before acknowledging it). - */ - - APP_USBD_EVT_FIRST_INTERNAL = 0x80, /**< First internal event, used by the APP library internally. */ - - APP_USBD_EVT_HFCLK_READY = APP_USBD_EVT_FIRST_INTERNAL, /**< High frequency clock started */ - APP_USBD_EVT_START_REQ, /**< Start requested */ - APP_USBD_EVT_STOP_REQ, /**< Stop requested */ - APP_USBD_EVT_SUSPEND_REQ, /**< Suspend request - HFCLK would be released and USBD peripheral clock would be disconnected */ - APP_USBD_EVT_WAKEUP_REQ, /**< Wakeup request - start the whole wakeup generation. */ - APP_USBD_EVT_SETUP_SETADDRESS, /**< - * Setup request to set address, separated from - * regular EVT_SETUP because this request is - * fully handled by hardware and for the software - * it is only a notification about what happened - */ - -} app_usbd_event_type_t; - - - -/** - * @brief Specific application event structure. - * - * All the data required by the events that comes from the application level. - */ -typedef struct -{ - app_usbd_event_type_t type; //!< Event type -} app_usbd_evt_t; - -/** - * @brief Specific application event structure with setup structure included. - * - * This event structure would be used when @ref APP_USBD_EVT_DRV_SETUP - * is passed to instance event handler. - */ -typedef struct -{ - app_usbd_event_type_t type; //!< Event type - app_usbd_setup_t setup; //!< Setup structure -} app_usbd_setup_evt_t; - - -/** - * @brief Complex event variable type. - * - * A variable that can store any kind of event. - */ -typedef union -{ - app_usbd_event_type_t type; //!< Event type - nrf_drv_usbd_evt_t drv_evt; //!< Events that comes directly from the driver. - /**< Use this event structure only for event - * type < @ref APP_USBD_EVT_FIRST_APP - */ - app_usbd_setup_evt_t setup_evt; //!< Event structure with SETUP structure included. - /**< This structure is used in connection with - * @ref APP_USBD_EVT_DRV_SETUP - */ - app_usbd_evt_t app_evt; //!< Events that comes from the application driver. - /**< Use this event structure only for event - * type >= @ref APP_USBD_EVT_FIRST_APP - */ -} app_usbd_complex_evt_t; - - -/** - * @brief Internal event variable type. - * - * The variable type used for internal event processing. - * This kind of event is the one that goes into the event queue. - * - * @note There is no setup event structure. - * This structure would be created when setup event is processed. - * The reason for that is the fact that setup event structure has high memory printout. - */ -typedef union -{ - app_usbd_event_type_t type; //!< Event type - nrf_drv_usbd_evt_t drv_evt; //!< Events that comes directly from the driver. - /**< Use this event structure only for event - * type < @ref APP_USBD_EVT_FIRST_APP - */ - app_usbd_evt_t app_evt; //!< Events that comes from the application driver. - /**< Use this event structure only for event - * type >= @ref APP_USBD_EVT_FIRST_APP - */ -} app_usbd_internal_evt_t; - - -#ifdef DOXYGEN -/** - * @brief Base instance of a USBD class. - * - * Any USBD class instance have to begin with this instance. - * This may then be followed by any implementation dependent data. - * - * For an instance it should be possible to put whole structure into FLASH. - * - * @note This type is early defined as incomplete type. - * This is required for function declaration that takes the pointer - * to this structure but in second hand - it is also placed inside - * the instance structure. - * @note The structure is defined in @file app_usbd_class_base.h. - */ -typedef struct {} app_usbd_class_inst_t; -#else -typedef struct app_usbd_class_inst_s app_usbd_class_inst_t; -#endif -/** - * @brief Endpoint callback function. - * - * The function used by every class instance. - * @param[in,out] p_inst Instance of the class. - * @param[in] p_event Event to process. - * - * @note If given event is not supported by class, return @ref NRF_ERROR_NOT_SUPPORTED - */ -typedef ret_code_t (*app_usbd_ep_event_handler_t)( - app_usbd_class_inst_t const * const p_inst, - app_usbd_complex_evt_t const * const p_event - ); - -/** - * @brief SOF interrupt callback function. - * - * @param[in] framecnt Number of current SOF frame. - * - * @sa app_usbd_class_sof_register - */ -typedef void (*app_usbd_sof_interrupt_handler_t)(uint16_t framecnt); - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_TYPES_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.c b/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.c deleted file mode 100644 index 249a9099b..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.c +++ /dev/null @@ -1,1199 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include "sdk_common.h" -#if NRF_MODULE_ENABLED(APP_USBD_CDC_ACM) - -#include "app_usbd_cdc_acm.h" -#include - -/** - * @defgroup app_usbd_cdc_acm_internal CDC ACM internals - * @{ - * @ingroup app_usbd_cdc - * @internal - */ - - -#define NRF_LOG_MODULE_NAME cdc_acm - -#if APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED -#define NRF_LOG_LEVEL APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL -#define NRF_LOG_INFO_COLOR APP_USBD_CDC_ACM_CONFIG_INFO_COLOR -#define NRF_LOG_DEBUG_COLOR APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR -#else //APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED -#define NRF_LOG_LEVEL 0 -#endif //APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED -#include "nrf_log.h" -NRF_LOG_MODULE_REGISTER(); - -#define APP_USBD_CDC_ACM_COMM_IFACE_IDX 0 /**< CDC ACM class comm interface index. */ -#define APP_USBD_CDC_ACM_DATA_IFACE_IDX 1 /**< CDC ACM class data interface index. */ - -#define APP_USBD_CDC_ACM_COMM_EPIN_IDX 0 /**< CDC ACM comm class endpoint IN index. */ -#define APP_USBD_CDC_ACM_DATA_EPIN_IDX 0 /**< CDC ACM data class endpoint IN index. */ -#define APP_USBD_CDC_ACM_DATA_EPOUT_IDX 1 /**< CDC ACM data class endpoint OUT index. */ - -/** - * @brief Auxiliary function to access cdc_acm class instance data. - * - * @param[in] p_inst Class instance data. - * - * @return CDC ACM class instance. - */ -static inline app_usbd_cdc_acm_t const * cdc_acm_get(app_usbd_class_inst_t const * p_inst) -{ - ASSERT(p_inst != NULL); - return (app_usbd_cdc_acm_t const *)p_inst; -} - -/** - * @brief Auxiliary function to access cdc_acm class context data. - * - * @param[in] p_cdc_acm CDC ACM class instance data. - * - * @return CDC ACM class instance context. - */ -static inline app_usbd_cdc_acm_ctx_t * cdc_acm_ctx_get(app_usbd_cdc_acm_t const * p_cdc_acm) -{ - ASSERT(p_cdc_acm != NULL); - ASSERT(p_cdc_acm->specific.p_data != NULL); - return &p_cdc_acm->specific.p_data->ctx; -} - -/** - * @brief User event handler. - * - * @param[in] p_inst Class instance. - * @param[in] event user Event type. - */ -static inline void user_event_handler(app_usbd_class_inst_t const * p_inst, - app_usbd_cdc_acm_user_event_t event) -{ - app_usbd_cdc_acm_t const * p_cdc_acm = cdc_acm_get(p_inst); - if (p_cdc_acm->specific.inst.user_ev_handler != NULL) - { - p_cdc_acm->specific.inst.user_ev_handler(p_inst, event); - } -} - -/** - * @brief Auxiliary function to access CDC ACM COMM IN endpoint address. - * - * @param[in] p_inst Class instance data. - * - * @return IN endpoint address. - */ -static inline nrf_drv_usbd_ep_t comm_ep_in_addr_get(app_usbd_class_inst_t const * p_inst) -{ - app_usbd_class_iface_conf_t const * class_iface; - class_iface = app_usbd_class_iface_get(p_inst, APP_USBD_CDC_ACM_COMM_IFACE_IDX); - - app_usbd_class_ep_conf_t const * ep_cfg; - ep_cfg = app_usbd_class_iface_ep_get(class_iface, APP_USBD_CDC_ACM_COMM_EPIN_IDX); - - return app_usbd_class_ep_address_get(ep_cfg); -} - -/** - * @brief Auxiliary function to access CDC ACM DATA IN endpoint address. - * - * @param[in] p_inst Class instance data. - * - * @return IN endpoint address. - */ -static inline nrf_drv_usbd_ep_t data_ep_in_addr_get(app_usbd_class_inst_t const * p_inst) -{ - app_usbd_class_iface_conf_t const * class_iface; - class_iface = app_usbd_class_iface_get(p_inst, APP_USBD_CDC_ACM_DATA_IFACE_IDX); - - app_usbd_class_ep_conf_t const * ep_cfg; - ep_cfg = app_usbd_class_iface_ep_get(class_iface, APP_USBD_CDC_ACM_DATA_EPIN_IDX); - - return app_usbd_class_ep_address_get(ep_cfg); -} - -/** - * @brief Auxiliary function to access CDC ACM DATA OUT endpoint address. - * - * @param[in] p_inst Class instance data. - * - * @return OUT endpoint address. - */ -static inline nrf_drv_usbd_ep_t data_ep_out_addr_get(app_usbd_class_inst_t const * p_inst) -{ - app_usbd_class_iface_conf_t const * class_iface; - class_iface = app_usbd_class_iface_get(p_inst, APP_USBD_CDC_ACM_DATA_IFACE_IDX); - - app_usbd_class_ep_conf_t const * ep_cfg; - ep_cfg = app_usbd_class_iface_ep_get(class_iface, APP_USBD_CDC_ACM_DATA_EPOUT_IDX); - - return app_usbd_class_ep_address_get(ep_cfg); -} - -/** - * @brief Internal SETUP standard IN request handler. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - */ -static ret_code_t setup_req_std_in(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - /* Only Get Descriptor standard IN request is supported by CDC class */ - if ((app_usbd_setup_req_rec(p_setup_ev->setup.bmRequestType) == APP_USBD_SETUP_REQREC_INTERFACE) - && - (p_setup_ev->setup.bRequest == APP_USBD_SETUP_STDREQ_GET_DESCRIPTOR)) - { - size_t dsc_len = 0; - size_t max_size; - - uint8_t * p_trans_buff = app_usbd_core_setup_transfer_buff_get(&max_size); - - /* Try to find descriptor in class internals*/ - ret_code_t ret = app_usbd_class_descriptor_find( - p_inst, - p_setup_ev->setup.wValue.hb, - p_setup_ev->setup.wValue.lb, - p_trans_buff, - &dsc_len); - - if (ret != NRF_ERROR_NOT_FOUND) - { - ASSERT(dsc_len < NRF_DRV_USBD_EPSIZE); - return app_usbd_core_setup_rsp(&(p_setup_ev->setup), p_trans_buff, dsc_len); - } - } - - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief Internal SETUP standard OUT request handler. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - */ -static ret_code_t setup_req_std_out(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - - switch (p_setup_ev->setup.bRequest) - { - default: - break; - } - - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief Internal SETUP class IN request handler. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - */ -static ret_code_t setup_req_class_in(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - app_usbd_cdc_acm_t const * p_cdc_acm = cdc_acm_get(p_inst); - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - switch (p_setup_ev->setup.bRequest) - { - case APP_USBD_CDC_REQ_GET_LINE_CODING: - { - if (p_setup_ev->setup.wLength.w != sizeof(app_usbd_cdc_line_coding_t)) - { - return NRF_ERROR_NOT_SUPPORTED; - } - - return app_usbd_core_setup_rsp(&p_setup_ev->setup, - &p_cdc_acm_ctx->line_coding, - sizeof(app_usbd_cdc_line_coding_t)); - } - default: - break; - } - - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief Class specific OUT request data callback. - * - * @param status Endpoint status. - * @param p_context Context of transfer (set by @ref app_usbd_core_setup_data_handler_set). - * - * @return Standard error code. - */ -static ret_code_t cdc_acm_req_out_data_cb(nrf_drv_usbd_ep_status_t status, void * p_context) -{ - if (status != NRF_USBD_EP_OK) - { - return NRF_ERROR_INTERNAL; - } - - app_usbd_cdc_acm_t const * p_cdc_acm = p_context; - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - switch (p_cdc_acm_ctx->request.type) - { - case APP_USBD_CDC_REQ_SET_LINE_CODING: - { - memcpy(&p_cdc_acm_ctx->line_coding, - &p_cdc_acm_ctx->request.payload.line_coding, - sizeof(app_usbd_cdc_line_coding_t)); - - NRF_LOG_INFO("REQ_SET_LINE_CODING: baudrate: %"PRIu32", databits: %u, " - "format: %u, parity: %u", - uint32_decode(p_cdc_acm_ctx->line_coding.dwDTERate), - p_cdc_acm_ctx->line_coding.bDataBits, - p_cdc_acm_ctx->line_coding.bCharFormat, - p_cdc_acm_ctx->line_coding.bParityType); - break; - } - default: - return NRF_ERROR_NOT_SUPPORTED; - } - - return NRF_SUCCESS; -} - - -/** - * @brief Class specific request data stage setup. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - */ -static ret_code_t cdc_acm_req_out_datastage(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - app_usbd_cdc_acm_t const * p_cdc_acm = cdc_acm_get(p_inst); - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - p_cdc_acm_ctx->request.type = p_setup_ev->setup.bRequest; - p_cdc_acm_ctx->request.len = p_setup_ev->setup.wLength.w; - - /*Request setup data*/ - NRF_DRV_USBD_TRANSFER_OUT(transfer, - &p_cdc_acm_ctx->request.payload, - p_cdc_acm_ctx->request.len); - ret_code_t ret; - CRITICAL_REGION_ENTER(); - ret = app_usbd_ep_transfer(NRF_DRV_USBD_EPOUT0, &transfer); - if (ret == NRF_SUCCESS) - { - const app_usbd_core_setup_data_handler_desc_t desc = { - .handler = cdc_acm_req_out_data_cb, - .p_context = (void*)p_cdc_acm - }; - - ret = app_usbd_core_setup_data_handler_set(NRF_DRV_USBD_EPOUT0, &desc); - } - CRITICAL_REGION_EXIT(); - - return ret; -} - -/** - * @brief Reset port to default state. - * - * @param p_inst Generic class instance. - */ -static void cdc_acm_reset_port(app_usbd_class_inst_t const * p_inst) -{ - app_usbd_cdc_acm_t const * p_cdc_acm = cdc_acm_get(p_inst); - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - p_cdc_acm_ctx->line_state = 0; - - // Set rx transfers configuration to default state. - p_cdc_acm_ctx->rx_transfer[0].p_buf = NULL; - p_cdc_acm_ctx->rx_transfer[1].p_buf = NULL; - p_cdc_acm_ctx->bytes_left = 0; - p_cdc_acm_ctx->bytes_read = 0; - p_cdc_acm_ctx->last_read = 0; - p_cdc_acm_ctx->cur_read = 0; - p_cdc_acm_ctx->p_copy_pos = p_cdc_acm_ctx->internal_rx_buf; -} - -/** - * @brief Internal SETUP class OUT request handler. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - */ -static ret_code_t setup_req_class_out(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - app_usbd_cdc_acm_t const * p_cdc_acm = cdc_acm_get(p_inst); - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - switch (p_setup_ev->setup.bRequest) - { - case APP_USBD_CDC_REQ_SET_LINE_CODING: - { - if (p_setup_ev->setup.wLength.w != sizeof(app_usbd_cdc_line_coding_t)) - { - return NRF_ERROR_NOT_SUPPORTED; - } - - return cdc_acm_req_out_datastage(p_inst, p_setup_ev); - } - case APP_USBD_CDC_REQ_SET_CONTROL_LINE_STATE: - { - if (p_setup_ev->setup.wLength.w != 0) - { - return NRF_ERROR_NOT_SUPPORTED; - } - - NRF_LOG_INFO("REQ_SET_CONTROL_LINE_STATE: 0x%x", p_setup_ev->setup.wValue.w); - - bool old_dtr = (p_cdc_acm_ctx->line_state & APP_USBD_CDC_ACM_LINE_STATE_DTR) ? - true : false; - p_cdc_acm_ctx->line_state = p_setup_ev->setup.wValue.w; - - bool new_dtr = (p_cdc_acm_ctx->line_state & APP_USBD_CDC_ACM_LINE_STATE_DTR) ? - true : false; - - if (old_dtr == new_dtr) - { - return NRF_SUCCESS; - } - - const app_usbd_cdc_acm_user_event_t ev = new_dtr ? - APP_USBD_CDC_ACM_USER_EVT_PORT_OPEN : APP_USBD_CDC_ACM_USER_EVT_PORT_CLOSE; - - user_event_handler(p_inst, ev); - - if (!new_dtr) - { - /*Abort DATA endpoints on port close */ - nrf_drv_usbd_ep_t ep; - ep = data_ep_in_addr_get(p_inst); - nrf_drv_usbd_ep_abort(ep); - ep = data_ep_out_addr_get(p_inst); - nrf_drv_usbd_ep_abort(ep); - - // Set rx transfers configuration to default state. - p_cdc_acm_ctx->rx_transfer[0].p_buf = NULL; - p_cdc_acm_ctx->rx_transfer[1].p_buf = NULL; - p_cdc_acm_ctx->bytes_left = 0; - p_cdc_acm_ctx->bytes_read = 0; - p_cdc_acm_ctx->last_read = 0; - p_cdc_acm_ctx->cur_read = 0; - p_cdc_acm_ctx->p_copy_pos = p_cdc_acm_ctx->internal_rx_buf; - } - - return NRF_SUCCESS; - } - default: - break; - } - - return NRF_ERROR_NOT_SUPPORTED; -} - -/** - * @brief Control endpoint handler. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - */ -static ret_code_t setup_event_handler(app_usbd_class_inst_t const * p_inst, - app_usbd_setup_evt_t const * p_setup_ev) -{ - ASSERT(p_inst != NULL); - ASSERT(p_setup_ev != NULL); - - if (app_usbd_setup_req_dir(p_setup_ev->setup.bmRequestType) == APP_USBD_SETUP_REQDIR_IN) - { - switch (app_usbd_setup_req_typ(p_setup_ev->setup.bmRequestType)) - { - case APP_USBD_SETUP_REQTYPE_STD: - return setup_req_std_in(p_inst, p_setup_ev); - case APP_USBD_SETUP_REQTYPE_CLASS: - return setup_req_class_in(p_inst, p_setup_ev); - default: - break; - } - } - else /*APP_USBD_SETUP_REQDIR_OUT*/ - { - switch (app_usbd_setup_req_typ(p_setup_ev->setup.bmRequestType)) - { - case APP_USBD_SETUP_REQTYPE_STD: - return setup_req_std_out(p_inst, p_setup_ev); - case APP_USBD_SETUP_REQTYPE_CLASS: - return setup_req_class_out(p_inst, p_setup_ev); - default: - break; - } - } - - return NRF_ERROR_NOT_SUPPORTED; -} - - -/** - * @brief CDC ACM consumer. - * - * @note See @ref nrf_drv_usbd_consumer_t - */ -static bool cdc_acm_consumer(nrf_drv_usbd_ep_transfer_t * p_next, - void * p_context, - size_t ep_size, - size_t data_size) -{ - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = (app_usbd_cdc_acm_ctx_t *) p_context; - p_next->size = data_size; - - if (data_size <= p_cdc_acm_ctx->rx_transfer[0].read_left) - { - p_next->p_data.rx = p_cdc_acm_ctx->rx_transfer[0].p_buf; - - p_cdc_acm_ctx->rx_transfer[0].p_buf += data_size; - p_cdc_acm_ctx->bytes_read += data_size; - p_cdc_acm_ctx->rx_transfer[0].read_left -= data_size; - NRF_LOG_DEBUG("Received %d bytes. Space left in user buffer: %d bytes.", - data_size, - p_cdc_acm_ctx->rx_transfer[0].read_left); - return (p_cdc_acm_ctx->rx_transfer[0].read_left) != 0; - } - else - { - p_next->p_data.rx = p_cdc_acm_ctx->internal_rx_buf; - - p_cdc_acm_ctx->cur_read = data_size; - NRF_LOG_DEBUG("Received %d bytes. Stored in internal buffer.", data_size); - return false; - } -} - -/** - * @brief CDC ACM single transfer consumer. - * - * This function finalizes transfer after any received block. - * - * @note See @ref nrf_drv_usbd_consumer_t - */ -static bool cdc_acm_single_shoot_consumer(nrf_drv_usbd_ep_transfer_t * p_next, - void * p_context, - size_t ep_size, - size_t data_size) -{ - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = (app_usbd_cdc_acm_ctx_t *) p_context; - p_next->size = data_size; - - if (data_size <= p_cdc_acm_ctx->rx_transfer[0].read_left) - { - p_next->p_data.rx = p_cdc_acm_ctx->rx_transfer[0].p_buf; - - p_cdc_acm_ctx->bytes_read = data_size; - p_cdc_acm_ctx->rx_transfer[0].read_left = data_size; - NRF_LOG_DEBUG("Received %d bytes. Space left in user buffer: %d bytes.", - data_size, - p_cdc_acm_ctx->rx_transfer[0].read_left); - } - else - { - p_next->p_data.rx = p_cdc_acm_ctx->internal_rx_buf; - p_cdc_acm_ctx->cur_read = data_size; - NRF_LOG_DEBUG("Received %d bytes. Stored in internal buffer.", data_size); - } - - return false; -} - -/** - * @brief Manage switching between user buffers and copying data from internal buffer. - * - * @param p_inst Generic USB class instance. - * - * @return Standard error code. - */ -static ret_code_t cdc_acm_rx_block_finished(app_usbd_class_inst_t const * p_inst) -{ - app_usbd_cdc_acm_t const * p_cdc_acm = cdc_acm_get(p_inst); - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - nrf_drv_usbd_ep_t ep = data_ep_out_addr_get(p_inst); - - nrf_drv_usbd_handler_desc_t handler_desc = { - .handler.consumer = cdc_acm_consumer, - .p_context = p_cdc_acm_ctx - }; - - if (p_cdc_acm_ctx->rx_transfer[0].read_left == 0) // Buffer completely filled by consumer - { - p_cdc_acm_ctx->last_read = p_cdc_acm_ctx->bytes_read; - p_cdc_acm_ctx->bytes_read = 0; - p_cdc_acm_ctx->bytes_left = 0; - - if (p_cdc_acm_ctx->rx_transfer[1].p_buf != NULL) - { - p_cdc_acm_ctx->rx_transfer[0] = p_cdc_acm_ctx->rx_transfer[1]; - p_cdc_acm_ctx->rx_transfer[1].p_buf = NULL; - return app_usbd_ep_handled_transfer(ep, &handler_desc); - } - else - { - p_cdc_acm_ctx->rx_transfer[0].p_buf = NULL; - return NRF_SUCCESS; - } - } - - size_t bytes_read = p_cdc_acm_ctx->cur_read; - size_t bytes_to_cpy = bytes_read; - - if (bytes_read > p_cdc_acm_ctx->rx_transfer[0].read_left) - { - bytes_to_cpy = p_cdc_acm_ctx->rx_transfer[0].read_left; - } - memcpy(p_cdc_acm_ctx->rx_transfer[0].p_buf, - p_cdc_acm_ctx->internal_rx_buf, - bytes_to_cpy); - - // First buffer is full - p_cdc_acm_ctx->last_read = p_cdc_acm_ctx->bytes_read + bytes_to_cpy; - p_cdc_acm_ctx->bytes_read = 0; - p_cdc_acm_ctx->bytes_left = bytes_read - bytes_to_cpy; - p_cdc_acm_ctx->p_copy_pos = p_cdc_acm_ctx->internal_rx_buf + bytes_to_cpy; - - if (p_cdc_acm_ctx->rx_transfer[1].p_buf != NULL) - { - // If there is second transfer, copy it to first - p_cdc_acm_ctx->rx_transfer[0] = p_cdc_acm_ctx->rx_transfer[1]; - p_cdc_acm_ctx->rx_transfer[1].p_buf = NULL; - - while (p_cdc_acm_ctx->bytes_left > 0) - { - - if (p_cdc_acm_ctx->bytes_left >= p_cdc_acm_ctx->rx_transfer[0].read_left) - { - // If there are enough bytes left in internal buffer to completely fill next transfer, - // we call user event handler to obtain next buffer and continue double buffering. - memcpy(p_cdc_acm_ctx->rx_transfer[0].p_buf, - p_cdc_acm_ctx->p_copy_pos, - p_cdc_acm_ctx->rx_transfer[0].read_left); - - p_cdc_acm_ctx->bytes_left -= p_cdc_acm_ctx->rx_transfer[0].read_left; - p_cdc_acm_ctx->p_copy_pos += p_cdc_acm_ctx->rx_transfer[0].read_left; - p_cdc_acm_ctx->last_read = p_cdc_acm_ctx->rx_transfer[0].read_left; - user_event_handler(p_inst, APP_USBD_CDC_ACM_USER_EVT_RX_DONE); - - if (p_cdc_acm_ctx->rx_transfer[1].p_buf != NULL) - { - p_cdc_acm_ctx->rx_transfer[0] = p_cdc_acm_ctx->rx_transfer[1]; - p_cdc_acm_ctx->rx_transfer[1].p_buf = NULL; - } - else - { - // If user does not specify a second buffer, all data transfers are done - // and data left in internal buffer is lost. - p_cdc_acm_ctx->rx_transfer[0].p_buf = NULL; - break; - } - } - else - { - memcpy(p_cdc_acm_ctx->rx_transfer[0].p_buf, - p_cdc_acm_ctx->p_copy_pos, - p_cdc_acm_ctx->bytes_left); - p_cdc_acm_ctx->bytes_read = p_cdc_acm_ctx->bytes_left; - - p_cdc_acm_ctx->rx_transfer[0].read_left -= p_cdc_acm_ctx->bytes_left; - p_cdc_acm_ctx->rx_transfer[0].p_buf += p_cdc_acm_ctx->bytes_left; - break; - } - } - - - } - else - { - p_cdc_acm_ctx->rx_transfer[0].p_buf = NULL; - } - - if (p_cdc_acm_ctx->rx_transfer[0].p_buf != NULL) - { - return app_usbd_ep_handled_transfer(ep, &handler_desc); - } - return NRF_SUCCESS; -} - -/** - * @brief Class specific endpoint transfer handler. - * - * @param[in] p_inst Generic class instance. - * @param[in] p_setup_ev Setup event. - * - * @return Standard error code. - */ -static ret_code_t cdc_acm_endpoint_ev(app_usbd_class_inst_t const * p_inst, - app_usbd_complex_evt_t const * p_event) -{ - if (comm_ep_in_addr_get(p_inst) == p_event->drv_evt.data.eptransfer.ep) - { - NRF_LOG_INFO("EPIN_COMM: notify"); - return NRF_SUCCESS; - } - ret_code_t ret; - if (NRF_USBD_EPIN_CHECK(p_event->drv_evt.data.eptransfer.ep)) - { - switch (p_event->drv_evt.data.eptransfer.status) - { - case NRF_USBD_EP_OK: - NRF_LOG_INFO("EPIN_DATA: %02x done", p_event->drv_evt.data.eptransfer.ep); - user_event_handler(p_inst, APP_USBD_CDC_ACM_USER_EVT_TX_DONE); - return NRF_SUCCESS; - case NRF_USBD_EP_ABORTED: - return NRF_SUCCESS; - default: - return NRF_ERROR_INTERNAL; - } - } - - if (NRF_USBD_EPOUT_CHECK(p_event->drv_evt.data.eptransfer.ep)) - { - switch (p_event->drv_evt.data.eptransfer.status) - { - case NRF_USBD_EP_OK: - ret = cdc_acm_rx_block_finished(p_inst); - NRF_LOG_INFO("EPOUT_DATA: %02x done", p_event->drv_evt.data.eptransfer.ep); - user_event_handler(p_inst, APP_USBD_CDC_ACM_USER_EVT_RX_DONE); - return ret; - case NRF_USBD_EP_WAITING: - case NRF_USBD_EP_ABORTED: - return NRF_SUCCESS; - default: - return NRF_ERROR_INTERNAL; - } - } - - return NRF_ERROR_NOT_SUPPORTED; -} - - -/** - * @brief @ref app_usbd_class_methods_t::event_handler - */ -static ret_code_t cdc_acm_event_handler(app_usbd_class_inst_t const * p_inst, - app_usbd_complex_evt_t const * p_event) -{ - ASSERT(p_inst != NULL); - ASSERT(p_event != NULL); - - ret_code_t ret = NRF_SUCCESS; - switch (p_event->app_evt.type) - { - case APP_USBD_EVT_DRV_SOF: - break; - case APP_USBD_EVT_DRV_RESET: - cdc_acm_reset_port(p_inst); - break; - case APP_USBD_EVT_DRV_SETUP: - ret = setup_event_handler(p_inst, (app_usbd_setup_evt_t const *)p_event); - break; - case APP_USBD_EVT_DRV_EPTRANSFER: - ret = cdc_acm_endpoint_ev(p_inst, p_event); - break; - case APP_USBD_EVT_DRV_SUSPEND: - break; - case APP_USBD_EVT_DRV_RESUME: - break; - case APP_USBD_EVT_INST_APPEND: - break; - case APP_USBD_EVT_INST_REMOVE: - break; - case APP_USBD_EVT_STARTED: - break; - case APP_USBD_EVT_STOPPED: - break; - case APP_USBD_EVT_POWER_REMOVED: - cdc_acm_reset_port(p_inst); - break; - default: - ret = NRF_ERROR_NOT_SUPPORTED; - break; - } - - return ret; -} - - -static bool cdc_acm_feed_descriptors(app_usbd_class_descriptor_ctx_t * p_ctx, - app_usbd_class_inst_t const * p_inst, - uint8_t * p_buff, - size_t max_size) -{ - static uint8_t ifaces = 0; - ifaces = app_usbd_class_iface_count_get(p_inst); - app_usbd_cdc_acm_t const * p_cdc_acm = cdc_acm_get(p_inst); - - APP_USBD_CLASS_DESCRIPTOR_BEGIN(p_ctx, p_buff, max_size); - - /* INTERFACE ASSOCIATION DESCRIPTOR */ - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x08); // bLength - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_DESCRIPTOR_INTERFACE_ASSOCIATION); // bDescriptorType = Interface Association - APP_USBD_CLASS_DESCRIPTOR_WRITE(p_cdc_acm->specific.inst.comm_interface); // bFirstInterface - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x02); // bInterfaceCount - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_COMM_CLASS); // bFunctionClass - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_SUBCLASS_ACM); // bFunctionSubClass - APP_USBD_CLASS_DESCRIPTOR_WRITE(p_cdc_acm->specific.inst.protocol); // bFunctionProtocol - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x00); // iFunction - - static uint8_t i = 0; - - for (i = 0; i < ifaces; i++) - { - /* INTERFACE DESCRIPTOR */ - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x09); // bLength - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_DESCRIPTOR_INTERFACE); // bDescriptorType = Interface - - static app_usbd_class_iface_conf_t const * p_cur_iface = NULL; - p_cur_iface = app_usbd_class_iface_get(p_inst, i); - - APP_USBD_CLASS_DESCRIPTOR_WRITE(app_usbd_class_iface_number_get(p_cur_iface)); // bInterfaceNumber - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x00); // bAlternateSetting - APP_USBD_CLASS_DESCRIPTOR_WRITE(app_usbd_class_iface_ep_count_get(p_cur_iface)); // bNumEndpoints - - if (p_cdc_acm->specific.inst.comm_interface == app_usbd_class_iface_number_get(p_cur_iface)) - { - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_COMM_CLASS); // bInterfaceClass = CDC COMM - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_SUBCLASS_ACM); // bInterfaceSubclass - APP_USBD_CLASS_DESCRIPTOR_WRITE(p_cdc_acm->specific.inst.protocol); // bInterfaceProtocol - } - else if (p_cdc_acm->specific.inst.data_interface == - app_usbd_class_iface_number_get(p_cur_iface)) - { - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_DATA_CLASS); // bInterfaceClass = CDC DATA - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x00); // bInterfaceSubclass - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x00); // bInterfaceProtocol - } - else - { - ASSERT(0); - } - - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x00); // iInterface - - if (p_cdc_acm->specific.inst.comm_interface == app_usbd_class_iface_number_get(p_cur_iface)) - { - /* HEADER DESCRIPTOR */ - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x05); // bLength - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_CS_INTERFACE); // bDescriptorType = Class Specific Interface - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_SCS_HEADER); // bDescriptorSubtype = Header Functional Descriptor - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x10); // bcdCDC LSB - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x01); // bcdCDC MSB - - /* CALL MANAGEMENT DESCRIPTOR */ - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x05); // bLength - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_CS_INTERFACE); // bDescriptorType = Class Specific Interface - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_SCS_CALL_MGMT); // bDescriptorSubtype = Call Management Functional Descriptor - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x03); // bmCapabilities - APP_USBD_CLASS_DESCRIPTOR_WRITE(p_cdc_acm->specific.inst.data_interface); // bDataInterface - - /* ABSTRACT CONTROL MANAGEMENT DESCRIPTOR */ - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x04); // bLength - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_CS_INTERFACE); // bDescriptorType = Class Specific Interface - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_SCS_ACM); // bDescriptorSubtype = Abstract Control Management Functional Descriptor - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x02); // bmCapabilities - - /* UNION DESCRIPTOR */ - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x05); - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_CS_INTERFACE); // bDescriptorType = Class Specific Interface - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_CDC_SCS_UNION); // bDescriptorSubtype = Union Functional Descriptor - APP_USBD_CLASS_DESCRIPTOR_WRITE(p_cdc_acm->specific.inst.comm_interface); // bControlInterface - APP_USBD_CLASS_DESCRIPTOR_WRITE(p_cdc_acm->specific.inst.data_interface); // bSubordinateInterface - } - else if (p_cdc_acm->specific.inst.data_interface == - app_usbd_class_iface_number_get(p_cur_iface)) - { - ; - } - else - { - ASSERT(0); - } - - /* ENDPOINT DESCRIPTORS */ - static uint8_t endpoints = 0; - endpoints = app_usbd_class_iface_ep_count_get(p_cur_iface); - - static uint8_t j = 0; - - for (j = 0; j < endpoints; j++) - { - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x07); // bLength - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_DESCRIPTOR_ENDPOINT); // bDescriptorType = Endpoint - - static app_usbd_class_ep_conf_t const * p_cur_ep = NULL; - p_cur_ep = app_usbd_class_iface_ep_get(p_cur_iface, j); - APP_USBD_CLASS_DESCRIPTOR_WRITE(app_usbd_class_ep_address_get(p_cur_ep)); // bEndpointAddress - - if (p_cdc_acm->specific.inst.comm_interface == - app_usbd_class_iface_number_get(p_cur_iface)) - { - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_INTERRUPT); // bmAttributes - } - else if (p_cdc_acm->specific.inst.data_interface == - app_usbd_class_iface_number_get(p_cur_iface)) - { - APP_USBD_CLASS_DESCRIPTOR_WRITE(APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_BULK); // bmAttributes - } - else - { - ASSERT(0); - } - - APP_USBD_CLASS_DESCRIPTOR_WRITE(LSB_16(NRF_DRV_USBD_EPSIZE)); // wMaxPacketSize LSB - APP_USBD_CLASS_DESCRIPTOR_WRITE(MSB_16(NRF_DRV_USBD_EPSIZE)); // wMaxPacketSize MSB - - if (p_cdc_acm->specific.inst.comm_interface == - app_usbd_class_iface_number_get(p_cur_iface)) - { - APP_USBD_CLASS_DESCRIPTOR_WRITE(p_cdc_acm->specific.inst.p_ep_interval[0]); // bInterval - } - else if (p_cdc_acm->specific.inst.data_interface == - app_usbd_class_iface_number_get(p_cur_iface)) - { - APP_USBD_CLASS_DESCRIPTOR_WRITE(0x00); // bInterval - } - else - { - ASSERT(0); - } - - } - - } - - APP_USBD_CLASS_DESCRIPTOR_END(); -} - -/** - * @brief Public cdc_acm class interface. - * - */ -const app_usbd_class_methods_t app_usbd_cdc_acm_class_methods = { - .event_handler = cdc_acm_event_handler, - .feed_descriptors = cdc_acm_feed_descriptors, -}; - -/** @} */ - -ret_code_t app_usbd_cdc_acm_write(app_usbd_cdc_acm_t const * p_cdc_acm, - const void * p_buf, - size_t length) -{ - app_usbd_class_inst_t const * p_inst = app_usbd_cdc_acm_class_inst_get(p_cdc_acm); - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - bool dtr_state = (p_cdc_acm_ctx->line_state & APP_USBD_CDC_ACM_LINE_STATE_DTR) ? - true : false; - if (!dtr_state) - { - /*Port is not opened*/ - return NRF_ERROR_INVALID_STATE; - } - - nrf_drv_usbd_ep_t ep = data_ep_in_addr_get(p_inst); - - if (APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE && ((length % NRF_DRV_USBD_EPSIZE) == 0)) - { - NRF_DRV_USBD_TRANSFER_IN_ZLP(transfer, p_buf, length); - return app_usbd_ep_transfer(ep, &transfer); - } - else - { - NRF_DRV_USBD_TRANSFER_IN(transfer, p_buf, length); - return app_usbd_ep_transfer(ep, &transfer); - } -} - -size_t app_usbd_cdc_acm_rx_size(app_usbd_cdc_acm_t const * p_cdc_acm) -{ - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - return p_cdc_acm_ctx->last_read; -} - -size_t app_usbd_cdc_acm_bytes_stored(app_usbd_cdc_acm_t const * p_cdc_acm) -{ - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - return p_cdc_acm_ctx->bytes_left; -} - -ret_code_t app_usbd_cdc_acm_read(app_usbd_cdc_acm_t const * p_cdc_acm, - void * p_buf, - size_t length) -{ - ASSERT(p_buf != NULL); - ret_code_t ret; - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - if (0U == (p_cdc_acm_ctx->line_state & APP_USBD_CDC_ACM_LINE_STATE_DTR)) - { - /*Port is not opened*/ - return NRF_ERROR_INVALID_STATE; - } - -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE == 0) - CRITICAL_REGION_ENTER(); -#endif // (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE == 0) - - if (p_cdc_acm_ctx->rx_transfer[0].p_buf == NULL) - { - if (p_cdc_acm_ctx->bytes_left >= length) - { - memcpy(p_buf, p_cdc_acm_ctx->p_copy_pos, length); - p_cdc_acm_ctx->bytes_left -= length; - p_cdc_acm_ctx->p_copy_pos += length; - p_cdc_acm_ctx->last_read = length; - ret = NRF_SUCCESS; - } - else - { - p_cdc_acm_ctx->rx_transfer[0].p_buf = p_buf; - p_cdc_acm_ctx->rx_transfer[0].read_left = length; - nrf_drv_usbd_ep_t ep = data_ep_out_addr_get(app_usbd_cdc_acm_class_inst_get(p_cdc_acm)); - nrf_drv_usbd_handler_desc_t const handler_desc = { - .handler.consumer = cdc_acm_consumer, - .p_context = p_cdc_acm_ctx - }; - - if (p_cdc_acm_ctx->bytes_left > 0) - { - memcpy(p_cdc_acm_ctx->rx_transfer[0].p_buf, - p_cdc_acm_ctx->p_copy_pos, - p_cdc_acm_ctx->bytes_left); - p_cdc_acm_ctx->rx_transfer[0].read_left -= p_cdc_acm_ctx->bytes_left; - p_cdc_acm_ctx->rx_transfer[0].p_buf += p_cdc_acm_ctx->bytes_left; - p_cdc_acm_ctx->bytes_read = p_cdc_acm_ctx->bytes_left; - p_cdc_acm_ctx->bytes_left = 0; - - } - ret = app_usbd_ep_handled_transfer(ep, &handler_desc); - if (ret == NRF_SUCCESS) - { - ret = NRF_ERROR_IO_PENDING; - } - } - } - else if (p_cdc_acm_ctx->rx_transfer[1].p_buf == NULL) - { - p_cdc_acm_ctx->rx_transfer[1].p_buf = p_buf; - p_cdc_acm_ctx->rx_transfer[1].read_left = length; - ret = NRF_ERROR_IO_PENDING; - } - else - { - ret = NRF_ERROR_BUSY; - } -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE == 0) - CRITICAL_REGION_EXIT(); -#endif // (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE == 0) - - return ret; -} - -ret_code_t app_usbd_cdc_acm_read_any(app_usbd_cdc_acm_t const * p_cdc_acm, - void * p_buf, - size_t length) -{ - ASSERT(p_buf != NULL); - ret_code_t ret; - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - if (0U == (p_cdc_acm_ctx->line_state & APP_USBD_CDC_ACM_LINE_STATE_DTR)) - { - /*Port is not opened*/ - return NRF_ERROR_INVALID_STATE; - } - -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE == 0) - CRITICAL_REGION_ENTER(); -#endif // (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE == 0) - if (p_cdc_acm_ctx->bytes_left > 0) - { - size_t to_copy = MIN(length, p_cdc_acm_ctx->bytes_left); - memcpy(p_buf, p_cdc_acm_ctx->p_copy_pos, to_copy); - p_cdc_acm_ctx->bytes_left -= to_copy; - p_cdc_acm_ctx->p_copy_pos += to_copy; - p_cdc_acm_ctx->last_read = to_copy; - ret = NRF_SUCCESS; - } - else - { - if (p_cdc_acm_ctx->rx_transfer[0].p_buf == NULL) - { - p_cdc_acm_ctx->rx_transfer[0].p_buf = p_buf; - p_cdc_acm_ctx->rx_transfer[0].read_left = length; - nrf_drv_usbd_ep_t ep = data_ep_out_addr_get(app_usbd_cdc_acm_class_inst_get(p_cdc_acm)); - nrf_drv_usbd_handler_desc_t const handler_desc = { - .handler.consumer = cdc_acm_single_shoot_consumer, - .p_context = p_cdc_acm_ctx - }; - - ret = app_usbd_ep_handled_transfer(ep, &handler_desc); - if (ret == NRF_SUCCESS) - { - ret = NRF_ERROR_IO_PENDING; - } - } - else - { - ret = NRF_ERROR_BUSY; - } - } - -#if (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE == 0) - CRITICAL_REGION_EXIT(); -#endif // (APP_USBD_CONFIG_EVENT_QUEUE_ENABLE == 0) - - return ret; -} - -static ret_code_t cdc_acm_serial_state_notify(app_usbd_cdc_acm_t const * p_cdc_acm) -{ - app_usbd_class_inst_t const * p_inst = app_usbd_cdc_acm_class_inst_get(p_cdc_acm); - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - nrf_drv_usbd_ep_t ep = comm_ep_in_addr_get(p_inst); - - NRF_DRV_USBD_TRANSFER_OUT(transfer, - &p_cdc_acm_ctx->request.payload, - sizeof(app_usbd_cdc_acm_notify_t)); - return app_usbd_ep_transfer(ep, &transfer); -} - -ret_code_t app_usbd_cdc_acm_serial_state_notify(app_usbd_cdc_acm_t const * p_cdc_acm, - app_usbd_cdc_acm_serial_state_t serial_state, - bool value) -{ - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - ret_code_t ret; - CRITICAL_REGION_ENTER(); - ret = NRF_SUCCESS; - switch (serial_state) - { - case APP_USBD_CDC_ACM_SERIAL_STATE_DCD: - case APP_USBD_CDC_ACM_SERIAL_STATE_DSR: - case APP_USBD_CDC_ACM_SERIAL_STATE_BREAK: - case APP_USBD_CDC_ACM_SERIAL_STATE_RING: - case APP_USBD_CDC_ACM_SERIAL_STATE_FRAMING: - case APP_USBD_CDC_ACM_SERIAL_STATE_PARITY: - case APP_USBD_CDC_ACM_SERIAL_STATE_OVERRUN: - - if (value) - { - p_cdc_acm_ctx->serial_state |= serial_state; - } - else - { - p_cdc_acm_ctx->serial_state &= ~serial_state; - } - - break; - default: - ret = NRF_ERROR_NOT_SUPPORTED; - break; - } - - if (ret == NRF_SUCCESS) - { - app_usbd_cdc_acm_notify_t * notify = &p_cdc_acm_ctx->request.payload.notify; - notify->cdc_notify.bmRequestType = app_usbd_setup_req_val(APP_USBD_SETUP_REQREC_INTERFACE, - APP_USBD_SETUP_REQTYPE_CLASS, - APP_USBD_SETUP_REQDIR_IN); - notify->cdc_notify.bRequest = APP_USBD_CDC_NOTIF_SERIAL_STATE; - notify->cdc_notify.wValue = 0; - notify->cdc_notify.wIndex = 0; - notify->cdc_notify.wLength = sizeof(notify->serial_state); - - notify->serial_state = p_cdc_acm_ctx->serial_state; - - ret = cdc_acm_serial_state_notify(p_cdc_acm); - } - CRITICAL_REGION_EXIT(); - - return ret; -} - -ret_code_t app_usbd_cdc_acm_line_state_get(app_usbd_cdc_acm_t const * p_cdc_acm, - app_usbd_cdc_acm_line_state_t line_state, - uint32_t * value) -{ - app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = cdc_acm_ctx_get(p_cdc_acm); - - ret_code_t ret; - CRITICAL_REGION_ENTER(); - ret = NRF_SUCCESS; - switch (line_state) - { - case APP_USBD_CDC_ACM_LINE_STATE_DTR: - case APP_USBD_CDC_ACM_LINE_STATE_RTS: - *value = (p_cdc_acm_ctx->line_state & line_state) != 0; - break; - default: - ret = NRF_ERROR_NOT_SUPPORTED; - break; - } - CRITICAL_REGION_EXIT(); - - return ret; -} - -#endif //NRF_MODULE_ENABLED(APP_USBD_CDC_ACM) diff --git a/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.h b/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.h deleted file mode 100644 index af81dc43b..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm.h +++ /dev/null @@ -1,362 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef APP_USBD_CDC_ACM_H__ -#define APP_USBD_CDC_ACM_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#include "nrf_drv_usbd.h" -#include "app_usbd_class_base.h" -#include "app_usbd.h" -#include "app_usbd_core.h" -#include "app_usbd_descriptor.h" - -#include "app_usbd_cdc_desc.h" -#include "app_usbd_cdc_types.h" -#include "app_usbd_cdc_acm_internal.h" - -/** - * @defgroup app_usbd_cdc_acm USB CDC ACM class - * @ingroup app_usbd - * - * @brief @tagAPI52840 Module with types, definitions and API used by CDC ACM class. - * - * @details References: - * - "Universal Serial Bus Class Definitions for Communications Devices" - * Revision 1.2, November 3, 2010 - * - "Universal Serial Bus Communications Class Subclass Specification for PSTN Devices" - * Revision 1.2, February 9, 2007 - * - * @{ - */ - -#ifdef DOXYGEN -/** - * @brief CDC ACM class instance type. - * - * @ref APP_USBD_CLASS_TYPEDEF - */ -typedef struct { } app_usbd_cdc_acm_t; -#else -/*lint -save -e10 -e26 -e123 -e505 */ -APP_USBD_CLASS_TYPEDEF(app_usbd_cdc_acm, \ - APP_USBD_CDC_ACM_CONFIG(0, 0, 0, 0, 0), \ - APP_USBD_CDC_ACM_INSTANCE_SPECIFIC_DEC, \ - APP_USBD_CDC_ACM_DATA_SPECIFIC_DEC \ -); -/*lint -restore*/ -#endif - - -/*lint -save -e407 */ - -/** - * @brief Events passed to user event handler. - * - * @note Example prototype of user event handler: - * - * @code - void cdc_acm_user_ev_handler(app_usbd_class_inst_t const * p_inst, - app_usbd_cdc_acm_user_event_t event); - * @endcode - */ -typedef enum app_usbd_cdc_acm_user_event_e { - APP_USBD_CDC_ACM_USER_EVT_RX_DONE, /**< User event RX_DONE. */ - APP_USBD_CDC_ACM_USER_EVT_TX_DONE, /**< User event TX_DONE. */ - - APP_USBD_CDC_ACM_USER_EVT_PORT_OPEN, /**< User event PORT_OPEN. */ - APP_USBD_CDC_ACM_USER_EVT_PORT_CLOSE, /**< User event PORT_CLOSE. */ -} app_usbd_cdc_acm_user_event_t; - -/*lint -restore*/ - -/** - * @brief Default CDC ACM descriptors. - * - * @param comm_interface COMM interface number. - * @param comm_epin COMM interface IN endpoint. - * @param data_interface DATA interface number. - * @param data_epin DATA interface IN endpoint. - * @param data_epout DATA interface OUT endpoint. - */ -#define APP_USBD_CDC_ACM_DEFAULT_DESC(comm_interface, \ - comm_epin, \ - data_interface, \ - data_epin, \ - data_epout) \ - APP_USBD_CDC_IAD_DSC(comm_interface, \ - APP_USBD_CDC_SUBCLASS_ACM, \ - APP_USBD_CDC_COMM_PROTOCOL_AT_V250) \ - APP_USBD_CDC_COMM_INTERFACE_DSC(comm_interface, \ - APP_USBD_CDC_SUBCLASS_ACM, \ - APP_USBD_CDC_COMM_PROTOCOL_AT_V250) \ - APP_USBD_CDC_HEADER_DSC(0x0110) \ - APP_USBD_CDC_CALL_MGMT_DSC(0x03, data_interface) \ - APP_USBD_CDC_ACM_DSC(0x02) \ - APP_USBD_CDC_UNION_DSC(comm_interface, data_interface) \ - APP_USBD_CDC_COM_EP_DSC(comm_epin, NRF_DRV_USBD_EPSIZE) \ - APP_USBD_CDC_DATA_INTERFACE_DSC(data_interface, 0, 0) \ - APP_USBD_CDC_DATA_EP_DSC(data_epin, data_epout, NRF_DRV_USBD_EPSIZE) - -/** - * @brief Global definition of app_usbd_cdc_acm_t class instance. - * - * @param instance_name Name of global instance. - * @param user_ev_handler User event handler (optional). - * @param comm_ifc Interface number of cdc_acm control. - * @param data_ifc Interface number of cdc_acm DATA. - * @param comm_ein COMM subclass IN endpoint. - * @param data_ein DATA subclass IN endpoint. - * @param data_eout DATA subclass OUT endpoint. - * @param cdc_protocol CDC protocol @ref app_usbd_cdc_comm_protocol_t - * - * @note This macro is just simplified version of @ref APP_USBD_CDC_ACM_GLOBAL_DEF_INTERNAL. - * - */ -#define APP_USBD_CDC_ACM_GLOBAL_DEF(instance_name, \ - user_ev_handler, \ - comm_ifc, \ - data_ifc, \ - comm_ein, \ - data_ein, \ - data_eout, \ - cdc_protocol) \ - APP_USBD_CDC_ACM_GLOBAL_DEF_INTERNAL(instance_name, \ - user_ev_handler, \ - comm_ifc, \ - data_ifc, \ - comm_ein, \ - data_ein, \ - data_eout, \ - cdc_protocol) \ - -/** - * @brief Helper function to get class instance from CDC ACM class. - * - * @param[in] p_cdc_acm CDC ACM class instance (defined by @ref APP_USBD_CDC_ACM_GLOBAL_DEF). - * - * @return Base class instance. - */ -static inline app_usbd_class_inst_t const * -app_usbd_cdc_acm_class_inst_get(app_usbd_cdc_acm_t const * p_cdc_acm) -{ - return &p_cdc_acm->base; -} - -/** - * @brief Helper function to get cdc_acm specific request from cdc_acm class. - * - * @param[in] p_cdc_acm CDC ACM class instance (defined by @ref APP_USBD_CDC_ACM_GLOBAL_DEF). - * - * @return CDC ACM class specific request. - */ -static inline app_usbd_cdc_acm_req_t * -app_usbd_cdc_acm_class_request_get(app_usbd_cdc_acm_t const * p_cdc_acm) -{ - return &p_cdc_acm->specific.p_data->ctx.request; -} - -/** - * @brief Helper function to get cdc_acm from base class instance. - * - * @param[in] p_inst Base class instance. - * - * @return CDC ACM class handle. - */ -static inline app_usbd_cdc_acm_t const * -app_usbd_cdc_acm_class_get(app_usbd_class_inst_t const * p_inst) -{ - return (app_usbd_cdc_acm_t const *)p_inst; -} - - -/** - * @brief Writes data to CDC ACM serial port. - * - * This is asynchronous call. User should wait for @ref APP_USBD_CDC_ACM_USER_EVT_TX_DONE event - * to be sure that all data has been sent and input buffer could be accessed again. - * - * @param[in] p_cdc_acm CDC ACM class instance (defined by @ref APP_USBD_CDC_ACM_GLOBAL_DEF). - * @param[in] p_buf Input buffer. - * @param[in] length Input buffer length. - * - * @return Standard error code. - */ -ret_code_t app_usbd_cdc_acm_write(app_usbd_cdc_acm_t const * p_cdc_acm, - const void * p_buf, - size_t length); - -/** - * @brief Returns the amount of data that was read. - * - * This function should be used on @ref APP_USBD_CDC_ACM_USER_EVT_RX_DONE event to get - * information how many bytes have been transfered into user buffer. - * - * @param[in] p_cdc_acm CDC ACM class instance (defined by @ref APP_USBD_CDC_ACM_GLOBAL_DEF). - * - * @return Amount of data transfered. - */ -size_t app_usbd_cdc_acm_rx_size(app_usbd_cdc_acm_t const * p_cdc_acm); - -/** - * @brief Returns the amount of data that was stored into internal buffer - * - * This function should be used on @ref APP_USBD_CDC_ACM_USER_EVT_RX_DONE event to get - * information how many bytes are waiting in internal buffer. - * - * @param[in] p_cdc_acm CDC ACM class instance (defined by @ref APP_USBD_CDC_ACM_GLOBAL_DEF). - * - * @return Amount of data waiting. - */ -size_t app_usbd_cdc_acm_bytes_stored(app_usbd_cdc_acm_t const * p_cdc_acm); - -/** - * @brief Reads data from CDC ACM serial port. - * - * This function uses internal buffer and double buffering for continuous transmission. - * - * If there is enough data in internal buffer to fill user buffer, NRF_SUCCESS is - * returned and data is immediately available in the user buffer. - * - * If not, up to two user buffers can be scheduled, function returns NRF_ERROR_IO_PENDING - * when first buffer is filled and @ref APP_USBD_CDC_ACM_USER_EVT_RX_DONE event is generated. - * - * @sa app_usbd_cdc_acm_read_any - * @sa app_usbd_cdc_acm_rx_size - * - * @param[in] p_cdc_acm CDC ACM class instance (defined by @ref APP_USBD_CDC_ACM_GLOBAL_DEF). - * @param[out] p_buf Output buffer. - * @param[in] length Number of bytes to read. - * - * @retval NRF_SUCCESS Data is stored into user buffer. - * @retval NRF_ERROR_IO_PENDING Awaiting transmission, when data is stored into user buffer, - * @ref APP_USBD_CDC_ACM_USER_EVT_RX_DONE event will be raised. - * @retval NRF_ERROR_BUSY There are already 2 buffers queued for transfers. - * @retval other Standard error code. - */ -ret_code_t app_usbd_cdc_acm_read(app_usbd_cdc_acm_t const * p_cdc_acm, - void * p_buf, - size_t length); - -/** - * @brief Read any data from CDC ACM port up to given buffer size - * - * This function is very similar to the @ref app_usbd_cdc_acm_read but it returns - * data as quick as any data is available, even if the given buffer was not totally full. - * - * @note This function cannot use double buffering. - * @note To check the number of bytes really read use @ref app_usbd_cdc_acm_rx_size - * function. - * - * @sa app_usbd_cdc_acm_read - * @sa app_usbd_cdc_acm_rx_size - * - * @param p_cdc_acm CDC ACM class instance (defined by @ref APP_USBD_CDC_ACM_GLOBAL_DEF). - * @param[out] p_buf Output buffer. - * @param[in] length Maximum number of bytes to read. - * - * @retval NRF_SUCCESS Data is stored into user buffer. - * @retval NRF_ERROR_IO_PENDING Awaiting transmission, when data is stored into user buffer, - * @ref APP_USBD_CDC_ACM_USER_EVT_RX_DONE event will be raised. - * @retval NRF_ERROR_BUSY There is already buffer set for a transfer. - * @retval other Standard error code. - */ -ret_code_t app_usbd_cdc_acm_read_any(app_usbd_cdc_acm_t const * p_cdc_acm, - void * p_buf, - size_t length); - -/** - * @brief Serial state notifications. - * */ -typedef enum { - APP_USBD_CDC_ACM_SERIAL_STATE_DCD = (1u << 0), /**< Notification bit DCD. */ - APP_USBD_CDC_ACM_SERIAL_STATE_DSR = (1u << 1), /**< Notification bit DSR. */ - APP_USBD_CDC_ACM_SERIAL_STATE_BREAK = (1u << 2), /**< Notification bit BREAK. */ - APP_USBD_CDC_ACM_SERIAL_STATE_RING = (1u << 3), /**< Notification bit RING. */ - APP_USBD_CDC_ACM_SERIAL_STATE_FRAMING = (1u << 4), /**< Notification bit FRAMING.*/ - APP_USBD_CDC_ACM_SERIAL_STATE_PARITY = (1u << 5), /**< Notification bit PARITY. */ - APP_USBD_CDC_ACM_SERIAL_STATE_OVERRUN = (1u << 6), /**< Notification bit OVERRUN.*/ -} app_usbd_cdc_acm_serial_state_t; - -/** - * @brief Serial line state. - */ -typedef enum { - APP_USBD_CDC_ACM_LINE_STATE_DTR = (1u << 0), /**< Line state bit DTR.*/ - APP_USBD_CDC_ACM_LINE_STATE_RTS = (1u << 1), /**< Line state bit RTS.*/ -} app_usbd_cdc_acm_line_state_t; - -/** - * @brief Serial state notification via IN interrupt endpoint. - * - * @param[in] p_cdc_acm CDC ACM class instance (defined by @ref APP_USBD_CDC_ACM_GLOBAL_DEF). - * @param[in] serial_state Serial state notification type. - * @param[in] value Serial state value. - * - * @return Standard error code. - */ -ret_code_t app_usbd_cdc_acm_serial_state_notify(app_usbd_cdc_acm_t const * p_cdc_acm, - app_usbd_cdc_acm_serial_state_t serial_state, - bool value); - -/** - * @brief Control line value get. - * - * @param[in] p_cdc_acm CDC ACM class instance (defined by @ref APP_USBD_CDC_ACM_GLOBAL_DEF). - * @param[in] line_state Line control value type. - * @param[out] value Line control value. - * - * @return Standard error code. - */ -ret_code_t app_usbd_cdc_acm_line_state_get(app_usbd_cdc_acm_t const * p_cdc_acm, - app_usbd_cdc_acm_line_state_t line_state, - uint32_t * value); - -/** @} */ -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_CDC_ACM_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm_internal.h b/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm_internal.h deleted file mode 100644 index 8b7844df6..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/class/cdc/acm/app_usbd_cdc_acm_internal.h +++ /dev/null @@ -1,287 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef APP_USBD_CDC_ACM_INTERNAL_H__ -#define APP_USBD_CDC_ACM_INTERNAL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - - -#include "app_util.h" - -/** - * @defgroup app_usbd_cdc_acm_internal USB CDC ACM internals - * @ingroup app_usbd_cdc_acm - * @brief @tagAPI52840 Internals of the USB ACM class implementation. - * @{ - */ - -/** - * @brief Forward declaration of type defined by @ref APP_USBD_CLASS_TYPEDEF in cdc_acm class. - * - */ -APP_USBD_CLASS_FORWARD(app_usbd_cdc_acm); - -/*lint -save -e165*/ -/** - * @brief Forward declaration of @ref app_usbd_cdc_acm_user_event_e. - * - */ -enum app_usbd_cdc_acm_user_event_e; - -/*lint -restore*/ - -/** - * @brief User event handler. - * - * @param[in] p_inst Class instance. - * @param[in] event User event. - * - */ -typedef void (*app_usbd_cdc_acm_user_ev_handler_t)(app_usbd_class_inst_t const * p_inst, - enum app_usbd_cdc_acm_user_event_e event); - -/** - * @brief CDC ACM class part of class instance data. - */ -typedef struct { - uint8_t comm_interface; //!< Interface number of cdc_acm control. - uint8_t comm_epin; //!< COMM subclass IN endpoint. - uint8_t data_interface; //!< Interface number of cdc_acm DATA. - uint8_t data_epout; //!< DATA subclass OUT endpoint. - uint8_t data_epin; //!< DATA subclass IN endpoint. - - app_usbd_cdc_comm_protocol_t protocol; //!< User specified CDC protocol. - - app_usbd_cdc_acm_user_ev_handler_t user_ev_handler; //!< User event handler. - - uint8_t * p_ep_interval; //!< Endpoint intervals. -} app_usbd_cdc_acm_inst_t; - - -/** - * @brief CDC ACM serial state class notify. - */ -typedef struct { - app_usbd_cdc_notify_t cdc_notify; //!< CDC notify. - uint16_t serial_state; //!< Serial port state. -} app_usbd_cdc_acm_notify_t; - -/** - * @brief CDC ACM class specific request handled via control endpoint. - */ -typedef struct { - uint8_t type; //!< Request type. - uint8_t len; //!< Request length. - - union { - app_usbd_cdc_line_coding_t line_coding; //!< CDC ACM current line coding. - app_usbd_cdc_acm_notify_t notify; //!< CDC ACM class notify. - } payload; -} app_usbd_cdc_acm_req_t; - -/** - * @brief CDC ACM rx transfer buffer. - */ -typedef struct { - uint8_t * p_buf; //!< User buffer pointer. - size_t read_left; //!< Bytes left to read into buffer. -} cdc_rx_buffer_t; - -/** - * @brief CDC ACM class context. - */ -typedef struct { - app_usbd_cdc_acm_req_t request; //!< CDC ACM class request. - app_usbd_cdc_line_coding_t line_coding; //!< CDC ACM current line coding. - - uint16_t line_state; //!< CDC ACM line state bitmap, DTE side. - uint16_t serial_state; //!< CDC ACM serial state bitmap, DCE side. - - cdc_rx_buffer_t rx_transfer[2]; //!< User receive transfers. - - uint8_t internal_rx_buf[NRF_DRV_USBD_EPSIZE]; //!< Internal receive buffer. - uint8_t * p_copy_pos; //!< Current copy position from internal buffer. - - size_t bytes_left; //!< Bytes left in internal buffer to copy. - size_t bytes_read; //!< Bytes currently written to user buffer. - size_t last_read; //!< Bytes read in last transfer. - size_t cur_read; //!< Bytes currently read to internal buffer. -} app_usbd_cdc_acm_ctx_t; - -/** - * @brief Default interval value for comm endpoint IN - * - */ -#define APP_USBD_CDC_ACM_DEFAULT_INTERVAL 0x10 - -/** - * @brief CDC ACM class configuration macro. - * - * Used by @ref APP_USBD_CDC_ACM_GLOBAL_DEF - * - * @param iface_comm Interface number of cdc_acm control. - * @param epin_comm COMM subclass IN endpoint. - * @param iface_data Interface number of cdc_acm DATA. - * @param epin_data DATA subclass IN endpoint. - * @param epout_data DATA subclass OUT endpoint. - * - */ -#define APP_USBD_CDC_ACM_CONFIG(iface_comm, epin_comm, iface_data, epin_data, epout_data) \ - ((iface_comm, epin_comm), \ - (iface_data, epin_data, epout_data)) - - -/** - * @brief Specific class constant data for cdc_acm class. - * - * @ref app_usbd_cdc_acm_inst_t - */ -#define APP_USBD_CDC_ACM_INSTANCE_SPECIFIC_DEC app_usbd_cdc_acm_inst_t inst; - - -/** - * @brief Configures cdc_acm class instance. - * - * @param user_event_handler User event handler. - * @param comm_ifc Interface number of cdc_acm control. - * @param comm_ein COMM subclass IN endpoint. - * @param data_ifc Interface number of cdc_acm DATA. - * @param data_ein DATA subclass IN endpoint. - * @param data_eout DATA subclass OUT endpoint. - * @param cdc_protocol CDC protocol. - * @param ep_list List of endpoints and intervals - */ -#define APP_USBD_CDC_ACM_INST_CONFIG(user_event_handler, \ - comm_ifc, \ - comm_ein, \ - data_ifc, \ - data_ein, \ - data_eout, \ - cdc_protocol, \ - ep_list) \ - .inst = { \ - .user_ev_handler = user_event_handler, \ - .comm_interface = comm_ifc, \ - .comm_epin = comm_ifc, \ - .data_interface = data_ifc, \ - .data_epin = data_ein, \ - .data_epout = data_eout, \ - .protocol = cdc_protocol, \ - .p_ep_interval = ep_list \ - } - -/** - * @brief Specific class data for cdc_acm class. - * - * @ref app_usbd_cdc_acm_ctx_t - */ -#define APP_USBD_CDC_ACM_DATA_SPECIFIC_DEC app_usbd_cdc_acm_ctx_t ctx; - - -/** - * @brief CDC ACM class descriptors config macro. - * - * @param interface_number Interface number. - * @param ... Extracted endpoint list. - */ -#define APP_USBD_CDC_ACM_DSC_CONFIG(interface_number, ...) { \ - APP_USBD_CDC_ACM_INTERFACE_DSC(interface_number, \ - 0, \ - 0, \ - APP_USBD_CDC_ACM_SUBCLASS_CDC_ACMCONTROL) \ -} - -/** - * @brief Public cdc_acm class interface. - * - */ -extern const app_usbd_class_methods_t app_usbd_cdc_acm_class_methods; - -/** - * @brief Global definition of @ref app_usbd_cdc_acm_t class. - * - * @param instance_name Name of global instance. - * @param user_ev_handler User event handler. - * @param comm_ifc Interface number of cdc_acm control. - * @param data_ifc Interface number of cdc_acm DATA. - * @param comm_ein COMM subclass IN endpoint. - * @param data_ein DATA subclass IN endpoint. - * @param data_eout DATA subclass OUT endpoint. - * @param cdc_protocol CDC protocol @ref app_usbd_cdc_comm_protocol_t - */ -/*lint -save -emacro(26 64 123 505 572 651, APP_USBD_CDC_ACM_GLOBAL_DEF_INTERNAL)*/ -#define APP_USBD_CDC_ACM_GLOBAL_DEF_INTERNAL(instance_name, \ - user_ev_handler, \ - comm_ifc, \ - data_ifc, \ - comm_ein, \ - data_ein, \ - data_eout, \ - cdc_protocol) \ - static uint8_t CONCAT_2(instance_name, _ep) = { \ - (APP_USBD_EXTRACT_INTERVAL_FLAG(comm_ein) ? APP_USBD_EXTRACT_INTERVAL_VALUE(comm_ein) \ - : APP_USBD_CDC_ACM_DEFAULT_INTERVAL)}; \ - APP_USBD_CLASS_INST_GLOBAL_DEF( \ - instance_name, \ - app_usbd_cdc_acm, \ - &app_usbd_cdc_acm_class_methods, \ - APP_USBD_CDC_ACM_CONFIG(comm_ifc, comm_ein, data_ifc, data_ein, data_eout), \ - (APP_USBD_CDC_ACM_INST_CONFIG(user_ev_handler, \ - comm_ifc, \ - comm_ein, \ - data_ifc, \ - data_ein, \ - data_eout, \ - cdc_protocol, \ - &CONCAT_2(instance_name, _ep))) \ - ) -/*lint -restore*/ - -/** @} */ - - - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_CDC_ACM_INTERNAL_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_desc.h b/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_desc.h deleted file mode 100644 index c6c8375a6..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_desc.h +++ /dev/null @@ -1,208 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef APP_USBD_CDC_DESC_H__ -#define APP_USBD_CDC_DESC_H__ - -#include -#include - -#include "app_usbd_descriptor.h" -#include "app_usbd_cdc_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @defgroup app_usbd_cdc_desc CDC class descriptors - * @brief @tagAPI52840 Descriptors used in the USB CDC class implementation. - * @ingroup app_usbd_cdc_acm - * - * A group of macros used to initialize CDC descriptors - * @{ - */ - -/** - * @brief Initializer of IAD descriptor for CDC class. - * - * @param interface_number Interface number. - * @param subclass Subclass, @ref app_usbd_cdc_subclass_t. - * @param protocol Protocol, @ref app_usbd_cdc_comm_protocol_t. - */ -#define APP_USBD_CDC_IAD_DSC(interface_number, subclass, protocol) \ - /*.bLength = */ sizeof(app_usbd_descriptor_iad_t), \ - /*.bDescriptorType = */ APP_USBD_DESCRIPTOR_INTERFACE_ASSOCIATION, \ - /*.bFirstInterface = */ interface_number, \ - /*.bInterfaceCount = */ 2, \ - /*.bFunctionClass = */ APP_USBD_CDC_COMM_CLASS, \ - /*.bFunctionSubClass = */ subclass, \ - /*.bFunctionProtocol = */ protocol, \ - /*.iFunction = */ 0, \ - -/** - * @brief Initializer of interface descriptor for CDC COMM class. - * - * @param interface_number Interface number. - * @param subclass Subclass, @ref app_usbd_cdc_subclass_t. - * @param protocol Protocol, @ref app_usbd_cdc_comm_protocol_t. - */ -#define APP_USBD_CDC_COMM_INTERFACE_DSC(interface_number, subclass, protocol) \ - /*.bLength = */ sizeof(app_usbd_descriptor_iface_t), \ - /*.bDescriptorType = */ APP_USBD_DESCRIPTOR_INTERFACE, \ - /*.bInterfaceNumber = */ interface_number, \ - /*.bAlternateSetting = */ 0x00, \ - /*.bNumEndpoints = */ 1, \ - /*.bInterfaceClass = */ APP_USBD_CDC_COMM_CLASS, \ - /*.bInterfaceSubClass = */ subclass, \ - /*.bInterfaceProtocol = */ protocol, \ - /*.iInterface = 0, */ 0x00, \ - - -/** - * @brief Initializer of interface descriptor for CDC DATA class. - * - * @param interface_number Interface number. - * @param subclass Subclass, @ref app_usbd_cdc_subclass_t. - * @param protocol Protocol, @ref app_usbd_cdc_data_protocol_t. - */ -#define APP_USBD_CDC_DATA_INTERFACE_DSC(interface_number, subclass, protocol) \ - /*.bLength = */ sizeof(app_usbd_descriptor_iface_t), \ - /*.bDescriptorType = */ APP_USBD_DESCRIPTOR_INTERFACE, \ - /*.bInterfaceNumber = */ interface_number, \ - /*.bAlternateSetting = */ 0x00, \ - /*.bNumEndpoints = */ 2, \ - /*.bInterfaceClass = */ APP_USBD_CDC_DATA_CLASS, \ - /*.bInterfaceSubClass = */ subclass, \ - /*.bInterfaceProtocol = */ protocol, \ - /*.iInterface = 0, */ 0x00, \ - - - -/** - * @brief Initializer of endpoint descriptor for CDC COM class. - * - * @param endpoint_in IN endpoint. - * @param ep_size Endpoint size. - */ -#define APP_USBD_CDC_COM_EP_DSC(endpoint_in, ep_size) \ - /*.bLength = */ sizeof(app_usbd_descriptor_ep_t), \ - /*.bDescriptorType = */ APP_USBD_DESCRIPTOR_ENDPOINT, \ - /*.bEndpointAddress = */ endpoint_in, \ - /*.bmAttributes = */ APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_INTERRUPT, \ - /*.wMaxPacketSize = */ APP_USBD_U16_TO_RAW_DSC(ep_size), \ - /*.bInterval = */ 16, \ - -/** - * @brief Initializer of endpoint descriptors for CDC DATA class. - * - * @param endpoint_in IN endpoint. - * @param endpoint_out OUT endpoint. - * @param ep_size Endpoint size. - */ -#define APP_USBD_CDC_DATA_EP_DSC(endpoint_in, endpoint_out, ep_size) \ - /*.bLength = */ sizeof(app_usbd_descriptor_ep_t), \ - /*.bDescriptorType = */ APP_USBD_DESCRIPTOR_ENDPOINT, \ - /*.bEndpointAddress = */ endpoint_in, \ - /*.bmAttributes = */ APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_BULK, \ - /*.wMaxPacketSize = */ APP_USBD_U16_TO_RAW_DSC(ep_size), \ - /*.bInterval = */ 0, \ - /*.bLength = */ sizeof(app_usbd_descriptor_ep_t), \ - /*.bDescriptorType = */ APP_USBD_DESCRIPTOR_ENDPOINT, \ - /*.bEndpointAddress = */ endpoint_out, \ - /*.bmAttributes = */ APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_BULK, \ - /*.wMaxPacketSize = */ APP_USBD_U16_TO_RAW_DSC(ep_size), \ - /*.bInterval = */ 0, \ - -/** - * @brief Initializer of endpoint descriptors for CDC header descriptor. - * - * @param bcd_cdc BCD CDC version. - */ -#define APP_USBD_CDC_HEADER_DSC(bcd_cdc) \ - /*.bLength = */ sizeof(app_usbd_cdc_desc_header_t), \ - /*.bDescriptorType = */ APP_USBD_CDC_CS_INTERFACE, \ - /*.bDescriptorSubtype = */ APP_USBD_CDC_SCS_HEADER, \ - /*.bcdCDC = */ APP_USBD_U16_TO_RAW_DSC(bcd_cdc), \ - -/** - * @brief Initializer of endpoint descriptors for CDC call management descriptor. - * - * @param capabilities Capabilities. - * @param data_interface Data interface. - */ -#define APP_USBD_CDC_CALL_MGMT_DSC(capabilities, data_interface) \ - /*.bLength = */ sizeof(app_usbd_cdc_desc_call_mgmt_t), \ - /*.bDescriptorType = */ APP_USBD_CDC_CS_INTERFACE, \ - /*.bDescriptorSubtype = */ APP_USBD_CDC_SCS_CALL_MGMT, \ - /*.bmCapabilities = */ capabilities, \ - /*.bDataInterface = */ data_interface, \ - - -/** - * @brief Initializer of endpoint descriptors for CDC DATA class. - * - * @param capabilities Capabilities. - */ -#define APP_USBD_CDC_ACM_DSC(capabilities) \ - /*.bLength = */ sizeof(app_usbd_cdc_desc_acm_t), \ - /*.bDescriptorType = */ APP_USBD_CDC_CS_INTERFACE, \ - /*.bDescriptorSubtype = */ APP_USBD_CDC_SCS_ACM, \ - /*.bmCapabilities = */ capabilities, \ - -/** - * @brief Initializer of endpoint descriptors for CDC DATA class. - * - * @param control_interface Control interface. - * @param ... Subordinate interfaces list. - */ -#define APP_USBD_CDC_UNION_DSC(control_interface, ...) \ - /*.bLength = */ sizeof(app_usbd_cdc_desc_union_t) + (NUM_VA_ARGS(__VA_ARGS__)), \ - /*.bDescriptorType = */ APP_USBD_CDC_CS_INTERFACE, \ - /*.bDescriptorSubtype = */ APP_USBD_CDC_SCS_UNION, \ - /*.bControlInterface = */ control_interface, \ - /*.bSubordinateInterface = */ __VA_ARGS__, \ - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_CDC_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_types.h b/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_types.h deleted file mode 100644 index e880d8238..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/class/cdc/app_usbd_cdc_types.h +++ /dev/null @@ -1,360 +0,0 @@ -/** - * Copyright (c) 2016 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef APP_USBD_CDC_TYPES_H__ -#define APP_USBD_CDC_TYPES_H__ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * @defgroup app_usbd_cdc_types CDC class types - * @ingroup app_usbd_cdc_acm - * - * @brief @tagAPI52840 Variable types used by the CDC class implementation. - * @{ - */ - -/** - * @brief Communications Interface Class code. - * - * Used for control interface in communication class. - * @ref app_usbd_descriptor_iface_t::bInterfaceClass - */ -#define APP_USBD_CDC_COMM_CLASS 0x02 - -/** - * @brief Data Class Interface code. - * - * Used for data interface in communication class. - * @ref app_usbd_descriptor_iface_t::bInterfaceClass - */ -#define APP_USBD_CDC_DATA_CLASS 0x0A - -/** - * @brief CDC subclass possible values. - * - * @ref app_usbd_descriptor_iface_t::bInterfaceSubClass - */ -typedef enum { - APP_USBD_CDC_SUBCLASS_RESERVED = 0x00, /**< Reserved in documentation. */ - APP_USBD_CDC_SUBCLASS_DLCM = 0x01, /**< Direct Line Control Model. */ - APP_USBD_CDC_SUBCLASS_ACM = 0x02, /**< Abstract Control Model. */ - APP_USBD_CDC_SUBCLASS_TCM = 0x03, /**< Telephone Control Model. */ - APP_USBD_CDC_SUBCLASS_MCCM = 0x04, /**< Multi-Channel Control Model. */ - APP_USBD_CDC_SUBCLASS_CAPI = 0x05, /**< CAPI Control Model. */ - APP_USBD_CDC_SUBCLASS_ENCM = 0x06, /**< Ethernet Networking Control Model. */ - APP_USBD_CDC_SUBCLASS_ATM = 0x07, /**< ATM Networking Control Model. */ - APP_USBD_CDC_SUBCLASS_WHCM = 0x08, /**< Wireless Handset Control Model. */ - APP_USBD_CDC_SUBCLASS_DM = 0x09, /**< Device Management. */ - APP_USBD_CDC_SUBCLASS_MDLM = 0x0A, /**< Mobile Direct Line Model. */ - APP_USBD_CDC_SUBCLASS_OBEX = 0x0B, /**< OBEX. */ - APP_USBD_CDC_SUBCLASS_EEM = 0x0C, /**< Ethernet Emulation Model. */ - APP_USBD_CDC_SUBCLASS_NCM = 0x0D /**< Network Control Model. */ -} app_usbd_cdc_subclass_t; - -/** - * @brief CDC protocol possible values. - * - * @ref app_usbd_descriptor_iface_t::bInterfaceProtocol - */ -typedef enum { - APP_USBD_CDC_COMM_PROTOCOL_NONE = 0x00, /**< No class specific protocol required. */ - APP_USBD_CDC_COMM_PROTOCOL_AT_V250 = 0x01, /**< AT Commands: V.250 etc. */ - APP_USBD_CDC_COMM_PROTOCOL_AT_PCCA101 = 0x02, /**< AT Commands defined by PCCA-101. */ - APP_USBD_CDC_COMM_PROTOCOL_AT_PCCA101_ANNEXO = 0x03, /**< AT Commands defined by PCCA-101 & Annex O. */ - APP_USBD_CDC_COMM_PROTOCOL_AT_GSM707 = 0x04, /**< AT Commands defined by GSM 07.07. */ - APP_USBD_CDC_COMM_PROTOCOL_AT_3GPP_27007 = 0x05, /**< AT Commands defined by 3GPP 27.007. */ - APP_USBD_CDC_COMM_PROTOCOL_AT_CDMA = 0x06, /**< AT Commands defined by TIA for CDMA. */ - APP_USBD_CDC_COMM_PROTOCOL_EEM = 0x07, /**< Ethernet Emulation Model. */ - APP_USBD_CDC_COMM_PROTOCOL_EXTERNAL = 0xFE, /**< External Protocol: Commands defined by Command Set Functional Descriptor. */ - APP_USBD_CDC_COMM_PROTOCOL_VENDOR = 0xFF /**< Vendor-specific. */ -} app_usbd_cdc_comm_protocol_t; - -/** - * @brief CDC data interface protocols possible values. - */ -typedef enum { - APP_USBD_CDC_DATA_PROTOCOL_NONE = 0x00, /**< No class specific protocol required. */ - APP_USBD_CDC_DATA_PROTOCOL_NTB = 0x01, /**< Network Transfer Block. */ - APP_USBD_CDC_DATA_PROTOCOL_ISDN_BRI = 0x30, /**< Physical interface protocol for ISDN BRI. */ - APP_USBD_CDC_DATA_PROTOCOL_HDLC = 0x31, /**< HDLC. */ - APP_USBD_CDC_DATA_PROTOCOL_TRANSPARENT = 0x32, /**< Transparent. */ - APP_USBD_CDC_DATA_PROTOCOL_Q921M = 0x50, /**< Management protocol for Q.921 data link protocol. */ - APP_USBD_CDC_DATA_PROTOCOL_Q921 = 0x51, /**< Data link protocol for Q.921. */ - APP_USBD_CDC_DATA_PROTOCOL_Q921TM = 0x52, /**< TEI-multiplexor for Q.921 data link protocol. */ - APP_USBD_CDC_DATA_PROTOCOL_V42BIS = 0x90, /**< Data compression procedures. */ - APP_USBD_CDC_DATA_PROTOCOL_Q931 = 0x91, /**< Euro-ISDN protocol control. */ - APP_USBD_CDC_DATA_PROTOCOL_V120 = 0x92, /**< V.24 rate adaptation to ISDN. */ - APP_USBD_CDC_DATA_PROTOCOL_CAPI20 = 0x93, /**< CAPI Commands. */ - APP_USBD_CDC_DATA_PROTOCOL_HOST = 0xFD, /**< Host based driver. - * @note This protocol code should only be used in messages - * between host and device to identify the host driver portion - * of a protocol stack. - */ - APP_USBD_CDC_DATA_PROTOCOL_EXTERNAL = 0xFE, /**< The protocol(s) are described using a Protocol Unit Functional - * Descriptors on Communications Class Interface. - */ - APP_USBD_CDC_DATA_PROTOCOL_VENDOR = 0xFF /**< Vendor-specific. */ -} app_usbd_cdc_data_protocol_t; - -/** - * @brief CDC Functional Descriptor types. - */ -typedef enum { - APP_USBD_CDC_CS_INTERFACE = 0x24, /**< Class specific interface descriptor type.*/ - APP_USBD_CDC_CS_ENDPOINT = 0x25 /**< Class specific endpoint descriptor type.*/ -} app_usbd_cdc_func_type_t; - -/** - * @brief CDC Functional Descriptor subtypes. - */ -typedef enum { - APP_USBD_CDC_SCS_HEADER = 0x00, /**< Header Functional Descriptor, which marks the beginning of the concatenated set of functional descriptors for the interface. */ - APP_USBD_CDC_SCS_CALL_MGMT = 0x01, /**< Call Management Functional Descriptor. */ - APP_USBD_CDC_SCS_ACM = 0x02, /**< Abstract Control Management Functional Descriptor. */ - APP_USBD_CDC_SCS_DLM = 0x03, /**< Direct Line Management Functional Descriptor. */ - APP_USBD_CDC_SCS_TEL_R = 0x04, /**< Telephone Ringer Functional Descriptor. */ - APP_USBD_CDC_SCS_TEL_CAP = 0x05, /**< Telephone Call and Line State Reporting Capabilities Functional Descriptor. */ - APP_USBD_CDC_SCS_UNION = 0x06, /**< Union Functional Descriptor. */ - APP_USBD_CDC_SCS_COUNTRY_SEL = 0x07, /**< Country Selection Functional Descriptor. */ - APP_USBD_CDC_SCS_TEL_OM = 0x08, /**< Telephone Operational Modes Functional Descriptor. */ - APP_USBD_CDC_SCS_USB_TERM = 0x09, /**< USB Terminal Functional Descriptor. */ - APP_USBD_CDC_SCS_NCT = 0x0A, /**< Network Channel Terminal Descriptor. */ - APP_USBD_CDC_SCS_PU = 0x0B, /**< Protocol Unit Functional Descriptor. */ - APP_USBD_CDC_SCS_EU = 0x0C, /**< Extension Unit Functional Descriptor. */ - APP_USBD_CDC_SCS_MCM = 0x0D, /**< Multi-Channel Management Functional Descriptor. */ - APP_USBD_CDC_SCS_CAPI = 0x0E, /**< CAPI Control Management Functional Descriptor. */ - APP_USBD_CDC_SCS_ETH = 0x0F, /**< Ethernet Networking Functional Descriptor. */ - APP_USBD_CDC_SCS_ATM = 0x10, /**< ATM Networking Functional Descriptor. */ - APP_USBD_CDC_SCS_WHCM = 0x11, /**< Wireless Handset Control Model Functional Descriptor. */ - APP_USBD_CDC_SCS_MDLM = 0x12, /**< Mobile Direct Line Model Functional Descriptor. */ - APP_USBD_CDC_SCS_MDLM_DET = 0x13, /**< MDLM Detail Functional Descriptor. */ - APP_USBD_CDC_SCS_DMM = 0x14, /**< Device Management Model Functional Descriptor. */ - APP_USBD_CDC_SCS_OBEX = 0x15, /**< OBEX Functional Descriptor. */ - APP_USBD_CDC_SCS_CS = 0x16, /**< Command Set Functional Descriptor. */ - APP_USBD_CDC_SCS_CS_DET = 0x17, /**< Command Set Detail Functional Descriptor. */ - APP_USBD_CDC_SCS_TEL_CM = 0x18, /**< Telephone Control Model Functional Descriptor. */ - APP_USBD_CDC_SCS_OBEX_SI = 0x19, /**< OBEX Service Identifier Functional Descriptor. */ - APP_USBD_CDC_SCS_NCM = 0x1A /**< NCM Functional Descriptor. */ -} app_usbd_cdc_func_subtype_t; - -/* Make all descriptors packed */ -#pragma pack(push, 1) - -/** - * @brief Header Functional Descriptor. - */ -typedef struct { - uint8_t bFunctionLength; //!< Size of this descriptor in bytes. - uint8_t bDescriptorType; //!< @ref APP_USBD_CDC_CS_INTERFACE descriptor type. - uint8_t bDescriptorSubtype; //!< Descriptor subtype @ref APP_USBD_CDC_SCS_HEADER. - uint8_t bcdCDC[2]; //!< USB Class Definitions for Communications Devices Specification release number in binary-coded decimal. -} app_usbd_cdc_desc_header_t; - -/** - * @brief Call management capabilities. - * - * @ref app_usbd_cdc_desc_call_mgmt_t::bmCapabilities bit. - * */ -typedef enum { - APP_USBD_CDC_CALL_MGMT_SUPPORTED = (1 << 0), /**< Call management capability bit 0.*/ - APP_USBD_CDC_CALL_MGMT_OVER_DCI = (1 << 1), /**< Call management capability bit 1.*/ -} app_subd_cdc_call_mgmt_cap_t; - -/** - * @brief CDC Call Management Functional Descriptor. - */ -typedef struct { - uint8_t bFunctionLength; //!< Size of this functional descriptor, in bytes. - uint8_t bDescriptorType; //!< Descriptor type @ref APP_USBD_CDC_CS_INTERFACE. - uint8_t bDescriptorSubtype; //!< Descriptor subtype @ref APP_USBD_CDC_SCS_CALL_MGMT. - uint8_t bmCapabilities; //!< Capabilities @ref app_subd_cdc_call_mgmt_cap_t. - uint8_t bDataInterface; //!< Data interface number. -} app_usbd_cdc_desc_call_mgmt_t; - -/** - * @brief ACM capabilities. - * - * @ref app_usbd_cdc_desc_acm_t::bmCapabilities bit. - * */ -typedef enum { - APP_USBD_CDC_ACM_FEATURE_REQUESTS = (1 << 0), /**< ACM capability bit FEATURE_REQUESTS. */ - APP_USBD_CDC_ACM_LINE_REQUESTS = (1 << 1), /**< ACM capability bit LINE_REQUESTS. */ - APP_USBD_CDC_ACM_SENDBREAK_REQUESTS = (1 << 2), /**< ACM capability bit SENDBREAK_REQUESTS.*/ - APP_USBD_CDC_ACM_NOTIFY_REQUESTS = (1 << 3), /**< ACM capability bit NOTIFY_REQUESTS. */ -} app_subd_cdc_acm_cap_t; - -/** - * @brief CDC ACM Functional Descriptor. - */ -typedef struct { - uint8_t bFunctionLength; //!< Size of this functional descriptor, in bytes. - uint8_t bDescriptorType; //!< Descriptor type @ref APP_USBD_CDC_CS_INTERFACE. - uint8_t bDescriptorSubtype; //!< Descriptor subtype @ref APP_USBD_CDC_SCS_ACM. - uint8_t bmCapabilities; //!< Capabilities @ref app_subd_cdc_acm_cap_t. -} app_usbd_cdc_desc_acm_t; - -/** - * @brief Union Functional Descriptor. - */ -typedef struct { - uint8_t bFunctionLength; //!< Size of this functional descriptor, in bytes. - uint8_t bDescriptorType; //!< Descriptor type @ref APP_USBD_CDC_CS_INTERFACE. - uint8_t bDescriptorSubtype; //!< Descriptor subtype @ref APP_USBD_CDC_SCS_UNION. - uint8_t bControlInterface; //!< The interface number of the Communications or Data Class interface, designated as the controlling interface for the union. - uint8_t bSubordinateInterface[]; //!< Interface number of subordinate interfaces in the union. Number of interfaced depends on descriptor size. -} app_usbd_cdc_desc_union_t; - -/** - * @brief Country Selection Functional Descriptor. - */ -typedef struct { - uint8_t bFunctionLength; //!< Size of this functional descriptor, in bytes. - uint8_t bDescriptorType; //!< Descriptor type @ref APP_USBD_CDC_CS_INTERFACE. - uint8_t bDescriptorSubtype; //!< Descriptor subtype @ref APP_USBD_CDC_SCS_COUNTRY_SEL. - uint8_t iCountryCodeRelDate; //!< Index of a string giving the release date for the implemented ISO 3166 Country Codes. -} app_usbd_cdc_desc_country_sel_t; - -/** - * @brief CDC Requests - * - */ -typedef enum { - /* CDC General */ - APP_USBD_CDC_REQ_SEND_ENCAPSULATED_COMMAND = 0x00, /**< This request is used to issue a command in the format of the supported control protocol of the Communications Class interface. */ - APP_USBD_CDC_REQ_GET_ENCAPSULATED_RESPONSE = 0x01, /**< This request is used to request a response in the format of the supported control protocol of the Communications Class interface. */ - /* CDC PSTN */ - APP_USBD_CDC_REQ_SET_COMM_FEATURE = 0x02, /**< This request controls the settings for a particular communications feature of a particular target. */ - APP_USBD_CDC_REQ_GET_COMM_FEATURE = 0x03, /**< This request returns the current settings for the communications feature as selected. */ - APP_USBD_CDC_REQ_CLEAR_COMM_FEATURE = 0x04, /**< This request controls the settings for a particular communications feature of a particular target, setting the selected feature to its default state. */ - APP_USBD_CDC_REQ_SET_AUX_LINE_STATE = 0x10, /**< This request is used to connect or disconnect a secondary jack to POTS circuit or CODEC, depending on hook state. */ - APP_USBD_CDC_REQ_SET_HOOK_STATE = 0x11, /**< This request is used to set the necessary PSTN line relay code for on-hook, off-hook, and caller ID states. */ - APP_USBD_CDC_REQ_PULSE_SETUP = 0x12, /**< This request is used to prepare for a pulse-dialing cycle. */ - APP_USBD_CDC_REQ_SEND_PULSE = 0x13, /**< This request is used to generate a specified number of make/break pulse cycles. */ - APP_USBD_CDC_REQ_SET_PULSE_TIME = 0x14, /**< This request sets the timing of the make and break periods for pulse dialing. */ - APP_USBD_CDC_REQ_RING_AUX_JACK = 0x15, /**< This request is used to generate a ring signal on a secondary phone jack. */ - APP_USBD_CDC_REQ_SET_LINE_CODING = 0x20, /**< This request allows the host to specify typical asynchronous line-character formatting properties. */ - APP_USBD_CDC_REQ_GET_LINE_CODING = 0x21, /**< This request allows the host to find out the currently configured line coding. */ - APP_USBD_CDC_REQ_SET_CONTROL_LINE_STATE = 0x22, /**< This request generates RS-232/V.24 style control signals. */ - APP_USBD_CDC_REQ_SEND_BREAK = 0x23, /**< This request sends special carrier modulation that generates an RS-232 style break. */ - APP_USBD_CDC_REQ_SET_RINGER_PARMS = 0x30, /**< This request configures the ringer for the communications device. */ - APP_USBD_CDC_REQ_GET_RINGER_PARMS = 0x31, /**< This request returns the ringer capabilities of the device and the current status of the device’s ringer. */ - APP_USBD_CDC_REQ_SET_OPERATION_PARMS = 0x32, /**< Sets the operational mode for the device, between a simple mode, standalone mode and a host centric mode. */ - APP_USBD_CDC_REQ_GET_OPERATION_PARMS = 0x33, /**< This request gets the current operational mode for the device. */ - APP_USBD_CDC_REQ_SET_LINE_PARMS = 0x34, /**< This request is used to change the state of the line, corresponding to the interface or master interface of a union to which the command was sent. */ - APP_USBD_CDC_REQ_GET_LINE_PARMS = 0x35, /**< This request is used to report the state of the line that corresponds to the interface or master interface of a union to which the command was sent. */ - APP_USBD_CDC_REQ_DIAL_DIGITS = 0x36, /**< This request dials the DTMF digits over the specified line. */ -} app_usbd_cdc_req_id_t; - -/** - * @brief CDC Notifications. - */ -typedef enum { - /* CDC General */ - APP_USBD_CDC_NOTIF_NETWORK_CONNECTION = 0x00, /**< This notification allows the device to notify the host about network connection status. */ - APP_USBD_CDC_NOTIF_RESPONSE_AVAILABLE = 0x01, /**< This notification allows the device to notify the host that a response is available. - * This response can be retrieved with a subsequent GetEncapsulatedResponse request. - _ */ - APP_USBD_CDC_NOTIF_CONNECTION_SPEED_CHANGE = 0x2A, /**< This notification allows the device to inform the host-networking driver - * that a change in either the up-link or the down-link bit rate of the connection has occurred. - */ - /* CDC PSTN */ - APP_USBD_CDC_NOTIF_AUX_JACK_HOOK_STATE = 0x08, /**< (DLM) This notification indicates the loop has changed on the auxiliary phone interface of the USB device. */ - APP_USBD_CDC_NOTIF_RING_DETECT = 0x09, /**< (DLM) This notification indicates ring voltage on the POTS line interface of the USB device. */ - APP_USBD_CDC_NOTIF_SERIAL_STATE = 0x20, /**< (ACM) This notification sends asynchronous notification of UART status. */ - APP_USBD_CDC_NOTIF_CALL_STATE_CHANGE = 0x28, /**< (TCM) This notification identifies that a change has occurred to the state of a call on the line corresponding to the interface or union for the line. */ - APP_USBD_CDC_NOTIF_LINE_STATE_CHANGE = 0x29 /**< (TCM) This notification identifies that a change has occurred to the state of the line corresponding to the interface or master interface of a union sending the notification message. */ -} app_usbd_cdc_notify_id_t; - -/** - * @brief Notification sent via CDC COMM endpoint. - * */ -typedef struct { - uint8_t bmRequestType; //!< Request type. - uint8_t bRequest; //!< Request ID @ref app_usbd_cdc_req_id_t. - uint16_t wValue; //!< Value field. - uint16_t wIndex; //!< Index field. - uint16_t wLength; //!< Length of payload following. -} app_usbd_cdc_notify_t; - -/** - * @brief CDC line coding structure. - */ -typedef struct { - uint8_t dwDTERate[4]; //!< Line baudrate. - uint8_t bCharFormat; //!< Character format @ref app_usbd_cdc_line_stopbit_t. - uint8_t bParityType; //!< Parity bits @ref app_usbd_cdc_line_parity_t. - uint8_t bDataBits; //!< Number of data bits. -} app_usbd_cdc_line_coding_t; - -/** - * @brief Possible values of @ref app_usbd_cdc_line_coding_t::bCharFormat. - */ -typedef enum { - APP_USBD_CDC_LINE_STOPBIT_1 = 0, /**< 1 stop bit. */ - APP_USBD_CDC_LINE_STOPBIT_1_5 = 1, /**< 1.5 stop bits. */ - APP_USBD_CDC_LINE_STOPBIT_2 = 2, /**< 2 stop bits. */ -} app_usbd_cdc_line_stopbit_t; - -/** - * @brief Possible values of @ref app_usbd_cdc_line_coding_t::bParityType. - */ -typedef enum { - APP_USBD_CDC_LINE_PARITY_NONE = 0, /**< No parity. */ - APP_USBD_CDC_LINE_PARITY_ODD = 1, /**< Odd parity. */ - APP_USBD_CDC_LINE_PARITY_EVEN = 2, /**< Even parity. */ - APP_USBD_CDC_LINE_PARITY_MARK = 3, /**< Parity forced to 0 (mark). */ - APP_USBD_CDC_LINE_PARITY_SPACE = 4, /**< Parity forced to 1 (space). */ -} app_usbd_cdc_line_parity_t; - - -#pragma pack(pop) - -/** @} */ -#ifdef __cplusplus -} -#endif - -#endif /* APP_USBD_TYPES_H__ */ diff --git a/third_party/NordicSemiconductor/libraries/usb/config/app_usbd_string_config.h b/third_party/NordicSemiconductor/libraries/usb/config/app_usbd_string_config.h deleted file mode 100644 index d90603cb7..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/config/app_usbd_string_config.h +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Copyright (c) 2016 - 2018, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef APP_USBD_STRING_CONFIG_H -#define APP_USBD_STRING_CONFIG_H - -/** - * @defgroup app_usbd_string_conf USBD string configuration - * @ingroup app_usbd_string_desc - * - * @brief @tagAPI52840 Configuration of the string module that can be easily affected by the final - * user. - * @{ - */ - -/** - * @brief Supported languages identifiers - * - * Comma separated list of supported languages. - */ -#define APP_USBD_STRINGS_LANGIDS \ - ((uint16_t)APP_USBD_LANG_ENGLISH | (uint16_t)APP_USBD_SUBLANG_ENGLISH_US) - -/** - * @brief Manufacturer name string descriptor - * - * Comma separated list of manufacturer names for each defined language. - * Use @ref APP_USBD_STRING_DESC macro to create string descriptor. - * - * The order of manufacturer names has to be the same like in - * @ref APP_USBD_STRINGS_LANGIDS. - */ -#define APP_USBD_STRINGS_MANUFACTURER \ - APP_USBD_STRING_DESC("Nordic Semiconductor") - -/** - * @brief Define whether @ref APP_USBD_STRINGS_MANUFACTURER is created by @ref APP_USBD_STRING_DESC - * or declared as global variable. - * */ -#define APP_USBD_STRINGS_MANUFACTURER_EXTERN 0 - -/** - * @brief Product name string descriptor - * - * List of product names defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER - */ -#define APP_USBD_STRINGS_PRODUCT \ - APP_USBD_STRING_DESC("nRF52840 OpenThread Device") - - -/** - * @brief Define whether @ref APP_USBD_STRINGS_PRODUCT is created by @ref APP_USBD_STRING_DESC - * or declared as global variable. - * */ -#define APP_USBD_STRINGS_PRODUCT_EXTERN 0 - -/** - * @brief Serial number string descriptor - * - * Create serial number string descriptor using @ref APP_USBD_STRING_DESC, - * or configure it to point to any internal variable pointer filled with descriptor. - * - * @note - * There is only one SERIAL number inside the library and it is Language independent. - */ -#define APP_USBD_STRING_SERIAL g_extern_serial_number - -/** - * @brief Define whether @ref APP_USBD_STRING_SERIAL is created by @ref APP_USBD_STRING_DESC - * or declared as global variable. - * */ -#define APP_USBD_STRING_SERIAL_EXTERN 1 - -/** - * @brief User strings default values - * - * This value stores all application specific user strings with its default initialization. - * The setup is done by X-macros. - * Expected macro parameters: - * @code - * X(mnemonic, [=str_idx], ...) - * @endcode - * - @c mnemonic: Mnemonic of the string descriptor that would be added to - * @ref app_usbd_string_desc_idx_t enumerator. - * - @c str_idx : String index value, may be set or left empty. - * For example WinUSB driver requires descriptor to be present on 0xEE index. - * Then use X(USBD_STRING_WINUSB, =0xEE, (APP_USBD_STRING_DESC(...))) - * - @c ... : List of string descriptors for each defined language. - */ -#define APP_USBD_STRINGS_USER \ - X(APP_USER_1, , APP_USBD_STRING_DESC("User 1")) - -/** @} */ -#endif /* APP_USBD_STRING_CONFIG_H */ diff --git a/third_party/NordicSemiconductor/libraries/usb/nordic_cdc_acm.cat b/third_party/NordicSemiconductor/libraries/usb/nordic_cdc_acm.cat deleted file mode 100644 index 3d578ff9faa1df1a10eb87c71079860b2287ca5f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7565 zcmc&(cUV)&7QZQkj`UsvN|6%gCR7_DAR>qq6$J!C2oj|xp-V9!ii-OL1qBO;B4R-l z(G{_Pl?Ci8N>Q<+BB(1a2)wz0KrCDQ<9#ppySX!G&YU?jbIxzh%mAKN7D?PVb53TT zG)@#>#M4RyJgrzf4u?ttagvCM3<0k$f&d=Lfh2B1!Vz&iYYAKtk7NN!07#J}Mu}25 z98q@T%>@UqZ}{Mvc6?>!!<9p=D$=Mepiym6lxA&-`T`jtc048(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8;n-Ya97F>7`U&q zE}NpHK4aJ7jnnJ)yl>vaI%;(-0#}swTXm4mP#Lqe{JpvBB;Si6ZYme{*C$F%Nu$KS zNt~&BHGvyka@WxB6UVzw{iJJjJ8c4TC(7hq?X~r0`>IqM4u(9WY(Cv&-lJoa+hS)l zcb^yQvA+13g5W+^&$OHE^7Az`dt~hfqeT=hMEe;ZOyS`DNxgSevNYdGKcV`2!()vZ Nr5{8ja@%I0{{>ZG4xIo1 diff --git a/third_party/NordicSemiconductor/libraries/usb/nordic_cdc_acm_example.inf b/third_party/NordicSemiconductor/libraries/usb/nordic_cdc_acm_example.inf deleted file mode 100644 index f9e70d7f6..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/nordic_cdc_acm_example.inf +++ /dev/null @@ -1,115 +0,0 @@ -; Copyright (c) 2019 Nordic Semiconductor -; Windows 2000, XP, Vista, 7 and 8 (x32 and x64) driver for Nordic CDC ACM - -[Version] -Signature = "$Windows NT$" -Class = Ports -ClassGuid = {4D36E978-E325-11CE-BFC1-08002BE10318} -Provider = %Manufacturer% -DriverVer = 03/11/2019,1.1.0.0 -CatalogFile = nordic_cdc_acm.cat - -;---------------------------------------------------------- -; Targets -;---------------------------------------------------------- - -[Manufacturer] -%Manufacturer%=DeviceList, NTAMD64, NTIA64, NTx86 - -[DeviceList.NTx86] -%NORDIC_CDC_ACM_EXAMPLE% =DriverInstall, USB\VID_1915&PID_520F&MI_00 -%NORDIC_BLE_UART_EXAMPLE% =DriverInstall, USB\VID_1915&PID_521A&MI_00 -%NORDIC_USB_CDC_CONNECTIVITY% =DriverInstall, USB\VID_1915&PID_521B&MI_00 -%NORDIC_SDFU_USB_EXAMPLE% =DriverInstall, USB\VID_1915&PID_521F&MI_00 -%NORDIC_OPENTHREAD_DEVICE% =DriverInstall, USB\VID_1915&PID_CAFE&MI_01 -%NORDIC_ZIGBEE_CLI_DEVICE% =DriverInstall, USB\VID_1915&PID_1337&MI_00 -%NORDIC_SNIFFER_802154_DEVICE% =DriverInstall, USB\VID_1915&PID_154A&MI_00 - - -[DeviceList.NTAMD64] -%NORDIC_CDC_ACM_EXAMPLE% =DriverInstall.NTamd64, USB\VID_1915&PID_520F&MI_00 -%NORDIC_BLE_UART_EXAMPLE% =DriverInstall.NTamd64, USB\VID_1915&PID_521A&MI_00 -%NORDIC_USB_CDC_CONNECTIVITY% =DriverInstall.NTamd64, USB\VID_1915&PID_521B&MI_00 -%NORDIC_SDFU_USB_EXAMPLE% =DriverInstall.NTamd64, USB\VID_1915&PID_521F&MI_00 -%NORDIC_OPENTHREAD_DEVICE% =DriverInstall.NTamd64, USB\VID_1915&PID_CAFE&MI_01 -%NORDIC_ZIGBEE_CLI_DEVICE% =DriverInstall.NTamd64, USB\VID_1915&PID_1337&MI_00 -%NORDIC_SNIFFER_802154_DEVICE% =DriverInstall.NTamd64, USB\VID_1915&PID_154A&MI_00 - - -[DeviceList.NTIA64] -%NORDIC_CDC_ACM_EXAMPLE% =DriverInstall.NTamd64, USB\VID_1915&PID_520F&MI_00 -%NORDIC_BLE_UART_EXAMPLE% =DriverInstall.NTamd64, USB\VID_1915&PID_521A&MI_00 -%NORDIC_USB_CDC_CONNECTIVITY% =DriverInstall.NTamd64, USB\VID_1915&PID_521B&MI_00 -%NORDIC_SDFU_USB_EXAMPLE% =DriverInstall.NTamd64, USB\VID_1915&PID_521F&MI_00 -%NORDIC_OPENTHREAD_DEVICE% =DriverInstall.NTamd64, USB\VID_1915&PID_CAFE&MI_01 -%NORDIC_ZIGBEE_CLI_DEVICE% =DriverInstall.NTamd64, USB\VID_1915&PID_1337&MI_00 -%NORDIC_SNIFFER_802154_DEVICE% =DriverInstall.NTamd64, USB\VID_1915&PID_154A&MI_00 - -;---------------------------------------------------------- -; Windows 2000, XP, Vista, Windows 7, Windows 8 - 32bit -;---------------------------------------------------------- - -[DestinationDirs] -DefaultDestDir=12 -DriverInstall.NT.Copy=12 - -[DriverInstall.NT] -include=mdmcpq.inf -CopyFiles=DriverInstall.NT.Copy -AddReg=DriverInstall.NT.AddReg - -[DriverInstall.NT.Copy] - -[DriverInstall.NT.AddReg] -HKR,,DevLoader,,*ntkern -HKR,,NTMPDriver,,usbser.sys -HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" - -[DriverInstall.NT.Services] -include=mdmcpq.inf -AddService = usbser, 0x00000002, DriverService.NT - -[DriverService.NT] -DisplayName = %Serial.SvcDesc% -ServiceType = 1 ; SERVICE_KERNEL_DRIVER -StartType = 3 ; SERVICE_DEMAND_START -ErrorControl = 1 ; SERVICE_ERROR_NORMAL -ServiceBinary = %12%\usbser.sys -LoadOrderGroup = Base - -;---------------------------------------------------------- -; Windows XP, Vista, Windows 7, Windows 8 - 64bit -;---------------------------------------------------------- - -[DriverInstall.NTamd64] -include=mdmcpq.inf -CopyFiles=DriverCopyFiles.NTamd64 -AddReg=DriverInstall.NTamd64.AddReg - -[DriverCopyFiles.NTamd64] - -[DriverInstall.NTamd64.AddReg] -HKR,,DevLoader,,*ntkern -HKR,,NTMPDriver,,usbser.sys -HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" - -[DriverInstall.NTamd64.Services] -AddService=usbser, 0x00000002, DriverService.NT - -;---------------------------------------------------------- -; String -;---------------------------------------------------------- - -[Strings] -Manufacturer = "Nordic Semiconductor" -NORDIC_CDC_ACM_EXAMPLE = "nRF52 USB CDC Demo" -NORDIC_BLE_UART_EXAMPLE = "nRF52 USB CDC BLE Demo" -NORDIC_USB_CDC_CONNECTIVITY = "nRF52 USB CDC Connectivity" -NORDIC_SDFU_USB_EXAMPLE = "nRF52 SDFU USB" -NORDIC_OPENTHREAD_DEVICE = "nRF52840 OpenThread Device" -NORDIC_ZIGBEE_CLI_DEVICE = "nRF52840 Zigbee CLI Device" -NORDIC_SNIFFER_802154_DEVICE = "nRF52 802.15.4 Sniffer" - - -Serial.SvcDesc = "USB Serial emulation driver" - diff --git a/third_party/NordicSemiconductor/libraries/usb/nrf_dfu_trigger_usb.c b/third_party/NordicSemiconductor/libraries/usb/nrf_dfu_trigger_usb.c deleted file mode 100644 index 081eab498..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/nrf_dfu_trigger_usb.c +++ /dev/null @@ -1,243 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#include "nrf_dfu_trigger_usb.h" -#include "app_usbd.h" -#include "app_usbd_nrf_dfu_trigger.h" -#include "nrf_drv_clock.h" -#include "nrf_log_ctrl.h" -#include "nrf_gpio.h" -#include "app_util.h" -#include "app_usbd_serial_num.h" -#define NRF_LOG_MODULE_NAME nrf_dfu_trigger_usb -#include "nrf_log.h" -NRF_LOG_MODULE_REGISTER(); - -#ifndef BSP_SELF_PINRESET_PIN -#error "This module is intended to be used with boards that have the GP pin shortened with the RESET pin." -#endif - -/** - * @brief Enable power USB detection. - * - * Configure if the example supports USB port connection. - */ -#ifndef USBD_POWER_DETECTION -#define USBD_POWER_DETECTION true -#endif - -#define DFU_FLASH_PAGE_SIZE (NRF_FICR->CODEPAGESIZE) -#define DFU_FLASH_PAGE_COUNT (NRF_FICR->CODESIZE) - -// Semantic versioning string. -#define VERSION_STRING STRINGIFY(APP_VERSION_MAJOR) "." STRINGIFY(APP_VERSION_MINOR) "." STRINGIFY(APP_VERSION_PATCH) APP_VERSION_PRERELEASE APP_VERSION_METADATA - -static uint8_t m_version_string[] = APP_NAME " " VERSION_STRING; ///< Human-readable version string. -static app_usbd_nrf_dfu_trigger_nordic_info_t m_dfu_info; ///< Struct with various information about the current firmware. - -static void dfu_trigger_evt_handler(app_usbd_class_inst_t const * p_inst, - app_usbd_nrf_dfu_trigger_user_event_t event) -{ - UNUSED_PARAMETER(p_inst); - - switch (event) - { - case APP_USBD_NRF_DFU_TRIGGER_USER_EVT_DETACH: - NRF_LOG_INFO("DFU Detach request received. Triggering a pin reset."); - NRF_LOG_FINAL_FLUSH(); - nrf_gpio_cfg_output(BSP_SELF_PINRESET_PIN); - nrf_gpio_pin_clear(BSP_SELF_PINRESET_PIN); - break; - default: - break; - } -} - - -APP_USBD_NRF_DFU_TRIGGER_GLOBAL_DEF(m_app_dfu, - NRF_DFU_TRIGGER_USB_INTERFACE_NUM, - &m_dfu_info, - m_version_string, - dfu_trigger_evt_handler); - - -static void usbd_user_evt_handler(app_usbd_event_type_t event) -{ - switch (event) - { - case APP_USBD_EVT_DRV_SUSPEND: - break; - case APP_USBD_EVT_DRV_RESUME: - break; - case APP_USBD_EVT_STARTED: - break; - case APP_USBD_EVT_STOPPED: - app_usbd_disable(); - break; - case APP_USBD_EVT_POWER_DETECTED: - NRF_LOG_INFO("USB power detected"); - - if (!nrf_drv_usbd_is_enabled()) - { - app_usbd_enable(); - } - break; - case APP_USBD_EVT_POWER_REMOVED: - NRF_LOG_INFO("USB power removed"); - app_usbd_stop(); - break; - case APP_USBD_EVT_POWER_READY: - NRF_LOG_INFO("USB ready"); - app_usbd_start(); - break; - default: - break; - } -} - - -static void strings_create(void) -{ - uint8_t prev_char = 'a'; // Arbitrary valid char, not '-'. - - // Remove characters that are not supported in semantic version strings. - for (size_t i = strlen(APP_NAME) + 1; i < strlen((char*)m_version_string); i++) - { - if (((m_version_string[i] >= 'a') && (m_version_string[i] <= 'z')) - || ((m_version_string[i] >= 'A') && (m_version_string[i] <= 'Z')) - || ((m_version_string[i] >= '0') && (m_version_string[i] <= '9')) - || (m_version_string[i] == '+') - || (m_version_string[i] == '.') - || (m_version_string[i] == '-')) - { - // Valid semantic version character. - } - else if (prev_char == '-') - { - m_version_string[i] = '0'; - } - else - { - m_version_string[i] = '-'; - } - - prev_char = m_version_string[i]; - } - -#if !NRF_DFU_TRIGGER_USB_USB_SHARED - app_usbd_serial_num_generate(); -#endif -} - -#if !(APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) -static void usbd_evt_handler(app_usbd_internal_evt_t const * const p_event) -{ - app_usbd_event_execute(p_event); -} -#endif - -ret_code_t nrf_dfu_trigger_usb_init(void) -{ - ret_code_t ret; - static bool initialized = false; - - if (initialized) - { - return NRF_SUCCESS; - } - - m_dfu_info.wAddress = CODE_START; - m_dfu_info.wFirmwareSize = CODE_SIZE; - m_dfu_info.wVersionMajor = APP_VERSION_MAJOR; - m_dfu_info.wVersionMinor = APP_VERSION_MINOR; - m_dfu_info.wFirmwareID = APP_ID; - m_dfu_info.wFlashPageSize = DFU_FLASH_PAGE_SIZE; - m_dfu_info.wFlashSize = m_dfu_info.wFlashPageSize * DFU_FLASH_PAGE_COUNT; - - strings_create(); - - if (!NRF_DFU_TRIGGER_USB_USB_SHARED) - { - static const app_usbd_config_t usbd_config = { - -#if !(APP_USBD_CONFIG_EVENT_QUEUE_ENABLE) - .ev_handler = usbd_evt_handler, -#endif - .ev_state_proc = usbd_user_evt_handler - }; - - ret = nrf_drv_clock_init(); - if ((ret != NRF_SUCCESS) && (ret != NRF_ERROR_MODULE_ALREADY_INITIALIZED)) - { - return ret; - } - - ret = app_usbd_init(&usbd_config); - if (ret != NRF_SUCCESS) - { - return ret; - } - } - - app_usbd_class_inst_t const * class_dfu = app_usbd_nrf_dfu_trigger_class_inst_get(&m_app_dfu); - ret = app_usbd_class_append(class_dfu); - - if (!NRF_DFU_TRIGGER_USB_USB_SHARED) - { - if (USBD_POWER_DETECTION) - { - ret = app_usbd_power_events_enable(); - APP_ERROR_CHECK(ret); - } - else - { - NRF_LOG_INFO("No USB power detection enabled\r\nStarting USB now"); - - app_usbd_enable(); - app_usbd_start(); - } - } - - if (ret == NRF_SUCCESS) - { - initialized = true; - } - - return ret; -} diff --git a/third_party/NordicSemiconductor/libraries/usb/nrf_dfu_trigger_usb.h b/third_party/NordicSemiconductor/libraries/usb/nrf_dfu_trigger_usb.h deleted file mode 100644 index 895b59ab1..000000000 --- a/third_party/NordicSemiconductor/libraries/usb/nrf_dfu_trigger_usb.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) 2017 - 2019, Nordic Semiconductor ASA - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form, except as embedded into a Nordic - * Semiconductor ASA integrated circuit in a product or a software update for - * such product, must reproduce the above copyright notice, this list of - * conditions and the following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * 3. Neither the name of Nordic Semiconductor ASA nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * 4. This software, with or without modification, must only be used with a - * Nordic Semiconductor ASA integrated circuit. - * - * 5. Any software provided in binary form under this license must not be reverse - * engineered, decompiled, modified and/or disassembled. - * - * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ -#ifndef NRF_DFU_TRIGGER_USB_H -#define NRF_DFU_TRIGGER_USB_H - -#include "sdk_errors.h" - -/** - * @defgroup nrf_dfu_trigger_usb USB DFU trigger library - * @ingroup app_common - * - * @brief @tagAPI52840 USB DFU trigger library is used to enter the bootloader and read the firmware version. - * - * @details See @ref lib_dfu_trigger_usb for additional documentation. - * @{ - */ - -/** - * @brief Function for initializing the USB DFU trigger library. - * - * @note If the USB is also used for other purposes, then this function must be called after USB is - * initialized but before it is enabled. In this case, the configuration flag @ref - * NRF_DFU_TRIGGER_USB_USB_SHARED must be set to 1. - * - * @note Calling this again after the first success has no effect and returns @ref NRF_SUCCESS. - * - * @note If @ref APP_USBD_CONFIG_EVENT_QUEUE_ENABLE is on (1), USB events must be handled manually. - * See @ref app_usbd_event_queue_process. - * - * @retval NRF_SUCCESS On successful initialization. - * @return An error code on failure, for example if called at a wrong time. - */ -ret_code_t nrf_dfu_trigger_usb_init(void); - -/** @} */ - -#endif //NRF_DFU_TRIGGER_USB_H diff --git a/third_party/NordicSemiconductor/libraries/utf_converter/LICENSE b/third_party/NordicSemiconductor/libraries/utf_converter/LICENSE deleted file mode 100644 index fdee8ad7e..000000000 --- a/third_party/NordicSemiconductor/libraries/utf_converter/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -Copyright (c) 2016 Pietro Gagliardi - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -(this is called the MIT License or Expat License; see http://www.opensource.org/licenses/MIT) diff --git a/third_party/NordicSemiconductor/libraries/utf_converter/utf.c b/third_party/NordicSemiconductor/libraries/utf_converter/utf.c deleted file mode 100644 index e76afe79c..000000000 --- a/third_party/NordicSemiconductor/libraries/utf_converter/utf.c +++ /dev/null @@ -1,350 +0,0 @@ -// utf by pietro gagliardi (andlabs) — https://github.com/andlabs/utf/ -// 10 november 2016 -#include "utf.h" - -// this code imitates Go's unicode/utf8 and unicode/utf16 -// the biggest difference is that a rune is unsigned instead of signed (because Go guarantees what a right shift on a signed number will do, whereas C does not) -// it is also an imitation so we can license it under looser terms than the Go source -#define badrune 0xFFFD - -// encoded must be at most 4 bytes -// TODO clean this code up somehow -size_t utf8EncodeRune(uint32_t rune, char *encoded) -{ - uint8_t b; - uint8_t c = 0; - uint8_t d = 0; - uint8_t e = 0; - size_t n; - - // not in the valid range for Unicode - if (rune > 0x10FFFF) - rune = badrune; - // surrogate runes cannot be encoded - if (rune >= 0xD800 && rune < 0xE000) - rune = badrune; - - if (rune < 0x80) { // ASCII bytes represent themselves - b = (uint8_t) (rune & 0xFF); - n = 1; - goto done; - } - if (rune < 0x800) { // two-byte encoding - c = (uint8_t) (rune & 0x3F); - c |= 0x80; - rune >>= 6; - b = (uint8_t) (rune & 0x1F); - b |= 0xC0; - n = 2; - goto done; - } - if (rune < 0x10000) { // three-byte encoding - d = (uint8_t) (rune & 0x3F); - d |= 0x80; - rune >>= 6; - c = (uint8_t) (rune & 0x3F); - c |= 0x80; - rune >>= 6; - b = (uint8_t) (rune & 0x0F); - b |= 0xE0; - n = 3; - goto done; - } - // otherwise use a four-byte encoding - e = (uint8_t) (rune & 0x3F); - e |= 0x80; - rune >>= 6; - d = (uint8_t) (rune & 0x3F); - d |= 0x80; - rune >>= 6; - c = (uint8_t) (rune & 0x3F); - c |= 0x80; - rune >>= 6; - b = (uint8_t) (rune & 0x07); - b |= 0xF0; - n = 4; - -done: - encoded[0] = b; - if (n > 1) - encoded[1] = c; - if (n > 2) - encoded[2] = d; - if (n > 3) - encoded[3] = e; - return n; -} - -const char *utf8DecodeRune(const char *s, size_t nElem, uint32_t *rune) -{ - uint8_t b, c; - uint8_t lowestAllowed, highestAllowed; - size_t i, expected; - int bad; - - b = (uint8_t) (*s); - if (b < 0x80) { // ASCII bytes represent themselves - *rune = b; - s++; - return s; - } - // 0xC0 and 0xC1 cover 2-byte overlong equivalents - // 0xF5 to 0xFD cover values > 0x10FFFF - // 0xFE and 0xFF were never defined (always illegal) - if (b < 0xC2 || b > 0xF4) { // invalid - *rune = badrune; - s++; - return s; - } - - // this determines the range of allowed first continuation bytes - lowestAllowed = 0x80; - highestAllowed = 0xBF; - switch (b) { - case 0xE0: - // disallow 3-byte overlong equivalents - lowestAllowed = 0xA0; - break; - case 0xED: - // disallow surrogate characters - highestAllowed = 0x9F; - break; - case 0xF0: - // disallow 4-byte overlong equivalents - lowestAllowed = 0x90; - break; - case 0xF4: - // disallow values > 0x10FFFF - highestAllowed = 0x8F; - break; - } - - // and this determines how many continuation bytes are expected - expected = 1; - if (b >= 0xE0) - expected++; - if (b >= 0xF0) - expected++; - if (nElem != 0) { // are there enough bytes? - nElem--; - if (nElem < expected) { // nope - *rune = badrune; - s++; - return s; - } - } - - // ensure that everything is correct - // if not, **only** consume the initial byte - bad = 0; - for (i = 0; i < expected; i++) { - c = (uint8_t) (s[1 + i]); - if (c < lowestAllowed || c > highestAllowed) { - bad = 1; - break; - } - // the old lowestAllowed and highestAllowed is only for the first continuation byte - lowestAllowed = 0x80; - highestAllowed = 0xBF; - } - if (bad) { - *rune = badrune; - s++; - return s; - } - - // now do the topmost bits - if (b < 0xE0) - *rune = b & 0x1F; - else if (b < 0xF0) - *rune = b & 0x0F; - else - *rune = b & 0x07; - s++; // we can finally move on - - // now do the continuation bytes - for (; expected; expected--) { - c = (uint8_t) (*s); - s++; - c &= 0x3F; // strip continuation bits - *rune <<= 6; - *rune |= c; - } - - return s; -} - -// encoded must have at most 2 elements -size_t utf16EncodeRune(uint32_t rune, uint16_t *encoded) -{ - uint16_t low, high; - - // not in the valid range for Unicode - if (rune > 0x10FFFF) - rune = badrune; - // surrogate runes cannot be encoded - if (rune >= 0xD800 && rune < 0xE000) - rune = badrune; - - if (rune < 0x10000) { - encoded[0] = (uint16_t) rune; - return 1; - } - - rune -= 0x10000; - low = (uint16_t) (rune & 0x3FF); - rune >>= 10; - high = (uint16_t) (rune & 0x3FF); - encoded[0] = high | 0xD800; - encoded[1] = low | 0xDC00; - return 2; -} - -// TODO see if this can be cleaned up somehow -const uint16_t *utf16DecodeRune(const uint16_t *s, size_t nElem, uint32_t *rune) -{ - uint16_t high, low; - - if (*s < 0xD800 || *s >= 0xE000) { - // self-representing character - *rune = *s; - s++; - return s; - } - if (*s >= 0xDC00) { - // out-of-order surrogates - *rune = badrune; - s++; - return s; - } - if (nElem == 1) { // not enough elements - *rune = badrune; - s++; - return s; - } - high = *s; - high &= 0x3FF; - if (s[1] < 0xDC00 || s[1] >= 0xE000) { - // bad surrogate pair - *rune = badrune; - s++; - return s; - } - s++; - low = *s; - s++; - low &= 0x3FF; - *rune = high; - *rune <<= 10; - *rune |= low; - *rune += 0x10000; - return s; -} - -// TODO find a way to reduce the code in all of these somehow -// TODO find a way to remove u as well -size_t utf8RuneCount(const char *s, size_t nElem) -{ - size_t len; - uint32_t rune; - - if (nElem != 0) { - const char *t, *u; - - len = 0; - t = s; - while (nElem != 0) { - u = utf8DecodeRune(t, nElem, &rune); - len++; - nElem -= u - t; - t = u; - } - return len; - } - len = 0; - while (*s) { - s = utf8DecodeRune(s, nElem, &rune); - len++; - } - return len; -} - -size_t utf8UTF16Count(const char *s, size_t nElem) -{ - size_t len; - uint32_t rune; - uint16_t encoded[2]; - - if (nElem != 0) { - const char *t, *u; - - len = 0; - t = s; - while (nElem != 0) { - u = utf8DecodeRune(t, nElem, &rune); - len += utf16EncodeRune(rune, encoded); - nElem -= u - t; - t = u; - } - return len; - } - len = 0; - while (*s) { - s = utf8DecodeRune(s, nElem, &rune); - len += utf16EncodeRune(rune, encoded); - } - return len; -} - -size_t utf16RuneCount(const uint16_t *s, size_t nElem) -{ - size_t len; - uint32_t rune; - - if (nElem != 0) { - const uint16_t *t, *u; - - len = 0; - t = s; - while (nElem != 0) { - u = utf16DecodeRune(t, nElem, &rune); - len++; - nElem -= u - t; - t = u; - } - return len; - } - len = 0; - while (*s) { - s = utf16DecodeRune(s, nElem, &rune); - len++; - } - return len; -} - -size_t utf16UTF8Count(const uint16_t *s, size_t nElem) -{ - size_t len; - uint32_t rune; - char encoded[4]; - - if (nElem != 0) { - const uint16_t *t, *u; - - len = 0; - t = s; - while (nElem != 0) { - u = utf16DecodeRune(t, nElem, &rune); - len += utf8EncodeRune(rune, encoded); - nElem -= u - t; - t = u; - } - return len; - } - len = 0; - while (*s) { - s = utf16DecodeRune(s, nElem, &rune); - len += utf8EncodeRune(rune, encoded); - } - return len; -} diff --git a/third_party/NordicSemiconductor/libraries/utf_converter/utf.h b/third_party/NordicSemiconductor/libraries/utf_converter/utf.h deleted file mode 100644 index b810a49de..000000000 --- a/third_party/NordicSemiconductor/libraries/utf_converter/utf.h +++ /dev/null @@ -1,61 +0,0 @@ -// utf by pietro gagliardi (andlabs) — https://github.com/andlabs/utf/ -// 10 november 2016 - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -// if nElem == 0, assume the buffer has no upper limit and is '\0' terminated -// otherwise, assume buffer is NOT '\0' terminated but is bounded by nElem *elements* - -extern size_t utf8EncodeRune(uint32_t rune, char *encoded); -extern const char *utf8DecodeRune(const char *s, size_t nElem, uint32_t *rune); -extern size_t utf16EncodeRune(uint32_t rune, uint16_t *encoded); -extern const uint16_t *utf16DecodeRune(const uint16_t *s, size_t nElem, uint32_t *rune); - -extern size_t utf8RuneCount(const char *s, size_t nElem); -extern size_t utf8UTF16Count(const char *s, size_t nElem); -extern size_t utf16RuneCount(const uint16_t *s, size_t nElem); -extern size_t utf16UTF8Count(const uint16_t *s, size_t nElem); - -#ifdef __cplusplus -} - -// Provide overloads on Windows for using these functions with wchar_t and WCHAR when wchar_t is a keyword in C++ mode (the default). -// Otherwise, you'd need to cast to pass a wchar_t pointer, WCHAR pointer, or equivalent to these functions. -// We use __wchar_t to be independent of the setting; see https://blogs.msdn.microsoft.com/oldnewthing/20161201-00/?p=94836 (ironically posted one day after I initially wrote this code!). -// TODO check this on MinGW-w64 -// TODO check this under /Wall -// TODO C-style casts enough? or will that fail in /Wall? -// TODO same for UniChar/unichar on Mac? if both are unsigned then we have nothing to worry about -#if defined(_MSC_VER) - -inline size_t utf16EncodeRune(uint32_t rune, __wchar_t *encoded) -{ - return utf16EncodeRune(rune, reinterpret_cast(encoded)); -} - -inline const __wchar_t *utf16DecodeRune(const __wchar_t *s, size_t nElem, uint32_t *rune) -{ - const uint16_t *ret; - - ret = utf16DecodeRune(reinterpret_cast(s), nElem, rune); - return reinterpret_cast(ret); -} - -inline size_t utf16RuneCount(const __wchar_t *s, size_t nElem) -{ - return utf16RuneCount(reinterpret_cast(s), nElem); -} - -inline size_t utf16UTF8Count(const __wchar_t *s, size_t nElem) -{ - return utf16UTF8Count(reinterpret_cast(s), nElem); -} - -#endif - -#endif diff --git a/third_party/NordicSemiconductor/nrfx/.gitignore b/third_party/NordicSemiconductor/nrfx/.gitignore deleted file mode 100644 index 16e737e81..000000000 --- a/third_party/NordicSemiconductor/nrfx/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -doc/html/* -doc/warnings_nrfx.txt diff --git a/third_party/NordicSemiconductor/nrfx/CHANGELOG.md b/third_party/NordicSemiconductor/nrfx/CHANGELOG.md deleted file mode 100644 index a148f3340..000000000 --- a/third_party/NordicSemiconductor/nrfx/CHANGELOG.md +++ /dev/null @@ -1,230 +0,0 @@ -# Changelog -All notable changes to this project are documented in this file. - -## [1.8.0] - 2019-08-27 -### Added -- Added support for nRF52833. -- Added bus recovery feature in the TWI and TWIM drivers. -- Added the nrfx_gppi helper layer to facilitate developing generic code that can utilize PPI or DPPI, depending on which interface is available in a given SoC. - -### Changed -- Updated MDK to version 8.27.0. - -### Fixed -- Fixed an issue in the TWIM driver that would make the driver stuck when a premature STOP condition was generated by a slave device. The driver now handles this situation properly and signals that a bus error occurred. -- Fixed a frame timing bug in the NFCT driver. Previously, the timing of the SENS_RES response could be violated after the NFCT peripheral was put to the Sleep state with the SLP_REQ command. - -## [1.7.2] - 2019-07-25 -### Added -- Added functions in the DPPI, GPIOTE, PPI, RTC, and TIMER HALs for getting tasks and events specified by index. -- Added the possibility of suspending transfers in the TWI driver. This allows combining several transfers into one continuous TWI transaction. -- Added termination of transfers at deinitialization of the UARTE driver. -- Added buffer alignment checks in the QSPI driver. -- Introduced the NRFX_OFFSETOF macro that duplicates the functionality of the built-in offsetof() mechanism, but can be used without issues also with non-constant expressions. -- Added an alternative way of ending the DMA transfer loop in the USBD driver. -- Added the CTSTARTED and CTSTOPPED events to the CLOCK HAL. - -### Changed -- Removed an assertion that prevented setting the data payload size of isochronous endpoints to zero, to fulfill requirements of the USB 2.0 specification, paragraph 5.6.3. -- Declared the tx_buffer_length field in the UART driver's control block as volatile to prevent issues in case of compilation with high optimization level. - -### Fixed -- Fixed an incorrect conversion of frequency values in the RADIO HAL. -- Fixed an incorrectly enabled interrupt in the QSPI driver. -- Corrected the LFCLK source selection values in the template configuration file for nRF9160. -- Fixed support for external LFCLK sources for nRF52811. - -## [1.7.1] - 2019-04-08 -### Added -- Added functions in the NVMC driver for getting the flash page size, the count of pages and the total flash size. - -### Fixed -- Fixed handling of short unaligned write requests (1 or 2 bytes in length) in the nrfx_nvmc_bytes_write() function. - -## [1.7.0] - 2019-03-29 -### Added -- Added drivers for NVMC and TEMP. -- Added HALs: AAR and FICR. -- Added support for the custom instruction long frame mode in the QSPI driver. - -### Changed -- Reworked HAL for NVMC. Now it can be used for all SoCs supported by nrfx. -- Reworked HAL for TEMP. -- Improved documentation. Now it is more precise and can be generated without warnings with newer versions of doxygen. -- Improved the UARTE driver to consume less current after the TX operation. Now at the end of the transmission the transmitter is turned off by the STOPTX task. -- Improved C++ support in drivers. Now fields in structures are filled up in the correct order. -- Changed to size_t the type used for holding the amount of data in the TWIS driver. - -### Fixed -- Fixed a race condition in the USBD driver. It could occur when an IN transfer was interrupted by an OUT transaction, which in turn was interrupted by a process with a higher priority. - -## [1.6.2] - 2019-02-12 -### Added -- Added the possibility to use the macro NRFX_COREDEP_DELAY_US_LOOP_CYCLES to specify the number of cycles consumed by one iteration of the internal loop in the function nrfx_coredep_delay_us(). - -### Changed -- Updated MDK to version 8.24.1. - -## [1.6.1] - 2019-01-29 -### Fixed -- Fixed an issue in the NFCT driver that caused a performance loss on nRF52832. The interrupt configuration is now properly restored after the NRFX_NFCT_EVT_FIELD_LOST event. - -## [1.6.0] - 2019-01-18 -### Added -- Added support for nRF52811. -- Added support for the legacy peripherals SPI, TWI, and UART in nRF52810. -- Added support for SAMPLERATE in nrf_saadc.h. -- Added clearing of the STOPPED event in the nrfx_saadc_init() function to prevent driver deadlock in some cases. -- Added HALs: BPROT, MPU, MWU. -- Added function for reading the pin input buffer configuration in the GPIO HAL. -- Implemented workaround for nRF9160 anomaly 1 in the I2S driver. - -### Changed -- Improved handling of hardware anomalies in the USBD driver. -- Updated MDK to version 8.23.1. - -### Fixed -- Fixed the condition in NRFX_WAIT_FOR in the nrfx_saadc_abort() function. The macro now correctly waits for a stop of the driver. -- Fixed the pending interrupt clearing in NVIC in the nrfx_usbd_stop() function. The driver now correctly handles power management. -- Fixed the case when nrfx_uarte_tx_in_progress() function would return an incorrect value. The driver now correctly updates the tx_buffer_length variable internally. - -## [1.5.0] - 2018-12-12 -### Added -- Added support for nRF9160. -- Added allocator for DPPI. -- Added HALs: DPPI, KMU, REGULATORS, SPU, VMC. -- Added support for DPPI subscription and publishing in HALs related to nRF9160. -- Added support for instances 2 and 3 in SPIS, TWIM, TWIS, and UARTE drivers. - -### Changed -- Updated MDK to version 8.21.1. - -### Fixed -- Corrected NRFX_I2S_CONFIG_RATIO value in nrfx_config.h. It now correctly uses supported value. - -## [1.4.0] - 2018-11-30 -### Added -- Added the nrfx_is_word_aligned() function for checking whether an address is word-aligned. -- Added HAL for ACL. -- Added functions for disabling and re-enabling interrupts in the SWI driver. -- Added possibility to completely remove interrupt handling from the WDT driver. - -### Changed -- Updated the documentation for the nrfx_uarte_rx() function. It now correctly reflects the actual behavior of the function. - -### Fixed -- Corrected the type of the nrfx_uarte_xfer_evt_t structure field that holds the amount of transferred bytes. -- Corrected the way of disabling interrupts in the NFCT driver when moving the peripheral to the disabled state. -- Fixed a typo in the name of the bmRequest field in the nrfx_usbd_setup_t structure. The new correct name is bRequest. -- Fixed the nrfx_ppi_channel_fork_assign() function. It now accepts also pre-programmed channels. -- Fixed handling of long custom instruction responses in the QSPI driver. -- Fixed a bug affecting the conversion of time to ticks in the TIMER HAL. - -## [1.3.1] - 2018-09-28 -### Fixed -- Corrected the type of nrfx_usbd_ep_status_get() return value. -- Corrected calls to undefined macros in NFCT and USBD drivers. - -## [1.3.0] - 2018-09-21 -### Added -- Added HAL and driver for NFCT. -- Added driver for USBD. -- Added function for setting the burst mode in the SAADC HAL. -- Added the NRFX_ARRAY_SIZE macro. - -### Changed -- Moved the implementation of nrfx_power_clock_irq_handler() to nrfx_power.c, removed nrfx_power_clock.c. - -### Fixed -- Replaced ARRAY_SIZE macro calls with NRFX_ARRAY_SIZE ones. - -## [1.2.0] - 2018-09-06 -### Added -- Added function for checking if a specific channel is enabled in the GPIOTE HAL. -- Added support for using the QDEC driver without LED. -- Added functions for modifying only the event endpoint or only the task endpoint in the PPI HAL. -- Added function for reading the pin pull configuration in the GPIO HAL. - -### Changed -- Corrected ISOSPLIT enumerator names in the USBD HAL. - -### Fixed -- Fixed a double buffering bug that occurred in the UARTE driver after the RX abort. -- Fixed the TXRX transfers in the TWIM driver. They can now be started after transfers that are not ended with the stop condition. - -## [1.1.0] - 2018-06-15 -### Added -- Implemented workaround for nRF52832 and nRF52840 anomaly 194 in the I2S driver. -- Implemented workaround for nRF52840 anomaly 195 in the SPIM driver. -- Added HALs for CCM, ECB, and RADIO. -- Extended HALs for GPIO, PPI, SAADC, and USBD. -- Added support for external LFCLK sources. - -### Changed -- Corrected handling of transfer lengths in the TWI driver. -- Updated MDK to version 8.17.0. - -### Fixed -- Fixed logging in the PPI driver. -- Fixed SPIM interrupt definition for nRF52810. -- Fixed Slave Select configuration in the SPIM driver. -- Corrected default settings for NRF_SPIM3. -- Fixed a typo in the UARTE TXDRDY event definition. -- Corrected the TIMEOUT event clearing in the WDT interrupt handler. - -## [1.0.0] - 2018-03-21 -### Added -- Added the NRFX_WAIT_FOR macro to improve the time-out functionality in QSPI and SAADC drivers. -- Added glue layer macros for checking and modifying the pending status of interrupts. -- Added new enumeration values for interrupts and events in the UARTE HAL. -- Implemented workarounds for nRF52 anomalies 192 and 201 in the CLOCK driver. -- Implemented workaround for nRF52840 anomaly 122 in the QSPI driver. -- Implemented workaround for nRF52840 anomaly 198 in the SPIM driver. - -### Changed -- Updated MDK to 8.16.0. -- Extended input pin configuration in the GPIOTE driver. -- Unified the way of checking if a required event handler was provided. Now, all drivers do it with assertions. -- Changed the RNG bias correction configuration option to be enabled by default. -- Refactored the ADC driver and HAL. -- Corrected assertions in the TIMER driver to make it usable in debug version with PPI. -- Improved buffer handling in the I2S driver. The API of the driver has been slightly modified. -- Enhanced SPIS driver API: added the "p_context" parameter, allowed NULL pointers for zero-length buffers. - -### Fixed -- Fixed result value casting in the TEMP HAL. -- Fixed types of conversion result and buffer size in the ADC HAL and driver. -- Fixed time-out in the SAADC driver in abort function. - -## [0.8.0] - 2017-12-20 -### Added -- Added XIP support in the QSPI driver. -- Implemented Errata 132 in the CLOCK driver. -- Added function for checking if a TIMER instance is enabled. -- Added extended SPIM support. - -### Changed -- Updated MDK to 8.15.0. Introduced Segger Embedded Studio startup files. -- Updated drivers: COMP, PWM, QDEC, SAADC, SPIS, TIMER, TWI, TWIS. -- Changed the type used for transfer lengths to 'size_t' in drivers: SPI, SPIM, SPIS, TWI, TWIM, TWIS, UART, UARTE. Introduced checking of EasyDMA transfers limits. -- Updated HALs: COMP, NVMC, UART, UARTE, USBD. -- Updated template files and documentation of configuration options. - -### Fixed -- Fixed TWI and TWIM drivers so that they now support GPIOs from all ports. -- Fixed definitions related to compare channels in the TIMER HAL. - -### Removed -- Removed the possibility of passing NULL instead of configuration to get default settings during drivers initialization. -- Removed support for UART1 and PRS box #5. - -## [0.7.0] - 2017-10-20 -### Added -- This CHANGELOG.md file. -- README.md file with simple description and explanations. -- HAL for: ADC, CLOCK, COMP, ECB, EGU, GPIO, GPIOTE, I2S, LPCOMP, NVMC, PDM, POWER, PPI, PWM, QDEC, QSPI, RNG, RTC, SAADC, SPI, SPIM, SPIS, ARM(R) SysTick, TEMP, TIMER, TWI, TWIM, TWIS, UART, UARTE, USBD, WDT. -- Drivers for: ADC, CLOCK, COMP, GPIOTE, I2S, LPCOMP, PDM, POWER, PWM, QDEC, QSPI, RNG, RTC, SAADC, SPI, SPIM, SPIS, ARM(R) SysTick, TIMER, TWI, TWIM, TWIS, UART, UARTE, WDT. -- Allocators for: PPI, SWI/EGU. -- MDK in version 8.14.0. -- Offline documentation for every added driver and simple integration description. -- Template integration files. diff --git a/third_party/NordicSemiconductor/nrfx/LICENSE b/third_party/NordicSemiconductor/nrfx/LICENSE deleted file mode 100644 index ed92c3b4f..000000000 --- a/third_party/NordicSemiconductor/nrfx/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -Copyright (c) 2017 - 2019, Nordic Semiconductor ASA -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - diff --git a/third_party/NordicSemiconductor/nrfx/README.md b/third_party/NordicSemiconductor/nrfx/README.md deleted file mode 100644 index 597398c67..000000000 --- a/third_party/NordicSemiconductor/nrfx/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# nrfx - -## Overview - -nrfx is a standalone set of drivers for peripherals present in Nordic -Semiconductor's SoCs. It originated as an extract from the nRF5 SDK. -The intention was to provide drivers that can be used in various environments -without the necessity to integrate other parts of the SDK into them. -For the user's convenience, the drivers come with the MDK package. This package -contains definitions of register structures and bitfields for all supported -SoCs, as well as startup and initialization files for them. - -## Supported SoCs - -* nRF51 Series -* nRF52810 -* nRF52811 -* nRF52832 -* nRF52833 -* nRF52840 -* nRF9160 - -## Directories - -``` - . - ├── doc # Project documentation files - ├── drivers # nrfx driver files - │ └── include # nrfx driver headers - │ └── src # nrfx driver sources - ├── hal # Hardware Access Layer files - ├── helpers # nrfx driver helper files - ├── mdk # nRF MDK files - ├── soc # SoC specific files - └── templates # Templates of nrfx integration files -``` - -## Generating documentation - -nrfx documentation is available in the `doc\html` folder of the release package. - -You can also generate documentation yourself from the source code. To do it, install doxygen -and run one of the scripts: `generate_html_doc.bat` or `generate_html_doc.sh`. Generated -documentation will be stored in the `doc\html` directory. Use `index.html` to open it. diff --git a/third_party/NordicSemiconductor/nrfx/doc/buildfiles/extra_stylesheet.css b/third_party/NordicSemiconductor/nrfx/doc/buildfiles/extra_stylesheet.css deleted file mode 100644 index 3b53f268d..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/buildfiles/extra_stylesheet.css +++ /dev/null @@ -1,506 +0,0 @@ -.appliesto {background-color:#3D578C;color:#fff} - -div.header -{ - background-image:none; - background-color: #FFF; - border-bottom: 0px; -} - -body, table, div, p, dl { - font-size: 16px; - font-family: Open Sans, Calibri, Arial, Sans-Serif; - color: #474747; - line-height: 20px; - -} - -a.code { - color: #1c99c7; -} - -a.el { - font-weight: normal; -} - -.contents a:visited, a:visited.code { - color: #16779a; -} - -.title { - font-size: 1.34em -} - -h1 { - font-size: 1.25em -} - -h2 { - font-size: 1.15em -} - -h3 { - font-size: 1.05em -} - -h4 { - font-size: 1em -} - -table.memberdecls, table.directory, table.memname { - margin:0px; - border:0px; - -moz-box-shadow: 0 0px 0px #d1d1d1; - -webkit-box-shadow: 0 0px 0px #d1d1d1; - box-shadow: 0 0px 0px #d1d1d1; -} - -table.memberdecls tr { - padding-left:0px; -} - -table.memberdecls tr:hover td, table.memname tr:hover td { - background: inherit; -} - -table.directory tr.even, table.directory tr.odd { - background: inherit; -} - -table.memberdecls td, table.directory td, table.directory td.desc { - border:0px; - padding: 2px 0px 0px; -} - -table.memberdecls td.memSeparator { - background-color:#inherit; - padding:2px; - border-bottom: 1px dotted #DEE4F0; -} - -.mdescLeft, .mdescRight, -.memItemLeft, .memItemRight, -.memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: inherit; -} - -div.levels { - display:none; -} - -table.retval { -border:#ccc 1px solid; -} - - -table.memname td, table.params td, table.retval td { -padding:5px; -border:0px; -} - -div.fragment div.line { -font-size: 14px; -line-height:18px; -} - -table.fieldtable, table.params, table.retval { - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.fieldtable th { - border:none; - border-bottom:1px solid #A8B8D9; -} - -table.blank, table.blank tr th, table.blank tr td { - border:none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.blank tr:hover td { - background: #ffffff; -} - - -#projectlogo -{ - text-align: left; - vertical-align: middle; - border-collapse: separate; -} - -#projectname -{ - font-size: 40px; - font-family: Open Sans, Calibri, Arial, Sans-Serif; - margin: 0px; - padding: 2px 0px; -} - -#projectbrief -{ - font-size: 30px; - margin: 0px; - padding: 0px; -} - -#titlearea -{ - border-bottom: 1px solid #e0e0e0; -} - -.label a, .item a -{ - border-bottom: none; - -} - -#nav-tree { - background-image: none; - background-color: #FAFAFA; -} - -div.contents { - margin-left: 30px; - margin-right: 30px; - -} - -div.header { - margin-left: 20px; -} - -table td.doclinks a { - font-size: 12px; - font-style: italic; - color: #e97c25; - border: 1px solid #e97c25; - padding: 2px 5px; - text-decoration: none; -} - -table td.docselected a { - background: #e97c25; - color: #fff; -} - -table td.doclinkintro { - font-size: 12px; - font-style: italic; -} - - -/* nordic.css */ -.p { - margin-top: .3em; -} - -/* fix for table spacing */ -td p.p { - margin: 0em; - padding: 0px; -} -dt.line_sep { - border-top: solid #c9c9c9 1px; - padding-top: 5px; - -} - -a -{ - color: #1c99c7; - text-decoration: none; - border-bottom: 1px #e5e5e5 solid; - -} - -a:visited -{ - color: #16779a; -} -a:hover -{ - color: #none; - text-decoration: underline; - border: none; -} - -a:active -{ - -} - -ul.ul { - margin-top: 4px; - margin-bottom: 10px; -} - - -a[href*='.pdf'] { -background:transparent url(./pdf.png) center left no-repeat; -padding-left:22px; -line-height:18px; -} - - -a[href*='.zip'] { -background:transparent url(./zip_s.png) center left no-repeat; -padding-left:22px; -line-height:18px; -} - -a[href*='.exe'] { -background:transparent url(./execute_s.png) center left no-repeat; -padding-left:22px; -line-height:18px; -} - -a[href*='.msi'] { -background:transparent url(./msi_s.png) center left no-repeat; -padding-left:22px; -line-height:18px; -} - -table a:link { - color: #1c99c7; - text-decoration: none; - border-bottom: 1px #e5e5e5 solid; -} -table a:visited { - color: #16779a; -} -table a:active, -table a:hover { - color: #none; - text-decoration: underline; - border: none; -} -table { - font-family:Calibri, Arial, Sans-Serif; - color:#474747; - font-size:16px; - margin-left: auto; - margin-right: auto; - border:#ccc 1px solid; - - - -moz-box-shadow: 0 1px 2px #d1d1d1; - -webkit-box-shadow: 0 1px 2px #d1d1d1; - box-shadow: 0 1px 2px #d1d1d1; -} -table th { - color: #000; - font-size: 18px; - font-weight: bold; - text-align: left; - padding:10px 15px 10px 10px; - border-top:1px solid #7eceed; - border-bottom:1px solid #7eceed; - border-right:1px solid #7eceed; - border-left:1px solid #7eceed; - - background: #7eceed; - background: -webkit-gradient(linear, left top, left bottom, from(#7eceed), to(#7eceed)); - background: -moz-linear-gradient(top, #7eceed, #7eceed); -} - -table th.center { - text-align: center; -} -table tr { - text-align: left; - -} -table td { - padding:5px 5px 5px 10px; - border-top: 1px solid #ffffff; - border-bottom:1px solid #e0e0e0; - border-left: 1px solid #e0e0e0; - border-right: 1px solid #e0e0e0; - -} -table tr:hover td { - background: #ebebeb; - background: -webkit-gradient(linear, left top, left bottom, from(#f2f2f2), to(#f0f0f0)); - background: -moz-linear-gradient(top, #f2f2f2, #f0f0f0); -} - - - - -img { - border: 0; - margin-left: auto; - margin-right: auto; - max-width:100%; -} - - -/* make svg files scale in IE. compatible with Dita OT v2.0 -img:not(.png) { - width: 100%; - margin-left: auto; - margin-right: auto; -} -*/ - - -/* make svg files scale in IE */ -embed.image:not(.png):not(.gif):not(.jpg) { - width: 100%; - margin-left: auto; - margin-right: auto; - margin-bottom: 15px; -} - -svg { - position: absolute; - top: 0; - left: 0; - -} - -caption { - caption-side: bottom; - text-align: center; - font-size: 100%; - font-weight: bold; - margin-top: 15px; - margin-bottom: 35px; - - } - -figdesc { - caption-side: bottom; - text-align: center; - font-size: 100%; - font-weight: bold; - margin-top: 15px; - margin-bottom: 20px; - - } - -/* to get figure captions to appear below the image and center */ - -div.fig { - display: table; - width: 100%; - margin-top: 10px; - margin-bottom: 55px; -} - -div.fig span.figcap { - display:table-footer-group; - text-align:center; - font-size: 100%; - font-weight: bold; - margin-top: 10px; - margin-bottom: 20px; - font-style: normal; -} -div.fig div.imagecenter { - display:table-row-group; -} - - -/* fix to hide borders in image maps (Chrome only) */ -img.map, map area{ - outline: none; -} - - -/* fix placement of ® */ -sup { - line-height: 1em; -} - -.sdkversion span { - font-size: 12px; - font-style: italic; - color: #e97c25; - border: 1px solid #e97c25; - padding: 2px 5px; -} - -.sdkversion { - text-align: right; -} - -.whichSDs span,.whichnRF span { - font-size: 12px; - font-style: italic; - color: #e97c25; - border: 1px solid #e97c25; - padding: 2px 5px; - } - -.whichSDs.nRF52 span,.whichnRF.nRF52 span { - color: #e97c25; - border-color: #e97c25; -} - -.whichSDs.nRF52840 span,.whichnRF.nRF52840 span { - color: #0081B7; - border-color: #0081B7; -} - -.whichSDs.nRF51 span,.whichnRF.nRF51 span { - color: #7f7f7f; - border-color: #7f7f7f; -} - -div.whichnRF { - padding-bottom: 5px; -} - -span.whichnRF{ - font-size: 12px; - font-style: italic; - color: #e97c25; - border: 1px solid #e97c25; - padding: 2px 5px; -} - -span.whichnRF.nRF52 { - color: #e97c25; - border-color: #e97c25; -} - -span.whichnRF.nRF52840 { - color: #0081B7; - border-color: #0081B7; -} - -span.whichnRF.nRF51 { - color: #7f7f7f; - border-color: #7f7f7f; -} - -.orange { - color: #e97c25; -} - -hr { - margin-top:20px; - border-top:1px solid #8EA7B0; -} - - -.directory td.entry { - white-space: normal; - width:50%; -} - -/* overrides */ -.topicfooter { - text-align: right; -// margin-top: 1px; - padding-right: 10px; - box-shadow: inset 0px 1px 0px 0px #e0e0e0; - font-size: 13px; -} - diff --git a/third_party/NordicSemiconductor/nrfx/doc/buildfiles/favicon.ico b/third_party/NordicSemiconductor/nrfx/doc/buildfiles/favicon.ico deleted file mode 100644 index 0bd6cc084510296cd3415452a8ac627b8279a523..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26694 zcme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@$d%n|Vs@<9tnxeih^bhO-v^BtNAIMH_m9%VJ7A`| z+{4@9IDQ=O(4LagVMoEInu+}nVaq$iAKjN<_-by7LA@`)2>-lf14(l|z5iuIJE{{a zuVWsqmTeBIum1g69=*OdS9#9HTnaxnFv)Yc#rGV(fL~ny2KV~lwF;|s1io|pKOe9q zKIe6?Rbl4ieIY#!mi2>8V)~b zTOPBq1Grx=#4TQe&uvVR?K&W1mG&Ngg*n>^&-CBL9?GO$55xBA0^fCS)E@|c<+yyo zaTPX~yzW)RxnkbIT#tE?_L0(F#v4C8YN;Ra$v}EF@Mpk&t**Sf40hk!*kg@-vxjNVFU{rBdO`TJPj<%pbhB|kHt>WW`eCn7 z5A*oPYpRoWdgtR^vh0)akznsq=8?ywbrSWmyq>;Z7V~iw`BUk>)L_0#*wq(nO?R~L3wWqUJR?x3q3t}(gw}$W=1%H}HF@~QAW_SAYgj5Gzv;P5^-XJ6Z diff --git a/third_party/NordicSemiconductor/nrfx/doc/buildfiles/footer.html b/third_party/NordicSemiconductor/nrfx/doc/buildfiles/footer.html deleted file mode 100644 index 974fce90c..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/buildfiles/footer.html +++ /dev/null @@ -1,10 +0,0 @@ -

- - diff --git a/third_party/NordicSemiconductor/nrfx/doc/buildfiles/header.html b/third_party/NordicSemiconductor/nrfx/doc/buildfiles/header.html deleted file mode 100644 index 1c3b27ef8..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/buildfiles/header.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - -$projectname $projectnumber: $title -$title - - - -$treeview -$search -$mathjax - -$extrastylesheet - - - - - -
- - -
- - - - - - - - - - - - - - - - - - - - - -
-
$projectname -  $projectnumber -
-
$projectbrief
-
-
$projectbrief
-
$searchbox
-
- - diff --git a/third_party/NordicSemiconductor/nrfx/doc/buildfiles/layout.xml b/third_party/NordicSemiconductor/nrfx/doc/buildfiles/layout.xml deleted file mode 100644 index 3bd29b76c..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/buildfiles/layout.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/third_party/NordicSemiconductor/nrfx/doc/buildfiles/nordic_small.png b/third_party/NordicSemiconductor/nrfx/doc/buildfiles/nordic_small.png deleted file mode 100644 index 9ebfb7b56fe34f80b39288e2ce7e035deb518702..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4338 zcmVZPiBbI#DebNWnI)!n-4ySKjkec!#K2t)naZrIj6D82?90zHRz)-r-2?mr z)&AkU3EuPTPDfc|(VPH)MLV>f;9T8`R(Ek_)&J$Ct`cn;e*v#scNwT@z?XeeZUJ>G zW2=^A-I@g(yK<Kf06*ceciY15?_aF^XEbuYa0I5jn~EZbb74H6gdT5Zv5 z{naR@0LSL3{Etz(mNy5^pjO!lSDxR{6J?J@tCM|8@fUEH*HQLFY6h>&uDK=J8Y1Ac z*Yzi&W&-^RRL`quHIXZ;)-bEF6A}Az&_e>}4ldvT8h8$6-%?UrN+@P;=tIPQjb!Uc zzOjLsSnMOF%0uN0C*Xq8>*4S)YK9&Pm9IpbB8qAm30C_e)MWwVvH2&8xu6fDl~u6X zw5o#gYk>dFvV;?X-fn5Ya-@@HqPLR|WFGQTfO;%o5O6VYGNK;t2R;J+?359tlO7NB z&2aqyunpMhQ%-;2xHQ*xIr%>f&>olGz)8;c7|;+f-|@h3U;uJYIy&`#2&@EN0}f}X za|f_1ilr==2ecHV21^~C$I|Wv&dgI;T@V3#ip;_dPzl@xY(yS@E-0srCBPjyl+z8k4roLM zfsQ%03m^jA2fPA&4Syfa7lHplI+$DkH-Y~LdI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w9O5vOW{=W>9mfh&{n&gY&mS8MKy(D!PTc!WSzBn1 zEalt%vsqbQ;s_(0Ra$FB-MT8UhM`m?*d4LebgmlsQ9)YwEdT%j07*qoM6N<$f{c+A$^ZZW diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_adc_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_adc_dox_config.h deleted file mode 100644 index a78308bd5..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_adc_dox_config.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * - * @defgroup nrfx_adc_config ADC peripheral driver configuration - * @{ - * @ingroup nrfx_adc - */ -/** @brief Enable the driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_ADC_ENABLED -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_ADC_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_ADC_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_ADC_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_ADC_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_ADC_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_clock_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_clock_dox_config.h deleted file mode 100644 index 4a772d631..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_clock_dox_config.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * - * @defgroup nrfx_clock_config CLOCK peripheral driver configuration - * @{ - * @ingroup nrfx_clock - */ -/** @brief Enable CLOCK driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_CLOCK_ENABLED -/** @brief LF Clock Source - * - * Following options are available: - * - 0 - RC - * - 1 - XTAL - * - 2 - Synth - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_CLOCK_CONFIG_LF_SRC - -/** @brief Enables LF Clock Calibration Support - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_CLOCK_CONFIG_LF_CAL_ENABLED - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_CLOCK_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_CLOCK_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_CLOCK_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_CLOCK_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_CLOCK_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_comp_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_comp_dox_config.h deleted file mode 100644 index 353e3b7d3..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_comp_dox_config.h +++ /dev/null @@ -1,158 +0,0 @@ -/** - * - * @defgroup nrfx_comp_config COMP peripheral driver configuration - * @{ - * @ingroup nrfx_comp - */ -/** @brief Enable COMP driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_ENABLED -/** @brief Reference voltage - * - * Following options are available: - * - 0 - Internal 1.2V - * - 1 - Internal 1.8V - * - 2 - Internal 2.4V - * - 4 - VDD - * - 7 - ARef - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_REF - -/** @brief Main mode - * - * Following options are available: - * - 0 - Single ended - * - 1 - Differential - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_MAIN_MODE - -/** @brief Speed mode - * - * Following options are available: - * - 0 - Low power - * - 1 - Normal - * - 2 - High speed - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_SPEED_MODE - -/** @brief Hystheresis - * - * Following options are available: - * - 0 - No - * - 1 - 50mV - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_HYST - -/** @brief Current Source - * - * Following options are available: - * - 0 - Off - * - 1 - 2.5 uA - * - 2 - 5 uA - * - 3 - 10 uA - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_ISOURCE - -/** @brief Analog input - * - * Following options are available: - * - 0 - * - 1 - * - 2 - * - 3 - * - 4 - * - 5 - * - 6 - * - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_INPUT - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_COMP_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_gpiote_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_gpiote_dox_config.h deleted file mode 100644 index 7eddaa90c..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_gpiote_dox_config.h +++ /dev/null @@ -1,93 +0,0 @@ -/** - * - * @defgroup nrfx_gpiote_config GPIOTE peripheral driver configuration - * @{ - * @ingroup nrfx_gpiote - */ -/** @brief Enable GPIOTE driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_GPIOTE_ENABLED -/** @brief Number of lower power input pins - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_GPIOTE_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_GPIOTE_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_GPIOTE_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_GPIOTE_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_i2s_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_i2s_dox_config.h deleted file mode 100644 index de315e918..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_i2s_dox_config.h +++ /dev/null @@ -1,225 +0,0 @@ -/** - * - * @defgroup nrfx_i2s_config I2S peripheral driver configuration - * @{ - * @ingroup nrfx_i2s - */ -/** @brief Enable I2S driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_ENABLED -/** @brief SCK pin - * - * Minimum value: 0 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_SCK_PIN - -/** @brief LRCK pin - * - * Minimum value: 1 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_LRCK_PIN - -/** @brief MCK pin - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_MCK_PIN - -/** @brief SDOUT pin - * - * Minimum value: 0 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_SDOUT_PIN - -/** @brief SDIN pin - * - * Minimum value: 0 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_SDIN_PIN - -/** @brief Mode - * - * Following options are available: - * - 0 - Master - * - 1 - Slave - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_MASTER - -/** @brief Format - * - * Following options are available: - * - 0 - I2S - * - 1 - Aligned - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_FORMAT - -/** @brief Alignment - * - * Following options are available: - * - 0 - Left - * - 1 - Right - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_ALIGN - -/** @brief Sample width (bits) - * - * Following options are available: - * - 0 - 8 - * - 1 - 16 - * - 2 - 24 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_SWIDTH - -/** @brief Channels - * - * Following options are available: - * - 0 - Stereo - * - 1 - Left - * - 2 - Right - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_CHANNELS - -/** @brief MCK behavior - * - * Following options are available: - * - 0 - Disabled - * - 2147483648 - 32MHz/2 - * - 1342177280 - 32MHz/3 - * - 1073741824 - 32MHz/4 - * - 805306368 - 32MHz/5 - * - 671088640 - 32MHz/6 - * - 536870912 - 32MHz/8 - * - 402653184 - 32MHz/10 - * - 369098752 - 32MHz/11 - * - 285212672 - 32MHz/15 - * - 268435456 - 32MHz/16 - * - 201326592 - 32MHz/21 - * - 184549376 - 32MHz/23 - * - 142606336 - 32MHz/30 - * - 138412032 - 32MHz/31 - * - 134217728 - 32MHz/32 - * - 100663296 - 32MHz/42 - * - 68157440 - 32MHz/63 - * - 34340864 - 32MHz/125 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_MCK_SETUP - -/** @brief MCK/LRCK ratio - * - * Following options are available: - * - 0 - 32x - * - 1 - 48x - * - 2 - 64x - * - 3 - 96x - * - 4 - 128x - * - 5 - 192x - * - 6 - 256x - * - 7 - 384x - * - 8 - 512x - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_RATIO - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_I2S_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_lpcomp_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_lpcomp_dox_config.h deleted file mode 100644 index f74c2bbee..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_lpcomp_dox_config.h +++ /dev/null @@ -1,146 +0,0 @@ -/** - * - * @defgroup nrfx_lpcomp_config LPCOMP peripheral driver configuration - * @{ - * @ingroup nrfx_lpcomp - */ -/** @brief Enable LPCOMP driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_LPCOMP_ENABLED -/** @brief Reference voltage - * - * Following options are available: - * - 0 - Supply 1/8 - * - 1 - Supply 2/8 - * - 2 - Supply 3/8 - * - 3 - Supply 4/8 - * - 4 - Supply 5/8 - * - 5 - Supply 6/8 - * - 6 - Supply 7/8 - * - 8 - Supply 1/16 (nRF52) - * - 9 - Supply 3/16 (nRF52) - * - 10 - Supply 5/16 (nRF52) - * - 11 - Supply 7/16 (nRF52) - * - 12 - Supply 9/16 (nRF52) - * - 13 - Supply 11/16 (nRF52) - * - 14 - Supply 13/16 (nRF52) - * - 15 - Supply 15/16 (nRF52) - * - 7 - External Ref 0 - * - 65543 - External Ref 1 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_LPCOMP_CONFIG_REFERENCE - -/** @brief Detection - * - * Following options are available: - * - 0 - Crossing - * - 1 - Up - * - 2 - Down - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_LPCOMP_CONFIG_DETECTION - -/** @brief Analog input - * - * Following options are available: - * - 0 - * - 1 - * - 2 - * - 3 - * - 4 - * - 5 - * - 6 - * - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_LPCOMP_CONFIG_INPUT - -/** @brief Hysteresis - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_LPCOMP_CONFIG_HYST - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_LPCOMP_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_LPCOMP_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_LPCOMP_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_LPCOMP_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_LPCOMP_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_nfct_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_nfct_dox_config.h deleted file mode 100644 index 02464373a..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_nfct_dox_config.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * - * @defgroup nrfx_nfct_config NFCT peripheral driver configuration - * @{ - * @ingroup nrfx_nfct - */ -/** @brief Enable NFCT driver. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_NFCT_ENABLED - -/** @brief Interrupt priority. - * - * The following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_NFCT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_NFCT_CONFIG_LOG_ENABLED - -/** @brief Default Severity level. - * - * The following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_NFCT_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * The following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_NFCT_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * The following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_NFCT_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_pdm_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_pdm_dox_config.h deleted file mode 100644 index 9e7e146b4..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_pdm_dox_config.h +++ /dev/null @@ -1,117 +0,0 @@ -/** - * - * @defgroup nrfx_pdm_config PDM peripheral driver configuration - * @{ - * @ingroup nrfx_pdm - */ -/** @brief Enable PDM driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PDM_ENABLED -/** @brief Mode - * - * Following options are available: - * - 0 - Stereo - * - 1 - Mono - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PDM_CONFIG_MODE - -/** @brief Edge - * - * Following options are available: - * - 0 - Left falling - * - 1 - Left rising - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PDM_CONFIG_EDGE - -/** @brief Clock frequency - * - * Following options are available: - * - 134217728 - 1000k - * - 138412032 - 1032k (default) - * - 142606336 - 1067k - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PDM_CONFIG_CLOCK_FREQ - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PDM_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PDM_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PDM_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PDM_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PDM_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_power_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_power_dox_config.h deleted file mode 100644 index 4970e16b1..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_power_dox_config.h +++ /dev/null @@ -1,51 +0,0 @@ -/** - * - * @defgroup nrfx_power_config POWER peripheral driver configuration - * @{ - * @ingroup nrfx_power - */ -/** @brief Enable POWER driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_POWER_ENABLED -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_POWER_CONFIG_IRQ_PRIORITY - -/** @brief The default configuration of main DCDC regulator - * - * This settings means only that components for DCDC regulator are installed and it can be enabled. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN - -/** @brief The default configuration of High Voltage DCDC regulator - * - * This settings means only that components for DCDC regulator are installed and it can be enabled. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_ppi_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_ppi_dox_config.h deleted file mode 100644 index 85e6126f5..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_ppi_dox_config.h +++ /dev/null @@ -1,70 +0,0 @@ -/** - * - * @defgroup nrfx_ppi_config PPI peripheral allocator configuration - * @{ - * @ingroup nrfx_ppi - */ -/** @brief Enabling PPI allocator - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PPI_ENABLED -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PPI_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PPI_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PPI_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PPI_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_prs_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_prs_dox_config.h deleted file mode 100644 index 745d7ce26..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_prs_dox_config.h +++ /dev/null @@ -1,110 +0,0 @@ -/** - * - * @defgroup nrfx_prs_config Peripheral Resource Sharing module configuration - * @{ - * @ingroup nrfx_prs - */ -/** @brief Enabling peripherals with same ID coexistence - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PRS_ENABLED -/** @brief Enables box 0 in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PRS_BOX_0_ENABLED - -/** @brief Enables box 1 in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PRS_BOX_1_ENABLED - -/** @brief Enables box 2 in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PRS_BOX_2_ENABLED - -/** @brief Enables box 3 in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PRS_BOX_3_ENABLED - -/** @brief Enables box 4 in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PRS_BOX_4_ENABLED - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PRS_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PRS_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PRS_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PRS_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_pwm_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_pwm_dox_config.h deleted file mode 100644 index 9cd940371..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_pwm_dox_config.h +++ /dev/null @@ -1,239 +0,0 @@ -/** - * - * @defgroup nrfx_pwm_config PWM peripheral driver configuration - * @{ - * @ingroup nrfx_pwm - */ -/** @brief - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_ENABLED -/** @brief Enable PWM0 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM0_ENABLED - -/** @brief Enable PWM1 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM1_ENABLED - -/** @brief Enable PWM2 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM2_ENABLED - -/** @brief Enable PWM3 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM3_ENABLED - -/** @brief Out0 pin - * - * Minimum value: 0 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN - -/** @brief Out1 pin - * - * Minimum value: 0 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN - -/** @brief Out2 pin - * - * Minimum value: 0 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN - -/** @brief Out3 pin - * - * Minimum value: 0 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN - -/** @brief Base clock - * - * Following options are available: - * - 0 - 16 MHz - * - 1 - 8 MHz - * - 2 - 4 MHz - * - 3 - 2 MHz - * - 4 - 1 MHz - * - 5 - 500 kHz - * - 6 - 250 kHz - * - 7 - 125 kHz - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK - -/** @brief Count mode - * - * Following options are available: - * - 0 - Up - * - 1 - Up and Down - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE - -/** @brief Top value - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE - -/** @brief Load mode - * - * Following options are available: - * - 0 - Common - * - 1 - Grouped - * - 2 - Individual - * - 3 - Waveform - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE - -/** @brief Step mode - * - * Following options are available: - * - 0 - Auto - * - 1 - Triggered - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_DEFAULT_CONFIG_STEP_MODE - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_CONFIG_DEBUG_COLOR - - -/** @brief Enables nRF52 Anomaly 109 workaround for PWM. - * - * The workaround uses interrupts to wake up the CPU and ensure - * it is active when PWM is about to start a DMA transfer. For - * initial transfer, done when a playback is started via PPI, - * a specific EGU instance is used to generate the interrupt. - * During the playback, the PWM interrupt triggered on SEQEND - * event of a preceding sequence is used to protect the transfer - * done for the next sequence to be played. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_NRF52_ANOMALY_109_WORKAROUND_ENABLED -/** @brief EGU instance used by the nRF52 Anomaly 109 workaround for PWM. - * - * Following options are available: - * - 0 - EGU0 - * - 1 - EGU1 - * - 2 - EGU2 - * - 3 - EGU3 - * - 4 - EGU4 - * - 5 - EGU5 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_PWM_NRF52_ANOMALY_109_EGU_INSTANCE - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_qdec_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_qdec_dox_config.h deleted file mode 100644 index 2a4363731..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_qdec_dox_config.h +++ /dev/null @@ -1,178 +0,0 @@ -/** - * - * @defgroup nrfx_qdec_config QDEC peripheral driver configuration - * @{ - * @ingroup nrfx_qdec - */ -/** @brief Enable QDEC driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_ENABLED -/** @brief Report period - * - * Following options are available: - * - 0 - 10 Samples - * - 1 - 40 Samples - * - 2 - 80 Samples - * - 3 - 120 Samples - * - 4 - 160 Samples - * - 5 - 200 Samples - * - 6 - 240 Samples - * - 7 - 280 Samples - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_REPORTPER - -/** @brief Sample period - * - * Following options are available: - * - 0 - 128 us - * - 1 - 256 us - * - 2 - 512 us - * - 3 - 1024 us - * - 4 - 2048 us - * - 5 - 4096 us - * - 6 - 8192 us - * - 7 - 16384 us - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_SAMPLEPER - -/** @brief A pin - * - * Minimum value: 0 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_PIO_A - -/** @brief B pin - * - * Minimum value: 0 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_PIO_B - -/** @brief LED pin - * - * Minimum value: 0 - * Maximum value: 31 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_PIO_LED - -/** @brief LED pre - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_LEDPRE - -/** @brief LED polarity - * - * Following options are available: - * - 0 - Active low - * - 1 - Active high - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_LEDPOL - -/** @brief Debouncing enable - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_DBFEN - -/** @brief Sample ready interrupt enable - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_SAMPLE_INTEN - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QDEC_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_qspi_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_qspi_dox_config.h deleted file mode 100644 index f89126747..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_qspi_dox_config.h +++ /dev/null @@ -1,170 +0,0 @@ -/** - * - * @defgroup nrfx_qspi_config QSPI peripheral driver configuration - * @{ - * @ingroup nrfx_qspi - */ -/** @brief Enable QSPI driver. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_ENABLED -/** @brief tSHSL, tWHSL and tSHWL in number of 16 MHz periods (62.5 ns). - * - * Minimum value: 0 - * Maximum value: 255 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_CONFIG_SCK_DELAY - -/** @brief Address offset in the external memory for Execute in Place operation. - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_CONFIG_XIP_OFFSET - -/** @brief Number of data lines and opcode used for reading. - * - * Following options are available: - * - 0 - FastRead - * - 1 - Read2O - * - 2 - Read2IO - * - 3 - Read4O - * - 4 - Read4IO - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_CONFIG_READOC - -/** @brief Number of data lines and opcode used for writing. - * - * Following options are available: - * - 0 - PP - * - 1 - PP2O - * - 2 - PP4O - * - 3 - PP4IO - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_CONFIG_WRITEOC - -/** @brief Addressing mode. - * - * Following options are available: - * - 0 - 24bit - * - 1 - 32bit - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_CONFIG_ADDRMODE - -/** @brief SPI mode. - * - * Following options are available: - * - 0 - Mode 0 - * - 1 - Mode 1 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_CONFIG_MODE - -/** @brief Frequency divider. - * - * Following options are available: - * - 0 - 32MHz/1 - * - 1 - 32MHz/2 - * - 2 - 32MHz/3 - * - 3 - 32MHz/4 - * - 4 - 32MHz/5 - * - 5 - 32MHz/6 - * - 6 - 32MHz/7 - * - 7 - 32MHz/8 - * - 8 - 32MHz/9 - * - 9 - 32MHz/10 - * - 10 - 32MHz/11 - * - 11 - 32MHz/12 - * - 12 - 32MHz/13 - * - 13 - 32MHz/14 - * - 14 - 32MHz/15 - * - 15 - 32MHz/16 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_CONFIG_FREQUENCY - -/** @brief SCK pin value. - * - * Minimum value: 0 - * Maximum value: 255 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_PIN_SCK - -/** @brief CSN pin value. - * - * Minimum value: 0 - * Maximum value: 255 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_PIN_CSN - -/** @brief IO0 pin value. - * - * Minimum value: 0 - * Maximum value: 255 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_PIN_IO0 - -/** @brief IO1 pin value. - * - * Minimum value: 0 - * Maximum value: 255 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_PIN_IO1 - -/** @brief IO2 pin value. - * - * Minimum value: 0 - * Maximum value: 255 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_PIN_IO2 - -/** @brief IO3 pin value. - * - * Minimum value: 0 - * Maximum value: 255 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_PIN_IO3 - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_QSPI_CONFIG_IRQ_PRIORITY - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_rng_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_rng_dox_config.h deleted file mode 100644 index 0fecf56b4..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_rng_dox_config.h +++ /dev/null @@ -1,94 +0,0 @@ -/** - * - * @defgroup nrfx_rng_config RNG peripheral driver configuration - * @{ - * @ingroup nrfx_rng - */ -/** @brief Enable RNG driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RNG_ENABLED -/** @brief Error correction - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RNG_CONFIG_ERROR_CORRECTION - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RNG_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RNG_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RNG_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RNG_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RNG_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_rtc_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_rtc_dox_config.h deleted file mode 100644 index ded1885b0..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_rtc_dox_config.h +++ /dev/null @@ -1,134 +0,0 @@ -/** - * - * @defgroup nrfx_rtc_config RTC peripheral driver configuration - * @{ - * @ingroup nrfx_rtc - */ -/** @brief - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC_ENABLED -/** @brief Enable RTC0 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC0_ENABLED - -/** @brief Enable RTC1 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC1_ENABLED - -/** @brief Enable RTC2 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC2_ENABLED - -/** @brief Maximum possible time[us] in highest priority interrupt - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC_MAXIMUM_LATENCY_US - -/** @brief Frequency - * - * Minimum value: 16 - * Maximum value: 32768 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC_DEFAULT_CONFIG_FREQUENCY - -/** @brief Ensures safe compare event triggering - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC_DEFAULT_CONFIG_RELIABLE - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_RTC_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_saadc_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_saadc_dox_config.h deleted file mode 100644 index 39011f2c9..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_saadc_dox_config.h +++ /dev/null @@ -1,123 +0,0 @@ -/** - * - * @defgroup nrfx_saadc_config SAADC peripheral driver configuration - * @{ - * @ingroup nrfx_saadc - */ -/** @brief Enable SAADC driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SAADC_ENABLED -/** @brief Resolution - * - * Following options are available: - * - 0 - 8 bit - * - 1 - 10 bit - * - 2 - 12 bit - * - 3 - 14 bit - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SAADC_CONFIG_RESOLUTION - -/** @brief Sample period - * - * Following options are available: - * - 0 - Disabled - * - 1 - 2x - * - 2 - 4x - * - 3 - 8x - * - 4 - 16x - * - 5 - 32x - * - 6 - 64x - * - 7 - 128x - * - 8 - 256x - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SAADC_CONFIG_OVERSAMPLE - -/** @brief Enabling low power mode - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SAADC_CONFIG_LP_MODE - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SAADC_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SAADC_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SAADC_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SAADC_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SAADC_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spi_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spi_dox_config.h deleted file mode 100644 index 29b647d1a..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spi_dox_config.h +++ /dev/null @@ -1,121 +0,0 @@ -/** - * - * @defgroup nrfx_spi_config SPI peripheral driver configuration - * @{ - * @ingroup nrfx_spi - */ -/** @brief - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPI_ENABLED -/** @brief Enable SPI0 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPI0_ENABLED - -/** @brief Enable SPI1 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPI1_ENABLED - -/** @brief Enable SPI2 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPI2_ENABLED - -/** @brief MISO pin pull configuration. - * - * Following options are available: - * - 0 - NRF_GPIO_PIN_NOPULL - * - 1 - NRF_GPIO_PIN_PULLDOWN - * - 3 - NRF_GPIO_PIN_PULLUP - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPI_MISO_PULL_CFG - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPI_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPI_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPI_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPI_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spim_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spim_dox_config.h deleted file mode 100644 index 0ff821057..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spim_dox_config.h +++ /dev/null @@ -1,163 +0,0 @@ -/** - * - * @defgroup nrfx_spim_config SPIM peripheral driver configuration - * @{ - * @ingroup nrfx_spim - */ -/** @brief - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM_ENABLED -/** @brief Enable SPIM0 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM0_ENABLED - -/** @brief Enable SPIM1 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM1_ENABLED - -/** @brief Enable SPIM2 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM2_ENABLED - -/** @brief Enable SPIM3 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM3_ENABLED - -/** @brief Enable extended SPIM features - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM_EXTENDED_ENABLED - -/** @brief MISO pin pull configuration. - * - * Following options are available: - * - 0 - NRF_GPIO_PIN_NOPULL - * - 1 - NRF_GPIO_PIN_PULLDOWN - * - 3 - NRF_GPIO_PIN_PULLUP - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM_MISO_PULL_CFG - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM_CONFIG_DEBUG_COLOR - - -/** @brief Enables nRF52 anomaly 109 workaround for SPIM. - * - * The workaround uses interrupts to wake up the CPU by catching - * a start event of zero-length transmission to start the clock. This - * ensures that the DMA transfer will be executed without issues and - * that the proper transfer will be started. See more in the Errata - * document or Anomaly 109 Addendum located at - * https://infocenter.nordicsemi.com/ - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED - -/** @brief Enables nRF52840 anomaly 198 workaround for SPIM3. - * - * See more in the Errata document located at - * https://infocenter.nordicsemi.com/ - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spis_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spis_dox_config.h deleted file mode 100644 index df51d2bed..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_spis_dox_config.h +++ /dev/null @@ -1,143 +0,0 @@ -/** - * - * @defgroup nrfx_spis_config SPIS peripheral driver configuration - * @{ - * @ingroup nrfx_spis - */ -/** @brief - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS_ENABLED -/** @brief Enable SPIS0 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS0_ENABLED - -/** @brief Enable SPIS1 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS1_ENABLED - -/** @brief Enable SPIS2 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS2_ENABLED - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief SPIS default DEF character - * - * Minimum value: 0 - * Maximum value: 255 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS_DEFAULT_DEF - -/** @brief SPIS default ORC character - * - * Minimum value: 0 - * Maximum value: 255 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS_DEFAULT_ORC - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS_CONFIG_DEBUG_COLOR - - -/** @brief Enables nRF52 Anomaly 109 workaround for SPIS. - * - * The workaround uses a GPIOTE channel to generate interrupts - * on falling edges detected on the CSN line. This will make - * the CPU active for the moment when SPIS starts DMA transfers, - * and this way the transfers will be protected. - * This workaround uses GPIOTE driver, so this driver must be - * enabled as well. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SPIS_NRF52_ANOMALY_109_WORKAROUND_ENABLED - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_swi_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_swi_dox_config.h deleted file mode 100644 index cf9a69f28..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_swi_dox_config.h +++ /dev/null @@ -1,126 +0,0 @@ -/** - * - * @defgroup nrfx_swi_config SWI/EGU peripheral allocator configuration - * @{ - * @ingroup nrfx_swi - */ -/** @brief Enable SWI/EGU allocator - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI_ENABLED -/** @brief Enable EGU support - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_EGU_ENABLED - -/** @brief Exclude SWI0 from being utilized by the driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI0_DISABLED - -/** @brief Exclude SWI1 from being utilized by the driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI1_DISABLED - -/** @brief Exclude SWI2 from being utilized by the driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI2_DISABLED - -/** @brief Exclude SWI3 from being utilized by the driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI3_DISABLED - -/** @brief Exclude SWI4 from being utilized by the driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI4_DISABLED - -/** @brief Exclude SWI5 from being utilized by the driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI5_DISABLED - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SWI_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_systick_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_systick_dox_config.h deleted file mode 100644 index b3c5feafb..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_systick_dox_config.h +++ /dev/null @@ -1,15 +0,0 @@ -/** - * - * @defgroup nrfx_systick_config ARM(R) SysTick driver configuration - * @{ - * @ingroup nrfx_systick - */ -/** @brief - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_SYSTICK_ENABLED - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_timer_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_timer_dox_config.h deleted file mode 100644 index 6d449eab0..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_timer_dox_config.h +++ /dev/null @@ -1,166 +0,0 @@ -/** - * - * @defgroup nrfx_timer_config TIMER periperal driver configuration - * @{ - * @ingroup nrfx_timer - */ -/** @brief - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER_ENABLED -/** @brief Enable TIMER0 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER0_ENABLED - -/** @brief Enable TIMER1 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER1_ENABLED - -/** @brief Enable TIMER2 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER2_ENABLED - -/** @brief Enable TIMER3 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER3_ENABLED - -/** @brief Enable TIMER4 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER4_ENABLED - -/** @brief Timer frequency if in Timer mode - * - * Following options are available: - * - 0 - 16 MHz - * - 1 - 8 MHz - * - 2 - 4 MHz - * - 3 - 2 MHz - * - 4 - 1 MHz - * - 5 - 500 kHz - * - 6 - 250 kHz - * - 7 - 125 kHz - * - 8 - 62.5 kHz - * - 9 - 31.25 kHz - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY - -/** @brief Timer mode or operation - * - * Following options are available: - * - 0 - Timer - * - 1 - Counter - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER_DEFAULT_CONFIG_MODE - -/** @brief Timer counter bit width - * - * Following options are available: - * - 0 - 16 bit - * - 1 - 8 bit - * - 2 - 24 bit - * - 3 - 32 bit - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TIMER_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twi_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twi_dox_config.h deleted file mode 100644 index 40c13d110..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twi_dox_config.h +++ /dev/null @@ -1,121 +0,0 @@ -/** - * - * @defgroup nrfx_twi_config TWI peripheral driver configuration - * @{ - * @ingroup nrfx_twi - */ -/** @brief - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWI_ENABLED -/** @brief Enable TWI0 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWI0_ENABLED - -/** @brief Enable TWI1 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWI1_ENABLED - -/** @brief Frequency - * - * Following options are available: - * - 26738688 - 100k - * - 67108864 - 250k - * - 104857600 - 400k - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWI_DEFAULT_CONFIG_FREQUENCY - -/** @brief Enables bus holding after uninit - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWI_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWI_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWI_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWI_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twim_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twim_dox_config.h deleted file mode 100644 index 5cb662035..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twim_dox_config.h +++ /dev/null @@ -1,135 +0,0 @@ -/** - * - * @defgroup nrfx_twim_config TWIM peripheral driver configuration - * @{ - * @ingroup nrfx_twim - */ -/** @brief - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM_ENABLED -/** @brief Enable TWIM0 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM0_ENABLED - -/** @brief Enable TWIM1 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM1_ENABLED - -/** @brief Frequency - * - * Following options are available: - * - 26738688 - 100k - * - 67108864 - 250k - * - 104857600 - 400k - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY - -/** @brief Enables bus holding after uninit - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM_CONFIG_DEBUG_COLOR - - -/** @brief Enables nRF52 anomaly 109 workaround for TWIM. - * - * The workaround uses interrupts to wake up the CPU by catching - * the start event of zero-frequency transmission, clear the - * peripheral, set desired frequency, start the peripheral, and - * the proper transmission. See more in the Errata document or - * Anomaly 109 Addendum located at https://infocenter.nordicsemi.com/ - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIM_NRF52_ANOMALY_109_WORKAROUND_ENABLED - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twis_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twis_dox_config.h deleted file mode 100644 index dca95b3e1..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_twis_dox_config.h +++ /dev/null @@ -1,158 +0,0 @@ -/** - * - * @defgroup nrfx_twis_config TWIS peripheral driver configuration - * @{ - * @ingroup nrfx_twis - */ -/** @brief - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_ENABLED -/** @brief Enable TWIS0 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS0_ENABLED - -/** @brief Enable TWIS1 instance - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS1_ENABLED - -/** @brief Assume that any instance would be initialized only once - * - * Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY - -/** @brief Remove support for synchronous mode - * - * Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_NO_SYNC_MODE - -/** @brief Address0 - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_DEFAULT_CONFIG_ADDR0 - -/** @brief Address1 - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_DEFAULT_CONFIG_ADDR1 - -/** @brief SCL pin pull configuration - * - * Following options are available: - * - 0 - Disabled - * - 1 - Pull down - * - 3 - Pull up - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL - -/** @brief SDA pin pull configuration - * - * Following options are available: - * - 0 - Disabled - * - 1 - Pull down - * - 3 - Pull up - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_TWIS_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_uart_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_uart_dox_config.h deleted file mode 100644 index d24bd8b8e..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_uart_dox_config.h +++ /dev/null @@ -1,139 +0,0 @@ -/** - * - * @defgroup nrfx_uart_config UART peripheral driver configuration - * @{ - * @ingroup nrfx_uart - */ -/** @brief Enable UART driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UART_ENABLED -/** @brief Enable UART0 instance - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UART0_ENABLED - -/** @brief Hardware Flow Control - * - * Following options are available: - * - 0 - Disabled - * - 1 - Enabled - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UART_DEFAULT_CONFIG_HWFC - -/** @brief Parity - * - * Following options are available: - * - 0 - Excluded - * - 14 - Included - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UART_DEFAULT_CONFIG_PARITY - -/** @brief Default Baudrate - * - * Following options are available: - * - 323584 - 1200 baud - * - 643072 - 2400 baud - * - 1290240 - 4800 baud - * - 2576384 - 9600 baud - * - 3866624 - 14400 baud - * - 5152768 - 19200 baud - * - 7729152 - 28800 baud - * - 8388608 - 31250 baud - * - 10309632 - 38400 baud - * - 15007744 - 56000 baud - * - 15462400 - 57600 baud - * - 20615168 - 76800 baud - * - 30924800 - 115200 baud - * - 61845504 - 230400 baud - * - 67108864 - 250000 baud - * - 123695104 - 460800 baud - * - 247386112 - 921600 baud - * - 268435456 - 1000000 baud - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UART_DEFAULT_CONFIG_BAUDRATE - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UART_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UART_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UART_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UART_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_uarte_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_uarte_dox_config.h deleted file mode 100644 index 08a3fc178..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_uarte_dox_config.h +++ /dev/null @@ -1,146 +0,0 @@ -/** - * - * @defgroup nrfx_uarte_config UARTE peripheral driver configuration - * @{ - * @ingroup nrfx_uarte - */ -/** @brief Enable UARTE driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE_ENABLED -/** @brief Enable UARTE0 instance - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE0_ENABLED - -/** @brief Enable UARTE1 instance - * - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE1_ENABLED - -/** @brief Hardware Flow Control - * - * Following options are available: - * - 0 - Disabled - * - 1 - Enabled - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE_DEFAULT_CONFIG_HWFC - -/** @brief Parity - * - * Following options are available: - * - 0 - Excluded - * - 14 - Included - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE_DEFAULT_CONFIG_PARITY - -/** @brief Default Baudrate - * - * Following options are available: - * - 323584 - 1200 baud - * - 643072 - 2400 baud - * - 1290240 - 4800 baud - * - 2576384 - 9600 baud - * - 3862528 - 14400 baud - * - 5152768 - 19200 baud - * - 7716864 - 28800 baud - * - 8388608 - 31250 baud - * - 10289152 - 38400 baud - * - 15007744 - 56000 baud - * - 15400960 - 57600 baud - * - 20615168 - 76800 baud - * - 30801920 - 115200 baud - * - 61865984 - 230400 baud - * - 67108864 - 250000 baud - * - 121634816 - 460800 baud - * - 251658240 - 921600 baud - * - 268435456 - 1000000 baud - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_UARTE_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_usbd_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_usbd_dox_config.h deleted file mode 100644 index 29f4e4e44..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_usbd_dox_config.h +++ /dev/null @@ -1,56 +0,0 @@ -/** - * - * @defgroup nrfx_usbd_config USBD peripheral driver configuration - * @{ - * @ingroup nrfx_usbd - */ -/** @brief Enable USB driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_USBD_ENABLED -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 - * - 5 - 5 - * - 6 - 6 - * - 7 - 7 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_USBD_CONFIG_IRQ_PRIORITY - -/** @brief Give priority to isochronous transfers - * - * This option gives priority to isochronous transfers. - * Enabling it assures that isochronous transfers are always processed, - * even if multiple other transfers are pending. - * Isochronous endpoints are prioritized before the usbd_dma_scheduler_algorithm - * function is called, so the option is independent of the algorithm chosen. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST - -/** @brief Respond to an IN token on ISO IN endpoint with ZLP when no data is ready - * - * If set, ISO IN endpoint will respond to an IN token with ZLP when no data is ready to be sent. - * Else, there will be no response. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_USBD_CONFIG_ISO_IN_ZLP - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_wdt_dox_config.h b/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_wdt_dox_config.h deleted file mode 100644 index 5399a4c89..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/config_dox/nrfx_wdt_dox_config.h +++ /dev/null @@ -1,117 +0,0 @@ -/** - * - * @defgroup nrfx_wdt_config WDT peripheral driver configuration - * @{ - * @ingroup nrfx_wdt - */ -/** @brief Enable WDT driver - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_WDT_ENABLED -/** @brief WDT behavior in CPU SLEEP or HALT mode - * - * Following options are available: - * - 1 - Run in SLEEP, Pause in HALT - * - 8 - Pause in SLEEP, Run in HALT - * - 9 - Run in SLEEP and HALT - * - 0 - Pause in SLEEP and HALT - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_WDT_CONFIG_BEHAVIOUR - -/** @brief Reload value - * - * Minimum value: 15 - * Maximum value: 4294967295 - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_WDT_CONFIG_RELOAD_VALUE - -/** @brief Remove WDT IRQ handling from WDT driver - * - * Following options are available: - * - 0 - Include WDT IRQ handling - * - 1 - Remove WDT IRQ handling - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_WDT_CONFIG_NO_IRQ - -/** @brief Interrupt priority - * - * Following options are available: - * - 0 - 0 (highest) - * - 1 - 1 - * - 2 - 2 - * - 3 - 3 - * - 4 - 4 (Not applicable for nRF51) - * - 5 - 5 (Not applicable for nRF51) - * - 6 - 6 (Not applicable for nRF51) - * - 7 - 7 (Not applicable for nRF51) - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_WDT_CONFIG_IRQ_PRIORITY - -/** @brief Enables logging in the module. - * - * Set to 1 to activate. - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_WDT_CONFIG_LOG_ENABLED -/** @brief Default Severity level - * - * Following options are available: - * - 0 - Off - * - 1 - Error - * - 2 - Warning - * - 3 - Info - * - 4 - Debug - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_WDT_CONFIG_LOG_LEVEL - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_WDT_CONFIG_INFO_COLOR - -/** @brief ANSI escape code prefix. - * - * Following options are available: - * - 0 - Default - * - 1 - Black - * - 2 - Red - * - 3 - Green - * - 4 - Yellow - * - 5 - Blue - * - 6 - Magenta - * - 7 - Cyan - * - 8 - White - * - * @note This is an NRF_CONFIG macro. - */ -#define NRFX_WDT_CONFIG_DEBUG_COLOR - - - -/** @} */ diff --git a/third_party/NordicSemiconductor/nrfx/doc/drv_supp_matrix.dox b/third_party/NordicSemiconductor/nrfx/doc/drv_supp_matrix.dox deleted file mode 100644 index de320a6a2..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/drv_supp_matrix.dox +++ /dev/null @@ -1,55 +0,0 @@ -/** -@page nrfx_drv_supp_matrix Driver support matrix -The following matrix shows which drivers are supported by specific Nordic SoCs. -@{ - -Driver | nRF51 Series | nRF52810/nRF52811 | nRF52832 | nRF52833 | nRF52840 | nRF9160 | ------------------|--------------|-------------------| -------------| -------------| -------------| -------------| -@ref nrf_aar |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_adc |@tagGreenTick |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross | -@ref nrf_acl |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_bprot |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagRedCross |@tagRedCross |@tagRedCross | -@ref nrf_ccm |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_clock |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_comp |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_dppi |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick | -@ref nrf_ecb |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_ficr |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_gpio |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_gpiote |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_i2s |@tagRedCross |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_kmu |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick | -@ref nrf_lpcomp |@tagGreenTick |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_mpu |@tagGreenTick |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross | -@ref nrf_mwu |@tagRedCross |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_nfct |@tagRedCross |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_nvmc |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_pdm |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_power |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_ppi |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_pwm |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_qdec |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_qspi |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick |@tagRedCross | -@ref nrf_radio |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_rng |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_rtc |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_saadc |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_spi |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_spim |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_spis |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_spu |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick | -@ref nrf_systick |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_swi_egu |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_temp |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_timer |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_twi |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_twim |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_twis |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_uart |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_uarte |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | -@ref nrf_usbd |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick |@tagGreenTick |@tagRedCross | -@ref nrf_vmc |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagRedCross |@tagGreenTick | -@ref nrf_wdt |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick |@tagGreenTick | - -@} -*/ diff --git a/third_party/NordicSemiconductor/nrfx/doc/generate_html_doc.bat b/third_party/NordicSemiconductor/nrfx/doc/generate_html_doc.bat deleted file mode 100644 index f63b3e794..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/generate_html_doc.bat +++ /dev/null @@ -1,2 +0,0 @@ -del html\*.* /Q -doxygen nrfx.doxyfile diff --git a/third_party/NordicSemiconductor/nrfx/doc/generate_html_doc.sh b/third_party/NordicSemiconductor/nrfx/doc/generate_html_doc.sh deleted file mode 100755 index 9cc608c6d..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/generate_html_doc.sh +++ /dev/null @@ -1,2 +0,0 @@ -rm -rf html -doxygen nrfx.doxyfile diff --git a/third_party/NordicSemiconductor/nrfx/doc/main_page.dox b/third_party/NordicSemiconductor/nrfx/doc/main_page.dox deleted file mode 100644 index 6ff79d713..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/main_page.dox +++ /dev/null @@ -1,89 +0,0 @@ -/** -@mainpage Introduction - -@em nrfx is a standalone set of drivers for peripherals present in Nordic -Semiconductor's SoCs. It originated as an extract from the nRF5 SDK. -The intention was to provide drivers that can be used in various environments -without the necessity to integrate other parts of the SDK into them. -For the user's convenience, the drivers come with the MDK package. This package -contains definitions of register structures and bitfields for all supported -SoCs, as well as startup and initialization files for them. - -Refer to the @ref nrfx_drv_supp_matrix to check which drivers are suitable -for a given SoC. - -@section nrfx_integration Integration - -The purpose of @em nrfx is to make it possible to use the same set of peripheral -drivers in various environments, from RTOSes to bare metal applications. -Hence, for a given host environment, a light integration layer must be provided -that implements certain specific routines, like interrupt management, critical -sections, assertions, or logging. This is done by filling a predefined set of -macros with proper implementations (or keeping some empty if desired) in files -named: -- @ref nrfx_glue -- @ref nrfx_log - -Templates of these files are provided -in the templates subfolder. Their customized -versions can be placed in any location within the host environment that the -used compiler can access via include paths. - -In addition, the following locations should be specified as include paths -([nrfx] stands for the @em nrfx root folder location): -@code -[nrfx]/ -[nrfx]/drivers/include -[nrfx]/mdk -@endcode - -@section nrfx_irq_handlers IRQ handlers - -The IRQ handlers in all drivers are implemented as ordinary API functions -named "nrfx_*_irq_handler". They can be bound to some structures or called in -a specific way according to the requirements of the host environment. -To install the handlers in the standard MDK way, you must only add the following -line to the @ref nrfx_glue file: - -@code -#include -@endcode - -This will cause the preprocessor to properly rename all the IRQ handler -functions so that the linker could install them in the vector table. - -@section nrfx_configuration Configuration - -The drivers use both dynamic (run time) and static (compile time) configuration. - -Dynamic configuration is done by specifying desired options in configuration -structures passed to the drivers during their initialization. -Refer to the API reference for a given driver to see the members of its -configuration structure. - -Static configuration allows enabling and disabling (excluding their code from -compilation) particular drivers or in some cases their specific features, -defining default parameters for dynamic configuration, parametrization of -logging in particular drivers. It is done by specifying desired values of macros -in a file named: - -- nrfx_config.h - -This file, similarly to the integration files mentioned above, can be placed -in any suitable location within the host environment. -The templates subfolder contains templates of -configuration files for all currently supported Nordic SoCs placed in respective -subfolders. -Refer to the "driver configuration" section in the API reference for a given -driver for more information regarding configuration options available for it. - -@section nrfx_additional_reqs Additional requirements - -Nordic SoCs are based on ARM® Cortex™-M series processors. Before you can -start developing with @em nrfx, you must add the CMSIS header files to include -paths during the compilation process. Download these files from the following -website: - -- ARM® CMSIS repository -(CMSIS/Include directory) -*/ diff --git a/third_party/NordicSemiconductor/nrfx/doc/nrf51_series.dox b/third_party/NordicSemiconductor/nrfx/doc/nrf51_series.dox deleted file mode 100644 index 3f8201f0e..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/nrf51_series.dox +++ /dev/null @@ -1,56 +0,0 @@ -/** -@page nrf51_series_drivers nRF51 Series Drivers -@{ - -@ref nrf_aar - -@ref nrf_adc - -@ref nrf_ccm - -@ref nrf_clock - -@ref nrf_ecb - -@ref nrf_ficr - -@ref nrf_gpio - -@ref nrf_gpiote - -@ref nrf_lpcomp - -@ref nrf_mpu - -@ref nrf_nvmc - -@ref nrf_power - -@ref nrf_ppi - -@ref nrf_qdec - -@ref nrf_radio - -@ref nrf_rng - -@ref nrf_rtc - -@ref nrf_spi - -@ref nrf_spis - -@ref nrf_swi_egu - -@ref nrf_temp - -@ref nrf_timer - -@ref nrf_twi - -@ref nrf_uart - -@ref nrf_wdt - -@} -*/ diff --git a/third_party/NordicSemiconductor/nrfx/doc/nrf52810.dox b/third_party/NordicSemiconductor/nrfx/doc/nrf52810.dox deleted file mode 100644 index 6aba43421..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/nrf52810.dox +++ /dev/null @@ -1,70 +0,0 @@ -/** -@page nrf52810_drivers nRF52810/nRF52811 Drivers -@{ - -@ref nrf_aar - -@ref nrf_bprot - -@ref nrf_ccm - -@ref nrf_clock - -@ref nrf_comp - -@ref nrf_ecb - -@ref nrf_ficr - -@ref nrf_gpio - -@ref nrf_gpiote - -@ref nrf_nvmc - -@ref nrf_pdm - -@ref nrf_power - -@ref nrf_ppi - -@ref nrf_pwm - -@ref nrf_qdec - -@ref nrf_radio - -@ref nrf_rng - -@ref nrf_rtc - -@ref nrf_saadc - -@ref nrf_spi - -@ref nrf_spim - -@ref nrf_spis - -@ref nrf_systick - -@ref nrf_swi_egu - -@ref nrf_temp - -@ref nrf_timer - -@ref nrf_twi - -@ref nrf_twim - -@ref nrf_twis - -@ref nrf_uart - -@ref nrf_uarte - -@ref nrf_wdt - -@} -*/ diff --git a/third_party/NordicSemiconductor/nrfx/doc/nrf52832.dox b/third_party/NordicSemiconductor/nrfx/doc/nrf52832.dox deleted file mode 100644 index 58f3bbda9..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/nrf52832.dox +++ /dev/null @@ -1,78 +0,0 @@ -/** -@page nrf52832_drivers nRF52832 Drivers -@{ - -@ref nrf_aar - -@ref nrf_bprot - -@ref nrf_ccm - -@ref nrf_clock - -@ref nrf_comp - -@ref nrf_ecb - -@ref nrf_ficr - -@ref nrf_gpio - -@ref nrf_gpiote - -@ref nrf_i2s - -@ref nrf_lpcomp - -@ref nrf_mwu - -@ref nrf_nfct - -@ref nrf_nvmc - -@ref nrf_pdm - -@ref nrf_power - -@ref nrf_ppi - -@ref nrf_pwm - -@ref nrf_qdec - -@ref nrf_radio - -@ref nrf_rng - -@ref nrf_rtc - -@ref nrf_saadc - -@ref nrf_spi - -@ref nrf_spim - -@ref nrf_spis - -@ref nrf_systick - -@ref nrf_swi_egu - -@ref nrf_temp - -@ref nrf_timer - -@ref nrf_twi - -@ref nrf_twim - -@ref nrf_twis - -@ref nrf_uart - -@ref nrf_uarte - -@ref nrf_wdt - -@} -*/ diff --git a/third_party/NordicSemiconductor/nrfx/doc/nrf52833.dox b/third_party/NordicSemiconductor/nrfx/doc/nrf52833.dox deleted file mode 100644 index d2637d98a..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/nrf52833.dox +++ /dev/null @@ -1,80 +0,0 @@ -/** -@page nrf52833_drivers nRF52833 Drivers -@{ - -@ref nrf_aar - -@ref nrf_acl - -@ref nrf_ccm - -@ref nrf_clock - -@ref nrf_comp - -@ref nrf_ecb - -@ref nrf_ficr - -@ref nrf_gpio - -@ref nrf_gpiote - -@ref nrf_i2s - -@ref nrf_lpcomp - -@ref nrf_mwu - -@ref nrf_nfct - -@ref nrf_nvmc - -@ref nrf_pdm - -@ref nrf_power - -@ref nrf_ppi - -@ref nrf_pwm - -@ref nrf_qdec - -@ref nrf_radio - -@ref nrf_rng - -@ref nrf_rtc - -@ref nrf_saadc - -@ref nrf_spi - -@ref nrf_spim - -@ref nrf_spis - -@ref nrf_systick - -@ref nrf_swi_egu - -@ref nrf_temp - -@ref nrf_timer - -@ref nrf_twi - -@ref nrf_twim - -@ref nrf_twis - -@ref nrf_uart - -@ref nrf_uarte - -@ref nrf_usbd - -@ref nrf_wdt - -@} -*/ diff --git a/third_party/NordicSemiconductor/nrfx/doc/nrf52840.dox b/third_party/NordicSemiconductor/nrfx/doc/nrf52840.dox deleted file mode 100644 index 7e9b51ece..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/nrf52840.dox +++ /dev/null @@ -1,82 +0,0 @@ -/** -@page nrf52840_drivers nRF52840 Drivers -@{ - -@ref nrf_aar - -@ref nrf_acl - -@ref nrf_ccm - -@ref nrf_clock - -@ref nrf_comp - -@ref nrf_ecb - -@ref nrf_ficr - -@ref nrf_gpio - -@ref nrf_gpiote - -@ref nrf_i2s - -@ref nrf_lpcomp - -@ref nrf_mwu - -@ref nrf_nfct - -@ref nrf_nvmc - -@ref nrf_pdm - -@ref nrf_power - -@ref nrf_ppi - -@ref nrf_pwm - -@ref nrf_qdec - -@ref nrf_qspi - -@ref nrf_radio - -@ref nrf_rng - -@ref nrf_rtc - -@ref nrf_saadc - -@ref nrf_spi - -@ref nrf_spim - -@ref nrf_spis - -@ref nrf_systick - -@ref nrf_swi_egu - -@ref nrf_temp - -@ref nrf_timer - -@ref nrf_twi - -@ref nrf_twim - -@ref nrf_twis - -@ref nrf_uart - -@ref nrf_uarte - -@ref nrf_usbd - -@ref nrf_wdt - -@} -*/ diff --git a/third_party/NordicSemiconductor/nrfx/doc/nrf9160.dox b/third_party/NordicSemiconductor/nrfx/doc/nrf9160.dox deleted file mode 100644 index fd929ad0e..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/nrf9160.dox +++ /dev/null @@ -1,54 +0,0 @@ -/** -@page nrf9160_drivers nRF9160 drivers -@{ - -@ref nrf_clock - -@ref nrf_systick - -@ref nrf_dppi - -@ref nrf_ficr - -@ref nrf_gpio - -@ref nrf_gpiote - -@ref nrf_i2s - -@ref nrf_kmu - -@ref nrf_nvmc - -@ref nrf_pdm - -@ref nrf_power - -@ref nrf_pwm - -@ref nrf_rtc - -@ref nrf_saadc - -@ref nrf_spim - -@ref nrf_spis - -@ref nrf_spu - -@ref nrf_swi_egu - -@ref nrf_timer - -@ref nrf_twim - -@ref nrf_twis - -@ref nrf_uarte - -@ref nrf_vmc - -@ref nrf_wdt - -@} -*/ diff --git a/third_party/NordicSemiconductor/nrfx/doc/nrfx.doxyfile b/third_party/NordicSemiconductor/nrfx/doc/nrfx.doxyfile deleted file mode 100644 index 3bf06cc2d..000000000 --- a/third_party/NordicSemiconductor/nrfx/doc/nrfx.doxyfile +++ /dev/null @@ -1,2505 +0,0 @@ -# Doxyfile 1.8.14 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See -# https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "nrfx" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -### EDIT THIS ### - -PROJECT_NUMBER = "1.8" - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -### EDIT THIS ### - -PROJECT_BRIEF = - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = buildfiles/nordic_small.png - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -### EDIT THIS ### - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -#ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = .. - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines (in the resulting output). You can put ^^ in the value part of an -# alias to insert a newline as if a physical newline was in the original file. - -ALIASES = "tagGreenTick=@htmlonly
✔
@endhtmlonly" \ - "tagRedCross=@htmlonly
✖
@endhtmlonly" \ - "linkProductSpecification52=[nRF52840 Product Specification](http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52/dita/nrf52/chips/nrf52840_ps.html) or [nRF52832 Product Specification](http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52/dita/nrf52/chips/nrf52832_ps.html)" - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up -# to that level are automatically included in the table of contents, even if -# they do not have an id attribute. -# Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. -# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. - -#TOC_INCLUDE_HEADINGS = 0 - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# If one adds a struct or class to a group and this option is enabled, then also -# any nested class or struct is added to the same group. By default this option -# is disabled and one has to add nested compounds explicitly via \ingroup. -# The default value is: NO. - -#GROUP_NESTED_COMPOUNDS = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -#HIDE_COMPOUND_REFERENCE= NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -#SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = NO - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = buildfiles/layout.xml - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = YES - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. -# The default value is: NO. - -#WARN_AS_ERROR = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = warnings_nrfx.txt - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING -# Note: If this tag is empty the current directory is searched. - -### EDIT THIS ### - -INPUT = ../helpers \ - ../drivers \ - ../hal \ - ../soc \ - ../templates \ - config_dox \ - . - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: https://www.gnu.org/software/libiconv/) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# read by doxygen. -# -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. - -FILE_PATTERNS = *.h \ - *.dox - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = NO - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -#SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see https://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = NO - -# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the -# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the -# cost of reduced performance. This can be particularly helpful with template -# rich C++ code for which doxygen's built-in parser lacks the necessary type -# information. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. -# The default value is: NO. - -#CLANG_ASSISTED_PARSING = NO - -# If clang assisted parsing is enabled you can provide the compiler with command -# line options that you would normally use when invoking the compiler. Note that -# the include paths will already be set by doxygen for the files and directories -# specified with INPUT and INCLUDE_PATH. -# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. - -#CLANG_OPTIONS = - -# If clang assisted parsing is enabled you can provide the clang parser with the -# path to the compilation database (see: -# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files -# were built. This is equivalent to specifying the "-p" option to a clang tool, -# such as clang-check. These options will then be passed to the parser. -# Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. -# The default value is: 0. - -#CLANG_COMPILATION_DATABASE_PATH = 0 - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = NO - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = buildfiles/header.html - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = buildfiles/footer.html - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = buildfiles/extra_stylesheet.css - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = buildfiles/favicon.ico - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# https://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 196 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 46 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 92 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML -# documentation will contain a main index with vertical navigation menus that -# are dynamically created via Javascript. If disabled, the navigation index will -# consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have Javascript, -# like the Qt help browser. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -#HTML_DYNAMIC_MENUS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = YES - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = com.nordic.infocenter.nrfx - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -### EDIT THIS ### - -DISABLE_INDEX = YES - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 1 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. -# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -#MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /